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 |
---|---|---|---|---|---|---|
Remove the specified resource from storage. | public function destroy($id)
{
$student = Student::find($id);
if ($student == null) {
Student::withTrashed()->find($id)->restore();
}else{
$student->delete();
}
// Return
return redirect()->route('students.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 |
Show the form for creating a new resource. | public function create()
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view('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\t{\n\t\treturn view('loisier/create');\n\t}",
"public function create()\n {\n return view('url.form');\n }",
"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\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 {\n return view('saldo.form');\n }",
"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 $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\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 {\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\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"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.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.7174283",
"0.7150356",
"0.71444064",
"0.71442676",
"0.713498",
"0.71283126",
"0.7123691",
"0.71158516",
"0.71158516",
"0.71158516",
"0.7112176",
"0.7094388",
"0.7085711",
"0.708025",
"0.70800644",
"0.70571953",
"0.70571953",
"0.70556754",
"0.70396435",
"0.7039549",
"0.7036275",
"0.703468",
"0.70305896",
"0.7027638",
"0.70265305",
"0.70199823",
"0.7018007",
"0.7004984",
"0.7003889",
"0.7000935",
"0.69973785",
"0.6994679",
"0.6993764",
"0.6989918",
"0.6986989",
"0.6966502",
"0.69656384",
"0.69564354",
"0.69518244",
"0.6951109",
"0.6947306",
"0.69444615",
"0.69423944",
"0.6941156",
"0.6937871",
"0.6937871",
"0.6936686",
"0.69345254",
"0.69318026",
"0.692827",
"0.69263744",
"0.69242257",
"0.6918349",
"0.6915889",
"0.6912884",
"0.691146",
"0.69103104",
"0.69085974",
"0.69040126",
"0.69014287",
"0.69012105",
"0.6900397",
"0.68951064",
"0.6893521",
"0.68932164",
"0.6891899",
"0.6891616",
"0.6891616",
"0.6889246",
"0.68880934",
"0.6887128",
"0.6884732",
"0.68822503",
"0.68809193",
"0.6875949",
"0.68739206",
"0.68739134",
"0.6870358",
"0.6869779",
"0.68696856",
"0.686877"
]
| 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $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($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($id)\n {\n return view('cataloguemodule::edit');\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 $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 displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\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($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\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(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"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 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\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.78561044",
"0.7695814",
"0.72755414",
"0.72429216",
"0.71737534",
"0.7064628",
"0.7056257",
"0.69859976",
"0.6949863",
"0.6948435",
"0.6942811",
"0.69298875",
"0.69032556",
"0.6900465",
"0.6900465",
"0.6880163",
"0.6865618",
"0.68620205",
"0.6859499",
"0.6847944",
"0.6837563",
"0.6812879",
"0.68089813",
"0.6808603",
"0.68049484",
"0.67966837",
"0.6795056",
"0.6795056",
"0.67909557",
"0.6787095",
"0.67825735",
"0.67783386",
"0.6771208",
"0.67658216",
"0.67488056",
"0.67488056",
"0.67481846",
"0.67474896",
"0.67430425",
"0.6737776",
"0.67283165",
"0.6715326",
"0.66959506",
"0.66939133",
"0.6690822",
"0.6690126",
"0.66885006",
"0.6687302",
"0.6685716",
"0.6672116",
"0.6671334",
"0.6667436",
"0.6667436",
"0.6664605",
"0.6663487",
"0.6662144",
"0.6659632",
"0.6658028",
"0.66556853",
"0.6645572",
"0.66350394",
"0.66338056",
"0.6630717",
"0.6630717",
"0.66214246",
"0.66212183",
"0.661855",
"0.6617633",
"0.6612846",
"0.66112465",
"0.66079855",
"0.65980226",
"0.6597105",
"0.6596064",
"0.6593222",
"0.65920717",
"0.6589676",
"0.6582856",
"0.65828097",
"0.6582112",
"0.6578338",
"0.65776545",
"0.65774703",
"0.6572131",
"0.65708333",
"0.65703875",
"0.6569249",
"0.6564464",
"0.6564464",
"0.65628386",
"0.6560576",
"0.6559898",
"0.65583706",
"0.6558308",
"0.6557277",
"0.65571105",
"0.6557092",
"0.6556115",
"0.655001",
"0.6549598",
"0.6547666"
]
| 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $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}",
"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 function delete(): void\n {\n unlink($this->path);\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 $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 File::find($id)->remove();\n \n return redirect()->route('files.index');\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 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 removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\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 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 removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"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 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 deleted(Storage $storage)\n {\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 removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"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 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 }",
"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();",
"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()\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.6673811",
"0.66624975",
"0.66376764",
"0.66351163",
"0.66280866",
"0.65443397",
"0.6543099",
"0.64656305",
"0.62881804",
"0.61755043",
"0.61278707",
"0.6089098",
"0.60534257",
"0.6043048",
"0.6006416",
"0.593359",
"0.5929751",
"0.5923406",
"0.59201753",
"0.5904145",
"0.58963126",
"0.5895338",
"0.589437",
"0.589437",
"0.589437",
"0.589437",
"0.58819216",
"0.58684987",
"0.5864614",
"0.58097607",
"0.57739484",
"0.5761358",
"0.57558876",
"0.5750673",
"0.5741367",
"0.5734089",
"0.57264656",
"0.5715195",
"0.5711313",
"0.5707201",
"0.57057804",
"0.57053447",
"0.5702519",
"0.5698952",
"0.56844676",
"0.56844676",
"0.56783324",
"0.5677608",
"0.56581664",
"0.564899",
"0.5648674",
"0.5647576",
"0.5641079",
"0.5636559",
"0.56325674",
"0.5619814",
"0.5615794",
"0.5607223",
"0.56022006",
"0.5601402",
"0.5601336",
"0.56004316",
"0.5590177",
"0.55810463",
"0.55665016",
"0.5565872",
"0.5565398",
"0.5563011",
"0.55565405",
"0.5556361",
"0.5549312",
"0.5544914",
"0.554211",
"0.5540394",
"0.5540394",
"0.5537265",
"0.5536237",
"0.55310345",
"0.55295527",
"0.5529016",
"0.5527304",
"0.5527274",
"0.5527126",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5523294",
"0.55231583",
"0.55181384"
]
| 0.0 | -1 |
Display a page to edit a new planttype | public function edit($id)
{
$soilType = SoilType::find($id);
return view('soilType.edit')->with('soilType', $soilType);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Plants $plant)\n {\n //\n }",
"public function getEdit($type)\n {\n // Title\n $title = Lang::get('admin/types/title.type_update');\n\n // Show the page\n return View::make('admin/types/edit', compact('type', 'title'));\n }",
"public function edit(plant $plant)\n {\n //\n }",
"public function edit(Plantation $plantation)\n {\n //$types = Type::all();\n $types =['' => 'Select a type'] + Type::pluck('name','id')->all();\n\n return view('editPlantation')->with('plantation',$plantation)\n ->with('types', $types);\n }",
"public function edit(Type $type)\n {\n //\n }",
"public function edit(Type $type)\n {\n //\n }",
"public function edit(Type $type)\n {\n //\n }",
"public function edit(PavaneType $pavaneType)\n {\n //\n }",
"public function edit(Type $type)\n {\n //\n return view('type', compact('type'));\n }",
"public function edit(Type $type)\n {\n Gate::authorize('edit-type', $type);\n $title = \"Edit {$type->name}\";\n return view('admin.types.edit', compact('title', 'type'));\n }",
"public function edit(BloodType $bloodType): View|Factory|Application\n {\n return view('blood-types.edit', ['bloodType' => $bloodType]);\n }",
"public function edit($idposttype)\n {\n $rs_categories = DB::select('call ListAllCategoryProcedure()');\n $categories = json_decode(json_encode($rs_categories), true);\n $posttype = PostType::find($idposttype);\n return view('admin.posttype.edit',compact('posttype','idposttype','categories'));\n }",
"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 {\n //\n\t\t$type = Type::findOrFail($id);\n\t\treturn view('admin.type_edit', ['type' => $type]);\n }",
"public function edit($id)\n {\n $portfoliotype = Portfoliotype::find($id);\n return view('admin.portftype.addportfoliotype', compact('portfoliotype'));\n }",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"function editItemType() {\n\t\tglobal $page;\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:itemtype\">';\n\t\t\t$_ .= $this->getTypeObject()->editItem();\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}",
"public function edit(HouseType $type)\n {\n return view('types.edit', compact('type'));\n }",
"public function edit($id)\n {\n $type = Type::find($id);\n return view('admin/type/edit', ['type' => $type]);\n }",
"public function edit($id)\n {\n $type = Type::findOrFail($id);\n return view('admin.type.edit', [\n 'type' => $type\n ]);\n }",
"public function edit($id)\n {\n $plate=Plate::findOrFail($id);\n $ptypes=Ptype::pluck('name','id')->all();\n $pstates=Pstate::pluck('name','id')->all();\n return view('Manager.Plates.edit_plate',compact('plate','ptypes','pstates'));\n\n }",
"public function edit($id)\n {\n $type = Type::find($id);\n return view('type.edit',compact('type'));\n }",
"public function edit($type = 'about')\n {\n // we should gather any information from the tables and then send that\n // back to the view. We order by id desc because we can create new\n // type pages or edit\n $node = $this->nodeModel->nodeByType($type)->orderBy('id', 'desc')->first();\n // return view\n \n return view('admin.node_view')->with(compact('node'));\n }",
"public function edit($id)\n {\n $item_type = Item_Type::find($id);\n\n return view('admin_panel.item_types.edit',compact('item_type'));\n\n }",
"public function edit($id)\n {\n $type=Trucktype::find($id);\n return view('admin.truck.type.edit',compact('type'));\n\n }",
"function lb_show_edit_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'edit',\n\t\t\t'this_cafe' => lb_get_this_cafe_from_cafe( $_GET['edit-id'] ),\n\t\t)\n\t);\n}",
"public function addType(){\n return view('admin.MovieTypes.addType');\n }",
"public function newAction() {\n\n $entity = $this->get('admin.helper.ClothingType')->createNew();\n $form = $this->createForm(new ClothingTypes('add',$entity), $entity);\n return $this->render('LoveThatFitAdminBundle:ClothingType:new.html.twig', array(\n 'form' => $form->createView()));\n }",
"public function edit($id)\n\t{\n\t\tif(!Auth::user()->hasPermission('editType')){\n\t\t\treturn redirect()->route('admin.getHome')->with('flash_message_error', '403! Không thể Edit Type');\n\t\t}\n\t\t//\n\t\t$film_type = FilmType::findOrFail($id);\n\t\treturn view('admin.type.edit', compact('film_type'));\n\t}",
"public function edit($typeId, $id, CarEngine $engine)\n {\n //\n $engine = $engine->find($id); \n $breadcrumb='carEngines.edit';\n $item=$engine;\n return view('admin.partials.cars.types.engines.form', compact('engine','breadcrumb','item'));\n }",
"public function editType($id)\n {\n $Get_solarType = SolarPanelType::where('id',$id)->first();\n // check if the record exist\n if ($Get_solarType) {\n return view('stock.edit-type',[\n 'singleType' => $Get_solarType\n ]);\n }\n alert()->danger('Oops!', 'No Record Found');\n return Redirect('/stock/new/solar/type');\n }",
"public function edit($id)\n\t{\n\t\t$product_type = $this->product_type->find($id);\n\n\t\tif (is_null($product_type))\n\t\t{\n\t\t\treturn Redirect::route('product_types.index');\n\t\t}\n\n\t\treturn View::make('scaffolds.product_types.edit', compact('product_type'));\n\t}",
"public function show_add_articleType(){\n\n return view('superAdmin.admin_add_articleType');\n }",
"public function edit($id)\n {\n $type = Type::find($id);\n return view('Type.edit',compact('type'));\n }",
"public function edit(DeviceType $type)\n {\n return view('devices.types.edit', compact('type'));\n }",
"function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}",
"public function permit_type_add_form()\n {\n $this->load->view('common/header');\n $this->load->view('permit/permittype/create_form');\n $this->load->view('common/footer');\n }",
"public function edit(Planta $planta)\n {\n //\n $caja = caja::pluck('description','id');\n $planta = planta::find($planta->id);\n return view('plantas.edit',['planta' => $planta,'caja'=>$caja]);\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Lock_Service_FileType::getFileType(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t}",
"public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}",
"public function show(Type $type)\n {\n //\n }",
"public function show(Type $type)\n {\n //\n }",
"public function show(Type $type)\n {\n //\n }",
"public function getCreateLocationType()\n {\n return view('admin.world_expansion.create_edit_location_type', [\n 'type' => new LocationType\n ]);\n }",
"public function edit($id)\n\t{\n\t\tif(Auth::user()->role == 'Admin')\n\t\t{\n\t\t\t$etype = $this->etype->find($id);\n\n\t\t\tif (is_null($etype))\n\t\t\t{\n\t\t\t\treturn Redirect::route('etypes.index');\n\t\t\t}\n\n\t\t\treturn View::make('etypes.edit', compact('etype'));\n\t\t}\n\t\tFlash::error('You are not authorized to view this page');\n\t\treturn Redirect::to('home');\t\t\t\t\t\n\t}",
"public function edit($id)\n {\n try\n {\n $type = Type::find($id);\n\n return view('admin.editType', ['type' => $type]);\n }\n catch(ModelNotFoundException $e)\n {\n // dd($e->getMessage());\n abort(404);\n }\n }",
"public function edit($id)\n {\n $data = [];\n $data['typeedit'] = ProductType::findOrFail($id);\n return view('product_type.edit', $data);\n }",
"public function edit(types $type)\n {\n return view('types.edit', compact('type'));\n }",
"public function edit(Salarytype $salarytype)\n {\n //\n }",
"public function edit($video_type)\n {\n //\n $tipoVideo = VideoType::findOrFail($video_type);\n \n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n return view('admin.videotype.edit', compact('tipoVideo', 'usuario'));\n }",
"public function getEditLocationType($id)\n {\n $type = LocationType::find($id);\n if(!$type) abort(404);\n return view('admin.world_expansion.create_edit_location_type', [\n 'type' => $type\n ]);\n }",
"public function edit($id)\n {\n $type = $this->typeRepo->getOne($id);\n\n return view('admin::appraisal.types.edit', compact('type'));\n }",
"public function edit($id)\n {\n $productTypeEdit = $this->productTypeService->productTypeRepository->getById($id);\n\n return view('admin.product_type.edit', compact('productTypeEdit'));\n }",
"public function edit(DeathType $deathType)\n {\n //\n }",
"function showLocations() {\n if(isset($_REQUEST['newloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->description = $_REQUEST['description'];\n $loc->save();\n }else if (isset($_REQUEST['delloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->id = $_REQUEST['id'];\n $loc->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Locations';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of locations and stick it in the template array\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $locList = Sysinventory_Location::generateLocationList();\n $tpl['PAGER'] = $locList;\n\n // make the form for adding a new location\n $form = new PHPWS_Form('add_location');\n $form->addText('description');\n $form->setLabel('description','Description');\n $form->addSubmit('submit','Create Location');\n $form->setAction('index.php?module=sysinventory&action=edit_locations');\n $form->addHidden('newloc','add');\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_location.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }",
"function showLocations() {\n if(isset($_REQUEST['newloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->description = $_REQUEST['description'];\n $loc->save();\n }else if (isset($_REQUEST['delloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->id = $_REQUEST['id'];\n $loc->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Locations';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of locations and stick it in the template array\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $locList = Sysinventory_Location::generateLocationList();\n $tpl['PAGER'] = $locList;\n\n // make the form for adding a new location\n $form = new PHPWS_Form('add_location');\n $form->addText('description');\n $form->setLabel('description','Description');\n $form->addSubmit('submit','Create Location');\n $form->setAction('index.php?module=sysinventory&action=edit_locations');\n $form->addHidden('newloc','add');\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_location.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }",
"public function edit($id)\n {\n $data = ProjectType::find($id);\n return view('manage.project-type.edit')->with(compact('data'));\n }",
"public function edit($id)\n {\n\t\t$jobtype = JobType::find($id);\n return view('admin.job-type.edit',['jobtype'=>$jobtype]);\n }",
"public function postEdit($type)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'name' => 'required|min:3'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Update the type post data\n $this->$type->name = Input::get('name');\n\n // Was the type post updated?\n if($this->$type->save())\n {\n // Redirect to the new type post page\n return Redirect::to('admin/types/' . $type->id . '/edit')->with('success', Lang::get('admin/types/messages.update.success'));\n }\n\n // Redirect to the types post management page\n return Redirect::to('admin/types/' . $type->id . '/edit')->with('error', Lang::get('admin/types/messages.update.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/types/' . $type->id . '/edit')->withInput()->withErrors($validator);\n }",
"public function editLocation($id)\n {\n $Get_solarType = SolarPanelType::where('id',$id)->first();\n // check if the record exist\n if ($Get_solarType) {\n return view('stock.edit-type',[\n 'singleType' => $Get_solarType\n ]);\n }\n alert()->danger('No Record Found!', 'Oops!');\n return Redirect('/stock/new/solar/type');\n }",
"protected function actionEdit() {\r\n\r\n //try 1: get the object type and names based on the current object\r\n $objInstance = class_objectfactory::getInstance()->getObject($this->getSystemid());\r\n if($objInstance != null) {\r\n $strObjectTypeName = uniSubstr($this->getActionNameForClass(\"edit\", $objInstance), 4);\r\n if($strObjectTypeName != \"\") {\r\n $strType = get_class($objInstance);\r\n $this->setCurObjectClassName($strType);\r\n $this->setStrCurObjectTypeName($strObjectTypeName);\r\n }\r\n }\r\n\r\n //try 2: regular, oldschool resolving based on the current action-params\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n\r\n $objEdit = new $strType($this->getSystemid());\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"edit\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\".$this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error editing current object type not known \", class_exception::$level_ERROR);\r\n }",
"public function edit($id)\n\t{\n $type= DB::select(\"select*from typemarchandises\");\n $producers = DB::select(\"select*from producers\");\n // print(\"<pre>\");\n // print_r($type);die();\n\t\t$product = Product::find($id);\n\t\treturn view('admin.edit',compact('product'),array('types'=> $type,'producers'=>$producers));\n\t}",
"public function edit($id)\n {\n $permType = PermType::find($id);\n return view('dashboard.permTypes.edit', compact('permType'));\n }",
"public function edit($id)\n {\n $unit_type = UnitType::find($id);\n return view('unit_type.edit', ['unit_type' => $unit_type]);\n }",
"public function edit($id)\n {\n $types = Type::findOrfail($id);\n\n return view('admin.edittype',compact('types'));\n }",
"public function edit(Page $page)\n {\n if($page->banner != ''){\n $banner = $this->load_image('pagebanner/'.$page->banner);\n if($banner){\n $page->banner_link = $banner->get_image_link();\n $page->banner_size = $banner->get_image_size();\n }\n\n }\n return view('admin.createpage',compact('page'));\n }",
"public function edit(PrizeType $prizeType)\n {\n //\n }",
"public function edit($id)\n {\n $usertype = Usertype::find($id);\n return view('usertypes.edit', compact('usertype'));\n }",
"public function edit($id)\n {\n $typeBeers = TypeBeer::find($id);\n return view('beer.type.edit', compact('typeBeers') );\n }",
"function get_form_edit(){\n\t\t\tif($this->check_session->user_session() && $this->check_session->get_level()==1){\n\t\t\t\t$kode_unit \t= form_prep($this->input->post('kode_unit'));\n\t\t\t\t$data['result_unit'] = $this->unit_model->get_unit($kode_unit);\n\t\t\t\t$this->load->view('form_edit_unit_',$data);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshow_404('page');\n\t\t\t}\n\t\t}",
"public function edit($id)\n {\n //\n $edit =Complainttype::find($id);\n return view('admin.complainttype.edit')->with('edit',$edit);\n }",
"public function showEdit()\n {\n\n }",
"public function plantillaEdit($id)\n {\n $prod=Productos::find($id); \n\n return view('productos.plantillas',compact('prod'));\n }",
"public function editItem($id)\n {\n $Get_solarType = SolarPanelType::where('id',$id)->first();\n // check if the record exist\n if ($Get_solarType) {\n return view('stock.edit-type',[\n 'singleType' => $Get_solarType\n ]);\n }\n alert()->danger('No Record Found!', 'Oops!');\n return Redirect('/stock/new/solar/type');\n }",
"public function postEdit(){\n return view(\"admin.product.edit\" );\n }",
"public function edit(RunType $runType)\n {\n //\n }",
"public function edit($type=null,$item_id, $id)\n {\n //\n }",
"public function edit($id)\n {\n $type = $this->typeRepository->find($id);\n\n return view('types.edit', compact('type'));\n }",
"public function actionEdit($type = null, $id = null)\n {\n $this->adminOnly();\n\n $page = $this->findPageById($id);\n\n if ($page === null) {\n $page = Yii::createObject($this->getPageClassName());\n $page->type = $type;\n $page->content->container = $this->contentContainer;\n }\n\n $page->content->visibility = \\humhub\\modules\\content\\models\\Content::VISIBILITY_PUBLIC;\n\n if ($page->load(Yii::$app->request->post()) && $page->save()) {\n if ($page->type == Container::TYPE_MARKDOWN) {\n \\humhub\\modules\\file\\models\\File::attachPrecreated($page, Yii::$app->request->post('fileUploaderHiddenGuidField'));\n }\n\n return $this->redirect($this->contentContainer->createUrl('list'));\n }\n\n return $this->render('@custom_pages/views/common/edit', [\n 'page' => $page,\n 'sguid' => $this->space->guid,\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()]);\n }",
"public function editAction()\n {\n $tiles = [];\n // Reuse the parameters from $_REQUEST\n // If we are going to render a full page for edit form, we shall also render the _form_controls\n $tiles[] = Region::create($this->getEditRegionPath(), array_merge($_REQUEST, [\n '_form_controls' => true,\n ]));\n return $this->render($this->findTemplatePath('page.html') , array( 'tiles' => $tiles ));\n }",
"public function editAction() {\n \t$id = $this->getInput('id');\n \tlist($info, $itemsList) = Admin_Service_Material::getById($id);\n \tforeach ($itemsList as $key=>$value) {\n\t \t$value['type'] = $value['type'] == 1 ? $this->ITEMTYPE[0] : $this->ITEMTYPE[1];//'gift':礼包,'link':链接\n \t $itemsList[$key] = $value;\n \t}\n \t\n \t$this->assign('info', $info);\n \t$this->assign('itemsList', $itemsList);\n $giftNameList = $this->getGiftName($itemsList);\n $this->assign('giftNameList', $giftNameList);\n \n \t$this->assign('dataType', $info[\"type\"] == 1 ?$this->DATATYPE[0] : $this->DATATYPE[1]);\n $this->assign('dataTypes', $this->DATATYPE);\n }",
"public function edit($id)\n {\n $sportstype = Sporttype::find($id);\n return view('sporttypes.edit', compact('sportstype','id'));\n }",
"public function getEdit(){\n return view(\"admin.product.edit\" );\n }",
"public function edit($id)\n {\n $customfield = Customfield::findOrFail($id);\n\n $types = Core_custom_field_type::select('ID','name')->get();\n\n\n return view('common::backend.customfield.edit', compact('customfield') , compact('types'));\n }",
"public function edit(type_of_user $type_of_user)\n {\n //\n }",
"public function createType()\n {\n\n return view('expense.type.create', compact(''));\n }",
"function travel_type_form($form, &$form_state, $entity_type, $op = 'edit') {\n // Handle the case when cloning is performed.\n if ($op == 'clone') {\n $entity_type->label .= ' (cloned)';\n $entity_type->type = '';\n }\n\n // Describe all properties of the entity which shall be shown on the form.\n $form['label'] = array(\n '#title' => t('Label'),\n '#type' => 'textfield',\n '#default_value' => $entity_type->label,\n '#description' => t('The human-readable name of this entity type.'),\n '#required' => TRUE,\n '#size' => 30,\n );\n $form['type'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($entity_type->type) ? $entity_type->type : '',\n '#maxlength' => 32,\n //'#disabled' => $entity_type->isLocked() && $op != 'clone',\n '#machine_name' => array(\n 'exists' => 'travel_type_load_multiple',\n 'source' => array('label'),\n ),\n '#description' => t('A unique machine-readable name for this entity type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n $form['description'] = array(\n '#type' => 'textarea',\n '#default_value' => isset($entity_type->description) ? $entity_type->description : '',\n '#description' => t('Description about the entity type.'),\n );\n\n // Add some buttons.\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save entity type'),\n '#weight' => 40,\n );\n //if (!$entity_type->isLocked() && $op != 'add' && $op != 'clone') {\n $entity_id = entity_id('travel', $entity);\n if (!empty($entity_id)) {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete entity type'),\n '#weight' => 45,\n '#limit_validation_errors' => array(),\n '#submit' => array('travel_type_form_submit_delete'),\n );\n }\n\n return $form;\n}",
"public function edit($id)\n {\n $material= material::find($id);\n $types = type::all();\n\n return view('dashboard.matrail.edit', compact('material','types'));\n\n //\n }",
"public function edit($id)\n {\n // ตรวจสอบ permission\n ChkPerm('st-vehicle-type-edit', 'setting/st-vehicle-type');\n\n $stvehicletype = StVehicleType::findOrFail($id);\n\n return view('setting.st-vehicle-type.edit', compact('stvehicletype'));\n }",
"public function edit(EmpType $empType)\n {\n //\n return view ('emptype.edit')->with(compact('empType'));\n }",
"public function editAction() {}",
"public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }",
"public function edit($id)\n {\n $n_preffered_contract_type = N_prefcontrtype::findOrFail($id);\n //dd($n_prefcontrtype);\n return view('admin.nom.prefcontrtypes.edit', compact('n_preffered_contract_type'));\n }",
"public function Editplan() {\n $plan_id = $this->input->post('plan_id');\n $data = array(\n 'plan_id' => $plan_id\n );\n $this->load->view('admin/plan/edit_plan', $data);\n }",
"public function edit( )\r\n {\r\n //\r\n }",
"public function edit($id)\n {\n $model = Type_cars::findOrFail($id);\n return view('modules.type.form', compact('model'));\n }",
"public function edit_usertype($id) {\n\t\t$arr['page'] = 'role';\n\t\t$arr['id'] = $id;\n\t\t$query = $this->setting->getusertypebyid($id);\n\t\t$arr['userrole'] = $query['role_name'];\n\t\t$arr['userrolealias'] = $query['role_alias'];\n\t\t$arr['roletype'] = $query['role_type'];\n $this->load->view('vwAddUserType',$arr);\n\t}",
"public function edit()\n {\n return view('admincp::edit');\n }",
"function display_machine_type_edit_form($user, $id=false) {\r\n if (!($id === false)) {\r\n try {\r\n $machineType = new MachineType($user->dbConn, $id);\r\n } catch (Exception $e) {\r\n $id = false;\r\n }\r\n }\r\n echo \"<form action='machine_type.php\".(($id === false) ? \"\" : \"?id=\".intval($id)).\"' method='POST' class='form-horizontal'>\r\n <fieldset>\r\n <div class='control-group'>\r\n <label class='control-label' for='machine_type[name]'>Name</label>\r\n <div class='controls'>\r\n <input name='machine_type[name]' type='text' class='input-xlarge' id='machine_type[name]'\".(($id === false) ? \"\" : \" value='\".escape_output($machineType->name).\"'\").\">\r\n </div>\r\n </div>\r\n <div class='control-group'>\r\n <label class='control-label' for='machine_type[description]'>Description</label>\r\n <div class='controls'>\r\n <input name='machine_type[description]' type='text' class='input-xlarge' id='machine_type[description]'\".(($id === false) ? \"\" : \" value='\".escape_output($machineType->description).\"'\").\">\r\n </div>\r\n </div>\r\n <div class='form-actions'>\r\n <button type='submit' class='btn btn-primary'>\".(($id === false) ? \"Add Machine Type\" : \"Save changes\").\"</button>\r\n <a href='#' onClick='window.location.replace(document.referrer);' class='btn'>\".(($id === false) ? \"Go back\" : \"Discard changes\").\"</a>\r\n </div>\r\n </fieldset>\\n</form>\\n\";\r\n}"
]
| [
"0.710706",
"0.70279014",
"0.6957722",
"0.6920303",
"0.6870563",
"0.6870563",
"0.6870563",
"0.68308127",
"0.6825618",
"0.68159395",
"0.6703499",
"0.66640496",
"0.6645606",
"0.6611474",
"0.65806174",
"0.65411484",
"0.65186286",
"0.6513734",
"0.6472456",
"0.6442497",
"0.64239156",
"0.641448",
"0.6408981",
"0.6408088",
"0.6402004",
"0.6381667",
"0.6380301",
"0.6373596",
"0.6361717",
"0.6360766",
"0.6360628",
"0.6344732",
"0.6342426",
"0.63413775",
"0.6334354",
"0.6303667",
"0.63024783",
"0.62985396",
"0.6297497",
"0.6287085",
"0.627171",
"0.62604415",
"0.62600684",
"0.62600684",
"0.62600684",
"0.6254745",
"0.62474364",
"0.6246703",
"0.62381905",
"0.62376183",
"0.62326586",
"0.62215793",
"0.62091094",
"0.6208534",
"0.620635",
"0.6205377",
"0.61937135",
"0.61937135",
"0.619253",
"0.61919475",
"0.61897576",
"0.6168466",
"0.6165107",
"0.61601543",
"0.6147523",
"0.61467993",
"0.61460716",
"0.6143619",
"0.6140098",
"0.61350864",
"0.61294425",
"0.6128847",
"0.61276627",
"0.6124156",
"0.6118294",
"0.61150205",
"0.61122715",
"0.6105633",
"0.61048573",
"0.6104425",
"0.61031675",
"0.609642",
"0.6093996",
"0.60868716",
"0.60868245",
"0.6085368",
"0.60806847",
"0.60806686",
"0.60709846",
"0.6070443",
"0.6069901",
"0.6067657",
"0.60661024",
"0.6065919",
"0.60653305",
"0.60595834",
"0.6056851",
"0.604562",
"0.6045113",
"0.6043985",
"0.6041173"
]
| 0.0 | -1 |
Display a page to delete a new planttype | public function destroy($id)
{
SoilType::destroy($id);
$soilType = SoilType::all();
return view('soilType.index', compact('soilType'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDelete($type)\n {\n // Title\n $title = Lang::get('admin/types/title.type_delete');\n\n // Show the page\n return View::make('admin/types/delete', compact('type', 'title'));\n }",
"public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fanli_Service_Ptype::getType($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Fanli_Service_Ptype::deleteType($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}",
"public function deleteAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new DeleteForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Delete an item\",\n ]);\n }",
"public function actionDelete($id,$type)\n {\n if($type=='dept'){\n $model=$this->findModel($id);\n $model->setAttribute('dept_delete',1);\n $model->save(false);\n }else{\n $model=$this->findModel($id);\n $model->setAttribute('branch_delete',1);\n $model->save(false);\n }\n\n return $this->redirect(['index']);\n }",
"public function getDelete($id)\n {\n $objecttype = ObjectType::find($id);\n // Show the page\n return view('admin.objecttype.delete', compact('objecttype'));\n }",
"function calendar_display_type_delete() {\n\t\t$db = new DB ;\n\t\tif(isset($_GET['id']) > 0)\n\t\t{\n\t\t\t// update all events who use this event_type we set the event_type to 'other'.\n\t\t\t// if we don't do this, the events who use this event_type can't be edited anymore.\n\t\t\t$result = $this->set_types_to_other($_GET['id']);\n\n\t\t\t// delete the event_type\n\t\t\t$sql = \"delete from event_type where event_type_id = \".$_GET['id'];\n\t\t\t$db->execute_statement($sql);\n\n\t\t\tinclude_once(SF_CLASS_PATH.'/calendar/calendar.inc');\n $calendar_obj = new Calendar ;\n $calendar_obj->cache_event_type_array();\n\t\t\t\t\t\t\t\n\t\t}\n\t\theader('Location: /admin/calendar/display_type_list.php');\n }",
"function travel_type_form_submit_delete(&$form, &$form_state) {\n // Redirect user to \"Delete\" URI for this entity type.\n $form_state['redirect'] = 'admin/structure/travel/' . $form_state['travel_type']->type . '/delete';\n}",
"public function postDelete($type)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'id' => 'required|integer'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n $id = $type->id;\n $type->delete();\n\n // Was the type post deleted?\n $type = Type::find($id);\n if(empty($type))\n {\n // Redirect to the type posts management page\n return Redirect::to('admin/successful-delete')->with('success', Lang::get('admin/types/messages.delete.success'));\n }\n }\n // There was a problem deleting the type post\n return Redirect::to('admin/types/' . $id . '/delete')->with('error', Lang::get('admin/types/messages.delete.error'));\n }",
"public function destroy(Type $type)\n {\n //\n $type->delete();\n return redirect()->route('type')\n ->with('success','ลบหมวดหมู่สินค้าสำเร็จ');\n }",
"public function deleted(Plant $plant)\n {\n //\n }",
"public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }",
"public function plantsAction(){\n\t\t$plants = Input::get('plant');\n\t\tforeach($plants as $plantID){\n\t\t\t$camera = Camera::where('Current_Left_Plant_ID', $plantID)->first();\n\t\t\tif($camera != null){\n\t\t\t\t$camera->Current_Left_Plant_ID = null;\n\t\t\t\t$camera->save();\n\t\t\t}\n\t\t\t$camera = Camera::where('Current_Right_Plant_ID', $plantID)->first();\n\t\t\tif($camera != null){\n\t\t\t\t$camera->Current_Right_Plant_ID = null;\n\t\t\t\t$camera->save();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif (Input::get('action') == \"Delete\") {\n\t\t\tforeach($plants as $plantID){\n\t\t\t\t$plant = Plant::find($plantID);\n\t\t\t\t// foreach($plant->images()->get() as $image){\n\t\t\t\t// \t$image->phenotypicData()->delete();\n\t\t\t\t// }\n\t\t\t\t// $plant->images()->delete();\n\t\t\t\t$plant->delete();\n\t\t\t}\n\t\t}\n\t\treturn Redirect::to('/');\n\t}",
"public function destroy($idposttype)\n {\n $posttype = PostType::find($idposttype);\n\n $posttype->delete();\n\n return redirect()->route('admin.posttype.index')->with('success','record have deleted');\n }",
"public function Deleteplan() {\n $plan_id = $this->input->post('plan_id');\n $data = array(\n 'plan_id' => $plan_id\n );\n $this->load->view('admin/plan/delete_plan', $data);\n }",
"public function destroy($id)\n {\n Type::find($id)->delete();\n return redirect()->route('types.index')\n ->with('success','Tipo di utente eliminato!');\n }",
"public function deleteAction() : object\n {\n if ($_SESSION['permission'] === \"admin\") {\n $form = new DeleteForm($this->di);\n $form->check();\n\n $this->page->add(\"user/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $this->page->render([\n \"title\" => \"Delete an item\",\n ]);\n }\n $this->di->get(\"response\")->redirect(\"user/login\");\n }",
"public function actionDelete($id,$type)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect([\"index$type\"]);\n }",
"public function getDeleteLocationType($id)\n {\n $type = LocationType::find($id);\n return view('admin.world_expansion._delete_location_type', [\n 'type' => $type,\n ]);\n }",
"public function destroy(HouseType $type)\n {\n $type->delete();\n\n alert()->success('Deleted Successfully');\n\n return redirect()->route('types.index');\n }",
"public function delete($placeType){\n }",
"public function deletesAction()\n {\n $em = $this->getDoctrine()->getManager();\n $request = $this->get('request');\n\n $filter_category = $em->getRepository('AciliaCmsBundle:ExpertCategory')->find(3);\n $query = $em->getRepository('AciliaCmsBundle:Energy')->getQuery(null, null, null, null, $filter_category);\n\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate($query, $this->get('request')->query->get('page', 1), 15);\n\n return $this->render('AciliaCmsBundle:Energy:deletes.html.twig', array(\n 'pagination' => $pagination,\n ));\n }",
"public function destroy(plant $plant)\n {\n //\n }",
"public function action_delete() {\n $elect_id = $this->request->query('elect_id');\n $res = Model::factory('Elect')->delete($elect_id);\n if(!$res) exit('error action_delete');\n $this->redirect('/'); \n }",
"public function delete()\n {\n return view('backend.pages.brand.delete');\n }",
"public function delete()\n\t{\n\t\t$id = $this->input->post('primary_id');\n\t\tif($this->mdl_plant->delete($id)) {\n\t\t\techo true;\n\t\t} else {\n\t\t\techo false;\n\t\t}\n\t}",
"public function delete($id){\n $this->autorender=false;\n if($this->Session->read('LOGEDTYPE')=='True') {\n if($id=='')\n { \n $this->Session->setFlash(' SECURITY ERROR ! ');\n $this->redirect(array('controller'=>'leaves','action'=>'index'));\n }\n else\n {\n $this->Leavetype->delete($id);\n $this->Session->setFlash(' Record deleted ');\n $this->redirect(array('controller'=>'leaves','action'=>'index'));\n }\n \n } \n }",
"public function deleteDrugType($id)\n {\n $drug_type = DrugType::findOrFail($id);\n if($drug_type->delete()){\n return redirect()->back()->with('delete_drug_type','Drug type deleted');\n }else{\n return redirect()->back()->with('delete_fail',\"Delete fail\");\n }\n }",
"public function destroy(Plants $plant)\n {\n if ($plant->delete()) {\n return redirect('/admin/plants')->with('plants.message',\n ['type' => 'success', 'message' => '\"' . $plant->name . '\" успешно удален']\n );\n } else {\n return redirect('/admin/plants')->with('plants.message',\n ['type' => 'danger', 'message' => 'Произошла при удалении']\n );\n }\n }",
"function mongo_node_type_delete_form($form, $form_state, $entity_type) {\n $form = array();\n // Send entity type.\n $form['entity_type'] = array(\n '#type' => 'value',\n '#value' => $entity_type,\n );\n $path = '/admin/structure/mongo-node';\n\n $extist_entity_content = '';\n $collection = mongodb_collection('fields_current', $entity_type);\n $count = $collection->count(array('_type' => $entity_type));\n if ($count) {\n $extist_entity_content = t('%type is used by %count piece of content on your site. If you remove this entity type, you will not be able to edit the %type content and it may not display correctly.', array('%type' => $entity_type, '%count' => $count));\n $extist_entity_content .= '<br/><br/>';\n }\n return confirm_form($form, t('Delete entity type'), $path, $extist_entity_content . 'This action cannot be undone', t('Delete'), t('Cancel'), 'mongo_node_type_delete');\n}",
"public function deleteAddProductTypeAdmin(Request $req){\n try {\n $client1 = new \\GuzzleHttp\\Client();\n $res = $client1->request('DELETE',PageController::getUrl('producttypes/'.$req->id.'') );\n $data = json_decode($res->getBody()->getContents(), true);\n return redirect()->back()->with(['flag'=>'success','title'=>'Đã xóa thành công' ,'message'=>' ']);\n } catch (\\GuzzleHttp\\Exception\\RequestException $e) {\n return redirect()->back()->with(['flag'=>'error','title'=>'Thất bại!','message'=>'Phải xóa thông số lỹ thuật trong loại sản phẩm trước']);\n }\n }",
"public function action_delete()\n\t{\n\t\t$view = View::factory('story/incomplete');\n\t\t$this->response->body($view);\n\t}",
"public function destroy($id)\n\t{\n\t\t$this->etype->find($id)->delete();\n\n\t\treturn Redirect::route('etypes.index');\n\t}",
"public function actionDelete() {}",
"public function actionDelete() {}",
"public function suppr()\n {\n $voyage_id = null;\n\n if (!empty($_GET['id']) && ctype_digit($_GET['id'])) {\n $voyage_id = $_GET['id'];\n }\n\n if (!$voyage_id) {\n die('please enter a proper number in the url for this to delete.');\n }\n\n\n $voyage_to_delete = $this->model->find($voyage_id, $this->modelName);\n $velo_id = $voyage_to_delete->velo_id;\n\n if (!$voyage_to_delete) {\n die(\"Does Not Exist\");\n }\n\n $this->model->delete($voyage_id);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }",
"public function listsfacilityTypedelete($facilityType_id)\r\n {\r\n $deleted_facilityType = FacilityTypes::destroy($facilityType_id);\r\n if($deleted_facilityType){\r\n return response()->json(['msg' => 'Deleted facilityType']);\r\n }\r\n }",
"public function deleteAction(Request $request, Plant $plant)\n {\n $form = $this->createDeleteForm($plant);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($plant);\n $em->flush();\n }\n\n return $this->redirectToRoute('plant_index');\n }",
"function travel_type_form_delete_confirm($form, &$form_state, $entity_type) {\n // Store the entity in the form.\n $form_state['entity_type'] = $entity_type;\n\n // Show confirm dialog.\n $message = t('Are you sure you want to delete entity type %title?', array('%title' => entity_label('entity_type', $entity_type)));\n return confirm_form(\n $form,\n $message,\n 'travel/' . entity_id('travel_type', $entity_type),\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}",
"public function actionDelete($id, $PSD_Type_Id)\n {\n $this->findModel($id, $PSD_Type_Id)->delete();\n\n return $this->redirect(['index']);\n }",
"public function destroy(Plant $plant)\n {\n //\n }",
"public function deleteAction() {\n \n }",
"public function delete($id) {\n $pelajaran = Pelajaran::find($id);\n return view('admin.pelajaran.delete')->with('pelajaran', $pelajaran);\n }",
"function travel_type_form_delete_confirm_submit($form, &$form_state) {\n // Delete the entity type.\n $entity_type = $form_state['entity_type'];\n entity_delete('travel_type', entity_id('travel_type', $entity_type));\n\n // Redirect user.\n drupal_set_message(t('@type %title has been deleted.', array('@type' => $entity_type->type, '%title' => $entity_type->label)));\n $form_state['redirect'] = 'admin/structure/travel';\n}",
"public function deleteAction()\n {\n if (isset($_GET[PARAM_DESIGN_NAME])) {\n\t\t\t$service = new Bigace_Smarty_Service();\n\t\t\t$design = $service->getDesign(urldecode($_GET[PARAM_DESIGN_NAME]));\n\n\t\t\tif (!is_null($design)) {\n\t\t\t if ($service->countDesignUsage(urldecode($_GET[PARAM_DESIGN_NAME])) == 0) {\n\t\t\t\t if ($service->deleteDesign(urldecode($_GET[PARAM_DESIGN_NAME]))) {\n\t\t\t\t\t $this->view->INFO = getTranslation('msg_deleted');\n\t\t\t\t } else {\n\t\t\t\t\t$this->view->ERROR = \"Could not delete design\";\n\t\t\t\t }\n\t\t\t } else {\n\t\t\t\t $this->view->ERROR = getTranslation('delete_in_use');\n\t\t\t }\n\t\t\t} else {\n\t\t\t $this->view->ERROR = \"Design does not exist.\";\n\t\t\t}\n } else {\n $this->view->ERROR = getTranslation('missing_values');\n }\n $this->_forward('index');\n }",
"public function destroy(types $type)\n {\n $type->delete();\n\n return redirect()->route('types.index')->with('message','Type Deleted Successfully');\n }",
"public function destroy($id)\n\t{\n\t\tif(!Auth::user()->hasPermission('deleteType')){\n\t\t\treturn redirect()->route('admin.getHome')->with('flash_message_error', '403! Không thể Delete Type');\n\t\t}\n\t\t//\n\t\t$film_type = FilmType::findOrFail($id);\n\t\t$film_type->delete();\n\t\t//forget cache\n\t\tif(Cache::has('film_type')){\n\t\t\tCache::forget('film_type');\n\t\t}\n\t\treturn redirect()->route('admin.type.index')->with(['flash_message' => 'Thành công! Xóa Type id: '.$id]);\n\t}",
"public function destroy($id)\n {\n $type=Trucktype::find($id)->delete();\n return redirect(route('type.index'))->with('message','Truck Type Delete Successfully.');\n }",
"public function getDelete($id)\n {\n $fornecedor = Fornecedor::find($id);\n $title = \"Remover Fornecedor\";\n // Show the page\n return view('admin.fornecedor.delete', compact('fornecedor','title'));\n }",
"public function delete (){\n\n $table = new simple_table_ops();\n $table->set_id_column('timetable_id');\n $table->set_table_name('timetables');\n $table->delete();\n\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=timetable&action=show&submit=yes&timetable_period_id={$_GET['timetable_period_id']}\");\n }",
"function cpatient_detail_delete() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"patient_detail\"] = new cpatient_detail();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'delete', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'patient_detail', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}",
"public function actionDeleted(){\n $viewType = \"deleted\";\n\n \n $searchModel = new SearchRepair();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $viewType);\n\n return $this->render('deleted', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ]);\n }",
"public function getDeleteform($id){\n $id = Crypt::decrypt($id);\n $itemtypelete=RItemType::find($id);\n if($itemtypelete->delete()){\n Session::flash('sms_success', trans('sta.save_data_success'));\n return Redirect::to('itemtype');\n }\n }",
"public function deleting($educationType)\n {\n\t\tparent::deleting($educationType);\n\n }",
"function delete_post()\n {\n $this->Admin_model->procedure = 'POST_DELETE';\n\n echo $this->p_post_id_delete;\n\n\n $rs = $this->Admin_model->delete($this->p_post_id_delete);\n\n //redirect('admin/Posts/display_cat');\n }",
"public function destroy($id)\n\t{\n\t\t$cate = WebAtctype::find($id);\n\t\t$type = $cate['type'];\n\t\t$cate -> delete();\n\t\treturn Redirect::to('admin/cate/'.\"$type\");\n\t}",
"public function destroy(Techno $id)\n {\n $id->delete(); \n $messageflash = \"Données technologies supprimées!\";\n return view('admin/home',compact('messageflash'));\n }",
"public function deleteMemberOfDayAction() {\n \n $this->view->id = $this->_getParam('id');\n \n if ($this->getRequest()->isPost()) {\n\n Engine_Api::_()->getDbtable('itemofthedays', 'sitepage')->delete(array('itemoftheday_id =?' => $this->_getParam('id')));\n\n\t\t\treturn $this->_forward('success', 'utility', 'core', array(\n\t\t\t\t'smoothboxClose' => 10,\n\t\t\t\t'parentRefresh' => 10,\n\t\t\t\t'messages' => array(Zend_Registry::get('Zend_Translate')->_(''))\n\t\t\t));\n }\n\n $this->renderScript('admin-widgets/delete.tpl');\n }",
"public function remove($id)\n\t{\n\t\tif($this->mdl_plant->remove($id)) {\n\t\t\t$this->session->set_flashdata('success', 'DELETED!');\n\t\t} else {\n\t\t\t$this->session->set_flashdata('error', 'ERROR!');\n\t\t}\n\t\tredirect('plants', 'refresh');\n\t}",
"public function destroy(PavaneType $pavaneType)\n {\n //\n }",
"public function deleteAction()\n {\n if ($this->request->isPost()) {\n $ids = $this->request->getPost('ids');\n\n ZArrayHelper::toInteger($ids);\n\n foreach ($ids as $id) {\n /**\n * @var MenuTypes $menu_type\n */\n $menu_type = MenuTypes::findFirst($id);\n /**\n * @var MenuDetails[] $menu_details\n */\n $menu_details = MenuDetails::find([\n 'menu_type_id = ?0',\n 'bind' => [$id]\n ]);\n foreach ($menu_details as $detail) {\n $detail->delete();\n }\n if ($menu_type->delete()) {\n $this->flashSession->success($menu_type->name . ' deleted successful');\n\n } else {\n $this->flashSession->error($menu_type->name . ' deleted fail');\n }\n }\n }\n return $this->response->redirect('/admin/menu/');\n }",
"public function destroy($id)\n {\n $type = Type::find($id);\n if(!$type){\n return redirect()->intended('admin/type');\n }\n $path = base_path() . '/storage/app/type/'. $type->image;\n if(Type::where('id', $id)->delete()){\n File::delete($path);\n }\n return redirect()->intended('admin/type');\n }",
"public function deleteTemplate ()\n {\n // Recovering template id\n $target =Input::get('data'); \n \n // Removing template\n $num = DB::update(\"DELETE FROM ezz_templates where id_template = $target\");\n return response () -> json ([\n 'borradas' => $num,\n 'status' => 'success'\n ],200);\n }",
"public function perma_del($id)\n {\n $create_letter = IndustryType::onlyTrashed()->findOrFail($id);\n $create_letter->forceDelete();\n\n return redirect()->route('admin.industry_type.index');\n }",
"public function deleteAction()\n {\n \n }",
"public function destroy($id)\n {\n Type::where('id', $id)->delete();\n return redirect('/types')->with('message','the message');\n }",
"public function destroy($id)\n {\n $type = Type::findOrFail($id);\n $type->delete();\n\n Session::flash('message', 'You successfully delete the type');\n\n return redirect()->route('admin.type.index');\n }",
"function delete()\n\t{\n\t\t$id = $this->uri->rsegment(3);\n\t\t$info = $this->football_spain_model->get_info($id);\n\t\tif (!$info) \n\t\t{\n\t\t\t$this->session->set_flashdata('message', 'Không có thông tin phù hợp');\n\t\t\tredirect(admin_url('spain/index'));\n\t\t\texit;\n\t\t}elseif($this->football_spain_model->delete($id)){\n\t\t\t$this->session->set_flashdata('message', 'Xóa thành công bài viết : ' . $info->title);\n\t\t\tredirect(admin_url('spain/index'));\n\t\t\texit;\n\t\t}else{\n\t\t\t$this->session->set_flashdata('message', 'Xóa không thành công bài viết : ' . $info->title);\n\t\t\tredirect(admin_url('spain/index'));\n\t\t\texit;\n\t\t}\n\n\t}",
"public function deletelandmarkAction(){\n $id_property = intval($this->_getParam(\"id\"));\n\n /* Initialize the delete form*/\n $form_delete = new library_forms_Delete;\n $this->view->formDelete = $form_delete;\n if ($this->getRequest()->isPost() && $form_delete->isValid($_POST)) {\n //Delete the landmark\n $model_landmark = new library_models_landmark;\n $model_landmark->delete('landmarkId = '.$id_property);\n //Report the success of the property deletion to the view\n $this->_flashMessenger->addMessage(\"The landmark has been deleted successfully\");\n $this->_helper->getHelper('Redirector')->gotoUrl(Zend_Registry::get('ROOTURL').\"index/manage\"); \n } \n }",
"public function delete(TipoEntrada $tipoEntrada)\n {\n $this->authorize('EXCLUIR_TABELAS_SISTEMA');\n return view('pages.tipo-entrada.delete', compact('tipoEntrada'));\n }",
"public function destroy($id)\n {\n $usertype = Usertype::find($id);\n $usertype->delete();\n Session::flash('success', 'The record was successfully deleted.');\n return redirect()->route('usertypes.index');\n }",
"public function destroy(Planta $planta)\n {\n //\n $vplanta = planta::find($planta->id);\n $vplanta->destroy($planta->id);\n return redirect('plantas');\n }",
"public function delete()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n try{\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/delete\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n\n }",
"public function destroy($id)\n {\n $typeField = TypeField::find($id);\n $typeField-> delete();\n return redirect()->route('Admin.TypeField.index');\n }",
"public function deleteAction() {\n\t\t$this->_notImplemented();\n\t}",
"public function destroy(String $type, String $title)\n {\n try{\n $file = FileModel::where('title',$title)->delete();\n $contact = FileContact::where('title',$title)->delete();\n $gallery = FileGallery::where('title',$title)->delete();\n File::deleteDirectory(\"Information/$type/$title\");\n }catch(\\Exception $e){\n return redirect(\"/admin/edit$type\")->with('failed',\"File $title gagal dihapus\");\n } \n\n return redirect(\"/admin/edit$type\")->with('success',\"File $title berhasil dihapus\");\n }",
"public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}",
"public function delete($entity_type, $entity_bundle, $entity_display) {\n $config = $this->configFactory->getEditable('alinks.settings');\n $displays = array_values(array_filter($config->get('displays'), function ($display) use ($entity_type, $entity_bundle, $entity_display) {\n return !($display['entity_type'] == $entity_type && $display['entity_bundle'] == $entity_bundle && $display['entity_display'] == $entity_display);\n }));\n $config->set('displays', $displays)->save();\n return new RedirectResponse(Url::fromRoute('alink_keyword.settings')->setAbsolute()->toString());\n }",
"public function deleteAction()\n {\n }",
"public function destroy($id)\n {\n $dt = Dosetype::find($id);\n $dt->delete();\n return redirect()->route('dosetype.index');\n }",
"public function deleteAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //SET LAYOUT \n $this->_helper->layout->setLayout('default-simple');\n\n //GET CLAIM ID\n $claim_id = $this->_getParam('claim_id', 'null');\n\n //GET CLAIM ITEM\n $claim = Engine_Api::_()->getItem('sitepage_claim', $claim_id);\n if ($claim->user_id != Engine_Api::_()->user()->getViewer()->getIdentity()) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET FORM\n $this->view->form = $form = new Sitepage_Form_Deleteclaim();\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET CLAIM TABLE\n Engine_Api::_()->getDbtable('claims', 'sitepage')->delete(array('claim_id=?' => $claim_id));\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => true,\n 'parentRefresh' => true,\n 'format' => 'smoothbox',\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('You have successfully deleted your claim request.'))\n ));\n }\n }",
"public function detalheAction()\n {\n $id = $this->getRequest()->getParam('id');\n\n $edicao = new Application_Model_Publicacao();\n $edicao->setId($id);\n \n $this->view->revista = $edicao;\n }",
"public function delete($id)\n\t{\n\t\techo $id;exit;\n\t\t/*// delete\n $pet = Pet::find($id);\n $pet->delete();\n\n // redirect\n Session::flash('message', 'Pet type deleted successfully');\n return Redirect::to('pet'); */\n\t}",
"public function deleteAction(){\n $this->_helper->json(\"Esto no esta implementado\");\n }",
"public function destroy(Plantation $plantation)\n {\n $plantation->delete();\n return redirect()->action('BackyardController@show', $plantation->backyard_id)->with('success','Plant Removed');\n }",
"function displayDeleteScreen()\t{\n\t\t$pluginId=$conf['pluginId'];\n\t\t$content=\"feal : displayDeleteScreen unset content\";\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ($this->aCAuth($origArr) && $this->conf['requireLogin']) || !$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\t\t\n\t\t\t\tif (is_array($origArr))\t{\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\t$this->markerArray['###HIDDENFIELDS###'].= '<input type=\"hidden\" name=\"rU['.$pluginId.']\" value=\"'.$this->recUid.'\" />';\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_DELETE_PREVIEW###', $origArr);\n\t\t\t\t\t} else {\t// Else display error, that you could not edit that particular record...\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$content='Object already deleted';\n\t\t\t\t}\n\t\t\t} else {\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content='Delete-option is not set in TypoScript';\n\t\t}\n\t\t$content=$content?$content:'No template for delete screen';\n\t\treturn $content;\n\t}",
"public function delete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$query = $this->podb->deleteFrom('detailfasilitaskesehatan')->where('id', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query->execute();\n\t\t\t$this->poflash->success('Detailfasilitaskesehatan has been successfully deleted', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t}\n\t}",
"public function perma_del($id)\n {\n if (! Gate::allows('type_of_institution_delete')) {\n return abort(401);\n }\n $type_of_institution = TypeOfInstitution::onlyTrashed()->findOrFail($id);\n $type_of_institution->forceDelete();\n\n return redirect()->route('admin.type_of_institutions.index');\n }",
"public function destroy($id)\n {\n $delete = ProjectType::find($id)->delete();\n\n return redirect()->route('project-type.index');\n }",
"public function destroy($id) \n {\n Soiltype::destroy($id);\n\n $soiltypes = Soiltype::where('systemID', app('system')->id)->get();\n return view('soiltypes.index', compact('soiltypes'));\n }",
"public function destroy($id)\n {\n table_schedule_type::find($id)->delete();\n return redirect('admin/schedule-type')->with('warning', 'Data have been removed!');\n \n }",
"public function getDelete($id)\n {\n $transmutation = Transmutation::find($id);\n // Show the page\n return view('transmutation/delete', compact('transmutation'));\n }",
"public function invoice_product_delete()\n {\n $data['nestedView']['pageTitle'] = 'Delete Invoice Product';\n $data['nestedView']['heading'] = \"Delete Invoice Product\";\n $data['nestedView']['cur_page'] = 'Delete Invoice Product';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Delete Invoice Product','class'=>'active','url'=>'');\n \n \n\n $data['flag']=1;\n $this->load->view('rollback_invoice/rollback_invoice_product_delete_view',$data);\n }",
"public function delete_record()\n {\n $id = $this->input->get('tpid');\n\n $result = $this->PumpModel->delete_data(array('tpid'=>$id));\n // print_r($result);die;\n redirect(base_url(). 'Pump');\n }",
"function mongo_node_page_delete($form, $form_state, $entity_type, $entity) {\n $form['#entity'] = $entity;\n $uri = entity_uri($entity_type, $entity);\n\n return confirm_form($form,\n t('Are you sure you want to delete %title', array('%title' => $entity->title)),\n $uri['path'],\n t('This action cannot be undone'),\n t('Delete'),\n t('Cancel')\n );\n}",
"public function destroy($tname)\n {\n DB::table('templates')->where('tname','=', $tname)->delete();\n\n Session::flash('message', 'Successfully deleted the template!');\n return Redirect::to('/templates');\n\n }",
"public function deleteAll($type)\n {\n try\n {\n if($type == 'projects')\n {\n //Get all deleted projects\n $projects = \\Project::onlyTrashed()->get()->toArray();\n if(sizeof($projects) != 0)\n {\n foreach($projects as $project)\n {\n //Get Tasks for project\n $tasks = \\Task::withTrashed()->where('project_id',$project['id'])->lists('id');\n if(sizeof($tasks) != 0)\n {\n //Delet Each Task\n foreach ($tasks as $task) \n {\n $result = static::deleteEntity($task,'task');\n }\n }\n //Delete Project\n $result = static::deleteEntity($project['id'],'project');\n }\n }\n //For Notifications \n \\Session::put('status','success');\n \\Session::put('message', 'Project Deleted');\n return \\View::make('dashboard.admin.data')\n ->with('data',null)\n ->with('type','Projects'); \n\n \n }\n elseif($type == 'tasks')\n {\n //Get all deleted tasks\n $tasks = \\Task::onlyTrashed()->get()->toArray();\n $data;\n if(sizeof($tasks) != 0)\n {\n //Delete Each Task\n foreach($tasks as $task)\n {\n $result = static::deleteEntity($task['id'],'task');\n\n }\n }\n //For Notifications\n \\Session::put('status','success');\n \\Session::put('message', 'Tasks Deleted');\n return \\View::make('dashboard.admin.data')\n ->with('data',null)\n ->with('type','Tasks'); \n \n }\n elseif($type == 'events')\n {\n //Permanently delete all events\n $events = \\Events::onlyTrashed()->forceDelete();\n //For Notifications\n \\Session::put('status','success');\n \\Session::put('message', 'Events Deleted');\n return \\View::make('dashboard.admin.data')\n ->with('data',null)\n ->with('type','Events'); \n\n }\n }\n catch(\\Exception $e)\n {\n\n \\Log::error('Something Went Wrong in Admin Data Controller - deleteAll():'.$e->getMessage());\n throw new \\SomethingWentWrongException();\n }\n\n }",
"public function destroy($id)\n {\n $condition = Product::has('product_type')->count();\n if($condition > 0) {\n return redirect()->route('product_type.index')->with('warning', 'Do not delete it, this product type is used in {{$condition}} products!');\n }\n else {\n $typedelete = ProductType::findOrFail($id);\n $typedelete->delete();\n return redirect()->route('product_type.index')->with('success', 'Deleted');\n }\n }",
"public function deleteAction(){\n //farewell brave knight, your cosmo will stay with us forever...\n $this->getDM()->remove($this->getKnight());\n $this->getDM()->flush();\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }",
"function deleteAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');//lay id cua record can xoa\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t//tien hanh xoa\n\t\t\tif($myProductCat->delete())\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succDelete']);\n\t\t\t\t\n\t\t\t\t$this->registry->me->writelog('ProductCategorydelete', $myProductCat->id, array('name' => $myProductCat->name[$langCode])); \t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['errDelete']);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t}\n\t\t\n\t\t$this->registry->smarty->assign(array('redirect' => $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t\t\n\t}",
"public function destroy($id)\n {\n $typeevent = TypeEvent::find($id);\n if($typeevent)\n $typeevent->delete();\n return redirect('/typeevent')->with(['success' => \"Type d'evenement Supprimé\"]);\n }",
"public function destroy(LoanType $type)\n {\n $loansCount = $type->loans_count;\n\n if ($loansCount) {\n flash()->error('Loan type is associated with loans. Cannot be deleted');\n return back();\n }\n\n $type->delete();\n flash()->success('Loan type deleted');\n\n return back();\n }"
]
| [
"0.7398255",
"0.69093573",
"0.6671923",
"0.6632658",
"0.6587023",
"0.6476143",
"0.6426598",
"0.6420932",
"0.63949794",
"0.6351616",
"0.63038784",
"0.6283032",
"0.62608093",
"0.62583864",
"0.6202466",
"0.6190539",
"0.618413",
"0.6167829",
"0.6167357",
"0.6156113",
"0.6105502",
"0.608987",
"0.60712594",
"0.60692877",
"0.60625917",
"0.60523665",
"0.6048975",
"0.60484797",
"0.60456324",
"0.6039795",
"0.6028221",
"0.6017108",
"0.6002928",
"0.6002928",
"0.5960434",
"0.59598184",
"0.59359664",
"0.5927217",
"0.5922911",
"0.5920197",
"0.5917089",
"0.591678",
"0.5908801",
"0.590738",
"0.5906435",
"0.59058106",
"0.5901982",
"0.5894186",
"0.5881266",
"0.5881202",
"0.58659256",
"0.586372",
"0.58567214",
"0.58521754",
"0.58505356",
"0.58477724",
"0.58372074",
"0.5823587",
"0.5821362",
"0.58183914",
"0.5813449",
"0.5811578",
"0.57988197",
"0.5795584",
"0.5781992",
"0.5774625",
"0.5765917",
"0.57644975",
"0.5763788",
"0.5751977",
"0.57457376",
"0.57299876",
"0.5722953",
"0.57146174",
"0.5712486",
"0.571201",
"0.571071",
"0.570726",
"0.5704865",
"0.5703442",
"0.5701483",
"0.57004684",
"0.57003945",
"0.5700029",
"0.5694918",
"0.5686347",
"0.56803954",
"0.5679057",
"0.56783694",
"0.567326",
"0.5672547",
"0.5665013",
"0.56639695",
"0.5659608",
"0.5655001",
"0.565454",
"0.5649713",
"0.5648563",
"0.56427497",
"0.5639394",
"0.5634141"
]
| 0.0 | -1 |
Determine if we can create a service with name | public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
if ($serviceLocator instanceof CommandFactoryLoader) {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canCreate(ContainerInterface $container, string $service): bool;",
"public function serviceExists(string $serviceName): bool;",
"public function canCreate(string $name) : bool\n {\n $class = $this->getClassName($name);\n return (class_exists($class) && ! interface_exists($class));\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n return true;\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n return count($this->getServiceRegistry()->queryForName($name)) > 0 || count($this->getServiceRegistry()->queryForName($requestedName));\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $services, $name, $requestedName)\n {\n return $this->canCreate($services, $requestedName);\n }",
"private function canServiceBeUsedWithReflectionBasedFactory(string $service): bool\n {\n if (! class_exists($service)) {\n return false;\n }\n\n if (PHP_VERSION_ID < 80100) {\n return true;\n }\n\n return ! enum_exists($service);\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $explodedName = explode('.', $requestedName);\n\n if(isset($explodedName[1])) {\n return $explodedName[1] === $this->getFactoryType();\n }\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $services, $name, $requestedName)\n {\n $config = $this->getConfig($services);\n if (empty($config)) {\n return false;\n }\n\n return (\n isset($config[$requestedName])\n && is_array($config[$requestedName])\n );\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)\n {\n return $this->canCreate($container, $requestedName);\n }",
"public function canCreate(ContainerInterface $container, string $requestedName): bool;",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $config = $this->getConfig($serviceLocator);\n if (empty($config)) {\n return false;\n }\n\n if (isset($config[$requestedName])\n && is_array($config[$requestedName])\n && !empty($config[$requestedName])\n ) {\n return true;\n }\n return false;\n }",
"final public function hasService($name)\n {\n $services = $this->getServices();\n return isset($services[$name]);\n }",
"public function serviceCreate(Request $requestParams): bool\n {\n }",
"public function serviceCreate(Request $requestParams): bool\n {\n }",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (0 !== strpos($requestedName, self::SERVICE_PREFIX)) {\n return false;\n }\n $config = $this->getConfig($container);\n\n return $this->hasNamedConfig($requestedName, $config);\n }",
"public function canCreate(string $name) : bool;",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $config = $serviceLocator->get('config');\n\n if(empty($config)){\n return false;\n }\n\n return isset($config[$this->configKey][$requestedName]);\n\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $controllerManager, $name, $requestedName)\n {\n $container = $controllerManager->getServiceLocator() ?: $controllerManager;\n return $this->canCreate($container, $requestedName);\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) : bool\n {\n $requestedName = $requestedName.'Controller';\n\n if ($requestedName !== 'SD\\Admin\\Controller\\SettingsController') {\n return class_exists($requestedName);\n }\n\n return false;\n }",
"public function exists($name)\n {\n return isset($this->services[$name]);\n }",
"public function isService(string $serviceId): bool;",
"public function isService() {\n\t\treturn true;\n\t}",
"public function hasServer(string $name): bool {}",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n /* We check, if $requestedName ends with the string '/Events'.\n * Instead of parsing the string with regular expressions (eg. ~/Events$~),\n * it's more efficient to just check with strpos, if the reversed string starts\n * with the reverted '/Events' string.\n */\n return 0 === strpos(strrev($requestedName), 'stnevE/');\n }",
"abstract public function getServiceName();",
"public function has($name)\n {\n if (!is_string($name)) {\n throw new \\InvalidArgumentException(sprintf(\n 'The name parameter must be of type string, %s given',\n is_object($name) ? get_class($name) : gettype($name)\n ));\n }\n\n $serviceName = strtolower($name);\n\n if ($this->hasAlias($serviceName)) {\n $serviceName = $this->aliasDefinitions[$serviceName];\n }\n\n return isset($this->services[$serviceName]) || array_key_exists($serviceName, $this->services);\n }",
"public function hasOperation($name);",
"public function isService() {\r\n\t\treturn false;\r\n\t}",
"public function testGetWillCreateAndReturnUnregisteredServiceIfTheNameResolvesToAValidClassName(): void\n {\n $container = new Container();\n\n $name = \\stdClass::class;\n $this->assertFalse($container->has($name));\n $service = $container->get(\\stdClass::class);\n\n $this->assertInstanceOf($name, $service);\n $this->assertTrue($container->has($name));\n $this->assertSame($service, $container->get($name));\n }",
"public function serviceTypeNameIsUnique($name){\n $dql = \"SELECT s from ServiceType s\n WHERE s.name = :name\";\n $query = $this->em->createQuery($dql);\n $result = $query->setParameter('name', $name)->getResult();\n\n if(count($result)==0){\n return true;\n }\n else {\n return false;\n }\n\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n if ($serviceLocator instanceof AbstractPluginManager) {\n $serviceLocator = $serviceLocator->getServiceLocator();\n }\n\n $config = $this->getConfig($serviceLocator);\n if (empty($config)) {\n return false;\n }\n\n return (\n isset($config[$requestedName])\n && is_array($config[$requestedName])\n && !empty($config[$requestedName])\n && isset($config[$requestedName]['model'])\n && is_string($config[$requestedName]['model'])\n );\n }",
"public function hasFactory($name)\n {\n return array_key_exists($name, $this->factories);\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n// return (substr($requestedName, 0, strlen('application.table.')) == 'application.table.') || (substr($requestedName, 0, strlen('quiz.table.')) == 'quiz.table.');\n return (strpos($requestedName, '.model.table.') !== false);\n }",
"public function has($name): bool\r\n {\r\n try {\r\n return $this->adapter->hasService($name);\r\n } catch (AdapterException $e) {\r\n $errorMessage = sprintf('The has() failed for service \\'%s\\' : %s', $name, $e->getMessage());\r\n\r\n $this->logger->debug($errorMessage, ['exception' => $e, 'name' => $name]);\r\n\r\n throw new Exception\\ContainerException($errorMessage, $e->getCode(), $e);\r\n }\r\n }",
"public function hasFactory($name)\n {\n return isset($this->factories[$name]) ? true : false;\n }",
"function _wsdl_docs_service_create($data) {\n // Confirm service name is unique\n $service_id = _wsdl_docs_get_service_id($data['name']);\n if ($service_id) {\n return 'Service with this name already exists';\n }\n // Create new WSDL service.\n $service = entity_create('wsclient_service', array('type' => 'soap'));\n $service->label = $data['name'];\n $service->name = strtolower(str_replace('-', '_', str_replace(' ', '_', $data['name'])));\n $service->save();\n $name = $data['name'];\n $id = $service->id;\n return \"WSDL service $name, ID: $id added.\";\n}",
"public function &getService(string $name, bool $create = true): Service {\n\n # Is there a Service for that name?\n if (!isset($this->services[$name])) {\n throw new \\Exception('Service Not Found');\n }\n\n # A string will be treated as classname: an service object will be created and stored.\n if (is_string($this->services[$name])) {\n if ($create) {\n $classname = $this->services[$name];\n if (!class_exists($classname)) {\n throw new \\Exception('service \"' . $classname . '\" not found');\n }\n # maybe not needed to store the object ...\n $this->services[$name] = new $classname($this, $this->getRequest());\n } else {\n throw new \\Exception('Service Not Found');\n }\n }\n\n $service = $this->services[$name];\n return $service;\n }",
"public function isServiceLoaded(string $serviceName): bool;",
"public function hasService($name, $resolve = TRUE) {\n if(array_key_exists($name, $this->services)) {\n return TRUE;\n }\n\n if(!$resolve) {\n return FALSE;\n }\n\n $classname = \"Loops\\\\Service\\\\\".Misc::camelize($name);\n\n if(class_exists($classname)) {\n $reflection = new ReflectionClass($classname);\n\n if($reflection->implementsInterface(\"Loops\\ServiceInterface\")) {\n if(!$classname::hasService($this)) {\n return FALSE;\n }\n $this->registerService($name, $classname, [], $classname::isShared($this));\n }\n }\n\n return $this->hasService($name, FALSE);\n }",
"public function create(): bool;",
"public function isSingleton(string $serviceId): bool;",
"public function canCreate(ContainerInterface $container, $requestedName): bool\n {\n return $requestedName === CrawlImageStrategy::class || $requestedName === CrawlLinkStrategy::class;\n }",
"public function isCreateResource();",
"static function isName($name)\n {\n return in_array($name, array(\"close_connection\",\n \"savepoint\",\n \"savepoint_rollback\",\n \"savepoint_release\",\n \"commit\",\n \"rollback\",\n \"prepare\",\n \"recover\",\n \"commit_by_xid\",\n \"rollback_by_xid\",\n \"create_cursor_read_view\",\n \"set_cursor_read_view\",\n \"close_cursor_read_view\",\n \"create_handler\",\n \"drop_database\",\n \"panic_call\",\n \"release_temporary_latches\",\n \"update_statistics\",\n \"start_snapshot\",\n \"flush_logs\",\n \"show_status\",\n \"partition_flags\",\n \"alter_table_flags\",\n \"alter_tablespace\",\n \"fill_files_table\",\n \"binlog_func\",\n \"binlog_log_query\"\n ));\n }",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (! $container->has('config')) {\n return false;\n }\n\n $config = $container->get('config');\n if (! isset($config['zf-rpc'][$requestedName])) {\n return false;\n }\n\n $config = $config['zf-rpc'][$requestedName];\n\n if (! is_array($config)\n || ! isset($config['callable'])\n ) {\n return false;\n }\n\n return true;\n }",
"protected function checkService(string $name): void\n {\n if (!isset($this->mapper[$name])) {\n throw new Exception(\"Service \" . $name . \" is not registered\");\n }\n }",
"public function hasResource($name)\n {\n if (strtolower($name) == 'zf2') {\n return parent::hasResource('zf2');\n }\n $service = $this->resolveResourceToServiceName($name);\n $serviceLocator = $this->getResource('zf2')->getServiceManager();\n\n // return registered resource or proxy to service locator to allow\n // greater backwards compatibility while utilizing service locator\n return parent::hasResource($name) || $serviceLocator->has($service);\n }",
"public function addService(string $title, string $content, string $file_name):bool\n {\n $addService = $this->pdo->prepare('INSERT INTO services(title, content, file_name) VALUES(:title, :content, :file_name)');\n\n $addService->bindValue(':title', $title);\n $addService->bindValue(':content', $content);\n $addService->bindValue(':file_name', $file_name);\n\n $service =$addService->execute();\n return $service;\n }",
"public function canCreate(ContainerInterface $container, $requestedName)\r\n {\r\n // TODO: Implement canCreate() method.\r\n }",
"public function testCreateService()\n {\n\n }",
"public static function getOrCreate(string $name)\n {\n $service = static::$services[$name];\n\n if (null === $service) {\n static::$services[$name] = new $name();\n return static::$services[$name];\n }\n\n return $service;\n }",
"public function create(): bool\n {\n return true;\n }",
"public function isMachine($name);",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n return strstr($requestedName, __NAMESPACE__.'\\Controller') !== false;\n }",
"protected function buildExistentService($serviceName)\n {\n $serviceDefinition = $this->services->get($serviceName);\n $serviceReflectionClass = new ReflectionClass($serviceDefinition->getClass());\n $serviceArguments = array();\n\n /**\n * Each argument is built recursively. If the argument is defined\n * as a service we will return the value of the get() call.\n *\n * Otherwise, if is defined as a parameter we will return the\n * parameter value\n *\n * Otherwise, we will treat the value as a plain value, not precessed.\n */\n $serviceDefinition\n ->getArgumentChain()\n ->each(function (Argument $argument) use (&$serviceArguments) {\n\n $argumentValue = $argument->getValue();\n if ($argument instanceof ServiceArgument) {\n\n $serviceArguments[] = $this->get($argumentValue);\n } elseif ($argument instanceof ParameterArgument) {\n\n $serviceArguments[] = $this->getParameter($argumentValue);\n } else {\n\n $serviceArguments[] = $argumentValue;\n }\n });\n\n return $serviceReflectionClass->newInstanceArgs($serviceArguments);\n }",
"function have_services(){\n\t$services = get_services();\n\treturn !empty($services) && is_array($services);\n}",
"public function canCreate();",
"public function canCreate();",
"private function generateService($name)\n\t{\n\t\t$def = $this->builder->getDefinition($name);\n\n\t\tif ($def->isDynamic()) {\n\t\t\treturn PhpHelpers::formatArgs('throw new Nette\\\\DI\\\\ServiceCreationException(?);',\n\t\t\t\t[\"Unable to create dynamic service '$name', it must be added using addService()\"]\n\t\t\t);\n\t\t}\n\n\t\t$entity = $def->getFactory()->getEntity();\n\t\t$serviceRef = $this->builder->getServiceName($entity);\n\t\t$factory = $serviceRef && !$def->getFactory()->arguments && !$def->getSetup() && $def->getImplementMode() !== $def::IMPLEMENT_MODE_CREATE\n\t\t\t? new Statement(['@' . ContainerBuilder::THIS_CONTAINER, 'getService'], [$serviceRef])\n\t\t\t: $def->getFactory();\n\n\t\t$this->currentService = null;\n\t\t$code = '$service = ' . $this->formatStatement($factory) . \";\\n\";\n\n\t\tif (\n\t\t\t(PHP_VERSION_ID < 70000 || $def->getSetup())\n\t\t\t&& ($type = $def->getType())\n\t\t\t&& !$serviceRef && $type !== $entity\n\t\t\t&& !(is_string($entity) && preg_match('#^[\\w\\\\\\\\]+\\z#', $entity) && is_subclass_of($entity, $type))\n\t\t) {\n\t\t\t$code .= PhpHelpers::formatArgs(\"if (!\\$service instanceof $type) {\\n\"\n\t\t\t\t. \"\\tthrow new Nette\\\\UnexpectedValueException(?);\\n}\\n\",\n\t\t\t\t[\"Unable to create service '$name', value returned by factory is not $type type.\"]\n\t\t\t);\n\t\t}\n\n\t\t$this->currentService = $name;\n\t\tforeach ($def->getSetup() as $setup) {\n\t\t\t$code .= $this->formatStatement($setup) . \";\\n\";\n\t\t}\n\n\t\t$code .= 'return $service;';\n\n\t\tif (!$def->getImplement()) {\n\t\t\treturn $code;\n\t\t}\n\n\t\t$factoryClass = (new Nette\\PhpGenerator\\ClassType)\n\t\t\t->addImplement($def->getImplement());\n\n\t\t$factoryClass->addProperty('container')\n\t\t\t->setVisibility('private');\n\n\t\t$factoryClass->addMethod('__construct')\n\t\t\t->addBody('$this->container = $container;')\n\t\t\t->addParameter('container')\n\t\t\t\t->setTypeHint($this->className);\n\n\t\t$rm = new \\ReflectionMethod($def->getImplement(), $def->getImplementMode());\n\n\t\t$factoryClass->addMethod($def->getImplementMode())\n\t\t\t->setParameters($this->convertParameters($def->parameters))\n\t\t\t->setBody(str_replace('$this', '$this->container', $code))\n\t\t\t->setReturnType(PHP_VERSION_ID >= 70000 ? (Reflection::getReturnType($rm) ?: $def->getType()) : null);\n\n\t\tif (PHP_VERSION_ID < 70000) {\n\t\t\t$this->generatedClasses[] = $factoryClass;\n\t\t\t$factoryClass->setName(str_replace(['\\\\', '.'], '_', \"{$this->className}_{$def->getImplement()}Impl_{$name}\"));\n\t\t\treturn \"return new {$factoryClass->getName()}(\\$this);\";\n\t\t}\n\n\t\treturn 'return new class ($this) ' . $factoryClass . ';';\n\t}",
"function check_requirements()\n\t{\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id FROM services WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t$sql_obj->execute();\n\n\t\tif (!$sql_obj->num_rows())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested service (\". $this->id .\") does not exist - possibly the service has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\t\treturn 1;\n\t}",
"public function hasNamed(string $name): bool;",
"public function hasDependency(string $name): bool;",
"public function has(string $name): bool\n {\n try {\n $result = $this->configCommand($name);\n } catch (RuntimeException $exception) {\n return false;\n }\n\n return $result->isSuccessful();\n }",
"public function has(string $serviceId): bool;",
"public function isCreatable();",
"protected function is_service_allowed($path) {\n\t\treturn true;\n\t}",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (! $container->has('config') || ! array_key_exists(self::class, $container->get('config'))) {\n return false;\n }\n $config = $container->get('config');\n $dependencies = $config['mamaz_db'];\n return is_array($dependencies);\n }",
"public function hasService(string $id): bool\n {\n return isset($this->getServices()[$id]);\n }",
"public function testHasWillAssertBooleanTrueForRegisteredService(): void\n {\n $container = new Container();\n\n $name = \\stdClass::class;\n $service = new \\stdClass();\n\n $this->assertFalse($container->has($name));\n\n $container->set($name, $service);\n\n $this->assertTrue($container->has($name));\n }",
"public function isCreate()\n {\n $route = request()->route();\n\n if (request()->method() != 'GET') {\n return request()->method() == 'POST'\n && count(explode('/', Str::after(request()->url(), '/api/'))) == 1;\n }\n\n return str_contains(optional($route)->getName(), '.create')\n || Str::endsWith(optional($route)->getName(), '.store');\n }",
"protected function _service( $name ) {\n\n\t\tif ( !isset( $this->_services[ $name ])) {\n\t\t\tthrow new Exception( \"The '$service' service is not configured.\" );\n\t\t}\n\n\t\treturn $this->_services[ $name ];\n\t}",
"protected function createInterface()\n {\n $classNameService = $this->argument('name');\n\n\n $this->call('make:service_interface', [\n 'name' => \"{$classNameService}Interface\",\n ]);\n }",
"protected function performCreate(): bool\n {\n // Abort if resource does not support create operations\n if (!$this->isCreatable()) {\n throw new UnsupportedOperation(sprintf('API does not support create operation for %s resources', $this->resourceNameSingular()));\n }\n\n $prepared = $this->prepareBeforeCreate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->post($this->endpoint(), $payload);\n\n // Extract and (re)populate resource\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function hasInstance(string $name): bool\n {\n return array_key_exists($name, $this->instances);\n }",
"public function creating(Service $Service)\n {\n //code...\n }",
"public function isFactoryBean ($beanName);",
"public function exists($name);",
"public function exists($name);",
"public function exists($name);",
"public function exists($name);",
"public function exists($name);",
"public function exists($name);",
"public function processExists($name)\n {\n return (bool) $this->getProcessConfig($name);\n }",
"public function create($data, &$form){\n $entity = new ServiceEntity();\n $em = $this->getEntityManager();\n\n $form->bind($entity);\n $form->setData($data);\n if (!$form->isValid()) return false;\n\n // we rename the file with a unique name\n $newName = FileUtilService::rename($data['service']['thumbnail'], 'images/services', \"service\");\n\n foreach(ServiceEntity::$thumbnailVariations as $variation){\n $result = FileUtilService::resize($newName,'images/services', $variation[\"width\"], $variation[\"height\"]);\n if(!$result) {\n $this->message = $result;\n return false;\n }\n }\n\n $entity->setThumbnail($newName);\n $entity->setUrl($this->getServiceUrl($entity));\n try {\n $em->persist($entity);\n $em->flush();\n $this->message = $this->getTranslator()->translate($this->getVocabulary()[\"MESSAGE_SERVICE_CREATED\"]);\n return true;\n } catch (\\Exception $e) {\n $this->message = $this->getTranslator()->translate($this->getVocabulary()[\"MESSAGE_SERVICE_NOT_CREATED\"]);\n return false;\n }\n }",
"public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }",
"public function canCreateFromAbstractFactory($cName, $rName)\n {\n if (array_key_exists($cName, $this->nestedContext)) {\n $context = $this->nestedContext[$cName];\n if ($context === false) {\n return false;\n } elseif (is_object($context)) {\n return !isset($this->pendingAbstractFactoryRequests[get_class($context).$cName]);\n }\n }\n $this->checkNestedContextStart($cName);\n // check abstract factories\n $result = false;\n $this->nestedContext[$cName] = false;\n foreach ($this->abstractFactories as $abstractFactory) {\n $pendingKey = get_class($abstractFactory).$cName;\n if (isset($this->pendingAbstractFactoryRequests[$pendingKey])) {\n $result = false;\n break;\n }\n\n if ($abstractFactory->canCreateServiceWithName($this, $cName, $rName)) {\n $this->nestedContext[$cName] = $abstractFactory;\n $result = true;\n break;\n }\n }\n $this->checkNestedContextStop();\n return $result;\n }",
"public function serverExists(string $name): bool\n {\n $path = Util::makePath(self::getConfigValue(JSONDBConfig::CONFIG_STORAGE_PATH), \"servers\", $name);\n return file_exists($path) && is_dir($path);\n }",
"protected function alreadyExists($name)\r\n {\r\n return class_exists($name);\r\n }",
"public function create($name)\n {\n if (is_array($name)) {\n list($cName, $rName) = $name;\n } else {\n $rName = $name;\n\n // inlined code from ServiceManager::canonicalizeName for performance\n if (isset($this->canonicalNames[$rName])) {\n $cName = $this->canonicalNames[$name];\n } else {\n $cName = $this->canonicalizeName($name);\n }\n }\n\n if (isset($this->delegators[$cName])) {\n return $this->createDelegatorFromFactory($cName, $rName);\n }\n\n return $this->doCreate($rName, $cName);\n }",
"public static function isValidName($name)\n {\n try {\n new static($name);\n } catch (Throwable $th) {\n return false;\n }\n\n return true;\n }",
"public function exists($name)\n {\n return ($this->isBasic($name) || $this->isDynamic($name));\n }",
"static public function hasInstance($name = 'main')\n {\n return isset(self::$instances[$name]);\n }",
"public function exists(string $name): bool\n {\n return isset($this->commands[$name]);\n }",
"public function inactive_client_cache_services($service_name)\r\n\t{\r\n\t\t$inactive_cache = array('SEARCH', 'GETCALENDARFARE', 'FARERULE');\r\n\t\t//$inactive_cache = array();\r\n\t\tif(in_array(strtoupper($service_name), $inactive_cache) == true){\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 testNewService()\n {\n $className = 'TechDivision\\ApplicationServer\\Api\\Mock\\MockService';\n $service = $this->service->newService($className);\n $this->assertInstanceOf($className, $service);\n }",
"public function create($name = false);",
"public function createService($serviceClass);",
"public function isServiceEnabled(): bool\n {\n return $this->getModuleRegistry()->isModuleEnabled(SchemaConfigurationFunctionalityModuleResolver::SCHEMA_CONFIGURATION);\n }",
"public function hasEnvironment($name);"
]
| [
"0.7183439",
"0.7112111",
"0.6851697",
"0.6819328",
"0.6770262",
"0.67630404",
"0.67038876",
"0.66979647",
"0.666754",
"0.66208583",
"0.65747863",
"0.65725744",
"0.6552689",
"0.65377414",
"0.65377414",
"0.6507546",
"0.64782494",
"0.64744806",
"0.6466327",
"0.64300704",
"0.62981874",
"0.6290183",
"0.6196369",
"0.6186826",
"0.61793244",
"0.61420995",
"0.61375445",
"0.61247057",
"0.6112201",
"0.6067445",
"0.5980789",
"0.5959182",
"0.593493",
"0.58983845",
"0.58587354",
"0.5852989",
"0.5849006",
"0.58291423",
"0.57863355",
"0.5756741",
"0.57249963",
"0.5717705",
"0.57071686",
"0.57045215",
"0.5679809",
"0.56742114",
"0.56671697",
"0.5632009",
"0.5614746",
"0.56009597",
"0.56006783",
"0.5576484",
"0.55725336",
"0.5563669",
"0.5561855",
"0.5552069",
"0.5547664",
"0.5511661",
"0.5511661",
"0.550244",
"0.54939467",
"0.5487662",
"0.5484351",
"0.5477103",
"0.5461626",
"0.5460204",
"0.5446289",
"0.5436727",
"0.5421121",
"0.5419036",
"0.5415012",
"0.54002315",
"0.5390744",
"0.5390579",
"0.53799593",
"0.53699833",
"0.5362837",
"0.53604186",
"0.53604186",
"0.53604186",
"0.53604186",
"0.53604186",
"0.53604186",
"0.53573096",
"0.5355231",
"0.53409296",
"0.5336521",
"0.53240407",
"0.53222173",
"0.53035533",
"0.5300115",
"0.52846724",
"0.5278102",
"0.52749527",
"0.52660114",
"0.5265481",
"0.5264524",
"0.5259663",
"0.5251859",
"0.52501"
]
| 0.6213584 | 22 |
Create service with name | public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
if (is_null($this->commandFactory)) {
$this->commandFactory = new CommandFactory();
}
return $this->commandFactory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _wsdl_docs_service_create($data) {\n // Confirm service name is unique\n $service_id = _wsdl_docs_get_service_id($data['name']);\n if ($service_id) {\n return 'Service with this name already exists';\n }\n // Create new WSDL service.\n $service = entity_create('wsclient_service', array('type' => 'soap'));\n $service->label = $data['name'];\n $service->name = strtolower(str_replace('-', '_', str_replace(' ', '_', $data['name'])));\n $service->save();\n $name = $data['name'];\n $id = $service->id;\n return \"WSDL service $name, ID: $id added.\";\n}",
"public function createService($serviceClass);",
"protected function createInterface()\n {\n $classNameService = $this->argument('name');\n\n\n $this->call('make:service_interface', [\n 'name' => \"{$classNameService}Interface\",\n ]);\n }",
"private function generateService($name)\n\t{\n\t\t$def = $this->builder->getDefinition($name);\n\n\t\tif ($def->isDynamic()) {\n\t\t\treturn PhpHelpers::formatArgs('throw new Nette\\\\DI\\\\ServiceCreationException(?);',\n\t\t\t\t[\"Unable to create dynamic service '$name', it must be added using addService()\"]\n\t\t\t);\n\t\t}\n\n\t\t$entity = $def->getFactory()->getEntity();\n\t\t$serviceRef = $this->builder->getServiceName($entity);\n\t\t$factory = $serviceRef && !$def->getFactory()->arguments && !$def->getSetup() && $def->getImplementMode() !== $def::IMPLEMENT_MODE_CREATE\n\t\t\t? new Statement(['@' . ContainerBuilder::THIS_CONTAINER, 'getService'], [$serviceRef])\n\t\t\t: $def->getFactory();\n\n\t\t$this->currentService = null;\n\t\t$code = '$service = ' . $this->formatStatement($factory) . \";\\n\";\n\n\t\tif (\n\t\t\t(PHP_VERSION_ID < 70000 || $def->getSetup())\n\t\t\t&& ($type = $def->getType())\n\t\t\t&& !$serviceRef && $type !== $entity\n\t\t\t&& !(is_string($entity) && preg_match('#^[\\w\\\\\\\\]+\\z#', $entity) && is_subclass_of($entity, $type))\n\t\t) {\n\t\t\t$code .= PhpHelpers::formatArgs(\"if (!\\$service instanceof $type) {\\n\"\n\t\t\t\t. \"\\tthrow new Nette\\\\UnexpectedValueException(?);\\n}\\n\",\n\t\t\t\t[\"Unable to create service '$name', value returned by factory is not $type type.\"]\n\t\t\t);\n\t\t}\n\n\t\t$this->currentService = $name;\n\t\tforeach ($def->getSetup() as $setup) {\n\t\t\t$code .= $this->formatStatement($setup) . \";\\n\";\n\t\t}\n\n\t\t$code .= 'return $service;';\n\n\t\tif (!$def->getImplement()) {\n\t\t\treturn $code;\n\t\t}\n\n\t\t$factoryClass = (new Nette\\PhpGenerator\\ClassType)\n\t\t\t->addImplement($def->getImplement());\n\n\t\t$factoryClass->addProperty('container')\n\t\t\t->setVisibility('private');\n\n\t\t$factoryClass->addMethod('__construct')\n\t\t\t->addBody('$this->container = $container;')\n\t\t\t->addParameter('container')\n\t\t\t\t->setTypeHint($this->className);\n\n\t\t$rm = new \\ReflectionMethod($def->getImplement(), $def->getImplementMode());\n\n\t\t$factoryClass->addMethod($def->getImplementMode())\n\t\t\t->setParameters($this->convertParameters($def->parameters))\n\t\t\t->setBody(str_replace('$this', '$this->container', $code))\n\t\t\t->setReturnType(PHP_VERSION_ID >= 70000 ? (Reflection::getReturnType($rm) ?: $def->getType()) : null);\n\n\t\tif (PHP_VERSION_ID < 70000) {\n\t\t\t$this->generatedClasses[] = $factoryClass;\n\t\t\t$factoryClass->setName(str_replace(['\\\\', '.'], '_', \"{$this->className}_{$def->getImplement()}Impl_{$name}\"));\n\t\t\treturn \"return new {$factoryClass->getName()}(\\$this);\";\n\t\t}\n\n\t\treturn 'return new class ($this) ' . $factoryClass . ';';\n\t}",
"public static function service($name)\n {\n return Container::getInstance()->make($name);\n }",
"public function creating(Service $Service)\n {\n //code...\n }",
"public function create($name);",
"public function &getService(string $name, bool $create = true): Service {\n\n # Is there a Service for that name?\n if (!isset($this->services[$name])) {\n throw new \\Exception('Service Not Found');\n }\n\n # A string will be treated as classname: an service object will be created and stored.\n if (is_string($this->services[$name])) {\n if ($create) {\n $classname = $this->services[$name];\n if (!class_exists($classname)) {\n throw new \\Exception('service \"' . $classname . '\" not found');\n }\n # maybe not needed to store the object ...\n $this->services[$name] = new $classname($this, $this->getRequest());\n } else {\n throw new \\Exception('Service Not Found');\n }\n }\n\n $service = $this->services[$name];\n return $service;\n }",
"public static function getOrCreate(string $name)\n {\n $service = static::$services[$name];\n\n if (null === $service) {\n static::$services[$name] = new $name();\n return static::$services[$name];\n }\n\n return $service;\n }",
"public function create($name)\n {\n if (is_array($name)) {\n list($cName, $rName) = $name;\n } else {\n $rName = $name;\n\n // inlined code from ServiceManager::canonicalizeName for performance\n if (isset($this->canonicalNames[$rName])) {\n $cName = $this->canonicalNames[$name];\n } else {\n $cName = $this->canonicalizeName($name);\n }\n }\n\n if (isset($this->delegators[$cName])) {\n return $this->createDelegatorFromFactory($cName, $rName);\n }\n\n return $this->doCreate($rName, $cName);\n }",
"protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }",
"public function createService(AccountServiceManagerInterface $sl);",
"public function creating(Service $service)\n {\n $service->slug = Str::slug($service->name);\n }",
"public function createService(\n ServiceLocatorInterface $services,\n $canonicalName = null,\n $requestedName = StorageInterface::class\n ) {\n return $this($services, $requestedName);\n }",
"public function createFSService();",
"public function create($name, array $args = NULL)\n {\n if(!$this->exists($name)) { // assume that this is the class name\n $this->register($name, $name); // assume that this is an class name\n }\n\n // add arguments case available\n if($args) {\n $service = clone $this->services[$name];\n foreach($args as $name => $value) {\n $service->addNamedArg($name, $value);\n }\n\n return $service->create();\n }\n\n return $this->services[$name]->create();\n }",
"private function createService($name, $serviceFile, $module, $author, $email)\n {\n $template = file_get_contents(\n __DIR__.DIRECTORY_SEPARATOR.\"templates\".DIRECTORY_SEPARATOR.\"front_service.tpl\"\n );\n\n $name = $this->getModuleFileName($module).'.'.$name;\n\n $template = str_replace('$name', $name, $template);\n $template = str_replace('$module',$module, $template);\n $template = str_replace('$author', $author, $template);\n $template = str_replace('$email', $email, $template);\n\n file_put_contents($serviceFile.'.js', $template);\n }",
"abstract public function getServiceName();",
"public function create_command($service_name) {\n\n // $doctrine represents the database configuration\n $doctrine = $this->sm->get($service_name);\n // schema represents manipulations over tables (alter, drop, create)\n $schema = $doctrine->get_schema();\n\n if(!$doctrine) {\n $this->shell->write_line('Service \"' . $service_name . '\" not found.');\n return;\n }\n \n $schema->create(); // we get the sql (array)\n\n $this->shell->offset = 2;\n\n $this->output->write_line(\n $this->formater->set_color(\n 'Tables created', 'green'\n )\n );\n }",
"public function testCreateService()\n {\n\n }",
"public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $explodedName = explode('.', $requestedName);\n\n $className = '';\n foreach ($explodedName as $nameSpace) {\n $className .= '\\\\' . \\ucfirst(StaticFilter::execute($nameSpace, 'Word\\DashToCamelCase'));\n }\n\n if (class_exists($className)) {\n return new $className;\n }\n\n throw new Exception('No service available for class name ' . (string)$className);\n }",
"public function testNewService()\n {\n $className = 'TechDivision\\ApplicationServer\\Api\\Mock\\MockService';\n $service = $this->service->newService($className);\n $this->assertInstanceOf($className, $service);\n }",
"public function getServiceGenerator($type, $name);",
"public static function createNamed($name, $cache = false) {}",
"public function createServiceWithName(ServiceLocatorInterface $services, $name, $requestedName)\n {\n return $this($services, $requestedName);\n }",
"public function create($serviceName, $context='default', $fallBackToDefaultContext=false)\n {\n $service = null;\n $serviceLocation = $this->hasService($serviceName, $context);\n\n switch($serviceLocation) {\n case self::SERVICE_NOT_FOUND:\n // If we don't have a service for the specified service and we do not\n // allow falling back to the default context, freak out.\n $this->logger->log(\"No service $serviceName for that context. Checking if I should look in default: \" . strcasecmp($context, 'default'));\n if (strcasecmp($context, 'default') != 0 && $fallBackToDefaultContext) {\n // Try to get the job done with the default context\n $service = $this->create($serviceName, 'default');\n }\n\n // We have no clue how to build this thing, let's just try it\n // and hope we don't light the atmosphere on fire.\n if (is_null($service)) {\n $this->logger->log(\"Could not build it using default context, trying to instantiate it\");\n $service = $this->getBuilder()->getUsingSimpleInstantiation($serviceName, 'default');\n }\n\n break;\n\n case self::SERVICE_IN_BUILDER:\n $this->logger->log(\"Service $serviceName found in builder\");\n $service = $this->getBuilder()->get($serviceName, $context);\n break;\n }\n\n return $service;\n }",
"public function create($service, $entity);",
"function &loadService( $name, $bundleId = '', $options = array() ) {\n\t\tif ( !isset( $this->services[$name] ) ) {\n\t\t\tif ( isset( $this->captures[$name] ) ) {\n\t\t\t\tif ( is_array( $this->captures[$name] ) ) {\n\t\t\t\t\tlist( $bundleId, $options ) = $this->captures[$name];\n\t\t\t\t} else {\n\t\t\t\t\t$bundleId = $this->captures[$name];\n\t\t\t\t}\n\t\t\t} elseif ( empty( $bundleId ) ) {\n\t\t\t\t$bundleId = $name;\n\t\t\t}\n\t\t\t$this->services[$name] =& XOS::create( $bundleId, $options );\n\t\t}\n\t\treturn $this->services[$name];\n\t}",
"protected function factorySynchronizer( $serviceName ) {\n\n $class = 'ifrin\\\\SyncSocial\\\\components\\\\services\\\\' . ucfirst( $serviceName );\n if ( class_exists( $class ) ) {\n\n $settings = isset( $this->settings[ $serviceName ] ) ? $this->settings[ $serviceName ] : [ ];\n $connection = isset( $settings['connection'] ) ? $settings['connection'] : [ ];\n\n $key = isset( $connection['key'] ) ? $connection['key'] : null;\n $secret = isset( $connection['secret'] ) ? $connection['secret'] : null;\n $url = $this->getConnectUrl( $serviceName );\n\n $credentials = new Credentials( $key, $secret, $url );\n\n $service = $this->factory->createService( $serviceName, $credentials, $this->storage );\n $options = isset( $settings['options'] ) ? $settings['options'] : [ ];\n\n return new $class( $service, $options );\n }\n }",
"public function createServiceWithName(ServiceLocatorInterface $services, $name, $requestedName)\n {\n $config = $this->getConfig($services);\n $options = (!empty($config[$requestedName])) ? $config[$requestedName]: null;\n return new Client(null, $options);\n }",
"public function created(Service $service)\n {\n //\n }",
"public function getService($name)\n {\n if (!isset($this->_instances[$name])) {\n if (!$this->_services) {\n $this->_services = $this->config->getConfig('services');\n }\n if (!isset($this->_services[$name])) {\n throw new \\Exception(\n 'Undefined service : ' . $name\n );\n }\n $this->_instances[$name] = new $this->_services[$name]($this);\n }\n return $this->_instances[$name];\n }",
"protected function instantiate_service( $class_name ): Service {\n\t\t/*\n\t\t * If the service is not registerable, we default to lazily instantiated\n\t\t * services here for some basic optimization.\n\t\t *\n\t\t * The services will be properly instantiated once they are retrieved\n\t\t * from the service container.\n\t\t */\n\t\tif ( ! is_a( $class_name, Registerable::class, true ) ) {\n\t\t\treturn new LazilyInstantiatedService(\n\t\t\t\tfn() => $this->injector->make( $class_name )\n\t\t\t);\n\t\t}\n\n\t\t// The service needs to be registered, so instantiate right away.\n\t\t$service = $this->injector->make( $class_name );\n\n\t\tif ( ! $service instanceof Service ) {\n\t\t\tthrow InvalidService::from_service( $service ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t}\n\n\t\treturn $service;\n\t}",
"public function create($name = false);",
"public function created(Service $Service)\n {\n //code...\n }",
"public function create($serviceManager);",
"public function service($name, $service)\n\t{\n\t\t$dependenciesAndService = self::getDependencyArray($service);\n\t\t\n\t\treturn $this->provider(\n\t\t\t$name, \n\t\t\tnew Provider(['Injector', function($injector) use ($dependenciesAndService) {\n\t\t\t\t\treturn $injector->instantiate($dependenciesAndService);\n\t\t\t}])\n\t\t);\n\t}",
"protected function createCall($service_name) {\n $em = $this->getEM();\n $zona = new \\DateTimeZone('Europe/Rome');\n $repository = $em->getRepository('Ephp\\Bundle\\WsInvokerBundle\\Entity\\Help\\Service');\n $service = $repository->find($service_name);\n $this->persist = $service->getEnableLog();\n try {\n $em->beginTransaction();\n $call = new LogCall();\n $call->setService($service);\n $call->setSendedAt(new \\DateTime('now', $zona));\n if ($this->persist) {\n $em->persist($call);\n $em->flush();\n }\n $em->commit();\n return $call;\n } catch (\\Exception $e) {\n $em->rollback();\n throw $e;\n }\n }",
"public function make($service, $username = '')\n {\n if ($username != '') {\n $this->client->setSubject($username);\n } else {\n $this->client->setSubject(array_get($this->config, 'service.username', $username));\n }\n $service = 'Google_Service_' . ucfirst($service);\n if (class_exists($service)) {\n $class = new \\ReflectionClass($service);\n\n return $class->newInstance($this->client);\n }\n throw new UnknownServiceException($service);\n }",
"public function createServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)\n {\n return $this($container, $requestedName);\n }",
"public function create(string $name, array $options = []);",
"protected function createFactory()\n {\n $factory = Str::studly(class_basename($this->argument('name')));\n\n $this->call('make:factory', [\n 'name' => \"{$factory}Factory\",\n '--model' => $this->qualifyClass($this->getNameInput()),\n ]);\n }",
"public function getService($name) {\n if(!$this->hasService($name)) {\n throw new Exception(\"Service '$name' does not exist.\");\n }\n\n if(array_key_exists($name, $this->shared_instances)) {\n return $this->shared_instances[$name];\n }\n\n $service = $this->createService($name, NULL, TRUE);\n\n if($this->services[$name][\"shared\"]) {\n $this->shared_instances[$name] = $service;\n }\n\n return $service;\n }",
"protected function createServiceClient(string $name, array $options = []): ServiceInterface\n {\n $entry = $this->manifest->getService($name);\n # we check for the manifest entry\n if (empty($entry)) {\n throw new ResourceNotFoundException('Could not find the client for the requested service '.$name);\n }\n $service = $entry['namespace'] . '\\\\' . $entry['client'];\n return new $service($this, $options);\n }",
"protected function buildExistentService($serviceName)\n {\n $serviceDefinition = $this->services->get($serviceName);\n $serviceReflectionClass = new ReflectionClass($serviceDefinition->getClass());\n $serviceArguments = array();\n\n /**\n * Each argument is built recursively. If the argument is defined\n * as a service we will return the value of the get() call.\n *\n * Otherwise, if is defined as a parameter we will return the\n * parameter value\n *\n * Otherwise, we will treat the value as a plain value, not precessed.\n */\n $serviceDefinition\n ->getArgumentChain()\n ->each(function (Argument $argument) use (&$serviceArguments) {\n\n $argumentValue = $argument->getValue();\n if ($argument instanceof ServiceArgument) {\n\n $serviceArguments[] = $this->get($argumentValue);\n } elseif ($argument instanceof ParameterArgument) {\n\n $serviceArguments[] = $this->getParameter($argumentValue);\n } else {\n\n $serviceArguments[] = $argumentValue;\n }\n });\n\n return $serviceReflectionClass->newInstanceArgs($serviceArguments);\n }",
"public function createService($name, ArrayObject $config = NULL, $merge_into_config = FALSE) {\n if($merge_into_config) {\n $service_config = $this->config->offsetExists($name) ? $this->config->offsetGet($name) : new ArrayObject;\n\n if(is_array($service_config)) {\n $service_config = ArrayObject::fromArray($service_config);\n }\n\n if($config) {\n $service_config->merge($config);\n }\n }\n else {\n $service_config = $config ?: new ArrayObject;\n }\n\n if(!$this->hasService($name)) {\n throw new Exception(\"Service '$name' does not exist.\");\n }\n\n $service = $this->services[$name];\n\n if(array_key_exists(\"classname\", $service)) {\n $reflection = new ReflectionClass($service[\"classname\"]);\n\n $params = new ArrayObject($service[\"params\"]);\n $params->merge($service_config);\n\n if($reflection->implementsInterface(\"Loops\\ServiceInterface\")) {\n return call_user_func_array([$service[\"classname\"], \"getService\" ], [ $params, $this ]);\n }\n else {\n $params->offsetSet(\"loops\", $this);\n return Misc::reflectionInstance($service[\"classname\"], $params);\n }\n }\n\n if(array_key_exists(\"callback\", $service)) {\n $params = new ArrayObject($service[\"params\"]);\n $params->merge($service_config);\n return call_user_func_array($service[\"callback\"], $params->toArray());\n }\n\n if(array_key_exists(\"object\", $service)) {\n return $service[\"object\"];\n }\n }",
"function newService($action = \"\")\n {\n $this->closeDialogs();\n $serv = preg_replace('/^new_/', '', $action);\n $this->plugins[$serv]->is_account = TRUE;\n $this->dialogObject = $this->plugins[$serv];\n $this->current = $serv;\n $this->dialog = TRUE;\n }",
"public function run()\n {\n Service::create([\n 'name'=>'consultation'\n ]);\n Service::create([\n 'name'=>'operation'\n ]);\n }",
"public function store(StoreServiceRequest $request)\n {\n $service = Service::create($request->only(['name']));\n\n return new ServiceResource($service);\n\n }",
"public static function factory(): ServiceInterface\n {\n return new static();\n }",
"private function createService(array $service)\n {\n if (isset($service['constructor'])) {\n $instance = $service['constructor']();\n return $instance;\n }\n\n if (!isset($service['class'])) {\n throw new ContainerException('Service hasn\\'t field class');\n }\n\n if (!class_exists($service['class'])) {\n throw new ContainerException(\"Class {$service['class']} doesn't exists\");\n }\n\n $class = $service['class'];\n if (isset($service['arguments'])) {\n $newService = new $class(...$service['arguments']);\n } else {\n $newService = new $class();\n }\n\n if (isset($service['calls'])) {\n foreach ($service['calls'] as $call) {\n if (!method_exists($newService, $call['method'])) {\n throw new ContainerException(\"Method {$call['method']} from {$service['class']} class not found\");\n }\n\n $arguments = $call['arguments'] ?? [];\n\n call_user_func_array([$newService, $call['method']], $arguments);\n }\n }\n\n return $newService;\n }",
"public function addService($name, $factory) {\n $this->serviceContainer\n ->register($name)\n ->setFactory($factory);\n }",
"public function createService(\n ServiceLocatorInterface $container,\n $name = null,\n $requestedName = DbTableGateway::class\n ) {\n return $this($container, $requestedName, $this->creationOptions);\n }",
"public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n return $this($serviceLocator, $requestedName);\n }",
"public function run()\n {\n factory(Servicios::class, 10)->create();\n }",
"public function getService($name)\n {\n return $this->pimple[$name];\n }",
"public function giveService($key, $Service);",
"protected function createFactory()\n {\n $factory = Str::studly($this->argument('name'));\n\n $this->call(FactoryMakeCommand::class, [\n 'name' => \"{$factory}Factory\",\n '--model' => $this->qualifyClass($this->getNameInput()),\n ]);\n }",
"public function create($scriptName = null);",
"private function getServiceId($name)\n {\n return sprintf('%s.%s.%s', $this->prefix, $this->resourceName, $name);\n }",
"public function create()\n {\n return view('admin/services.service.create');\n }",
"private function createByName($class, $name)\n {\n return $class::findOneCreateNew([\n 'name' => $name,\n ]);\n }",
"public function createServiceObjects() \n {\n var_dump('jj', Ini::$serviceConnections);\n //if (!empty(Ini::$serviceConnections)) \n //{\n foreach (Ini::$serviceConnections as $connectionName => $connectionDetail) \n {\n Ini::loadModule(Sysutils::Ucase($connectionDetail->type) . 'Service', 'Services', '\\Sys');\n $fqClassname = '\\\\Sys\\\\'. Sysutils::Ucase($connectionDetail->type) . 'Service';\n $this->autoLoadedServices[$connectionName] = array('url' => $connectionDetail->url, 'type' => $connectionDetail->type);\n $this->{$connectionName} = new $fqClassname($connectionDetail->url);\n }\n \n //}\n }",
"public function create()\n {\n $services = Service::all();\n return view('back.service.addService', compact('services'));\n }",
"public function createRegistrationServiceProvider($name, $path, $slug, $namespace)\n\t{\n\t\t$content = file_get_contents($this->getStubDirectory('ServiceProvider.stub'));\n\t\t$content = str_replace(\n\t\t\t['{{name}}', '{{slug}}', '{{namespace}}'],\n\t\t\t[$name, $slug, $namespace],\n\t\t\t$content\n\t\t);\n\t\t$this->createFile($path . '/Providers/' . $name . 'ServiceProvider.php', $content);\n\t}",
"function __construct($service) {\n // return new $class;\n }",
"public function createService(RestServiceEntity $details)\n {\n $serviceName = ucfirst($details->serviceName);\n\n if (! preg_match('/^[a-zA-Z][a-zA-Z0-9_]*(\\\\\\[a-zA-Z][a-zA-Z0-9_]*)*$/', $serviceName)) {\n throw new CreationException('Invalid service name; must be a valid PHP namespace name.');\n }\n\n $entity = new RestServiceEntity();\n $entity->exchangeArray($details->getArrayCopy());\n\n $mediaType = $this->createMediaType();\n $controllerService = $details->controllerServiceName\n ? $details->controllerServiceName\n : $this->createControllerServiceName($serviceName);\n $resourceClass = $details->resourceClass\n ? $details->resourceClass\n : $this->createResourceClass($serviceName);\n $routeName = $details->routeName\n ? $details->routeName\n : $this->createRoute($serviceName, $details->routeMatch, $details->routeIdentifierName, $controllerService);\n $collectionClass = $details->collectionClass\n ? $details->collectionClass\n : $this->createCollectionClass($serviceName);\n $entityClass = $details->entityClass\n ? $details->entityClass\n : $this->createEntityClass($serviceName, 'entity', $details);\n $module = $details->module\n ? $details->module\n : $this->module;\n\n $entity->exchangeArray([\n 'collection_class' => $collectionClass,\n 'controller_service_name' => $controllerService,\n 'entity_class' => $entityClass,\n 'module' => $module,\n 'resource_class' => $resourceClass,\n 'route_name' => $routeName,\n 'accept_whitelist' => [\n $mediaType,\n 'application/hal+json',\n 'application/json',\n ],\n 'content_type_whitelist' => [\n $mediaType,\n 'application/json',\n ],\n ]);\n\n $this->createRestConfig($entity, $controllerService, $resourceClass, $routeName);\n $this->createContentNegotiationConfig($entity, $controllerService);\n $this->createHalConfig($entity, $entityClass, $collectionClass, $routeName);\n\n return $entity;\n }",
"public function createEntity($name);",
"public function store(ServiceCreateRequest $request)\n {\n Service::create([\n 'name' => $request->name,\n 'image' => $request->image ? $request->file('image')->store('public') : \"public/no_image.png\",\n 'service_type' => $request->service_type,\n 'client' => $request->idClient,\n 'start_date' => $request->start_date,\n 'end_date' => $request->end_date,\n 'observations' => $request->observations\n ]);\n return redirect()->route('client.show', ['id' => $request->idClient])->with('success', 'Servicio creado correctamente');\n }",
"public function getService($serviceName = null, $context = null) {\r\n\t\tif($serviceName === null) {\r\n\t\t\t$serviceName = Nomenclature::toServiceName($this->getAnnotation('entity'));\r\n\t\t}\r\n\r\n\t\tif($context === null) {\r\n\t\t $context = $this->getContext();\r\n\t\t}\r\n\t\t\r\n\t\treturn new $serviceName($context);\r\n\t}",
"public function getService(string $serviceId, array $arguments = []): Service;",
"public function create()\n {\n return view(\"admin.services.create\");\n }",
"public function run()\n {\n $services = [\n 'Hospital',\n 'Police',\n 'Water services',\n 'Public bus station',\n 'Market',\n 'Shops',\n 'Electrical supply',\n 'Primary school',\n 'Secondary school'\n ];\n\n for($i = 0; $i < count($services); $i++){\n $service = [\n 'name' => $services[$i],\n ];\n Utility::create($service);\n }\n }",
"protected function _service( $name ) {\n\n\t\tif ( !isset( $this->_services[ $name ])) {\n\t\t\tthrow new Exception( \"The '$service' service is not configured.\" );\n\t\t}\n\n\t\treturn $this->_services[ $name ];\n\t}",
"public static function buildServiceDefinition(\n bool $asCRUD = false,\n ?string $name = null,\n ?string $namespace = null,\n ?string $model = null\n ) {\n return self::createServiceBuilder($asCRUD, $name, $namespace, $model)->build();\n }",
"protected function createFactory()\n {\n\n $this->call('wizard:factory', [\n 'name' => $this->argument('name'),\n ]);\n }",
"public function make(string $name, array $parameters = []);",
"private function registerServices($servicesToCreate, $pimple)\n {\n\n foreach ($servicesToCreate as $serviceId => $serviceProperties) {\n $pimple[$serviceId] = function (Container $pimple) use ($serviceProperties) {\n $arguments = [];\n if (isset($serviceProperties['arguments'])) {\n foreach ($serviceProperties['arguments'] as $argument) {\n $arguments[] = $pimple[$argument];\n }\n }\n\n $class = $serviceProperties['class'];\n return new $class(...$arguments);\n };\n }\n }",
"private function getServiceFromFactory($name)\n {\n $serviceFactory = $this->serviceFactory[$name];\n $delegateContainer = $this->delegateContainer ?: $this;\n\n return $serviceFactory($delegateContainer);\n }",
"abstract public function getServiceTypeName();",
"public function run()\n {\n CarService::Create([\n 'name' => 'Oil change',\n ]);\n\n CarService::Create([\n 'name' => 'Tyres',\n ]);\n\n CarService::Create([\n 'name' => 'Suspension',\n ]);\n\n }",
"public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $registrations = $this->getServiceRegistry()->queryForName($name);\n if(empty($registrations)){\n $registrations = $this->getServiceRegistry()->queryForName($requestedName);\n }\n if(empty($registrations)){\n return null;\n }\n\n // TODO implement different instance picking strategies\n $registration = $registrations[rand(0, count($registrations)-1)];\n\n $serviceWrapper = new RegistryService($registration->getService(), $registration);\n $circuitBreaker = new CircuitBreaker($serviceWrapper, $registration->getServiceName());\n $circuitBreaker->setServiceLocator($serviceLocator);\n\n $builder = new ProxyBuilder();\n if(interface_exists($requestedName)){\n $builder->setImplements($requestedName);\n }\n $proxyClass = $builder->build();\n /** @var ProxyAbstract $instance */\n $instance = new $proxyClass();\n $instance->__setService($circuitBreaker);\n\n return $instance;\n }",
"public function create()\n {\n return view('widegts::services.create');\n }",
"public function create()\n {\n return \\Response::view('service.create');\n }",
"public function __set($name, $value) {\n $this->services[$name] = $value;\n }",
"public function testCreateService()\n {\n $dummyService = new OcrDummyService();\n $ocrConfig = array('blubb');\n $config = array('ocr' => array('service' => 'test', 'config' => $ocrConfig));\n $serviceLocator = new ServiceManager();\n $serviceLocator->setService('Configuration', $config);\n $serviceLocator->setService('test', $dummyService);\n $service = $this->factory->createService($serviceLocator);\n $this->assertSame($service, $dummyService);\n $this->assertEquals($service->getConfig(), $ocrConfig);\n }",
"public function setServiceName($val)\n {\n $this->_propDict[\"serviceName\"] = $val;\n return $this;\n }",
"public function createHostedService($serviceName, $label, $description = '', $location = null, $affinityGroup = null)\n {\n \tif ($serviceName == '' || is_null($serviceName)) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Service name should be specified.');\n \t}\n \tif ($label == '' || is_null($label)) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Label should be specified.');\n \t}\n if (strlen($label) > 100) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');\n \t}\n if (strlen($description) > 1024) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');\n \t}\n \tif ( (is_null($location) && is_null($affinityGroup)) || (!is_null($location) && !is_null($affinityGroup)) ) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Please specify a location -or- an affinity group for the service.');\n \t}\n\n \t$locationOrAffinityGroup = is_null($location)\n \t\t? '<AffinityGroup>' . $affinityGroup . '</AffinityGroup>'\n \t\t: '<Location>' . $location . '</Location>';\n\n $response = $this->_performRequest(self::OP_HOSTED_SERVICES, '',\n \t\tZend_Http_Client::POST,\n \t\t['Content-Type' => 'application/xml; charset=utf-8'],\n \t\t'<CreateHostedService xmlns=\"http://schemas.microsoft.com/windowsazure\"><ServiceName>' . $serviceName . '</ServiceName><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description>' . $locationOrAffinityGroup . '</CreateHostedService>');\n\n \tif (!$response->isSuccessful()) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));\n\t\t}\n }",
"protected function service()\n {\n return new Service();\n }",
"public function servicename($value): self\n {\n $this->servicename = $value;\n \n return $this;\n }",
"public static function getService($name)\n {\n global $container;\n $service = $container->getByType($name, false);\n if (!$service) {\n $service = $container->getService($name);\n }\n return $service;\n }",
"public function run()\n {\n //\n SystemService::create([\n 'nombre' => 'La carta mozo'\n ]);\n SystemService::create([\n 'nombre' => 'Delivery'\n ]);\n SystemService::create([\n 'nombre' => 'Reservas'\n ]);\n SystemService::create([\n 'nombre' => 'Marketing'\n ]);\n }",
"public function store(CreateServiceRequest $request)\n {\n $service = new Service;\n $service->title = $request->title;\n $service->price = $request->price;\n $service->save();\n return redirect('/services');\n }",
"abstract public function service();",
"public function create(){\n return view('admin/service/service_create');\n }",
"public function create($name, $value = '');",
"public function run()\n {\n factory(ServiceBay::class, 10)->create();\n }",
"public function addShippingService($name, $price, $deadline) {\n\n $this->jsonData['Shipping']['Services'][] = array(\n 'Name' => $this->validateString($name, 128),\n 'Price' => $this->validateNumber($price, 18),\n 'DeadLine' => $this->validateNumber($deadline, 9)\n );\n\n }",
"function createservicestep1_post()\n {\n $em = $this->doctrine->em;\n $service = new \\Entities\\Service();\n $service->setAthor($this->getCurrentUser());\n\n\n $service->title = $this->post('title', TRUE);\n $service->subtitle = $this->post('subtitle', TRUE);\n $service->phone = $this->post('phone', TRUE);\n $service->address = $this->post('address', TRUE);\n// $service->addSubCategories($this->post('categories', TRUE),$em);\n// $service->addCities($this->post('cities', TRUE),$em);\n// $icon = $this->post('icon');\n// $path= \"./resources/\".$icon['filename'];\n// file_put_contents($path, base64_decode($icon['value']));\n// $service->setIcon($path);\n// $em->persist($service);\n// $em->flush();\n $this->set_response($service, REST_Controller::HTTP_OK);\n }",
"public function make(string $service): mixed\n {\n $service = 'Google\\\\Service\\\\'.ucfirst($service);\n\n if (class_exists($service)) {\n $class = new \\ReflectionClass($service);\n\n return $class->newInstance($this->client);\n }\n\n throw new UnknownServiceException($service);\n }"
]
| [
"0.71739507",
"0.71466535",
"0.70478565",
"0.70433086",
"0.69156516",
"0.68860865",
"0.6612338",
"0.656033",
"0.6555998",
"0.6536716",
"0.6531007",
"0.6480055",
"0.6473079",
"0.6449763",
"0.64379865",
"0.63928086",
"0.63894516",
"0.636719",
"0.6355712",
"0.631768",
"0.63014346",
"0.6230713",
"0.62006587",
"0.61500347",
"0.612636",
"0.6115517",
"0.61140096",
"0.60861343",
"0.6080542",
"0.60446405",
"0.60440373",
"0.60212266",
"0.6008048",
"0.60072535",
"0.6003133",
"0.59816575",
"0.5969963",
"0.59541273",
"0.5933251",
"0.5900718",
"0.5875292",
"0.5851727",
"0.58494073",
"0.58263534",
"0.5822195",
"0.58162725",
"0.57919127",
"0.5785604",
"0.5745099",
"0.5739597",
"0.57368565",
"0.5721084",
"0.57199526",
"0.5710274",
"0.5704183",
"0.56935704",
"0.5692024",
"0.568521",
"0.5676479",
"0.56540596",
"0.56476045",
"0.5643606",
"0.5639435",
"0.56336737",
"0.56335664",
"0.5627702",
"0.5615295",
"0.5603201",
"0.56015486",
"0.5599811",
"0.55948216",
"0.5581722",
"0.5580794",
"0.5567404",
"0.55609417",
"0.5558085",
"0.55569184",
"0.55554736",
"0.5553327",
"0.5544835",
"0.55329543",
"0.5531835",
"0.5531215",
"0.5527459",
"0.5525362",
"0.55224276",
"0.5519522",
"0.55176866",
"0.5516699",
"0.5512249",
"0.5508104",
"0.5507683",
"0.5505658",
"0.5505119",
"0.5500332",
"0.54967767",
"0.54913616",
"0.5491288",
"0.549103",
"0.54899573"
]
| 0.5528673 | 83 |
Fix current page, so it is not past the last one. | protected function fixPage(): void
{
if (null !== $this->total) {
$this->page = \min($this->page, $this->getLastPage());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fixPage(){\r\n\t\t$page=$this->_vars['current_page'];\r\n\t\t$total=$this->_vars['total_pages'];\r\n\t\tif ($page<=0){\r\n\t\t\t$page=$this->_vars['current_page']=1;\r\n\t\t}else if ($page>$total) {\r\n\t\t\t$page=$this->_vars['current_page']=$total;\r\n\t\t}\r\n\t\t$this->_vars['current_offset']=$page>0?(($page-1)*$show):0;\r\n\t\treturn $this;\r\n\t}",
"private function refreshCurrentPage()\n {\n $this->_currentPage = $this->_limit ? floor($this->_offset/$this->_limit) + 1 : 1;\n }",
"private function lastPage() {\n $this->currentPageNumber--;\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->lastPage[\"vOffset\"];\n $this->hOffset = $this->lastPage[\"hOffset\"];\n }",
"function ninja_forms_mp_breadcrumb_update_current_page(){\r\n\tglobal $ninja_forms_processing;\r\n\r\n\t$form_id = $ninja_forms_processing->get_form_ID();\r\n\t$nav = '';\r\n\t$all_extras = $ninja_forms_processing->get_all_extras();\r\n\tif( is_array( $all_extras ) AND !empty( $all_extras ) ){\r\n\t\tforeach( $all_extras as $key => $val ){\r\n\t\t\tif( strpos( $key, '_mp_page_' ) !== false ){\r\n\t\t\t\t$nav = str_replace( '_mp_page_', '', $key );\r\n\t\t\t\t$ninja_forms_processing->update_extra_value( '_current_page', $nav );\r\n\t\t\t\t$show = ninja_forms_mp_check_page_conditional( $form_id, $nav );\r\n\t\t\t\tif( !$show ){\r\n\t\t\t\t\t$ninja_forms_processing->update_extra_value( '_prev', 'Previous' );\r\n\t\t\t\t\tninja_forms_mp_nav_update_current_page();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $nav;\r\n}",
"function ninja_forms_mp_nav_update_current_page(){\r\n\tglobal $ninja_forms_processing;\r\n\r\n\t$form_id = $ninja_forms_processing->get_form_ID();\r\n\r\n\tif( $ninja_forms_processing->get_extra_value( '_current_page' ) ){\r\n\t\t$current_page = $ninja_forms_processing->get_extra_value( '_current_page' );\r\n\t}else{\r\n\t\t$current_page = 1;\r\n\t}\t\r\n\tif( $ninja_forms_processing->get_extra_value( '_page_count' ) ){\r\n\t\t$page_count = $ninja_forms_processing->get_extra_value( '_page_count' );\r\n\t}else{\r\n\t\t$page_count = 1;\r\n\t}\r\n\r\n\t$nav = '';\r\n\tif( $ninja_forms_processing->get_extra_value( '_prev' ) ){\r\n\t\t$nav = 'prev';\r\n\t\tif( $current_page != 1 ){\r\n\t\t\t$current_page--;\r\n\t\t}\r\n\t}\r\n\r\n\tif( $ninja_forms_processing->get_extra_value( '_next' ) ){\r\n\t\t$nav = 'next';\r\n\t\tif( $current_page != $page_count ){\r\n\t\t\t$current_page++;\r\n\t\t}\r\n\t}\r\n\r\n\tif( $nav != '' ){\r\n\t\tif ( function_exists( 'ninja_forms_conditionals_field_filter' ) ) {\r\n\t\t\tninja_forms_conditionals_field_filter( $form_id );\r\n\t\t}\r\n\t\t$show = ninja_forms_mp_check_page_conditional( $form_id, $current_page );\r\n\r\n\t\t$ninja_forms_processing->update_extra_value( '_current_page', $current_page );\r\n\r\n\t\tif( ( $current_page <= $page_count ) AND !$show ){\r\n\t\t\tninja_forms_mp_nav_update_current_page();\r\n\t\t}\r\n\t}\t\t\r\n}",
"private function markCurrentPage() {\n $this->pageReloadMarker = $this->randomMachineName();\n $this->getSession()->executeScript('document.body.appendChild(document.createTextNode(\"' . $this->pageReloadMarker . '\"));');\n }",
"function lastPage()\n\t\t{\n\t\t\t$this->currentPage = $this->numberOfPages();\n\t\t}",
"function LastPage ( )\n{\n if ( $this->_need_refresh_() || $this->CurrentPage() < $this->PageCount() ) {\n if ( $this->PageCount() > 1 ) {\n $cSQL = $this->_SQL_LastPage();\n $this->_ReversedRecord = true;\n $this->_new_page_($this->PageCount(),$cSQL);\n } else {\n $this->FirstPage();\n }\n }\n}",
"public function override_next_page() {\n return false;\n }",
"protected function redirectToCurrentPage() {}",
"private function resetCurrentSitemap()\n {\n $this->current_sitemap = 0;\n }",
"protected function movePage()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\t// current_page is already set to new position\n\t\t$target_page = $this->current_page-1;\n\t\t$source_page = $_REQUEST[\"old_pos\"]-1;\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\tforeach($pages[$source_page] as $question)\n\t\t{\n\t\t\t$questions[] = $question[\"question_id\"];\n\t\t}\n\n\t\t// move to first position\n\t\t$position = 0;\n\t\tif($_REQUEST[\"pgov\"] != \"fst\")\n\t\t{\n\t\t\t$position = 1;\n\t\t}\n\n\t\t$target = $pages[$target_page];\n\t\t$target = array_shift($target);\n\t\t$this->object->moveQuestions($questions, $target[\"question_id\"], $position);\n\n\t\tif($target_page < $source_page && $position)\n\t\t{\n\t\t $this->current_page++;\n\t\t}\n\n\t\tilUtil::sendSuccess($lng->txt(\"survey_page_moved\"), true);\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}",
"abstract protected function setPreviousPage();",
"public function doLocalAnchorFix() {}",
"function restore_current_blog()\n {\n }",
"public function rewind() : void\n {\n $this->page(1);\n }",
"private function autoRedirectToLastPage()\n {\n if($this->urlQueryStringName === NULL)\n {\n self::$registry->error->reportError('The Url Query String for Pagination is not defined yet, You can do it by using initURLQueryStringName() method.', __LINE__, __METHOD__, true);\n return 0;\n }\n \n if($this->currentPageNumber() > $this->totalPages)\n {\n $pageQueryStringNamePosition = array_search($this->urlQueryStringName, $this->URLQueryString);\n $this->URLQueryString[++$pageQueryStringNamePosition] = $this->totalPages;\n $finalQueryString = implode('/', $this->URLQueryString);\n self::$registry->request->go(null, null, $finalQueryString);\n }\n return;\n }",
"public function resetCurrent(): void\n {\n $this->current = $this->lastPart = '';\n }",
"private function fixAutoIncrement() {\n $database = \\Env::get('db');\n $result = $database->Execute(\"SELECT MAX(CONVERT(`object_id`, UNSIGNED)) AS `oldAutoIncrement`\n FROM `\" . DBPREFIX . \"log_entry`\n WHERE `object_class` = 'Cx\\\\\\\\Core\\\\\\\\ContentManager\\\\\\\\Model\\\\\\\\Entity\\\\\\\\Page'\");\n if ($result === false) return;\n $oldAutoIncrement = $result->fields['oldAutoIncrement'] + 1;\n $result = $database->Execute(\"SHOW TABLE STATUS LIKE '\" . DBPREFIX . \"content_page'\");\n if ($result !== false && $result->fields['Auto_increment'] < $oldAutoIncrement) {\n $result = $database->Execute(\"ALTER TABLE `\" . DBPREFIX . \"content_page` AUTO_INCREMENT = \" . contrexx_raw2db($oldAutoIncrement));\n }\n }",
"public function getLastPage() {}",
"function new_since_last_visit() {\n $this->skip_layout = $this->request->isAsyncCall();\n\n $page = (integer) $this->request->get('page');\n if($page < 1) {\n $page = 1;\n } // if\n\n list($objects, $pagination) = ProjectObjects::paginateNew($this->logged_user, $page, 10);\n\n $this->smarty->assign(array(\n 'objects' => $objects,\n 'pagination' => $pagination,\n ));\n }",
"public function rewind() { \n\t\t$this->currentPage = 1;\n\t\t\n\t\tif(array_key_exists(1,$this->pages))\n\t\t\treset($this->pages[$i]);\n\t}",
"function RecentPage()\n\t{\n\t\t$this->SetInitialValues();\n\t}",
"private function incCurrentSitemap()\n {\n $this->current_sitemap = $this->current_sitemap + 1;\n }",
"public function rewind()\n {\n $this->current = $this->bottom();\n }",
"public function rewindHistory();",
"private function reset() {\n $this->_minimumPage = NULL;\n $this->_maximumPage = NULL;\n $this->_previousPage = NULL;\n $this->_nextPage = NULL;\n $this->_lastPage = NULL;\n }",
"public function PIDupinRootlineConditionMatchesCurrentPageIdWhileSavingNewPage() {}",
"static function RedirToDefault()\n\t{\n\t\theader(\"Location: \" . $GLOBALS['host'] . self::$subDir . \"/\" . self::$defPage);\n\t}",
"public function getCurrentPage(): int;",
"public function getCurrentPage(): int;",
"protected function clearTopPage(): void\n {\n $this->owner->TopPageID = 0;\n }",
"function revert_site() {\n if ( MAIN_SITE != \"\" ) {\n restore_current_blog();\n }\n}",
"public function fastForward()\n {\n $this->current = $this->top();\n }",
"private function resetCurrentItem()\n {\n $this->current_item = 0;\n }",
"public static function getFinalPage($current, $max) {\n if ($max <= 7) {\n return $max;\n } else if ($current <= 4) {\n return 7;\n } else if ($current > ($max - 3)) {\n return $max;\n } else {\n return $current + 3;\n }\n }",
"protected function updateTopPage(): void\n {\n if (!$this->topPageUpdate) {\n return;\n }\n\n /** @var SiteTreeExtension $extension */\n $extension = singleton(SiteTreeExtension::class);\n $extension->addDuplicatedObject($this->owner);\n }",
"public function lastPage($resetmargins=false) {\n\t\t$this->setPage($this->getNumPages(), $resetmargins);\n $this->isLastPage = true;\n\t}",
"function _endpage()\n\t\t{\n\t\t\t$this->state=1;\n\t\t}",
"public function movePostFromEndToTheMiddle() {}",
"function lastcomments_page() {\r\n\r\n\tglobal $SYSTEM_FLAGS, $template, $CurrentHandler;\r\n\t// Action if ppage is enabled\r\n\tif (pluginGetVariable('lastcomments', 'ppage') && ($CurrentHandler['handlerParams']['value']['pluginName'] == 'core')) {\r\n\t\t$SYSTEM_FLAGS['info']['title']['group'] = \"lastcomments\";\r\n\t\t$template['vars']['mainblock'] = lastcomments(1);\r\n\t} else {\r\n\t\terror404();\r\n\t}\r\n}",
"static function get_current_page_url() {\n\t\tif ( isset($_SERVER['REQUEST_URI']) ) {\n\t\t\t$_SERVER['REQUEST_URI'] = preg_replace('/&?offset=[0-9]*/', '', $_SERVER['REQUEST_URI']);\n\t\t}\n\t\treturn wp_kses($_SERVER['REQUEST_URI'], '');\n\t}",
"public function getLastPage();",
"public function cleanCurrent() {}",
"private function calcLastPageCount()\n\t{\n\t\t$this->lastPageCount=$this->totalRecords%$this->recordsPerPage;\n\t}",
"private function calculateOffset() {\n $this->offset = ($this->currentpage - 1) * $this->limit;\n }",
"private function ending()\n {\n if ($this->current_page + 1 <= $this->total_pages) {\n return '<li><a href=\"' . ($this->current_page + 1) . '\">»</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">»</a></li>';\n }\n }",
"private function print_last_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( $this->total_pages ),\n\t\t\t__( 'Go to the last page', 'multilingual-press' ),\n\t\t\t'last-page' . $this->disable_last,\n\t\t\t'»'\n\t\t);\n\t}",
"function previousPage()\n\t\t{\n\t\t\tif(!$this->hasPrevious())\n\t\t\t\tthrow new Exception(\"Page out of bounds\");\n\t\t\t\t\n\t\t\t$this->currentPage--;\n\t\t}",
"public function PrevPage()\n {\n if ($this->m_CurrentPage <= 1)\n $this->m_CurrentPage = 1;\n else \n $this->m_CurrentPage--;\n return $this->ReRender();\n }",
"private function refreshNbPages()\n {\n $this->_nbPages = $this->_limit ? ceil($this->_count/$this->_limit) : 0;\n }",
"function currentPage($newValue=NULL) {\n\t\tif ( isset($newValue) ) $this->current_page = IntVal($newValue);\n\t\treturn $this->current_page;\n\t}",
"final public function removePages(): void\n {\n $this->pages = [];\n $this->index = [];\n }",
"public function PIDupinRootlineConditionMatchesCurrentPageIdWhileEditingNewPage() {}",
"function get_one_page(){\n\t\t$this->m_n_current_page_number = gf_get_value_n('v_current_page_number');\n\t}",
"public function disableTopPageUpdate(): void\n {\n $this->topPageUpdate = false;\n }",
"private function beginning()\n {\n if ($this->current_page - 1 >= 1) {\n return '<li><a href=\"' . ($this->current_page - 1) . '\">«</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">«</a></li>';\n }\n }",
"function newPage()\n {\n $this->lastPageNumber ++;\n if ($this->lastPageNumber != 1)\n $this->documentBuffer .= \"<br clear=\\\"all\\\" style=\\\"page-break-before: always;\\\">\";\n return $this->lastPageNumber;\n }",
"private function relativePathFix($path){\n\t\t// check if page is a generated javadoc\n\t\t$page_str = $this->doc->saveHTML();\n\t\tif(preg_match('%.*Generated by javadoc.*%', $page_str)){\n\t\t\t// if it is, fix the frame-based links so that the path isn't appended to itself infinitely\n\t\t\t$path = preg_replace('%(.*\\/).*\\.html\\?(.*\\/.*)%', \"$1$2\", $path);\n\t\t}\n\t\t$dirs = explode('/', $path);\n\t\t// check if link goes up a directory\n\t\tif($dirs[0] == '..'){\n\t\t\t$new_path = explode('/', $this->current_path);\n\t\t\tif(count($dirs) == 2){\n\t\t\t\tarray_pop($new_path);\n\t\t\t\tarray_pop($new_path);\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t} else {\n\t\t\t\t// remove slash from end of current path to ensure single slashes\n\t\t\t\tif(empty($new_path[count($new_path)-1]) || is_null($new_path[count($new_path)-1])){\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// go up directories\n\t\t\t\twhile($dirs[0] == '..'){\n\t\t\t\t\tarray_shift($dirs);\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// stick the two paths together to get new path\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t\t$new_path .= implode('/', $dirs);\n\t\t\t}\n\t\t// if link it to same dir, remove the ./\n\t\t} elseif($dirs[0] == '.'){\n\t\t\t$new_path = $this->current_path.substr($path, 2);\n\t\t// if the link starts at root, use it without modification\n\t\t} elseif(empty($dirs[0]) || is_null($dirs[0])){\n\t\t\t$new_path = $path;\n\t\t} elseif(strlen($dirs[0]) == 2){\n\t\t\t$new_path = '/'.$path;\n\t\t// default to adding the link's value to the end of the current directory\n\t\t} else {\n\t\t\t$new_path = $this->current_path.$path;\n\t\t}\n\t\t\n\t\t// if the link doesn't point to a file or query string, but has no end slash, add one\n\t\tif(count(explode('.', $new_path)) < 2 && count(explode('?', $new_path)) < 2 && substr($new_path, -1) != '/'){\n\t\t\t$new_path .= '/';\n\t\t}\n\t\treturn $new_path;\n\t}",
"public function getLastPage(): int;",
"private function checkBounds()\n {\n $this->page = max($this->page, 0);\n $this->page = min($this->page, $this->lastPage());\n }",
"function NewPage()\n {\n $ypos = $this->GetY();\n if ($ypos > 230){\n $this->AddPage();\n }\n }",
"private function nextPage() {\n $this->lastPage = array(\n \"vOffset\" => $this->vOffset,\n \"hOffset\" => $this->hOffset,\n );\n $footerToAppend = false;\n $this->currentPageNumber++;\n if (isset($this->pages[$this->currentPageNumber])) {\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = 0;\n } else {\n $this->pages[$this->currentPageNumber] = $this->haruDoc->addPage();\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->currentPage->setTextRenderingMode(\\HaruPage::FILL);\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = ($this->hOffset ? $this->hOffset : 0);\n $footerToAppend = true;\n }\n if ($this->currentFont && $this->currentFontSize && $this->currentFontColor) {\n $this->currentPage->setFontAndSize($this->currentFont, $this->currentFontSize);\n $this->setColor($this->currentFontColor[0], $this->currentFontColor[1], $this->currentFontColor[2]);\n }\n if ($footerToAppend && $this->currentPageNumber > 1) {\n $this->currentPage->beginText();\n $this->setFont(self::FONT_NORMAL, 12, array(0,0,0));\n $this->currentPage->textOut($this->PAGE_WIDTH - self::HMARGIN - $this->currentPage->getTextWidth($this->currentPageNumber),\n self::VMARGIN - 30, $this->currentPageNumber);\n $this->revertFont();\n $this->setFont(self::FONT_BOLD, 12, array(0,0,0));\n $this->currentPage->textOut(self::HMARGIN,\n self::VMARGIN - 30, $this->currentBookName);\n $this->revertFont();\n $this->currentPage->endText();\n\n }\n\n }",
"public function fix() {}",
"public function getCurrentPage();",
"public function getCurrentPage();",
"public function getCurrentPage();",
"public function fix() {}",
"public function markLastUpdate(){\n if(!$this->updatedAtOveridden) $this->updatedAt = new \\DateTime();\n if($this->applicant) //child pages dont have direct links to the application\n $this->applicant->markLastUpdate();\n if($this->parent) //child pages should update their parents\n $this->parent->markLastUpdate();\n }",
"private function setOffset()\n {\n $this->offset = ($this->limit * $this->currentPage) - $this->limit;\n }",
"protected function needsNewPage()\n {\n return $this->getY() >= $this->layout['pageMaxY'];\n }",
"function rd_fix_blog_tab_on_cpt($classes, $item, $args) {\n if (!is_singular('post') && !is_category() && !is_tag()) {\n $blog_page_id = intval(get_option('page_for_posts'));\n if ($blog_page_id != 0) {\n if ($item->object_id == $blog_page_id) {\n unset($classes[array_search('current_page_parent', $classes)]);\n }\n }\n }\n return $classes;\n}",
"public function sitePageMoveAction ()\n {\n\n $response = new stdClass();\n $response->success = true;\n $response->msg = 'Success';\n\n try {\n $Pm = Tg_Site::getInstance();\n $Parent = $Pm->getPageById($this->_getParam(\"parentId\"));\n $Page = $Pm->getPageById($this->_getParam(\"pageId\"));\n\n if ($Page->getParent()->id != $Parent->id) {\n foreach ($Parent->getPages() as $subPage )\n {\n if ($subPage->name == $Page->name)\n {\n throw new Zend_Exception (\"Page move failed - path already used\");\n }\n }\n }\n\n $Parent->movePage ($this->_getParam(\"pageId\"), $this->_getParam(\"previousSiblingId\",0));\n\n } catch (Zend_Exception $exp)\n {\n $response->success = false;\n $response->msg = $exp->getMessage ();\n }\n\n echo Zend_Json::encode ($response);\n die;\n }",
"public function reorderChildren()\n {\n $sql = \"select ID_PAGE from \" . $this->mode . \"PAGE where PAG_IDPERE=\" . $this->getID() . \" order by PAG_POIDS\";\n $stmt = $this->dbh->prepare(\"update \" . $this->mode . \"PAGE set PAG_POIDS=:PAG_POIDS where ID_PAGE=:ID_PAGE\");\n $PAG_POIDS = 1;\n $stmt->bindParam(':PAG_POIDS', $PAG_POIDS, PDO::PARAM_INT);\n foreach ($this->dbh->query($sql)->fetchAll(PDO::FETCH_COLUMN) as $ID_PAGE) {\n $stmt->bindValue(':ID_PAGE', $ID_PAGE, PDO::PARAM_INT);\n $stmt->execute();\n $PAG_POIDS ++;\n }\n }",
"protected function fixSelf() {}",
"protected function fixSelf() {}",
"public function restorePosition()\n {\n if ($this->value['y']==$this->_pdf->getY()) $this->_pdf->setY($this->value['yc'], false);\n }",
"private function retrieve_page() {\n\t\t$replacement = null;\n\n\t\t$max = $this->determine_pagenumbering( 'max' );\n\t\t$nr = $this->determine_pagenumbering( 'nr' );\n\t\t$sep = $this->retrieve_sep();\n\n\t\tif ( $max > 1 && $nr > 1 ) {\n\t\t\t/* translators: 1: current page number, 2: total number of pages. */\n\t\t\t$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'wordpress-seo' ), $nr, $max );\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"function truethemes_remove_nextpage($content){\n\n\tglobal $wp_query;\n\t$is_posts_page = $wp_query->is_posts_page;\n\t\t\n\t//check if is posts page, archive, category or tag.\n\tif(is_home()||$is_posts_page==1||is_archive()||is_category()||is_tag()||is_page_template('index.php')){\n\t\n\t//we explode content and use only first part of array.\n \t$content = explode('<!--nextpage-->',$content);\n \t//return back first part of content to WordPress.\n\treturn $content[0];\n\t}else{\n\t//other pages, we do nothing to it.\n\treturn $content;\n\t}\n\n\n}",
"public function getCurrentPageNumber(): int;",
"private function back(){\n \t$params = array(\n \t\t\t'page'=>intval(I('p')) ? intval(I('p')) : 1,\n \t\t\t'pagesize'=>$this->pagesize,\n \t\t\t'type'=>Status::AfterSaleBack,\n \t);\n \tif (session('distributor_id')) {\n \t\t$params['distributor_id'] = session('distributor_id');\n \t}\n \t$result = $this->afterSalesService()->getPagerList($params);\n \t$this->assign('back_list', $result['list']);\n }",
"public static function redirect_old_onboarding() {\n\t\t$current_page = isset( $_GET['page'] ) ? wc_clean( wp_unslash( $_GET['page'] ) ) : false; // phpcs:ignore csrf okay.\n\n\t\tif ( 'wc-setup' === $current_page ) {\n\t\t\tdelete_transient( '_wc_activation_redirect' );\n\t\t\twp_safe_redirect( wc_admin_url( '&reset_profiler=1' ) );\n\t\t}\n\t}",
"public function removePage()\n\t{\n\t\tif(isset($this->searchFilters[$this->ref_page]))\n\t\t{\n\t\t\tunset($this->searchFilters[$this->ref_page]);\n\t\t}\n\t}",
"public function previous_page(){\n if($this->current_page > 1){\n return $this->current_page - 1;\n }\n else{\n return NULL;\n }\n }",
"public function set_last_page() {\n\t\t\t$this->last_page = $_SERVER['PHP_SELF'];\n\t\t\t\n\t\t\t// If the GET array has \"add\" or \"rem\" values, we need to remove\n\t\t\t// those.\n\t\t\tif(isset($_GET)) { \n\t\t\t\tif (array_key_exists('add', $_GET)) \n\t\t\t\t\tunset($_GET['add']);\n\t\t\t\tif (array_key_exists('rem', $_GET))\n\t\t\t\t\tunset($_GET['rem']);\n\t\t\t\t\t\n\t\t\t\t// Set up an iterator and then loop through GET to get key-value\n\t\t\t\t// pairs, then append them to our last page.\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($_GET as $key=>$val) {\n\t\t\t\t\t$count = count($_GET);\n\t\t\t\t\tif ($count > 1) {\n\t\t\t\t\t\tif ($i == 0)\n\t\t\t\t\t\t\t$this->last_page .= '?' . $key . '=' . $val . '&';\n\t\t\t\t\t\telse if ($i == $count-1)\n\t\t\t\t\t\t\t$this->last_page .= $key . '=' . $val;\n\t\t\t\t\t\telse\t\n\t\t\t\t\t\t\t$this->last_page .= $key . '=' . $val . '&';\t\t\n\t\t\t\t\t} else\n\t\t\t\t\t\t$this->last_page .= '?' . $key . '=' . $val;\n\t\t\t\t\t\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t$this->last_page = substr($this->last_page, 1);\n\t\t$_SESSION['last_page'] = $this->last_page;\n\t\treturn $this->last_page;\n\t\t}",
"private function setCurrentPath(){\n\t\t$dirs = explode('/', $this->pages[0]);\n\t\t// if last character is a / then just use it\n\t\tif(empty($dirs[count($dirs)-1]) || is_null($dirs[count($dirs)-1])){\n\t\t\t$this->current_path = $this->pages[0];\n\t\t// if end of path was a filename, remove it and add a /\n\t\t} else {\n\t\t\tarray_pop($dirs);\n\t\t\t$this->current_path = implode('/', $dirs).'/';\n\t\t}\n\t}",
"public function rewind()\n {\n $this->currentIndex = 0;\n $this->currentPage = 0;\n $this->loadPage();\n }",
"protected function getCurrentPage() {\n if (isset($this->data['page'])) return $this->data['page'];\n else return 1;\n }",
"function firstPage()\n\t\t{\n\t\t\t$this->currentPage = 1;\n\t\t}",
"function get_hide_current_page_id() {\n\tif ( is_shop() ) { // Shop page (reservation page with map)\n\t\treturn 6;\n\t}\n\tif ( is_cart() ) {\n\t\treturn 7;\n\t}\n\tif ( is_checkout() ) {\n\t\treturn 8;\n\t}\n\treturn false;\n}",
"function prevPage() {\n\tglobal $activePages, $currentView, $currentArticle, $currentArticlePage;\n\t\n\t$root = '/' . $_GET['language'] . '/';\n\t\n\t// If we're on the home page, the prev button should be inactive\n\tif( $currentView == 'home' ) {\n\t\treturn false;\n\t}\n\t// If we're on the credits page, the prev button should point to the last article\n\telse if( $currentView == 'credits' ) {\n\t\treturn $root . getArrayLastIndex( $activePages );\n\t}\n\n\tif( empty(nextPrevArticleName('prev')) && $currentArticlePage == '1' ){\n\t\treturn $root;\n\t} elseif( $currentArticlePage == '1' ) {\n\t\treturn $root . nextPrevArticleName('prev') . '/' . $activePages[nextPrevArticleName('prev')]['numberOfPages'];\n\t} elseif($activePages[$currentArticle]['numberOfPages'] >= $currentArticlePage) {\n\t\treturn $root . $currentArticle . '/' . (string)($currentArticlePage-1);\n\t} else {\n\t\treturn $root . $currentArticle;\t\t\n\t}\n}",
"function orderup() {\n\t\t\n\t\t$this->_order(-1);\n\t\t\n\t\t$this->adminLink->makeURL();\n\t\t$this->app->redirect( $this->adminLink->url );\n\t\n\t}",
"function CurrentPage ( )\n{\n return $this->_CurrentPage;\n}",
"public function rewind()\n\t{\n\t\t$this->_currentIndex = 0;\n\t\t$this->_currentPage = 0;\n\t\t$this->loadPage();\n\t}",
"public function endPage() {}",
"function newItemAfter()\r\n\t{\r\n\t\t$this->content_obj->newItemAfter();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}",
"public function previous(): void\n {\n if ($this->cursor > 0) {\n $this->cursor--;\n }\n }",
"public function isLastPage(): bool\n {\n return $this->current === $this->number_of_pages;\n }",
"public function removeLastPostFromBlog() {}",
"function cmdeals_front_page_featured_paging_fix() {\n\t\t\n\tif ( is_front_page() && is_page( get_option('cmdeals_featured_page_id') )) :\n\t\t\n\t\tquery_posts( array( 'page_id' => get_option('cmdeals_featured_page_id'), 'is_paged' => true ) );\n\t\t\n\t\tdefine('FEATURED_IS_ON_FRONT', true);\n\t\t\n\tendif;\n}"
]
| [
"0.7492113",
"0.6936748",
"0.6537707",
"0.60750395",
"0.6003374",
"0.5981531",
"0.5850402",
"0.5802926",
"0.5749004",
"0.5662524",
"0.565283",
"0.5635898",
"0.5516926",
"0.54890746",
"0.5436282",
"0.5422225",
"0.54127216",
"0.540879",
"0.54041845",
"0.5345584",
"0.5341712",
"0.5331744",
"0.5314733",
"0.53017485",
"0.52892524",
"0.52375525",
"0.523664",
"0.5234952",
"0.521602",
"0.5198824",
"0.5198824",
"0.51956284",
"0.5170433",
"0.5162004",
"0.51581454",
"0.5154443",
"0.5153196",
"0.5145818",
"0.51434225",
"0.5132433",
"0.5127585",
"0.51266795",
"0.5122913",
"0.5103303",
"0.5099095",
"0.50955814",
"0.5081414",
"0.5056785",
"0.5054285",
"0.50516975",
"0.5032643",
"0.5028946",
"0.5023986",
"0.5013928",
"0.50097984",
"0.49905884",
"0.4985562",
"0.49737033",
"0.4973566",
"0.4966006",
"0.49657026",
"0.49652112",
"0.49586153",
"0.49535966",
"0.4953263",
"0.4953263",
"0.4953263",
"0.4953143",
"0.4938426",
"0.4932656",
"0.49279535",
"0.49214947",
"0.49150434",
"0.4904413",
"0.4903773",
"0.4903773",
"0.49029025",
"0.48882914",
"0.4882863",
"0.4875944",
"0.48701474",
"0.48648334",
"0.48499098",
"0.4845903",
"0.48457927",
"0.48414347",
"0.48381487",
"0.4831706",
"0.48313832",
"0.48099598",
"0.48086697",
"0.48079678",
"0.4806729",
"0.4804854",
"0.4803479",
"0.48002866",
"0.47951984",
"0.47948015",
"0.479161",
"0.47887328"
]
| 0.7412039 | 1 |
Show the application dashboard. | public function findByName() {
$term = Request::input('term');
$cities = [];
if (($term) && ($term !== '')) {
$search_term = Helpers::accentToRegex($term);
$query_term = '/.*' . $search_term . '*/i';
$cities = Cities::where('properties.nome_municipio', 'regexp', $query_term)->
orderBy('properties.nome_municipio')->
get(array('properties.geo_codigo', 'properties.nome_municipio', 'properties.sigla'));
}
return Response::json($cities);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }",
"function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}",
"public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }",
"public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }",
"public function dashboard()\n {\n return view('backend.dashboard.index');\n }",
"public function index() {\n return view(\"admin.dashboard\");\n }",
"public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }",
"public function dashboard(){\n return view('backend.admin.index');\n }",
"public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }",
"public function dashboard()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }",
"public function dashboard() \r\n {\r\n return view('admin.index');\r\n }",
"public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}",
"public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }",
"public function dashboard()\n {\n\n return view('admin.dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('adm.dashboard');\n }",
"public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }",
"public function show()\n {\n return view('dashboard');\n }",
"public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}",
"public function index() {\n return view('modules.home.dashboard');\n }",
"public function show()\n {\n return view('dashboard.dashboard');\n \n }",
"public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }",
"public function dashboard()\n { \n return view('jobposter.dashboard');\n }",
"public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}",
"public function index()\n {\n return view('pages.admin.dashboard');\n }",
"public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }",
"public function index()\n {\n //\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard.index');\n }",
"public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }",
"public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }",
"public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }",
"public function getDashboard() {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('smartcrud.auth.dashboard');\n }",
"public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }",
"public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }",
"public function index()\n {\n return view('board.pages.dashboard-board');\n }",
"public function index()\n {\n return view('admin::settings.development.dashboard');\n }",
"public function index()\n {\n return view('dashboard.dashboard');\n }",
"public function show()\n {\n return view('dashboard::show');\n }",
"public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }",
"public function dashboard()\n {\n return view('Admin.dashboard');\n }",
"public function show()\n {\n return view('admins\\auth\\dashboard');\n }",
"public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }",
"public function index()\n {\n return view('bitaac::account.dashboard');\n }",
"public function index()\n { \n return view('admin-views.dashboard');\n }",
"public function getDashboard()\n {\n return view('dashboard');\n }",
"function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }",
"public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }",
"public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }",
"public function index()\r\n {\r\n return view('user.dashboard');\r\n }",
"public function index() {\n return view('dashboard', []);\n }",
"public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }",
"public function index()\n {\n return view('back-end.dashboard.index');\n //\n }",
"public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}",
"public function index() {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('page.dashboard.index');\n }",
"public function index()\n {\n\n return view('dashboard');\n }",
"public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }",
"public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }",
"public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}",
"public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }",
"public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}",
"public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }",
"public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }",
"public function index()\n {\n return view('/dashboard');\n }",
"public function index()\n {\n \treturn view('dashboard');\n }",
"public function index()\n {\n return view('ketua.ketua-dashboard');\n }",
"public function index(){\n return View::make('admin.authenticated.dashboardview');\n }",
"public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }",
"public function index()\n {\n return view('adminpanel.home');\n }",
"public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}",
"public function index()\n {\n return view('dashboard.home');\n }",
"public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }",
"public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }",
"public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }",
"public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }",
"public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }",
"public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }",
"public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }",
"public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }"
]
| [
"0.77850926",
"0.7760142",
"0.7561336",
"0.75147176",
"0.74653697",
"0.7464913",
"0.73652893",
"0.7351646",
"0.7346477",
"0.73420244",
"0.7326711",
"0.7316215",
"0.73072463",
"0.7287626",
"0.72826403",
"0.727347",
"0.727347",
"0.727347",
"0.727347",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7241342",
"0.7236133",
"0.7235562",
"0.7218318",
"0.71989936",
"0.7197427",
"0.71913266",
"0.71790016",
"0.71684825",
"0.71577966",
"0.7146797",
"0.7133428",
"0.7132746",
"0.71298903",
"0.71249074",
"0.71218014",
"0.71170413",
"0.7110151",
"0.7109032",
"0.7107029",
"0.70974076",
"0.708061",
"0.7075653",
"0.70751685",
"0.7064041",
"0.70550334",
"0.7053102",
"0.7051273",
"0.70484304",
"0.7043605",
"0.70393986",
"0.70197886",
"0.70185125",
"0.70139873",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.6992477",
"0.6979631",
"0.69741416",
"0.69741327",
"0.6968815",
"0.6968294",
"0.69677526",
"0.69652885",
"0.69586027",
"0.6944985",
"0.69432825",
"0.69419175",
"0.6941512",
"0.6941439",
"0.6938837",
"0.6937524",
"0.6937456",
"0.6937456",
"0.69276494",
"0.6921651",
"0.69074917",
"0.69020325",
"0.6882262",
"0.6869339",
"0.6867868",
"0.68557185",
"0.68479055",
"0.684518",
"0.68408877",
"0.6838798",
"0.6833479",
"0.6832326",
"0.68309164",
"0.6826798",
"0.6812457"
]
| 0.0 | -1 |
Determine if the user is authorized to make this request. | public function authorize()
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() != null;\n }",
"public function authorize(): bool\n {\n return $this->user() !== null;\n }",
"public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }",
"public function authorize()\n {\n return !is_null($this->user());\n }",
"public function authorize()\n {\n return request()->user() != null;\n }",
"public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }",
"public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }",
"public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }",
"public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }",
"public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\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 }",
"public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }",
"public function isAuthorized() {}",
"public function authorize()\n {\n return request()->loggedin_role === 1;\n }",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }",
"public function authorize()\n {\n return auth()->check() ? true : false;\n }",
"public function authorize()\n {\n return auth()->check() ? true : false;\n }",
"public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }",
"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 $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }",
"public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }",
"function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }",
"public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }",
"public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }",
"public function authorize()\n {\n return is_client_or_staff();\n }",
"public function isAuthorized() {\n\t\treturn true;\n\t}",
"public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }",
"public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}",
"public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }",
"public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }",
"public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }",
"public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }",
"public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }",
"public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }",
"public function hasAuthorized() {\n return $this->_has(1);\n }",
"public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }",
"public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }",
"public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }",
"public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }",
"public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }",
"public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n return \\Auth::check() ? true : false;\n }",
"public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}",
"public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }",
"public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }",
"public function authorize()\n {\n return !empty(Auth::user());\n }",
"public function isAuthorized() {\n\t\t\n\t}",
"public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }",
"public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }",
"public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }",
"public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }",
"public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}",
"public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }",
"public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }",
"public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }",
"public function authorize()\n {\n return $this->auth->check();\n }",
"public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }",
"public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return $this->container['auth']->check();\n }",
"function isAuthorized($request) {\n return true;\n }",
"public function authorize()\n {\n return Auth::guest() || isMember();\n }",
"public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }",
"public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }",
"public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }",
"public function authorize()\n {\n return TRUE;\n }",
"public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }",
"public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }",
"public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }",
"public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }",
"public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}",
"public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }",
"public function authorize()\n {\n // User system not implemented\n return true;\n }",
"public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\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 authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }",
"public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }",
"public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }",
"public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }"
]
| [
"0.8400091",
"0.8376151",
"0.8376151",
"0.8343046",
"0.8252765",
"0.82470274",
"0.82118946",
"0.8145545",
"0.8110389",
"0.8082113",
"0.7991577",
"0.7989312",
"0.7982695",
"0.79595965",
"0.79507434",
"0.794834",
"0.7925477",
"0.7914969",
"0.7899856",
"0.7893212",
"0.78900343",
"0.7888994",
"0.78601307",
"0.78408074",
"0.78408074",
"0.78372097",
"0.7823834",
"0.7811764",
"0.78082436",
"0.77920574",
"0.778678",
"0.7780834",
"0.77797455",
"0.7762395",
"0.7753989",
"0.7717805",
"0.7717805",
"0.7715764",
"0.7713016",
"0.7703022",
"0.7693164",
"0.76921535",
"0.7690499",
"0.7689976",
"0.7673568",
"0.7666598",
"0.7665594",
"0.7654846",
"0.764989",
"0.7642104",
"0.76419175",
"0.76415265",
"0.76339245",
"0.7629985",
"0.76287305",
"0.7627034",
"0.76196754",
"0.76196754",
"0.76125336",
"0.76029867",
"0.76025975",
"0.7602217",
"0.7602217",
"0.7601853",
"0.7599287",
"0.75959945",
"0.75878304",
"0.75853646",
"0.75802433",
"0.756261",
"0.75532365",
"0.75522506",
"0.7550781",
"0.7543391",
"0.75425404",
"0.75393015",
"0.75372255",
"0.7528432",
"0.7515795",
"0.7513582",
"0.7498955",
"0.74950546",
"0.7494261",
"0.7491022",
"0.74871314",
"0.748663",
"0.7479677",
"0.74769044",
"0.7472495",
"0.7470842",
"0.7465162",
"0.7464345",
"0.7462356",
"0.7461828",
"0.7461126",
"0.744885",
"0.7438837",
"0.74345404",
"0.7433543",
"0.743183",
"0.74237186"
]
| 0.0 | -1 |
Get the validation rules that apply to the request. | public function rules()
{
return [
'title' => 'required|string',
'type' => 'required|in:Conference,Paper,Journal',
'photo' => 'image|mimes:jpeg,bmp,png,jpg',
'code' => 'required|string',
'pdf' => 'mimes:pdf',
'sublines' => 'required',
'usrs' => 'required',
'fk_project' => 'required',
'abstract' => 'required|string',
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }",
"public function getRules()\n {\n return $this->validator->getRules();\n }",
"public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }",
"public function rules()\n {\n return $this->validationRules;\n }",
"public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }",
"public static function getRules()\n {\n return (new static)->getValidationRules();\n }",
"public function getRules()\n {\n return $this->validation_rules;\n }",
"public function getValidationRules()\n {\n return [];\n }",
"public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }",
"public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }",
"public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }",
"protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }",
"public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }",
"public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }",
"public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }",
"public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }",
"public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }",
"protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }",
"public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }",
"protected function getValidRules()\n {\n return $this->validRules;\n }",
"public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }",
"public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }",
"public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }",
"public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n { \n return $this->rules;\n }",
"public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }",
"public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }",
"public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }",
"public function validationRules()\n {\n return [];\n }",
"public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }",
"public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }",
"public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }",
"public function rules()\n {\n return static::$rules;\n }",
"function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}",
"public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }",
"public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }",
"public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }",
"public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }",
"protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }",
"public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }",
"public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }",
"public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }",
"public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }",
"public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }",
"abstract protected function getValidationRules();",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }",
"public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}",
"public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }",
"public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }",
"public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }",
"public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }",
"public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }",
"public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }",
"public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }",
"public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }",
"public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }",
"public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }",
"public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }",
"public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }",
"public function getValidationRules() : array;",
"public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }",
"public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }",
"public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }",
"public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}",
"public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function rules()\n {\n $rules = array();\n return $rules;\n }",
"public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }",
"public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }",
"public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }",
"protected function get_validation_rules()\n {\n }",
"public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }",
"public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }",
"public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }",
"public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }",
"public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }",
"public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }",
"public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }",
"public function rules(Request $request)\n {\n return Qc::$rules;\n }",
"public function defineValidationRules()\n {\n return [];\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }",
"public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }"
]
| [
"0.8343821",
"0.8013592",
"0.7936293",
"0.79256666",
"0.7923988",
"0.7904124",
"0.7859339",
"0.7789916",
"0.7783626",
"0.7764009",
"0.77377397",
"0.7732641",
"0.7710237",
"0.7692145",
"0.7685806",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
"0.76764345",
"0.76736814",
"0.76648664",
"0.76589006",
"0.7642358",
"0.7630315",
"0.76299596",
"0.7618019",
"0.7609191",
"0.7608528",
"0.7602886",
"0.7599232",
"0.7598731",
"0.759276",
"0.7589901",
"0.7587388",
"0.7580103",
"0.7555663",
"0.755539",
"0.7550758",
"0.75460374",
"0.75400335",
"0.7537494",
"0.7536634",
"0.7530304",
"0.751899",
"0.75147283",
"0.7507793",
"0.75060636",
"0.75058895",
"0.749851",
"0.74955255",
"0.7495497",
"0.7493491",
"0.7490783",
"0.74902636",
"0.74900305",
"0.7487785",
"0.7485355",
"0.74800664",
"0.7479263",
"0.74697244",
"0.7464123",
"0.74631083",
"0.7461849",
"0.74595183",
"0.7455498",
"0.74541795",
"0.7453817",
"0.74505293",
"0.74489987",
"0.74412817",
"0.7441232",
"0.74353904",
"0.7435348",
"0.74327135",
"0.7429806",
"0.74293125",
"0.7424185",
"0.7420515",
"0.741543",
"0.7414524",
"0.7413734",
"0.74124366",
"0.7410401",
"0.74060625",
"0.7404286",
"0.740283",
"0.7401983",
"0.7390648",
"0.73845214",
"0.7373376",
"0.7371277",
"0.7369807",
"0.7361433",
"0.7356357",
"0.73448884",
"0.7344577",
"0.7343399",
"0.7335577"
]
| 0.0 | -1 |
Authenticate Set the API ID, Secret Key, and Server | public function Authenticate ($api_id, $secret_key, $server = 'https://elektropay.com/api') {
$this->api_id = $api_id;
$this->secret_key = $secret_key;
$this->post_url = $server;
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function authenticate()\n {\n $this->client->authenticate($this->token, null, Client::AUTH_HTTP_TOKEN);\n }",
"public static function authenticate(): void\n {\n try {\n $headers = [\n 'User-Agent' => 'albawebstudio-petfinderapi/1.0',\n 'Accept' => 'application/json',\n ];\n $data = [\n 'grant_type' => 'client_credentials',\n 'client_id' => self::$key,\n 'client_secret' => self::$secret,\n ];\n\n $config = [\n 'base_uri' => self::getEndpointUrl(),\n ];\n\n $client = new Client($config);\n\n $response = $client->request(self::POST, \"oauth2/token\", [\n 'headers' => $headers,\n 'json' => $data,\n ]);\n\n self::$accessToken = json_decode($response->getBody()->getContents(), true)['access_token'];\n Cache::add('petfinder_access_token', self::$accessToken, Carbon::now()->addHour());\n\n } catch (ClientException | GuzzleException $exception) {\n $logger = new Log();\n $logger->error($exception->getMessage());\n }\n }",
"public function OAuthAuthenticate()\n {\n throw new Exception( \"OAuthAuthenticate Not yet implemented\" );\n \n// $response = Auth1::legs(2)\n// ->set( 'key', $this->OAuthConsumerKey )\n// ->set( 'secret', $this->OAuthConsumerSecret )\n// ->request( $this->OAuthRequestURI );\n }",
"private function clientLogin() {\r\n $apikey = $this->input->server('PHP_AUTH_USER');\r\n $apisecret = $this->input->server('PHP_AUTH_PW');\r\n\r\n if (strlen(trim($apikey)) < 2 || strlen(trim($apisecret)) < 2) {\r\n throw new Exception('', 401000);\r\n }\r\n return $this->apiv1_core->clientLogin($apikey, $apisecret);\r\n }",
"public function authenticate() {}",
"function authenticate() {}",
"public function authenticate();",
"public function authenticate();",
"public function authenticate();",
"function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n $response[\"error\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $client_id;\n // get user primary key id\n $client_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"error\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}",
"function authenticate(\\Slim\\Route $route) {\r\n // getting request header\r\n $headers = apache_request_headers();\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n // verifying authorization header\r\n \r\n if (isset($headers['Authorization'])) {\r\n // $db = new DbHandler();\r\n // get the api key\r\n $api_key = $headers['Authorization'];\r\n // validating api key\r\n //echo $api_key;\r\n if ($api_key!='123456') {\r\n \t//echo '1';\r\n \r\n $response['error'] = true;\r\n $response['message'] = 'Access denied. Invalid api key';\r\n \r\n jsonResponse1( 200, $response );\r\n // echoResponse(401, $response);\r\n $app->stop();\r\n } else {\r\n \t//echo '2';\r\n \t//jsonResponse1( 200, $response );\r\n /* global $user_id;\r\n // get user primary key id\r\n $user = $db->getUserId($api_key);\r\n if ($user != NULL) {\r\n $user_id = $user['id'];\r\n } */\r\n }\r\n } else {\r\n // api key is missing in header\r\n $response['error'] = true;\r\n $response['message'] = \"Api key is missing\";\r\n echoResponse(400, $response);\r\n $app->stop();\r\n }\r\n}",
"function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $apikey = $headers['Authorization'];\n // validating apikey\n if (!$db->isValidApiKey($apikey)) {\n // apikey is not present in users table\n $response['error'] = \"true\";\n $response['rest'] = \"authenticate\";\n\t\t $response['message'] = \"Apikey Error\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($apikey);\n }\n } else {\n // apikey is missing in header\n\t\t$response['error'] = \"true\";\n\t\t$response['rest'] = \"authenticate\";\n\t\t$response['message'] = \"Apikey Missing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}",
"public function authenticate() {\n }",
"function authenticate()\n {\n $endpoint = $this->endpoints['authenticate'];\n return $this->sendRequest($endpoint['method'], $endpoint['uri']);\n }",
"public function _setRawCredentials()\n\t{\n\t\t/* Check if an API Key or Access Token has been passed as a parameter in the query string. Because of the\n\t\t\tobvious security issues with this, we do not recommend it, but sometimes it is the only choice */\n\t\tif ( isset( \\IPS\\Request::i()->key ) )\n\t\t{\n\t\t\t$this->rawApiKey = \\IPS\\Request::i()->key;\n\t\t\treturn;\n\t\t}\n\t\tif ( isset( \\IPS\\Request::i()->access_token ) and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t{\n\t\t\t$this->rawAccessToken = \\IPS\\Request::i()->access_token;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* Look for an API key in an automatically decoded HTTP Basic header */\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) )\n\t\t{\n\t\t\t$this->rawApiKey = $_SERVER['PHP_AUTH_USER'];\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* If we're still here, try to find an Authorization header - start with $_SERVER... */\n\t\t$authorizationHeader = NULL;\n\t\tforeach ( $_SERVER as $k => $v )\n\t\t{\n\t\t\tif ( mb_substr( $k, -18 ) == 'HTTP_AUTHORIZATION' )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $v;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* ...if we didn't find anything there, try apache_request_headers() */\n\t\tif ( !$authorizationHeader and \\function_exists('apache_request_headers') )\n\t\t{\n\t\t\t$headers = @apache_request_headers();\n\t\t\tif ( isset( $headers['Authorization'] ) )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $headers['Authorization'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* If we managed to get one, set if it's an API Key or an Access Token */\n\t\tif ( $authorizationHeader )\n\t\t{\n\t\t\tif ( mb_substr( $authorizationHeader, 0, 7 ) === 'Bearer ' and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t\t{\n\t\t\t\t$this->rawAccessToken = mb_substr( $authorizationHeader, 7 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$exploded = explode( ':', base64_decode( mb_substr( $authorizationHeader, 6 ) ) );\n\t\t\t\tif ( isset( $exploded[0] ) )\n\t\t\t\t{\n\t\t\t\t\t$this->rawApiKey = $exploded[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"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}",
"function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n //$headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $apiKey = $app->request->params('apikey');\n\n // Verifying Authorization Header\n if (isset($apiKey)) {\n $db = new DbHandler();\n if (!$db->isValidApiKey($apiKey)) {\n // api key is not present in users table\n $response[\"error\"] = TRUE;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($apiKey);\n }\n } else {\n // api key is missing in header\n $response[\"error\"] = TRUE;\n $response[\"message\"] = \"Api key is missing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}",
"private function prepareAuth()\n {\n $this->client->setHeaders(\n [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->zendeskHelper->getToken()\n ]\n );\n }",
"function authenticate(\\Slim\\Route $route) {\r\n // Getting request headers\r\n $headers = apache_request_headers();\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n\r\n // Verifying Authorization Header\r\n if (isset($headers['Authorization'])) {\r\n $db = new DbHandler();\r\n\r\n // get the api key\r\n $api_key = $headers['Authorization'];\r\n // validating api key\r\n if (!$db->isValidApiKey($api_key)) {\r\n // api key is not present in users table\r\n $response[\"error\"] = true;\r\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\r\n echoRespnse(401, $response);\r\n $app->stop();\r\n } else {\r\n global $user_id;\r\n // get user primary key id\r\n $user_id = $db->getUserId($api_key);\r\n }\r\n } else {\r\n // api key is missing in header\r\n $response[\"error\"] = true;\r\n $response[\"message\"] = \"Api key is misssing\";\r\n echoRespnse(400, $response);\r\n $app->stop();\r\n }\r\n}",
"function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n $response[\"error\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"error\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}",
"function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n $response[\"error\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"error\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}",
"public function setAuth($key, $secret)\n {\n $this->apiKey = $key;\n $this->apiSecret = $secret;\n }",
"protected function authenticate()\n\t{\n\t\t// Send the token request to Keystone\n\t\t$message = [\n\t\t\t'auth' => [\n\t\t\t\t'tenantId' => $this->tenantId,\n\t\t\t\t'passwordCredentials' => [\n\t\t\t\t\t'username' => $this->username,\n\t\t\t\t\t'password' => $this->password,\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\t\t$json = json_encode($message);\n\t\t$url = rtrim($this->authEndpoint, '/') . '/tokens';\n\n\t\t$request = new Request('POST', $url);\n\t\t$request->data = $json;\n\t\t$request->setHeader('Accept', 'application/json');\n\t\t$request->setHeader('Content-Type', 'application/json');\n\t\t$request->setHeader('Content-Length', strlen($request->data));\n\n\t\t$response = $request->getResponse();\n\n\t\t// Get the tenant ID\n\t\t$this->tenantId = $response->body->access->token->tenant->id;\n\n\t\t// Get the token and its expiration\n\t\t$this->token = $response->body->access->token->id;\n\t\t$date = new DateTime($response->body->access->token->expires);\n\t\t$this->tokenExpiration = $date->getTimestamp();\n\n\t\t// Loop through the serviceCatalog and index the Swift endpoints\n\t\tif (isset($request->body) && isset($request->body->serviceCatalog))\n\t\t{\n\t\t\tforeach ($request->body->serviceCatalog as $service)\n\t\t\t{\n\t\t\t\tif ($service->name != 'swift')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!isset($service->endpoints))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ($service->endpoints as $endpoint)\n\t\t\t\t{\n\t\t\t\t\t$this->endPoints[$endpoint->region] = $endpoint->publicURL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Callback\n\t\tif (is_callable($this->authenticationCallback))\n\t\t{\n\t\t\tcall_user_func_array($this->authenticationCallback, [&$this, $response]);\n\t\t}\n\n\t\treturn $this->token;\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 }",
"public function setAuthParams()\n {\n if( $this->getUseSession() )\n {\n // FIXME Need to add session functionality\n }\n else\n {\n $this->getHttpClient()->setParameterGet( 'user', $this->getUsername() );\n $this->getHttpClient()->setParameterGet( 'password', $this->getPassword() );\n $this->getHttpClient()->setParameterGet( 'api_id', $this->getApiId() );\n }\n }",
"public function login($apiKey = null, $apiSecret = null)\n {\n $this->_execute('/info/user/login', self::METHOD_POST);\n\n if (!empty($this->_error)) {\n throw new Api_Odr_Exception(self::MESSAGE_CURL_ERROR_FOUND);\n }\n\n $result = $this->_result;\n\n if (!is_string($apiKey) || $apiKey === '') {\n $apiKey = $this->_config['api_key'];\n }\n\n if (!is_string($apiSecret) || $apiSecret === '') {\n $apiSecret = $this->_config['api_secret'];\n }\n\n $apiKey = trim($apiKey);\n $apiSecret = trim($apiSecret);\n\n if ($apiKey === '' || $apiSecret === '') {\n throw new Api_Odr_Exception('You should defined `api_key` and `api_secret`');\n }\n\n $signatureRuleWrapper = $result['response']['fields']['signature']['signature_rule'];\n $signatureRule = $result['response']['fields']['signature']['signature_rule_clear'];\n\n $wrapper = 'sha1';\n\n if (strpos($signatureRuleWrapper, '#SHA1(') === 0) {\n $wrapper = 'sha1';\n } elseif(strpos($signatureRuleWrapper, '#MD5(') === 0) {\n $wrapper = 'md5';\n }\n\n $timestamp = time();\n\n $r = array(\n '#API_KEY#' => $apiKey,\n '#MD5(API_KEY)#' => md5($apiKey),\n '#SHA1(API_KEY)#' => sha1($apiKey),\n '#TIMESTAMP#' => $timestamp,\n '#API_SECRET#' => $apiSecret,\n '#MD5(API_SECRET)#' => md5($apiSecret),\n '#SHA1(API_SECRET)#' => sha1($apiSecret),\n );\n\n $signature = str_replace(array_keys($r), array_values($r), $signatureRule);\n\n switch($wrapper) {\n case 'sha1':\n $signature = sha1($signature);\n break;\n case 'md5':\n $signature = md5($signature);\n break;\n default:\n break;\n }\n\n $data = array(\n 'timestamp' => $timestamp,\n 'api_key' => $apiKey,\n 'signature' => 'token$' . $signature,\n );\n\n $this->_execute('/user/login/', self::METHOD_POST, $data);\n\n $result = $this->_result;\n\n $this->setHeader($result['response']['as_header'], $result['response']['token']);\n\n return $this;\n }",
"function auth_apikey($key){\n\t\n}",
"function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n $response[\"errorcode\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"errorcode\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}",
"function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new dbUser();\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n response('Invalid user ','Authorization', 'failed',true);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n response('Api Key is missing ','Authorization', 'failed',true);\n $app->stop();\n }\n}",
"public function __construct( $api_key, $secret_key ) {\r\n\t\r\n\t\t$this->api_key = $api_key;\r\n\t\t$this->secret_key = $secret_key;\r\n\t}",
"private function get_auth() {\n\n\t\t$options = array ('trace' => true, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED);\n\n\t\t$params = array();\n\t\t$params [\"credential\"][\"Type\"] = $this->type;\n\t\t$params [\"credential\"][\"Username\"] = $this->username;\n\t\t$encodedPassword = md5(mb_convert_encoding($this->password, 'utf-16le', 'utf-8'));\n\t\t$params [\"credential\"][\"Password\"] = $this->password;\n\t\t$params [\"credential\"][\"ApplicationId\"] = $this->api_key;\n\n\t\t$params [\"credential\"][\"IdentityId\"] = $this->identity;\n\n\t\t//$authentication = new SoapClient ( \"https://webservices.24sevenoffice.com/authenticate/authenticate.asmx?wsdl\", $options );\n\t\t$authentication = new SoapClient ( \"https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl\", $options );\n\n\t\t$login = true;\n\n\t\tif (!empty($_SESSION['ASP.NET_SessionId']))\n\t\t{\n\t\t \n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t try\n\t\t {\n\t\t $login = !($authentication->HasSession()->HasSessionResult);\n\t\t }\n\t\t catch ( SoapFault $fault ) \n\t\t {\n\t\t $login = true;\n\t\t }\n\n\t\t}\n\n\t\tif( $login )\n\t\t{\n\t\t\t\n\t\t $result = ($temp = $authentication->Login($params));\n\t\t // set the session id for next time we call this page\n\t\t $_SESSION['ASP.NET_SessionId'] = $result->LoginResult;\n\t\t // each seperate webservice need the cookie set\n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t // throw an error if the login is unsuccessful\n\n\t\t\t/*echo \"<pre>\";\n\t\t\tprint_r( $authentication );\n\t\t\techo \"</pre>\";*/\n\t\t\t\n\t\t if($authentication->HasSession()->HasSessionResult == false)\n\t\t throw new SoapFault(\"0\", \"Invalid credential information.\");\n\t\t}\n\n\t}",
"public function auth()\n\t{\n\t\t$r = $this->do_auth();\n\t\t$x['status'] = $r;\n\t\techo json_encode($x);die;\n\t}",
"function authenticate(\\Slim\\Route $route) {\n\n $app = \\Slim\\Slim::getInstance();\n // Getting request headers\n $api_key = $app->request->headers(\"Authorization\");\n // Verifying Authorization Header\n $db = new DbHandler();\n if (!$db->isValidHeader($api_key)) {\n $app->stop();\n }\n}",
"public function authentication(): void\n {\n $oauthParams = [\n 'clientId' => $this->config['clientId'],\n 'clientSecret' => $this->config['clientSecret'],\n 'redirectUri' => $this->config['callbackUrl'],\n ];\n\n $auth = new OAuth($oauthParams);\n\n if (isset($_GET['code'])) {\n $token = $auth->getAccessToken('authorization_code', ['code' => $_GET['code']]);\n\n $this->accessToken = $token->getToken();\n $this->refreshToken = $token->getRefreshToken();\n $this->instanceUrl = $token->getInstanceUrl();\n $this->tokenExpiry = $token->getExpires();\n\n } else {\n header('Location: '.$auth->getAuthorizationUrl());\n die();\n }\n }",
"public function ApiRequestAuthenticate($tokenAuth)\n {\n \\Piwik\\Registry::get('auth')->setLogin($login = null);\n \\Piwik\\Registry::get('auth')->setTokenAuth($tokenAuth);\n }",
"private function generateAPIAuth()\n {\n $ts = time();\n return '&ts='.$ts.'&apikey='.getenv('PUBLIC_KEY').'&hash='.md5($ts.getenv('PRIVATE_KEY').getenv('PUBLIC_KEY'));\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 authenticate(ServerRequestInterface $request): ResultInterface;",
"protected function init_api() {\n\t\tinclude_once dirname( __FILE__ ) . '/includes/class-coinbase-api-handler.php';\n\n\t\tCoinbase_API_Handler::$log = get_class( $this ) . '::log';\n\t\tCoinbase_API_Handler::$api_key = $this->get_option( 'api_key' );\n\t}",
"protected function auth()\n {\n $params = [\n 'grant_type' => 'client_credentials',\n 'client_id' => $this->clientID,\n 'client_secret' => $this->secret,\n ];\n\n $curlSession = curl_init(self::NZPOST_AUTH_URL);\n\n curl_setopt($curlSession, CURLOPT_POST, 1);\n curl_setopt($curlSession, CURLOPT_POSTFIELDS, http_build_query($params));\n curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, 1);\n $response = curl_exec($curlSession);\n\n $responseCode = curl_getinfo($curlSession, CURLINFO_HTTP_CODE);\n\n if (200 !== $responseCode) {\n throw new NzPostClientAuthException($response);\n }\n\n $body = json_decode($response, TRUE);\n if (!isset($body['access_token'])) {\n throw new NzPostClientAuthException('Could not get auth token from NZPOST API');\n }\n\n $this->token = $body['access_token'];\n\n if (isset($body['expires_in']) && $this->cacheIsSet()) {\n $expiresAt = $body['expires_in'] - self::REQUEST_TIMEOUT;\n\n $this->Cache->set(self::TOKEN, $body['access_token'], $expiresAt);\n }\n\n }",
"public function __construct($api_key, $data){\n \n if($this->hasPermission($api_key)){\n $this->response['message'] = 'Hi '.$data['REMOTE_ADDR'].', You successfully reached our API server :).';\n $this->response['error'] = null;\n $this->response['response'] = self::generatePassword();\n } else {\n $this->response['message'] = 'You don\\'t have permission';\n $this->response['error'] = '001';\n $this->resonse['response'] = false;\n }\n // Load passwords and connections from db or local file :/\n // But for testing purposes I'll add them manually here\n }",
"private function setupClient() {\n\t\t$this->client = MeetupKeyAuthClient::factory( [\n\t\t\t'key' => $this->key\n\t\t] );\n\t}",
"public function initialize() {\n\n\t\tif ( ! $this->config['keys']['id'] || ! $this->config['keys']['secret'] ) {\n\t\t\tthrow new Exception( \"Your application id and secret are required in order to connect to {$this->providerId}.\", 4 );\n\t\t}\n\n\t\t// override requested scope\n\t\tif ( isset( $this->config['scope'] ) && ! empty( $this->config['scope'] ) ) {\n\t\t\t$this->scope = $this->config['scope'];\n\t\t}\n\n\t\t// include OAuth2 client\n\t\trequire_once( Hybrid_Auth::$config['path_libraries'] . 'OAuth/OAuth2Client.php' );\n\t\trequire_once( wc_social_login()->get_plugin_path() . '/includes/hybridauth/class-wp-oauth2-client.php' );\n\n\t\t// create a new OAuth2 client instance\n\t\t$this->api = new WP_OAuth2_Client( $this->config['keys']['id'], $this->config['keys']['secret'], $this->endpoint, $this->compressed );\n\n\t\t$this->api->api_base_url = 'https://api.linkedin.com/v1/';\n\t\t$this->api->authorize_url = 'https://www.linkedin.com/oauth/v2/authorization';\n\t\t$this->api->token_url = 'https://www.linkedin.com/oauth/v2/accessToken';\n\n\t\t// If we have an access token, set it\n\t\tif ( $this->token( 'access_token' ) ) {\n\t\t\t$this->api->access_token = $this->token('access_token');\n\t\t\t$this->api->refresh_token = $this->token('refresh_token');\n\t\t\t$this->api->access_token_expires_in = $this->token('expires_in');\n\t\t\t$this->api->access_token_expires_at = $this->token('expires_at');\n\t\t\t$this->api->request_headers = array( 'Authorization' => 'Bearer ' . $this->api->access_token );\n\t\t}\n\n\t\tif ( empty( $this->config['fields'] ) ) {\n\t\t\t$this->config['fields'] = array(\n\t\t\t\t'id',\n\t\t\t\t'first-name',\n\t\t\t\t'last-name',\n\t\t\t\t'public-profile-url',\n\t\t\t\t'picture-url',\n\t\t\t\t'email-address',\n\t\t\t\t'date-of-birth',\n\t\t\t\t'phone-numbers',\n\t\t\t\t'summary',\n\t\t\t);\n\t\t}\n\t}",
"public static function authenticate(): void\n {\n $headers = getallheaders();\n $token = $headers['Authorization'] ?? null;\n\n if ($token === null\n || !self::validate($token)\n ) {\n header('Not authorized', true, 403);\n exit;\n }\n }",
"public function __construct($apiKey, $secretKey) {\n $this->apiKey = $apiKey;\n $this->secretKey = $secretKey;\n $this->url = $this->version . \"/\" . $this->resource;\n $this->sessionURL = $this->version;\n }",
"public function auth ()\n {\n $params = ['grant_type'=>'client_credentials'];\n $headers = ['Authorization' => 'Basic ' . base64_encode($this->_client_id.':'.$this->_client_secret)];\n $this->_request(Request::AUTH_URL, CurlClient::POST, $params, $headers);\n $token = Arr::get ($this->_body, 'access_token');\n $this->token($token);\n return ( ! empty ($token));\n }",
"private function authenticate()\n {\n self::assertValidAuthType();\n\n $this->client\n ->getEmitter()\n ->attach(new $this->authenticators[$this->authType]($this));\n }",
"private function auth()\n {\n if (!$this->username)\n {\n throw new PhpOpenSIPsException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpOpenSIPsException(\"Missing password\");\n }\n \n // realm\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }",
"public function __construct($url,$user,$password,$key,$api_version='V1'){\n $this->urlPath = $url;\n $this->apiUser = $user;\n $this->apiPassword = $password;\n\n\n if($key == \"\"){ \n $this->authenticate();\n } else{\n $this->apiKey = $key;\n }\n \n \n }",
"public function get_api_auth()\n {\n session_start();\n echo $_SESSION['api_auth'];\n }",
"private function performAuth() {\r\n\t\t\r\n\t\tGLOBAL $wgYammerConsumerKey, $wgYammerConsumerSecret, $wgEnableParserCache;\r\n\t\t\r\n\t\t$wgEnableParserCache = false;\r\n\t\t\r\n\t\t$status = $this->namespaceGet('status','init',true);\r\n\t\t\r\n\t\t# Consumer key is required\r\n\t\tif(empty($wgYammerConsumerKey) || empty($wgYammerConsumerSecret)) {\r\n\t\t\treturn $this->createErrorResponse('Please configure <code>$wgYammerConsumerKey</code> and <code>$wgYammerConsumerSecret</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# If the accesstoken/accesstokensecret are available, display those\r\n\t\tif(($atk =$this->namespaceGet('accesstoken',false)) !== false && ($ats = $this->namespaceGet('accesstokensecret',false)) !== false) {\r\n\t\t\treturn $this->createErrorResponse('Please configure <code>$wgYammerAccessKey=\"'.$atk.'\";</code> and <code>$wgYammerAccessSecret=\"'.$ats.'\";</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# If the request token/request token secret are not available, request one\r\n\t\t$rtk = $this->namespaceGet('requesttoken', false);\r\n\t\t$rts = $this->namespaceGet('requesttokensecret', false);\r\n\t\tif(false === ($rtk) && false === ($rts)) {\r\n\t\t\t$resp = $this->oauth_get(self::YAMMER_URI_REQUESTTOKEN, $wgYammerConsumerKey, $wgYammerConsumerSecret,'','',false,'PLAINTEXT');//$this->http(self::YAMMER_URI_REQUESTTOKEN, 'get');\r\n\t\t\tparse_str($resp[1], $arr);\r\n\t\t\t\r\n\t\t\tif(!empty($arr['oauth_token']) && !empty($arr['oauth_token_secret'])) {\r\n\t\t\t\t$this->namespaceSet('requesttoken', $arr['oauth_token']);\r\n\t\t\t\t$this->namespaceSet('requesttokensecret', $arr['oauth_token_secret']);\r\n\t\t\t\treturn $this->createErrorResponse('A new request token was retrieved from the Yammer server. Please <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a> for further instructions');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->createErrorResponse('<pre>Invalid response: '.htmlspecialchars($resp[1]).'</pre>');\r\n\t\t} else if(!empty($_POST['oauth_verifier'])) {\r\n\t\t\t$verifier = $_POST['oauth_verifier'];\r\n\t\t\t$resp = $this->oauth_get(self::YAMMER_URI_ACCESSTOKEN.'?callback_token='.urlencode($verifier), $wgYammerConsumerKey, $wgYammerConsumerSecret, $rtk, $rts, false, 'PLAINTEXT', 'POST');\r\n\t\t\tparse_str($resp[1], $arr);\r\n\t\t\tif(!empty($arr['oauth_token']) && !empty($arr['oauth_token_secret'])) {\r\n\t\t\t\t$this->namespaceSet('accesstoken', $arr['oauth_token']);\r\n\t\t\t\t$this->namespaceSet('accesstokensecret', $arr['oauth_token_secret']);\r\n\t\t\t\treturn $this->createErrorResponse('Request token was exchanged for an access token. Please <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->createErrorResponse('Failed to verify using code '.$verifier. '<br />The Yammer server sent the following response:<code>'.htmlspecialchars($resp[1]).'</code>');\r\n\t\t} else {\r\n\t\t\treturn $this->createVerifyFormResponse($rtk);//'rtk='.var_export($rtk, true).', rts='.var_export($rts, true));\r\n\t\t}\r\n\t\t\r\n\t\t# If the request token/request token secret are available\r\n\t\t# a) If the $_POST[verifier] is available, try and exchange the request token with an access token\r\n\t\t# b) Else show the authorisation url + the form where the member can input the Yammer oauth token\r\n\t\tif($rtk = $this->namespaceGet('requesttoken') && $rts = $this->namespaceGet('requesttokensecret', false)) {\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->createErrorResponse('Unexpected error in '.__CLASS__.'::'.__FUNCTION__);\r\n\t}",
"public function authentication()\n {\n }",
"public function requestAuthToken()\n {\n $apiKey = $this->getApiKey();\n $username = $this->getUsername();\n $password = $this->getPassword();\n $apiUrl = $this->getApiUrl();\n\n if ($apiKey) {\n return $apiKey;\n }\n\n if (!$username) {\n throw new AuthException('Username not provided', AuthException::USERNAME_NOT_PROVIDED);\n }\n\n if (!$password) {\n throw new AuthException('Password not provided', AuthException::USERNAME_NOT_PROVIDED);\n }\n\n if (!$apiUrl) {\n throw new ConnException('API URL not provided', ConnException::URL_NOT_PROVIDED);\n }\n\n $requestHeaders = ['Content-Type' => 'application/json'];\n\n $requestObj = new stdClass();\n $requestObj->username = $username;\n $requestObj->password = $password;\n\n $requestOptions = [\n 'headers' => $requestHeaders,\n 'body' => json_encode($requestObj)\n ];\n\n $response = $this->processRequest('PUT', $this->getApiUrl() . '/login', $requestOptions);\n\n if (200 !== $response->getStatusCode()) {\n throw new ConnException('Non-200 response from API.', ConnException::BAD_RESPONSE);\n }\n\n $responseRawBody = $response->getBody()->getContents();\n if (!isJson($responseRawBody)) {\n throw new ConnException('Non-JSON response from API.', ConnException::BAD_RESPONSE);\n }\n\n $responseBody = json_decode($responseRawBody);\n if (!isset($responseBody->token)) {\n throw new ConnException('API token not found in response.', ConnException::BAD_RESPONSE);\n }\n\n $this->setConnectionData($responseBody);\n $this->setApiKey($responseBody->token);\n\n return $responseBody->token;\n }",
"public function __construct()\n {\n $this->apiKey = '66122f8ad1adb1c075c75aba3bd503a4a559fc7f';\n }",
"protected function authenticate()\n\t{\n\t\t$config = $this->getConfig();\n\n\t\tif(empty($config->api->auth->username) && empty($config->api->auth->password))\n\t\t\treturn true;\n\n\t\t$key = $this->getRequest()->getPost('key');\n\t\t$serviceKey = md5($config->api->auth->username . ':' . $config->api->auth->password);\n\t\tif($key && $key == $serviceKey)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"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 }",
"public function setAuthenticationParams() {\n }",
"public function setApiCredentials($credentials) {\n\t\t$secure = (isset($credentials['secure'])) ? $credentials['secure'] : true;\n\t\t$this->api_url = $secure ? 'https://' : 'http://';\n\t\t$this->api_url .= $credentials['api_domain'] . '/@api/deki/';\n\n\t\t$this->api_username = (!empty($credentials['api_username'])) ? $credentials['api_username'] : '';\n\t\t$this->api_password = (!empty($credentials['api_password'])) ? $credentials['api_password'] : '';\n\t}",
"public function __construct() {\n $dotenv = new Dotenv();\n $dotenv->load(dirname(__DIR__).'/.env');\n\n $this->api = new Api($_ENV['CLODUI_API']);\n\n $client_id = $_ENV['CLODUI_CLIENT_ID'];\n $user_pool_id = $_ENV['CLODUI_USER_POOL_ID'];\n $identity_pool_id = $_ENV['CLODUI_IDENTITY_POOL_ID'];\n\n Logger::debug('Config Client ID '. $client_id. ', User pool id '. $user_pool_id. ', Identity pool id '. $identity_pool_id);\n $this->auth = new Auth($client_id, $user_pool_id, $identity_pool_id);\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 }",
"protected function authenticate()\n\t{\n\t\treturn $this->client;\n\t}",
"function MCAPI($username, $password) {\n //do more \"caching\" of the uuid for those people that keep instantiating this...\n $this->apiUrl = parse_url(\"http://api.mailchimp.com/\" . $this->version . \"/?output=php\");\n if (isset($GLOBALS[\"mc_api_key\"]) && $GLOBALS[\"mc_api_key\"]!=\"\"){\n $this->api_key = $GLOBALS[\"mc_api_key\"];\n } else {\n $this->api_key = $this->callServer(\"login\", array(\"username\" => $username, \"password\" => $password));\n $GLOBALS[\"mc_api_key\"] = $this->api_key;\n }\n }",
"public function authenticate()\n {\n $urlAccessToken = Client::BASE_URL.'/v1/token';\n\n // we are using a very simple password grant AdForm\n // doesn't event return a Refresh Token AF\n $provider = new GenericProvider([\n 'clientId' => '',\n 'clientSecret' => '',\n 'redirectUri' => '',\n 'urlAuthorize' => '',\n 'urlAccessToken' => $urlAccessToken,\n 'urlResourceOwnerDetails' => ''\n ]);\n\n try {\n $this->accessToken = $provider->getAccessToken('password', [\n 'username' => $this->username,\n 'password' => $this->password\n ]);\n } catch (IdentityProviderException $e) {\n throw OauthException::connect($e->getMessage());\n }\n }",
"public function getApiKey();",
"function authGet() { }",
"public function testAuthenticationServiceAuthenticate()\n {\n $response = self::$av->authenticate(self::$credentials);\n $this->assertFalse($response->hasError);\n\n $this->assertNotEmpty($response->reply->getAccessToken());\n self::$accessToken = $response->reply->getAccessToken();\n }",
"public function authenticate()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('login', Input::only('email', 'password'));\n\n\t\t# if the user was authenticated\n\t\tif(isset($response['success']))\n\t\t{\t\n\t\t\t# save the returned user object to the session for later use\n\t\t\tUser::startSession($response['success']['data']['user']);\n\n\t\t\t# we got here from a redirect. if they came via a new account registration then reflash the \n\t\t\t# session so we can use the data on the next page load\n\t\t\tif(Session::has('success')) {\n\t\t\t\tSession::reflash();\n\t\t\t}\t\t\t\n\n\t\t\tif(Input::get('redirect') && ! Session::has('ignoreRedirect')) {\n\t\t\t\treturn Redirect::to(Input::get('redirect'));\n\t\t\t}\n\n\t\t\t# and show the profile page\n\t\t\treturn Redirect::to('profile');\t\n\t\t}\n\t\t# auth failed. return to the log in screen and display an error\n\t\telse \n\t\t{ \n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('login-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\n\t\t\t# ... and show the log in page again\n\t\t\treturn Redirect::to('login');\n\t\t}\n\t}",
"public function authenticate( $params ) {\n\t\t$response = $this->requester->request('POST', $this->url, $params);\n\t\t$this->requester->token = $response['token'];\n\t\treturn $response;\n\n\t}",
"public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }",
"private function auth()\n {\n if (!$this->username)\n {\n throw new PhpSIPException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpSIPException(\"Missing password\");\n }\n \n // realm\n $result = [];\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = [];\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }",
"public function xAuth() {\n\t\t// Auth config\n\t\t$auth = \\Config::get('gponster/laravel-oauth-server::auth');\n\n\t\t// ----------------------------------------------------------------------------\n\t\t// IF PASSWORD STORE IN DATABASE AS DIGEST FORMAT, CLIENT APPLICATION\n\t\t// MUST GENERATE PASSWORD DIGEST BEFORE BUILD SIGNATURE WITH SAME ALGORITHM\n\t\t// ----------------------------------------------------------------------------\n\t\t$credentials = [\n\t\t\t$auth['username'] => $this->getParam(self::X_AUTH_USERNAME, true),\n\t\t\t$auth['password'] => $this->getParam(self::X_AUTH_PASSWORD, true),\n\t\t\t$auth['status'] => 1\n\t\t];\n\n\t\tif(empty($credentials[$auth['username']])) {\n\t\t\tthrow OAuthException::make(OAuthException::PARAMETER_ABSENT,\n\t\t\t\t[\n\t\t\t\t\t'name' => self::X_AUTH_USERNAME\n\t\t\t\t]);\n\t\t}\n\n\t\tif(empty($credentials[$auth['password']])) {\n\t\t\tthrow OAuthException::make(OAuthException::PARAMETER_ABSENT,\n\t\t\t\t[\n\t\t\t\t\t'name' => self::X_AUTH_PASSWORD\n\t\t\t\t]);\n\t\t}\n\n\t\t$xAuthMode = $this->getParam(self::X_AUTH_MODE, true);\n\t\t$loggedIn = false;\n\t\t$user = null;\n\n\t\tif($xAuthMode == 'client_auth') {\n\t\t\t$loggedIn = \\Auth::validate($credentials);\n\t\t\tif($loggedIn) {\n\t\t\t\t$user = Auth::getLastAttempted();\n\t\t\t}\n\t\t} else if(! empty($auth['social_login'])) {\n\t\t\t// Try social-login\n\t\t\t$provider = \\App::make(\n\t\t\t\t'Gponster\\\\OAuth\\\\Provider\\\\SocialLoginProviderInterface');\n\t\t\t$user = $provider->login($xAuthMode, $credentials[$auth['username']],\n\t\t\t\t$credentials[$auth['password']], null);\n\t\t}\n\n\t\tif(! $user) {\n\t\t\tthrow OAuthException::make(OAuthException::INVALID_CREDENTIALS,\n\t\t\t\t[\n\t\t\t\t\t'username' => $credentials[$auth['username']]\n\t\t\t\t]);\n\t\t}\n\n\t\t// Verify request if signature not valid\n\t\t$result = $this->verify(false, $this->forceBypassNonce);\n\n\t\t$options = [];\n\t\t$options['callback_url'] = isset($result['callback_url']) ? $result['callback_url'] : null;\n\t\t$options['referer_url'] = isset($result['referer_url']) ? $result['referer_url'] : null;\n\n\t\t// Should have a transaction here?\n\t\t$accessToken = $this->storages['access_token']->createAccessToken(\n\t\t\t$result['consumer_key'], $credentials[$auth['username']], $options);\n\t\tif(! $accessToken) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'Cannot create new access token for ' . json_encode($result));\n\t\t}\n\n\t\t$data = [];\n\t\t$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($accessToken['token']);\n\t\t$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode($accessToken['token_secret']);\n\t\t$data[self::OAUTH_CALLBACK_CONFIRMED] = 1;\n\n\t\t$data['user'] = [\n\t\t\t$auth['username'] => $user->{$auth['username']}\n\t\t];\n\n\t\t// Get extra information\n\t\tif(! empty($auth['profile'])) {\n\t\t\t$provider = \\App::make(\n\t\t\t\t'Gponster\\\\OAuth\\\\Provider\\\\UserProfileProviderInterface');\n\t\t\t$profile = $provider->profile($user->{$auth['username']}, [\n\t\t\t\t'login' => true\n\t\t\t]);\n\n\t\t\tif(is_array($profile)) {\n\t\t\t\t$data['user'] = array_merge($data['user'], $profile);\n\t\t\t}\n\t\t}\n\n\t\tif(! empty($accessToken['expires_at']) && is_numeric($accessToken['expires_at'])) {\n\t\t\t$expiresAt = Carbon::createFromTimestamp(intval($accessToken['expires_at']));\n\n\t\t\t$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();\n\t\t\t$data['expires_at'] = $expiresAt->timestamp;\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function __construct($apiKey, $apiSecret) {\r\n\t\t$this->apiKey = $apiKey;\r\n\t\t$this->apiSecret = $apiSecret;\r\n\t\t//$this->setStore ( $store );\r\n\t\tparent::__construct ( $app_key, $app_secret );\r\n\t}",
"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 }",
"abstract protected function auth();",
"abstract public function credentials();",
"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 Authenticate( )\n\t\t{\n\t\t\t$dataArray = array(\n \"email\"=>$this->email,\n \"password\"=>$this->password\n );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/Authenticate/123\", \"json\" );\n \n return $response;\n\t\t}",
"public function authenticate($token);",
"function Redactedapi() {\n \n if(!empty($_POST['site_id']) && is_numeric($_POST['site_id']))\n {\n $this->site_id = $_POST['site_id']; \n } \n else\n {\n $this->site_id = 1;\n }\n \n if($_SERVER['SERVER_NAME'] == 'www.redacted.com'){\n $this->username = 'xxxx';\n $this->password = 'xxxx';\n $this->url \t\t= 'https://api-1.redacted.com/redactedapiservice.asmx';\n } else{\n $this->username = 'xxxxx';\n $this->password = 'xxxxx';\n $this->url \t = 'https://testapi-1.redacted.com/redactedAPIService.asmx?wsdl';\n } \n\t\t\t\n\t\t$this->CI =& get_instance();\n\t\t$this->CI->load->helper('cookie');\n\t}",
"public function doAuthentication();",
"protected function sendAuthRequest() : void\n {\n $message = \"PASSWORD \" . $this->id . \" \" . $this->password;\n $this->sendRequest($message);\n }",
"public function doAuthentication( $api_token = null ) { \t\n\n $url = $this->_base_url . 'me';\n $this->_callAPI($url);\n }",
"public function login(string $username, string $password): ApiInterface;",
"public function connect($details)\n\t{\n\t\t$this->restApi->setAuthInfo($details['username'], $details['password']);\n\t\t$this->searchApi->setAuthInfo($details['username'], $details['password']);\n\t}",
"public function setUp() {\n\t\t$this->client = new ElggApiClient(elgg_get_site_url(), $this->apikey->public);\n\t\t$result = $this->client->obtainAuthToken($this->user->username, 'pass123');\n\t\tif (!$result) {\n\t\t echo \"Error in getting auth token!\\n\";\n\t\t}\n\t}",
"public static function auth()\n {\n return (new Authenticator(request()));\n }",
"public function __construct($api_key , $api_secret) {\r\n\r\n if(empty($api_key)) {\r\n throw new \\Exception(\"API Key not set\");\r\n }\r\n\r\n if(empty($api_secret)) {\r\n throw new \\Exception(\"API Secret not set\");\r\n }\r\n\r\n $this->api_key = $api_key;\r\n $this->api_secret = $api_secret;\r\n }",
"public function __construct()\n {\n $this->client = new Client();\n $this->apiKey = Api::platform('TikApi')->first()->api_key;\n }",
"public function getAuthSecret()\n {\n return $this->apiSecret;\n }",
"public function __construct() {\n\t\t$client = new \\GuzzleHttp\\Client;\n\t\t$this->client = $client;\n\n\t\t$response = $this->client->request('POST', 'http://api.thingsee.com/v2/accounts/login', \n\t\t\t['json' => \n\t\t\t\t[\n\t\t\t\t\t'email' => Config::get('thingsee.email'), \n\t\t\t\t\t'password' => Config::get('thingsee.password')\n\t\t\t\t]\n\t\t\t]);\n\n\t\t// Obsolete, 401 and 500 will be caught in the calling function\n\t\t$statusCode = $response->getStatusCode();\n\n\t\t$data = json_decode($response->getBody(), true);\n\t\t$this->accountAuthToken = $data['accountAuthToken'];\n\t}",
"public function testAuthenticate()\n {\n $this->mockWebApplication([\n 'modules' => [\n 'oauth2' => [\n 'resourceServerAccessTokenRevocationValidation' => false, // Token revocation validation is tested during functional testing.\n ]\n ]\n ]);\n // phpcs:enable Generic.Files.LineLength.TooLong\n\n $request = Yii::$app->request;\n $request->headers->set('Authorization', 'Bearer ' . $this->validAccessToken);\n\n $httpBearerAuth = new Oauth2HttpBearerAuth();\n\n $identity = $httpBearerAuth->authenticate(Yii::$app->user, $request, Yii::$app->response);\n $this->assertNotNull($identity);\n $this->assertEquals(123, $identity->getId());\n }",
"public function __construct( $api_key, $api_secret ){\n $this->api_key = $api_key;\n $this->api_secret = $api_secret;\n\n $this->service = new FmRestApi();\n }",
"function testCredentials($params = array())\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/keyTest\", $params);\n return $this->createResponse($result,'Test APIKey Credentials','ApiKey');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"public function authenticate()\n\t{\n\t\t$this->errorCode==self::ERROR_NONE;\n\t}",
"public function testApiCredentialsFromEnvironment() {\n // set home directory that would be necessary for a file\n $_SERVER['HOME'] = dirname(__FILE__);\n // set the environment variable, this is what it should be set to\n $envVarKey = \\AffiliateLinkr\\CommissionJunction\\ApiCredentials::ENV_KEY;\n $envVarSite = \\AffiliateLinkr\\CommissionJunction\\ApiCredentials::ENV_SITE;\n $_SERVER[$envVarKey] = \"BARKEY\";\n $_SERVER[$envVarSite] = \"FOOSITE\";\n $oApiCredentials = \\AffiliateLinkr\\CommissionJunction\\ApiCredentials::factory();\n\n $this->assertNotNull($oApiCredentials);\n \n $this->assertEquals($_SERVER[$envVarKey], $oApiCredentials->getDeveloperKey());\n $this->assertEquals($_SERVER[$envVarSite], $oApiCredentials->getWebsiteId());\n \n }",
"static function init($api_token, $api_secret, $options = array())\n {\n self::$api_token = $api_token;\n self::$api_secret = $api_secret;\n\n self::$use_https = self::option_or_default('use_https', $options, self::$use_https);\n self::$encode = self::option_or_default('encode', $options, self::$encode);\n self::$use_buffer = self::option_or_default('use_buffer', $options, self::$use_buffer);\n self::$log_dir = self::option_or_default('log_dir', $options, self::$log_dir);\n self::$log_file_buffer = self::option_or_default('log_file_buffer', $options, self::$log_file_buffer);\n self::$log_file_debug = self::option_or_default('log_file_debug', $options, self::$log_file_debug);\n self::$debug = self::option_or_default('debug', $options, self::$debug);\n self::$prod_env = self::option_or_default('prod_env', $options, self::$prod_env);\n self::$epoch = self::option_or_default('epoch', $options, self::$epoch);\n\n // check if everything we need is installed and working\n if ((self::$use_buffer || self::$debug) && !is_writable(self::$log_dir)) {\n throw new Exception('Unable to write to log dir ' . self::$log_dir);\n }\n if (!function_exists('curl_init')) {\n throw new Exception('Salesmachine needs the CURL PHP extension.');\n }\n if (!function_exists('json_decode')) {\n throw new Exception('Salesmachine needs the JSON PHP extension.');\n }\n\n return self::is_initialized();\n }",
"function acapi_get_creds() {\n $user = acapi_get_option('email');\n $pass = acapi_get_option('key');\n if (empty($user) || empty($pass)) {\n return drush_set_error('ACAPI_CREDS_MISSING', dt('Email and api key required; specify --email/--key or run drush ac-api-login'));\n }\n return \"$user:$pass\";\n}",
"function authenticate() {\n //this would be for hard-coded username/password, sometimes useful if you \n //don't have a database\n //echo $_SERVER[\"PHP_AUTH_USER\"] . \"<BR>\";\n if ((isset($_SERVER[\"PHP_AUTH_USER\"]) && ($_SERVER['PHP_AUTH_USER'] == 'client') &&\n isset($_SERVER['PHP_AUTH_PW']) && ($_SERVER[\"PHP_AUTH_PW\"] == 'secret'))) {\n header('HTTP/1.0 200 OK'); //all is good!\n } else {\n -\n //don't let them in!\n header('WWW-Authenticate: Basic realm=\"Test Authentication System\"');\n header('HTTP/1.0 401 Unauthorized');\n echo \"You must enter a valid login ID and password to access this resource\\n\";\n }\n exit; //stop execution of the program so we don't get any more errors\n}",
"public function api($server = \"\"){\n\t\t\n\t\tswitch($server)\n\t\t{\n\t\t\tcase \"live\":\n\t\t\t\t$this->server_url = $this->live_server_url;\n\t\t\t\tbreak;\n\t\t\tcase \"rc\":\n\t\t\t\t$this->server_url = $this->rc_server_url;\n\t\t\t\tbreak;\n\t\t\tcase \"dev\":\n\t\t\t\t$this->server_url = $this->dev_server_url;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->server_url = $this->live_server_url;\n\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\tif(isset($_SESSION['session_id']))\n\t\t\t$this->session_id = $_SESSION['session_id'];\n\t}",
"public function authenticateApiKey(MvcEvent $event)\n {\n $routeMatch = $event->getRouteMatch();\n if (!$routeMatch->getParam('__API__')) {\n // This is not an API request.\n return;\n }\n\n $identity = $event->getRequest()->getQuery('key_identity');\n $credential = $event->getRequest()->getQuery('key_credential');\n\n if (is_null($identity) || is_null($credential)) {\n // No identity/credential key to authenticate against.\n return;\n }\n\n $auth = $event->getApplication()->getServiceManager()\n ->get('Omeka\\AuthenticationService');\n $auth->getAdapter()->setIdentity($identity);\n $auth->getAdapter()->setCredential($credential);\n $auth->authenticate();\n }"
]
| [
"0.6701531",
"0.6609958",
"0.64511836",
"0.6438541",
"0.64375895",
"0.6429138",
"0.6402728",
"0.6402728",
"0.6402728",
"0.6344048",
"0.63339394",
"0.61989075",
"0.61964893",
"0.6126083",
"0.6096294",
"0.60950583",
"0.6074857",
"0.606251",
"0.6059285",
"0.60130334",
"0.60130334",
"0.59942365",
"0.5983661",
"0.59722334",
"0.59712404",
"0.59570366",
"0.59546304",
"0.5949506",
"0.5943653",
"0.5920727",
"0.5908268",
"0.58958447",
"0.58913743",
"0.58892936",
"0.5877003",
"0.5873559",
"0.585581",
"0.5854322",
"0.5833262",
"0.5812369",
"0.58030504",
"0.58015287",
"0.57957554",
"0.5776897",
"0.57768553",
"0.57607347",
"0.57604784",
"0.5751097",
"0.5749189",
"0.5746613",
"0.5742808",
"0.568528",
"0.5666034",
"0.5656434",
"0.565375",
"0.56530005",
"0.5649001",
"0.5643432",
"0.5642222",
"0.56317097",
"0.5628828",
"0.56286657",
"0.5628596",
"0.5627908",
"0.56233937",
"0.5613892",
"0.5606681",
"0.56022793",
"0.5594758",
"0.5582382",
"0.5581125",
"0.5574402",
"0.5558442",
"0.5557942",
"0.5555284",
"0.554687",
"0.5536597",
"0.55336636",
"0.55313146",
"0.55290216",
"0.55252576",
"0.5521381",
"0.5507738",
"0.5502144",
"0.5494198",
"0.5483492",
"0.5482699",
"0.54808176",
"0.5478359",
"0.54775643",
"0.547655",
"0.5467806",
"0.5467634",
"0.54674906",
"0.5459731",
"0.5456221",
"0.5453139",
"0.5449443",
"0.5443131",
"0.54388624"
]
| 0.7090771 | 0 |
Set Request Type Sets the request type | public function SetMethod($method) {
$this->method = ucwords($method);
return TRUE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setRequestType($requestType) {\n\t\t$requestType = $this->str($requestType);\n\n\t\tif(!$requestType->caseLower()->equals('GET') && !$requestType->equals('POST')) {\n\t\t\tthrow new OAuth2Exception('Invalid request type provided \"' . $requestType->val() . '\".\n\t\t\t\t\t\t\t\t\t\tPossible values are GET and POST.');\n\t\t}\n\n\t\t$this->_requestType = $requestType->caseUpper()->val();\n\t}",
"public function setRequestType(?string $value): void {\n $this->getBackingStore()->set('requestType', $value);\n }",
"public function getRequestType()\n {\n return $this->getParameter('requestType') ?: $this->requestType;\n }",
"public function getRequestType()\n {\n return $this->requestType;\n }",
"public function getRequestType()\n {\n return $this->_requestType;\n }",
"public function getRequestType() : RequestType {\n\t\t\treturn clone $this->requestType;\n\t\t}",
"function setRequest($value) {\n $this->request = $value;\n }",
"public function setType($type) {}",
"public function defineTypo3RequestTypes() {}",
"function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type){ }",
"function setType($type) {\n\t\t$this->_type = $type;\n\t}",
"function setType($type) {\n\t\t$this->_type = $type;\n\t}",
"public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}",
"public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}",
"public function setType(string $type);",
"public function setType($type)\r\n {\r\n $this->type = $type;\r\n }",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\n\t}",
"public function setType( $type )\n {\n }",
"protected function setType()\n {\n $this->client_type = $this->getType();\n }",
"public function getRequestType()\n {\n return $this->getKey('RequestType');\n }",
"function setRequest($request) {\n\t\t$this->m_request = $request;\n\t}",
"public function setType($Type) \n {\n $this->Type = $Type;\n }",
"public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }",
"function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}",
"public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}",
"public function setRenderType($type)\n {\n if ($type === self::RENDER_JSON) {\n $this->allowRenderJson = true;\n }\n\n $_REQUEST['renderType'] = $type;\n }",
"public function setType(string $type) {\n if ($type == Router::API_ROUTE || $type == Router::CLOSURE_ROUTE ||\n $type == Router::CUSTOMIZED || $type == Router::VIEW_ROUTE) {\n $this->type = $type;\n }\n }",
"protected function getRequestType()\r\n {\r\n return array_key_exists('StatusCode', $this->request_data) && is_numeric($this->request_data['StatusCode'])\r\n ? self::REQ_NOTIFICATION\r\n : self::REQ_CUSTOMER_REDIRECT;\r\n }",
"public function setType($t){\n $this->type = $t;\n }",
"public function setContentType ($type) {\r\n\t\t$this->content_type = Headers::getMimeType($type) ?: $type;\r\n\t}",
"public function setType( $type ) {\n\n\t\t$this->type = $type;\n\t}",
"public function type(string $type): self\n {\n if (!in_array($type, ['generic', 'personal'])) {\n throw new InvalidRequestException('Type must be either \"generic\" or \"personal\".');\n }\n $this->type = $type;\n\n return $this;\n }",
"public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}",
"public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}",
"public function setType($type)\n {\n $this['type'] = $type;\n }",
"public static function set_request($request){\n\t\t\tself::$request = $request;\n\t\t}",
"public function setRequest(namespace\\Request $request)\n {\n $this->request = $request;\n }",
"public function set($data, $type)\n {\n switch ($type) {\n case self::HTTP_TYPE_GET:\n $this->get = (array)$data;\n break;\n case self::HTTP_TYPE_POST:\n $this->post = (array)$data;\n break;\n case self::HTTP_TYPE_COOKIE:\n $this->cookie = (array)$data;\n break;\n case self::HTTP_TYPE_REQUEST:\n $this->request = (array)$data;\n break;\n case self::HTTP_TYPE_JSON:\n $this->json = (array)$data;\n break;\n case self::HTTP_TYPE_PARAMS:\n $this->params = (array)$data;\n break;\n default:\n throw new \\Exception('Request type is unknown');\n }\n }",
"public function update(Request $request, Type $type)\n {\n //\n }",
"public function update(Request $request, Type $type)\n {\n //\n }",
"public function setMethod($request_method) {}",
"public function setRequestTypeData($var)\n {\n GPBUtil::checkEnum($var, \\Kubemq\\Request\\RequestType::class);\n $this->RequestTypeData = $var;\n\n return $this;\n }",
"public function setRequest($request);",
"public function setType($type)\n\t{\n\t\t// TODO: Validate the action?\n\t\t$this->type = $type;\n\t\t\n\t\treturn $this;\n\t}",
"public function setType($aType) {\n $this->type = $aType;\n }",
"public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}",
"public function setTyp( $type );",
"function setType($inType) {\n\t\tif ( $inType !== $this->_Type ) {\n\t\t\t$this->_Type = $inType;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function setType(string $type)\n {\n $this->type = $type;\n }",
"public function setRequest(Request $request)\n {\n $this->_request = $request;\n }",
"public function setRequest( $request ){\n \n $this->request = $request;\n \n }",
"function setRequest($request) {\n $this->request = $request;\n }",
"public function setCapabilityType($type = 'post'){\n\t\t$this->capabilityType = $type;\n\t}",
"public function setRequest(Request $request)\n\t{\n\t\t/* null */\n\t}",
"public function setRequest($request)\n {\n $this->request = $request;\n }",
"public function & SetRequestClass ($requestClass);",
"public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }",
"function set_content_type($type) {\n $this->response->add_header('Content-Type', $type);\n }",
"public function setContentType( string $type ) : void\n {\n $this->headers->set( 'Content-Type', $type );\n }",
"protected function setType(int $type):void {\r\n\t\t$this->type = $type;\r\n\t}",
"public function setRequest(Request $request) {\r\n $this->request = $request;\r\n }",
"function getRequestType() {\n\t\treturn $this->sapiType;\n\t}",
"public function setContentType($type)\r\n {\r\n $this->repo['header']['Content-Type'] = $type;\r\n }",
"private function setContentType($type = \"html\") \n\t{\n\t\theader('Content-type: application/'.$type);\n\t}",
"public function changeTypeDrink($request);",
"public function type( $type )\n {\n $this->type = strtolower( $type );\n return $this;\n }",
"public function getTypeFromRequest(Request $request);",
"public function getTypeFromRequest(Request $request);",
"function http_set_content_type($content_type)\n\t{\n\t\t$this->http_content_type = $content_type;\n\t}",
"public function setType(?string $type): void\n {\n }",
"public function setType(?string $type): void;",
"public function set_type(String $_type){\n $this->_type = $_type;\n\n return $this;\n }",
"public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }",
"public function setContentTypeHeader($type)\n {\n switch($type) {\n case 'json':\n $this->app->response->headers->set('Content-Type', 'application/json');\n break;\n case 'javascript':\n $this->app->response->headers->set('Content-Type', 'application/javascript');\n break;\n default:\n // default is html..\n break;\n }\n }",
"public function setType(string $type): self;",
"public function setType(string $type): self;",
"public function setRequest(Request $request) {\n $this->request = $request;\n }"
]
| [
"0.80168456",
"0.74022025",
"0.6853477",
"0.67805016",
"0.6765541",
"0.65668523",
"0.6503747",
"0.64230794",
"0.63405496",
"0.6335648",
"0.6307088",
"0.6307088",
"0.6307088",
"0.6293864",
"0.6291824",
"0.6291824",
"0.6281185",
"0.6267813",
"0.62605035",
"0.62596536",
"0.6246048",
"0.6246048",
"0.6246048",
"0.6246048",
"0.6246048",
"0.6246048",
"0.6246048",
"0.6246048",
"0.6240395",
"0.62282735",
"0.6227798",
"0.62236154",
"0.6222322",
"0.6199024",
"0.61927044",
"0.6187344",
"0.6180124",
"0.6180124",
"0.6168437",
"0.6168437",
"0.6168437",
"0.6168437",
"0.6168437",
"0.6168437",
"0.6168437",
"0.6168437",
"0.6168437",
"0.6167373",
"0.6167373",
"0.61638385",
"0.6162537",
"0.61307144",
"0.6126649",
"0.61244714",
"0.6110913",
"0.6100536",
"0.6091045",
"0.6091045",
"0.6082284",
"0.6080062",
"0.60764956",
"0.6036817",
"0.602284",
"0.602284",
"0.6012448",
"0.6007784",
"0.5977949",
"0.59634876",
"0.5963243",
"0.5951843",
"0.5950297",
"0.5947437",
"0.5923847",
"0.59081674",
"0.58941615",
"0.5879972",
"0.5869578",
"0.5864148",
"0.5856488",
"0.58484584",
"0.5848229",
"0.5846175",
"0.58418924",
"0.58056575",
"0.5804834",
"0.5799745",
"0.579741",
"0.5793079",
"0.57901853",
"0.57894754",
"0.57892066",
"0.57892066",
"0.57829964",
"0.57787716",
"0.5777706",
"0.5773645",
"0.5772202",
"0.57629126",
"0.5762525",
"0.5762525",
"0.57527804"
]
| 0.0 | -1 |
Set a Parameter Sets a parameter for the request | public function Param($name, $value, $parent = FALSE) {
if (!isset($this->params))
{
$this->params = new stdClass();
}
if (!empty($parent)) {
// initiate parent parameter storage
if (!isset($this->params->$parent)) {
$this->params->$parent = new stdClass();
}
$this->params->$parent->$name = $this->xmlEntities($this->utf8tohtml($value));
} else {
$this->params->$name = $this->xmlEntities($this->utf8tohtml($value));
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function setParameter($parameter);",
"public function setParameter($name, $value);",
"public function setParam($param, $value);",
"public function set($parameter, $value);",
"public function setParameter($name, $value) {\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 setParam($name, $value);",
"public function set_parameter($name, $value)\n {\n $this->_parameters[ $name ] = $value;\n }",
"public function setParameter($param, $value)\n {\n $this->params[$param] = $value;\n }",
"function setParameter($key, $value) {\n $this->parameters[$key] = $value;\n }",
"protected function setParameter($name, $value)\n {\n $this->parameters[$name] = $value;\n }",
"abstract protected function setParameter($key, $value);",
"public function setParameter($name, $value) {\n $this->parameters[$name] = $value;\n }",
"public function setParameter($name, $value)\n {\n $this->params[$name] = $value;\n $this->processFilters();\n }",
"function setParam($name, $value) {\n $this->params[$name] = $value;\n }",
"public function setParam($key, $value);",
"public function setParameter($name, $value)\n {\n $this->parameters();\n $this->parameters[$name] = $value;\n }",
"public function setParameter($name, $value)\n {\n $this->getParameters();\n $this->parameters[$name] = $value;\n }",
"public function setParameter($name, $value)\n {\n $this->parameters[$name] = $value;\n }",
"public function setParameter ($name, $value)\n {\n\n $this->parameters[$name] = $value;\n\n }",
"public function setParam($name, $value){\n\t\t$this->params[(string)$name] = $value;\n\t}",
"public function setParameter(string $paramName, $paramValue = NULL);",
"public function setParam($name, $value) {\n $this->parameter[$name] = $value;\n }",
"public function setParameter($parameter, $value)\n {\n $this->setParameters(array_merge($this->getParameters(), [$parameter => $value]));\n }",
"public function setParameter(int $parameter): void\n {\n $this->parameter = $parameter;\n }",
"public function __set($param, $value)\r\n {\r\n $this->params_named->set($param, $value);\r\n }",
"public function setParam($param, $value)\n {\n $this->params[$param] = $value;\n }",
"public function setParam($param, $value)\n {\n $this->_params[$param] = $value;\n }",
"public function setParam($name, $val) {\n $this->params[$name]= $val;\n }",
"protected function set(string $parameter, $value): self {\n\t\t$this->parameters[$parameter] = $value;\n\t\t\n\t\treturn $this;\n\t}",
"public function setParam(string $name, $value): void\n {\n $this->params[$name] = $value;\n }",
"public static function setParameter($name,$value) {\n\t if($value === null) {\n\t unset($_REQUEST[$name]);\n\t return null;\n\t }\n\t\treturn ($_REQUEST[$name] = $value);\n\t}",
"public function setParameter( $key, $value ) {\n\t\t$this->fields[ $this->parameterPrefix . trim( $key ) ] = $value;\n\t}",
"public function set_param($key, $value)\n {\n }",
"public function set( $name, $value )\n\t{\n\t\t$this->_params[$name] = $value;\n\t}",
"public function setParameter($name, $value, $ns = null)\r\n {\r\n $this->parameterHolder->set($name, $value, $ns);\r\n }",
"function setParameters($parameters);",
"final public function setParameter($name, $value)\n {\n $this->parameters[$name] = $value;\n return $this;\n }",
"protected function setParameters($parameter, $id)\n {\n $this->parameters[$parameter] = $id;\n }",
"final public function setParameter($name, $value, $type = null): self\n {\n if ($type === null) {\n $type = ParameterTypeInferer::inferType($value);\n }\n\n $this->parameters[$name] = ['value' => $value, 'type' => $type, 'is_list' => false];\n\n // Keep the parameters sorted for the hash\n ksort($this->parameters);\n\n // The filter collection of the EM is now dirty\n $this->em->getFilters()->setFiltersStateDirty();\n\n return $this;\n }",
"public function __set($name, $value)\n {\n $this->params[$name] = $value;\n }",
"public function setParameter($parameter)\n\t{\n\t\t$this->parameter = $parameter;\n\t\t\n\t\treturn $this;\n\t}",
"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($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($key, $val) {\n $this->params[$key] = $val;\n }",
"public function setParam($key, $value)\r\n {\r\n $this->_frontController->setParam($key, $value);\r\n }",
"public function setter(string $paramName, $paramValue);",
"public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }",
"public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }",
"public function setParam($name, $value)\n\t{\n\t\treturn $this->_tpl->params->set($name, $value);\n\t}",
"private function setParam($statemant, $key, $value){\n\t\t$statemant->bindParam($key, $value);\n\t}",
"public function setParam($name, $value){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}",
"public function set($parameter, $value = null) {\n if (is_array($parameter)) {\n return $this->parameters = $parameter;\n }\n return $this->parameters[$parameter] = $value;\n }",
"public function setParam($key, $value)\n\t{\n\t\treturn $this->_params->set($key, $value);\n\t}",
"public function __set($param, $value);",
"function set_params($params)\r\n\t{\r\n\t\t$this->parameters = $params;\r\n\t}",
"public function offsetSet($param, $value)\n\t{\n\t\t$this->params[(string) $param] = $value;\n\t}",
"public function parameter(string $paramName, $paramValue);",
"function setParam($inKey, $inParamValue) {\n\t\treturn $this->_setItem($inKey, $inParamValue);\n\t}",
"public function set($params) {}",
"function setParam($var, $val) {\n\t\t\t$this->obj[$var] = $val;\n\t\t}",
"private function _setParam($param, $val)\n {\n \n switch ($param) {\n case 'symbol':\n $this->symbol = $val;\n break;\n case 'stat':\n $this->stat = $val;\n break;\n case 'history':\n $this->history = $val;\n break;\n }\n }",
"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 set_parameter(Application $application, $name, $value)\n {\n $parameters = &$this->determine_level($application);\n $parameters[$name] = $value;\n }",
"public function setParam($name, $value)\n {\n $name = (string) $name;\n $this->_invokeParams[$name] = $value;\n return $this;\n }",
"public function setParam($name, $value) \n {\n\n // lazy init\n if ($this->_params == null) {\n $this->_params = array();\n }\n\n $this->_params[$name] = $value;\n return $this;\n }",
"public function setParam($name, $value)\n {\n $this->params[$name] = $value;\n return $this;\n }",
"protected function setParameter($parameter, $value)\n {\n if ($value === null) {\n if (is_string($parameter)) {\n unset($this->params[$parameter]);\n } elseif (is_int($parameter)) {\n $this->params[$parameter] = null;\n }\n } else {\n $this->params[$parameter] = $value;\n }\n\n return $this;\n }",
"public function setParam($name, $value = null) {\n\t\tif (is_array($name))\n\t\t{\n\t\t\t$this->params = $this->params + (array)$name;\n\n\t\t\t/*foreach ($name as $key => $value) {\n\t\t\t\tif (null === $value) {\n\t\t\t\t\tunset($this->_params[$key]);\n\t\t\t\t}\n\t\t\t}*/\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$name = (string)$name;\n\n\t\t\t/*if ((null === $value) && isset($this->_params[$name])) {\n\t\t\t\tunset($this->_params[$name]);\n\t\t\t} elseif (null !== $value) {\n\t\t\t\t$this->_params[$name] = $value;\n\t\t\t}*/\n\t\t\t$this->params[$name] = $value;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setDefaultParam($name, $value);",
"public function setParameters($parameters){\n\t\tself::$_parameters[get_class($this)] = $parameters;\n\t}",
"public function setParameter($key, $value, $type = null)\n {\n if ($type !== null) {\n $this->paramTypes[$key] = $type;\n }\n\n $this->params[$key] = $value;\n\n return $this;\n }",
"protected function setParam(string $key, string $value): RequestInterface\n {\n $this->params[$key] = $value;\n return $this;\n }",
"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 setParameters($parameters) {\n $this->params = $parameters;\n }",
"public function setParameter(string $name, $value): void\n {\n $this->config[$name] = $value;\n }",
"public function setMinkParameter($name, $value)\n {\n $this->minkParameters[$name] = $value;\n }",
"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 with(Template\\Parameter $parameter)\n {\n $this->parameters[$parameter->getKey()] = $parameter;\n }",
"public function putParam($key, $value)\n {\n $this->params[$key] = $value;\n }",
"public function setJsonParameter($name, $value)\n {\n $this->json_parameters[$name] = $value;\n }",
"public function setParameter($key, $value)\n {\n if (!$this->parameters) {\n $this->parameters = array();\n }\n\n $this->parameters[$key] = $value;\n\n return $this;\n }",
"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 }",
"public function setName($param) {\n $this->name = $param;\n }",
"public function setParameter($name, $value): QueryBuilderInterface;",
"function setParam($name, $value)\n\t{\n\t\t$this->table->$name = $value;\n\t}",
"public function addParameter(string $name, $value): self;",
"public function set($parameters)\n {}",
"public function setParam(string $key, string $value): self\n {\n $this->params[$key] = $value;\n\n return $this;\n }",
"public function setParam($params)\n {\n $this->m_params = $params;\n }",
"public function setParameter(array $parameter): self\n {\n $this->options['parameter'] = $parameter;\n return $this;\n }",
"public function set_parameter( $param_id, $value, $required = false, $data = NULL )\n {\n $util_class_name = lib::get_class_name( 'util' );\n\n // make sure the parameter exists\n if( !array_key_exists( $param_id, $this->parameters ) )\n throw lib::create( 'exception\\argument', 'param_id', $param_id, __METHOD__ );\n\n // process the value so that it displays correctly\n if( 'boolean' == $this->parameters[$param_id]['type'] )\n {\n if( is_null( $value ) ) $value = '';\n else $value = $value ? 'Yes' : 'No';\n }\n else if( 'date' == $this->parameters[$param_id]['type'] )\n {\n if( strlen( $value ) )\n {\n $date_obj = $util_class_name::get_datetime_object( $value );\n $value = $date_obj->format( 'Y-m-d' );\n }\n else $value = '';\n }\n else if( 'time' == $this->parameters[$param_id]['type'] )\n {\n if( strlen( $value ) )\n {\n $date_obj = $util_class_name::get_datetime_object( $value );\n $value = $date_obj->format( 'H:i' );\n }\n else $value = '12:00';\n }\n else if( 'hidden' == $this->parameters[$param_id]['type'] )\n {\n if( is_bool( $value ) ) $value = $value ? 'true' : 'false';\n }\n else if( 'constant' == $this->parameters[$param_id]['type'] &&\n ( ( is_int( $value ) && 0 == $value ) ||\n ( is_string( $value ) && '0' == $value ) ) )\n {\n $value = ' 0';\n }\n else if( 'number' == $this->parameters[$param_id]['type'] )\n {\n $value = floatval( $value );\n }\n\n $this->parameters[$param_id]['value'] = $value;\n if( 'enum' == $this->parameters[$param_id]['type'] )\n {\n $enum = $data;\n if( is_null( $enum ) )\n throw lib::create( 'exception\\runtime',\n 'Trying to set enum parameter without enum values.', __METHOD__ );\n\n // add a null entry (to the front of the array) if the parameter is not required\n if( !$required )\n {\n $enum = array_reverse( $enum, true );\n $enum['NULL'] = '';\n $enum = array_reverse( $enum, true );\n }\n $this->parameters[$param_id]['enum'] = $enum;\n }\n else if( 'date' == $this->parameters[$param_id]['type'] ||\n 'datetime' == $this->parameters[$param_id]['type'] )\n {\n if( is_array( $data ) )\n {\n $date_limits = $data;\n if( array_key_exists( 'min_date', $date_limits ) )\n $this->parameters[$param_id]['min_date'] = $date_limits['min_date'];\n if( array_key_exists( 'max_date', $date_limits ) )\n $this->parameters[$param_id]['max_date'] = $date_limits['max_date'];\n }\n }\n\n $this->parameters[$param_id]['required'] = $required;\n }",
"public function setParam($param, $value){\n // $value = array_merge(array('plugins'), (array)$value);\n\n if ($param == 'template_dir'){\n $this->setTemplateDirs((array)$value);\n } else {\n //$this->_instance->$param = $value;\n }\n\n\n }",
"function set_get_parameter($param, $value) {\n\n $get_value = \\M\\Config::get('GET');\n $get_value[$param] = $value;\n\n \\M\\Config::set('GET', $get_value);\n}",
"public function setParameters($parameters) {\n $this->parameters = $parameters;\n }",
"private function setParameter($key, $value)\n {\n $this->parameters->set($key, $value);\n\n return $this;\n }",
"public function setParam($param)\n {\n $this->param = $param;\n\n return $this;\n }",
"public function param($param, $value)\n\t{\n\t\t$this->parameters[$param] = $value;\n\n\t\treturn $this;\n\t}",
"public function setParams($params);",
"public function setParams($params);",
"public function set_parameters($value)\n\t{\n\t\t$this->parameters = array_merge($this->parameters, $value);\n\t}"
]
| [
"0.80442446",
"0.7853172",
"0.7599025",
"0.7559847",
"0.7544423",
"0.74947274",
"0.7490428",
"0.7340862",
"0.729433",
"0.72901046",
"0.7289757",
"0.7275213",
"0.72491074",
"0.7244063",
"0.72012264",
"0.71937525",
"0.71824014",
"0.71735847",
"0.7163779",
"0.71479326",
"0.7121363",
"0.71190155",
"0.7110855",
"0.7086699",
"0.7066479",
"0.7015473",
"0.695727",
"0.6914342",
"0.6885768",
"0.68772423",
"0.6824924",
"0.68207115",
"0.6804159",
"0.6773173",
"0.67451286",
"0.67322195",
"0.67139465",
"0.6710224",
"0.6699676",
"0.663679",
"0.65805984",
"0.6530954",
"0.6521269",
"0.65197414",
"0.6517597",
"0.65028375",
"0.64682597",
"0.64492756",
"0.64492756",
"0.64479446",
"0.6434594",
"0.6434469",
"0.64343655",
"0.6429172",
"0.64041024",
"0.6403232",
"0.6399407",
"0.63777244",
"0.6342468",
"0.63420594",
"0.63195187",
"0.6305449",
"0.6301155",
"0.62902397",
"0.6286825",
"0.62755126",
"0.62745994",
"0.6271271",
"0.6262566",
"0.6262545",
"0.62561196",
"0.6252443",
"0.62510645",
"0.6224885",
"0.62244517",
"0.6212292",
"0.6205159",
"0.6195698",
"0.61938596",
"0.61907166",
"0.6186715",
"0.6167568",
"0.6167098",
"0.6155168",
"0.6154044",
"0.61524296",
"0.6152393",
"0.6149604",
"0.61370873",
"0.61194056",
"0.6094218",
"0.6087946",
"0.6078218",
"0.60779315",
"0.6077593",
"0.60768926",
"0.6072739",
"0.60658413",
"0.606529",
"0.606529",
"0.60565114"
]
| 0.0 | -1 |
Process the Request Sends the request to the server in XML and returns a PHP array of the response | public function Process($debug = FALSE) {
if ($this->post_url == '') {
return FALSE;
}
// See which params are set
$i=0;
if(isset($this->params)) {
foreach($this->params as $key => $value) {
if(is_object($value)) {
$xml_params[$i] = '<'.$key.'>';
foreach($value as $key1 => $value1) {
$xml_params[$i] .= '<'.strtolower($key1).'>'.$value1.'</'.strtolower($key1).'>';
}
$xml_params[$i] .= '</'.$key.'>';
} else {
$xml_params[$i] = '<'.strtolower($key).'>'.$value.'</'.strtolower($key).'>';
}
$i++;
}
}
// put our XML together
$xml = '<?xml version="1.0" encoding="UTF-8"?><request>';
if(isset($this->api_id) AND isset($this->secret_key)) {
$xml .= '<authentication><api_id>' . $this->api_id . '</api_id><secret_key>' . $this->secret_key . '</secret_key></authentication>';
}
if(isset($this->method)) {
$xml .= '<type>'.$this->method.'</type>';
}
if(isset($xml_params)) {
foreach($xml_params as $xml_param)
{
$xml .= $xml_param;
}
}
$xml .= '</request>';
if ($debug) {
$xml = simplexml_load_string($xml);
$doc = new DOMDocument('1.0');
$doc->preserveWhiteSpace = false;
$doc->loadXML($xml->asXML());
$doc->formatOutput = true;
echo $doc->saveXML();
return true;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, $this->post_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$data = curl_exec($ch);
// die($data);
if (curl_errno($ch)) {
print curl_error($ch);
}
else {
curl_close($ch);
// empty parameters
$this->params = new stdClass;
// check for a system error
if (strpos($data, '<div') === 0) {
// this isn't XML, it's an error
$error = strip_tags($data);
echo 'A system error was incurred in the process of the ' . $this->method . ' call: ' . $error;
return FALSE;
}
$xml = $this->toArray($data);
// automatically redirect if we received a <redirect> node
if (isset($xml['redirect']) and !empty($xml['redirect'])) {
header('Location: ' . $xml['redirect']);
die();
}
return $xml;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function processRequest();",
"function processRequest() {\n\n\t\t// Cleanup any previous response\n\t\t$this->m_response = null;\n\n\t\t// Optional argument is the request\n\t\tif (func_num_args() === 1) {\n\t\t\t$this->m_request = func_get_arg(0);\n\t\t}\n\n\t\tif ($this->m_request === null) {\n\t\t\ttrigger_error(\"CardEaseXMLRequest: No request to process\", E_USER_ERROR);\n\t\t}\n\n\t\t// Validate that the request data is good\n\t\t$this->m_request->validate();\n\n\t\tif ($this->m_serverURLs === null || count($this->m_serverURLs) === 0) {\n\t\t\ttrigger_error(\"CardEaseXMLCommunication: No servers to contact\", E_USER_ERROR);\n\t\t}\n\n\t\t$lastCommunicationException = null;\n\n\t\t// Try each of the server URLs\n\t\tforeach ($this->m_serverURLs as $url) {\n\n\t\t\tif ($url === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$xmlWriter = new XMLWriterCreditCall($this->m_xmlEncoding);\n\t\t\t$requestXML = $this->m_request->generateRequestXML($xmlWriter);\n\n\t\t\t// Set the HTTP settings\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10000);\n\t\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Content-Type: text/xml\"));\n\t\t\tcurl_setopt($curl, CURLOPT_POST, TRUE);\n\t\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $requestXML);\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t\t@curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, TRUE); // FIXME This should really be TRUE\n\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE); // FIXME This should really be TRUE\n\t\t\tcurl_setopt($curl, CURLOPT_CAINFO, dirname(__FILE__).'/../../cacert.pem');\n\t\t\tcurl_setopt($curl, CURLOPT_TIMEOUT, $url->getTimeout());\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $url->getURL());\n\n\t\t\t// Setup the proxy information\n\t\t\tif ($this->m_proxyHost !== null) {\n\t\t\t\tcurl_setopt($curl, CURLOPT_PROXY, $this->m_proxyHost.\":\".$this->m_proxyPort);\n\n\t\t\t\tif ($this->m_proxyUserName !== null && $this->m_proxyPassword !== null) {\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->m_proxyUserName.\":\".$this->m_proxyPassword);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Create a connection to the server and send the XML\n\t\t\t$responseXML = curl_exec($curl);\n\n\t\t\t$curlError = curl_error($curl);\n\t\t\t$curlInfo = curl_getinfo($curl);\n\n\t\t\tcurl_close($curl);\n\n\t\t\tif (!empty($curlError)) {\n\t\t\t\t$lastCommunicationException = \"CardEaseXMLCommunication: $curlError\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Read the response code from the server and check it\n\t\t\t$responseCode = $curlInfo['http_code'];\n\n\t\t\t// Check the response code\n\t\t\tif ($responseCode !== 200) {\n\t\t\t\t$lastCommunicationException = \"CardEaseXMLCommunication: Unexpected HTTP response: \" . $responseCode;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (strlen($responseXML) === 0) {\n\t\t\t\t$lastCommunicationException = \"CardEaseXMLCommunication: Unable to retrieve server response\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Convert the XML string to a response\n\t\t\t$this->m_response = new Response();\n\t\t\t$this->m_response->parseResponseXML($responseXML);\n\n\t\t\t// If we have got this far the connection has been successful\n\t\t\treturn $this->m_response;\n\t\t}\n\n\t\t// Communication hasn't been successful and an exception exists\n\t\tif ($lastCommunicationException !== null) {\n\t\t\ttrigger_error($lastCommunicationException, E_USER_ERROR);\n\t\t}\n\n\t\treturn $this->m_response;\n\t}",
"abstract public function processRequest();",
"public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }",
"public abstract function processRequest();",
"public function process($request)\n\t\t{\n\t\t\treturn array('request' => $request, 'result' => 'demo');\n\t\t}",
"public function xml()\n {\n try\n {\n if (! $this->decoded) {\n $this->response = json_encode(simplexml_load_string($this->response));\n\n $this->json();\n }\n }\n catch (\\Exception $exception){\n $this->decoded = [];\n }\n\n return $this->decoded;\n }",
"public function getXmlResponse();",
"public function parse($xml = null)\n {\n if($xml === null)\n $xml = $this->getResponse()->getBody();\n\n $xml = simplexml_load_string($xml);\n $requestSummary = new \\ZendService\\ZendServerAPI\\DataTypes\\RequestSummary();\n $requestSummary->setEventsCount((string) $xml->responseData->requestSummary->eventsCount);\n $requestSummary->setCodeTracing((string) $xml->responseData->requestSummary->codeTracing);\n\n foreach ($xml->responseData->requestSummary->events->event as $xmlEvent) {\n $event = new \\ZendService\\ZendServerAPI\\DataTypes\\Event();\n $event->setType((string) $xmlEvent->type);\n $event->setDescription((string) $xmlEvent->description);\n\n $superglobal = new \\ZendService\\ZendServerAPI\\DataTypes\\SuperGlobals();\n if (isset($xmlEvent->superGlobals->cookie->parameter)) {\n foreach ($xmlEvent->superGlobals->cookie->parameter as $cookie) {\n $superglobal->addCookieParameter(trim((string) $cookie->name), trim((string) $cookie->value));\n }\n }\n\n if (isset($xmlEvent->superGlobals->server->parameter)) {\n foreach ($xmlEvent->superGlobals->server->parameter as $server) {\n $superglobal->addServerParameter(trim((string) $server->name), trim((string) $server->value));\n }\n }\n\n if (isset($xmlEvent->superGlobals->get->parameter)) {\n foreach ($xmlEvent->superGlobals->get->parameter as $get) {\n $superglobal->addGetParameter(trim((string) $get->name), trim((string) $get->value));\n }\n }\n\n if (isset($xmlEvent->superGlobals->post->parameter)) {\n foreach ($xmlEvent->superGlobals->post->parameter as $post) {\n $superglobal->addPostParameter(trim((string) $post->name), trim((string) $post->value));\n }\n }\n\n if (isset($xmlEvent->superGlobals->session->parameter)) {\n foreach ($xmlEvent->superGlobals->session->parameter as $session) {\n $superglobal->addSessionParameter(trim((string) $session->name), trim((string) $session->value));\n }\n }\n\n $event->setSuperglobals($superglobal);\n $event->setSeverity((string) $xmlEvent->severity);\n $event->setDebugUrl((string) $xmlEvent->debugUrl);\n\n foreach ($xmlEvent->backtrace->step as $xmlStep) {\n $step = new \\ZendService\\ZendServerAPI\\DataTypes\\Step();\n $step->setNumber((string) $xmlStep->number);\n $step->setObject((string) $xmlStep->object);\n $step->setClass((string) $xmlStep->class);\n $step->setFunction((string) $xmlStep->function);\n $step->setFile((string) $xmlStep->file);\n $step->setLine((string) $xmlStep->line);\n\n $event->addStep($step);\n }\n\n $requestSummary->addEvents($event);\n }\n\n return $requestSummary;\n }",
"private function process(HttpSocketResponse $response)\n\t{\n\t\t$result = array();\n\t\tif (!empty($response)) {\n\t\t\t$body = $response->body();\n\t\t\tswitch ($this->format) {\n\t\t\t\tcase 'xml':\n\t\t\t\t\t$xml = Xml::build($body);\n\t\t\t\t\t$temp = Xml::toArray($xml);\n\t\t\t\t\t$result = array('Yourls' => $temp['result']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'json':\n\t\t\t\t\t$result = array('Yourls' => json_decode($body, true));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$result = $body;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"public function processMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n \t//extract post data\n \t$logfile = fopen(\"./log/request_log\", \"a\");\n \tfwrite($logfile, $postStr);\n \tfclose($logfile);\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $parseObj = new RequestParse();\n $requestData = $parseObj->parse($postStr);\n $processObj = new RequestProcess();\n $responseData = $processObj->process($requestData);\n $responseObj = new RequestResponse();\n //echo $responseObj->response($responseData);\n\t\t $response = $responseObj->response($responseData);\n\t\t echo $response;\n\t\t $logfile = fopen(\"./log/response_log\", \"a\");\n\t\t fwrite($logfile, $response);\n\t\t fclose($logfile);\n }else {\n \techo \"\";\n \texit;\n }\n }",
"public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }",
"function response()\n{\n //$data = $GLOBALS['HTTP_RAW_POST_DATA'];\n $data = file_get_contents('php://input');\n $client = simplexml_load_string($data);\n\n if (strtolower($client->MsgType) == \"event\") {\n if ($client->Event == 'subscribe') {\n $toUserName = $client->FromUserName;\n $FromUserName = $client->ToUserName;\n $time = time();\n $msgType = 'text';\n $content = \"hello world\";\n $tpl = \" <xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n </xml>\";\n $info = sprintf($tpl,$toUserName,$FromUserName,$time,$msgType,$content);\n echo $info;\n }\n\n\n }else{\n if(strtolower($client->MsgType) == 'text'){\n $request = $client->Content;\n $flag = fliter($request);\n switch($flag){\n case 'cet4':\n $msg = cet4($request);\n break;\n case 'matrix':\n $msg = matrixCaculator($request);\n break;\n case 'default':\n $msg = $request;\n break;\n default:\n $msg = $request;\n }\n responseText($client,$msg);\n }\n }\n}",
"function processRequest($request) {\n\t\tlogMessage($request);\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, 'http://api.myallocator.com/pms/v201408/xml/SetAllocation');\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);\n\t\tcurl_setopt($curl, CURLOPT_TIMEOUT, 60);\n\t\tcurl_setopt($curl, CURLOPT_POST, 1);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, 'xmlRequestString=' . urlencode($request));\n\t\t$body = trim(curl_exec($curl));\n\t\t// echo \"Response: \" . $body . \"\\n\";\n\t\t$matches = array();\n\t\tlogMessage($body);\n\t\tpreg_match('/<Success>([^<]*)<\\/Success>/', $body, $matches);\n\t\t$success = count($matches) > 0 ? $matches[1] : '';\n\t\tif($success == 'true') {\n\t\t\techo \"<b>Update Successful!</b><br>\\n\";\n\t\t} else {\n\t\t\techo \"Update not successful: \" . $success . \"<br>\\n\";\n\t\t\techo \"Warnings: <br><ul>\\n\";\n\t\t\t$matches = array();\n\t\t\tpreg_match('/<WarningMsg>([^<]*)<\\/WarningMsg>/', $body, $matches);\n\t\t\tforeach ($matches as $msg) {\n\t\t\t\techo '<li>' . $msg . \"</li>\\n\";\n\t\t\t}\n\t\t\techo \"</ul>\\n\";\n\t\t\techo \"Errors: <br><ul>\\n\";\n\t\t\tpreg_match('/<ErrorMsg>([^<]*)<\\/ErrorMsg>/', $body, $matches);\n\t\t\tforeach ($matches as $msg) {\n\t\t\t\techo '<li>' . $msg . \"</li>\\n\";\n\t\t\t}\n\t\t\techo \"</ul>\\n\";\n\n\t\t}\n\n\t\t//echo \"Response: \" . $body;\n\t\treturn $body;\n\t}",
"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}",
"public function getEmrsRequest(){\r\n\t \t$xml = '<EMRSV4.0Request USERID=\"282LIXIA0523\" PASSWORD=\"309NM26RF888\">\r\n\t\t\t\t\t\t<Option>RIGHTWINDOW</Option>\r\n\t\t\t\t\t\t<CustomerName>Garrison Johns</CustomerName>\r\n\t\t\t\t\t\t<CustomerAddress1>TEST 40</CustomerAddress1>\r\n\t\t\t\t\t\t<CustomerAddress2>6406 Ivy Lane</CustomerAddress2>\r\n\t\t\t\t\t\t<CustomerCity>Greenbelt</CustomerCity>\r\n\t\t\t\t\t\t<CustomerState>MD</CustomerState>\r\n\t\t\t\t\t\t<CustomerZip5>20770</CustomerZip5>\r\n\t\t\t\t\t\t<CustomerZip4 />\r\n\t\t\t\t\t\t<RetailerName>Reza Dianat</RetailerName>\r\n\t\t\t\t\t\t<RetailerAddress>6406 Ivy Lane</RetailerAddress>\r\n\t\t\t\t\t\t<PermitNumber>293829</PermitNumber>\r\n\t\t\t\t\t\t<PermitIssuingPOCity>Greenbelt</PermitIssuingPOCity>\r\n\t\t\t\t\t\t<PermitIssuingPOState>MD</PermitIssuingPOState>\r\n\t\t\t\t\t\t<PermitIssuingPOZip5>20770</PermitIssuingPOZip5>\r\n\t\t\t\t\t\t<PDUPOBox>6406 Ivy Lane</PDUPOBox>\r\n\t\t\t\t\t\t<PDUCity>Greenbelt</PDUCity>\r\n\t\t\t\t\t\t<PDUState>MD</PDUState>\r\n\t\t\t\t\t\t<PDUZip5>20770</PDUZip5>\r\n\t\t\t\t\t\t<PDUZip4>1234</PDUZip4>\r\n\t\t\t\t\t\t<ServiceType>Bound Printed Matter</ServiceType>\r\n\t\t\t\t\t\t<DeliveryConfirmation>False</DeliveryConfirmation>\r\n\t\t\t\t\t\t<InsuranceValue />\r\n\t\t\t\t\t\t<MailingAckPackageID>ID00001</MailingAckPackageID>\r\n\t\t\t\t\t\t<WeightInPounds>0</WeightInPounds>\r\n\t\t\t\t\t\t<WeightInOunces>10</WeightInOunces>\r\n\t\t\t\t\t\t<RMA>RMA 123456</RMA>\r\n\t\t\t\t\t\t<RMAPICFlag>False</RMAPICFlag>\r\n\t\t\t\t\t\t<ImageType>TIF</ImageType>\r\n\t\t\t\t\t\t<RMABarcode>False</RMABarcode>\r\n\t\t\t\t\t\t<AllowNonCleansedDestAddr>False</AllowNonCleansedDestAddr>\r\n\t\t\t\t\t\t</EMRSV4.0Request>';\r\n\t\t\t\t\t\t\r\n\t\t\treturn $xml ;\r\n\t \t\r\n\t }",
"private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}",
"public function request(){\n\t\t$request = file_get_contents('php://input');\n\t\treturn json_decode($request,true);\n\t}",
"private function Send_CE_XML_Request($request)\n\t\t{\n\t\t\t$test_url = \"https://api.stgi.net/xml.pl\";\n\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $test_url);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t\n\t\t\t// turning off the server and peer verification(TrustManager Concept).\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n\t\t\n\t\t\treturn curl_exec($ch);\n\t\t}",
"function send_xml_request($xml_request){\t\n\t\tini_set('max_execution_time', 300);\n\t\t$ch = curl_init(); //initiate the curl session\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url.$this->endpoint); //set to API endpoint\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t//curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // tell curl to return data in a variable\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: text/xml\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\"Content-length: \".strlen($xml_request),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Authorize: '.$this->authorisation_key.' username='.$this->api_username.'&password='.$this->api_password.'&apikey='.$this->api_key.'&class=Customer'\n\t\t\t\t\t\t\t\t\t\t\t));\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $xml_request); // post the xml\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, (int)120); // set timeout in seconds\n\n\t\t$xml_response = curl_exec($ch);\n\n\t\tif($xml_response === FALSE)\n\t\t\t$this->has_response=false;\n\t\telse\n\t\t\t$this->has_response=true;\n\t\t\t\n\t\tcurl_close ($ch);\n\t\t// Get Status\n\t\t//$status_code = get_status($xml_response);\n\t\treturn $xml_response;\n\t}",
"function curlRequest() \n {\n\t\t$ch=curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->URL);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 180);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->XMLRequest);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSLVERSION, 3);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\t$httpHeader = array(\"Content-Type: text/xml; charset=UTF-8\", \"Content-Encoding: UTF-8\");\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);\n\t\t// Execute request, store response and HTTP response code\n\t\t$data=curl_exec($ch);\n\t\t$this->errno = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\tcurl_close($ch);\n\t\treturn($data);\n\t}",
"function parse_response($response)\n {\n $data = $response->getBody();\n\n // Note we could not use Guzzle XML method becuase Endicia does not return valid XML it seems\n $sxe = new SimpleXMLElement($data);\n\n if ($sxe->status == 0) {\n $return_data = array();\n $return_data['Status'] = (string)$sxe->Status;\n $return_data['Base64LabelImage'] = (string)$sxe->Base64LabelImage;\n $return_data['TrackingNumber'] = (string)$sxe->TrackingNumber;\n $return_data['FinalPostage'] = (string)$sxe->FinalPostage;\n $return_data['TransactionID'] = (string)$sxe->TransactionID;\n $return_data['PostmarkDate'] = (string)$sxe->PostmarkDate;\n $return_data['DeliveryTimeDays'] = (string)$sxe->PostagePrice->DeliveryTimeDays;\n\t $return_data['error'] = (string)$data;\n \n\t\treturn $return_data;\n } else {\n return array('status' => 'error', 'message' => $sxe);\n }\n }",
"public function getRequestXML()\n\t{\n\t\treturn $this->request_xml;\n\t}",
"public function getResponse(): array;",
"public static function process_http_request()\n {\n }",
"public function getResponse() : array;",
"protected function parseResponse()\n {\n $data = simplexml_load_string($this->body);\n \n $this->data = $data;\n }",
"private function getResponse() {\n\t\t$packed_len = stream_get_contents($this->id, 4); //The first 4 bytes contain our N-packed length\n\t\t$hdr = unpack('Nlen', $packed_len);\n\t\t$len = $hdr['len'];\n\t\t$this->xmlResponse = stream_get_contents($this->id, $len);\n\t}",
"public function parse()\n\t{\n\t\t//we don't need to hit the API everytime parse is called\n\t\tif (!$this->response)\n\t\t\t$this->response = $this->request->execute();\n\t\t\n\t\treturn $this->invokeParserMethod();\t\n\t}",
"private function xml() {\n if( $this->format === 'text/hal+xml' ) {\n header('Content-Type: text/hal+xml; charset=utf-8', TRUE, $this->status);\n $hal_response = (new Resource())\n ->setURI(\"/{$this->resource}\". (isset($this->filters['id']) ? $this->filters['id'] : ''))\n ->setLink($this->resource, new Link(\"/{$this->resource}\"))\n ->setData($this->content);\n\n $writer = new Hal\\XmlWriter(true);\n \n return $writer->execute($hal_response);\n } else {\n header('Content-Type: text/xml; charset=utf-8', TRUE, $this->status);\n $xml_data = new \\SimpleXMLElement('<?xml version=\"1.0\"?><data></data>');\n static::array_to_xml($this->content,$xml_data);\n \n return $xml_data->asXML();\n }\n \n }",
"public function get_request_content();",
"function processRequests()\n\t{\n\n\t\t$requestMode = -1;\n\t\t$sFunctionName = \"\";\n\t\t$bFoundFunction = true;\n\t\t$bFunctionIsCatchAll = false;\n\t\t$sFunctionNameForSpecial = \"\";\n\t\t$aArgs = array();\n\t\t$sPreResponse = \"\";\n\t\t$bEndRequest = false;\n\t\t$sResponse = \"\";\n\n\t\t$requestMode = $this->getRequestMode();\n\t\tif ($requestMode == -1) return;\n\n\t\tif ($requestMode == XAJAX_POST)\n\t\t{\n\t\t\t$sFunctionName = $_POST[\"xajax\"];\n\n\t\t\tif (!empty($_POST[\"xajaxargs\"]))\n\t\t\t\t$aArgs = $_POST[\"xajaxargs\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader (\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\t\t\theader (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n\t\t\theader (\"Cache-Control: no-cache, must-revalidate\");\n\t\t\theader (\"Pragma: no-cache\");\n\n\t\t\t$sFunctionName = $_GET[\"xajax\"];\n\n\t\t\tif (!empty($_GET[\"xajaxargs\"]))\n\t\t\t\t$aArgs = $_GET[\"xajaxargs\"];\n\t\t}\n\n\t\t// Use xajax error handler if necessary\n\t\tif ($this->bErrorHandler) {\n\t\t\t$GLOBALS['xajaxErrorHandlerText'] = \"\";\n\t\t\tset_error_handler(\"xajaxErrorHandler\");\n\t\t}\n\n\t\tif ($this->sPreFunction) {\n\t\t\tif (!$this->_isFunctionCallable($this->sPreFunction)) {\n\t\t\t\t$bFoundFunction = false;\n\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t$objResponse->addAlert(\"Unknown Pre-Function \". $this->sPreFunction);\n\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t}\n\t\t}\n\t\t//include any external dependencies associated with this function name\n\t\tif (array_key_exists($sFunctionName,$this->aFunctionIncludeFiles))\n\t\t{\n\t\t\tob_start();\n\t\t\tinclude_once($this->aFunctionIncludeFiles[$sFunctionName]);\n\t\t\tob_end_clean();\n\t\t}\n\n\t\tif ($bFoundFunction) {\n\t\t\t$sFunctionNameForSpecial = $sFunctionName;\n\t\t\tif (!array_key_exists($sFunctionName, $this->aFunctions))\n\t\t\t{\n\t\t\t\tif ($this->sCatchAllFunction) {\n\t\t\t\t\t$sFunctionName = $this->sCatchAllFunction;\n\t\t\t\t\t$bFunctionIsCatchAll = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$bFoundFunction = false;\n\t\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t\t$objResponse->addAlert(\"Unknown Function $sFunctionName.\");\n\t\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($this->aFunctionRequestTypes[$sFunctionName] != $requestMode)\n\t\t\t{\n\t\t\t\t$bFoundFunction = false;\n\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t$objResponse->addAlert(\"Incorrect Request Type.\");\n\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t}\n\t\t}\n\n\t\tif ($bFoundFunction)\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($aArgs); $i++)\n\t\t\t{\n\t\t\t\t// If magic quotes is on, then we need to strip the slashes from the args\n\t\t\t\tif (get_magic_quotes_gpc() == 1 && is_string($aArgs[$i])) {\n\n\t\t\t\t\t$aArgs[$i] = stripslashes($aArgs[$i]);\n\t\t\t\t}\n\t\t\t\tif (stristr($aArgs[$i],\"<xjxobj>\") != false)\n\t\t\t\t{\n\t\t\t\t\t$aArgs[$i] = $this->_xmlToArray(\"xjxobj\",$aArgs[$i]);\n\t\t\t\t}\n\t\t\t\telse if (stristr($aArgs[$i],\"<xjxquery>\") != false)\n\t\t\t\t{\n\t\t\t\t\t$aArgs[$i] = $this->_xmlToArray(\"xjxquery\",$aArgs[$i]);\n\t\t\t\t}\n\t\t\t\telse if ($this->bDecodeUTF8Input)\n\t\t\t\t{\n\t\t\t\t\t$aArgs[$i] = $this->_decodeUTF8Data($aArgs[$i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this->sPreFunction) {\n\t\t\t\t$mPreResponse = $this->_callFunction($this->sPreFunction, array($sFunctionNameForSpecial, $aArgs));\n\t\t\t\tif (is_array($mPreResponse) && $mPreResponse[0] === false) {\n\t\t\t\t\t$bEndRequest = true;\n\t\t\t\t\t$sPreResponse = $mPreResponse[1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$sPreResponse = $mPreResponse;\n\t\t\t\t}\n\t\t\t\tif (is_a($sPreResponse, \"xajaxResponse\")) {\n\t\t\t\t\t$sPreResponse = $sPreResponse->getXML();\n\t\t\t\t}\n\t\t\t\tif ($bEndRequest) $sResponse = $sPreResponse;\n\t\t\t}\n\n\t\t\tif (!$bEndRequest) {\n\t\t\t\tif (!$this->_isFunctionCallable($sFunctionName)) {\n\t\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t\t$objResponse->addAlert(\"The Registered Function $sFunctionName Could Not Be Found.\");\n\t\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($bFunctionIsCatchAll) {\n\t\t\t\t\t\t$aArgs = array($sFunctionNameForSpecial, $aArgs);\n\t\t\t\t\t}\n\t\t\t\t\t$sResponse = $this->_callFunction($sFunctionName, $aArgs);\n\t\t\t\t}\n\t\t\t\tif (is_a($sResponse, \"xajaxResponse\")) {\n\t\t\t\t\t$sResponse = $sResponse->getXML();\n\t\t\t\t}\n\t\t\t\tif (!is_string($sResponse) || strpos($sResponse, \"<xjx>\") === FALSE) {\n\t\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t\t$objResponse->addAlert(\"No XML Response Was Returned By Function $sFunctionName.\");\n\t\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t\t}\n\t\t\t\telse if ($sPreResponse != \"\") {\n\t\t\t\t\t$sNewResponse = new xajaxResponse($this->sEncoding, $this->bOutputEntities);\n\t\t\t\t\t$sNewResponse->loadXML($sPreResponse);\n\t\t\t\t\t$sNewResponse->loadXML($sResponse);\n\t\t\t\t\t$sResponse = $sNewResponse->getXML();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$sContentHeader = \"Content-type: text/xml;\";\n\t\tif ($this->sEncoding && strlen(trim($this->sEncoding)) > 0)\n\t\t\t$sContentHeader .= \" charset=\".$this->sEncoding;\n\t\theader($sContentHeader);\n\t\tif ($this->bErrorHandler && !empty( $GLOBALS['xajaxErrorHandlerText'] )) {\n\t\t\t$sErrorResponse = new xajaxResponse();\n\t\t\t$sErrorResponse->addAlert(\"** PHP Error Messages: **\" . $GLOBALS['xajaxErrorHandlerText']);\n\t\t\tif ($this->sLogFile) {\n\t\t\t\t$fH = @fopen($this->sLogFile, \"a\");\n\t\t\t\tif (!$fH) {\n\t\t\t\t\t$sErrorResponse->addAlert(\"** Logging Error **\\n\\nxajax was unable to write to the error log file:\\n\" . $this->sLogFile);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfwrite($fH, \"** xajax Error Log - \" . strftime(\"%b %e %Y %I:%M:%S %p\") . \" **\" . $GLOBALS['xajaxErrorHandlerText'] . \"\\n\\n\\n\");\n\t\t\t\t\tfclose($fH);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sErrorResponse->loadXML($sResponse);\n\t\t\t$sResponse = $sErrorResponse->getXML();\n\n\t\t}\n\t\tif ($this->bCleanBuffer) while (@ob_end_clean());\n\t\tprint $sResponse;\n\t\tif ($this->bErrorHandler) restore_error_handler();\n\n\t\tif ($this->bExitAllowed)\n\t\t\texit();\n\t}",
"public function post(string $xml): array\n {\n $factory = Psr17FactoryDiscovery::findRequestFactory();\n $request = $factory->createRequest('POST', $this->uri);\n foreach ($this->headers as $name => $value) {\n $request = $request->withHeader($name, $value);\n };\n\n $body = Psr17FactoryDiscovery::findStreamFactory()->createStream($xml);\n $request = $request->withBody($body);\n\n return $this->resolveResponse($this->sendRequest($request));\n }",
"private function _parseXml()\n {\n $temp = @simplexml_load_string( $this->input, \"SimpleXMLElement\", LIBXML_NOCDATA );\n $json = @json_encode( $temp );\n $data = @json_decode( $json, true );\n\n if( is_array( $data ) )\n {\n $_REQUEST = array_merge( $_GET, $this->_data( $data ) );\n return true;\n }\n return false;\n }",
"function requestData($url) {\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$request_results = curl_exec($ch);\n\t$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\n\tif ($code == '200') {\n\t\t$results = simplexml_load_string($request_results);\n\t\tif (!$results) {\n\t\t\t$errors = libxml_get_errors();\n\t\t\t$xml = explode(\"\\n\", $request_results);\n\t\t\n\t\t\tforeach ($errors as $error) {\n\t\t\t\techo display_xml_error($error, $xml);\n\t\t\t}\n\t\t\n\t\t\tlibxml_clear_errors();\n\t\t}\n\t} else {\n\t\t$results = $request_results->error->message->value;\n\t}\t\n\t\n\tcurl_close($ch);\n\t\n\treturn $results;\n}",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"private function processRequest($request)\n {\n if (!is_array($request)) {\n return $this->requestError();\n }\n\n // The presence of the 'id' key indicates that a response is expected\n $isQuery = array_key_exists('id', $request);\n\n $id = &$request['id'];\n\n if (($id !== null) && !is_int($id) && !is_float($id) && !is_string($id)) {\n return $this->requestError();\n }\n\n $version = &$request['jsonrpc'];\n\n if ($version !== self::VERSION) {\n return $this->requestError($id);\n }\n\n $method = &$request['method'];\n\n if (!is_string($method)) {\n return $this->requestError($id);\n }\n\n // The 'params' key is optional, but must be non-null when provided\n if (array_key_exists('params', $request)) {\n $arguments = $request['params'];\n\n if (!is_array($arguments)) {\n return $this->requestError($id);\n }\n } else {\n $arguments = array();\n }\n\n if ($isQuery) {\n return $this->processQuery($id, $method, $arguments);\n }\n\n $this->processNotification($method, $arguments);\n return null;\n }",
"public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}",
"public function getResponseXML()\n\t{\n\t\treturn $this->response_xml;\n\t}",
"private function requestProcessor() {\n try {\n\n if (empty($this->uri))\n throw new \\Exception(\"Undefined url\");\n\n $ReqHandle = curl_init($this->uri);\n\n $body = json_encode([]);\n if( sizeof($this->data) > 0 )\n $body = json_encode($this->data);\n\n $returnTransfer = 0;\n if( $this->hasResponseToReturn )\n $returnTransfer = 1;\n\n $isPost = 0;\n if( $this->method != 'GET')\n $isPost = 1;\n\n\n if($isPost == 1){\n curl_setopt($ReqHandle,CURLOPT_POST, $isPost);\n curl_setopt($ReqHandle, CURLOPT_POSTFIELDS, $body);\n }\n \n curl_setopt_array($ReqHandle, [\n CURLOPT_RETURNTRANSFER => $returnTransfer,\n CURLOPT_HTTPHEADER => $this->headersToBeUsed\n ]);\n\n\n $result = curl_exec($ReqHandle);\n\n if(curl_errno($ReqHandle)){\n\n return curl_error($ReqHandle);\n }\n\n if($returnTransfer == 1)\n return json_decode($result);\n\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }",
"public function getProcessedOrder( $param = array() )\n {\n \n $Token = Configure::read('access_token');\n $soapUrl = \"http://api.linnlive.com/order.asmx?op=ProcessOrder\"; \n $xml_post_string = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Body>\n <ProcessOrder xmlns=\"http://api.linnlive.com/order\">\n <Token>'.$Token.'</Token>\n <request> \n <OrderIdIsSet>true</OrderIdIsSet>\n <OrderId>'.$param['OrderId'].'</OrderId> \n <ProcessedByName>'.$param['ProcessedByName'].'</ProcessedByName>\n <ProcessDateTimeIdIsSet>true</ProcessDateTimeIdIsSet> \n </request>\n </ProcessOrder>\n </soap:Body>\n </soap:Envelope>';\n \n $headers = array(\n \"POST /generic.asmx HTTP/1.1\",\n \"Host: api.linnlive.com\",\n \"Content-Type: text/xml; charset=utf-8\",\n \"Content-Length: \".strlen($xml_post_string)\n );\n \n $url = $soapUrl;\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $response = curl_exec($ch); \n curl_close($ch);\n \n $response = str_replace( \"</soap:Body>\" ,\"\" , str_replace( \"<soap:Body>\" , \"\" , $response ) );\n $parser = simplexml_load_string($response);\n //echo \"<pre>\";\n //print_r($parser);\n return $parser->ProcessOrderResponse->ProcessOrderResult->Error;\n //exit; \n \n }",
"public function process($request)\n {\n $openssl = new Openssl($this->iv_key, $this->secret_key);\n\n //Encrypt\n $encrypted = $openssl->encryptData($request);\n\n return array(\n 'PARAMS' => $encrypted,\n 'ACCESS_KEY' => $this->access_key,\n 'COUNTRY_CODE' => $this->country_code\n );\n }",
"public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }",
"public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending parameters must be JSON.');\n }\n $lenght = strlen($jsondata);\n if($lenght<=0){\n $this->log(\"Length must be more than zero.\",'Exiting process.');\n $this->error_message(\"Length must be more than zero.\");\n }else{\n $lenght = $lenght <= 999 ? \"0\" . $lenght : $lenght;\n }\n\n $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));\n\n $this->response_json = str_replace(substr($this->response_json, 0, 4), \"\", $this->response_json);\n if ($this->response_json) {\n $object = json_decode($this->response_json);\n if ($object->status == 'error') {\n $this->error_message($object->data->error . ' : ' . $object->data->error_description);\n } elseif ($object->status == 'ok') {\n $this->response_object = json_decode($this->response_json);\n }\n } else {\n $this->log(\"Response is empty...\",'Exiting process.');\n $this->error_message('Response is empty...');\n }\n }",
"function process_request() {\n\t\tglobal $publishthis;\n\n\t\ttry{\n\n\t\t\t$bodyContent = '';\n\n\t\t\tif ( function_exists( 'wpcom_vip_file_get_contents' ) ) {\n\t\t\t\t$bodyContent = wpcom_vip_file_get_contents( 'php://input', 10, 60 );\n\t\t\t} else {\n\t\t\t\t$bodyContent = file_get_contents( 'php://input' );\n\t\t\t}\n\n\t\t\t$publishthis->log->addWithLevel( array( 'message' => 'Endpoint Request', 'status' => 'info', 'details' => $bodyContent ), \"2\" );\n\n\t\t\t$arrEndPoint = json_decode( $bodyContent, true );\n\n\t\t\t$action = $arrEndPoint[\"action\"];\n\n\t\t\t$pt_settings = $publishthis->get_options();\n\n\t\t\tif( !in_array( $action, array('resetState', 'stopEndpoint', 'resumeEndpoint') ) ) {\n\t\t\t\t$manually_stopped = get_option( 'pt_import_manually_stopped' );\n\t\t\t\tif ( $manually_stopped == 1 ) {\n\t\t\t\t\t$this->sendFailure('Import manually stopped');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch( $action ) {\n\t\t\t\tcase \"verify\":\n\t\t\t\t\t$this->actionVerify();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"publish\":\n\t\t\t\t\tif( $publishthis->get_option( 'curated_publish' ) != 'import_from_manager' ) {\n\t\t\t\t\t\t$this->sendFailure( \"Publishing through CMS is disabled\" );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$feedId = intval( $arrEndPoint[\"feedId\"], 10 );\n\t\t\t\t\t$pageNum = intval( $arrEndPoint[\"pageNum\"], 10 );\n\t\t\t\t\t$importId = $arrEndPoint[\"importId\"];\n\n\t\t\t\t\t$this->actionPublish2( $feedId, $pageNum, $importId );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getAuthors\":\n\t\t\t\t\t$this->actionGetAuthors();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getCategories\":\n\t\t\t\t\t$this->actionGetCategories();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resetState\":\n\t\t\t\t\t$this->resetState();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"stopEndpoint\":\n\t\t\t\t\t$this->stopEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resumeEndpoint\":\n\t\t\t\t\t$this->resumeEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->sendFailure( \"Empty or bad request made to endpoint\" );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch( Exception $ex ) {\n\t\t\t//we will log this to the pt logger, but we always need to send back a failure if this occurs\n\n\t\t\t$this->sendFailure( $ex->getMessage() );\n\t\t}\n\n\t\treturn;\n\t}",
"public function processRequest() {\n $serviceType = $this->getServiceType();\n if(!$serviceType){return \"Invalid Call ! \\n\";}\n $repoPath = $this->getRepoName();\n if(!defined(\"__APIURL__\" . $serviceType)){\n return \"API URL not found for $serviceType\\n\";\n }\n $apiUrl = sprintf(constant(\"__APIURL__\" . $serviceType), $repoPath);\n $response = $this->makeCurlRequest($apiUrl, 'get');\n switch ($serviceType) {\n case 'github.com':\n return $this->getCountForGit($response);\n break;\n case 'bitbucket.org':\n return $this->getCountForBit($response);\n break;\n default :\n return $response;\n break;\n }\n }",
"private function createRequest()\n {\n $xml = new DOMDocument();\n $xml->formatOutput = true;\n\n $trackRequest = $xml->appendChild($xml->createElement(\"TrackRequest\"));\n $trackRequest->setAttribute('xml:lang', 'en-US');\n\n $request = $trackRequest->appendChild($xml->createElement(\"Request\"));\n\n $node = $xml->importNode($this->createTransactionNode(), true);\n $request->appendChild($node);\n\n $request->appendChild($xml->createElement(\"RequestAction\", \"Track\"));\n\n if (null !== $this->requestOption) {\n $request->appendChild($xml->createElement(\"RequestOption\", $this->requestOption));\n }\n\n if (null !== $this->trackingNumber) {\n $trackRequest->appendChild($xml->createElement(\"TrackingNumber\", $this->trackingNumber));\n }\n\n return $xml->saveXML();\n }",
"public function getRequestXML()\n\t{\n\t\treturn $this->requestXML;\n\t}",
"function _getXMLResponse($sResponse) {\n if (extension_loaded('simplexml')) { // If simplexml is available, we can do more stuff!\n $oDOM = new DOMDocument;\n $oDOM->loadXML($sResponse);\n $sXML = simplexml_import_dom($oDOM);\n $sXMLLayout = 'http://www.shrinktheweb.com/doc/stwresponse.xsd';\n\n // Pull response codes from XML feed\n $aThumbnail = (array)$sXML->children($sXMLLayout)->Response->ThumbnailResult->Thumbnail;\n $aResponse['thumbnail'] = $aThumbnail[0];\n $aResponse['stw_action'] = $aThumbnail[1];\n $aResponse['stw_response_status'] = $sXML->children($sXMLLayout)->Response->ResponseStatus->StatusCode; // HTTP Response Code\n $aResponse['stw_response_code'] = $sXML->children($sXMLLayout)->Response->ResponseCode->StatusCode; // STW Error Response\n $aResponse['stw_last_captured'] = $sXML->children($sXMLLayout)->Response->ResponseTimestamp->StatusCode; // Last Captured\n $aResponse['stw_quota_remaining'] = $sXML->children($sXMLLayout)->Response->Quota_Remaining->StatusCode; // New Reqs left for today\n $aResponse['stw_bandwidth_remaining'] = $sXML->children($sXMLLayout)->Response->Bandwidth_Remaining->StatusCode; // New Reqs left for today\n $aResponse['stw_category_code'] = $sXML->children($sXMLLayout)->Response->CategoryCode->StatusCode; // Not yet implemented\n } else {\n\t // LEGACY SUPPPORT\n $aResponse['stw_response_status'] = _getLegacyResponse('ResponseStatus', $sRemoteData);\n $aResponse['stw_response_code'] = _getLegacyResponse('ResponseCode', $sRemoteData);\n\n // check remaining quota\n $aResponse['stw_quota_remaining'] = _getLegacyResponse('Quota_Remaining', $sRemoteData);\n // check remaining bandwidth\n $aResponse['stw_bandwidth_remaining'] = _getLegacyResponse('Bandwidth_Remaining', $sRemoteData);\n\n // get thumbnail and status\n $aThumbnail = $this->_getThumbnailStatus($sRemoteData);\n $aResponse = array_merge($aResponse, $aThumbnail);\n }\n \n if ($aResponse['stw_action'] == 'delivered') {\n $aResponse['exists'] = true;\n } else {\n $aResponse['exists'] = false;\n }\n\n if ($aResponse['stw_action'] == 'fix_and_retry') {\n $aResponse['problem'] = true;\n } else {\n $aResponse['problem'] = false;\n }\n\n if ($aResponse['stw_action'] == 'noretry') {\n $aResponse['error'] = true;\n } else {\n $aResponse['error'] = false;\n }\n\n // if we use the advanced api for free account we get an invalid request\n if ($aResponse['stw_response_code'] == 'INVALID_REQUEST') {\n $aResponse['invalid'] = true;\n } else {\n $aResponse['invalid'] = false;\n }\n\t\t\n\t\t// if our domain or IP is not listed in the account's \"Allowed Referrers\" AND \"Lock to Account\" is enabled, then we get this error\n if ($aResponse['stw_response_code'] == 'LOCK_TO_ACCOUNT') {\n $aResponse['locked'] = true;\n } else {\n $aResponse['locked'] = false;\n }\n\n return $aResponse;\n }",
"public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }",
"function process(){\n\t\t\treturn $this->xml->dumpmem();\n\t\t}",
"abstract function parse_api_response();",
"private function soap_request($request)\n\t{\n\t\tksort($request);\n\t\tforeach($request as $k => $v) // For each root key of the array structure,\n\t\t{\n\t\t\tif(is_array($v)) // if the value is an array,\n\t\t\t{\n\t\t\t\t$r[$k] = $this->soap_request($v); // We recurse into that array;\n\t\t\t} \n\t\t\telseif(!is_bool($v)) // however, if it is a bool value, we leave it out.\n\t\t\t{\n\t\t\t\t$r[$k] = $v; // Otherwise, we keep it around.\n\t\t\t} \t\n\t\t}\n\t\treturn $r; // Then return it.\n\t}",
"public function getXml()\n {\n if (is_null($this->quote)) {\n throw new \\LogicException('Quote object not set.');\n }\n\n if (is_null($this->preparedXml)) {\n $paymentArray = $this->config->getPaymentArray();\n $address = $this->quote->getBillingAddress();\n\n $taType = '27920';\n $processingCode = ($this->config->isLiveMode()) ? '1' : '8';\n\n $xml = simplexml_load_string(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<REQUEST></REQUEST>\");\n $customerobj = $xml->addChild('CUSTOMER');\n $customerobj->addChild('AUTH_ID', $this->config->getApiAuthId());\n $customerobj->addChild('AUTH_PW', $this->config->getApiAuthPassword());\n $customerobj->addChild('CUSTOMER_TA_ID', md5(time()));\n $processobj = $xml->addChild('PROCESS');\n $processobj->addChild('TA_TYPE', $taType);\n $processobj->addChild('PROCESSING_CODE', $processingCode);\n $processobj->addChild('REQUESTREASON', 'ABK');\n $queryobj = $xml->addChild('QUERY');\n $queryobj->addChild('FIRST_NAME', $this->escaper->escapeHtml(substr($address->getFirstname(), 0, 64)));\n $queryobj->addChild('LAST_NAME', $this->escaper->escapeHtml(substr($address->getLastname(), 0, 64)));\n $customerDob = '';\n if ($dob = $this->quote->getCustomerDob()) {\n $customerDob = date('Y-m-d', strtotime($dob));\n }\n $queryobj->addChild('DOB', $customerDob);\n $queryobj->addChild('ADDR_STREET_FULL', $this->escaper->escapeHtml(substr($address->getStreetFull(), 0, 50)));\n $queryobj->addChild('ADDR_ZIP', substr($address->getPostcode(), 0, 5));\n $queryobj->addChild('ADDR_CITY', $this->escaper->escapeHtml(substr($address->getCity(), 0, 32)));\n $queryobj->addChild('ADDR_COUNTRY', $address->getCountryId());\n $queryobj->addChild('CUSTOMERIP', ($this->quote->getRemoteIp() ? $this->quote->getRemoteIp() : '127.0.0.1'));\n $queryobj->addChild('CUSTOMEREMAIL', $this->escaper->escapeHtml(substr($address->getEmail(), 0, 128)));\n $queryobj->addChild('CUSTOMERTEL', $this->escaper->escapeHtml(substr($address->getTelephone(), 0, 64)));\n $queryobj->addChild('COMPANY_NAME', $this->escaper->escapeHtml(substr($address->getCompany(), 0, 64)));\n $queryobj->addChild('AMOUNT', round($this->quote->getGrandTotal() * 100));\n\n // add purchase type with appended group type\n $purchaseType = isset($paymentArray[$this->paymentMethod]) ? $paymentArray[$this->paymentMethod] : '';\n $purchaseType .= ($this->quote->getCheckoutMethod() != Quote::CHECKOUT_METHOD_LOGIN_IN) ? '1' : '2';\n $queryobj->addChild('PURCHASE_TYPE', $purchaseType);\n\n $this->preparedXml = $xml;\n }\n\n return $this->preparedXml;\n }",
"function parse() {\r\n\t\t/* JSON */\r\n\t\tif (strpos ( $this->response_content_type, \"application/json\" ) !== false) {\r\n\t\t\t$this->response_parsed = json_decode($this->response_body);\r\n\t\t\t/* JSON STREAM */\r\n\t\t} elseif (strpos ( $this->response_content_type, \"json-stream\" ) !== false) {\r\n\t\t\t$stream = split ( \"\\n\", $this->response_body );\r\n\t\t\tif (count ( $stream ) < $stream [0] ['ResultLength']) {\r\n\t\t\t\t// echo \"Invalid JSON Stream. Result Length:\".count($stream);\r\n\t\t\t\t$this->client->status_code = 400;\r\n\t\t\t\t$GLOBALS ['ResultStack']->pushNew ( \"Invalid JSON Stream\", ERROR );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$jsonServer = new JSON ( JSON_LOOSE_TYPE );\r\n\t\t\t$this->response_parsed = array ();\r\n\t\t\tforeach ( $stream as $line )\r\n\t\t\t\t$this->response_parsed [] = $jsonServer->decode ( $line );\r\n\t\t\t/* DEFAULT */\r\n\t\t} else {\r\n\t\t\t$this->response_parsed = $this->response_body;\r\n\t\t}\r\n\t}",
"public function getResponse() {}",
"public function getResponse() {}",
"protected function parseRequest()\n {\n $this->input = $this->request->getPostList()->toArray();\n }",
"function send_request($request)\n {\n $response = $request->send();\n return $this->parse_response($response);\n }",
"abstract public function request();",
"private function parseRequest(){\n\t\t\n\t\tif($this->swapperRequest){\n\t\t\tif($this->blockName != $this->oldBlockName){\n\t\t\t\theader('Content-Type: application/json');\n\t\t\t\t$link = explode('?',$_SERVER['REQUEST_URI']);\n\t\t\t\t$output = array('swapper_newpage' => true, 'swapper_newpage_link' => 'http://'.$_SERVER['HTTP_HOST'].$link[0]);\n\t\t\t\techo json_encode($output);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\t$this->oldRequest = array();\n\t\t\tif(Session::exists('swapper.oldRequest')){\n\t\t\t\t$this->oldRequest = Session::get('swapper.oldRequest');\n\t\t\t}\n\n\t\t\t$this->responseBlocks = array();\n\t\t\t/*echo \"old:\";\n\t\t\tprint_r($this->oldRequest);*/\n\t\t\tforeach($this->blocks as $block => $vars){\n\t\t\t\t\t#echo $block;\n\t\t\t\t\tif(!isset($this->oldRequest[$block])){\n\n\t\t\t\t\t\t$this->responseBlocks[$block] = $vars;\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$diff = $this->arrayRecursiveDiff($vars,$this->oldRequest[$block]);\n\t\t\t\t\t\t$this->diff = $diff;\n\t\t\t\t\t\tif(!empty($diff)){\n\t\t\t\t\t\t\t$this->responseBlocks[$block] = $vars;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t/*echo \"New response:\";\n\t\t\tprint_r($this->responseBlocks);\n\t\t\tdie();*/\n\t\t\treturn;\n\t\t}\n\n\t\t$this->responseBlocks = $this->blocks;\n\t}",
"public function getResponseData();",
"function process() {\n\t\t\t$response = $this->response();\n\t\t\t$this->setSuccess($response);\n\t\t\treturn $this->responseVar;\n\t\t}",
"public function doRequest() {\n $this->request = $this->prepareRequest();\n \n $url = $this->conf->getEndPoint($this->orderType);\n $request = new WebServiceSoap\\SveaDoRequest($url);\n\n $svea_req = $request->GetAddresses($this->request);\n\n $response = new \\SveaResponse($svea_req,\"\");\n return $response->response;\n }",
"public function parse(){\n\t\t$this->_data = array();\n\t\n\t\ttry{\n\t\t\tparent::parse();\n\t\t\t\n\t\t\tif(!empty($this->_response)){\n\t\t\t\tif($this->_request['method'] == 'GetEvents'){\n\t\t\t\t\tif(is_array($this->_response->GetEventsResult->Event)){\n\t\t\t\t\t\tforeach($this->_response->GetEventsResult->Event as $event){\n\t\t\t\t\t\t\t$this->_data[] = $event;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(is_object($this->_response->GetEventsResult->Event)){\n\t\t\t\t\t\t$this->_data = $this->_response->GetEventsResult->Event;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->_data = null;\n\t\t\t\t\t}\n\t\t\t\t}else if($this->_request['method'] == 'SearchEvents'){\n\t\t\t\t\tif(is_array($this->_response->SearchEventsResult->Event)){\n\t\t\t\t\t\tforeach($this->_response->SearchEventsResult->Event as $event){\n\t\t\t\t\t\t\t$this->_data[] = $event;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(is_object($this->_response->SearchEventsResult->Event)){\n\t\t\t\t\t\t$this->_data = $this->_response->SearchEventsResult->Event;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->_data = null;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(!empty($this->_response->GetCountryByIDResult)){\n\t\t\t\t\t\t$this->_data = $this->_response->GetCountryByIDResult;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->_data = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t}catch(TNException $e){\n\t\t\t$err = $this->debug($e->getMessage());\n\t\t\techo $err;\n\t\t}\n\t\n\t\treturn $this;\n\t}",
"public function executeResponse(sfWebRequest $request)\n {\n return require(dirname(__FILE__).'/response.php');\n }",
"public function __doRequest($request, $location, $action, $version, $one_way = 0)\n\t{\n\t\t$response = parent::__doRequest($request, $location, $action, $version, $one_way);\n\t\t$this->rawResponse = $response;\n\t\t//if resposnse content type is mtom strip away everything but the xml.\n\t\tif (strpos($response, \"Content-Type: application/xop+xml\") !== false) {\n\t\t\t//not using stristr function twice because not supported in php 5.2 as shown below\n\t\t\t//$response = stristr(stristr($response, \"<s:\"), \"</s:Envelope>\", true) . \"</s:Envelope>\";\n\t\t\t$tempstr = stristr($response, \"<s:\");\n\t\t\t$response = substr($tempstr, 0, strpos($tempstr, \"</s:Envelope>\")) . \"</s:Envelope>\";\n\t\t}\n\t\t//log_message($response);\n\t\treturn $response;\n\t}",
"public static function requestPayload() {\n return json_decode(file_get_contents('php://input'), true);\n }",
"abstract public function processResponse($response);",
"abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);",
"public function getResponseXML()\n\t{\n\t\treturn $this->responseXML;\n\t}",
"public function fetchOutput_Raw() {\n list($headers, $body) = $this->getInputModule()->fetchOutput_Raw();\n\n $url = $this->getParameter('url');\n\n // Set up the request for HTTP POST, including the body.\n $req =& new HTTP_Request($url);\n $req->setMethod('POST');\n $req->setBody($body);\n\n // Send whitelisted headers with request.\n $headers_in_whitelist = array_merge(\n array( 'content-type' ),\n $this->getParameter('headers_in_whitelist', array())\n );\n foreach ($headers as $name => $value) {\n if (in_array(strtolower($name), $headers_in_whitelist))\n $req->addHeader($name, $value);\n }\n\n // Fire off the request, get the headers and body.\n $rv = $req->sendRequest();\n $headers = $req->getResponseHeader();\n $body = $req->getResponseBody();\n\n // Pass along only whitelisted headers.\n $headers_out = array();\n $headers_out_whitelist = array_merge(\n array( 'content-type' ),\n $this->getParameter('headers_out_whitelist', array())\n );\n foreach ($headers as $name => $value) {\n if (in_array(strtolower($name), $headers_out_whitelist))\n $headers_out[$name] = $value;\n }\n\n return array($headers_out, $body);\n }",
"function XMLBodyRequest(){\n\t\t$request = \"<?xml version='1.0' encoding='UTF-8'?>\\n\";\n\t\t$request .= \"<SyncFoliosRequest user='desarrollo' password='M1Gd3s4rr0y02015'>\";\n\t\t\t$request .= \"<RFC>TTV0812107N4</RFC>\";\n\t\t\t$request .= \"<FoliosUsed>666</FoliosUsed>\";\n\t\t$request .= \"</SyncFoliosRequest>\";\n\t\t\n\t\t/**For debugging purposes*/\n\t\t//header (\"Content-Type:text/xml\");echo \"$request\";die;\n\t\treturn $request;\n\t}",
"function data() {\n $result = $this->fetcher->get($this->url);\n\n if ($result->getStatusCode() == 200) {\n $xml = new SimpleXMLElement($result->getBody());\n\n // WorkflowMax API's standard for error reporting\n if((string)$xml->Status !== 'OK') {\n throw new \\LogicException((string)$xml->ErrorDescription);\n }\n\n $array = json_decode(json_encode($xml), true);\n\n if($this->dataProcessor) {\n $dp = $this->dataProcessor;\n $array = $dp($array);\n }\n\n return $array;\n }\n\n throw new \\LogicException('URL returned status code ' . $result->getStatusCode());\n }",
"private function getResponseXML()\n\t\t{\n\n\n\t\t\t\tif($this->action_code==\"RateShop\" || $this->action_code==\"SingleCarRateShop\"){ //rateshop\n\t\t\t\t\t$wsdl = ($this->car_company==\"dollar\")?DOLLAR_RATESHOP_WS_URL:THRIFTY_RATESHOP_WS_URL;\n\t\t\t\t\t$soapAction = \"http://www.opentravel.org/OTA/2003/05/OTA2010A.RateService/GetRates\";\n\t\t\t\t\t$methodname = \"GetRates\";\n\n\t\t\t\t}else{ //booking\n\t\t\t\t\t$wsdl = ($this->car_company==\"dollar\")?DOLLAR_BOOKING_WS_URL:THRIFTY_BOOKING_WS_URL;;\n\t\t\t\t\tif($this->action_code==\"Booking\"){\n\t\t\t\t\t\t$methodname = \"MakeReservation\";\n\t\t\t\t\t\t$soapAction = \"http://www.opentravel.org/OTA/2003/05/OTA2010A.ReservationService/MakeReservation\";\n\t\t\t\t\t}else if($this->action_code==\"RetrieveReservation\"){\n\t\t\t\t\t\t$soapAction =\"http://DTG.TourDirect/IReservationService/RetrieveReservation\";\n\t\t\t\t\t\t$methodname=\"RetrieveReservation\";\n\n\t\t\t\t\t}else if($this->action_code==\"ModifyReservation\"){\n\t\t\t\t\t\t$soapAction =\"http://www.opentravel.org/OTA/2003/05/OTA2010A.ReservationService/ModifyReservation\";\n\t\t\t\t\t\t$methodname=\"ModifyReservation\";\n\t\t\t\t\t}else if($this->action_code==\"CANCEL\"){\n\t\t\t\t\t\t$soapAction =\"http://www.opentravel.org/OTA/2003/05/OTA2010A.ReservationService/CancelReservation\";\n\t\t\t\t\t\t$methodname=\"CancelReservation\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfile_put_contents(dirname(__FILE__). DIRECTORY_SEPARATOR . 'LogTF'.date('Ymd').'.txt',$wsdl,FILE_APPEND);\n\t\t\t\t$client = new nusoap_client($wsdl,'wsdl');\n\t\t\t\t$client->soap_defencoding = 'utf-8';\n\t\t\t\t$client->operation = $methodname;\n\t\t\t\t$r=$client->send($this->xml, $soapAction, '');\n\t\t\t\t$response_xml = $client->responseData;\n\t\t\t\tfile_put_contents(dirname(__FILE__). DIRECTORY_SEPARATOR . 'LogTF'.date('Ymd').'.txt',$response_xml,FILE_APPEND);\n//\t\t\tprint_r($wsdl);\n\t\t\t//print_r($response_xml);\n\t\t\t//print_r($this->car_company);\n\t\t\t//print_r($this->xml);\n\t\t\t//exit;\n\n\t\t\t\tif($this->action_code==\"RateShop\" || $this->action_code==\"SingleCarRateShop\"){\n\t\t\t\t\t$xml = simplexml_load_string($response_xml);\n\t\t\t\t\t$name_spaces = $xml->getNamespaces(true);\n\t\t\t\t\t$result=$xml->children($name_spaces['s'])->Body->children()->GetRatesResponse->asXML();\n\t\t\t\t\t$result = $this->parseResponseXML($result);\n\t\t\t\t}else{\n\t\t\t\t\tif($this->action_code==\"Booking\"){\n\t\t\t\t\t\t$xml = simplexml_load_string($response_xml);\n\t\t\t\t\t\t$name_spaces = $xml->getNamespaces(true);\n\t\t\t\t\t\t$result=$xml->children($name_spaces['s'])->Body->children()->MakeReservationResponse->asXML();\n\t\t\t\t\t\t$result = $this->parseResponseXML($result);\n\t\t\t\t\t}else if($this->action_code==\"RetrieveReservation\"){\n\t\t\t\t\t\t$result = $this->parseResponseXML($r[\"RetrieveReservationResult\"]);\n\t\t\t\t\t}else if($this->action_code==\"ModifyReservation\"){\n\t\t\t\t\t\t$xml = simplexml_load_string($response_xml);\n\t\t\t\t\t\t$result =$xml->Body->ModifyReservationResponse->asXML();\n\t\t\t\t\t\t$result = $this->parseResponseXML($result);\n\t\t\t\t\t}else if($this->action_code==\"CANCEL\"){\n\t\t\t\t\t\t$xml = simplexml_load_string($response_xml);\n\t\t\t\t\t\t$name_spaces = $xml->getNamespaces(true);\n\t\t\t\t\t\t$result=$xml->children($name_spaces['s'])->Body->children()->CancelReservationResponse->asXML();\n\t\t\t\t\t\t$result = $this->parseResponseXML($result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tunset($client);\n\t\t\t$this->response = $result;\n\t\t\treturn $result;\n\t\t}",
"protected function _parseClientRequestStream() {\n\t $this->clientoutput->response = array();\n\t\t$this->_parsing->offset = 0;\n\t\t\n $body = '';\n $length = 0;\t\t\n\t\t\n\t $fp = fopen(\"php://input\",\"r\"); //rb?\n\n\t //while(!feof($fp)) {\n\t\tdo {\n\t\t\n // NOTE: for chunked encoding to work properly make sure\n // there is NOTHING (besides newlines) before the first hexlength\n\n // get the line which has the length of this chunk (use fgets here)\n $line = fgets($fp, BUFFER_LENGTH);\n\n // if it's only a newline this normally means it's read\n // the total amount of data requested minus the newline\n // continue to next loop to make sure we're done\n if ($line == CRLF) {\n continue;\n }\n\n // the length of the block is sent in hex decode it then loop through\n // that much data get the length\n // NOTE: hexdec() ignores all non hexadecimal chars it finds\n $length = hexdec($line);\n\n if (!is_int($length)) {\n //trigger_error('Most likely not chunked encoding', E_USER_ERROR);\n\t\t\t $this->clientoutput->body .= $line;\n\t\t\t continue;\n }\n\n // zero is sent when at the end of the chunks\n // or the end of the stream or error\n if ($line === false || $length < 1 || feof($fp)) {\n // break out of the streams loop\n break;\n }\t\n\n // loop though the chunk\n do\n {\n // read $length amount of data\n // (use fread here)\n $data = fread($fp, $length);\n\n // remove the amount received from the total length on the next loop\n // it'll attempt to read that much less data\n $length -= strlen($data);\n\n // PRINT out directly\n #print $data;\n #flush();\n // you could also save it directly to a file here\n\n // store in string for later use\n $this->clientoutput->body .= $data;\n\n // zero or less or end of connection break\n if ($length <= 0 || feof($fp)) {\n // break out of the chunk loop\n break;\n }\n }\n while (true);\n // end of chunk loop\n }\n while (true);\n // end of stream loop\n\t\t\n\t //} \n fclose($fp);\t\t\n\t}",
"public function readHttpRequest(){\n\t\t\t$incomingFormData = file_get_contents('php://input');\n\t\t\t\n\t\t\treturn $incomingFormData;\n\t\t\t}",
"protected function init()\n {\n if ($this->request->getResponseFormat() == 'xml') {\n $aggregated = new \\SimpleXMLElement('<response/>');\n foreach ($this->responseRaw as $name => $response) {\n $child = $aggregated->addChild('classification');\n $child->addAttribute('classifier', $name);\n $xml = simplexml_load_string($response);\n\n if (! $xml instanceof \\SimpleXMLElement) {\n throw new ServiceReaderException('Failed parsing XML response.');\n }\n\n if ((string) $xml->status->attributes()->success !== 'true') {\n throw new ServiceReaderException($xml->status->attributes()->statusCode);\n }\n\n foreach ($xml->readCalls->classify as $classify) {\n $child->addAttribute('textCoverage', $classify->classification->attributes()->textCoverage);\n foreach ($classify->classification->class as $class) {\n $this->simplexmlImportXml($child, $class->asXML());\n }\n }\n }\n\n return $aggregated->asXML();\n }\n\n if ($this->request->getResponseFormat() == 'json') {\n $aggregated = array();\n foreach ($this->responseRaw as $name => $response) {\n $current = json_decode($response, 1);\n\n if (! array_key_exists('success', $current)) {\n throw new ServiceReaderException('Unable to complete request');\n }\n\n if ($current['success'] !== true) {\n throw new ServiceReaderException($current['statusCode'] . ' ' . $current['errorMessage']);\n }\n\n array_key_exists('textCoverage', $current) ? '' : $current['textCoverage'] = null;\n array_key_exists('cls1', $current) ? '' : $current['cls1'] = null;\n\n $aggregated[] = array(\n 'classifier' => $name,\n 'textCoverage' => $current['textCoverage'],\n 'classes' => $current['cls1']\n );\n }\n\n return json_encode($aggregated);\n }\n\n return $this->responseRaw;\n }",
"function GetPollRequestXML() {\n\t\trequire_once('xml-processing/gc_xmlbuilder.php');\n\t\t$xml_data = new gc_XmlBuilder();\n\t\t\n\t\t$xml_data->Push('notification-data-request',\n \t\tarray('xmlns' => $this->schema_url));\n \t\t$xml_data->Element('continue-token', $this->continue_token);\n \t$xml_data->Pop('notification-data-request');\n\n \treturn $xml_data->GetXML();\n\t}",
"public function processcontact()\n\t{\n\t\t$input = Request::all();\n\n\t\treturn $input;\n\t}",
"public function getRequestData();",
"public function processRequest() : \\Core\\Responses\\CLIResponse {\n return Response::create('CLIResponse');\n }",
"public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}",
"abstract protected function process(Request $request);",
"public function & GetRequest ();",
"public function getXMLResponse() {\n return \\Lib\\Format::forge($this->_response)->to_xml();\n }",
"public function getResponse() {\n\t}",
"public function xml()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header xml data\n header('Content-Type: text/xml');\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n // set varibales data\n $results = Utility::array2XML($this->vars);\n // send\n echo $results;\n }\n }",
"public function processRequest(): ResponseInterface\n {\n $routes = $this->bs->routes();\n $request = new Request($this->bs->globals());\n $routingEngine = new RoutingEngine($routes);\n $result = $routingEngine->resolve(\n $request->method(),\n $request->uri()\n );\n if($result === null) {\n return new TextResponse(\"404 page not found\");\n }\n $requestHandler = new RequestHandler(\n $this,\n $request,\n $this->bs->middlewares(),\n $result\n );\n $response = $requestHandler->handleRequest();\n return $response;\n }",
"public function getResponse(string &$packageRoot, Request &$request): Response;",
"private function parse()\n {\n if ($this->isError()) {\n // error parsing\n if (empty($this->body) || !isset($this->body['errors'])) {\n // response body isn't an error object, return a custom one\n $error = new Entity\\Error();\n $error->message = \"Error $this->http_status\";\n $error->name = \"INVALID REQUEST\";\n $error->at = \"\";\n $this->objects[] = $error;\n } else {\n // parse error\n $errors = $this->body['errors'];\n foreach ($errors as $error) {\n $this->objects[] = Entity\\Error::parse($error);\n }\n }\n } else if (isset($this->body['card'])) {\n // card parsing\n $cards = $this->body['card'];\n foreach ($cards as $card) {\n $this->objects[] = Entity\\Card::parse($card);\n }\n } else if (isset($this->body['paymentmethod'])) {\n // payment parsing\n $this->objects[] = Entity\\Payment::parse($this->body);\n if (isset($this->body['subscription_plan'])) {\n // subscription also found, payment is a subscription\n $this->objects[] = Entity\\Subscription::parse($this->body['subscription_plan']);\n }\n } else if (isset($this->body['vendor'])) {\n // vendor parsing\n $this->objects[] = Entity\\Vendor::parse($this->body['vendor']);\n } else if (isset($this->body['item'])) {\n // item parsing\n $this->objects[] = Entity\\Item::parse($this->body['item']);\n } else if (isset($this->body['refunded'])) {\n // refund parsing, same as payment\n $this->objects[] = Entity\\Payment::parse($this->body);\n } else if (isset($this->body['subscription_plan'])) {\n // subscription parsing\n $this->objects[] = Entity\\Subscription::parse($this->body['subscription_plan']);\n } else if (isset($this->body['deleted'])) {\n // nothing to return\n } else {\n throw new \\RuntimeException('Could not recognize response type');\n }\n }"
]
| [
"0.6506312",
"0.63636845",
"0.6344446",
"0.6285832",
"0.6262795",
"0.6245345",
"0.6233025",
"0.6182918",
"0.61504614",
"0.6143785",
"0.61279774",
"0.6127595",
"0.61215043",
"0.6065762",
"0.60455555",
"0.59596926",
"0.59568626",
"0.5913014",
"0.5880179",
"0.5828049",
"0.5740899",
"0.57399035",
"0.5733475",
"0.57299626",
"0.5728882",
"0.57054764",
"0.5689094",
"0.5667656",
"0.5660795",
"0.56434894",
"0.5636775",
"0.56323606",
"0.5630201",
"0.5621297",
"0.56137246",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5590645",
"0.5588863",
"0.5579482",
"0.5569172",
"0.5564032",
"0.5561475",
"0.5558095",
"0.55476695",
"0.5526859",
"0.55173016",
"0.5510203",
"0.5499366",
"0.5474021",
"0.54444695",
"0.5434821",
"0.5415994",
"0.5408114",
"0.5407343",
"0.54073304",
"0.5404756",
"0.5397517",
"0.5397517",
"0.5396159",
"0.53927314",
"0.538324",
"0.53714067",
"0.53709275",
"0.53572863",
"0.53560346",
"0.53523415",
"0.5345496",
"0.5344719",
"0.5342135",
"0.5341629",
"0.53351635",
"0.5332223",
"0.5330528",
"0.5318242",
"0.53072894",
"0.52956176",
"0.5293867",
"0.5293085",
"0.52818847",
"0.5275242",
"0.5274259",
"0.52677345",
"0.5267397",
"0.5264534",
"0.525822",
"0.52541465",
"0.52510464",
"0.52476573",
"0.52438784",
"0.524243",
"0.5229758",
"0.5228246"
]
| 0.0 | -1 |
Convert XML to PHP Array | private function toArray($xml) {
if (is_string($xml)) $xml = new SimpleXMLElement($xml);
$children = $xml->children();
if ( !$children ) return (string) $xml;
$arr = array();
foreach ($children as $key => $node) {
$node = $this->toArray($node);
// support for 'anon' non-associative arrays
if ($key == 'anon') {
$key = count($arr);
}
// if the node is already set, put it into an array
if (isset($arr[$key])) {
if (!is_array($arr[$key]) || !isset($arr[$key][0]) || $arr[$key][0] == null) {
$arr[$key] = array($arr[$key]);
}
$arr[$key][] = $node;
} else {
$arr[$key] = $node;
}
}
return $arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function xml_to_array()\r\n {\r\n $output=array();\r\n \r\n foreach($this->xpath_map as $key=>$value)\r\n {\r\n $output[$key]=$value['data'];\r\n }\r\n \r\n return $output;\r\n }",
"private function xml_to_array($xml) {\n\t\t$doc = new \\DOMDocument();\n\t\t$doc->loadXML($xml);\n\t\t$root = $doc->documentElement;\n\t\t$output = $this->domnode_to_array($root);\n\t\t$output['@root'] = $root->tagName;\n\t\treturn $output;\n\t}",
"private function xml2array($xml) \n\t{ \n\t\t$json = json_encode( simplexml_load_string($xml));\n\t\treturn json_decode($json, TRUE);\n\t}",
"function xml_to_array($xml)\n {\n $xml = simplexml_load_string($xml, \"SimpleXMLElement\", LIBXML_NOCDATA);\n $root = $xml->getName();\n $data[\"$root\"] = json_decode(json_encode($xml), TRUE);\n\n return $data;\n }",
"private function xml2array($xml) {\n $dom = new DOMDocument('1.0', 'UTF-8');\n $dom->loadXML($xml);\n $root = $dom->documentElement;\n\n $out = array();\n\n AppKitArrayUtil::xml2Array($root->childNodes, $out);\n\n return $out;\n }",
"public function toArray()\r\n {\r\n $xml = $this->getXml();\r\n\r\n return json_decode(json_encode((array) $xml), true);\r\n }",
"static function xmlToArray($xml)\n {\n $domXml = new DOMDocument();\n if (!$domXml->loadxml($xml))\n {\n throw new Exception('Invalid XML');\n }\n $rootNode = $domXml->documentElement;\n $array = array();\n foreach($rootNode->childNodes as $child)\n {\n $array[$child->nodeName] = self::xmlDecode($child->nodeValue);\n }\n return $array;\n }",
"function xml2array($xml_string)\n {\n return \\Findforsikring\\Support\\Converters::xml2Array($xml_string);\n }",
"static function xmlToArray($xml) {\n return json_decode(json_encode(simplexml_load_string($xml)), true);\n }",
"public function simpleXML2Array($xml){\n\n $array = (array)$xml;\n\n if (count($array) == 0) {\n $array = (string)$xml; \n }\n\n if (is_array($array)) {\n //recursive Parser\n foreach ($array as $key => $value){\n if (is_object($value)) {\n if(strpos(get_class($value),\"SimpleXML\")!==false){\n $array[$key] = $this->simpleXML2Array($value);\n }\n } else {\n $array[$key] = $this->simpleXML2Array($value);\n }\n }\n }\n\n return $array;\n \n }",
"public static function toArray( $xml ) {\n if ( is_string( $xml ) ) $xml = new SimpleXMLElement( $xml );\n $children = $xml->children();\n if ( !$children ) return (string) $xml;\n $arr = array();\n foreach ( $children as $key => $node ) {\n $node = Vsb::toArray( $node );\n\n // support for 'anon' non-associative arrays\n if ( $key == 'anon' ) $key = count( $arr );\n\n // if the node is already set, put it into an array\n if ( isset( $arr[$key] ) ) {\n if ( !is_array( $arr[$key] ) || $arr[$key][0] == null ) $arr[$key] = array( $arr[$key] );\n $arr[$key][] = $node;\n } else {\n $arr[$key] = $node;\n }\n }\n return $arr;\n }",
"function toArray( $xml )\r\n {\r\n\t\t$this->rownum=0;\r\n $newXML = new SimpleXMLElement( $xml );\r\n return $this->getArrayElements( $newXML );\r\n }",
"public static function xml2array( $xmlObject ) {\n\t\t$json = json_encode( $xmlObject );\n\t\treturn json_decode( $json, TRUE );\n\t}",
"private function __xmlToArray($xml=null, $ifXML=true) {\r\n\t\tif (strpos($xml, \"<?xml\") === false && $ifXML) {\r\n\t\t\t$this->_errors[] = $xml;\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\tif (!class_exists('Xml')) {\r\n\t\t\tApp::import('Core', 'Xml');\r\n\t\t}\r\n\t\t$xml = new Xml($xml);\r\n\t\treturn $xml->toArray();\r\n\t}",
"private function xml_to_array ($xml) {\n\t\t$array = array();\n\t\tforeach ($xml->pref as $pref) {\n\t\t\t$array[(string)$pref->key] = $pref;\n\t\t}\n\t\treturn $array;\n\t}",
"function XmlToArray($xml){\r\n\t\t$array = simplexml_load_string ( $xml );\r\n\t\t$newArray = array ( ) ;\n\t\t$array = ( array ) $array ;\r\n\t\tforeach ( $array as $key => $value )\r\n\t\t{\r\n\t\t\t$value = ( array ) $value ;\t\t\t\r\n\t\t\t$newArray [ $key] = $value[0];\r\n\t\t}\r\n\t\t$newArray = array_map(\"trim\", $newArray);\r\n\t\treturn $newArray; \n}",
"private function simplexml2array($xml) {\n\t\tif (is_object($xml) && (get_class($xml) == 'SimpleXMLElement')) {\n\t\t\t$attributes = $xml->attributes();\n\t\t\tforeach($attributes as $k=>$v) {\n\t\t\t\tif ($v) $a[$k] = (string) $v;\n\t\t\t}\n\t\t\t$x = $xml;\n\t\t\t$xml = get_object_vars($xml);\n\t\t}\n\t\tif (is_array($xml)) {\n\t\t\tif (count($xml) == 0) return (string) $x; // for CDATA\n\t\t\tforeach($xml as $key => $value) {\n\t\t\t\t$r[$key] = $this->simplexml2array($value);\n\t\t\t}\n\t\t\tif (isset($a)) $r['@attributes'] = $a; // Attributes\n\t\t\treturn $r;\n\t\t}\n\t\treturn (string) $xml;\n\t}",
"public function getAsArray() {\n if($this->xmldb->xml) {\n $vals = array();\n $nodeList = $this->xmldb->xml->documentElement->childNodes;\n foreach ($nodeList as $node) {\n if (is_a($node, \"DOMElement\")) {\n #extract the child text value from each node\n $vals[] = $node->firstChild->nodeValue;\n }\n }\n \n return $vals;\n }\n }",
"protected function convertXmlToArray($xml)\n\t{\n\t\tif (!is_object($xml)) {\n\t\t\t$xml = simplexml_load_string($xml);\n\t\t}\n\t\t$result = (array)$xml;\n\t\tforeach ($result as $key => $value) {\n\t\t\tif (is_object($value)) {\n\t\t\t\t$result[$key] = $this->convertXmlToArray($value);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"private static function _simplexml2array($xml) {\n $xml_copy = $xml;\n if (is_object($xml) && get_class($xml) == 'SimpleXMLElement') {\n foreach ($xml->attributes() as $key => $value) {\n if ($value) {\n $attributes[$key] = (string)$value;\n }\n }\n\n $xml = get_object_vars($xml);\n }\n\n if (is_array($xml)) {\n if (empty($xml)) {\n return (string)$xml_copy;\n }\n\n $result = array();\n foreach ($xml as $key => $value) {\n $result[$key] = self::_simplexml2array($value);\n }\n\n return $result;\n }\n\n return (string)$xml;\n }",
"function setXmlArray(){\n \n $xmlData = simplexml_load_file($this->urlXml);\n $this->xmlArray = (array)$xmlData;\n \n }",
"protected function xml2array($xmlstring){\n\t\t$xml = simplexml_load_string($xmlstring, \"SimpleXMLElement\", LIBXML_NOCDATA);\n\t\t$jsonData = json_encode($xml);\n\t\treturn json_decode($jsonData, true);\n\t}",
"public static function fromXml($xml): array\n {\n if (!$xml) {\n $msg ='Convert To Array Error! Invalid Xml!';\n throw new InvalidArgumentException($msg);\n }\n\n libxml_disable_entity_loader(true);\n\n return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA), JSON_UNESCAPED_UNICODE), true);\n }",
"public function getDataprotArray() {\n\t\t$arr = array();\n\t\t$ds = $this->getDataprotXML();\n\t\tif (strlen($ds) > 1) {\n\t\t\t$arr = GeneralUtility::xml2array($ds);\n\t\t}\n\n\t\treturn $arr;\n\t}",
"public static function toArray( $xml ) {\n\t\tif(is_string($xml)) {\n\t\t\t$xml = new SimpleXMLElement( $xml );\n\t\t}\n\n\t\t$children = $xml->children();\n\n\t\tif(!$children) {\n\t\t\treturn (string) $xml;\n\t\t}\n\n\t\t$arr = array();\n\t\t$adjusted = array(); // used to determine if a node has been converted to an array of nodes\n\t\tforeach($children as $key => $node) {\n\t\t\t$node = SnipplrXML::toArray($node);\n\n\t\t\t// support for 'anon' non-associative arrays\n\t\t\tif($key == 'anon') {\n\t\t\t\t$key = count($arr);\n\t\t\t}\n\n\t\t\t// if the node is already set, put it into an array\n\t\t\tif(isset($arr[$key])) {\n\t\t\t\tif(isset($adjusted[$key]) && $adjusted[$key] == false) {\n\t\t\t\t\t$first_value = $arr[$key];\n\t\t\t\t\t$arr[$key] = array();\n\t\t\t\t\t$arr[$key][] = $first_value;\n\t\t\t\t\t$adjusted[$key] = true;\n\t\t\t\t}\n\n\t\t\t\tif(!is_array($arr[$key]) || (isset($arr[$key][0]) && $arr[$key][0] == null)) {\n\t\t\t\t\t$arr[$key] = array( $arr[$key] );\n\t\t\t\t}\n\t\t\t\t$arr[$key][] = $node;\n\t\t\t} else {\n\t\t\t\t$arr[$key] = $node;\n\t\t\t\t$adjusted[$key] = false;\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\t}",
"private function parseXmlToArrayWP($xml)\n {\n $xml = preg_replace(\"/(<\\/?)(\\w+):([^>]*>)/\", \"$1$2$3\", $xml);\n $xml = simplexml_load_string($xml);\n $json = json_encode($xml);\n return json_decode($json, true);\n }",
"function _xmlToArray($rootTag, $sXml)\n\t{\n\t\t$aArray = array();\n\t\t$sXml = str_replace(\"<$rootTag>\",\"<$rootTag>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</$rootTag>\",\"</$rootTag>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<e>\",\"<e>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</e>\",\"</e>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<k>\",\"<k>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</k>\",\"|~|</k>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<v>\",\"<v>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</v>\",\"|~|</v>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<q>\",\"<q>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</q>\",\"|~|</q>|~|\",$sXml);\n\n\t\t$this->aObjArray = explode(\"|~|\",$sXml);\n\n\t\t$this->iPos = 0;\n\t\t$aArray = $this->_parseObjXml($rootTag);\n\n\t\tif ($this->bDecodeUTF8Input)\n\t\t{\n\t\t\tforeach ($aArray as $sKey => $sValue)\n\t\t\t{\n\t\t\t\t$aArray[$sKey] = $this->_decodeUTF8Data($sValue);\n\t\t\t}\n\t\t}\n\n\t\treturn $aArray;\n\t}",
"public static function xmlToArr(string $xmlstr): array {\n if ($xmlstr === \"OK\") {\n return FALSE;\n }\n $xml = simplexml_load_string($xmlstr);\n if ($xml === FALSE) {\n Nova::log(\"Invalid XML: {$xmlstr}\", \"error\");\n return [];\n }\n $json = json_encode($xml);\n $arr = json_decode($json, TRUE);\n return $arr;\n }",
"public static function xml2array($xml)\n {\n $arr = array();\n \n if(is_file($xml))\n {\n $xml = file_get_contents($xml);\n }\n $xml = (string)$xml;\n libxml_use_internal_errors(true);\n $dom = new DOMDocument();\n $dom->loadXML($xml);\n $sheets = $dom->getElementsByTagName(SheetConv::XML_WORKSHEET);\n for($i = 0; $i < $sheets->length; $i++)\n {\n $vals = array();\n $sheet = $sheets->item($i);\n $tables = $sheet->getElementsByTagName(SheetConv::XML_TABLE); \n // the sheet has only one table\n if($tables->length > 0)\n {\n $table = $tables->item(0);\n $rows = $table->getElementsByTagName(SheetConv::XML_ROW);\n // the table should has more than one row, first row was the field\n if($rows->length > 0)\n {\n $fields = array();\n $fieldRow = $rows->item(0);\n $fieldCells = $fieldRow->getElementsByTagName(SheetConv::XML_CELL);\n // field cells index\n for($fci = 0; $fci < $fieldCells->length; $fci++)\n {\n // $row->cell->data->value\n $fields[$fci] = $fieldCells->item($fci)->nodeValue;\n }\n \n // value rows index\n for($vri = 1; $vri < $rows->length; $vri++)\n {\n $val = array();\n $valRow = $rows->item($vri);\n $valCells = $valRow->getElementsByTagName(SheetConv::XML_CELL);\n $current = 0;\n // value cells index\n for($vci = 0; $vci < $valCells->length; $vci++)\n {\n if($valCells->item($vci)->getAttribute('ss:Index'))\n {\n $val[$fields[$vci]] = '';\n $current = $valCells->item($vci)->getAttribute('ss:Index') - 1;\n }\n if(isset($fields[$current]))\n {\n $val[$fields[$current]] = $valCells->item($vci)->nodeValue;\n $current++;\n }\n }\n $vals[] = $val;\n }\n }\n }\n $arr[$i] = $vals; \n }\n return $arr;\n }",
"public static function toArray( string $xml, $escape = [] ) {\n\n // Return an associative array.\n return object_to_array(new SimpleXMLElement(self::escapeXML($xml, $escape)));\n\n }",
"function xml2array($contents, $get_attributes=1, $priority = 'attribute') { \r\n if(!$contents) return array(); \r\n\r\n if(!function_exists('xml_parser_create')) { \r\n //print \"'xml_parser_create()' function not found!\"; \r\n return array(); \r\n } \r\n\r\n //Get the XML parser of PHP - PHP must have this module for the parser to work\r\n $parser = xml_parser_create(''); \r\n xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, \"UTF-8\"); # http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss\r\n xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); \r\n xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); \r\n xml_parse_into_struct($parser, trim($contents), $xml_values); \r\n xml_parser_free($parser); \r\n\r\n if(!$xml_values) return;//Hmm... \r\n\r\n //Initializations \r\n $xml_array = array(); \r\n $parents = array(); \r\n $opened_tags = array(); \r\n $arr = array(); \r\n\r\n $current = &$xml_array; //Refference \r\n\r\n //Go through the tags. \r\n $repeated_tag_index = array();//Multiple tags with same name will be turned into an array\r\n foreach($xml_values as $data) { \r\n unset($attributes,$value);//Remove existing values, or there will be trouble\r\n \r\n //This command will extract these variables into the foreach scope \r\n // tag(string), type(string), level(int), attributes(array). \r\n extract($data);//We could use the array by itself, but this cooler. \r\n\r\n $result = array(); \r\n $attributes_data = array(); \r\n \r\n if(isset($value)) { \r\n if($priority == 'tag') $result = $value; \r\n else $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode\r\n } \r\n\r\n //Set the attributes too. \r\n if(isset($attributes) and $get_attributes) { \r\n foreach($attributes as $attr => $val) { \r\n if($priority == 'tag') $attributes_data[$attr] = $val; \r\n else $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'\r\n } \r\n } \r\n\r\n //See tag status and do the needed. \r\n if($type == \"open\") {//The starting of the tag '<tag>' \r\n $parent[$level-1] = &$current; \r\n if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag\r\n $current[$tag] = $result; \r\n if($attributes_data) $current[$tag. '_attr'] = $attributes_data;\r\n $repeated_tag_index[$tag.'_'.$level] = 1; \r\n\r\n $current = &$current[$tag]; \r\n\r\n } else { //There was another element with the same tag name \r\n\r\n if(isset($current[$tag][0])) {//If there is a 0th element it is already an array\r\n $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;\r\n $repeated_tag_index[$tag.'_'.$level]++; \r\n } else {//This section will make the value an array if multiple tags with the same name appear together\r\n $current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array\r\n $repeated_tag_index[$tag.'_'.$level] = 2; \r\n \r\n if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well\r\n $current[$tag]['0_attr'] = $current[$tag.'_attr']; \r\n unset($current[$tag.'_attr']); \r\n } \r\n\r\n } \r\n $last_item_index = $repeated_tag_index[$tag.'_'.$level]-1; \r\n $current = &$current[$tag][$last_item_index]; \r\n } \r\n\r\n } elseif($type == \"complete\") { //Tags that ends in 1 line '<tag />' \r\n //See if the key is already taken. \r\n if(!isset($current[$tag])) { //New Key \r\n $current[$tag] = $result; \r\n $repeated_tag_index[$tag.'_'.$level] = 1; \r\n if($priority == 'tag' and $attributes_data) $current[$tag. '_attr'] = $attributes_data;\r\n \r\n } else { //If taken, put all things inside a list(array) \r\n if(isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array...\r\n \r\n // ...push the new element into that array. \r\n $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;\r\n \r\n if($priority == 'tag' and $get_attributes and $attributes_data) {\r\n $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;\r\n } \r\n $repeated_tag_index[$tag.'_'.$level]++; \r\n\r\n } else { //If it is not an array... \r\n $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value\r\n $repeated_tag_index[$tag.'_'.$level] = 1; \r\n if($priority == 'tag' and $get_attributes) { \r\n if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well\r\n \r\n $current[$tag]['0_attr'] = $current[$tag.'_attr']; \r\n unset($current[$tag.'_attr']); \r\n } \r\n \r\n if($attributes_data) { \r\n $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;\r\n } \r\n } \r\n $repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken\r\n } \r\n } \r\n\r\n } elseif($type == 'close') { //End of tag '</tag>' \r\n $current = &$parent[$level-1]; \r\n } \r\n } \r\n \r\n return($xml_array); \r\n}",
"public function xmlToArray($xml, $options = array()) {\r\n\t\t$defaults = array(\r\n\t\t\t'namespaceSeparator' \t=> ':',\t\t//you may want this to be something other than a colon\r\n\t\t\t'attributePrefix' \t\t=> '@', \t//to distinguish between attributes and nodes with the same name\r\n\t\t\t'alwaysArray' \t\t\t=> array(), //array of xml tag names which should always become arrays\r\n\t\t\t'autoArray' \t\t\t=> true, //only create arrays for tags which appear more than once\r\n\t\t\t'textContent' \t\t\t=> '$', //key used for the text content of elements\r\n\t\t\t'autoText' \t\t\t\t=> true, //skip textContent key if node has no attributes or child nodes\r\n\t\t\t'keySearch' \t\t\t=> false, //optional search and replace on tag and attribute names\r\n\t\t\t'keyReplace' \t\t\t=> false //replace values for above search values (as passed to str_replace())\r\n\t\t);\r\n\t\t$options = array_merge($defaults, $options);\r\n\t\t$namespaces = $xml->getDocNamespaces();\r\n\t\t$namespaces[''] = null; //add base (empty) namespace\r\n\t \r\n\t\t//get attributes from all namespaces\r\n\t\t$attributesArray = array();\r\n\t\tforeach ($namespaces as $prefix => $namespace) {\r\n\t\t\tforeach ($xml->attributes($namespace) as $attributeName => $attribute) {\r\n\t\t\t\t//replace characters in attribute name\r\n\t\t\t\tif ($options['keySearch']) $attributeName =\r\n\t\t\t\t\t\tstr_replace($options['keySearch'], $options['keyReplace'], $attributeName);\r\n\t\t\t\t$attributeKey = $options['attributePrefix']\r\n\t\t\t\t\t\t. ($prefix ? $prefix . $options['namespaceSeparator'] : '')\r\n\t\t\t\t\t\t. $attributeName;\r\n\t\t\t\t$attributesArray[$attributeKey] = (string)$attribute;\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n\t\t//get child nodes from all namespaces\r\n\t\t$tagsArray = array();\r\n\t\tforeach ($namespaces as $prefix => $namespace) {\r\n\t\t\tforeach ($xml->children($namespace) as $childXml) {\r\n\t\t\t\t//recurse into child nodes\r\n\t\t\t\t$childArray = $this->xmlToArray($childXml, $options);\r\n\t\t\t\tlist($childTagName, $childProperties) = each($childArray);\r\n\t \r\n\t\t\t\t//replace characters in tag name\r\n\t\t\t\tif ($options['keySearch']) $childTagName =\r\n\t\t\t\t\t\tstr_replace($options['keySearch'], $options['keyReplace'], $childTagName);\r\n\t\t\t\t//add namespace prefix, if any\r\n\t\t\t\tif ($prefix) $childTagName = $prefix . $options['namespaceSeparator'] . $childTagName;\r\n\t \r\n\t\t\t\tif (!isset($tagsArray[$childTagName])) {\r\n\t\t\t\t\t//only entry with this key\r\n\t\t\t\t\t//test if tags of this type should always be arrays, no matter the element count\r\n if(is_array($childArray[$childTagName]) && count($childArray[$childTagName]) == 0) {\r\n $tagsArray[$childTagName] = \"\";\r\n } else {\r\n //print_r($childArray);\r\n $tagsArray[$childTagName] =\r\n in_array($childTagName, $options['alwaysArray']) || !$options['autoArray']\r\n ? array($childProperties) : $childProperties;\r\n }\r\n\t\t\t\t} elseif (\r\n\t\t\t\t\tis_array($tagsArray[$childTagName]) && array_keys($tagsArray[$childTagName])\r\n\t\t\t\t\t=== range(0, count($tagsArray[$childTagName]) - 1)) {\r\n\t\t\t\t\t//key already exists and is integer indexed array\r\n\t\t\t\t\t$tagsArray[$childTagName][] = $childProperties;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//key exists so convert to integer indexed array with previous value in position 0\r\n\t\t\t\t\t$tagsArray[$childTagName] = array($tagsArray[$childTagName], $childProperties);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t //echo \"<pre>\"; print_r($tagsArray); echo \"</pre>\";\r\n\t\t//get text content of node\r\n\t\t$textContentArray = array();\r\n\t\t$plainText = trim((string)$xml);\r\n\t\tif ($plainText !== '') $textContentArray[$options['textContent']] = $plainText;\r\n\t \r\n\t\t//stick it all together\r\n\t\t$propertiesArray = !$options['autoText'] || $attributesArray || $tagsArray || ($plainText === '')\r\n\t\t\t\t? array_merge($attributesArray, $tagsArray, $textContentArray) : $plainText;\r\n\t \r\n\t\t//return node as array\r\n\t\treturn array(\r\n\t\t\t$xml->getName() => $propertiesArray\r\n\t\t);\r\n\t}",
"public function xml_prase_array(){\n\t\t$str=array();\n\t\n\t\t\t$fg=$this->xml->children(); \n\t\t//echo \t$fg->count().\"dds\";\n\t\t\t//$i=0;\n\t\t\tforeach ($fg[1]->children() as $re=>$fw) {\n\t\t\t\t$ds=array();\n\t\t\t\tforeach ($fw->children() as $fw1) {\n\t\t\t\t $str1=$fw1->getName();\n\t\t\t\t//echo $fw1;\n\t\t\t\t$r=(string)$fw1;\n\t\t\t\t//$ds=array();\n\t\t\t\t$ds[$str1]=$r;\n\t\t\t\t///$this->xml->saveXML();\n\t\t\t\t//print_r($fw1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$str[$re]=$ds;\n\t\t//$i++;\n\t\t\t}\n\t\t\n\t\t\t$this->xml->saveXML();\n\t\t\n\t\treturn $str;\n\t}",
"public function xmlToArray($xmlSource, $isFile = true) {\r\n if ($isFile)\r\n $xml = file_get_contents($xmlSource);\r\n else\r\n $xml = $xmlSource;\r\n\r\n $xmlObject = new SimpleXMLElement($xml);\r\n $decodeArray = @json_decode(@json_encode($xmlObject), 1);\r\n foreach ($decodeArray as $newDecodeArray) {\r\n $returnArray = $newDecodeArray;\r\n }\r\n return $returnArray;\r\n }",
"function xml2array($contents, $get_attributes=1, $priority = 'tag') {\n if(!$contents) return array();\n\n if(!function_exists('xml_parser_create')) {\n //print \"'xml_parser_create()' function not found!\";\n return array();\n }\n\n //Get the XML parser of PHP - PHP must have this module for the parser to work\n $parser = xml_parser_create('');\n xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, \"UTF-8\"); # http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss\n xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n xml_parse_into_struct($parser, trim($contents), $xml_values);\n xml_parser_free($parser);\n\n if(!$xml_values) return;//Hmm...\n\n //Initializations\n $xml_array = array();\n $parents = array();\n $opened_tags = array();\n $arr = array();\n\n $current = &$xml_array; //Refference\n\n //Go through the tags.\n $repeated_tag_index = array();//Multiple tags with same name will be turned into an array\n foreach($xml_values as $data) {\n unset($attributes,$value);//Remove existing values, or there will be trouble\n\n //This command will extract these variables into the foreach scope\n // tag(string), type(string), level(int), attributes(array).\n extract($data);//We could use the array by itself, but this cooler.\n\n $result = array();\n $attributes_data = array();\n \n if(isset($value)) {\n if($priority == 'tag') $result = $value;\n else $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode\n }\n\n //Set the attributes too.\n if(isset($attributes) and $get_attributes) {\n foreach($attributes as $attr => $val) {\n if($priority == 'tag') $attributes_data[$attr] = $val;\n else $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'\n }\n }\n\n //See tag status and do the needed.\n if($type == \"open\") {//The starting of the tag '<tag>'\n $parent[$level-1] = &$current;\n if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag\n $current[$tag] = $result;\n if($attributes_data) $current[$tag. '_attr'] = $attributes_data;\n $repeated_tag_index[$tag.'_'.$level] = 1;\n\n $current = &$current[$tag];\n\n } else { //There was another element with the same tag name\n\n if(isset($current[$tag][0])) {//If there is a 0th element it is already an array\n $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;\n $repeated_tag_index[$tag.'_'.$level]++;\n } else {//This section will make the value an array if multiple tags with the same name appear together\n $current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array\n $repeated_tag_index[$tag.'_'.$level] = 2;\n \n if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well\n $current[$tag]['0_attr'] = $current[$tag.'_attr'];\n unset($current[$tag.'_attr']);\n }\n\n }\n $last_item_index = $repeated_tag_index[$tag.'_'.$level]-1;\n $current = &$current[$tag][$last_item_index];\n }\n\n } elseif($type == \"complete\") { //Tags that ends in 1 line '<tag />'\n //See if the key is already taken.\n if(!isset($current[$tag])) { //New Key\n $current[$tag] = $result;\n $repeated_tag_index[$tag.'_'.$level] = 1;\n if($priority == 'tag' and $attributes_data) $current[$tag. '_attr'] = $attributes_data;\n\n } else { //If taken, put all things inside a list(array)\n if(isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array...\n\n // ...push the new element into that array.\n $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;\n \n if($priority == 'tag' and $get_attributes and $attributes_data) {\n $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;\n }\n $repeated_tag_index[$tag.'_'.$level]++;\n\n } else { //If it is not an array...\n $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value\n $repeated_tag_index[$tag.'_'.$level] = 1;\n if($priority == 'tag' and $get_attributes) {\n if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well\n \n $current[$tag]['0_attr'] = $current[$tag.'_attr'];\n unset($current[$tag.'_attr']);\n }\n \n if($attributes_data) {\n $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;\n }\n }\n $repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken\n }\n }\n\n } elseif($type == 'close') { //End of tag '</tag>'\n $current = &$parent[$level-1];\n }\n }\n \n return($xml_array);\n}",
"function xml2array($contents, $get_attributes=1) {\n if(!$contents) return array();\n\n if(!function_exists('xml_parser_create')) {\n return array();\n }\n //Get the XML parser of PHP - PHP must have this module for the parser to work\n $parser = xml_parser_create();\n xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );\n xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );\n xml_parse_into_struct( $parser, $contents, $xml_values );\n xml_parser_free( $parser );\n\n if(!$xml_values) return;\n\n //Initializations\n $xml_array = array();\n $parents = array();\n $opened_tags = array();\n $arr = array();\n\n $current = &$xml_array;\n\n //Go through the tags.\n foreach($xml_values as $data) {\n unset($attributes,$value);//Remove existing values, or there will be trouble\n\n //This command will extract these variables into the foreach scope\n // tag(string), type(string), level(int), attributes(array).\n extract($data);//We could use the array by itself, but this cooler.\n\n $result = '';\n if($get_attributes) {//The second argument of the function decides this.\n $result = array();\n if(isset($value)) $result['value'] = $value;\n\n //Set the attributes too.\n if(isset($attributes)) {\n foreach($attributes as $attr => $val) {\n if($get_attributes == 1) $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'\n /** :TODO: should we change the key name to '_attr'? Someone may use the tagname 'attr'. Same goes for 'value' too */\n }\n }\n } elseif(isset($value)) {\n $result = $value;\n }\n\n //See tag status and do the needed.\n if($type == \"open\") {//The starting of the tag '<tag>'\n $parent[$level-1] = &$current;\n\n if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag\n $current[$tag] = $result;\n $current = &$current[$tag];\n\n } else { //There was another element with the same tag name\n if(isset($current[$tag][0])) {\n array_push($current[$tag], $result);\n } else {\n $current[$tag] = array($current[$tag],$result);\n }\n $last = count($current[$tag]) - 1;\n $current = &$current[$tag][$last];\n }\n\n } elseif($type == \"complete\") { //Tags that ends in 1 line '<tag />'\n //See if the key is already taken.\n if(!isset($current[$tag])) { //New Key\n $current[$tag] = $result;\n\n } else { //If taken, put all things inside a list(array)\n if((is_array($current[$tag]) and $get_attributes == 0)//If it is already an array...\n or (isset($current[$tag][0]) and is_array($current[$tag][0]) and $get_attributes == 1)) {\n array_push($current[$tag],$result); // ...push the new element into that array.\n } else { //If it is not an array...\n $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value\n }\n }\n\n } elseif($type == 'close') { //End of tag '</tag>'\n $current = &$parent[$level-1];\n }\n }\n\n return($xml_array);\n}",
"function icedrive_response_to_array($response)\r\n {\r\n libxml_use_internal_errors(true);\r\n $xml = simplexml_load_string(str_replace(':', '', $response));\r\n $xml = json_encode($xml);\r\n $xml = json_decode($xml, true);\r\n return $xml;\r\n }",
"protected function simpleXML2Array(\\SimpleXMLElement $xml)\n {\n $array = [];\n\n foreach ($xml as $element) {\n /* @var \\SimpleXMLElement $element */\n $elementName = $element->getName();\n $elementVars = get_object_vars($element);\n\n if (!empty($elementVars)) {\n $array[$elementName] = $element instanceof \\SimpleXMLElement\n ? $this->simpleXML2Array($element)\n : $elementVars;\n } else {\n $array[$elementName] = trim($element);\n }\n }\n\n return $array;\n }",
"private function xmlToArray( $xml, $out = [] )\n\t{\n\t\tforeach ( (array) $xml as $key => $node ) {\n\n\t\t\tif( $node instanceof SimpleXMLElement ) {\n\t\t\t\t$out[ $key ] = $this->xmlToArray( $node );\n\t\t\t} else if( is_array($node) ) { \n\t\t\t\t$out[ $key ] = $this->xmlToArray( $node ); // not sure why I split it ;x\n\t\t\t} else {\n\t\t\t\t$out[ $key ] = $node;\n\t\t\t}\n\t\t\t\n\t\t\tif( isset( $out[ $key ]['@attributes'] ) ) {\n\t\t\t\tforeach( $out[ $key ]['@attributes'] as $attrKey => $attrValue ) {\n\t\t\t\t\t$out[ $key ][ $attrKey ] = $attrValue;\n\t\t\t\t}\n\t\t\t\tunset( $out[ $key ]['@attributes'] );\n\t\t\t}\n\n\t\t}\n\n\t\treturn ( count( $out ) == 0 ? '' : $out );\n\t}",
"public static function responsexml2array($xml) {\n if (!$xml) {\n return $xml;\n }\n\n // Convert to nice array.\n $xml = self::_simplexml2array($xml);\n\n if (!isset($xml['items']['item'])) {\n return $xml;\n }\n\n // Fix the problem with 1 or 2+ items in array.\n if (!isset($xml['items']['item'][0])) {\n $tmp = array(0 => $xml['items']['item']);\n unset($xml['items']);\n $xml['items']['item'] = $tmp;\n }\n\n // Fix problem with 1 or 2+ mediafiles in array.\n foreach ($xml['items']['item'] as &$item) {\n if (!empty($item['mediafiles']) && !isset($item['mediafiles']['mediafile'][0])) {\n $tmp = array(0 => $item['mediafiles']['mediafile']);\n unset($item['mediafiles']['mediafile']);\n $item['mediafiles']['mediafile'] = $tmp;\n }\n }\n\n return $xml;\n }",
"function xml_unserialize(&$xml) {\r\n\t$xml_parser = new XML();\r\n\t$data = $xml_parser->parse($xml);\r\n\t$xml_parser->destruct();\r\n\t$arr = xml_format_array($data);\r\n\treturn $arr['root'];\r\n}",
"function xml2array( $data, $lower = false ) {\n\n $vals = json_decode( json_encode( (array)simplexml_load_string( $data ) ), true );\n\n // Lower / Uppercase array keys\n if ( $lower === true AND is_array( $vals ) )\n return array_change_key_case( $vals, CASE_LOWER );\n\n else\n return $vals;\n\n }",
"function xml_to_associative_array($xml_object)\n{\n\t$objects_array = array(); // create empty array where structure of objects will be converted\n\n\tforeach($xml_object->attributes() as $attr_key => $value) // set attributes id and values\n\t{\n\t\t$objects_array['@attributes'][$attr_key] = (string)$value;\n\t}\n\n\tforeach($xml_object as $index => $child) // recursively call function on all of the children (xml sub objects)\n\t{\n\t\t$objects_array[$index][] = xml_to_associative_array($child);\n\t}\n\n\tif($xml_object->count() == 0) // if its the last object in tree and there is no other children\n\t\t$objects_array['@value'] = $xml_object->__toString(); //convert value to string and store it under value keyword\n\n\treturn $objects_array;\n}",
"public function xml2array($contents, $get_attributes=1, $priority = 'tag')\n {\n if(!$contents) return array();\n\n if(!function_exists('xml_parser_create')) {\n //print \"'xml_parser_create()' function not found!\";\n return array();\n }\n\n //Get the XML parser of PHP - PHP must have this module for the parser to work\n $parser = xml_parser_create('');\n xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, \"UTF-8\"); # http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss\n xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n xml_parse_into_struct($parser, trim($contents), $xml_values);\n xml_parser_free($parser);\n\n if(!$xml_values) return;//Hmm...\n\n //Initializations\n $xml_array = array();\n $parents = array();\n $opened_tags = array();\n $arr = array();\n\n $current = &$xml_array; //Refference\n\n //Go through the tags.\n $repeated_tag_index = array();//Multiple tags with same name will be turned into an array\n foreach($xml_values as $data) {\n unset($attributes,$value);//Remove existing values, or there will be trouble\n\n //This command will extract these variables into the foreach scope\n // tag(string), type(string), level(int), attributes(array).\n extract($data);//We could use the array by itself, but this cooler.\n\n $result = array();\n $attributes_data = array();\n\n if(isset($value)) {\n if($priority == 'tag') $result = $value;\n else $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode\n }\n\n //Set the attributes too.\n if(isset($attributes) and $get_attributes) {\n foreach($attributes as $attr => $val) {\n if($priority == 'tag') $attributes_data[$attr] = $val;\n else $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'\n }\n }\n\n //See tag status and do the needed.\n if($type == \"open\") {//The starting of the tag '<tag>'\n $parent[$level-1] = &$current;\n if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag\n $current[$tag] = $result;\n if($attributes_data) $current[$tag. '_attr'] = $attributes_data;\n $repeated_tag_index[$tag.'_'.$level] = 1;\n\n $current = &$current[$tag];\n\n } else { //There was another element with the same tag name\n\n if(isset($current[$tag][0])) {//If there is a 0th element it is already an array\n $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;\n $repeated_tag_index[$tag.'_'.$level]++;\n } else {//This section will make the value an array if multiple tags with the same name appear together\n $current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array\n $repeated_tag_index[$tag.'_'.$level] = 2;\n\n if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well\n $current[$tag]['0_attr'] = $current[$tag.'_attr'];\n unset($current[$tag.'_attr']);\n }\n\n }\n $last_item_index = $repeated_tag_index[$tag.'_'.$level]-1;\n $current = &$current[$tag][$last_item_index];\n }\n\n } elseif($type == \"complete\") { //Tags that ends in 1 line '<tag />'\n //See if the key is already taken.\n if(!isset($current[$tag])) { //New Key\n $current[$tag] = $result;\n $repeated_tag_index[$tag.'_'.$level] = 1;\n if($priority == 'tag' and $attributes_data) $current[$tag. '_attr'] = $attributes_data;\n\n } else { //If taken, put all things inside a list(array)\n if(isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array...\n\n // ...push the new element into that array.\n $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;\n\n if($priority == 'tag' and $get_attributes and $attributes_data) {\n $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;\n }\n $repeated_tag_index[$tag.'_'.$level]++;\n\n } else { //If it is not an array...\n $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value\n $repeated_tag_index[$tag.'_'.$level] = 1;\n if($priority == 'tag' and $get_attributes) {\n if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well\n\n $current[$tag]['0_attr'] = $current[$tag.'_attr'];\n unset($current[$tag.'_attr']);\n }\n\n if($attributes_data) {\n $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;\n }\n }\n $repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken\n }\n }\n\n } elseif($type == 'close') { //End of tag '</tag>'\n $current = &$parent[$level-1];\n }\n }\n\n return($xml_array);\n }",
"protected static function xmlToArray(\\SimpleXMLElement $element)\n {\n $data = (array)$element;\n foreach ($data as $key => $value) {\n if ($value instanceof \\SimpleXMLElement) {\n $data[$key] = static::xmlToArray($value);\n }\n }\n\n return $data;\n }",
"function xml_to_array($contents, $get_attributes=1, $priority = 'tag') {\n\t\tif(!$contents) return array();\n\n\t\tif(!function_exists('xml_parser_create')) {\n\t\t\ttrigger_error(\"XML not supported: \" .\n \"http://www.php.net/manual/en/ref.xml.php\", E_USER_ERROR);\n\t\t\treturn array();\n\t\t}\n\t\t$output_encoding = 'ISO-8859-1';\n\t\t$input_encoding = NULL;\n\t\t$detect_encoding = true;\n\n list($parser, $source) = $this->xml_create_parser($contents,\n $output_encoding, $input_encoding, $detect_encoding);\n\n\n if (!is_resource($parser))\n\t\t{\n\t\t\ttrigger_error(\"Failed to create an instance of PHP's XML parser. \" .\n \"http://www.php.net/manual/en/ref.xml.php\", E_USER_ERROR);\n }\n\n\t\txml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n\t\txml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n\t\txml_parse_into_struct($parser, trim($contents), $xml_values);\n\t\txml_parser_free($parser);\n\n\t\tif(!$xml_values) return;//Hmm...\n\n\t\t//Initializations\n\t\t$xml_array = array();\n\t\t$parents = array();\n\t\t$opened_tags = array();\n\t\t$arr = array();\n\n\t\t$current = &$xml_array; //Refference\n\n\t\t//Go through the tags.\n\t\t$repeated_tag_index = array();//Multiple tags with same name will be turned into an array\n\t\tforeach($xml_values as $data) {\n\t\t\tunset($attributes,$value);//Remove existing values, or there will be trouble\n\n\t\t\t//This command will extract these variables into the foreach scope\n\t\t\t// tag(string), type(string), level(int), attributes(array).\n\t\t\textract($data);//We could use the array by itself, but this cooler.\n\n\t\t\t$result = array();\n\t\t\t$attributes_data = array();\n\n\t\t\tif(isset($value)) {\n\t\t\t\tif($priority == 'tag') $result = $value;\n\t\t\t\telse $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode\n\t\t\t}\n\n\t\t\t//Set the attributes too.\n\t\t\tif(isset($attributes) and $get_attributes) {\n\t\t\t\tforeach($attributes as $attr => $val) {\n\t\t\t\t\tif($priority == 'tag') $attributes_data[$attr] = $val;\n\t\t\t\t\telse $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//See tag status and do the needed.\n\t\t\tif($type == \"open\") {//The starting of the tag '<tag>'\n\t\t\t\t$parent[$level-1] = &$current;\n\t\t\t\tif(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag\n\t\t\t\t\t$current[$tag] = $result;\n\t\t\t\t\tif($attributes_data) $current[$tag. '_attr'] = $attributes_data;\n\t\t\t\t\t$repeated_tag_index[$tag.'_'.$level] = 1;\n\n\t\t\t\t\t$current = &$current[$tag];\n\n\t\t\t\t} else { //There was another element with the same tag name\n\n\t\t\t\t\tif(isset($current[$tag][0])) {//If there is a 0th element it is already an array\n\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;\n\t\t\t\t\t\t$repeated_tag_index[$tag.'_'.$level]++;\n\t\t\t\t\t} else {//This section will make the value an array if multiple tags with the same name appear together\n\t\t\t\t\t\t$current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array\n\t\t\t\t\t\t$repeated_tag_index[$tag.'_'.$level] = 2;\n\n\t\t\t\t\t\tif(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well\n\t\t\t\t\t\t\t$current[$tag]['0_attr'] = $current[$tag.'_attr'];\n\t\t\t\t\t\t\tunset($current[$tag.'_attr']);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\t$last_item_index = $repeated_tag_index[$tag.'_'.$level]-1;\n\t\t\t\t\t$current = &$current[$tag][$last_item_index];\n\t\t\t\t}\n\n\t\t\t} elseif($type == \"complete\") { //Tags that ends in 1 line '<tag />'\n\t\t\t\t//See if the key is already taken.\n\t\t\t\tif(!isset($current[$tag])) { //New Key\n\t\t\t\t\t$current[$tag] = $result;\n\t\t\t\t\t$repeated_tag_index[$tag.'_'.$level] = 1;\n\t\t\t\t\tif($priority == 'tag' and $attributes_data) $current[$tag. '_attr'] = $attributes_data;\n\n\t\t\t\t} else { //If taken, put all things inside a list(array)\n\t\t\t\t\tif(isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array...\n\n\t\t\t\t\t\t// ...push the new element into that array.\n\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;\n\n\t\t\t\t\t\tif($priority == 'tag' and $get_attributes and $attributes_data) {\n\t\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$repeated_tag_index[$tag.'_'.$level]++;\n\n\t\t\t\t\t} else { //If it is not an array...\n\t\t\t\t\t\t$current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value\n\t\t\t\t\t\t$repeated_tag_index[$tag.'_'.$level] = 1;\n\t\t\t\t\t\tif($priority == 'tag' and $get_attributes) {\n\t\t\t\t\t\t\tif(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well\n\n\t\t\t\t\t\t\t\t$current[$tag]['0_attr'] = $current[$tag.'_attr'];\n\t\t\t\t\t\t\t\tunset($current[$tag.'_attr']);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($attributes_data) {\n\t\t\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} elseif($type == 'close') { //End of tag '</tag>'\n\t\t\t\t$current = &$parent[$level-1];\n\t\t\t}\n\t\t}\n\n\t\treturn($xml_array);\n\t}",
"function xmlUrl2array(string $url, int $get_attributes = 1, string $priority = 'tag'): array\n{\n if (!function_exists('xml_parser_create')) {\n return array();\n }\n\n $contents = file_get_contents($url);\n\n return xml2array($contents, $get_attributes, $priority);\n}",
"function ConvertXML2Array ( $contents = '', $get_attributes = 1, $priority = 'tag' )\n\t{\n\t\t$xml_values = '';\n\t\t$return_array = array ();\n\t\t$tag = '';\n\t\t$type = '';\n\t\t$level = 0;\n\t\t$attributes = array ();\n\t\tif ( function_exists( 'xml_parser_create' ) ) {\n\t\t\t$parser = xml_parser_create( 'UTF-8' );\n\n\t\t\txml_parser_set_option( $parser, XML_OPTION_TARGET_ENCODING, \"UTF-8\" );\n\t\t\txml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );\n\t\t\txml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );\n\t\t\txml_parse_into_struct( $parser, trim( $contents ), $xml_values );\n\t\t\txml_parser_free( $parser );\n\n\t\t\t//Initializations\n\t\t\t$xml_array = array ();\n\t\t\t$parent = array ();\n\n\t\t\t$current = & $xml_array; // Reference\n\n\n\t\t\t// Go through the tags.\n\t\t\t$repeated_tag_index = array ();\n\n\t\t\t// Multiple tags with same name will be turned into an array\n\t\t\tforeach ( $xml_values as $data ) {\n\t\t\t\tunset( $attributes, $value ); //Remove existing values, or there will be trouble\n\n\n\t\t\t\t// This command will extract these variables into the foreach scope\n\t\t\t\t// tag(string), type(string), level(int), attributes(array).\n\t\t\t\textract( $data ); //We could use the array by itself, but this cooler.\n\n\n\t\t\t\t$result = array ();\n\t\t\t\t$attributes_data = array ();\n\n\t\t\t\tif ( isset( $value ) ) {\n\t\t\t\t\tif ( $priority == 'tag' ) {\n\t\t\t\t\t\t$result = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result['value'] = $value; //Put the value in an associate array if we are in the 'Attribute' mode\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Set the attributes too\n\t\t\t\tif ( isset( $attributes ) and $get_attributes ) {\n\t\t\t\t\tforeach ( $attributes as $attr => $val ) {\n\t\t\t\t\t\tif ( $priority == 'tag' )\n\t\t\t\t\t\t\t$attributes_data[$attr] = $val;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// See tag status and do what's needed\n\t\t\t\tif ( $type == \"open\" ) { // The starting of the tag '<tag>'\n\t\t\t\t\t$parent[$level - 1] = & $current;\n\n\t\t\t\t\tif ( ! is_array( $current ) or (! in_array( $tag, array_keys( $current ) )) ) { //Insert New tag\n\t\t\t\t\t\t$current[$tag] = $result;\n\t\t\t\t\t\tif ( $attributes_data )\n\t\t\t\t\t\t\t$current[$tag . '_attr'] = $attributes_data;\n\t\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] = 1;\n\n\t\t\t\t\t\t$current = & $current[$tag];\n\n\t\t\t\t\t} else { // There was another element with the same tag name\n\n\n\t\t\t\t\t\tif ( isset( $current[$tag][0] ) ) { //If there is a 0th element it is already an array\n\t\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;\n\t\t\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] ++;\n\t\t\t\t\t\t} else { //This section will make the value an array if multiple tags with the same name appear together\n\t\t\t\t\t\t\t$current[$tag] = array ($current[$tag], $result );\n\t\t\t\t\t\t\t//This will combine the existing item and the new item together to make an array\n\t\t\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] = 2;\n\n\t\t\t\t\t\t\tif ( isset( $current[$tag . '_attr'] ) ) { // The attribute of the last(0th) tag must be moved as well\n\t\t\t\t\t\t\t\t$current[$tag]['0_attr'] = $current[$tag . '_attr'];\n\t\t\t\t\t\t\t\tunset( $current[$tag . '_attr'] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;\n\t\t\t\t\t\t$current = & $current[$tag][$last_item_index];\n\t\t\t\t\t}\n\t\t\t\t} elseif ( $type == \"complete\" ) { //Tags that ends in 1 line '<tag />'\n\t\t\t\t\t//See if the key is already taken.\n\t\t\t\t\tif ( ! isset( $current[$tag] ) ) { // New key\n\t\t\t\t\t\t$current[$tag] = $result;\n\t\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] = 1;\n\t\t\t\t\t\tif ( $priority == 'tag' and $attributes_data )\n\t\t\t\t\t\t\t$current[$tag . '_attr'] = $attributes_data;\n\t\t\t\t\t} else { //If taken, put all things inside a list(array)\n\t\t\t\t\t\tif ( isset( $current[$tag][0] ) and is_array( $current[$tag] ) ) {\n\t\t\t\t\t\t\t//This will combine the existing item and the new item together to make an array\n\t\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;\n\t\t\t\t\t\t\tif ( $priority == 'tag' and $get_attributes and $attributes_data ) {\n\t\t\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] ++;\n\t\t\t\t\t\t} else { //If it is not an array...\n\t\t\t\t\t\t\t$current[$tag] = array ($current[$tag], $result ); //...Make it an array using using the existing value and the new value\n\t\t\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] = 1;\n\t\t\t\t\t\t\tif ( $priority == 'tag' and $get_attributes ) {\n\t\t\t\t\t\t\t\tif ( isset( $current[$tag . '_attr'] ) ) { //The attribute of the last(0th) tag must be moved as well\n\t\t\t\t\t\t\t\t\t$current[$tag]['0_attr'] = $current[$tag . '_attr'];\n\t\t\t\t\t\t\t\t\tunset( $current[$tag . '_attr'] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( $attributes_data ) {\n\t\t\t\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] ++; //0 and 1 index is already taken\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif ( $type == 'close' ) { //End of tag '</tag>'\n\t\t\t\t\t$current = & $parent[$level - 1];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$return_array = $xml_array;\n\t\t}\n\t\treturn ($return_array);\n\t}",
"protected function getData() {\n\n $path = $this->getPath();\n\n // Check if file exists.\n if(!file_exists($path)) {\n throw new ImporterException(t('XML file @path does not exist.', array('@path' => $path)));\n }\n\n // Let the XML parser use internal errors so we can collect them later if anything goes wrong.\n libxml_use_internal_errors(true);\n $xml = simplexml_load_file($path);\n if($xml === FALSE) {\n $error_message = \"Failed loading XML:\";\n foreach(libxml_get_errors() as $error) {\n $error_message.= PHP_EOL . $error->message;\n }\n throw new ImporterException($error_message);\n }\n\n // XML -> JSON -> ARRAY\n $json = json_encode($xml);\n $array = json_decode($json, TRUE);\n return $array;\n }",
"public function rawXmlToArray($rawXML) {\n return [$this->getEvidence() => parent::rawXmlToArray($rawXML)];\n }",
"function xml2assoc($xml) { \n\t\t$tree = null; \n\t\twhile($xml->read()) {\n\t\t\tswitch ($xml->nodeType) { \n\t\t\t\tcase XMLReader::END_ELEMENT: return $tree; \n\t\t\t\tcase XMLReader::ELEMENT: \n\t\t\t\t\t$node = array('tag' => $xml->name, 'value' => $xml->isEmptyElement ? '' : xml2assoc($xml)); \n\t\t\t\t\tif($xml->hasAttributes) {\n\t\t\t\t\t\twhile($xml->moveToNextAttribute()) {\n\t\t\t\t\t\t\t$node['attributes'][$xml->name] = $xml->value; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$tree[] = $node; \n\t\t\t\tbreak; \n\t\t\t\tcase XMLReader::TEXT: \n\t\t\t\tcase XMLReader::CDATA: \n\t\t\t\t\t$tree .= $xml->value; \n\t\t\t} \n\t\t}\n\t\treturn $tree; \n\t}",
"public function xmlToArray( $string )\n {\n\n $doc = new DOMDocument();\n $doc->loadXML( $string );\n $root = $doc->documentElement;\n\n return $this->DomNodeToArray( $root );\n }",
"public static function xml2array($xmlString) {\n\n\t\t$xml = null;\n\t\tif(empty($xmlString)) {\n\t\t\techo 'Given empty XML String to xml2array.';\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$use_errors = libxml_use_internal_errors(TRUE);\n\t\t\t//$xml = new \\SimpleXMLElement($xmlString, LIBXML_NOERROR);\n\t\t\t$xml = new \\SimpleXMLElement($xmlString);\n\n\t\t\t//echo '<pre>'.htmlspecialchars($xml->asXML()).'</pre>';\n\t\t} catch (\\Exception $e) {\n\n\t\t\techo 'Caught exception: ' . $e->getMessage() . chr(10);\n\t\t\t//echo libxml_get_last_error();\n\t\t\techo 'Failed loading XML: ' . chr(10);\n\t\t\techo '<pre>';\n\t\t\tprint_r(htmlentities($xmlString));\n\t\t\techo '</pre>';\n\t\t\tforeach(libxml_get_errors() as $error) {\n\t\t\t\techo '- ' . $error->message . \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\tlibxml_clear_errors();\n\t\tlibxml_use_internal_errors($use_errors);\n\n\t\treturn $xml;\n\n\t\t// TOdO - xml repsonse from soap geht ned gscheit decodieren ..\n\t\t$xmlString = preg_replace(\"/(<\\/?)(\\w+):([^>]*>)/\", \"$1$2$3\", $xmlString);\n\n\t\t$xml = new \\SimpleXMLElement($xmlString);\n\t\treturn $xml;\n\t}",
"private function load( $xml ) {\n\t\t$fils = 0;\n\t\t$array = array();\n\n\t\tforeach( $this->namespaces as $uri => $prefix ) { \n\t\t\tforeach( $xml->children($uri) as $key => $value ) { \n\t\t\t\t$child = $this->load( $value );\n\n\t\t\t\t// To deal with the attributes, \n\t\t\t\t// only works for attributes without a namespace, or in with xml namespace prefixes \n\t\t\t\tif (count( $value->attributes() ) > 0 || count( $value->attributes(\"xml\", TRUE) ) > 0 ) { \n\t\t\t\t\t$child[\"@attributes\"] = $this->getAttributes( $value );\n\t\t\t\t}\n\t\t\t\t// Also add the namespace when there is one\n\t\t\t\tif ( !empty( $uri ) ) { \n\t\t\t\t\t$child[\"@namespace\"] = $uri;\n\t\t\t\t}\n\n\t\t\t\t//Let see if the new child is not in the array\n\t\t\t\tif( !in_array( $key, array_keys($array) ) ) {\n\t\t\t\t\t$array[$key] = NULL;\n\t\t\t\t\t$array[$key][] = $child;\n\t\t\t\t}\n\t\t\t\telse { \n\t\t\t\t\t//Add an element in an existing array\n\t\t\t\t\t$array[$key][] = $child;\n\t\t\t\t}\n\n\t\t\t\t$fils++;\n\t\t\t}\n\t\t}\n\n\t\t# no container, returning value\n\t\tif ( $fils == 0 ) {\n\t\t\treturn array( (string) $xml );\n\t\t}\n\n\t\treturn $array;\n\t}",
"function simpleXMLToArray(SimpleXMLElement $xml,$attributesKey=null,$childrenKey=null,$valueKey=null){\n\n\t\tif($childrenKey && !is_string($childrenKey)){$childrenKey = '@children';}\n\t\tif($attributesKey && !is_string($attributesKey)){$attributesKey = '@attributes';}\n\t\tif($valueKey && !is_string($valueKey)){$valueKey = '@values';}\n\n\t\t$return = array();\n\t\t$name = $xml->getName();\n\t\t$_value = trim((string)$xml);\n\t\tif(!strlen($_value)){$_value = null;};\n\n\t\tif($_value!==null){\n\t\t\tif($valueKey){$return[$valueKey] = $_value;}\n\t\t\telse{$return = $_value;}\n\t\t}\n\n\t\t$children = array();\n\t\t$first = true;\n\t\tforeach($xml->children() as $elementName => $child){\n\t\t\t$value = simpleXMLToArray($child,$attributesKey, $childrenKey,$valueKey);\n\t\t\tif(isset($children[$elementName])){\n\t\t\t\tif(is_array($children[$elementName])){\n\t\t\t\t\tif($first){\n\t\t\t\t\t\t$temp = $children[$elementName];\n\t\t\t\t\t\tunset($children[$elementName]);\n\t\t\t\t\t\t$children[$elementName][] = $temp;\n\t\t\t\t\t\t$first=false;\n\t\t\t\t\t}\n\t\t\t\t\t$children[$elementName][] = $value;\n\t\t\t\t}else{\n\t\t\t\t\t$children[$elementName] = array($children[$elementName],$value);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$children[$elementName] = $value;\n\t\t\t}\n\t\t}\n\t\tif($children){\n\t\t\tif($childrenKey){$return[$childrenKey] = $children;}\n\t\t\telse{$return = array_merge($return,$children);}\n\t\t}\n\n\t\t$attributes = array();\n\t\tforeach($xml->attributes() as $name=>$value){\n\t\t\t$attributes[$name] = trim($value);\n\t\t}\n\t\tif($attributes){\n\t\t\tif($attributesKey){$return[$attributesKey] = $attributes;}\n\t\t\telse{$return = array_merge($return, $attributes);}\n\t\t}\n\n\t\treturn $return;\n\t}",
"public function toArray(\\DOMDocument $domDocument, \\DOMElement $node) : array;",
"function xml2array($contents, $get_attributes = 1, $priority = 'tag') {\n\tif (!function_exists('xml_parser_create')) {\n\t\treturn array ();\n\t}\n\t$parser = xml_parser_create('');\n\txml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, \"UTF-8\");\n\txml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n\txml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n\txml_parse_into_struct($parser, trim($contents), $xml_values);\n\txml_parser_free($parser);\n\tif (!$xml_values) {\n\t\treturn; //Hmm...\n\t}\n\t$xml_array = array ();\n\t$parents = array ();\n\t$opened_tags = array ();\n\t$arr = array ();\n\t$current = & $xml_array;\n\t$repeated_tag_index = array ();\n\tforeach ($xml_values as $data) {\n\t\tunset ($attributes, $value);\n\t\textract($data);\n\t\t$result = array ();\n\t\t$attributes_data = array ();\n\t\tif (isset ($value)) {\n\t\t\tif ($priority == 'tag') {\n\t\t\t\t$result = $value;\n\t\t\t} else {\n\t\t\t\t$result['value'] = $value;\n\t\t\t}\n\t\t}\n\t\tif (isset ($attributes) and $get_attributes) {\n\t\t\tforeach ($attributes as $attr => $val) {\n\t\t\t\tif ($priority == 'tag') {\n\t\t\t\t\t$attributes_data[$attr] = $val;\n\t\t\t\t} else {\n\t\t\t\t\t$result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($type == \"open\") {\n\t\t\t$parent[$level -1] = & $current;\n\t\t\tif (!is_array($current) or (!in_array($tag, array_keys($current)))) {\n\t\t\t\t$current[$tag] = $result;\n\t\t\t\tif ($attributes_data) {\n\t\t\t\t\t$current[$tag . '_attr'] = $attributes_data;\n\t\t\t\t}\n\t\t\t\t$repeated_tag_index[$tag . '_' . $level] = 1;\n\t\t\t\t$current = &$current[$tag];\n\t\t\t} else {\n\t\t\t\tif (isset ($current[$tag][0])) {\n\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;\n\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level]++;\n\t\t\t\t} else {\n\t\t\t\t\t$current[$tag] = array (\n\t\t\t\t\t\t$current[$tag],\n\t\t\t\t\t\t$result\n\t\t\t\t\t\t);\n\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] = 2;\n\t\t\t\t\tif (isset ($current[$tag . '_attr'])) {\n\t\t\t\t\t\t$current[$tag]['0_attr'] = $current[$tag . '_attr'];\n\t\t\t\t\t\tunset ($current[$tag . '_attr']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;\n\t\t\t\t$current = &$current[$tag][$last_item_index];\n\t\t\t}\n\t\t} elseif ($type == \"complete\") {\n\t\t\tif (!isset ($current[$tag])) {\n\t\t\t\t$current[$tag] = $result;\n\t\t\t\t$repeated_tag_index[$tag . '_' . $level] = 1;\n\t\t\t\tif ($priority == 'tag' and $attributes_data) {\n\t\t\t\t\t$current[$tag . '_attr'] = $attributes_data;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (isset ($current[$tag][0]) and is_array($current[$tag])) {\n\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;\n\t\t\t\t\tif ($priority == 'tag' and $get_attributes and $attributes_data) {\n\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;\n\t\t\t\t\t}\n\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level]++;\n\t\t\t\t} else {\n\t\t\t\t\t$current[$tag] = array (\n\t\t\t\t\t\t$current[$tag],\n\t\t\t\t\t\t$result\n\t\t\t\t\t\t);\n\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level] = 1;\n\t\t\t\t\tif ($priority == 'tag' and $get_attributes) {\n\t\t\t\t\t\tif (isset ($current[$tag . '_attr'])) {\n\t\t\t\t\t\t\t$current[$tag]['0_attr'] = $current[$tag . '_attr'];\n\t\t\t\t\t\t\tunset ($current[$tag . '_attr']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($attributes_data) {\n\t\t\t\t\t\t\t$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($type == 'close') {\n\t\t\t$current = &$parent[$level -1];\n\t\t}\n\t}\n\treturn ($xml_array);\n}",
"static function asArray($filecont){\n\t\t\t$knj_xml = new knj_xml($filecont);\n\t\t\t$tags = $knj_xml->tags;\n\t\t\tunset($knj_xml);\n\t\t\t\n\t\t\treturn $tags;\n\t\t}",
"public static function unserialize($xml)\n {\n $sxml = new \\SimpleXMLElement($xml);\n\n return self::_sxml2arr($sxml);\n }",
"function xml2array(string $contents, int $get_attributes = 1, string $priority = 'tag'): array\n{\n if (!$contents) {\n return array();\n }\n\n if (!function_exists('xml_parser_create')) {\n return array();\n }\n //Get the XML parser of PHP - PHP must have this module for the parser to work\n $parser = xml_parser_create();\n xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n xml_parse_into_struct($parser, $contents, $xml_values);\n xml_parser_free($parser);\n\n if (!$xml_values) {\n return array();\n }//Hmm...\n\n //Initializations\n $xml_array = array();\n $parents = array();\n $opened_tags = array();\n $arr = array();\n\n $current = &$xml_array;\n\n //Go through the tags.\n foreach ($xml_values as $data) {\n unset($attributes, $value);//Remove existing values, or there will be trouble\n extract($data);//We could use the array by itself, but this cooler.\n\n $result = '';\n if ($get_attributes) {//The second argument of the function decides this.\n $result = array();\n if (isset($value)) {\n $result['value'] = $value;\n }\n\n //Set the attributes too.\n if (isset($attributes)) {\n foreach ($attributes as $attr => $val) {\n if ($get_attributes == 1) {\n $result['attr'][$attr] = $val;\n } //Set all the attributes in a array called 'attr'\n /** :TODO: should we change the key name to '_attr'? Someone may use the tagname 'attr'. Same goes for 'value' too */\n }\n }\n } elseif (isset($value)) {\n $result = $value;\n }\n\n //See tag status and do the needed.\n if ($type == \"open\") {//The starting of the tag '<tag>'\n $parent[$level - 1] = &$current;\n\n if (!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag\n $current[$tag] = $result;\n $current = &$current[$tag];\n } else { //There was another element with the same tag name\n if (isset($current[$tag][0])) {\n array_push($current[$tag], $result);\n } else {\n $current[$tag] = array($current[$tag], $result);\n }\n $last = count($current[$tag]) - 1;\n $current = &$current[$tag][$last];\n }\n } elseif ($type == \"complete\") { //Tags that ends in 1 line '<tag />'\n //See if the key is already taken.\n if (!isset($current[$tag])) { //New Key\n $current[$tag] = $result;\n } else { //If taken, put all things inside a list(array)\n if ((is_array($current[$tag]) and $get_attributes == 0)//If it is already an array...\n or (isset($current[$tag][0]) and is_array($current[$tag][0]) and $get_attributes == 1)) {\n array_push($current[$tag], $result); // ...push the new element into that array.\n } else { //If it is not an array...\n $current[$tag] = array($current[$tag], $result); //...Make it an array using using the existing value and the new value\n }\n }\n } elseif ($type == 'close') { //End of tag '</tag>'\n $current = &$parent[$level - 1];\n }\n }\n\n return ($xml_array);\n}",
"public static function parseXML($xmlStr): array\n {\n /*Basic parsing using simplexml_load_string */ \n $xmlObj = simplexml_load_string($xmlStr);//SimpleXMLElement Object\n if(isset($xmlObj->link)){\n $item = ['name'=>$xmlObj->name, 'link'=>$xmlObj->link]; \n }else{\n $item = ['name'=>$xmlObj->name, 'link'=>''];\n }\n \n return $item;\n }",
"public function getDebbXmlArray()\r\n\t{\r\n\t\t$array = array();\r\n\t\t$array['Load'] = $this->getLLoad();\r\n\t\t$array['PowerUsage'] = $this->getPowerUsage();\r\n\t\treturn $array;\r\n\t}",
"protected function extractXml($xml){\r\n\t$data = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\t\r\n\t$ret = array();\r\n\t$ret['system_type'] = (string)$data->row[0]->attributes()->system_type;\r\n\t$ret['validate'] = (string)$data->row[0]->attributes()->validate;\r\n\t$ret['predefined'] = (string)$data->row[0]->attributes()->predefined;\r\n\t$ret['size'] = (string)$data->row[0]->attributes()->size;\r\n\t$ret['unique'] = (string)$data->row[0]->attributes()->unique;\r\n\t$ret['cleanup'] = (string)$data->row[0]->attributes()->cleanup;\r\n\t$ret['name'] = (string)$data->row[0]->name;\r\n\t$ret['title'] = (string)$data->row[0]->title;\r\n\t$ret['table'] = (string)$data->row[0]->table;\r\n\t$ret['default_value'] = (string)$data->row[0]->default_value;\r\n\t$ret['default_lock_url'] = (string)$data->row[0]->default_lock_url;\r\n\treturn $ret; \r\n}",
"private function oauth_parse_xml($xml_string) {\r\n $xml = simplexml_load_string($xml_string);\r\n $json = json_encode($xml);\r\n $array = json_decode($json, true);\r\n \r\n return $array;\r\n }",
"private static function _sxml2arr($sxml, $arr = null)\n {\n foreach ((array) $sxml as $key => $value) {\n if (is_object($value) || (is_array($value))) {\n $arr[$key] = self::_sxml2arr($value);\n } else {\n $arr[$key] = $value;\n }\n }\n\n return $arr;\n }",
"static function convert($contents, $get_attributes=1)\n {\n if(!$contents) return array();\n \n if(!function_exists('xml_parser_create')) {\n //print \"'xml_parser_create()' function not found!\";\n return array();\n }\n //Get the XML parser of PHP - PHP must have this module for the parser to work\n $parser = xml_parser_create();\n xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );\n xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );\n xml_parse_into_struct( $parser, $contents, $xml_values );\n xml_parser_free( $parser );\n \n if(!$xml_values) return;//Hmm...\n \n //Initializations\n $xml_array = array();\n $parents = array();\n $opened_tags = array();\n $arr = array();\n \n $current = &$xml_array;\n \n //Go through the tags.\n foreach($xml_values as $data) {\n unset($attributes,$value);//Remove existing values, or there will be trouble\n \n //This command will extract these variables into the foreach scope\n // tag(string), type(string), level(int), attributes(array).\n extract($data);//We could use the array by itself, but this cooler.\n \n $result = '';\n if($get_attributes) {//The second argument of the function decides this.\n $result = array();\n if(isset($value)) $result['value'] = $value;\n \n //Set the attributes too.\n if(isset($attributes)) {\n foreach($attributes as $attr => $val) {\n if($get_attributes == 1) $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'\n /** :TODO: should we change the key name to '_attr'? Someone may use the tagname 'attr'. Same goes for 'value' too */\n }\n }\n } elseif(isset($value)) {\n $result = $value;\n }\n \n //See tag status and do the needed.\n if($type == \"open\") {//The starting of the tag '<tag>'\n $parent[$level-1] = &$current;\n \n if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag\n $current[$tag] = $result;\n $current = &$current[$tag];\n \n } else { //There was another element with the same tag name\n if(isset($current[$tag][0])) {\n array_push($current[$tag], $result);\n } else {\n $current[$tag] = array($current[$tag],$result);\n }\n $last = count($current[$tag]) - 1;\n $current = &$current[$tag][$last];\n }\n \n } elseif($type == \"complete\") { //Tags that ends in 1 line '<tag />'\n //See if the key is already taken.\n if(!isset($current[$tag])) { //New Key\n $current[$tag] = $result;\n \n } else { //If taken, put all things inside a list(array)\n if((is_array($current[$tag]) and $get_attributes == 0)//If it is already an array...\n or (isset($current[$tag][0]) and is_array($current[$tag][0]) and $get_attributes == 1)) {\n array_push($current[$tag],$result); // ...push the new element into that array.\n } else { //If it is not an array...\n $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value\n }\n }\n \n } elseif($type == 'close') { //End of tag '</tag>'\n $current = &$parent[$level-1];\n }\n }\n \n return($xml_array);\n }",
"public function asXML();",
"function xmlProvider() {\n\n return [\n [\n 'hello',\n 'hello',\n ],\n [\n '<element>hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\">hello</element>'\n ],\n [\n '<element foo=\"bar\">hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\" foo=\"bar\">hello</element>'\n ],\n [\n '<element x1:foo=\"bar\" xmlns:x1=\"http://example.org/ns\">hello</element>',\n '<element xmlns:x1=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\" x1:foo=\"bar\">hello</element>'\n ],\n [\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<element xmlns:foo=\"http://example.org/ns\">hello</element>',\n '<element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\">hello</element>',\n '<element>hello</element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child>hello</child></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child>hello</child></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child>hello</child></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child/></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child a=\"b\"/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child a=\"b\"/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child a=\"b\"/></x1:element>',\n ],\n ];\n\n }",
"function getXMLData()\n{\n\t$xml=simplexml_load_file(\"/var/www/VDF.xml\") or die(\"Error: Cannot create object\");\n\t$n = $xml->data_cloud[0]->datatocloud->count();\n\t$data = $xml->data_cloud[0];\n\t$data_array = array();\n\t$variable_array = array(\"type\",\"ext\",\"meteringID\",\"time_interval\",\"unit\",\"factor\",\"timestamp\");\n\t$data_split_array = array();\n\n\n\tfor ($i=0;$i<$n;$i++){\n\t\t$string = $data->datatocloud[$i];\n\t\t$string_parts = explode(\":\", $string);\n\t\t$sn = 7;\n\t\tfor ($s=0;$s<$sn;$s++){\n\t\t\tif($s<6){\n\t\t\t\t$data_split_array[$variable_array[$s]] = trim($string_parts[$s]);\n\t\t\t} else {\n\t\t\t\t//set inital timestamp\n\t\t\t\t$date = new DateTime();\n\t\t\t\t//$_SERVER['REQUEST_TIME'];\n\t\t\t\t$timestamp = $date->getTimestamp();\n\t\t\t\t$data_split_array[$variable_array[$s]] = $timestamp;\n\t\t\t}\n\t\t}\n\n\t\t$data_array[$i] = $data_split_array;\n\t\tunset($data_split_array);\n\t}\n\n\treturn $data_array;\t\n}",
"function convert_xml_to_assoc($xml) {\n $assoc = array();\n \n foreach((array)$xml as $key => $value) {\n if(is_object($value)) {\n $assoc[$key] = convert_xml_to_assoc($value);\n } else {\n $assoc[$key] = $value;\n }\n }\n \n return $assoc;\n}",
"public function getXml() {}",
"public function parseXml($data = '') {\n\n if ($data == '' || !$data) {\n return [];\n }\n // Read string using SimpleXMLElement.\n $xml_data = new \\SimpleXMLElement($data);\n\n return $xml_data;\n }",
"function decode_xml($data) {\n return @get_object_vars(simplexml_load_string($data));\n }",
"public function __serialize(): array\n {\n $array = $this->jsonSerialize();\n array_walk_recursive($array, function (&$item, $key): void {\n if ($item instanceof SimpleXMLElement) {\n $item = json_decode((string)json_encode((array)$item), true);\n }\n });\n\n /** @var array */\n return $array;\n }",
"public static function fromXml( $xml )\n\t{\n\t\tif ( str::isString( $xml ) )\n\t\t\t$xml = simplexml_load_string( (string) $xml );\n\n\t\tif ( !( $xml instanceof \\SimpleXMLElement ) )\n\t\t\tthrow new \\InvalidArgumentException( 'invalid XML document' );\n\n\t\treturn _A( static::xml2Array( $xml ) );\n\t}",
"function sduconnect_nodelist_to_array($node_list) {\n $output = [];\n foreach ($node_list as $node) {\n $output[] = $node->nodeValue;\n }\n return $output;\n}",
"public function getValuesXml();",
"public function xmlToAssoc(SimpleXMLElement $xml)\n {\n $array = array();\n foreach ($xml as $key => $value) {\n if (isset($value->$key)) {\n $i = 0;\n foreach ($value->$key as $v) {\n $array[$key][$i++] = (string)$v;\n }\n }\n else {\n // try to transform it into string value, trimming spaces between elements\n $array[$key] = trim((string)$value);\n if (empty($array[$key]) && !empty($value)) {\n $array[$key] = self::xmlToAssoc($value);\n }\n // untrim strings values\n else {\n $array[$key] = (string)$value;\n }\n }\n }\n return $array;\n }",
"protected function parseArrayElement(\\SimpleXMLElement $node) {\n\t\t\t$iList = new Common\\Mutable\\ArrayList();\n\t\t\t$children = $node->children();\n\t\t\tforeach ($children as $child) {\n\t\t\t\tswitch ($child->getName()) {\n\t\t\t\t\tcase 'array':\n\t\t\t\t\t\t$iList->addValue($this->parseArrayElement($child));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'dictionary':\n\t\t\t\t\t\t$iList->addValue($this->parseDictionaryElement($child));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'expression':\n\t\t\t\t\t\t$iList->addValue($this->parseExpressionElement($child));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'null':\n\t\t\t\t\t\t$iList->addValue($this->parseNullElement($child));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'undefined':\n\t\t\t\t\t\t$iList->addValue($this->parseUndefinedElement($child));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'value':\n\t\t\t\t\t\t$iList->addValue($this->parseValueElement($child));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $iList->toArray();\n\t\t}",
"public function asArray(SimpleXMLElement $xml, $isCanonical = true) {\n $result = array();\n if (!$isCanonical) {\n // add attributes\n foreach ($xml->attributes() as $attributeName => $attribute) {\n if ($attribute) {\n $result['@'][$attributeName] = trim((string) $attribute);\n }\n }\n }\n // add children values\n if ($xml->hasChildren()) {\n foreach ($xml->children() as $childName => $child) {\n if (!$child->hasChildren())\n $result[$childName] = $this->asArray($child, $isCanonical);\n else\n $result[$childName][] = $this->asArray($child, $isCanonical);\n }\n } else {\n if (empty($result)) {\n // return as string, if nothing was found\n $result = trim((string) $xml);\n } else {\n // value has zero key element\n $result[0] = trim((string) $xml);\n }\n }\n return $result;\n }",
"public function getDataToImportData () {\n\n $orders = $this->getImportedOrderData([\n 'products',\n 'userAddress',\n 'orderType',\n 'payment'\n ]);\n $data = $this->prepareXmlArray($orders);\n $result = ArrayToXml::convert($data);\n\n return $result;\n }",
"public function toArray()\n {\n return $this->elements;\n }",
"function convertXmlToPhp($xml);",
"protected function parseXML($xml, $recursive = false, $cust = false) {\n\t\tif (!$recursive) {\n\t\t\t$array = simplexml_load_string($xml);\n\t\t} else {\n\t\t\t$array = $xml;\n\t\t}\n\t\n\t\t$newArray = array();\n\t\t$array = (array) $array;\n\n\t\tforeach ($array as $key=>$value) {\n\t\t\t$value = (array) $value;\n\t\t\tif (isset($value[0])) {\n\t\t\t\tif (count($value) > 1) {\n\t\t\t\t\t$newArray[$key] = (array) $value;\n\t\t\t\t} else {\n\t\t\t\t\t$newArray[$key] = trim($value[0]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$newArray[$key] = $this->parseXML($value, true);\n\t\t\t}\n\t\t}\n\t return $newArray;\n\t}",
"public function testXMLtoArrayFunctionWithValidXML()\n {\n $array = $this->mockTrait->xmlToArray($this->validXml);\n\n $this->assertEquals(true, array_key_exists('to', $array));\n $this->assertEquals(true, array_key_exists('from', $array));\n $this->assertEquals(true, array_key_exists('heading', $array));\n $this->assertEquals(true, array_key_exists('body', $array));\n }",
"protected static function xml2Array( \\SimpleXMLElement $xml, $level = array() )\n\t{\n\t\t$overlay = array();\n\n\t\tforeach ( $xml->children() as $sub )\n\t\t{\n\t\t\t// get name of element to convert\n\t\t\t$name = $sub->getName();\n\n\t\t\t// want to extend some existing data of element?\n\t\t\t$extend = trim( $sub['extend'] );\n\t\t\t$extend = $extend ? preg_match( '/^on|yes|true|y|extend$/i', $extend )\n\t\t\t\t\t\t\t : array_key_exists( $name, $overlay );\n\n\n\t\t\t// prepare to actually extend some existing data\n\t\t\tif ( array_key_exists( $name, $overlay ) )\n\t\t\t\t$existing = $overlay[$name];\n\t\t\telse if ( array_key_exists( $name, $level ) )\n\t\t\t\t$existing = $level[$name];\n\t\t\telse\n\t\t\t{\n\t\t\t\t$existing = array();\n\t\t\t\t$extend = false;\n\t\t\t}\n\n\t\t\tif ( $extend )\n\t\t\t\t// start new set initially containing previously collected sole element\n\t\t\t\t$overlay[$name] = is_array( $existing ) && !static::isHash( $existing ) ? $existing : array( $existing );\n\n\n\t\t\t// get described data of current element\n\t\t\t$value = self::xml2Array( $sub, $extend || !is_array( $existing ) ? array() : $existing );\n\n\n\t\t\tif ( $extend )\n\t\t\t\t// merge with existing data\n\t\t\t\t$overlay[$name][] = $value;\n\t\t\telse\n\t\t\t\t// set data replacing some existing data\n\t\t\t\t$overlay[$name] = $value;\n\t\t}\n\n\n\t\t// apply created overlay to initially provided level of data\n\t\tforeach ( $overlay as $name => $value )\n\t\t\t$level[$name] = $value;\n\n\n\t\tif ( count( $level ) )\n\t\t\treturn $level;\n\n\t\tif ( (string) $xml === '' )\n\t\t\treturn array();\n\n\t\treturn data::autoType( _S($xml,'utf-8')->asUtf8 );\n\t}",
"protected function xmlToArray(\\SimpleXMLElement $xml, $prefix = '', $clear_cache = true) {\n if ($clear_cache) {\n $this->multiriga = array();\n }\n $out = array();\n\n foreach ($xml->children() as $foglia) {\n $id = ($prefix ? $prefix . '_' : '') . $foglia->getName();\n if (!isset($out[$id])) {\n $out[$id] = $foglia->count() == 0 ? \"{$foglia}\" : $this->xmlToArray($foglia, $prefix, false);\n } else {\n $index = $xml->getName() . '|' . $id;\n if (!in_array($index, $this->multiriga)) {\n $this->multiriga[] = $index;\n $out[$id] = array($out[$id]);\n }\n $out[$id][] = $foglia->count() == 0 ? \"{$foglia}\" : $this->xmlToArray($foglia, $prefix, false);\n }\n }\n\n return $out;\n }",
"public static function response2array($response) {\n return $response ? self::responsexml2array($response->xml) : FALSE;\n }",
"public function toArray(): array\n {\n $array = [];\n\n for ($i = 1; $i <= $this->size; $i++) {\n $array[] = $this->elements[$i]['value'];\n }\n\n return $array;\n }",
"public function toArray()\n {\n return $this->_elements;\n }",
"public function getValue(): array\n {\n return $this->nodeValue;\n }",
"public static function extract(string $path, array $options = []): array\n {\n\t\t$xmlObject = simplexml_load_file($path);\n\t\t$json = json_encode($xmlObject);\n $array = json_decode($json, true);\n return array_values($array);\n }",
"public function xml()\n {\n try\n {\n if (! $this->decoded) {\n $this->response = json_encode(simplexml_load_string($this->response));\n\n $this->json();\n }\n }\n catch (\\Exception $exception){\n $this->decoded = [];\n }\n\n return $this->decoded;\n }",
"public function toArray(): array {\n return $this->attributes()->toArray();\n }",
"private function domnode_to_array($node) {\n\t\t$output = array();\n\t\tswitch ($node->nodeType) {\n\n\t\t\tcase XML_CDATA_SECTION_NODE:\n\t\t\tcase XML_TEXT_NODE:\n\t\t\t\t$output = trim($node->textContent);\n\t\t\t\tbreak;\n\n\t\t\tcase XML_ELEMENT_NODE:\n\t\t\t\tfor ($i=0, $m=$node->childNodes->length; $i<$m; $i++) {\n\t\t\t\t\t$child = $node->childNodes->item($i);\n\t\t\t\t\t$v = $this->domnode_to_array($child);\n\t\t\t\t\tif(isset($child->tagName)) {\n\t\t\t\t\t\t$t = $child->tagName;\n\t\t\t\t\t\tif(!isset($output[$t])) {\n\t\t\t\t\t\t\t$output[$t] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$output[$t][] = $v;\n\t\t\t\t\t}\n\t\t\t\t\telseif($v || $v === '0') {\n\t\t\t\t\t\t$output = (string) $v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($node->attributes->length && !is_array($output)) { //Has attributes but isn't an array\n\t\t\t\t\t$output = array('@content'=>$output); //Change output into an array.\n\t\t\t\t}\n\t\t\t\tif (is_array($output)) {\n\t\t\t\t\tif ($node->attributes->length) {\n\t\t\t\t\t\t$a = array();\n\t\t\t\t\t\tforeach($node->attributes as $attrName => $attrNode) {\n\t\t\t\t\t\t\t$a[$attrName] = (string) $attrNode->value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$output['@attributes'] = $a;\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($output as $t => $v) {\n\t\t\t\t\t\tif (is_array($v) && count($v)==1 && $t!='@attributes') {\n\t\t\t\t\t\t\t$output[$t] = $v[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $output;\n\t}",
"public function xmlOutputToFile() {\n $array = array(\n 'id' => $this->musicRelease->id,\n 'trackCount' => $this->musicRelease->trackCount,\n 'title' => $this->musicRelease->title\n );\n \n return $array;\n }",
"private function _getArray($element)\n {\n $arr = array();\n \n foreach ($element->children() as $name => $node) {\n $arr[] = (string)$node;\n }\n \n return $arr;\n }",
"public function toArray()\n {\n $array = array();\n $array['id'] = md5(self::SEARCH_TYPE.$this->attribute('id'));\n $array['entity_id'] = $this->attribute('id');\n $array['parent_id'] = $this->attribute('node_id');\n $array['type'] = self::SEARCH_TYPE;\n $array['url'] = $this->urlAlias();\n $array['language_code'] = $this->languageCode();\n $array['content'] = $this->attribute('content');\n $array['published'] = $this->attribute('published');\n $array['modified'] = $this->attribute('modified');\n return $array;\n }",
"function xml_import ($xml) {\r\n $xml = html_entity_decode($xml);\r\n\t\tif (!stristr($xml,'<?xml')) {\r\n\t\t\t\t$xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>'.$xml;\r\n\t\t}\r\n $data = XML_unserialize($xml);\r\n\t\tif ($data === NULL) {\r\n\t\t\treturn 0;\r\n\t\t} else {\r\n\t\t return $data;\r\n\t\t}\r\n\t}",
"public function iterateToNull(SimpleXMLElement $xml): array;"
]
| [
"0.8158303",
"0.79301995",
"0.78761053",
"0.786762",
"0.7810978",
"0.76821357",
"0.76658595",
"0.76197165",
"0.75039744",
"0.74393255",
"0.7395674",
"0.734347",
"0.7214862",
"0.72105175",
"0.714016",
"0.7113072",
"0.71031237",
"0.7101944",
"0.7055246",
"0.7038776",
"0.6994862",
"0.69355613",
"0.6934714",
"0.690574",
"0.68971634",
"0.68701106",
"0.68562716",
"0.685435",
"0.68121004",
"0.6776474",
"0.67675877",
"0.67137754",
"0.6687903",
"0.66849405",
"0.65977323",
"0.65814996",
"0.6577978",
"0.65459657",
"0.6531421",
"0.65247494",
"0.6517884",
"0.65056425",
"0.6499774",
"0.6478735",
"0.64749086",
"0.64671576",
"0.64601874",
"0.6457105",
"0.64363635",
"0.64154494",
"0.6396735",
"0.63787144",
"0.637602",
"0.6352897",
"0.63193685",
"0.625805",
"0.62562853",
"0.62491614",
"0.621721",
"0.6187812",
"0.6185776",
"0.61098087",
"0.61087805",
"0.6078688",
"0.6067201",
"0.6057026",
"0.60282415",
"0.6021388",
"0.599422",
"0.5937912",
"0.5935833",
"0.5934489",
"0.59054726",
"0.59016114",
"0.5890358",
"0.5885001",
"0.5871644",
"0.5864302",
"0.5854398",
"0.5820389",
"0.5803802",
"0.5800503",
"0.5800372",
"0.57973707",
"0.57886386",
"0.5775912",
"0.5760624",
"0.57595634",
"0.57592463",
"0.5753637",
"0.5751703",
"0.573533",
"0.5733405",
"0.57205397",
"0.5711174",
"0.5703251",
"0.5683646",
"0.5679143",
"0.5671163",
"0.56705546"
]
| 0.7196062 | 14 |
Set Amount Sets the amount of the charge | public function Amount($amount) {
$this->Param('amount', $amount);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setAmount($amount);",
"public function setAmount($amount){\n\n $this->amount = $amount;\n\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n }",
"public function setAmount($value)\n\t{\n\t\treturn $this->set('Amount', $value);\n\t}",
"public function setAmount($value) \n {\n $this->_fields['Amount']['FieldValue'] = $value;\n return $this;\n }",
"public function setAmount($value)\n {\n $this->_fields['Amount']['FieldValue'] = $value;\n return $this;\n }",
"public function setChargesAttribute($amount)\n {\n $this->attributes['charges'] = formatAmount($amount);\n }",
"protected function setAmount()\n {\n if ( ! isset( $_POST['amount'] ) ) {\n $this->error = true;\n $this->data['error']['amount'] = 'Please enter a donation amount.';\n return;\n }\n \n $amount = trim( $_POST['amount'] );\n\n // Remove illegal characters\n $regex = '/[[^0-9.]]/';\n $value = preg_replace( $regex, '', $amount );\n \n \tif ( $value && is_numeric( $value ) && $value > 0 ) {\n $value = floor( $value * 100 ); // Set the amount in cents.\n \t\t$this->data['amount'] = $value;\n \t} else {\n \t\t$this->data['amount'] = 0;\n \t}\n }",
"public function amount($value) {\n $this->annotations['amount'] = $value;\n return $this;\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount()\n {\n $exact = $this->getOriginalPurgeValue('amount_exact');\n $percentage = $this->getOriginalPurgeValue('amount_percentage');\n\n $this->amount = $this->is_percentage\n ? $percentage\n : $exact;\n }",
"public function setAmount($amount)\n {\n $this->amount = Checker::int($amount, self::AMOUNT_MIN, self::AMOUNT_MAX, \"amount\");\n }",
"public function setAmount($amount)\n {\n return $this->setData(self::AMOUNT, $amount);\n }",
"public function setTransactionAmount($value) \n {\n $this->_fields['TransactionAmount']['FieldValue'] = $value;\n return;\n }",
"public function setGiftcardAmount($value);",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n\n return $this;\n }",
"public function setAmount($var)\n {\n GPBUtil::checkString($var, True);\n $this->amount = $var;\n\n return $this;\n }",
"public function setAmount(Amount $amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setCustomGiftcardAmount($value);",
"public function setAmount(string $amount)\r\n {\r\n $this->amount = $amount;\r\n\r\n return $this;\r\n }",
"public function withAmount($value)\n {\n $this->setAmount($value);\n return $this;\n }",
"public function withAmount($value)\n {\n $this->setAmount($value);\n return $this;\n }",
"public function setAmount($intAmount);",
"public function setAmount($amount)\n {\n $this->_amount = $amount;\n return $this;\n }",
"public function setChargeAmount(string $chargeAmount): self\n {\n $this->options['chargeAmount'] = $chargeAmount;\n return $this;\n }",
"public function setAmount($amount)\r\n {\r\n $this->amount = $amount;\r\n\r\n return $this;\r\n }",
"public function setAmount($amount)\n {\n $this->_amount = (int) $amount;\n return $this;\n }",
"public function setAmount(Money $amount): self\n {\n $this->initialized['amount'] = true;\n $this->amount = $amount;\n\n return $this;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"protected function amount($amount)\n {\n return $this->setAmount($amount);\n }",
"public function setAmount(Money $amount) {\n\t\t$this->amount = $amount;\n\t\treturn $this;\n\t}",
"public function setBaseDiscountAmount($amount);",
"public function setAmount($amount)\n\t{\n\t\t$this->amount = $amount;\n\n\t\treturn $this;\n\t}",
"public function charge($amount)\n {\n if ($this->isValid(false, false, false, $amount)) {\n $this->setBalanceDelta(\n -$amount\n )->setBalance(\n $this->getBalance() - $amount\n )->setHistoryAction(\n \\Magento\\GiftCardAccount\\Model\\History::ACTION_USED\n );\n }\n\n return $this;\n }",
"public function setDiscountAmount($amount);",
"public function setAmountMoney(Money $amountMoney): void\n {\n $this->amountMoney = $amountMoney;\n }",
"public function setAmount($var)\n {\n GPBUtil::checkFloat($var);\n $this->amount = $var;\n\n return $this;\n }",
"public function setCharge($value)\n {\n $this->_fields['Charge']['FieldValue'] = $value;\n return $this;\n }",
"public function setAmount($amount)\n {\n if ($amount instanceof DBMoney) {\n $this->setField('Money', $amount);\n } elseif ($this->Status == 'Created' && is_numeric($amount)) {\n $this->MoneyAmount = $amount;\n }\n return $this;\n }",
"public function setAmount(\\horstoeko\\ubl\\entities\\cbc\\Amount $amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setTaxAmount($amount);",
"public function setCharge($Charge){\n $this->Charge = $Charge;\n }",
"public function setAmount($balance)\n {\n $this->amount = (int) $balance;\n }",
"public function setAmount($amount)\n {\n if (!empty($amount)) {\n $this->amount = $amount;\n }\n\n return $this;\n }",
"public function chargeCard($amount)\n {\n if ($this->isValidCard)\n $this->balance += $this->parseAmount($amount);\n }",
"public function setamount($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (double) $v;\n }\n\n if ($this->amount !== $v) {\n $this->amount = $v;\n $this->modifiedColumns[] = ActionTypePeer::AMOUNT;\n }\n\n\n return $this;\n }",
"public function setAmount($var)\n {\n GPBUtil::checkInt64($var);\n $this->amount = $var;\n\n return $this;\n }",
"public function update($amount)\n {\n $currentBalance = auth()->user()->balance->amount;\n $newAmount = $currentBalance + $amount;\n auth()->user()->balance()->update(['amount' => $newAmount]);\n }",
"public function setAmount($amount)\n {\n $amount = floatval(str_replace(' ','',$amount));\n\n if (!Amount::validate($amount)) {\n throw new AmountException($amount);\n }\n $this->amount = $amount;\n\n return $this;\n }",
"public function setAmountAttribute($input)\n {\n $this->attributes['amount'] = $input ? $input : null;\n }",
"public function setAmount($amount)\n {\n try {\n $this->amount = Validation::getProperAmount($amount);\n return $this;\n } catch (\\InvalidArgumentException $iae) {\n throw $iae; // rethrow the exception to handle further up in the stack.\n }\n }",
"public function set_amountInvoice($amountInvoice) {\n $this->amountInvoice = (double)$amountInvoice;\n }",
"public function setCharges($charges)\n {\n $this->charges = $charges;\n }",
"public function setAmount($amount = 0, $wholeAmt) {\n $amt = array(\n 'x_amount'=>$this->cleanAmt($amount, $wholeAmt),\n );\n $this->NVP = array_merge($this->NVP, $amt); \n }",
"function deposit($amount) {\n $this->balance += $amount;\n }",
"public function setAmountCapAttribute($amount)\n {\n $this->attributes['amount_cap'] = formatAmount($amount);\n }",
"public function setBaseShippingAmount($amount);",
"public function setAmountAttribute($input)\n { \n $this->attributes['amount'] = $input ? $input : null;\n }",
"function SetAmountSoldOutside ($amount = 0) {\n\t\n}",
"public function setAwardAmount($value)\n {\n return $this->set('AwardAmount', $value);\n }",
"public function setBaseAmount($amount) {\r\n $this->baseAmount = NumberDataTypeHelper::truncate(floatval($amount), 2);\r\n }",
"public function withCharge($value)\n {\n $this->setCharge($value);\n return $this;\n }",
"public function setAmount(Money $amount): PricingTier\n {\n $this->offsetSet(self::AMOUNT, $amount);\n return $this;\n }",
"public function setBaseTaxAmount($amount);",
"protected function setTargetAmountAttribute($value)\n {\n $this->attributes['target_amount'] = preg_replace('/[,]/', '', $value);\n }",
"public function setStoneAmount($value)\n {\n return $this->set(self::_STONE_AMOUNT, $value);\n }",
"public function setAttackDamage(float $amount): void\n {\n $this->attackDamage = $amount;\n }",
"public function setAmount($value) {\n if(strlen($value) > 8 ){\n throw new ValueException(\"Value \".$value.\" is higher than 8\");\n }\n $this->Importe = number_format($value,$this->Exponente,'','');\n }",
"public function deposit($amount)\n {\n $this->balance += $amount;\n $this->save();\n }",
"public function setBaseShippingDiscountAmount($amount);",
"public function request($amount)\n {\n if (!\\is_numeric($amount)) {\n throw new \\InvalidArgumentException('The amount must be numeric');\n }\n\n $this->amount = $amount;\n\n return $this;\n }",
"public function request($amount)\n {\n if (!\\is_numeric($amount)) {\n throw new \\InvalidArgumentException('The amount must be numeric');\n }\n\n $this->amount = $amount;\n\n return $this;\n }",
"public function setShippingAmount($amount);",
"public function setPaymentAmountType($value)\n {\n $this->_fields['PaymentAmountType']['FieldValue'] = $value;\n return $this;\n }",
"public function set_amountCustomer($amountCustomer) {\n $this->amountCustomer = (double)$amountCustomer;\n }",
"public function times($amount)\n {\n $this->amount = $amount;\n\n return $this;\n }",
"public function updateCredits($amount)\n {\n return $this->credit()->update(['amount' => $amount]);\n }",
"public function setAmountAttribute($input)\n {\n if ($input != '') {\n $this->attributes['amount'] = $input;\n } else {\n $this->attributes['amount'] = null;\n }\n }",
"public function setCharges($charges);",
"public function addExpense($amount)\n {\n $account = Account::findOne([\n 'username' => $this->getCurrentUser()->username,\n ]);\n\n $account->balance -= $amount;\n\n $account->update(true, ['balance']);\n }",
"public function setPaymentAuthorizationAmount($amount);",
"public function setDiscountTaxCompensationAmount($amount);",
"public function setValue(string $value): AmountBuilderInterface\n {\n $this->amount->setValue($value);\n\n return $this;\n }",
"public function setBaseDiscountTaxCompensationAmount($amount);",
"public function setAmount(float $amount): InitAbstract\n\t{\n\t\tparent::setAmount($amount);\n\n\t\t$this->setData(null, 'minimumAmount');\n\t\t$this->setData(null, 'maximumAmount');\n\n\t\treturn $this;\n\t}",
"public function setFreeAfterAmountAttribute($amount)\n {\n $this->attributes['free_after_amount'] = formatAmount($amount);\n }",
"public function creditCard($amount)\n {\n if ($this->isValidCard)\n $this->balance -= $this->parseAmount($amount);\n }",
"public function setReimbursedAmount($value)\n {\n $this->_fields['ReimbursedAmount']['FieldValue'] = $value;\n return $this;\n }",
"public function setDisplayAmount($displayAmount);",
"public function setDisplayAmount($displayAmount);",
"public function credit(int $accountNumber, float $amount): void\n {\n $this->getAccount($accountNumber)->credit($amount);\n }"
]
| [
"0.7896932",
"0.7879314",
"0.775862",
"0.775862",
"0.77047336",
"0.7662618",
"0.7505507",
"0.73995864",
"0.7178216",
"0.7174205",
"0.71691644",
"0.71682084",
"0.71682084",
"0.71682084",
"0.71682084",
"0.7150268",
"0.7088638",
"0.7002675",
"0.69585377",
"0.6946819",
"0.69129676",
"0.6777057",
"0.6767641",
"0.67661446",
"0.6750967",
"0.6706792",
"0.6706792",
"0.6706683",
"0.6672976",
"0.66665566",
"0.6642629",
"0.66261923",
"0.6606484",
"0.660306",
"0.660306",
"0.660306",
"0.660306",
"0.6563762",
"0.63751525",
"0.6367763",
"0.6352448",
"0.6351094",
"0.6331678",
"0.6294751",
"0.6285516",
"0.6275127",
"0.62613726",
"0.6252844",
"0.6234597",
"0.62302125",
"0.6206855",
"0.6189263",
"0.618048",
"0.6162014",
"0.61603624",
"0.6142533",
"0.612445",
"0.60823196",
"0.60806525",
"0.6056736",
"0.605396",
"0.60454625",
"0.6042435",
"0.6022765",
"0.5976095",
"0.5975016",
"0.59711826",
"0.5963435",
"0.59562063",
"0.59550023",
"0.594266",
"0.59146947",
"0.59137475",
"0.58843046",
"0.58744",
"0.58569264",
"0.5856134",
"0.58523357",
"0.58441114",
"0.58441114",
"0.58330065",
"0.5832271",
"0.58298093",
"0.58181584",
"0.58168715",
"0.5800375",
"0.57972527",
"0.57910705",
"0.57860065",
"0.57558316",
"0.57548445",
"0.5742342",
"0.5742109",
"0.5732936",
"0.5724814",
"0.57178825",
"0.570943",
"0.570943",
"0.5704933"
]
| 0.6024503 | 63 |
Set Credit Card Sets the credit card information | public function CreditCard($name, $number, $exp_month, $exp_year, $security_code = FALSE) {
$number = str_replace(' ','',$number);
$number = trim($number);
$this->Param('name', $name, 'credit_card');
$this->Param('card_num', $number, 'credit_card');
$this->Param('exp_month', $exp_month, 'credit_card');
$this->Param('exp_year', $exp_year, 'credit_card');
if($security_code) {
$this->Param('cvv', $security_code, 'credit_card');
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCreditCardData($data=null) {\n if(!is_array($data)) {\n $p = $this->getPayment();\n $data = array(\n 'CREDITCARDTYPE' => $p['cardType'],\n 'ACCT' => $p['cardNumber'], //'4532497022010364',\n 'EXPDATE' => $p['cardExpirationMonth'] . $p['cardExpirationYear'],\n 'CVV2' => $p['securityId']\n );\n }\n $this->_creditCardData = $data;\n }",
"public function setCreditCard($card_id, $num, $cvv, $date)\n {\n $this->cardid = $card_id;\n $this->creditcard_number = $num;\n $this->cvv = $cvv;\n $this->validation_date = $date;\n }",
"function setCardnumber($cardnumber) {\n\t\tif (strlen($cardnumber)>=13 and strlen($cardnumber)<=16 and is_numeric($cardnumber)) {\n\t\t\t$this->cardnumber = $cardnumber;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Credit Card Number\";\n\t\t}\n\t}",
"function setCardnumber($cardnumber) {\n\t\tif (strlen($cardnumber)>=13 and strlen($cardnumber)<=16 and is_numeric($cardnumber)) {\n\t\t\t$this->cardnumber = $cardnumber;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Credit Card Number\";\n\t\t}\n\t}",
"public function setCard($parameters = NULL) {\n\n if ($parameters === NULL) {\n $this->card = $parameters;\n return;\n }\n\n if (is_array($parameters)) {\n $this->card = (empty($parameters) ? NULL : new CreditCard($parameters));\n }\n }",
"public function setCreditCard($creditCard)\n {\n $this->creditCard = $creditCard;\n\n return $this;\n }",
"public function setCredit($credit) {\n $this->data['credit'] = $credit;\n }",
"public function setCard(?bool $card): void\n {\n $this->card = $card;\n }",
"public function setCreditCard($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->credit_card !== $v) {\n\t\t\t$this->credit_card = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::CREDIT_CARD;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setCustomerCardId(?string $customerCardId): void\n {\n $this->customerCardId['value'] = $customerCardId;\n }",
"public function setCreditInfo() {\n\t\t$this->creditInfo = $this->photo['title'] . \" by \" . $this->userName;\n\t}",
"function setCC($cc){\n\t\t\t$this->cc = $cc;\n\t\t}",
"public function edit(CreditCard $creditCard)\n {\n //\n }",
"public function creditCardPayment()\n {\n }",
"public function setCreditCard(\n $number,\n $expirationMonth,\n $expirationYear,\n $holder_name\n )\n {\n $this->data->credit_card = new stdClass();\n $this->data->credit_card->number = $number;\n $this->data->credit_card->holder_name = $holder_name;\n $this->data->credit_card->expiration_month = $expirationMonth;\n $this->data->credit_card->expiration_year = $expirationYear;\n\n return $this;\n }",
"public function creditCard($amount)\n {\n if ($this->isValidCard)\n $this->balance -= $this->parseAmount($amount);\n }",
"public function setCreditCard($card_number,$card_exp_year_month,$card_cvc)\n {\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($card_number);\n $creditCard->setExpirationDate( $card_exp_year_month);\n $creditCard->setCardCode($card_cvc);\n // Add the payment data to a paymentType object\n $paymentType = new AnetAPI\\PaymentType();\n $paymentType->setCreditCard($creditCard);\n \n return $paymentType;\n }",
"public function editcardAction()\n {\n $isValidToken = false;\n $token = $this->getRequest()->getParam('t');\n $customer = $this->_getCustomer();\n $api = $this->_getApi();\n $paymentMethods = $api->getPaymentMethods($customer->getId(), true);\n \n foreach($paymentMethods as $key => $pm) {\n if($pm->getData('paymentMethodToken') == $token) {\n $isValidToken = true;\n }\n }\n \n if($isValidToken) {\n \n } else {\n Mage::getSingleton('core/session')->addError('Credit card token is not valid. Please try again.');\n $this->_redirect('payments/customer/creditcards');\n }\n \n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }",
"public function setCard(?string $card): self\n {\n $this->card = $card;\n\n return $this;\n }",
"public function setCardDetails($creditCardNo = null, $expiryMonth = null, $expiryYear = null, $cvv = null)\n {\n if ($expiryMonth != null) {\n $expiryMonth = Validation::getProperExiryMonth($expiryMonth);\n }\n if ($expiryYear != null) {\n $expiryYear = Validation::getProperExpiryYear($expiryYear);\n }\n if (!Validation::validateCardDetails($creditCardNo == null ? $this->creditCardNo : $creditCardNo, $expiryMonth == null ? $this->expiryMonth : $expiryMonth, $expiryYear == null ? $this->expiryYear : $expiryYear, $cvv == null ? $this->cvv : $cvv)) {\n throw new \\InvalidArgumentException(\"Invalid credit card details\");\n }\n if ($creditCardNo != null) {\n $creditCardNo = str_replace(\" \", \"\", $creditCardNo); // remove all spaces\n $creditCardNo = str_replace(\"-\", \"\", $creditCardNo); // remove all dashes\n if (!Validation::isSupportedCard($creditCardNo)) {\n throw new CardTypeUnsupportedException(\"Card type is unsupported.\");\n }\n }\n if ($creditCardNo != null)\n $this->creditCardNo = $creditCardNo;\n\n if ($expiryMonth != null)\n $this->expiryMonth = $expiryMonth;\n\n if ($expiryYear != null)\n $this->expiryYear = $expiryYear;\n\n if ($cvv != null)\n $this->cvv = $cvv;\n\n return $this;\n }",
"public function set_card(INT $_card){\n $this->_card = $_card;\n\n return $this;\n }",
"public function storeCreditCardWithNumberCard($token)\n {\n $user = User::find(\\Auth::user()->id);\n\n try {\n if (empty($user->stripe_id)) {\n $user->createAsStripeCustomer($token);\n } else {\n $user->updateCard($token);\n }\n } catch (\\Exception $ex) {\n \\Log::error(\"Can not update credit card. \" . $ex->getMessage());\n throw new UpdateCreditCardException();\n }\n }",
"public function setCardNonce(?string $cardNonce): void\n {\n $this->cardNonce['value'] = $cardNonce;\n }",
"public function editCustomerCreditCard($data) {\n\t\t$soapclient = new SoapClient($this->pci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'EziDebitCustomerID' => $data['eziDebitCID'],\n\t\t\t\t'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'NameOnCreditCard' => $data['cardName'],\n\t\t\t\t'CreditCardNumber' => $data['cardNumber'],\n\t\t\t\t'CreditCardExpiryYear' => $data['cardExpiryYear'],\n\t\t\t\t'CreditCardExpiryMonth' => $data['cardExpiryMonth'],\n\t\t\t\t'Reactivate' => $data['reactivate'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $soapclient->editCustomerCreditCard($params);\n\t}",
"function commerce_braintree_creditcard_edit_form($form, &$form_state, $sid) {\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n $form_state['build_info']['files']['form'] = drupal_get_path('module', 'commerce_braintree') . '/commerce_braintree.form.inc';\n $sub = commerce_braintree_subscription_local_get(array('sid' => $sid), FALSE);\n $payment = commerce_payment_method_instance_load('braintree|commerce_payment_braintree');\n $creditcard = commerce_braintree_creditcard_get_by_token($sub['token']);\n $billing_address = isset($creditcard->billingAddress) ? $creditcard->billingAddress : null;\n $form['payment_method'] = array(\n '#type' => 'fieldset', \n '#title' => t('Payment Method Details'),\n );\n $form['payment_method']['ca_cardholder_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Cardholder Name'),\n '#default_value' => isset($creditcard->cardholderName) ? $creditcard->cardholderName : '',\n );\n // NOTE: A hidden field is changable via Firebug. Value is not.\n // Because there's no validation, this would have allowed any user with access to this form\n // to change any credit card on the website for any user, providing they guess another ca_token.\n //$form['payment_method']['ca_token'] = array('#type' => 'value', '#value' => $token);\n $form['payment_method']['sid'] = array('#type' => 'value', '#value' => $sid);\n \n\n \n // Prepare the fields to include on the credit card form.\n $fields = array(\n 'code' => '',\n );\n\n // Add the credit card types array if necessary.\n $card_types = array_diff(array_values($payment['settings']['card_types']), array(0));\n if (!empty($card_types)) {\n $fields['type'] = $card_types;\n }\n \n $defaults = array(\n 'type' => isset($creditcard->cardType) ? $creditcard->cardType : '',\n 'number' => isset($creditcard->maskedNumber) ? $creditcard->maskedNumber : '', \n 'exp_month' => isset($creditcard->expirationMonth) ? $creditcard->expirationMonth : '', \n 'exp_year' => isset($creditcard->expirationYear) ? $creditcard->expirationYear : '',\n );\n \n // load oder\n $order = commerce_order_load($sub['order_id']);\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n // get profile id\n $profile_id = $order_wrapper->commerce_customer_billing->profile_id->value();\n \n // load customer profile\n $profile = commerce_customer_profile_load($profile_id);\n \n if (isset($profile->commerce_customer_address['und']['0']['first_name'])) {\n $profile->commerce_customer_address['und']['0']['first_name'] = isset($billing_address->firstName) ? $billing_address->firstName :'' ;\n }\n if (isset($profile->commerce_customer_address['und']['0']['last_name'])) {\n $profile->commerce_customer_address['und']['0']['last_name'] = isset($billing_address->lastName) ? $billing_address->lastName : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['organisation_name'])) {\n // //company\n $profile->commerce_customer_address['und']['0']['organisation_name'] = isset($billing_address->company) ? $billing_address->company :'';\n }\n if (isset($profile->commerce_customer_address['und']['0']['administrative_area'])) {\n //state\n $profile->commerce_customer_address['und']['0']['administrative_area'] = isset($billing_address->region) ? $billing_address->region : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['premise'])) {\n //address 2\n $profile->commerce_customer_address['und']['0']['premise'] = isset($billing_address->extendedAddress) ? $billing_address->extendedAddress : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['locality'])) {\n //city\n $profile->commerce_customer_address['und']['0']['locality'] = isset($billing_address->locality) ? $billing_address->locality : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['postal_code'])) {\n //postal code\n $profile->commerce_customer_address['und']['0']['postal_code'] = isset($billing_address->postalCode) ? $billing_address->postalCode : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['thoroughfare'])) {\n // address 1\n $profile->commerce_customer_address['und']['0']['thoroughfare'] = isset($billing_address->streetAddress) ? $billing_address->streetAddress : '';\n }\n \n // Add the field related form elements.\n $form_state['customer_profile'] = $profile;\n // Attach address field to form\n field_attach_form('commerce_customer_profile', $profile, $form, $form_state);\n $form['commerce_customer_address']['#weight'] = '0';\n $form['payment_method'] += commerce_payment_credit_card_form($fields, $defaults);\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n \n \n $form['#validate'][] = 'commerce_braintree_creditcard_edit_form_validate';\n $form['#submit'][] = 'commerce_braintree_creditcard_edit_form_submit';\n return $form;\n}",
"public function setCC()\n {\n }",
"function InfUpdateCreditCard($inf_card_id, $CardNumber='', $ExpirationMonth, $ExpirationYear, $NameOnCard, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->Id = $inf_card_id;\n\tif ($CreditCard<>\"\") {\n\t\t$credit_card->CardNumber = $CardNumber;\n\t}\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->NameOnCard = $NameOnCard;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\treturn $credit_card->save(); // Update Card in Infusionsoft\n}",
"public function __construct($card)\n {\n $this->card = $card;\n }",
"public function creditcardsAction() {\n if (!$this->_getSession()->isLoggedIn()) {\n $this->_redirect('customer/account/login');\n return;\n }\n\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getParams();\n if (isset($data)) {\n $result = $this->_save($data);\n switch ($result->getResponseCode()) {\n case self::RESPONSE_CODE_SUCCESS:\n Mage::getSingleton('core/session')->addSuccess('Credit card has been added.');\n break;\n case self::RESPONSE_CODE_FAILURE:\n Mage::getSingleton('core/session')->addError('Credit card has not been saved. Please try again.');\n break;\n }\n\n $this->_redirect('payments/customer/creditcards');\n }\n }\n\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }",
"public function getCreditCard()\n {\n return $this->creditCard;\n }",
"public function setCreditCardNo($creditCardNo)\n {\n $creditCardNo = str_replace(\" \", \"\", $creditCardNo); // remove all spaces\n $creditCardNo = str_replace(\"-\", \"\", $creditCardNo); // remove all dashes\n if (!Validation::validateCardDetails($creditCardNo, $this->expiryMonth, $this->expiryYear, $this->cvv)) {\n throw new \\InvalidArgumentException(\"Invalid credit card number\");\n }\n if (!Validation::isSupportedCard($creditCardNo)) {\n throw new CardTypeUnsupportedException(\"Card type is unsupported.\");\n }\n $this->creditCardNo = $creditCardNo;\n return $this;\n }",
"private function creditCardPayment($data)\n {\n $creditCard = $this->createSelling(new CreditCard, $data);\n\n // Set billing information for credit card\n $creditCard->setBilling()->setAddress()->withParameters(\n 'Av. Paulista',\n '1578',\n 'Bela Vista',\n '01310-200',\n 'São Paulo',\n 'SP',\n 'BRA',\n 'Museu'\n );\n\n $creditCard->setToken($data['cardToken']);\n\n // Set the installment quantity and value (could be obtained using the Installments\n // service, that have an example here in \\public\\getInstallments.php)\n $availableInstallments = $this->getInstallments($data['cardBrand']);\n\n $choosenInstallment = Arr::where($availableInstallments, function ($installment) use ($data) {\n return $installment->getQuantity() == $data['installments'];\n });\n $choosenInstallment = Arr::first($choosenInstallment);\n\n $creditCard->setInstallment()->withParameters(\n $choosenInstallment->getQuantity(),\n $choosenInstallment->getAmount(),\n $this->noInterestInstallments\n );\n\n // Set credit card holder information\n $creditCard->setHolder()->setBirthdate('01/01/2000');\n $creditCard->setHolder()->setName($data['cardName']); // Equals in Credit Card\n $creditCard->setHolder()->setPhone()->withParameters(\n 11,\n 999999999\n );\n $creditCard->setHolder()->setDocument()->withParameters(\n 'CPF',\n '10173649076'\n );\n\n try {\n // Get the crendentials and register the boleto payment\n $result = $creditCard->register(\n Configure::getAccountCredentials()\n );\n // code\n // grossAmount\n // netAmount\n // $pagamento = Pagamentos::create();\n // $pagamento->codigo_transacao = $result->getCode();\n // $pagamento->valor = $result->getGrossAmount();\n // $pagamento->valor_pagseguro = $result->getNetAmount();\n dd($result);\n } catch (Exception $e) {\n dd($e, 'Credit Card');\n }\n }",
"public function getCreditCardNumber()\n {\n return $this->creditCardNumber;\n }",
"public function creditcardAction()\r\n\t{\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('creditcarddetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"creditcard\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t\r\n\t\t\t $auth = Zend_Auth::getInstance();\r\n\t\t\t if($auth->hasIdentity())\r\n\t\t\t {\r\n\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{ \r\n\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t$creditcardDetailsform = new Default_Form_Creditcarddetails();\r\n\t\t\t\t\t\t$creditcardDetailsModel = new Default_Model_Creditcarddetails();\r\n\t\t\t\t\t\tif($id)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t$data = $creditcardDetailsModel->getcreditcarddetailsRecord($id);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"id\",$data[0][\"id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"user_id\",$data[0][\"user_id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_type\",$data[0][\"card_type\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_number\",$data[0][\"card_number\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"nameoncard\",$data[0][\"nameoncard\"]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$expiry_date = sapp_Global::change_date($data[0][\"card_expiration\"],'view');\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault('card_expiration', $expiry_date);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_issuedby\",$data[0][\"card_issued_comp\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_code\",$data[0][\"card_code\"]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$creditcardDetailsform->setAttrib('action',BASE_URL.'mydetails/creditcard/');\r\n\t\t\t\t\t\t\t$this->view->id=$id;\r\n\t\t\t\t\t\t\t$this->view->form = $creditcardDetailsform;\r\n\t\t\t\t\t\t\t$this->view->data=$data;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($this->getRequest()->getPost())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result = $this->save($creditcardDetailsform,$tabName);\t\r\n\t\t\t\t\t\t\t$this->view->msgarray = $result; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata; \r\n\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t}\t\t\t\r\n\t}",
"function add_credit_card($contact_id,$data)\n {\n $last_4 = substr($data['CardNumber'],-4);\n $cc_id = $this->locateCard($contact_id,$last_4);\n\n if($cc_id == 0) //Doesn't Exist\n {\n //Add Card\n $cc_id = $this->dsAdd('CreditCard',$data);\n return $cc_id;\n }\n elseif($cc_id > 0)\n {\n //Check if card as same expiration date\n $card_data = $this->dsLoad('CreditCard',$cc_id,array('ExpirationMonth','ExpirationYear'));\n if(\n $card_data['ExpirationMonth'] == $data['ExpirationMonth'] &&\n $card_data['ExpirationYear'] == $data['ExpirationMonth']) {\n return $cc_id;\n }\n else\n {\n //Update CC Dates\n return $this->dsUpdate('CreditCard',$cc_id,array('ExpirationYear' => $data['ExpirationYear'],'ExpirationMonth' => $data['ExpirationMonth']));\n }\n\n\n }\n else\n {\n return FALSE;\n }\n\n }",
"public function saveAction()\n {\n $postData = $this->getRequest()->getPost();\n\n if ($profileId = $this->getRequest()->getParam('id')) {\n $model = Mage::getModel('authnettoken/cim_payment_profile')->load($profileId);\n }\n else {\n $model = Mage::getModel('authnettoken/cim_payment_profile');\n }\n\n if ($postData) {\n\n try {\n try {\n // Save post data to model\n $model->addData($postData);\n // Now try to save payment profile to Auth.net CIM\n $model->saveCimProfileData(true);\n }\n catch (SFC_AuthnetToken_Helper_Cim_Exception $eCim) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to save credit card to Authorize.Net CIM!');\n if ($eCim->getResponse() != null) {\n Mage::getSingleton('adminhtml/session')->addError('CIM Result Code: ' . $eCim->getResponse()->getResultCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Code: ' .\n $eCim->getResponse()->getMessageCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Text: ' .\n $eCim->getResponse()->getMessageText());\n }\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $postData['customer_id']));\n\n return;\n }\n\n // Now save model\n $model->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('adminhtml')->__('Saved credit card ' . $model->getCustomerCardnumber() . '.'));\n Mage::getSingleton('adminhtml/session')->setCustomerData(false);\n\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $model->getId()));\n\n return;\n }\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $model->getCustomerId()));\n\n return;\n }\n catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to save credit card!');\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $postData['customer_id']));\n }\n }\n\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile', array('id' => $postData['customer_id']));\n }",
"function update_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no'; \n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"creditcards \n SET creditcard_number = '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n creditcard_type = '\" . mb_strtolower($form['type']) . \"',\n date_updated = '\" . DATETIME24H . \"',\n creditcard_expiry = '\" . $form['expmon'] . $form['expyear'] . \"',\n cvv2 = '\" . $ilance->db->escape_string($form['cvv2']) . \"',\n name_on_card = '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n phone_of_cardowner = '\" . $ilance->db->escape_string($form['phone']) . \"',\n email_of_cardowner = '\" . $ilance->db->escape_string($form['email']) . \"',\n card_billing_address1 = '\" . $ilance->db->escape_string($form['address1']) . \"',\n card_billing_address2 = '\" . $ilance->db->escape_string($form['address2']) . \"',\n card_city = '\" . $ilance->db->escape_string($form['city']) . \"',\n card_state = '\" . $ilance->db->escape_string($form['state']) . \"',\n card_postalzip = '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n card_country = '\" . $ilance->db->escape_string($form['countryid']) . \"',\n authorized = '\" . $ilance->db->escape_string($form['authorized']) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n AND cc_id = '\" . $ilance->db->escape_string($form['cc_id']) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_updated_creditcard');\t\t\n $ilance->email->set(array(\n '{{member}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }",
"public function setUseCreditCard($useCreditCard)\n {\n $this->useCreditCard = $useCreditCard;\n return $this;\n }",
"public function update(Request $request, CreditCard $creditCard)\n {\n //\n }",
"function commerce_braintree_creditcard_edit_form_submit($form, &$form_state) {\n $sub = commerce_braintree_subscription_local_get(array('sid' => $form_state['values']['sid']), FALSE);\n $token = $sub['token'];\n $commerce_customer_address = $form_state['values']['commerce_customer_address']['und'][0];\n //billing address\n $billing_address['firstName'] = isset($commerce_customer_address['first_name']) ? $commerce_customer_address['first_name'] : '';\n $billing_address['lastName'] = isset($commerce_customer_address['last_name']) ? $commerce_customer_address['last_name'] : '';\n $billing_address['company'] = isset($commerce_customer_address['organisation_name']) ? $commerce_customer_address['organisation_name'] : '';\n $billing_address['streetAddress'] = isset($commerce_customer_address['thoroughfare']) ? $commerce_customer_address['thoroughfare'] : '';\n $billing_address['extendedAddress'] = isset($commerce_customer_address['premise']) ? $commerce_customer_address['premise'] : '';\n $billing_address['locality'] = isset($commerce_customer_address['locality']) ? $commerce_customer_address['locality'] : '';\n $billing_address['region'] = isset($commerce_customer_address['administrative_area']) ? $commerce_customer_address['administrative_area'] : '';\n $billing_address['postalCode'] = isset($commerce_customer_address['postal_code']) ? $commerce_customer_address['postal_code'] : '';\n $billing_address['countryCodeAlpha2'] = isset($commerce_customer_address['country']) ? $commerce_customer_address['country'] : '';\n \n //creditcard\n $creditcard['cardholderName'] = $form_state['values']['ca_cardholder_name'];\n $creditcard['number'] = $form_state['values']['credit_card']['number'];\n $creditcard['cvv'] = $form_state['values']['credit_card']['code'];\n $creditcard['expirationDate'] = $form_state['values']['credit_card']['exp_month'];\n $creditcard['expirationDate'] .= '/' . $form_state['values']['credit_card']['exp_year'];\n $creditcard['billingAddress'] = $billing_address;\n $creditcard['options'] = array('verifyCard' => TRUE);\n $creditcard['billingAddress']['options'] = array('updateExisting' => TRUE);\n \n $card = commerce_braintree_credit_card_update($creditcard, $token);\n if ($card->success) {\n drupal_set_message(t('Updated Successfull.'));\n return;\n }\n drupal_set_message(t('There are error. @errors', array('@errors' => commerce_braintree_get_errors($card))), 'error');\n}",
"private function addCreditcard(CreditCard $creditcard)\n {\n if (null === $creditcard->token) {\n # No token available.\n $this->post['card']['number'] = $creditcard->number;\n $this->post['card']['expiry_month'] = $creditcard->month;\n $this->post['card']['expiry_year'] = $creditcard->year;\n $this->post['card']['cvc'] = $creditcard->verification_value;\n $this->post['card']['name'] = $creditcard->name();\n\n return;\n }\n\n if (strpos($creditcard->token, 'card_') === 0) {\n return $this->post['card_token'] = $creditcard->token;\n }\n\n if (strpos($creditcard->token, 'cus_') === 0) {\n return $this->post['customer_token'] = $creditcard->token;\n }\n }",
"public function changeCreaditCard(){\n return View::make('user.change_credit_card')->with(array('title_for_layout' => 'Thay đổi thẻ tín dụng'));\n }",
"public function setIdCard($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->id_card !== $v) {\n $this->id_card = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_ID_CARD] = true;\n }\n\n return $this;\n }",
"public function getCreditCard()\n\t{\n\t\treturn $this->credit_card;\n\t}",
"public function createCreditCard(CreditCard $creditCard): CreditCard;",
"function InfAddCreditCard($inf_contact_id, $CardNumber, $ExpirationMonth, $ExpirationYear, $CVV2, $BillName, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->ContactId = $inf_contact_id;\n\t$credit_card->CardNumber = $CardNumber;\n\t$credit_card->CVV2 = $CVV2;\n\t$credit_card->CardType = WriteCardType($CardNumber);\n#\t$credit_card->Status = 3; //0: Unknown, 1: Invalid, 2: Deleted, 3: Valid/Good, 4: Inactive\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->BillName = $BillName;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\t\n\t# Return card id\n\treturn $credit_card->save();\n}",
"public function action_addcreditcard() {\n $package = Model::factory('package');\n $btn_card_confirm = arr::get($_REQUEST, 'btn_card_confirm');\n $config_country['taxicountry'] = $this->country_info();\n $this->session = Session::instance();\n $errors = array();\n $userid = $this->session->get('userid');\n $postvalue = Arr::map('trim', $this->request->post());\n\n $getadmin_profile_info = $package->getadmin_profile_info();\n\n\n $post_values = Securityvalid::sanitize_inputs($postvalue);\n $billing_card_info_details = $package->billing_card_info_details();\n if (empty($billing_card_info_details)) {\n $billing_info_id = '';\n } else {\n $billing_info_id = $billing_card_info_details[0]['_id'];\n }\n if (isset($btn_card_confirm) && Validation::factory($_POST)) {\n $validator = $package->upgrade_plan_validate(arr::extract($post_values, array('cardnumber', 'cvv', 'expirydate', 'firstName', 'lastname', 'address', 'postal_code', 'terms', 'country', 'state', 'city')), $userid);\n if ($validator->check()) {\n $cardnumber = $postvalue['cardnumber'];\n $cvv = $postvalue['cvv'];\n $expirydate = explode('/', $postvalue['expirydate']);\n $firstname = $postvalue['firstName'];\n $lastname = $postvalue['lastname'];\n $address = $postvalue['address'];\n $city = $postvalue['city'];\n $country = $postvalue['country'];\n $state = $postvalue['state'];\n $postal_code = $postvalue['postal_code'];\n $package_upgrade_time = PACKAGE_UPGRADE_TIME;\n $cardnumber = preg_replace('/\\s+/', '', $cardnumber);\n \n $this->billing_info['card_number'] = $cardnumber;\n $this->billing_info['cvv'] = $cvv;\n $this->billing_info['expirationMonth'] = $expirydate[0];\n $this->billing_info['expirationYear'] = $expirydate[1];\n $this->billing_info['firstName'] = $firstname;\n $this->billing_info['lastname'] = $lastname;\n $this->billing_info['address'] = $address;\n $this->billing_info['city'] = $city;\n $this->billing_info['country'] = $country;\n $this->billing_info['state'] = $state;\n $this->billing_info['postal_code'] = $postal_code;\n $this->billing_info['createdate'] = $package_upgrade_time; \n $this->billing_info['currency']=CLOUD_CURRENCY_FORMAT; \n $billing_info_reg = $package->billing_registration($this->billing_info, $billing_info_id);\n if ($billing_info_reg) {\n Message::success(__('billing_updated_sucessfully'));\n }\n } else {\n $errors = $validator->errors('errors');\n }\n }\n $view = View::factory(ADMINVIEW . 'package_plan/addcreditcard')\n ->bind('postedvalues', $this->userPost)\n ->bind('errors', $errors)\n ->bind('getadmin_profile_info', $getadmin_profile_info)\n ->bind('subscription_cost_month', $subscription_cost_month)\n ->bind('billing_card_info_details', $billing_card_info_details)\n ->bind('all_country_list', $config_country['taxicountry'])\n ->bind('setup_cost', $setup_cost)\n ->bind('postvalue', $post_values);\n $this->template->title = CLOUD_SITENAME . \" | \" . __('add_credit_card');\n $this->template->page_title = __('add_credit_card');\n $this->template->content = $view;\n }",
"public function giveCard(Card $card)\n\t{\n\t\t$card->setGiven(true);\n\t\t$this->save($card, false);\n\t}",
"function chargeCreditCard()\n{\n\t \n\t$insert_id = $this->session->userdata('recent_reg_id');\n\t$current_login_user = $this->common_front_model->get_session_data();\n\t$inputData=$this->input->post();\n\n\t//print_r($current_login_user);\n\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"9zyp7U9TTQ\");\n $merchantAuthentication->setTransactionKey(\"8hFVee23p993GVVa\");\n \n // Set the transaction's refId\n $refId = $current_login_user['matri_id'].'-' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($inputData['card_number']);\n $creditCard->setExpirationDate($inputData['year'].\"-\".$inputData['month']);\n $creditCard->setCardCode($inputData['cvv']);\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber($refId);\n $order->setDescription(\"Membership Renewal-\".$inputData['plan_name']);\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($inputData['name_on_card']);\n // $customerAddress->setLastName($current_login_user['lastname']);\n // $customerAddress->setCompany($current_login_user['username']);\n //$customerAddress->setAddress(\"14 Main Street\");\n // $customerAddress->setCity(\"Pecan Springs\");\n //$customerAddress->setState(\"TX\");\n // $customerAddress->setZip(\"44628\");\n // $customerAddress->setCountry(\"USA\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId($current_login_user['matri_id']);\n $customerData->setEmail($current_login_user['email']);\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n $transactionRequestType->setAmount($inputData['plan_amount']);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\t//print_r($request);\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n \n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) {\n //echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n // echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n // echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n // echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n\t\t\t\t//echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n\t\t\t\t//$this->data['status']=\"Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n\t\t\t\t//$status=\"success\";\n\t\t\t\t$this->payment_status(\"authorize\");\n\t\t\t\treturn true;\n\t\t\t\t\n } else {\n //echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n // echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n\n } else {\n // echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n\t\t\t//\techo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n } else {\n echo \"No response returned \\n\";\n }\n\n\t//return $response;\n\t\n\t\t\t\t$this->common_model->front_load_header('Payment Success');\n\t\t\t\tif($status=='success'){\n\t\t\t\t\t$this->load->view('front_end/payment_success',$this->data);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->load->view('front_end/payment_fail',$this->data);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->common_model->front_load_footer();\n}",
"public function setCidCard($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cid_card !== $v) {\n $this->cid_card = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_CID_CARD] = true;\n }\n\n return $this;\n }",
"public function setCardInfo($dat,$key = false){\n if($key){\n $this->_cardinfo[$key] = $dat;\n }else{\n $this->_cardinfo = $dat;\n }\n }",
"public function setCardnumber($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cardnumber !== $v) {\n $this->cardnumber = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_CARDNUMBER] = true;\n }\n\n return $this;\n }",
"public function show(CreditCard $creditCard)\n {\n //\n }",
"public function processCreditCard()\n {\n $this->load();\n\n $multiBuyer = new MultiBuyer($this->request, [self::INDEX_CREDIT_CARD]);\n $multiBuyerCustomer = $multiBuyer->createCustomers();\n\n if (!$this->isValidateCreditCardRequest()) {\n Log::create()\n ->error(LogMessages::INVALID_CREDIT_CARD_REQUEST, __METHOD__)\n ->withOrderId($this->session->data['order_id']);\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $card = $this->fillCreditCardData(0);\n $orderData = $this->model_checkout_order->getOrder($this->session->data['order_id']);\n $orderData['saveCreditCard'] = $card['saveThisCard'];\n\n try {\n $response = $this->createCreditCardOrder(\n (double)$card['paymentDetails'][2],\n $card['paymentDetails'][0],\n $orderData,\n $card['cardToken'],\n [$card['cardId']],\n isset($multiBuyerCustomer[0]) ? $multiBuyerCustomer[0] : null\n );\n } catch (Exception $e) {\n Log::create()\n ->error(LogMessages::UNABLE_TO_CREATE_ORDER, __METHOD__)\n ->withOrderId($this->session->data['order_id'])\n ->withException($e);\n\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $orderStatus = $this->getOrder()->translateStatusFromMP($response);\n if (!$orderStatus) {\n Log::create()\n ->error(LogMessages::UNKNOWN_ORDER_STATUS, __METHOD__)\n ->withResponseStatus($response->status)\n ->withOrderId($this->session->data['order_id']);\n\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $orderComment = $this->data['order_statuses'][$response->status];\n\n $newOrder = $this->getOrder();\n $newOrder->updateOrderStatus($orderStatus, $orderComment);\n\n $this->saveMPOrderId($response->id, $this->session->data['order_id']);\n\n $this->saveOrderCreditcardInfo($response->charges[0]);\n\n $this->response->redirect($this->url->link('checkout/success', '', true));\n }",
"public function setCCNumber($number = '') {\n $cc = array(\n 'x_card_num'=>$this->cleanCCNumber($number),\n );\n $this->NVP = array_merge($this->NVP, $cc); \n }",
"protected function submitCreditCardForm(array $element, FormStateInterface $form_state) {\n\n $values = $form_state->getValue($element['#parents']);\n \n $this->entity->card_type = $values['type'];\n $this->entity->card_number = substr($values['number'], -4);\n $this->entity->card_exp_month = $values['expiration']['month'];\n $this->entity->card_exp_year = $values['expiration']['year'];\n $this->entity->cpf = $values['information']['cpf'];\n $this->entity->birth_date = $values['information']['birth_date'];\n $this->entity->card_holder_name = $values['card_holder_name'];\n $this->entity->sender_hash = $values['sender_hash'];\n $this->entity->card_hash = $values['card_hash'];\n $this->entity->card_brand = $values['card_brand'];\n $this->entity->installments = $values['installments'];\n }",
"function edds_credit_card_form( $echo = true ) {\n\n\tglobal $edd_options;\n\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contact support.', 'edds' ) );\n\t\treturn;\n\t}\n\n\tob_start(); ?>\n\n\t<?php if ( ! wp_script_is ( 'edd-stripe-js' ) ) : ?>\n\t\t<?php edd_stripe_js( true ); ?>\n\t<?php endif; ?>\n\n\t<?php do_action( 'edd_before_cc_fields' ); ?>\n\n\t<fieldset id=\"edd_cc_fields\" class=\"edd-do-validate\">\n\t\t<legend><?php _e( 'Credit Card Info', 'edds' ); ?></legend>\n\t\t<?php if( is_ssl() ) : ?>\n\t\t\t<div id=\"edd_secure_site_wrapper\">\n\t\t\t\t<span class=\"padlock\">\n\t\t\t\t\t<svg class=\"edd-icon edd-icon-lock\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"28\" viewBox=\"0 0 18 28\" aria-hidden=\"true\">\n\t\t\t\t\t\t<path d=\"M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9c0 .828-.672 1.5-1.5 1.5h-15C.672 24 0 23.328 0 22.5v-9c0-.828.672-1.5 1.5-1.5H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5c.828 0 1.5.672 1.5 1.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'edds' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\t\t?>\n\t\t<?php if ( ! empty( $existing_cards ) ) { edd_stripe_existing_card_field_radio( get_current_user_id() ); } ?>\n\n\t\t<div class=\"edd-stripe-new-card\" <?php if ( ! empty( $existing_cards ) ) { echo 'style=\"display: none;\"'; } ?>>\n\t\t\t<?php do_action( 'edd_stripe_new_card_form' ); ?>\n\t\t\t<?php do_action( 'edd_after_cc_expiration' ); ?>\n\t\t</div>\n\n\t</fieldset>\n\t<?php\n\n\tdo_action( 'edd_after_cc_fields' );\n\n\t$form = ob_get_clean();\n\n\tif ( false !== $echo ) {\n\t\techo $form;\n\t}\n\n\treturn $form;\n}",
"public function stripe_credit_card(Request $request, $subscription_uid) {\n $subscription = \\Acelle\\Model\\Subscription::findByUid($subscription_uid);\n $order_id = $subscription->getOrderID();\n $result = null;\n\n // Check billing information\n if( $this->checkBillingInformation($request, $subscription) !== true ) {\n return redirect()->away($this->checkBillingInformation($request, $subscription));\n }\n\n $payment_method = \\Acelle\\Model\\PaymentMethod::getByType(\\Acelle\\Model\\PaymentMethod::TYPE_STRIPE_CREDIT_CARD);\n $apiSecretKey = $payment_method->getOption('api_secret_key');\n $apiPublishableKey = $payment_method->getOption('api_publishable_key');\n\n try {\n \\Stripe\\Stripe::setApiKey($apiSecretKey);\n\n // validate and save posted data\n if ($request->isMethod('post')) {\n\n // Token is created using Stripe.js or Checkout!\n // Get the payment token submitted by the form:\n $token = $request->stripeToken;\n\n // Charge the user's card:\n $result = \\Stripe\\Charge::create(array(\n \"amount\" => $subscription->stripePrice(),\n \"currency\" => $subscription->currency_code,\n \"description\" => trans('messages.stripe_checkout_description', ['order' => $order_id]),\n \"source\" => $token,\n ));\n\n $payment = new Payment();\n $payment->subscription_id = $subscription->id;\n $payment->payment_method_id = $payment_method->id;\n $payment->data = serialize($result);\n $payment->status = 'success';\n $payment->action = \\Acelle\\Model\\Payment::ACTION_PAID;\n $payment->payment_method_name = trans('messages.' . $payment_method->type);\n $payment->order_id = $order_id;\n\n // billing information\n $billing_information = $request->session()->get('billing_information');\n if (isset($billing_information)) {\n $payment->tax_number = $billing_information['tax_number'];\n $payment->billing_address = $billing_information['billing_address'];\n $request->session()->forget('billing_information');\n }\n\n $payment->save();\n $subscription->setPaid();\n\n // try enabling the subscription, proceed anyway if failed\n try {\n $subscription->enable();\n } catch (\\Exception $ex) {\n // just suppress the error and leave the subscription disabled\n LaravelLog::warning(\"Cannot enable subscription {$subscription->id}, proceed anyway\");\n }\n\n return redirect()->action('PaymentController@success', $subscription->uid);\n }\n\n } catch(\\Stripe_CardError $e) {\n $error_message = \"\";\n // Since it's a decline, Stripe_CardError will be caught\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n $error_message .= 'Status is:' . $e->getHttpStatus() . \"\\n\";\n $error_message .= 'Type is:' . $err['type'] . \"\\n\";\n $error_message .= 'Code is:' . $err['code'] . \"\\n\";\n // param is '' in this case\n $error_message .= 'Param is:' . $err['param'] . \"\\n\";\n $error_message .= 'Message is:' . $err['message'] . \"\\n\";\n } catch (\\Stripe_InvalidRequestError $e) {\n $error_message = $e->getMessage();\n } catch (\\Stripe_AuthenticationError $e) {\n // Authentication with Stripe's API failed\n // (maybe you changed API keys recently)\n $error_message = $e->getMessage();\n } catch (\\Stripe_ApiConnectionError $e) {\n // Network communication with Stripe failed\n } catch (\\Stripe_Error $e) {\n // Display a very generic error to the user, and maybe send\n // yourself an email\n $error_message = $e->getMessage();\n } catch (\\Exception $e) {\n // Something else happened, completely unrelated to Stripe\n $error_message = $e->getMessage();\n }\n\n if (isset($error_message)) {\n PaymentLog::error(trans('messages.something_went_wrong_with_payment') . ': ' .$error_message);\n return view('somethingWentWrong', ['message' => trans('messages.something_went_wrong_with_payment', ['error' => $error_message])]);\n }\n\n return view('payments.stripe_credit_card', [\n 'subscription' => $subscription,\n 'apiPublishableKey' => $apiPublishableKey,\n 'result' => $result,\n 'payment_method' => $payment_method,\n ]);\n }",
"public function setCard($index,Card $val) :void\n {\n if($index>=0 && $index<=47)\n $this->cards[$index]=$val;\n }",
"public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}",
"public function setCardcode($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cardcode !== $v) {\n $this->cardcode = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_CARDCODE] = true;\n }\n\n return $this;\n }",
"public function postEditCard(EditCardRequest $request)\n {\n try {\n $expiry = explode('/', $request->expiry);\n $month = $expiry[0];\n $year = $expiry[1];\n $customerId = RecruiterProfile::where(['user_id' => Auth::user()->id])->pluck('customer_id');\n $customer = \\Stripe\\Customer::retrieve($customerId[0]);\n $card = $customer->sources->retrieve($request->cardId);\n $card->exp_month = $month;\n $card->exp_year = $year;\n $card->save();\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.card_edidted');\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }",
"public function setGiftcardAmount($value);",
"public function credit ($number)\n {\n $req = new FortieRequest();\n $req->method('PUT');\n $req->path($this->basePath)->path($number)->path('credit');\n\n return $this->send($req->build());\n }",
"public function setCreditCardToken($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->credit_card_token !== $v) {\n\t\t\t$this->credit_card_token = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::CREDIT_CARD_TOKEN;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function editCustomerAction(Request $request, Card $card)\n {\n $customer = $card->getCustomer();\n $form = $this->createForm(CustomerType::class, $customer);\n $form->handleRequest($request);\n\n if($form->isSubmitted() && $form->isValid()){\n $birthday = $request->request->get('appbundle_customer')['birthday'];\n $customer->setBirthday(new \\DateTime($birthday));\n $em = $this->getDoctrine()->getManager();\n $em->persist($customer);\n $em->flush();\n\n $this->addFlash('success', \"The customer's informations were modified.\");\n\n return $this->redirectToRoute('staff_customer_view', [\n 'number' => $card->getNumber()\n ]);\n }\n\n return $this->render('staff/customer/edit_customer.html.twig', array(\n \"form\" => $form->createView(),\n \"customer\" => $customer\n ));\n }",
"public function setCreditCardSecurity($creditCardSecurity)\n {\n $this->creditCardSecurity = $creditCardSecurity;\n\n return $this;\n }",
"public function setCustomGiftcardAmount($value);",
"public function createCreditCardProfile(int $authNetCustId, CreditCardInterface $creditCard);",
"public function newPostAction()\n {\n // The card\n $card = Mage::getModel('mbiz_cc/cc');\n\n try {\n $post = $this->getRequest()->getPost();\n\n $card->setData(array(\n 'customer' => $this->_getCustomerSession()->getCustomer(),\n 'dateval' => isset($post['dateval-month'], $post['dateval-year']) ? sprintf('%02d%02d', (int) $post['dateval-month'], $post['dateval-year'] - 2000) : null,\n 'cvv' => isset($post['cvv']) ? $post['cvv'] : null,\n 'type' => isset($post['type']) ? $post['type'] : null,\n 'owner' => isset($post['owner']) ? $post['owner'] : null,\n 'number' => isset($post['number']) ? $post['number'] : null,\n ));\n\n /* INFO:\n * To specify the token you can use the event \"cc_validate_before\"\n */\n\n $errors = $card->validate();\n\n if ($errors) {\n foreach ($errors as $error) {\n $this->_getSession()->addError($error);\n }\n } else {\n $card->save();\n $this->_getSession()->addSuccess($this->__('Credit card saved successfully.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n\n $this->_redirect('customer/cc/index');\n }",
"public function assignData( $data ) {\r\n\t\tparent::assignData( $data );\r\n\t\t\r\n\t\t$post = Mage::app()->getRequest()->getParam('payment');\r\n\t\t\r\n\t\tif( !empty( $post['payment_id'] ) ) {\r\n\t\t\t$card = $this->getPaymentInfoById( $post['payment_id'], false );\r\n\t\t\t\r\n\t\t\tif( $card && $card->getCardNumber() != '' ) {\r\n\t\t\t\t$this->getInfoInstance()->setCcLast4( substr( $card->getCardNumber(), -4 ) )\r\n\t\t\t\t\t\t\t\t\t\t->setCcType( '' );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"public function unsetCustomerCardId(): void\n {\n $this->customerCardId = [];\n }",
"function setCurrencyCode($currencycode) {\n\t\tif (strlen($currencycode) == 3) {\n\t\t\t$this->currencycode = $currencycode;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Currency Code\";\n\t\t}\n\t}",
"function setCurrencyCode($currencycode) {\n\t\tif (strlen($currencycode) == 3) {\n\t\t\t$this->currencycode = $currencycode;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Currency Code\";\n\t\t}\n\t}",
"public function storeCreditCard($obj) {\n if($obj){\n $cc_id = CreditCard::create(array(\n 'type' => $obj-> type,\n 'number' => $obj-> number,\n 'name' => $obj-> name,\n 'expirationDate' => $obj-> expirationDate\n ))->id;\n return $cc_id;\n }\n\n }",
"public function chargeCard($amount)\n {\n if ($this->isValidCard)\n $this->balance += $this->parseAmount($amount);\n }",
"function insert_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n $form['creditcard_status'] = 'active';\n $form['default_card'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no';\n }\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"creditcards\n (cc_id, date_added, date_updated, user_id, creditcard_number, creditcard_expiry, cvv2, name_on_card, phone_of_cardowner, email_of_cardowner, card_billing_address1, card_billing_address2, card_city, card_state, card_postalzip, card_country, creditcard_status, default_card, creditcard_type, authorized) \n VALUES(\n NULL,\n '\" . DATETIME24H . \"',\n '\" . DATETIME24H . \"',\n '\" . intval($userid) . \"',\n '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n '\" . $ilance->db->escape_string($form['expmon'] . $form['expyear']) . \"',\n '\" . intval($form['cvv2']) . \"',\n '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n '\" . $ilance->db->escape_string($form['phone']) . \"',\n '\" . $ilance->db->escape_string($form['email']) . \"',\n '\" . $ilance->db->escape_string($form['address1']) . \"',\n '\" . $ilance->db->escape_string($form['address2']) . \"',\n '\" . $ilance->db->escape_string($form['city']) . \"',\n '\" . $ilance->db->escape_string($form['state']) . \"',\n '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n '\" . $ilance->db->escape_string($form['countryid']) . \"',\n '\" . $ilance->db->escape_string($form['creditcard_status']) . \"',\n '\" . $ilance->db->escape_string($form['default_card']) . \"',\n '\" . $ilance->db->escape_string($form['type']) . \"',\n '\" . $ilance->db->escape_string($form['authorized']) . \"')\n \", 0, null, __FILE__, __LINE__);\n $cc_id = $ilance->db->insert_id(); \n $ilance->email->mail = fetch_user('email', $userid);\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_added_new_card');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('member_added_new_card_admin');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n return true;\n }",
"function addCreditCard($userDetails){\n\ttry{\n\t\t$cardRegister = new \\MangoPay\\CardRegistration();\n\t\t$cardRegister->UserId \t= $userDetails['userAccountId'];\n\t\t$cardRegister->Currency = $userDetails['userCurrency'];\n\t\t$createdCardRegister = $mangoPayApi->CardRegistrations->Create($cardRegister);\n\t\t$data\n\t\t\n\t\t$handle = curl_init();\n\t\tcurl_setopt($handle, CURLOPT_URL, $url);\n\t\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($handle, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); \n\t\tcurl_setopt($handle, CURLOPT_POST, true);\n\t\tcurl_setopt($handle, CURLOPT_POSTFIELDS, $data);\n\t\t$response = curl_exec($handle);\n\t\t\n\t\t\n\t\t\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t}\n\n}",
"private function createCreditCard($credit_card_details)\n {\n $creditCard = new CreditCardType();\n $creditCard->setCardNumber($credit_card_details->getCardNumber());\n $creditCard->setExpirationDate(\"XXXX\");\n $this->payment_data = new PaymentType();\n $this->payment_data->setCreditCard($creditCard);\n\n return true;\n }",
"public function testCardCustomer()\r\n {\r\n $card = new Card();\r\n $card->setCodeCard('1230456789');\r\n $customer = new Customer();\r\n $customer->setFirstName('Antoine');\r\n\r\n #Mock du repository\r\n $repository = $this->createMock(ObjectRepository::class);\r\n $repository->expects($this->any())\r\n ->method('findby')\r\n ->willReturn(null);\r\n\r\n # Mock du EntityManager\r\n $em = $this->createMock(EntityManagerInterface::class);\r\n $em->expects($this->any())\r\n ->method('getRepository')\r\n ->willReturn($repository);\r\n # On mock le cardPDF et UrlGeneratorInterface\r\n $cardPDF = $this->createMock(CardPdf::class);\r\n $urlGeneratorInterface = $this->createMock(UrlGeneratorInterface::class);\r\n\r\n # On mock le workflow\r\n $workflow = $this->createMock(WorkflowInterface::class);\r\n $workflow->expects($this->any())\r\n ->method('can')\r\n ->willReturn(true);\r\n\r\n $cm = new CardManager($em, $cardPDF, $urlGeneratorInterface, $workflow);\r\n\r\n $cm->setCardCustomer($card, $customer);\r\n $this->assertSame('Antoine', $card->getCustomer()->getFirstName());\r\n }",
"public function addNewCardToCustomer($card) {\n\n\t\treturn $this->request('/card', $card, 'POST');\n\t}",
"public function __construct($cardNo)\n {\n $this->cardNo = $cardNo;\n }",
"public function getCardcode()\n {\n return $this->cardcode;\n }",
"public function creditCardSale($extinfo,$mobileid,$userid,$creditcard,$amount,$name_on_card,$expire_month,$expire_year,$cvv2,$zip,$address,$state,$type,$processor) {\n $processor_transaction_id = App_Transaction_Transaction::GetProcessorTransactionId($mobileid);\n $extinfo[\"processor_transaction_id\"] = $processor_transaction_id;\n\n //Use WigiSafe client to take out that much money\n $wsc = new App_WigiSafeClient();\n $res = $wsc->creditCardSale($processor_transaction_id,$amount,$name_on_card,$expire_month,$expire_year,$cvv2,$zip,$address,$state,$creditcard,$zip,$address,$state,$type,$processor);\n if (!$res) {\n throw new App_Exception_WsException(\"Can not fund from this card\");\n return false;\n }\n\n $c = new App_Cellphone($mobileid);\n\n\n $balance = $c->getBalance();\n $temp_balance = $c->getTempBalance();\n\n //if (Zend_Registry::get('pp.env') === \"live\") {\n $c->addToBalance($amount);\n $balance = $c->getBalance() + $amount;\n $temp_balance = $c->getTempBalance();\n //}\n\n $u = new App_User($userid);\n\n return App_Transaction_Transaction::log(App_Transaction_Type::CREDIT_SALE_PENDING,'Info',$amount,$balance,$temp_balance,$mobileid,'0',App_Transaction_Type::getConstName(App_Transaction_Type::CREDIT_SALE_PENDING),$c->getCellphone(),\"\",$userid,\"\",$c->getAlias() . \":\" . $u->getEmail(),\"\",\"\",$extinfo);\n }",
"function spgateway_credit_MetaData() {\n return array(\n 'DisplayName' => 'spgateway - 信用卡',\n 'APIVersion' => '1.1', // Use API Version 1.1\n 'DisableLocalCredtCardInput' => false,\n 'TokenisedStorage' => false,\n );\n}",
"function saveCard()\n {\n $table = 'module_isic_card';\n $card = $this->vars[\"card_id\"];\n $this->convertValueFieldKeys();\n //print_r($this->vars);\n // there are 2 possibilites for saving card (modify existing or add new)\n if ($card) { // modify existing card\n\n $row_old = $this->isic_common->getCardRecord($card);\n $t_field_data = $this->getFieldData($row_old[\"type_id\"]);\n\n\n $r = &$this->db->query('\n UPDATE\n `module_isic_card`\n SET\n `module_isic_card`.`moddate` = NOW(),\n `module_isic_card`.`moduser` = ?,\n `module_isic_card`.`person_name` = ?,\n `module_isic_card`.`person_addr1` = ?,\n `module_isic_card`.`person_addr2` = ?,\n `module_isic_card`.`person_addr3` = ?,\n `module_isic_card`.`person_addr4` = ?,\n `module_isic_card`.`person_email` = ?,\n `module_isic_card`.`person_phone` = ?,\n `module_isic_card`.`person_position` = ?,\n `module_isic_card`.`person_class` = ?,\n `module_isic_card`.`person_stru_unit` = ?,\n `module_isic_card`.`person_bankaccount` = ?,\n `module_isic_card`.`person_bankaccount_name` = ?,\n `module_isic_card`.`person_newsletter` = ?,\n `module_isic_card`.`confirm_user` = !,\n `module_isic_card`.`confirm_payment_collateral` = !,\n `module_isic_card`.`confirm_payment_cost` = !,\n `module_isic_card`.`confirm_admin` = !\n WHERE\n `module_isic_card`.`id` = !\n ', $this->userid,\n $this->vars[\"person_name\"],\n $this->vars[\"person_addr1\"],\n $this->vars[\"person_addr2\"],\n $this->vars[\"person_addr3\"],\n $this->vars[\"person_addr4\"],\n $this->vars[\"person_email\"],\n $this->vars[\"person_phone\"],\n $this->vars[\"person_position\"],\n $this->vars[\"person_class\"],\n $this->vars[\"person_stru_unit\"],\n $this->vars[\"person_bankaccount\"],\n $this->vars[\"person_bankaccount_name\"],\n $this->vars[\"person_newsletter\"] ? 1 : 0,\n $this->vars[\"confirm_user\"] ? 1: 0,\n $this->user_type == 1 ? ($this->vars[\"confirm_payment_collateral\"] ? 1 : 0) : $row_old[\"confirm_payment_collateral\"],\n $this->user_type == 1 ? ($this->vars[\"confirm_payment_cost\"] ? 1 : 0) : $row_old[\"confirm_payment_cost\"],\n $this->user_type == 1 ? ($this->vars[\"confirm_admin\"] ? 1 : 0) : $row_old[\"confirm_admin\"],\n $card\n );\n if ($r) {\n $success = true;\n $this->isic_common->saveCardChangeLog(2, $card, $row_old, $this->isic_common->getCardRecord($card));\n $message = 'card saved ...';\n } else {\n $success = false;\n $message = 'card modify failed ...';\n }\n\n } else { // adding new card\n $success = false;\n $action = 1; // add\n $t_field_data = $this->getFieldData($this->vars[\"type_id\"]);\n //print_r($t_field_data);\n foreach ($t_field_data[\"detailview\"] as $fkey => $fval) {\n // check for disabled fields, setting these values to empty\n if (in_array($action, $fval[\"disabled\"])) {\n unset($this->vars[$fkey]);\n continue;\n }\n // check for requried fields\n if (in_array($action, $fval[\"required\"])) {\n if (!$this->vars[$fkey]) {\n $error = $error_required_fields = true;\n break;\n }\n }\n if (!$error) {\n $insert_fields[] = $this->db->quote_field_name(\"{$fkey}\");\n $t_value = '';\n switch ($fval['type']) {\n case 1: // textfield\n $t_value = $this->db->quote($this->vars[$fkey] ? $this->vars[$fkey] : '');\n break;\n case 2: // combobox\n $t_value = $this->vars[$fkey] ? $this->vars[$fkey] : 0;\n break;\n case 3: // checkbox\n $t_value = $this->vars[$fkey] ? 1 : 0;\n break;\n case 5: // date\n $t_date = $this->convertDate($this->vars[$fkey]);\n $t_value = $this->db->quote($t_date);\n break;\n default :\n break;\n }\n $insert_values[] = $t_value;\n }\n }\n if (!$error) {\n $r = &$this->db->query('INSERT INTO ' . $this->db->quote_field_name($table) . ' FIELDS (' . implode(',', $insert_fields) . ') VALUES (' . implode(',', $insert_values) . ')');\n echo \"<!-- \" . $this->db->show_query() . \" -->\\n\";\n $card = $this->db->insert_id();\n\n }\n\n if ($r && $card) {\n $success = true;\n $this->isic_common->saveCardChangeLog(1, $card, array(), $this->isic_common->getCardRecord($card));\n $message = 'new card saved ...';\n } else {\n $success = false;\n $message = 'card add failed ...';\n }\n }\n\n echo JsonEncoder::encode(array('success' => $success, 'msg' => $message));\n exit();\n \n }",
"public function add(Card $card): void\n {\n $this->set($card->getKey(), $card);\n }",
"public function askForCard()\n {\n }",
"public function setCard(Model\\CardSetting $card): self\n {\n $this->card = $card;\n\n return $this;\n }",
"public function addCard()\n {\n }",
"public function setNameOnCard($var)\n {\n GPBUtil::checkString($var, True);\n $this->name_on_card = $var;\n\n return $this;\n }",
"public function store(Request $request)\n {\n $validator = request()->validate(\n [\n 'type' => 'required|in:visa,mastercard,cihvisa,cihmastercard',\n 'number' => 'required|numeric|min:0',\n 'expMonth' => 'required|numeric|between:1,12',\n 'expYear' => 'required|numeric|between:2018,2100', // TODO: make this dynamic\n ]);\n\n $creditCard = new CreditCard();\n $creditCard->type = Input::get('type');\n $creditCard->number = Input::get('number');\n $creditCard->expMonth = Input::get('expMonth');\n $creditCard->expYear = Input::get('expYear');\n $creditCard->user_id = Auth::id();\n \n $creditCard->save();\n \n return redirect('/profile');\n }",
"public function get_card(){ return $this->_card;}",
"public function getCreditCardById($customer_id, $card_id)\n {\n \n // verify the required parameter 'customer_id' is set\n if ($customer_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_id when calling getCreditCardById');\n }\n // verify the required parameter 'card_id' is set\n if ($card_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $card_id when calling getCreditCardById');\n }\n \n // parse inputs\n $resourcePath = \"/customer/{customer_id}/credit_card/{card_id}\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"GET\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customer_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_id),\n $resourcePath\n );\n }// path params\n if ($card_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"card_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($card_id),\n $resourcePath\n );\n }\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCard'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCard', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCard', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }",
"public function setAccountCode($value);",
"function cardNumber()\n\t\t{\n\t\t\techo $this->card_number;\n\t\t}",
"public function changeCardNumber($card, $number){\n $availableCard = $this->getCardRepository()->findOneByNumber($number);\n $this->entityManager->remove($availableCard);\n $this->entityManager->flush();\n $card->setNumber($number);\n $this->save($card, true);\n }",
"function ezcreditcardType ()\n {\n $this->eZDataType( self::DATA_TYPE_STRING, ezi18n( 'kernel/classes/datatypes', 'Credit card', 'Datatype name' ), array( \n 'serialize_supported' => true , \n 'object_serialize_map' => array( \n 'data_text' => 'text' \n ) \n ) );\n }",
"public function addCardToCustomer($number, $customer)\n {\n $number = intval($number);\n if($number){\n if(strlen((string)$number) != 9){\n $this->session->getFlashBag()->add('error', 'The card number your entered is not valid.');\n return;\n }\n $card = $this->getCardRepository()->findInactiveCardByNumber($number);\n\n if(null != $card){\n $card->setCustomer($customer);\n $card->setIsActive(true);\n $this->entityManager->persist($customer);\n $this->entityManager->persist($card);\n $this->entityManager->flush();\n $this->session->getFlashBag()->add('success', 'Success ! You have a new card !');\n $addCardEvent = new CustomerAddCardEvent($card);\n $this->dispatcher->dispatch(CustomerAddCardEvent::NAME, $addCardEvent);\n\t\t\t\treturn;\n }else{\n $this->session->getFlashBag()->add('error', 'The card number your entered doesn\\'t exist.');\n return;\n }\n }else{\n $this->session->getFlashBag()->add('error', 'The card number your entered is not valid.');\n return;\n }\n\n }"
]
| [
"0.70192105",
"0.6974019",
"0.69172263",
"0.69172263",
"0.68762636",
"0.66995496",
"0.6634257",
"0.6559769",
"0.6545362",
"0.6475479",
"0.6458408",
"0.64289933",
"0.6416472",
"0.63858896",
"0.63369596",
"0.62682104",
"0.62268114",
"0.62054884",
"0.6152741",
"0.6128626",
"0.6102686",
"0.60823154",
"0.60387695",
"0.60282636",
"0.6008674",
"0.60085195",
"0.5948075",
"0.58726394",
"0.5863755",
"0.5860127",
"0.58521295",
"0.585167",
"0.58304507",
"0.5820132",
"0.58194166",
"0.5818925",
"0.581822",
"0.5794773",
"0.5775355",
"0.57732916",
"0.5756176",
"0.5745558",
"0.57397",
"0.57391745",
"0.57357556",
"0.5717186",
"0.5693506",
"0.56766075",
"0.5673793",
"0.5652101",
"0.5650365",
"0.56470716",
"0.5630219",
"0.56247103",
"0.56154597",
"0.5552872",
"0.5523647",
"0.5513071",
"0.5511094",
"0.5502374",
"0.5499492",
"0.546588",
"0.5462541",
"0.54569024",
"0.54446054",
"0.54365236",
"0.5436004",
"0.54197896",
"0.5415319",
"0.54135674",
"0.53993237",
"0.53977114",
"0.5384196",
"0.5384196",
"0.5382393",
"0.53732854",
"0.53708816",
"0.5365201",
"0.5354382",
"0.5341167",
"0.5333363",
"0.53155035",
"0.5314453",
"0.5306052",
"0.5292369",
"0.52874476",
"0.5280639",
"0.52550375",
"0.5247334",
"0.52421457",
"0.52404314",
"0.52267075",
"0.52243984",
"0.5223031",
"0.52194244",
"0.5210365",
"0.52089447",
"0.52082705",
"0.520631"
]
| 0.59725535 | 26 |
Use a Customer ID Link the charge to an existing customer by ID, doesn't require Customer information | public function UseCustomer ($customer_id) {
$this->Param('customer_id',$customer_id);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCustomer($customer_id);",
"public function setCustomerId($id);",
"abstract public function getCustomer($ID);",
"public function getCustomerId();",
"public function getCustomerId();",
"public function getCustomerId();",
"function getCustomerById_customer($id_customer)\n {\n\n\n\n $query = \"SELECT * FROM `customer` WHERE id_customer = '$id_customer'\";\n $hasil = $this->db->query($query);\n\n return $hasil;\n }",
"public function getCustomerId() {\n return $this->customerID;\n }",
"function set_customer_id($blog_id, $customer_id) {\n\t\tglobal $wpdb;\n\t\t\n\t\t$exists = $wpdb->get_var( $wpdb->prepare(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_stripe_customers WHERE blog_id = %d\", $blog_id) );\t\t\t\t\t\t\t\t\t\n\t\tif ( $exists ) {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->base_prefix}pro_sites_stripe_customers SET customer_id = %s WHERE blog_id = %d\", $customer_id, $blog_id) );\t\t\t\t\t\t\t\n\t\t} else {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"INSERT INTO {$wpdb->base_prefix}pro_sites_stripe_customers(blog_id, customer_id) VALUES (%d, %s)\", $blog_id, $customer_id) );\t\t\t\t\t\t\t\n\t\t}\n\t}",
"function customer_id($customer_id=null)\n {\n if (isset($customer_id)) $this->customer_id = intval($customer_id);\n return $this->customer_id;\n }",
"public function getCustomerId()\n {\n return $this->customer_id;\n }",
"public function getCustomerId()\n {\n return $this->customer_id;\n }",
"public function getCustomer($_ID)\n {\n return $this->getUnique(\"customers\", $_ID);\n }",
"function createCustomer($id, $stripeid) // user_charge.php, user_charge_package_10.php, user_charge_subscription.php\r\n\r\n{\r\n\r\n\tglobal $mysqli,$db_table_prefix;\r\n\r\n\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"users\r\n\r\n\t\tSET\r\n\r\n\t\tstripe_id = ?\r\n\r\n\t\tWHERE\r\n\r\n\t\tid = ?\");\r\n\r\n\t$stmt->bind_param(\"si\", $stripeid, $id);\r\n\r\n\t$result = $stmt->execute();\r\n\r\n\t$stmt->close();\r\n\r\n\treturn $result;\r\n\r\n}",
"public function changeCustomer($id, $canChangeCustomer = 1)\n {\n $document = $this->document->findOrFail($id);\n\n $customer = Customer::find( $document->customer_id );\n\n $addressBook = $customer->addresses;\n\n $theId = $customer->invoicing_address_id;\n $invoicing_address = $addressBook->filter(function($item) use ($theId) { // Filter returns a collection!\n return $item->id == $theId;\n })->first();\n\n $addressbookList = array();\n foreach ($addressBook as $address) {\n $addressbookList[$address->id] = $address->alias;\n }\n\n\n return view($this->view_path.'.change_customer', $this->modelVars() + compact('customer', 'invoicing_address', 'addressBook', 'addressbookList', 'document', 'canChangeCustomer'));\n }",
"function get_customer_to_order($customer_id) {\n\t$sql = \"SELECT cust.name, \n\t\t cust.address, \"\n\t\t .TB_PREF.\"credit_status.dissallow_invoices, \n\t\t cust.sales_type AS salestype,\n\t\t cust.dimension_id,\n\t\t cust.dimension2_id,\n\t\t stype.sales_type,\n\t\t stype.tax_included,\n\t\t stype.factor,\n\t\t cust.curr_code,\n\t\t cust.discount,\n\t\t cust.payment_terms,\n\t\t cust.pymt_discount,\n\t\t cust.credit_limit - Sum(IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2,\n\t\t\t-1, 1) * (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount),0)) as cur_credit\n\t\tFROM \".TB_PREF.\"debtors_master cust\n\t\t LEFT JOIN \".TB_PREF.\"debtor_trans trans ON trans.type!=\".ST_CUSTDELIVERY.\" AND trans.debtor_no = cust.debtor_no,\"\n\t\t .TB_PREF.\"credit_status, \"\n\t\t .TB_PREF.\"sales_types stype\n\t\tWHERE cust.sales_type=stype.id\n\t\t\tAND cust.credit_status=\".TB_PREF.\"credit_status.id\n\t\t\tAND cust.debtor_no = \".db_escape($customer_id)\n\t\t.\" GROUP by cust.debtor_no\";\n\n\t$result =db_query($sql,\"Customer Record Retreive\");\n\treturn \tdb_fetch($result);\n}",
"public function customer_by_id($id)\n {\n return $this->customers->customer_by_id($id);\n }",
"function getCcInfoByCustId($customerid) {\n $query = \"SELECT * FROM `creditcards` WHERE CustomerId='\".$customerid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }",
"public function getCustomer(int $id)\n {\n return Customer::where('id', $id)->first();\n }",
"public function charge_customer( $amount, $customer_id, $desc ) {\r\n\t\t$params = array(\r\n\t\t\t'amount' => $amount,\r\n\t\t\t'currency' => 'usd',\r\n\t\t\t'customer' => $customer_id,\r\n\t\t\t'description' => $desc\r\n\t\t);\r\n\t\t\r\n\t\treturn $this->_send_request( 'charges', $params, STRIPE_METHOD_POST );\r\n\t}",
"public function setChargeId($value)\n {\n return $this->set(self::_CHARGE_ID, $value);\n }",
"public function subscriptions($id)\n {\n\n \\Stripe\\Stripe::setApiKey(\"sk_test_QY4jsEKRBOS1VUpRcrJZIMrj\");\n\n $customer_id = 'cus_EMwyFkdGdPZ6uu';//fetch it from your stored database\n\n $charge = \\Stripe\\Charge::create([\n 'amount' => 1500, // $15.00 this time\n 'currency' => 'usd',\n 'customer' => $customer_id, // fetch it from your database which we have stored above\n ]);\n\n dd('successfylly charged');\n }",
"public function GetCustomer($customer_id) {\n\n //set up the query\n $this->sql = \"SELECT *\n FROM customers\n WHERE customerID = :customer_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':customer_id' => $customer_id,\n ]);\n }",
"public function customer($customer_id, &$data){\n if(!$this->that->config->get('koraki_registered'))\n return;\n\n if(empty($customer_id)){\n return;\n }\n\n $this->that->load->model('account/customer');\n\n $customer = $this->that->model_account_customer->getCustomer($customer_id);\n\n $this->that->load->model('localisation/country');\n\n $country_info = $this->that->model_localisation_country->getCountry($data['country_id']);\n\n $variables = array(\n \"fname\" => $customer['firstname'],\n \"lname\" => $customer['lastname'],\n \"city\" => $data['city'],\n \"country\" => $country_info['name'],\n \"country_code\" => $country_info['iso_code_2']\n );\n\n $location_array = array();\n array_push($location_array, $data['city']);\n array_push($location_array, $country_info['name']);\n $location = $data['city'] ? join(\", \", $location_array) : $country_info['name'];\n $location_verb = (empty($data['country_id']) && empty($data[0]['city'])) ? \"\" : \" from \" . $location;\n\n\n if(isset($customer) && $customer['newsletter']) {\n $post = array(\n \"variables\" => json_encode($variables),\n \"notificationText\" => empty($customer['firstname'])?\"Someone\" : $customer['firstname'] . $location_verb . \" registered as a user\",\n \"location\" => $location\n );\n\n $this->post($post);\n }\n }",
"function select_customer() {\n $data = array();\n $customer_id = $this->input->post(\"customer\");\n\n if ($this->Customer->account_number_exists($customer_id)) {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n\n if ($this->Customer->exists($customer_id)) {\n $this->sale_lib->set_customer($customer_id);\n if ($this->config->item('automatically_email_receipt')) {\n $this->sale_lib->set_email_receipt(1);\n }\n } else {\n $data['error'] = lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }",
"public function getStripeCustomerId() {\n return $this->stripe_customer_id;\n\n }",
"public function get_customer($id = null) {\n $this->db->select('*');\n if ($id != NULL) {\n $this->db->where('customer_id_pri', $id);\n }\n $this->db->order_by('customer_id_pri');\n return $this->db->get('customer');\n }",
"function wp_stripe_find_customer_subscription_charge($customer_id, $plan_id) {\n\n $customer_invoices = Stripe_Invoice::all(array('customer' => $customer_id));\n\n $matching_invoice = null; \n\n // Loop through invoices looking for a matching subscription\n foreach( $customer_invoices->data as $invoice) {\n if ( $invoice->lines->subscriptions ) {\n foreach( $invoice->lines->subscriptions as $subscription ) {\n if ( $subscription->plan->id == $plan_id ) {\n $matching_invoice = $invoice; \n break 2;\n }\n }\n }\n }\n\n // Get the charge if we found a matching invoice\n $charge = $matching_invoice ? Stripe_Charge::retrieve($matching_invoice->charge) : null;\n\n return $charge;\n}",
"public function getCustomerIdentifier()\n {\n return $this->customer_identifier;\n }",
"function getStripeCustomerId(){\n\n $getCusId = $this->common_model->getsingle(USERS,array('userId'=>$this->session->userdata('userId')));\n if($getCusId){\n return $getCusId->stripeCustomerId;\n }else{\n return FALSE;\n }\n\n }",
"public function getOrCreateCustomer();",
"function jpid_next_customer_id() {\n\treturn JPID()->db_customers->get_next_id();\n}",
"function getCustomer($db_link, $custID){\n\t\t$sql_cust = \"SELECT * FROM customer LEFT JOIN custsex ON customer.custsex_id = custsex.custsex_id LEFT JOIN custmarried ON customer.custmarried_id = custmarried.custmarried_id LEFT JOIN custsick ON customer.custsick_id = custsick.custsick_id LEFT JOIN user ON customer.user_id = user.user_id WHERE cust_id = '$custID'\";\n\t\t$query_cust = mysqli_query($db_link, $sql_cust);\n\t\tcheckSQL($db_link, $query_cust, $db_link);\n\t\t$result_cust = mysqli_fetch_assoc($query_cust);\n\n\t\treturn $result_cust;\n\t}",
"function ciniki_sapos_web_stripeCustomerCharge(&$ciniki, $tnid, $args) {\n\n if( !isset($args['stripe-token']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.238', 'msg'=>'Internal Error'));\n }\n if( !isset($args['stripe-email']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.239', 'msg'=>'Internal Error'));\n }\n if( !isset($args['charge-amount']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.244', 'msg'=>'Internal Error'));\n }\n\n //\n // Load the tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'core', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_currency = $rc['settings']['intl-default-currency'];\n\n //\n // Load stripe settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_sapos_settings', 'tnid', $tnid, 'ciniki.sapos', 'settings', 'stripe');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['settings']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.240', 'msg'=>'Stripe processing not configured'));\n }\n $stripe_settings = $rc['settings'];\n\n if( !isset($stripe_settings['stripe-sk']) || $stripe_settings['stripe-sk'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.241', 'msg'=>'Stripe processing not configured'));\n }\n\n //\n // Load stripe library\n //\n require_once($ciniki['config']['ciniki.core']['lib_dir'] . '/Stripe/init.php');\n \\Stripe\\Stripe::setApiKey($stripe_settings['stripe-sk']);\n\n //\n // Create customer\n //\n try {\n $customer = \\Stripe\\Customer::create(array(\n 'email'=>$args['stripe-email'],\n 'source'=>$args['stripe-token'],\n ));\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to setup customer: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.242', 'msg'=>$e->getMessage()));\n }\n \n //\n // Process the charge\n //\n if( $args['charge-amount'] > 0 ) {\n try {\n $charge = \\Stripe\\Charge::create(array(\n 'customer' => $customer->id,\n 'amount' => number_format($args['charge-amount'] * 100, 0, '', ''),\n 'currency' => $intl_currency,\n ));\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to charge customer: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.245', 'msg'=>$e->getMessage()));\n }\n\n //\n // Check for a balance transaction\n //\n if( isset($charge['balance_transaction']) ) {\n try {\n $balance = \\Stripe\\BalanceTransaction::retrieve($charge['balance_transaction']);\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to get balance: \" . $e->getMessage());\n }\n }\n } else {\n //\n // If nothing to charge, store the customer details as part of the transaction.\n //\n $charge = $customer;\n }\n\n //\n // Add the transaction to the ciniki_sapos_transactions\n //\n if( isset($args['invoice_id']) ) {\n $dt = new DateTime('now', new DateTimeZone('UTC'));\n if( isset($balance['fee']) ) {\n $fees = bcdiv($balance['fee'], 100, 2);\n } else {\n $fees = 0;\n }\n if( isset($charge['outcome']['seller_message']) ) {\n $gateway_status = $charge['outcome']['seller_message'];\n } else {\n $gateway_status = 'Unknown';\n }\n $transaction_args = array(\n 'invoice_id'=>$args['invoice_id'],\n 'status'=>40,\n 'transaction_type'=>20,\n 'transaction_date'=>$dt->format('Y-m-d H:i:s'),\n 'source'=>30,\n 'customer_amount'=>$args['charge-amount'],\n 'transaction_fees'=>$fees,\n 'tenant_amount'=>bcsub($args['charge-amount'], $fees, 6),\n 'user_id'=>0,\n 'notes'=>'',\n 'gateway'=>30,\n 'gateway_token'=>$charge['id'],\n 'gateway_status'=>$gateway_status,\n 'gateway_response'=>serialize($charge),\n );\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.sapos.transaction', $transaction_args);\n if( $rc['stat'] != 'ok' ) {\n error_log(\"STRIPE-ERR: Unable to record transaction: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.243', 'msg'=>$e->getMessage()));\n }\n }\n\n return array('stat'=>'ok');\n}",
"public function findById($id){\n $customer = Customer::find($id);\n return $customer;\n }",
"public function setExtCustomerId($id);",
"public function getCustomer_Id() {\n return $this->customer_Id; \n }",
"public function setCustomerId($value)\n {\n return $this->set(self::customer_id, $value);\n }",
"public function customer(){\n\t\treturn Customers::find($this->customers_id);\n\t}",
"protected function _lookupCustomerId()\n {\n return $this->_customerFactory->create()\n ->loadByEmail($this->_quote->getCustomerEmail())\n ->getId();\n }",
"public function __construct($id, $customer_id)\n {\n $this->id = $id;\n $this->customer_id = $customer_id;\n }",
"public function getCustomerByIdCustomer($id){\n $dbResult = $this->db->query(\"SELECT * FROM customer WHERE id_customer = ?\", array($id));\n return $dbResult->getResult();\n }",
"function update_customer($customer_id,$params){\n $this->company_db->update('tbl_customer', $params,array(\"id\"=>$customer_id)); \n }",
"function select_customer()\n {\n $data = array();\n $customer_id = $this->input->post(\"term\");\n \n if ($this->Customer->account_number_exists($customer_id))\n {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n \n if ($this->Customer->exists($customer_id))\n {\n $this->sale_lib->set_customer($customer_id);\n if($this->config->item('automatically_email_receipt'))\n {\n $this->sale_lib->set_email_receipt(1);\n }\n }\n else\n {\n $data['error']=lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }",
"public function getCustomer($id) {\n return $this->customerRepository->getById($id);\n }",
"public function getCustomerId()\n {\n return $this->getParameter('customerId');\n }",
"public function getChargeId()\n {\n return $this->get(self::_CHARGE_ID);\n }",
"public function getCustomer()\n {\n if (null === $customer && isset($this['CUSTOMER_ID']))\n {\n $this->customer = \\Fastbill\\Customer\\Finder::findOneById($this['CUSTOMER_ID']);\n }\n return $this->customer;\n }",
"public static function get_customer( $id=0 ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\treturn $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}customers WHERE id = %d\", $id ) );\r\n\t}",
"public function c_view($id = null)\n {\n\t\t$this->layout= 'c_default';\n\t\t$this->getC();\n $customer = $this->Customers->get($id, [\n 'contain' => ['Hires', 'Selections']\n ]);\n $this->set('customer', $customer);\n $this->set('_serialize', ['customer']);\n }",
"public function setCustomerID($customer_id)\n {\n $this->customer_id = $customer_id;\n }",
"public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }",
"public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }",
"function add_customer($params){\n $this->company_db->insert('tbl_customer', $params);\n return $this->company_db->insert_id();\n }",
"public function get_customer_byid($customer_id = \"\"){\r\n $query = $this->db->get_where('view_customer_info', array('customer_id' => $customer_id));\r\n return $query->row_array();\r\n }",
"public function getCustomerId()\n {\n if (array_key_exists(\"customerId\", $this->_propDict)) {\n return $this->_propDict[\"customerId\"];\n } else {\n return null;\n }\n }",
"public function getCustomerBy_ID($customer_id) { /* this fun is used to get customer deatails */\n\n $sqlselect = \"SELECT * FROM customer_details WHERE cust_id = '$customer_id'\";\n\n $result = $this->db->query($sqlselect);\n\n if ($result->num_rows() <= 0) {\n $response = array(\n 'status' => 0,\n 'status_message' => 'No Records Found.');\n } else {\n $response = $result->result_array();\n }\n return $response;\n }",
"function getCustomerID($userID) {\n $customerModel = $this->loadModel('Customers');\n $query = $customerModel->find()->select('id')->where([\n 'user_id' => $userID\n ])->first();\n return $query->id;\n }",
"public function update_customer($data,$id){\n\t\t\n\t\t\t$this->db->where('id',$id);\n\t\t\t$this->db->update('customers',$data);\n\t\t\tredirect('Customer');\n\t\t\n\t}",
"public function customer(): BelongsTo\n {\n return $this->belongsTo(StripeCustomer::class);\n }",
"public function setCustomerId($customerId)\n {\n $this->_customer = $this->customerRepository->getById($customerId);\n return $this;\n }",
"public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}",
"public function getCustomerId()\n {\n return $this->getValue('nb_customer_id');\n }",
"protected function getCustomerId()\n {\n return $this->customerSession->getCustomer()->getId();\n }",
"public function setCustomerId(?string $customerId): void\n {\n $this->customerId['value'] = $customerId;\n }",
"public function customerId(): int\n {\n return $this->customerId;\n }",
"private function populateCustomerReference(Customer $customer)\n {\n $customerReference = NostoCustomerManager::getCustomerReference($customer);\n if (!empty($customerReference)) {\n $this->setCustomerReference($customerReference);\n } else {\n $customerReference = NostoCustomerManager::generateCustomerReference($customer);\n NostoCustomerManager::saveCustomerReference($customer, $customerReference);\n $this->setCustomerReference($customerReference);\n }\n }",
"public function getCustomer()\n {\n return \\tabs\\api\\core\\Customer::create($this->getCusref());\n }",
"public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }",
"public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }",
"public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }",
"public function setCustomerId($value)\n {\n return $this->setParameter('customerId', $value);\n }",
"public function customer_save($id = NULL)\n {\n if ($this->input->post())\n {\n if ($this->input->post('id'))\n {\n $this->MCustomers->update(trim($this->input->post('code')));\n }\n else\n {\n $ac_receivable = $this->MSettings->get_by_company_id($this->session->user_company);\n $chart = $this->MAc_charts->get_by_id($ac_receivable['ac_receivable']);\n $siblings = $this->MAc_charts->get_by_parent_id($ac_receivable['ac_receivable']);\n if (count($siblings) > 0)\n {\n $ac_code_temp = explode('.', $siblings['code']);\n $ac_last = count($ac_code_temp) - 1;\n $ac_new = (int) $ac_code_temp[$ac_last] + 10;\n $ac_code = $chart['code'] . '.' . $ac_new;\n }\n else\n {\n $ac_code = $chart['code'] . '.10';\n }\n\n $ac_id = $this->MAc_charts->account_create($ac_receivable['ac_receivable'], $ac_code, $this->input->post('name'));\n\n // $customer = $this->MCustomers->get_latest();\n // if ( count( $customer ) > 0 ) {\n // $code = (int) $customer['code'] + 1;\n // } else {\n // $code = 1001;\n // }\n $this->MCustomers->create(trim($this->input->post('code')), $ac_id);\n }\n\n $this->session->set_flashdata('success', 'Customer saved successfully.');\n redirect('inventory/customer-list', 'refresh');\n }\n else\n {\n $data['title'] = 'POS System';\n $data['menu'] = 'inventory';\n $data['content'] = 'admin/inventory/customer/save';\n $customer = $this->MCustomers->get_latest();\n if (count($customer) > 0)\n {\n $data['code'] = (int)$customer['code'] + 1;\n }\n else\n {\n $data['code'] = 1001;\n }\n $data['customer'] = $this->MCustomers->get_by_id($id);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/template', $data);\n }\n }",
"public function getCustid()\n {\n return $this->custid;\n }",
"public function get($id)\n {\n return Customer::find($id);\n }",
"protected function _addCustomer($object) {\n\t\t$format = Mage::getStoreConfig('tax/avatax/cust_code_format', $object->getStoreId());\n\t\t$customer = Mage::getModel('customer/customer');\n\t\t$customerCode = '';\n\t\t\n\t\tif($object->getCustomerId()) {\n\t\t\t$customer->load($object->getCustomerId());\n\t\t\t$taxClass = Mage::getModel('tax/class')->load($customer->getTaxClassId())->getOpAvataxCode();\n \t$this->_request->setCustomerUsageType($taxClass);\n\t\t}\n\t\t\n\t\tswitch($format) {\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::LEGACY:\n\t\t\t\tif($customer->getId()) {\n\t\t\t\t\t$customerCode = $customer->getName() . ' (' . $customer->getId() . ')';\n\t\t\t\t} else {\n $address = $object->getBillingAddress() ? $object->getBillingAddress() : $object;\n\t\t\t\t\t$customerCode = $address->getFirstname() . ' ' . $address->getLastname() . ' (Guest)';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_EMAIL:\n\t\t\t\t$customerCode = $object->getCustomerEmail() ? $object->getCustomerEmail() : $customer->getEmail();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// New code by David Dzimianski - CSH 2013\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_MAS_ID:\n\t\t\t\t$customerCode = $object->getData('mas_id') ? '00' . $object->getData('mas_id') : '00' . $customer->getData('mas_id');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_ID:\n\t\t\tdefault:\n\t\t\t\t$customerCode = $object->getCustomerId() ? $object->getCustomerId() : 'guest-'.$object->getId();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->_request->setCustomerCode($customerCode);\n\t}",
"function getCustID($db_link){\n\t\tif (isset($_GET['cust'])) $_SESSION['cust_id'] = sanitize($db_link, $_GET['cust']);\n\t\telse header('Location: start.php');\n\t}",
"public function customer()\r\n {\r\n return $this->belongsTo(Customer::class, 'customer_id', 'id');\r\n }",
"function getCustomer($customer_id) {\n \t\n \t$sql = \"SELECT * FROM customer WHERE id=?\";\n \t\n \t$result = $this->db->query($sql, array($customer_id));\n \t\n \tif( !$result )\n \t\treturn FALSE;\n \t\n \t//personal\n \t$personal['id'] = $result['id'];\n \t$personal['name'] = $result['name'];\n \t$personal['address'] = $result['address'];\n \t$personal['identify_no'] = $result['identify_no'];\n \t$personal['birthday'] = $result['birthday'];\n \t$personal['cellphone'] = $result['cellphone'];\n \t$personal['email'] = $result['email'];\n \t$personal['gender'] = $result['gender'];\n \t$personal['marriage'] = $result['marriage'];\n \t$personal['telephone'] = $result['telephone'];\n \t$personal['thumbnail'] = $result['thumbnail'];\n \t$personal['fb_id'] = $result['fb_id'];\n \t$customer['note'] = $data[\"note\"];\n \t$personal['create_time'] = $result['create_time'];\n \t$personal['modify_time'] = $result['modify_time'];\n $personal['personality'] = $result['personality'];\n \t\n \t//children\n \t$child['boy'] = $result['child_boy'];\n \t$child['girl'] = $result['child_girl'];\n \t\n \t//visit_history\n \t$visit_records = $this->getVisitRecords($customer_id);\n \t\n \t//evaluation\n \t$evaluations = $this->getEvaluation($customer_id);\n \t\n \t//tag\n \t$tags = $this->getTags($customer_id);\n \t\n \n \t//company\n \t$company['name'] = $result['company_name'];\n \t$company['address'] = $result['company_address'];\n \t$company['phone'] = $result['company_phone'];\n \t$company['category'] = $result['company_category'];\n \t$company['title'] = $result['company_title'];\n\n \t\n \t//combine the data\n \t$data = $personal;\n \t$data['child'] = $child;\n \t$data['company'] = $company;\n \t\n \tif( $evaluations )\n \t\t$data['evaluation'] = $evaluations;\n \t\n \tif( $visit_records )\n \t\t$data['visit_history'] = $visit_records;\n \t\n \tif( $tags )\n \t\t$data['tags'] = $tags;\n\n //relationship\n $relationship = $this->getRelationship($customer_id);\n if( $relationship )\n $data['relationship'] = $relationship;\n \t\n \treturn $data;\n }",
"public function setId($customerAddressId);",
"function get_customer($customer_id)\n {\n return $this->db->get_where('customer',array('customer_id'=>$customer_id))->row_array();\n }",
"public function edit(Customer $customer, $id)\n {\n //\n $customer = Customer::with('reference', 'sales_executive', 'sales_supervisor', 'company')->find($id);\n $references = Referensi::all();\n $sales_executives = Sales::where('sales_position', 'Sales')->get();\n $sales_supervisor = Sales::where('sales_position', 'Supervisor')->get();\n $companies = Company::where('company_type', 'customer')->get();\n return view('pages.customer.create-customer', compact('customer', 'references', 'sales_executives', 'sales_supervisor', 'companies'));\n }",
"public function setCustomerTransactionId($id) {\n \t$this->customerTransactionId = $id;\n }",
"public function getCustomer();",
"public function getCustomerById($id){ \n $query = \"SELECT * FROM tbl_customer WHERE id = '$id' \";\n $result = $this->db->select($query);\n return $result;\n }",
"public function bill($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Bill::find_with_client($this, $id);\n\n }",
"public function customer_info( $customer_id ) {\r\n\t\treturn $this->_send_request( 'customers/'.$customer_id );\r\n\t}",
"public function getCreditCardById($customer_id, $card_id)\n {\n \n // verify the required parameter 'customer_id' is set\n if ($customer_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_id when calling getCreditCardById');\n }\n // verify the required parameter 'card_id' is set\n if ($card_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $card_id when calling getCreditCardById');\n }\n \n // parse inputs\n $resourcePath = \"/customer/{customer_id}/credit_card/{card_id}\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"GET\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customer_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_id),\n $resourcePath\n );\n }// path params\n if ($card_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"card_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($card_id),\n $resourcePath\n );\n }\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCard'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCard', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCard', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }",
"public function cancel(Request $request)\n{\n// Get the payment token ID submitted by the form:\n $token = $_POST['stripeToken'];\n \n $customer = \\Stripe\\Customer::create([\n 'source' => $token,\n 'email' => 'test@gmail.com',\n ]);\n $charge = \\Stripe\\Charge::create([\n 'amount' => 1000,\n 'currency' => 'usd',\n 'customer' => $customer->id,\n ]);\n print_r($charge);\n die;\n\n return redirect()->back()->with('message', 'Payment Successfully Updated.');\n \n\n\n\n}",
"public function setCustomerID($customerID)\n {\n $this->customerID = $customerID;\n return $this;\n }",
"public function setCustomerId($val)\n {\n $this->_propDict[\"customerId\"] = $val;\n return $this;\n }",
"public function getCustomerId()\n {\n return Mage::getSingleton('customer/session')->getCustomerId();\n }",
"public function getCustomerId()\n {\n return Mage::getSingleton('customer/session')->getCustomerId();\n }",
"public function customer()\n {\n return Customer::retrieve($this->customer);\n }",
"public function joinCustomer($classId);",
"public function add_customer($order) {\n\n $customerData = array(\n 'name' => $order->billing_first_name,\n 'last_name' => $order->billing_last_name,\n 'email' => $order->billing_email,\n 'requires_account' => false,\n 'phone_number' => $order->billing_phone, \n );\n\n if($this->hasAddress($order)) {\n $customerData['address'] = array(\n 'line1' => substr($order->billing_address_1, 0, 200),\n 'line2' => substr($order->billing_address_2, 0, 50),\n 'line3' => '',\n 'state' => $order->billing_state,\n 'city' => $order->billing_city,\n 'postal_code' => $order->billing_postcode,\n 'country_code' => $order->billing_country\n );\n }\n \n $response = $this->openpay_request($customerData, 'customers');\n\n if (!isset($response->error_code)) {\n // Store the ID on the user account\n if (is_user_logged_in()) {\n update_user_meta(get_current_user_id(), '_openpay_customer_id', $response->id);\n }\n\n // Store the ID in the order\n update_post_meta($order->id, '_openpay_customer_id', $response->id);\n\n return $response->id;\n } else {\n $msg = $this->handleRequestError($response->error_code);\n return new WP_Error('error', __($response->error_code.' '.$msg, 'openpay-woosubscriptions'));\n }\n }",
"public function copy_customer( $cid )\n\t{\n\t\t\n\t\t//SHOULD FIRST CHECK THAT BOTH MAGENTO DATABASES ARE THE SAME\n\t\t\n\t\t//GET TABLES WITH A FOREIGN KEY RESTRAINT TO THE customer_entity TABLE\n\t\t$cust_restraint_tables\t= $this->get_customer_restraint_tables($this->pdo_source);\n\t\t\n\t\t//GET TABLES WITH THE COLUMN customer_id THAT ARE NOT FOREIGN KEY RESTRAINT TABLES\n\t\t$cust_id_tables\t\t\t= array_diff_assoc( $this->get_customer_id_tables($this->pdo_source), $cust_restraint_tables );\n\n\t\t//ALL TABLES FOR CUSTOMER\n\t\t$tables = array_merge( $cust_restraint_tables, $cust_id_tables );\n\n\t\t//ELIMINATE TABLES FOR ORDERS\n\t\t$sales_tables\t\t\t= $this->get_sales_restraint_tables( $this->pdo_source );\n\t\t\n\t\t$sales_tables['sales_flat_order'] = 'customer_id';\n\t\t\n\t\t$tables = array_diff_key( $tables, $sales_tables );\n\t\t\n\t\t//print_r($tables);\n\t\t//print_r($sales_tables);\n\t\t//exit;\n\n\t\t//GET A LIST OF ALL THE PRIMARY KEYS IN EACH TABLE\n\t\t$primary_keys\t\t\t= $this->get_primary_keys($this->pdo_source);\n\t\t\n\n\t\t//FIND ALL TABLES WITH 2+ PRIMARY KEYS AND GET RID OF THEM\n\t\t//IF THE PROGRAM EXITED ON THIS LOOP, A ROW HAS MORE THAN 1 PRIMARY KEY AND THIS CLASS IS NOT SET UP TO HANDLE IT YET\n\t\tforeach ( $tables as $table_name=>$column_name )\n\t\t{\n\n\t\t\tif ( count( $primary_keys[$table_name] ) > 1 )\n\t\t\t{\n\t\t\t\t$result = $this->pdo_source->query('select count(*) from ' . $table_name . ' ')->fetchColumn();\n\n\t\t\t\t$rowsInTableForCid = $this->pdo_source->query('select count(*) from ' . $table_name . ' where ' . $tables[$table_name] . ' = ' . $cid)->fetchColumn();\n\t\t\t\t\n\t\t\t\tif ( $rowsInTableForCid > 0 )\n\t\t\t\t{\n\t\t\t\t\techo $table_name . ' has ' . count($primary_keys[$table_name]) . ' primary keys and ' . $result . ' rows' . \"\\n\";\n\t\t\t\t\techo 'There are ' . $rowsInTableForCid . ' rows with the customer id as the value of the column ' . $tables[$table_name] ;\n\t\t\t\t\techo 'exiting, line ' . __LINE__. \"\\n\";exit;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t//FIRST INSERT THE CUSTOMER ROW INTO THE customer_entity TABLE\n\t\t$query_source = \"select * from customer_entity where entity_id = \" . $cid . \";\";\n\t\tforeach ( $this->pdo_source->query($query_source) as $row )\n\t\t{\n\t\t\tunset( $row['entity_id'] );\n\t\t\t\n\t\t\t$query_target = \"insert into customer_entity (\" . implode(',', array_keys($row)) . \") values (\" . implode(',', array_fill(0, count($row), '?')) . \")\";\n\t\t\t\n\t\t\t//echo $query_target . \"\\n\";\n\t\t\t//print_r($row);\n\t\t\t//CREATE PARAMETERS FOR ->execute() CALL\n\t\t\t$params = array();\n\t\t\tforeach ( $row as $key=>$value)\n\t\t\t{\n\t\t\t\t$params[] = $value;\n\t\t\t}\n\t\t\t\n\t\t\t//COMMENT IN AFTER TESTING\n\t\t\t//*\n\t\t\t$st\t= $this->pdo_target->prepare($query_target);\n\t\t\t$st->execute( $params );\n\t\t\t\n\t\t\t$target_cid = $this->pdo_target->lastInsertId();\n\t\t\t//*/\n\t\t\t//$target_cid = 13734;\n\t\t\t\n\t\t\techo \"Customer Inserted to target with entity_id = \" . $target_cid . \"\\n\";\n\t\t\t\n\t\t\t//print_r($row);exit;\n\t\t}\n\t\t//RETURN THE last_insert_id AND USE IT FOR THE OTHER TABLES\n\t\n\n\t\n\t\t//THESE ARE TABLES WE CAN WORK WITH\n\t\tforeach ( $tables as $table_name=>$column_name )\n\t\t{\n\n\t\t\techo $table_name . \" \" . $column_name . \"\\n\";\n\t\t\t//GET ROWS FROM SOURCE WHERE THE SOURCE customer id IS PRESENT\n\t\t\t$query_source = \"select * from \" . $table_name . \" where \" . $column_name . \" = \" . $cid . \";\";\n\t\t\t\t\t\n\t\t\tforeach ( $this->pdo_source->query($query_source) as $row )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//print_r($row);\n\t\t\t\t\n\t\t\t\t//GET RID OF THE PRIMARY KEY\n\t\t\t\tunset( $row[$primary_keys[$table_name][0]] );\n\t\t\t\t//REPLACE FOREIGN RESTRAINT WITH THE NEW CLIENT ID\n\t\t\t\t$row[$column_name] = $target_cid;\n\t\t\t\t\n\t\t\t\t$query_target = \"insert into \" . $table_name . \" (\" . implode(',', array_keys($row)) . \") values (\" . implode(',', array_fill(0, count($row), '?')) . \")\";\n\t\t\t\t\n\t\t\t\t//echo $query_target . \"\\n\";\n\t\t\t\t//print_r($row);\n\t\t\t\t//CREATE PARAMETERS FOR ->execute() CALL\n\t\t\t\t$params = array();\n\t\t\t\tforeach ( $row as $key=>$value)\n\t\t\t\t{\n\t\t\t\t\t$params[] = $value;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$st\t= $this->pdo_target->prepare($query_target);\n\t\t\t\t$st->execute( $params );\n\t\t\t\n\t\t\t\t//exit;\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t\techo \"DONE copying customer\\n executing: \\n \\$mg->copy_sales(\". $cid .\" , \" . $target_cid . \");\\n\";\n\t\t$this->copy_sales( $cid, $target_cid );\n\t\n\t}",
"public function displayCustomer($customerid) {\n global $mwAdminDB; // db connection \n\n return ($mwAdminDB->displayCustomer($customerid));\n }",
"public function setCustomerId($var)\n {\n GPBUtil::checkString($var, True);\n $this->customer_id = $var;\n\n return $this;\n }"
]
| [
"0.650749",
"0.64770037",
"0.64075977",
"0.6096979",
"0.6096979",
"0.6096979",
"0.6096523",
"0.6042491",
"0.59913534",
"0.59608376",
"0.59227383",
"0.59227383",
"0.5898742",
"0.58971775",
"0.5885786",
"0.5881254",
"0.5877852",
"0.58723754",
"0.5848017",
"0.5838307",
"0.58331305",
"0.58271945",
"0.58219206",
"0.57852125",
"0.577744",
"0.5754303",
"0.57541686",
"0.5674773",
"0.5673723",
"0.56705403",
"0.56685835",
"0.5659557",
"0.5652971",
"0.5649985",
"0.5631987",
"0.56306535",
"0.5628777",
"0.56224805",
"0.56200975",
"0.56164324",
"0.56144637",
"0.5608488",
"0.5590475",
"0.55856",
"0.5584101",
"0.556354",
"0.55622166",
"0.5552299",
"0.5550372",
"0.55424565",
"0.55393934",
"0.5530685",
"0.5530685",
"0.551904",
"0.551217",
"0.54768485",
"0.5474664",
"0.54625463",
"0.5453817",
"0.5448032",
"0.5446363",
"0.54403675",
"0.54385674",
"0.54364204",
"0.5433117",
"0.5432894",
"0.54323983",
"0.5431842",
"0.5431119",
"0.5431119",
"0.5431119",
"0.5428444",
"0.5422242",
"0.54182637",
"0.5416707",
"0.54152954",
"0.54115355",
"0.5406132",
"0.53947264",
"0.538882",
"0.5383952",
"0.5373961",
"0.5367923",
"0.53676796",
"0.5364574",
"0.53629565",
"0.536068",
"0.53601855",
"0.535691",
"0.5347499",
"0.5346284",
"0.5342517",
"0.5342517",
"0.5341563",
"0.5332236",
"0.5331822",
"0.53307706",
"0.5317406",
"0.53104526"
]
| 0.54373944 | 63 |
Set Gateway ID If you have multiple gateways, specify which gateway to use. | public function UseGateway($gateway_id) {
$this->Param('gateway_id', $gateway_id);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_gateway($gateway_slug, $args) {\n\n // Set payments gateway\n md_set_gateway($gateway_slug, $args);\n \n }",
"protected function setGateway($gateway)\n {\n $this->gateway = $gateway;\n }",
"public function setGateway(GatewayInterface $gateway) {\n $this->gateway = $gateway;\n }",
"public function setGateway(GatewayInterface $gateway)\n {\n }",
"public function setGatewayId(int $gateway_id)\n {\n $this->gateway_id = $gateway_id;\n\n return $this;\n }",
"public function getGatewayId()\n {\n return $this->gateway_id;\n }",
"public function set_gateway( $gateway ) {\n\t\t$this->_gateway = $gateway;\n\n\t\t// Setup API key.\n\t\tStripeCheckout::setApiKey( $this->_gateway->get_secret_key() );\n\n\t\t// If we don't set this, Stripe will use latest version, which may break our implementation.\n\t\tStripeCheckout::setApiVersion( '2019-09-09' );\n\n\t\t// Setup plugin info.\n\t\tStripeCheckout::setAppInfo(\n\t\t\t'Membership 2 - Stripe Checkout',\n\t\t\tM2STRIPE_VERSION,\n\t\t\tsite_url()\n\t\t);\n\t}",
"function setGateway($gateway = NULL) {\n\t\t\t//set the gateway property\n\t\t\tif(isset($gateway)) {\n\t\t\t\t$this->gateway = $gateway;\n\t\t\t}\n\n\t\t\t//which one to load?\n\t\t\t$classname = \"PMProGateway\";\t//default test gateway\n\t\t\tif(!empty($this->gateway) && $this->gateway != \"free\") {\n\t\t\t\t$classname .= \"_\" . $this->gateway;\t//adding the gateway suffix\n\t\t\t}\n\n\t\t\tif(class_exists($classname) && isset($this->gateway)) {\n\t\t\t\t$this->Gateway = new $classname($this->gateway);\n\t\t\t} else {\n\t\t\t\t$this->Gateway = null;\t//null out any current gateway\n\t\t\t\t$error = new WP_Error(\"PMPro1001\", \"Could not locate the gateway class file with class name = \" . $classname . \".\");\n\t\t\t}\n\n\t\t\tif(!empty($this->Gateway)) {\n\t\t\t\treturn $this->Gateway;\n\t\t\t} else {\n\t\t\t\t//gateway wasn't setup\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"protected function getGatewayIdentifier() {\n\t\treturn $this->gatewayIdentifier;\n\t}",
"protected function getGatewayIdentifier() {\n\t\treturn $this->gatewayIdentifier;\n\t}",
"public function set_gateway_device($device)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // Validate\n //---------\n // TODO\n\n // Update tag if it exists\n //------------------------\n\n $file = new File(self::FILE_NETWORK);\n $match = $file->replace_lines('/^GATEWAYDEV=/', \"GATEWAYDEV=\\\"$device\\\"\\n\");\n\n // If tag does not exist, add it\n //------------------------------\n\n if (! $match)\n $file->add_lines(\"GATEWAYDEV=\\\"\" . $device . \"\\\"\\n\");\n }",
"public function setCustomerGateway($value) \n {\n $this->_fields['CustomerGateway']['FieldValue'] = $value;\n return;\n }",
"public function setGatewayVersion($version)\n {\n $this->_gatewayVersion = (int)$version;\n }",
"public function setGatewayIP($value)\n {\n return $this->set('GatewayIP', $value);\n }",
"public function edit(Gateway $gateway)\n {\n //\n }",
"public function updateGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Updated Gateway Details';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n //Wulian Gateway\n\n $this->validate($request,\n ['GATEWAY_NAME'=>'unique:M005_GATEWAY|required']);\n if($request->KEY == 'gateway'){\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n $gateway->FLOOR_ID = $request->FLOOR_ID ?\n $request->FLOOR_ID : $gateway->FLOOR_ID;\n $gateway->ROOM_ID = $request->ROOM_ID ?\n $request->ROOM_ID : $gateway->ROOM_ID;\n $gateway->REG_FLAG = $request->REG_FLAG ?\n $request->REG_FLAG : $gateway->REG_FLAG;\n $gateway->ONLINE_FLAG = $request->ONLINE_FLAG ?\n $request->ONLINE_FLAG : $gateway->ONLINE_FLAG;\n $gateway->GATEWAY_NAME = $request->GATEWAY_NAME ?\n $request->GATEWAY_NAME : $gateway->GATEWAY_NAME;\n $gateway->save();\n return response($gateway, 201);\n }else{\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n\n $gateway->FLOOR_ID = $request->FLOOR_ID ?\n $request->FLOOR_ID : $gateway->FLOOR_ID;\n $gateway->GATEWAY_SERIAL_NO = $request->GATEWAY_SERIAL_NO ?\n $request->GATEWAY_SERIAL_NO : $gateway->GATEWAY_SERIAL_NO;\n $gateway->GATEWAY_NAME = $request->GATEWAY_NAME ?\n $request->GATEWAY_NAME : $gateway->GATEWAY_NAME;\n $gateway->GATEWAY_IP = $request->GATEWAY_IP ?\n $request->GATEWAY_IP : $gateway->GATEWAY_IP;\n $gateway->save();\n return response($gateway, 201);\n }\n }",
"public function setGateway($gateway)\n {\n if ($this->Status == 'Created') {\n $this->setField('Gateway', $gateway);\n }\n return $this;\n }",
"public function setGateway($name)\n {\n $this->gateway = $name;\n\n return $this;\n }",
"public function setGatewayData(array $data)\n {\n $this->gateway_data = $data;\n\n return $this;\n }",
"public function setGateway(Direction $direction, Space $space) : void\n {\n $this->gateways->put($direction->getValue(), $space);\n }",
"public function getGateway() {\n return $this->gateway;\n }",
"public function add_gateway( $gateways ) {\n\t\t$gateways[] = 'Paytwit_WC_gateway';\n\t\treturn $gateways;\n\t}",
"public function setProviderGateway(ProviderGatewayContract $providerGateway)\n {\n $this->providerGateway = $providerGateway;\n }",
"public function gateway(string $gateway): Gateway\n {\n $gateway = mb_strtolower($gateway);\n\n if (! isset($this->created[$gateway])) {\n $this->created[$gateway] = $this->createGateway($gateway);\n }\n\n return $this->created[$gateway];\n }",
"public function setDefaultGateway($name){\n\t\t\tif($this->__find($name)){\n\t\t\t\tSymphony::Configuration()->set('default_gateway', $name, 'Email');\n\t\t\t\tAdministration::instance()->saveConfig();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new EmailGatewayException(__('This gateway can not be found. Can not save as default.'));\n\t\t\t}\n\t\t}",
"private function _processSingleGateway()\n {\n if($gateway = $this->gateway_library->get_first())\n {\n $this->session->set_userdata( 'gateway_id', $gateway->id );\n //now place order\n $order_id = $this->place_order();\n if($order_id > 0)\n {\n $this->set_step(0); //6\n redirect( NC_ROUTE.'/payment/order/'.$order_id);\n }\n }\n redirect( NC_ROUTE.'/cart/');\n }",
"public function getGateway()\n {\n return $this->gateway;\n }",
"public function gateway()\n {\n return $this->belongsTo('App\\Gateway', 'GATEWAY_ID' ,'GATEWAY_ID');\n }",
"public function smsGatewayCru(Request $request, $id=0)\n {\n //for save on POST request\n if ($request->isMethod('post')) {\n $this->validate($request, [\n 'gateway' => 'required|integer',\n 'name' => 'required|min:4|max:255',\n 'sender_id' => 'nullable',\n 'user' => 'required|max:255',\n 'password' => 'nullable|max:255',\n 'api_url' => 'required',\n ]);\n\n\n $data = [\n 'gateway' => $request->get('gateway',''),\n 'name' => $request->get('name',''),\n 'sender_id' => $request->get('sender_id',''),\n 'user' => $request->get('user',''),\n 'password' => $request->get('password',''),\n 'api_url' => $request->get('api_url',''),\n ];\n\n\n AppMeta::updateOrCreate(\n ['id' => $id],\n [\n 'meta_key' => 'sms_gateway',\n 'meta_value' => json_encode($data)\n ]\n );\n $msg = \"SMS Gateway \";\n $msg .= $id ? 'updated.' : 'added.';\n\n if($id){\n return redirect()->route('settings.sms_gateway.index')->with('success', $msg);\n }\n return redirect()->route('settings.sms_gateway.create')->with('success', $msg);\n }\n\n //for get request\n $gateways = AppHelper::SMS_GATEWAY_LIST;\n $gateway_id = null;\n $gateway = AppMeta::find($id);\n if($gateway) {\n $gateway_id = (json_decode($gateway->meta_value))->gateway;\n }\n\n return view('backend.settings.smsgateway_add', compact('gateways', 'gateway', 'gateway_id'));\n }",
"protected function get_gateway() {\n\n\t\treturn $this->gateway;\n\t}",
"public function updateGateway(\n $gatewayId,\n array $body\n )\n {\n return $this->_UpdateGateway_operation->call([\n 'GatewayId' => $gatewayId,\n 'body' => $body\n ]);\n }",
"public function register_gateway($gateways)\n {\n $gateways['jeeb'] = array(\n 'admin_label' => 'Jeeb',\n 'checkout_label' => 'Jeeb - Pay securely with bitcoins through Jeeb Payment Gateway.',\n );\n return $gateways;\n }",
"function getGatewayID() {\n\t\treturn commsGateway::GW_APP_LOOP_BACK;\n\t}",
"public function setTableGateway(\\Zend_Db_Table $_tableGateway)\n {\n $this->_tableGateway = $_tableGateway;\n }",
"protected function setupGateway( $package, $gateway )\n {\n \n $request = $this->getRequest();\n \n $codeRoot = $gateway->getCodeRoot();\n \n $gwName = $gateway->getName();\n $gwSrc = $gateway->getSrc();\n \n $this->protocol->subHead( 'Deploy Gateway '.$gwName.' to '.$codeRoot );\n \n if( !Fs::exists($codeRoot) )\n {\n if( !Fs::mkdir($codeRoot))\n {\n $this->protocol->error( 'Konnte das Zielverzeichnis: '.$codeRoot.' nicht anlegen.' );\n throw new GaiaException( 'Konnte das Zielverzeichnis: '.$codeRoot.' nicht anlegen.' );\n }\n }\n \n $gwSrcPath = $this->dataPath.'gateway/'.$gwSrc;\n $gwTargetPath = $codeRoot.'/'.$gwName;\n \n if( !Fs::exists($gwSrcPath) )\n {\n $error = 'Konnte keine Daten zu dem Gateway: '.$gwSrc.' unter '.$gwSrcPath.' finden.';\n $this->protocol->error( $error );\n throw new GaiaException( $error );\n }\n \n if( Fs::exists( $gwTargetPath ) )\n {\n \n if( !$this->console->question\n (\n <<<QUESTION\nEs existiert bereits ein Gateway unter: {$gwTargetPath}.\nSoll die vorhandene Installation komplett überschrieben werden?\n\nWarnung wenn du jetzt auf ja klickst werden alle Daten \ndie sich in der Installation befinden gelöscht.\nQUESTION\n ))\n {\n \n $errMsg = <<<ERROR\nDie Installation wurde abgebrochen da unter \"{$gwTargetPath}\" \nbereits eine Installation vorhanden war.\n\nZum updaten der Installation bitte das update Script verwenden.\nERROR;\n \n $this->protocol->error( $errMsg );\n throw new GaiaException( $errMsg );\n }\n \n // löschen der alten installation\n // Hoffentlich hat da jemand gut drüber nachgedacht\n Fs::del( $gwTargetPath );\n }\n \n if( !Fs::copyContent( $gwSrcPath, $gwTargetPath ) )\n {\n $error = 'Kopieren der Gatewaydaten ist fehlgeschlagen';\n $this->protocol->error( $error );\n throw new GaiaException( $error );\n }\n \n // sollten versehentlich die sessiondaten mitkopiert worden sein\n // sicherstellen dass keine alten sessiondaten kopiert wurden\n if( Fs::exists( $gwTargetPath.'/tmp/session' ) )\n {\n $this->protocol->warning( 'lösche vorhadenen sessiondaten in '.$gwTargetPath.'/tmp/session' );\n Fs::del( $gwTargetPath.'/tmp/session' );\n }\n Fs::mkdir( $gwTargetPath.'/tmp/session' );\n \n // sicher stellen, dass der cache nicht mit deployt wurde\n if( Fs::exists( $gwTargetPath.'/cache' ) )\n {\n $this->protocol->warning( 'lösche vorhadenen cache in '.$gwTargetPath.'/cache' );\n Fs::del( $gwTargetPath.'/cache' );\n }\n Fs::mkdir( $gwTargetPath.'/cache' );\n \n // bearbeiten der gmod includes\n if( Fs::exists( $gwTargetPath.'/conf/include/available_gmod' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/available_gmod in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/available_gmod' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/available_gmod' );\n \n if( Fs::exists( $gwTargetPath.'/conf/include/gmod' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/gmod in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/gmod' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/gmod' );\n \n // bearbeiten der module includes\n if( Fs::exists( $gwTargetPath.'/conf/include/available_module' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/available_module in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/available_module' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/available_module' );\n \n if( Fs::exists( $gwTargetPath.'/conf/include/module' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/module in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/module' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/module' );\n \n // bearbeiten der metadata includes\n if( Fs::exists( $gwTargetPath.'/conf/include/metadata' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/metadata in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/metadata' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/metadata' );\n\n \n // kopieren der conf\n // conf kann aus dem request genommen werden\n // wenn nicht im request wird in der package.bdl gesucht\n $confKey = $gateway->getConfKey();\n \n\n if( $confKey )\n {\n $this->protocol->info( \"Use configuration {$confKey}\" );\n \n if( Fs::exists( $gwTargetPath.'/conf/space/'.$confKey ) )\n {\n Fs::copyContent( $gwTargetPath.'/conf/space/'.$confKey, $gwTargetPath.'/conf/' );\n }\n else \n {\n \n $fatal = <<<FATAL\nDie angefragte Konfiguration: {$confKey} existiert nicht im Gateway: {$gwTargetPath}/conf/space/\nFATAL;\n \n $this->protocol->fatal( $fatal ); \n throw new GaiaException( $fatal );\n }\n \n }\n\n \n\n }",
"public function setBillingAddressId($id);",
"public function getGateway() {\n\t\treturn self::$gateways[mt_rand(0, (self::$COUNT-1))];\n\t}",
"public function setSourceGateway($var)\n {\n GPBUtil::checkString($var, True);\n $this->source_gateway = $var;\n\n return $this;\n }",
"public function __construct( GatewayInitializer $gateway )\n {\n $this->gateway = $gateway->init();\n }",
"public function setDoorId()\n {\n if(isset($_GET['doorId']))\n {\n echo 'const doorId = '.$_GET['doorId'].';';\n }\n else\n {\n $config = new Config;\n echo 'const doorId = '.$config->defaultDoor.';';\n }\n }",
"function setCountryId( $value )\n {\n $this->CountryID = $value;\n }",
"public function getGateway(): ?GatewayInterface\n {\n if (null === $this->_gateway) {\n $this->_gateway = Commerce::getInstance()->getGateways()->getGatewayById($this->gatewayId);\n }\n\n return $this->_gateway;\n }",
"public static function gateway($key = '')\n {\n $payment_gateways = Cache::get(CACHE_PARAM_PAYMENT_GATEWAY, null);\n if (is_null($payment_gateways)) {\n $invoice_status = self::all();\n $payment_gateways = [];\n foreach ($invoice_status as $status) {\n $payment_gateways[strtoupper($status->name)] = $status->id;\n }\n Cache::put(CACHE_PARAM_PAYMENT_GATEWAY, $payment_gateways, 43200);\n }\n\n return empty($key) ? $payment_gateways : $payment_gateways[$key];\n }",
"public static function setFactory( GatewayFactory $cFactory = null )\n\t{\n\t\tstatic::$g_cFactory = $cFactory;\n\t}",
"public function setRouteID($value) {\n\t\t$this->_route_id = $value;\n\t}",
"public function set_id($setid){\n $this->id = $setid;\n }",
"public function update(Request $request, Gateway $gateway)\n {\n // dd($request, $gateway);\n $gateway->update($request->all());\n toastr()->success('Gateway Updated');\n return redirect()->back();\n }",
"public function add_gateway($id = NULL) {\n $data['title'] = \"Add New Channel\";\n\n $this->settings_model->_table_name = \"tbl_gateway_type\"; //table name\n $this->settings_model->_order_by = \"id\";\n $data['typeinfo'] = $this->settings_model->get();\n\n if (!empty($id)) \n {\n // retrive data from db by id \n \n $this->settings_model->_table_name = \"tbl_channel\"; //table name\n $this->settings_model->_order_by = \"id\";\n $val = $this->settings_model->get_by(array('id' => $id), TRUE);\n\n if ($val) { // get general info by id\n $data['ginfo'] = $val; // assign value from db \n }\n $data['cinfo'] = $this->settings_model->get_gateway_info($id);\n\n }\n \n $data['subview'] = $this->load->view('admin/gateway/gatewayadd', $data, TRUE);\n $this->load->view('admin/_layout_main', $data);\n }",
"function add_shipping_id( $available_gateways ) {\n $shipping_id = get_shipping_id();\n\n echo '<div class=\"card--inline m-b-3 position-right position-right--50\">';\n if ( isset($shipping_id) && $shipping_id ) {\n echo '<p>Shipping ID: ' . $shipping_id . '</p>';\n } else {\n echo '<p>Please contact RANDYS to add a Shipper Account ID to your account.</p>';\n }\n echo '</div>';\n}",
"public function blockGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Updated Gateway to be Blocked';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n $gateway->REG_FLAG = 4;\n $gateway->save();\n\n return \"success\";\n }",
"public function setVpnGatewayInterface($var)\n {\n GPBUtil::checkInt32($var);\n $this->vpn_gateway_interface = $var;\n\n return $this;\n }",
"public function setShippingOptionId($id){\n $this->shippingOptionId = $id;\n }",
"public function setSourceGatewayIp($var)\n {\n GPBUtil::checkString($var, True);\n $this->source_gateway_ip = $var;\n\n return $this;\n }",
"public function setclient_id($value);",
"Public Function setNetworkId($NetworkId) {\n\t\t$this->networkId = $NetworkId;\n\t\n\t}",
"public function set_id_pg($id=0){\n\t\t\t$id = (int) $id;\n\t\t\tif($id!=0){\n\t\t\t\t$this->ipg_id=$id;\n\t\t\t}else{\n\t\t\t\t$this->ipg_id=0;\n\t\t\t}\n\t\t}",
"function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }",
"public function setID($id) {\n $this->id = $id; \n }",
"public function gateway($name = null)\n {\n $name = $name ?: $this->getGateway();\n\n if ( ! isset($this->gateways[$name]))\n {\n $this->gateways[$name] = $this->resolve($name);\n }\n\n return $this->gateways[$name];\n }",
"public function test_set_gateway_config()\n {\n\n $payumBuilder = m::spy('Payum\\Core\\PayumBuilder');\n $config = [\n 'gatewayConfigs' => [\n 'gatewayName' => [\n 'factory' => 'factory',\n 'username' => 'username',\n 'password' => 'password',\n ],\n 'gatewayName2' => [\n 'factory' => 'stdClass',\n 'username' => 'username',\n 'password' => 'password',\n ],\n ],\n 'storage.gatewayConfig' => 'eloquent',\n ];\n $app = m::spy('Illuminate\\Contracts\\Foundation\\Application');\n\n $gatewayConfig = m::spy('Recca0120\\LaravelPayum\\Model\\GatewayConfig');\n $gatewayFactory = m::spy('Payum\\Core\\GatewayFactoryInterface');\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $app->shouldReceive('make')->andReturn($gatewayConfig);\n\n $gatewayConfig\n ->shouldReceive('newQuery')->andReturnSelf()\n ->shouldReceive('get')->andReturnSelf()\n ->shouldReceive('all')->andReturn([$gatewayConfig])\n ->shouldReceive('getGatewayName')->once()->andReturn('fooGateway')\n ->shouldReceive('getFactoryName')->once()->andReturn('fooFactoryName')\n ->shouldReceive('getConfig')->once()->andReturn([\n 'foo' => 'bar',\n ]);\n\n $manager = new PayumBuilderManager($payumBuilder, $config, $app);\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $manager->setGatewayConfig();\n\n foreach ($config['gatewayConfigs'] as $gatewayName => $gatewayConfig) {\n $payumBuilder->shouldReceive('addGatewayFactory')->with($gatewayName, m::on(function ($closure) use ($gatewayConfig, $gatewayFactory) {\n $closure($gatewayConfig, $gatewayFactory);\n\n return true;\n }));\n }\n }",
"public function setId($id) {\n $this->vendorData[\"ID_VENDOR\"] = (int)$id;\n }",
"private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}",
"public function setID($id){\n $this->id = $id;\n }",
"public function setIDSender($idSender){\n $this->IDsender = $idSender;\n }",
"function setId($id)\n\t{\n\t\t// Set state ID and wipe data\n\t\t$this->_id\t\t\t= $id;\n\t\t$this->_state\t\t= null;\n\t\t$this->_suburbs\t\t= null;\n\t}",
"public function __construct(DataGatewayInterface $gateway)\n {\n $this->gateway = $gateway;\n }",
"public function setID($id){\n $this->ID = $id;\n }",
"public function setID($id);",
"public function delete_gateway($id = NULL) \n {\n $this->settings_model->_table_name = \"tbl_channel\"; // table name\n $this->settings_model->_primary_key = \"id\"; // $id\n $this->settings_model->delete($id); \n \n $type = \"success\";\n $message = \"频道信息成功删除!\";\n set_message($type, $message);\n redirect('admin/gateway/gateway');\n \n }",
"public function update(UpdatePaymentGatewaysRequest $request, $id)\n {\n if (! Gate::allows('payment_gateway_edit')) {\n return prepareBlockUserMessage();\n }\n $request = $this->saveFiles($request);\n $payment_gateway = PaymentGateway::findOrFail($id);\n $payment_gateway->update($request->all());\n\n\n flashMessage( 'success', 'update' );\n return redirect()->route('admin.payment_gateways.index');\n }",
"public function setID($id) {\n\t\t$this->id = $id;\n\t}",
"public function setID($id)\n {\n $this->ID = $id;\n }",
"public function setShipmentId($id)\n {\n if (is_string($id) || is_numeric($id)) {\n $this->options['ShipmentId'] = $id;\n } else {\n $this->log('Tried to set ShipmentId to invalid value', 'Warning');\n\n return false;\n }\n }",
"public function setID($id)\n {\n $this->id = $id;\n }",
"public function setMicrosoftTunnelSiteId(?string $value): void {\n $this->getBackingStore()->set('microsoftTunnelSiteId', $value);\n }",
"public function registerGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Registered a Gateway';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n $this->validate($request,['GATEWAY_NAME'=>'required']);\n if (!isset($request->GATEWAY_ID, $request->FLOOR_ID,\n $request->GATEWAY_NAME)) {\n abort(400, 'Malformed syntax.');\n }\n\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n\n if ($gateway->REG_FLAG == 1) {\n \tabort(409, 'Entity is already registered');\n }\n else {\n \t$gateway->FLOOR_ID = $request->FLOOR_ID;\n\t $gateway->ROOM_ID = $request->ROOM_ID;\n\t $gateway->GATEWAY_NAME = $request->GATEWAY_NAME;\n\t $gateway->REG_FLAG = 1;\n\t $gateway->save();\n }\n\n return response($gateway, 201);\n }",
"function set_region_id($link, $data, $value) // Colorize: green\n { // Colorize: green\n return set_property_value($link, $data, \"region_id\", $value); // Colorize: green\n }",
"public function __construct(PaymentGatewayInterface $paymentGateway)\n {\n $this->paymentGateway = $paymentGateway;\n }",
"public function getVpnGatewayInterface()\n {\n return isset($this->vpn_gateway_interface) ? $this->vpn_gateway_interface : 0;\n }",
"public function deleteGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Deleted a Gateway';\n\n //Find Gateway from DB\n $gateway = Gateway::findorFail($request->GATEWAY_ID);\n\n\n\n if($request->KEY == 'gateway'){\n $remote_ip = $gateway->GATEWAY_IP;\n $remote_port = env(\"PORT_GATEWAY\");\n\n if($gateway){\n //Get Devices based on Gateway\n $devices = $gateway->devices()->get();\n\n //Uncomment for Production\n //Delete Plotted Device on Floor Map\n foreach ($gateway->devices()->get() as $key => $device) {\n $this->deleteDevicePlot($device);\n }\n\n //if request has \"FORCE\" parameter, directly delete gateway form db\n if ($request->FORCE == true) {\n\n $gateway->devices()->delete();\n $gateway->delete();\n $this->auditLogs($ip,$host,$module,$instruction);\n\n return \"success\";\n }\n //Unregister Gateway to OPS\n $data = '{\"mode\":\"deleteGateway\"}';\n $message = $this->encryptMessage($data);\n $sRet = $this->sendToSocket($remote_ip,$remote_port,$message);\n\n $retArr = json_decode($sRet,true);\n if($retArr[\"function\"] == 'gatewayDeleted'){\n //Uncomment for Production\n //Delete Devices based on Gateway\n $gateway->devices()->delete();\n $gateway->delete();\n $this->auditLogs($ip,$host,$module,$instruction);\n }else{\n $this->auditLogs($ip,$host,$module,'Cannot contact Gateway to be:'.$gateway->GATEWAY_NAME);\n return 'gateway';\n }\n\n return \"success\";\n }\n }else{\n $gateway->REG_FLAG = 9;\n $gateway->save();\n return \"success\";\n }\n\n }",
"function set_id($id)\r\n {\r\n $this->set_default_property(self :: PROPERTY_ID, $id);\r\n }",
"public function set($id, $instance);",
"public function setDestinationId($destinationId):void\r\n {\r\n $this->destinationId = $destinationId;\r\n }",
"function setId($id)\n\t{\n\t\t// Set suburb ID and wipe data\n\t\t$this->_id\t\t\t= $id;\n\t\t$this->_suburb\t= null;\n\t}",
"public function setID($id){\n $this->id=$id;\n }",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"function set_id($id)\n {\n $this->id = $id;\n }",
"public function setBillingProfileId($billing_profile_id);",
"function setGroupID( $groupID ) \n {\n $this->setValueByFieldName( 'navbargroup_id', $groupID);\n }",
"public function __call($gateway_name, array $data = array()) {\n\t\t\n\t\t$sdata = serialize($data);\n\t\tif(isset($this->_gateways[$gateway_name][$sdata]))\n\t\t\treturn $this->_gateways[$gateway_name][$sdata];\n\t\t\n\t\t$gateway = $this->getGateway($gateway_name);\n\t\t\n\t\tif($gateway instanceof self) {\n\t\t\t$gateway->setName($gateway_name);\n\t\t\t$gateway->setData($data);\n\t\t}\n\t\t\n\t\treturn $this->_gateways[$gateway_name][$sdata] = $gateway;\n\t}",
"function set_agreement_id($agreement_id)\n {\n $this->set_default_property(self :: PROPERTY_AGREEMENT_ID, $agreement_id);\n }",
"public function delete_gateway_device()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $file = new File(self::FILE_NETWORK);\n $file->delete_lines('/GATEWAYDEV=\\\".*\\\"/i');\n\n $interfaces = new Iface_Manager();\n $ethlist = $interfaces->get_interface_details();\n $wanif = \"\";\n\n foreach ($ethlist as $eth => $info) {\n if (isset($info['role']) && ($info['role'] == Role::ROLE_EXTERNAL)) {\n $wanif = $eth;\n break;\n }\n }\n\n if ($wanif)\n $this->set_gateway_device($wanif);\n }",
"function set_id($id)\n {\n $this->set_default_property(self :: PROPERTY_ID, $id);\n }",
"function set_client($client_id) {\n $this->_client_id_param = array(\"clientID\" => $client_id);\n }",
"public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}",
"protected function registerGateways()\n {\n $this->container['gateway.fastcgi'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\Gateway\\Fastcgi($c['dispatcher']);\n });\n\n $this->container['gateway.php-fpm'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\Gateway\\PhpFpm($c['dispatcher']);\n });\n }",
"public function getSourceGateway()\n {\n return $this->source_gateway;\n }"
]
| [
"0.7070939",
"0.7032529",
"0.69883823",
"0.6752199",
"0.6599843",
"0.654597",
"0.64548",
"0.62824106",
"0.60924757",
"0.60924757",
"0.6017569",
"0.59679115",
"0.5948079",
"0.57182544",
"0.56409574",
"0.56119275",
"0.55651915",
"0.55635893",
"0.5553248",
"0.5455811",
"0.5339118",
"0.5336203",
"0.52948576",
"0.52939916",
"0.52882975",
"0.52481544",
"0.522268",
"0.5197363",
"0.5192688",
"0.5158405",
"0.5118489",
"0.51157737",
"0.5112989",
"0.510541",
"0.5032417",
"0.49995908",
"0.496527",
"0.49550432",
"0.49509418",
"0.49234182",
"0.49149585",
"0.48776698",
"0.48723397",
"0.48588297",
"0.4850421",
"0.48484838",
"0.48466083",
"0.48432213",
"0.48414087",
"0.4828558",
"0.48192948",
"0.48151737",
"0.48025724",
"0.47975245",
"0.47960675",
"0.47874522",
"0.47775996",
"0.4770707",
"0.4770098",
"0.4761751",
"0.47565094",
"0.4743799",
"0.4740161",
"0.4731643",
"0.47313172",
"0.47248903",
"0.47187695",
"0.4691955",
"0.4686862",
"0.4685426",
"0.46753123",
"0.46751034",
"0.46739486",
"0.46604314",
"0.46594682",
"0.46555716",
"0.46335968",
"0.46335688",
"0.46301538",
"0.46289453",
"0.46264052",
"0.46110985",
"0.46102414",
"0.46069777",
"0.46056694",
"0.459458",
"0.45942694",
"0.45942694",
"0.45875725",
"0.45801136",
"0.4579156",
"0.45785373",
"0.45775875",
"0.45757094",
"0.45739263",
"0.45720237",
"0.45604503",
"0.45583013",
"0.45557144"
]
| 0.65958315 | 5 |
Set Amount Sets the amount of the charge | public function Amount($amount) {
$this->Param('amount', $amount);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setAmount($amount);",
"public function setAmount($amount){\n\n $this->amount = $amount;\n\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n }",
"public function setAmount($value)\n\t{\n\t\treturn $this->set('Amount', $value);\n\t}",
"public function setAmount($value) \n {\n $this->_fields['Amount']['FieldValue'] = $value;\n return $this;\n }",
"public function setAmount($value)\n {\n $this->_fields['Amount']['FieldValue'] = $value;\n return $this;\n }",
"public function setChargesAttribute($amount)\n {\n $this->attributes['charges'] = formatAmount($amount);\n }",
"protected function setAmount()\n {\n if ( ! isset( $_POST['amount'] ) ) {\n $this->error = true;\n $this->data['error']['amount'] = 'Please enter a donation amount.';\n return;\n }\n \n $amount = trim( $_POST['amount'] );\n\n // Remove illegal characters\n $regex = '/[[^0-9.]]/';\n $value = preg_replace( $regex, '', $amount );\n \n \tif ( $value && is_numeric( $value ) && $value > 0 ) {\n $value = floor( $value * 100 ); // Set the amount in cents.\n \t\t$this->data['amount'] = $value;\n \t} else {\n \t\t$this->data['amount'] = 0;\n \t}\n }",
"public function amount($value) {\n $this->annotations['amount'] = $value;\n return $this;\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }",
"public function setAmount()\n {\n $exact = $this->getOriginalPurgeValue('amount_exact');\n $percentage = $this->getOriginalPurgeValue('amount_percentage');\n\n $this->amount = $this->is_percentage\n ? $percentage\n : $exact;\n }",
"public function setAmount($amount)\n {\n $this->amount = Checker::int($amount, self::AMOUNT_MIN, self::AMOUNT_MAX, \"amount\");\n }",
"public function setAmount($amount)\n {\n return $this->setData(self::AMOUNT, $amount);\n }",
"public function setTransactionAmount($value) \n {\n $this->_fields['TransactionAmount']['FieldValue'] = $value;\n return;\n }",
"public function setGiftcardAmount($value);",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n\n return $this;\n }",
"public function setAmount($var)\n {\n GPBUtil::checkString($var, True);\n $this->amount = $var;\n\n return $this;\n }",
"public function setAmount(Amount $amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setCustomGiftcardAmount($value);",
"public function setAmount(string $amount)\r\n {\r\n $this->amount = $amount;\r\n\r\n return $this;\r\n }",
"public function withAmount($value)\n {\n $this->setAmount($value);\n return $this;\n }",
"public function withAmount($value)\n {\n $this->setAmount($value);\n return $this;\n }",
"public function setAmount($intAmount);",
"public function setAmount($amount)\n {\n $this->_amount = $amount;\n return $this;\n }",
"public function setChargeAmount(string $chargeAmount): self\n {\n $this->options['chargeAmount'] = $chargeAmount;\n return $this;\n }",
"public function setAmount($amount)\r\n {\r\n $this->amount = $amount;\r\n\r\n return $this;\r\n }",
"public function setAmount($amount)\n {\n $this->_amount = (int) $amount;\n return $this;\n }",
"public function setAmount(Money $amount): self\n {\n $this->initialized['amount'] = true;\n $this->amount = $amount;\n\n return $this;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"protected function amount($amount)\n {\n return $this->setAmount($amount);\n }",
"public function setAmount(Money $amount) {\n\t\t$this->amount = $amount;\n\t\treturn $this;\n\t}",
"public function setBaseDiscountAmount($amount);",
"public function setAmount($amount)\n\t{\n\t\t$this->amount = $amount;\n\n\t\treturn $this;\n\t}",
"public function charge($amount)\n {\n if ($this->isValid(false, false, false, $amount)) {\n $this->setBalanceDelta(\n -$amount\n )->setBalance(\n $this->getBalance() - $amount\n )->setHistoryAction(\n \\Magento\\GiftCardAccount\\Model\\History::ACTION_USED\n );\n }\n\n return $this;\n }",
"public function setDiscountAmount($amount);",
"public function setAmountMoney(Money $amountMoney): void\n {\n $this->amountMoney = $amountMoney;\n }",
"public function setAmount($var)\n {\n GPBUtil::checkFloat($var);\n $this->amount = $var;\n\n return $this;\n }",
"public function setCharge($value)\n {\n $this->_fields['Charge']['FieldValue'] = $value;\n return $this;\n }",
"public function setAmount($amount)\n {\n if ($amount instanceof DBMoney) {\n $this->setField('Money', $amount);\n } elseif ($this->Status == 'Created' && is_numeric($amount)) {\n $this->MoneyAmount = $amount;\n }\n return $this;\n }",
"public function setAmount(\\horstoeko\\ubl\\entities\\cbc\\Amount $amount)\n {\n $this->amount = $amount;\n return $this;\n }",
"public function setTaxAmount($amount);",
"public function setCharge($Charge){\n $this->Charge = $Charge;\n }",
"public function setAmount($balance)\n {\n $this->amount = (int) $balance;\n }",
"public function setAmount($amount)\n {\n if (!empty($amount)) {\n $this->amount = $amount;\n }\n\n return $this;\n }",
"public function chargeCard($amount)\n {\n if ($this->isValidCard)\n $this->balance += $this->parseAmount($amount);\n }",
"public function setamount($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (double) $v;\n }\n\n if ($this->amount !== $v) {\n $this->amount = $v;\n $this->modifiedColumns[] = ActionTypePeer::AMOUNT;\n }\n\n\n return $this;\n }",
"public function setAmount($var)\n {\n GPBUtil::checkInt64($var);\n $this->amount = $var;\n\n return $this;\n }",
"public function update($amount)\n {\n $currentBalance = auth()->user()->balance->amount;\n $newAmount = $currentBalance + $amount;\n auth()->user()->balance()->update(['amount' => $newAmount]);\n }",
"public function setAmount($amount)\n {\n $amount = floatval(str_replace(' ','',$amount));\n\n if (!Amount::validate($amount)) {\n throw new AmountException($amount);\n }\n $this->amount = $amount;\n\n return $this;\n }",
"public function setAmountAttribute($input)\n {\n $this->attributes['amount'] = $input ? $input : null;\n }",
"public function setAmount($amount)\n {\n try {\n $this->amount = Validation::getProperAmount($amount);\n return $this;\n } catch (\\InvalidArgumentException $iae) {\n throw $iae; // rethrow the exception to handle further up in the stack.\n }\n }",
"public function set_amountInvoice($amountInvoice) {\n $this->amountInvoice = (double)$amountInvoice;\n }",
"public function setCharges($charges)\n {\n $this->charges = $charges;\n }",
"public function setAmount($amount = 0, $wholeAmt) {\n $amt = array(\n 'x_amount'=>$this->cleanAmt($amount, $wholeAmt),\n );\n $this->NVP = array_merge($this->NVP, $amt); \n }",
"function deposit($amount) {\n $this->balance += $amount;\n }",
"public function setAmountCapAttribute($amount)\n {\n $this->attributes['amount_cap'] = formatAmount($amount);\n }",
"public function setBaseShippingAmount($amount);",
"public function setAmountAttribute($input)\n { \n $this->attributes['amount'] = $input ? $input : null;\n }",
"function SetAmountSoldOutside ($amount = 0) {\n\t\n}",
"public function setAwardAmount($value)\n {\n return $this->set('AwardAmount', $value);\n }",
"public function setBaseAmount($amount) {\r\n $this->baseAmount = NumberDataTypeHelper::truncate(floatval($amount), 2);\r\n }",
"public function withCharge($value)\n {\n $this->setCharge($value);\n return $this;\n }",
"public function setAmount(Money $amount): PricingTier\n {\n $this->offsetSet(self::AMOUNT, $amount);\n return $this;\n }",
"public function setBaseTaxAmount($amount);",
"protected function setTargetAmountAttribute($value)\n {\n $this->attributes['target_amount'] = preg_replace('/[,]/', '', $value);\n }",
"public function setStoneAmount($value)\n {\n return $this->set(self::_STONE_AMOUNT, $value);\n }",
"public function setAttackDamage(float $amount): void\n {\n $this->attackDamage = $amount;\n }",
"public function setAmount($value) {\n if(strlen($value) > 8 ){\n throw new ValueException(\"Value \".$value.\" is higher than 8\");\n }\n $this->Importe = number_format($value,$this->Exponente,'','');\n }",
"public function deposit($amount)\n {\n $this->balance += $amount;\n $this->save();\n }",
"public function setBaseShippingDiscountAmount($amount);",
"public function request($amount)\n {\n if (!\\is_numeric($amount)) {\n throw new \\InvalidArgumentException('The amount must be numeric');\n }\n\n $this->amount = $amount;\n\n return $this;\n }",
"public function request($amount)\n {\n if (!\\is_numeric($amount)) {\n throw new \\InvalidArgumentException('The amount must be numeric');\n }\n\n $this->amount = $amount;\n\n return $this;\n }",
"public function setShippingAmount($amount);",
"public function setPaymentAmountType($value)\n {\n $this->_fields['PaymentAmountType']['FieldValue'] = $value;\n return $this;\n }",
"public function set_amountCustomer($amountCustomer) {\n $this->amountCustomer = (double)$amountCustomer;\n }",
"public function times($amount)\n {\n $this->amount = $amount;\n\n return $this;\n }",
"public function updateCredits($amount)\n {\n return $this->credit()->update(['amount' => $amount]);\n }",
"public function setAmountAttribute($input)\n {\n if ($input != '') {\n $this->attributes['amount'] = $input;\n } else {\n $this->attributes['amount'] = null;\n }\n }",
"public function setCharges($charges);",
"public function addExpense($amount)\n {\n $account = Account::findOne([\n 'username' => $this->getCurrentUser()->username,\n ]);\n\n $account->balance -= $amount;\n\n $account->update(true, ['balance']);\n }",
"public function setPaymentAuthorizationAmount($amount);",
"public function setDiscountTaxCompensationAmount($amount);",
"public function setValue(string $value): AmountBuilderInterface\n {\n $this->amount->setValue($value);\n\n return $this;\n }",
"public function setBaseDiscountTaxCompensationAmount($amount);",
"public function setAmount(float $amount): InitAbstract\n\t{\n\t\tparent::setAmount($amount);\n\n\t\t$this->setData(null, 'minimumAmount');\n\t\t$this->setData(null, 'maximumAmount');\n\n\t\treturn $this;\n\t}",
"public function setFreeAfterAmountAttribute($amount)\n {\n $this->attributes['free_after_amount'] = formatAmount($amount);\n }",
"public function creditCard($amount)\n {\n if ($this->isValidCard)\n $this->balance -= $this->parseAmount($amount);\n }",
"public function setReimbursedAmount($value)\n {\n $this->_fields['ReimbursedAmount']['FieldValue'] = $value;\n return $this;\n }",
"public function setDisplayAmount($displayAmount);",
"public function setDisplayAmount($displayAmount);",
"public function credit(int $accountNumber, float $amount): void\n {\n $this->getAccount($accountNumber)->credit($amount);\n }"
]
| [
"0.7896932",
"0.7879314",
"0.775862",
"0.775862",
"0.77047336",
"0.7662618",
"0.7505507",
"0.73995864",
"0.7178216",
"0.7174205",
"0.71691644",
"0.71682084",
"0.71682084",
"0.71682084",
"0.71682084",
"0.7150268",
"0.7088638",
"0.7002675",
"0.69585377",
"0.6946819",
"0.69129676",
"0.6777057",
"0.6767641",
"0.67661446",
"0.6750967",
"0.6706792",
"0.6706792",
"0.6706683",
"0.6672976",
"0.66665566",
"0.6642629",
"0.66261923",
"0.6606484",
"0.660306",
"0.660306",
"0.660306",
"0.660306",
"0.6563762",
"0.63751525",
"0.6367763",
"0.6352448",
"0.6351094",
"0.6331678",
"0.6294751",
"0.6285516",
"0.6275127",
"0.62613726",
"0.6252844",
"0.6234597",
"0.62302125",
"0.6206855",
"0.6189263",
"0.618048",
"0.6162014",
"0.61603624",
"0.6142533",
"0.612445",
"0.60823196",
"0.60806525",
"0.6056736",
"0.605396",
"0.60454625",
"0.6042435",
"0.6022765",
"0.5976095",
"0.5975016",
"0.59711826",
"0.5963435",
"0.59562063",
"0.59550023",
"0.594266",
"0.59146947",
"0.59137475",
"0.58843046",
"0.58744",
"0.58569264",
"0.5856134",
"0.58523357",
"0.58441114",
"0.58441114",
"0.58330065",
"0.5832271",
"0.58298093",
"0.58181584",
"0.58168715",
"0.5800375",
"0.57972527",
"0.57910705",
"0.57860065",
"0.57558316",
"0.57548445",
"0.5742342",
"0.5742109",
"0.5732936",
"0.5724814",
"0.57178825",
"0.570943",
"0.570943",
"0.5704933"
]
| 0.6024503 | 64 |
Set Credit Card Sets the credit card information | public function CreditCard($name, $number, $exp_month, $exp_year, $security_code = FALSE) {
$number = str_replace(' ','',$number);
$number = trim($number);
$this->Param('name', $name, 'credit_card');
$this->Param('card_num', $number, 'credit_card');
$this->Param('exp_month', $exp_month, 'credit_card');
$this->Param('exp_year', $exp_year, 'credit_card');
if($security_code) {
$this->Param('cvv', $security_code, 'credit_card');
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCreditCardData($data=null) {\n if(!is_array($data)) {\n $p = $this->getPayment();\n $data = array(\n 'CREDITCARDTYPE' => $p['cardType'],\n 'ACCT' => $p['cardNumber'], //'4532497022010364',\n 'EXPDATE' => $p['cardExpirationMonth'] . $p['cardExpirationYear'],\n 'CVV2' => $p['securityId']\n );\n }\n $this->_creditCardData = $data;\n }",
"public function setCreditCard($card_id, $num, $cvv, $date)\n {\n $this->cardid = $card_id;\n $this->creditcard_number = $num;\n $this->cvv = $cvv;\n $this->validation_date = $date;\n }",
"function setCardnumber($cardnumber) {\n\t\tif (strlen($cardnumber)>=13 and strlen($cardnumber)<=16 and is_numeric($cardnumber)) {\n\t\t\t$this->cardnumber = $cardnumber;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Credit Card Number\";\n\t\t}\n\t}",
"function setCardnumber($cardnumber) {\n\t\tif (strlen($cardnumber)>=13 and strlen($cardnumber)<=16 and is_numeric($cardnumber)) {\n\t\t\t$this->cardnumber = $cardnumber;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Credit Card Number\";\n\t\t}\n\t}",
"public function setCard($parameters = NULL) {\n\n if ($parameters === NULL) {\n $this->card = $parameters;\n return;\n }\n\n if (is_array($parameters)) {\n $this->card = (empty($parameters) ? NULL : new CreditCard($parameters));\n }\n }",
"public function setCreditCard($creditCard)\n {\n $this->creditCard = $creditCard;\n\n return $this;\n }",
"public function setCredit($credit) {\n $this->data['credit'] = $credit;\n }",
"public function setCard(?bool $card): void\n {\n $this->card = $card;\n }",
"public function setCreditCard($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->credit_card !== $v) {\n\t\t\t$this->credit_card = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::CREDIT_CARD;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setCustomerCardId(?string $customerCardId): void\n {\n $this->customerCardId['value'] = $customerCardId;\n }",
"public function setCreditInfo() {\n\t\t$this->creditInfo = $this->photo['title'] . \" by \" . $this->userName;\n\t}",
"function setCC($cc){\n\t\t\t$this->cc = $cc;\n\t\t}",
"public function edit(CreditCard $creditCard)\n {\n //\n }",
"public function creditCardPayment()\n {\n }",
"public function setCreditCard(\n $number,\n $expirationMonth,\n $expirationYear,\n $holder_name\n )\n {\n $this->data->credit_card = new stdClass();\n $this->data->credit_card->number = $number;\n $this->data->credit_card->holder_name = $holder_name;\n $this->data->credit_card->expiration_month = $expirationMonth;\n $this->data->credit_card->expiration_year = $expirationYear;\n\n return $this;\n }",
"public function creditCard($amount)\n {\n if ($this->isValidCard)\n $this->balance -= $this->parseAmount($amount);\n }",
"public function setCreditCard($card_number,$card_exp_year_month,$card_cvc)\n {\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($card_number);\n $creditCard->setExpirationDate( $card_exp_year_month);\n $creditCard->setCardCode($card_cvc);\n // Add the payment data to a paymentType object\n $paymentType = new AnetAPI\\PaymentType();\n $paymentType->setCreditCard($creditCard);\n \n return $paymentType;\n }",
"public function editcardAction()\n {\n $isValidToken = false;\n $token = $this->getRequest()->getParam('t');\n $customer = $this->_getCustomer();\n $api = $this->_getApi();\n $paymentMethods = $api->getPaymentMethods($customer->getId(), true);\n \n foreach($paymentMethods as $key => $pm) {\n if($pm->getData('paymentMethodToken') == $token) {\n $isValidToken = true;\n }\n }\n \n if($isValidToken) {\n \n } else {\n Mage::getSingleton('core/session')->addError('Credit card token is not valid. Please try again.');\n $this->_redirect('payments/customer/creditcards');\n }\n \n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }",
"public function setCard(?string $card): self\n {\n $this->card = $card;\n\n return $this;\n }",
"public function setCardDetails($creditCardNo = null, $expiryMonth = null, $expiryYear = null, $cvv = null)\n {\n if ($expiryMonth != null) {\n $expiryMonth = Validation::getProperExiryMonth($expiryMonth);\n }\n if ($expiryYear != null) {\n $expiryYear = Validation::getProperExpiryYear($expiryYear);\n }\n if (!Validation::validateCardDetails($creditCardNo == null ? $this->creditCardNo : $creditCardNo, $expiryMonth == null ? $this->expiryMonth : $expiryMonth, $expiryYear == null ? $this->expiryYear : $expiryYear, $cvv == null ? $this->cvv : $cvv)) {\n throw new \\InvalidArgumentException(\"Invalid credit card details\");\n }\n if ($creditCardNo != null) {\n $creditCardNo = str_replace(\" \", \"\", $creditCardNo); // remove all spaces\n $creditCardNo = str_replace(\"-\", \"\", $creditCardNo); // remove all dashes\n if (!Validation::isSupportedCard($creditCardNo)) {\n throw new CardTypeUnsupportedException(\"Card type is unsupported.\");\n }\n }\n if ($creditCardNo != null)\n $this->creditCardNo = $creditCardNo;\n\n if ($expiryMonth != null)\n $this->expiryMonth = $expiryMonth;\n\n if ($expiryYear != null)\n $this->expiryYear = $expiryYear;\n\n if ($cvv != null)\n $this->cvv = $cvv;\n\n return $this;\n }",
"public function set_card(INT $_card){\n $this->_card = $_card;\n\n return $this;\n }",
"public function storeCreditCardWithNumberCard($token)\n {\n $user = User::find(\\Auth::user()->id);\n\n try {\n if (empty($user->stripe_id)) {\n $user->createAsStripeCustomer($token);\n } else {\n $user->updateCard($token);\n }\n } catch (\\Exception $ex) {\n \\Log::error(\"Can not update credit card. \" . $ex->getMessage());\n throw new UpdateCreditCardException();\n }\n }",
"public function setCardNonce(?string $cardNonce): void\n {\n $this->cardNonce['value'] = $cardNonce;\n }",
"public function editCustomerCreditCard($data) {\n\t\t$soapclient = new SoapClient($this->pci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'EziDebitCustomerID' => $data['eziDebitCID'],\n\t\t\t\t'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'NameOnCreditCard' => $data['cardName'],\n\t\t\t\t'CreditCardNumber' => $data['cardNumber'],\n\t\t\t\t'CreditCardExpiryYear' => $data['cardExpiryYear'],\n\t\t\t\t'CreditCardExpiryMonth' => $data['cardExpiryMonth'],\n\t\t\t\t'Reactivate' => $data['reactivate'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $soapclient->editCustomerCreditCard($params);\n\t}",
"function commerce_braintree_creditcard_edit_form($form, &$form_state, $sid) {\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n $form_state['build_info']['files']['form'] = drupal_get_path('module', 'commerce_braintree') . '/commerce_braintree.form.inc';\n $sub = commerce_braintree_subscription_local_get(array('sid' => $sid), FALSE);\n $payment = commerce_payment_method_instance_load('braintree|commerce_payment_braintree');\n $creditcard = commerce_braintree_creditcard_get_by_token($sub['token']);\n $billing_address = isset($creditcard->billingAddress) ? $creditcard->billingAddress : null;\n $form['payment_method'] = array(\n '#type' => 'fieldset', \n '#title' => t('Payment Method Details'),\n );\n $form['payment_method']['ca_cardholder_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Cardholder Name'),\n '#default_value' => isset($creditcard->cardholderName) ? $creditcard->cardholderName : '',\n );\n // NOTE: A hidden field is changable via Firebug. Value is not.\n // Because there's no validation, this would have allowed any user with access to this form\n // to change any credit card on the website for any user, providing they guess another ca_token.\n //$form['payment_method']['ca_token'] = array('#type' => 'value', '#value' => $token);\n $form['payment_method']['sid'] = array('#type' => 'value', '#value' => $sid);\n \n\n \n // Prepare the fields to include on the credit card form.\n $fields = array(\n 'code' => '',\n );\n\n // Add the credit card types array if necessary.\n $card_types = array_diff(array_values($payment['settings']['card_types']), array(0));\n if (!empty($card_types)) {\n $fields['type'] = $card_types;\n }\n \n $defaults = array(\n 'type' => isset($creditcard->cardType) ? $creditcard->cardType : '',\n 'number' => isset($creditcard->maskedNumber) ? $creditcard->maskedNumber : '', \n 'exp_month' => isset($creditcard->expirationMonth) ? $creditcard->expirationMonth : '', \n 'exp_year' => isset($creditcard->expirationYear) ? $creditcard->expirationYear : '',\n );\n \n // load oder\n $order = commerce_order_load($sub['order_id']);\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n // get profile id\n $profile_id = $order_wrapper->commerce_customer_billing->profile_id->value();\n \n // load customer profile\n $profile = commerce_customer_profile_load($profile_id);\n \n if (isset($profile->commerce_customer_address['und']['0']['first_name'])) {\n $profile->commerce_customer_address['und']['0']['first_name'] = isset($billing_address->firstName) ? $billing_address->firstName :'' ;\n }\n if (isset($profile->commerce_customer_address['und']['0']['last_name'])) {\n $profile->commerce_customer_address['und']['0']['last_name'] = isset($billing_address->lastName) ? $billing_address->lastName : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['organisation_name'])) {\n // //company\n $profile->commerce_customer_address['und']['0']['organisation_name'] = isset($billing_address->company) ? $billing_address->company :'';\n }\n if (isset($profile->commerce_customer_address['und']['0']['administrative_area'])) {\n //state\n $profile->commerce_customer_address['und']['0']['administrative_area'] = isset($billing_address->region) ? $billing_address->region : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['premise'])) {\n //address 2\n $profile->commerce_customer_address['und']['0']['premise'] = isset($billing_address->extendedAddress) ? $billing_address->extendedAddress : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['locality'])) {\n //city\n $profile->commerce_customer_address['und']['0']['locality'] = isset($billing_address->locality) ? $billing_address->locality : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['postal_code'])) {\n //postal code\n $profile->commerce_customer_address['und']['0']['postal_code'] = isset($billing_address->postalCode) ? $billing_address->postalCode : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['thoroughfare'])) {\n // address 1\n $profile->commerce_customer_address['und']['0']['thoroughfare'] = isset($billing_address->streetAddress) ? $billing_address->streetAddress : '';\n }\n \n // Add the field related form elements.\n $form_state['customer_profile'] = $profile;\n // Attach address field to form\n field_attach_form('commerce_customer_profile', $profile, $form, $form_state);\n $form['commerce_customer_address']['#weight'] = '0';\n $form['payment_method'] += commerce_payment_credit_card_form($fields, $defaults);\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n \n \n $form['#validate'][] = 'commerce_braintree_creditcard_edit_form_validate';\n $form['#submit'][] = 'commerce_braintree_creditcard_edit_form_submit';\n return $form;\n}",
"public function setCC()\n {\n }",
"function InfUpdateCreditCard($inf_card_id, $CardNumber='', $ExpirationMonth, $ExpirationYear, $NameOnCard, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->Id = $inf_card_id;\n\tif ($CreditCard<>\"\") {\n\t\t$credit_card->CardNumber = $CardNumber;\n\t}\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->NameOnCard = $NameOnCard;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\treturn $credit_card->save(); // Update Card in Infusionsoft\n}",
"public function __construct($card)\n {\n $this->card = $card;\n }",
"public function creditcardsAction() {\n if (!$this->_getSession()->isLoggedIn()) {\n $this->_redirect('customer/account/login');\n return;\n }\n\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getParams();\n if (isset($data)) {\n $result = $this->_save($data);\n switch ($result->getResponseCode()) {\n case self::RESPONSE_CODE_SUCCESS:\n Mage::getSingleton('core/session')->addSuccess('Credit card has been added.');\n break;\n case self::RESPONSE_CODE_FAILURE:\n Mage::getSingleton('core/session')->addError('Credit card has not been saved. Please try again.');\n break;\n }\n\n $this->_redirect('payments/customer/creditcards');\n }\n }\n\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }",
"public function getCreditCard()\n {\n return $this->creditCard;\n }",
"public function setCreditCardNo($creditCardNo)\n {\n $creditCardNo = str_replace(\" \", \"\", $creditCardNo); // remove all spaces\n $creditCardNo = str_replace(\"-\", \"\", $creditCardNo); // remove all dashes\n if (!Validation::validateCardDetails($creditCardNo, $this->expiryMonth, $this->expiryYear, $this->cvv)) {\n throw new \\InvalidArgumentException(\"Invalid credit card number\");\n }\n if (!Validation::isSupportedCard($creditCardNo)) {\n throw new CardTypeUnsupportedException(\"Card type is unsupported.\");\n }\n $this->creditCardNo = $creditCardNo;\n return $this;\n }",
"private function creditCardPayment($data)\n {\n $creditCard = $this->createSelling(new CreditCard, $data);\n\n // Set billing information for credit card\n $creditCard->setBilling()->setAddress()->withParameters(\n 'Av. Paulista',\n '1578',\n 'Bela Vista',\n '01310-200',\n 'São Paulo',\n 'SP',\n 'BRA',\n 'Museu'\n );\n\n $creditCard->setToken($data['cardToken']);\n\n // Set the installment quantity and value (could be obtained using the Installments\n // service, that have an example here in \\public\\getInstallments.php)\n $availableInstallments = $this->getInstallments($data['cardBrand']);\n\n $choosenInstallment = Arr::where($availableInstallments, function ($installment) use ($data) {\n return $installment->getQuantity() == $data['installments'];\n });\n $choosenInstallment = Arr::first($choosenInstallment);\n\n $creditCard->setInstallment()->withParameters(\n $choosenInstallment->getQuantity(),\n $choosenInstallment->getAmount(),\n $this->noInterestInstallments\n );\n\n // Set credit card holder information\n $creditCard->setHolder()->setBirthdate('01/01/2000');\n $creditCard->setHolder()->setName($data['cardName']); // Equals in Credit Card\n $creditCard->setHolder()->setPhone()->withParameters(\n 11,\n 999999999\n );\n $creditCard->setHolder()->setDocument()->withParameters(\n 'CPF',\n '10173649076'\n );\n\n try {\n // Get the crendentials and register the boleto payment\n $result = $creditCard->register(\n Configure::getAccountCredentials()\n );\n // code\n // grossAmount\n // netAmount\n // $pagamento = Pagamentos::create();\n // $pagamento->codigo_transacao = $result->getCode();\n // $pagamento->valor = $result->getGrossAmount();\n // $pagamento->valor_pagseguro = $result->getNetAmount();\n dd($result);\n } catch (Exception $e) {\n dd($e, 'Credit Card');\n }\n }",
"public function getCreditCardNumber()\n {\n return $this->creditCardNumber;\n }",
"public function creditcardAction()\r\n\t{\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('creditcarddetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"creditcard\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t\r\n\t\t\t $auth = Zend_Auth::getInstance();\r\n\t\t\t if($auth->hasIdentity())\r\n\t\t\t {\r\n\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{ \r\n\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t$creditcardDetailsform = new Default_Form_Creditcarddetails();\r\n\t\t\t\t\t\t$creditcardDetailsModel = new Default_Model_Creditcarddetails();\r\n\t\t\t\t\t\tif($id)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t$data = $creditcardDetailsModel->getcreditcarddetailsRecord($id);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"id\",$data[0][\"id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"user_id\",$data[0][\"user_id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_type\",$data[0][\"card_type\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_number\",$data[0][\"card_number\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"nameoncard\",$data[0][\"nameoncard\"]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$expiry_date = sapp_Global::change_date($data[0][\"card_expiration\"],'view');\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault('card_expiration', $expiry_date);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_issuedby\",$data[0][\"card_issued_comp\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_code\",$data[0][\"card_code\"]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$creditcardDetailsform->setAttrib('action',BASE_URL.'mydetails/creditcard/');\r\n\t\t\t\t\t\t\t$this->view->id=$id;\r\n\t\t\t\t\t\t\t$this->view->form = $creditcardDetailsform;\r\n\t\t\t\t\t\t\t$this->view->data=$data;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($this->getRequest()->getPost())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result = $this->save($creditcardDetailsform,$tabName);\t\r\n\t\t\t\t\t\t\t$this->view->msgarray = $result; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata; \r\n\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t}\t\t\t\r\n\t}",
"function add_credit_card($contact_id,$data)\n {\n $last_4 = substr($data['CardNumber'],-4);\n $cc_id = $this->locateCard($contact_id,$last_4);\n\n if($cc_id == 0) //Doesn't Exist\n {\n //Add Card\n $cc_id = $this->dsAdd('CreditCard',$data);\n return $cc_id;\n }\n elseif($cc_id > 0)\n {\n //Check if card as same expiration date\n $card_data = $this->dsLoad('CreditCard',$cc_id,array('ExpirationMonth','ExpirationYear'));\n if(\n $card_data['ExpirationMonth'] == $data['ExpirationMonth'] &&\n $card_data['ExpirationYear'] == $data['ExpirationMonth']) {\n return $cc_id;\n }\n else\n {\n //Update CC Dates\n return $this->dsUpdate('CreditCard',$cc_id,array('ExpirationYear' => $data['ExpirationYear'],'ExpirationMonth' => $data['ExpirationMonth']));\n }\n\n\n }\n else\n {\n return FALSE;\n }\n\n }",
"public function saveAction()\n {\n $postData = $this->getRequest()->getPost();\n\n if ($profileId = $this->getRequest()->getParam('id')) {\n $model = Mage::getModel('authnettoken/cim_payment_profile')->load($profileId);\n }\n else {\n $model = Mage::getModel('authnettoken/cim_payment_profile');\n }\n\n if ($postData) {\n\n try {\n try {\n // Save post data to model\n $model->addData($postData);\n // Now try to save payment profile to Auth.net CIM\n $model->saveCimProfileData(true);\n }\n catch (SFC_AuthnetToken_Helper_Cim_Exception $eCim) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to save credit card to Authorize.Net CIM!');\n if ($eCim->getResponse() != null) {\n Mage::getSingleton('adminhtml/session')->addError('CIM Result Code: ' . $eCim->getResponse()->getResultCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Code: ' .\n $eCim->getResponse()->getMessageCode());\n Mage::getSingleton('adminhtml/session')->addError('CIM Message Text: ' .\n $eCim->getResponse()->getMessageText());\n }\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $postData['customer_id']));\n\n return;\n }\n\n // Now save model\n $model->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('adminhtml')->__('Saved credit card ' . $model->getCustomerCardnumber() . '.'));\n Mage::getSingleton('adminhtml/session')->setCustomerData(false);\n\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $model->getId()));\n\n return;\n }\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $model->getCustomerId()));\n\n return;\n }\n catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError('Failed to save credit card!');\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile',\n array('id' => $postData['customer_id']));\n }\n }\n\n // Send customer back to saved credit cards grid\n $this->_redirect('adminhtml/customer/edit/tab/customer_info_tabs_paymentprofile', array('id' => $postData['customer_id']));\n }",
"function update_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no'; \n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"creditcards \n SET creditcard_number = '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n creditcard_type = '\" . mb_strtolower($form['type']) . \"',\n date_updated = '\" . DATETIME24H . \"',\n creditcard_expiry = '\" . $form['expmon'] . $form['expyear'] . \"',\n cvv2 = '\" . $ilance->db->escape_string($form['cvv2']) . \"',\n name_on_card = '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n phone_of_cardowner = '\" . $ilance->db->escape_string($form['phone']) . \"',\n email_of_cardowner = '\" . $ilance->db->escape_string($form['email']) . \"',\n card_billing_address1 = '\" . $ilance->db->escape_string($form['address1']) . \"',\n card_billing_address2 = '\" . $ilance->db->escape_string($form['address2']) . \"',\n card_city = '\" . $ilance->db->escape_string($form['city']) . \"',\n card_state = '\" . $ilance->db->escape_string($form['state']) . \"',\n card_postalzip = '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n card_country = '\" . $ilance->db->escape_string($form['countryid']) . \"',\n authorized = '\" . $ilance->db->escape_string($form['authorized']) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n AND cc_id = '\" . $ilance->db->escape_string($form['cc_id']) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_updated_creditcard');\t\t\n $ilance->email->set(array(\n '{{member}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }",
"public function setUseCreditCard($useCreditCard)\n {\n $this->useCreditCard = $useCreditCard;\n return $this;\n }",
"public function update(Request $request, CreditCard $creditCard)\n {\n //\n }",
"function commerce_braintree_creditcard_edit_form_submit($form, &$form_state) {\n $sub = commerce_braintree_subscription_local_get(array('sid' => $form_state['values']['sid']), FALSE);\n $token = $sub['token'];\n $commerce_customer_address = $form_state['values']['commerce_customer_address']['und'][0];\n //billing address\n $billing_address['firstName'] = isset($commerce_customer_address['first_name']) ? $commerce_customer_address['first_name'] : '';\n $billing_address['lastName'] = isset($commerce_customer_address['last_name']) ? $commerce_customer_address['last_name'] : '';\n $billing_address['company'] = isset($commerce_customer_address['organisation_name']) ? $commerce_customer_address['organisation_name'] : '';\n $billing_address['streetAddress'] = isset($commerce_customer_address['thoroughfare']) ? $commerce_customer_address['thoroughfare'] : '';\n $billing_address['extendedAddress'] = isset($commerce_customer_address['premise']) ? $commerce_customer_address['premise'] : '';\n $billing_address['locality'] = isset($commerce_customer_address['locality']) ? $commerce_customer_address['locality'] : '';\n $billing_address['region'] = isset($commerce_customer_address['administrative_area']) ? $commerce_customer_address['administrative_area'] : '';\n $billing_address['postalCode'] = isset($commerce_customer_address['postal_code']) ? $commerce_customer_address['postal_code'] : '';\n $billing_address['countryCodeAlpha2'] = isset($commerce_customer_address['country']) ? $commerce_customer_address['country'] : '';\n \n //creditcard\n $creditcard['cardholderName'] = $form_state['values']['ca_cardholder_name'];\n $creditcard['number'] = $form_state['values']['credit_card']['number'];\n $creditcard['cvv'] = $form_state['values']['credit_card']['code'];\n $creditcard['expirationDate'] = $form_state['values']['credit_card']['exp_month'];\n $creditcard['expirationDate'] .= '/' . $form_state['values']['credit_card']['exp_year'];\n $creditcard['billingAddress'] = $billing_address;\n $creditcard['options'] = array('verifyCard' => TRUE);\n $creditcard['billingAddress']['options'] = array('updateExisting' => TRUE);\n \n $card = commerce_braintree_credit_card_update($creditcard, $token);\n if ($card->success) {\n drupal_set_message(t('Updated Successfull.'));\n return;\n }\n drupal_set_message(t('There are error. @errors', array('@errors' => commerce_braintree_get_errors($card))), 'error');\n}",
"private function addCreditcard(CreditCard $creditcard)\n {\n if (null === $creditcard->token) {\n # No token available.\n $this->post['card']['number'] = $creditcard->number;\n $this->post['card']['expiry_month'] = $creditcard->month;\n $this->post['card']['expiry_year'] = $creditcard->year;\n $this->post['card']['cvc'] = $creditcard->verification_value;\n $this->post['card']['name'] = $creditcard->name();\n\n return;\n }\n\n if (strpos($creditcard->token, 'card_') === 0) {\n return $this->post['card_token'] = $creditcard->token;\n }\n\n if (strpos($creditcard->token, 'cus_') === 0) {\n return $this->post['customer_token'] = $creditcard->token;\n }\n }",
"public function changeCreaditCard(){\n return View::make('user.change_credit_card')->with(array('title_for_layout' => 'Thay đổi thẻ tín dụng'));\n }",
"public function setIdCard($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->id_card !== $v) {\n $this->id_card = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_ID_CARD] = true;\n }\n\n return $this;\n }",
"public function getCreditCard()\n\t{\n\t\treturn $this->credit_card;\n\t}",
"public function createCreditCard(CreditCard $creditCard): CreditCard;",
"function InfAddCreditCard($inf_contact_id, $CardNumber, $ExpirationMonth, $ExpirationYear, $CVV2, $BillName, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->ContactId = $inf_contact_id;\n\t$credit_card->CardNumber = $CardNumber;\n\t$credit_card->CVV2 = $CVV2;\n\t$credit_card->CardType = WriteCardType($CardNumber);\n#\t$credit_card->Status = 3; //0: Unknown, 1: Invalid, 2: Deleted, 3: Valid/Good, 4: Inactive\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->BillName = $BillName;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\t\n\t# Return card id\n\treturn $credit_card->save();\n}",
"public function action_addcreditcard() {\n $package = Model::factory('package');\n $btn_card_confirm = arr::get($_REQUEST, 'btn_card_confirm');\n $config_country['taxicountry'] = $this->country_info();\n $this->session = Session::instance();\n $errors = array();\n $userid = $this->session->get('userid');\n $postvalue = Arr::map('trim', $this->request->post());\n\n $getadmin_profile_info = $package->getadmin_profile_info();\n\n\n $post_values = Securityvalid::sanitize_inputs($postvalue);\n $billing_card_info_details = $package->billing_card_info_details();\n if (empty($billing_card_info_details)) {\n $billing_info_id = '';\n } else {\n $billing_info_id = $billing_card_info_details[0]['_id'];\n }\n if (isset($btn_card_confirm) && Validation::factory($_POST)) {\n $validator = $package->upgrade_plan_validate(arr::extract($post_values, array('cardnumber', 'cvv', 'expirydate', 'firstName', 'lastname', 'address', 'postal_code', 'terms', 'country', 'state', 'city')), $userid);\n if ($validator->check()) {\n $cardnumber = $postvalue['cardnumber'];\n $cvv = $postvalue['cvv'];\n $expirydate = explode('/', $postvalue['expirydate']);\n $firstname = $postvalue['firstName'];\n $lastname = $postvalue['lastname'];\n $address = $postvalue['address'];\n $city = $postvalue['city'];\n $country = $postvalue['country'];\n $state = $postvalue['state'];\n $postal_code = $postvalue['postal_code'];\n $package_upgrade_time = PACKAGE_UPGRADE_TIME;\n $cardnumber = preg_replace('/\\s+/', '', $cardnumber);\n \n $this->billing_info['card_number'] = $cardnumber;\n $this->billing_info['cvv'] = $cvv;\n $this->billing_info['expirationMonth'] = $expirydate[0];\n $this->billing_info['expirationYear'] = $expirydate[1];\n $this->billing_info['firstName'] = $firstname;\n $this->billing_info['lastname'] = $lastname;\n $this->billing_info['address'] = $address;\n $this->billing_info['city'] = $city;\n $this->billing_info['country'] = $country;\n $this->billing_info['state'] = $state;\n $this->billing_info['postal_code'] = $postal_code;\n $this->billing_info['createdate'] = $package_upgrade_time; \n $this->billing_info['currency']=CLOUD_CURRENCY_FORMAT; \n $billing_info_reg = $package->billing_registration($this->billing_info, $billing_info_id);\n if ($billing_info_reg) {\n Message::success(__('billing_updated_sucessfully'));\n }\n } else {\n $errors = $validator->errors('errors');\n }\n }\n $view = View::factory(ADMINVIEW . 'package_plan/addcreditcard')\n ->bind('postedvalues', $this->userPost)\n ->bind('errors', $errors)\n ->bind('getadmin_profile_info', $getadmin_profile_info)\n ->bind('subscription_cost_month', $subscription_cost_month)\n ->bind('billing_card_info_details', $billing_card_info_details)\n ->bind('all_country_list', $config_country['taxicountry'])\n ->bind('setup_cost', $setup_cost)\n ->bind('postvalue', $post_values);\n $this->template->title = CLOUD_SITENAME . \" | \" . __('add_credit_card');\n $this->template->page_title = __('add_credit_card');\n $this->template->content = $view;\n }",
"public function giveCard(Card $card)\n\t{\n\t\t$card->setGiven(true);\n\t\t$this->save($card, false);\n\t}",
"function chargeCreditCard()\n{\n\t \n\t$insert_id = $this->session->userdata('recent_reg_id');\n\t$current_login_user = $this->common_front_model->get_session_data();\n\t$inputData=$this->input->post();\n\n\t//print_r($current_login_user);\n\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"9zyp7U9TTQ\");\n $merchantAuthentication->setTransactionKey(\"8hFVee23p993GVVa\");\n \n // Set the transaction's refId\n $refId = $current_login_user['matri_id'].'-' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($inputData['card_number']);\n $creditCard->setExpirationDate($inputData['year'].\"-\".$inputData['month']);\n $creditCard->setCardCode($inputData['cvv']);\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber($refId);\n $order->setDescription(\"Membership Renewal-\".$inputData['plan_name']);\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($inputData['name_on_card']);\n // $customerAddress->setLastName($current_login_user['lastname']);\n // $customerAddress->setCompany($current_login_user['username']);\n //$customerAddress->setAddress(\"14 Main Street\");\n // $customerAddress->setCity(\"Pecan Springs\");\n //$customerAddress->setState(\"TX\");\n // $customerAddress->setZip(\"44628\");\n // $customerAddress->setCountry(\"USA\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId($current_login_user['matri_id']);\n $customerData->setEmail($current_login_user['email']);\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n $transactionRequestType->setAmount($inputData['plan_amount']);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\t//print_r($request);\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n \n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) {\n //echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n // echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n // echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n // echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n\t\t\t\t//echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n\t\t\t\t//$this->data['status']=\"Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n\t\t\t\t//$status=\"success\";\n\t\t\t\t$this->payment_status(\"authorize\");\n\t\t\t\treturn true;\n\t\t\t\t\n } else {\n //echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n // echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n\n } else {\n // echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n\t\t\t//\techo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n } else {\n echo \"No response returned \\n\";\n }\n\n\t//return $response;\n\t\n\t\t\t\t$this->common_model->front_load_header('Payment Success');\n\t\t\t\tif($status=='success'){\n\t\t\t\t\t$this->load->view('front_end/payment_success',$this->data);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->load->view('front_end/payment_fail',$this->data);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->common_model->front_load_footer();\n}",
"public function setCidCard($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cid_card !== $v) {\n $this->cid_card = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_CID_CARD] = true;\n }\n\n return $this;\n }",
"public function setCardInfo($dat,$key = false){\n if($key){\n $this->_cardinfo[$key] = $dat;\n }else{\n $this->_cardinfo = $dat;\n }\n }",
"public function setCardnumber($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cardnumber !== $v) {\n $this->cardnumber = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_CARDNUMBER] = true;\n }\n\n return $this;\n }",
"public function show(CreditCard $creditCard)\n {\n //\n }",
"public function processCreditCard()\n {\n $this->load();\n\n $multiBuyer = new MultiBuyer($this->request, [self::INDEX_CREDIT_CARD]);\n $multiBuyerCustomer = $multiBuyer->createCustomers();\n\n if (!$this->isValidateCreditCardRequest()) {\n Log::create()\n ->error(LogMessages::INVALID_CREDIT_CARD_REQUEST, __METHOD__)\n ->withOrderId($this->session->data['order_id']);\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $card = $this->fillCreditCardData(0);\n $orderData = $this->model_checkout_order->getOrder($this->session->data['order_id']);\n $orderData['saveCreditCard'] = $card['saveThisCard'];\n\n try {\n $response = $this->createCreditCardOrder(\n (double)$card['paymentDetails'][2],\n $card['paymentDetails'][0],\n $orderData,\n $card['cardToken'],\n [$card['cardId']],\n isset($multiBuyerCustomer[0]) ? $multiBuyerCustomer[0] : null\n );\n } catch (Exception $e) {\n Log::create()\n ->error(LogMessages::UNABLE_TO_CREATE_ORDER, __METHOD__)\n ->withOrderId($this->session->data['order_id'])\n ->withException($e);\n\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $orderStatus = $this->getOrder()->translateStatusFromMP($response);\n if (!$orderStatus) {\n Log::create()\n ->error(LogMessages::UNKNOWN_ORDER_STATUS, __METHOD__)\n ->withResponseStatus($response->status)\n ->withOrderId($this->session->data['order_id']);\n\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $orderComment = $this->data['order_statuses'][$response->status];\n\n $newOrder = $this->getOrder();\n $newOrder->updateOrderStatus($orderStatus, $orderComment);\n\n $this->saveMPOrderId($response->id, $this->session->data['order_id']);\n\n $this->saveOrderCreditcardInfo($response->charges[0]);\n\n $this->response->redirect($this->url->link('checkout/success', '', true));\n }",
"public function setCCNumber($number = '') {\n $cc = array(\n 'x_card_num'=>$this->cleanCCNumber($number),\n );\n $this->NVP = array_merge($this->NVP, $cc); \n }",
"protected function submitCreditCardForm(array $element, FormStateInterface $form_state) {\n\n $values = $form_state->getValue($element['#parents']);\n \n $this->entity->card_type = $values['type'];\n $this->entity->card_number = substr($values['number'], -4);\n $this->entity->card_exp_month = $values['expiration']['month'];\n $this->entity->card_exp_year = $values['expiration']['year'];\n $this->entity->cpf = $values['information']['cpf'];\n $this->entity->birth_date = $values['information']['birth_date'];\n $this->entity->card_holder_name = $values['card_holder_name'];\n $this->entity->sender_hash = $values['sender_hash'];\n $this->entity->card_hash = $values['card_hash'];\n $this->entity->card_brand = $values['card_brand'];\n $this->entity->installments = $values['installments'];\n }",
"function edds_credit_card_form( $echo = true ) {\n\n\tglobal $edd_options;\n\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contact support.', 'edds' ) );\n\t\treturn;\n\t}\n\n\tob_start(); ?>\n\n\t<?php if ( ! wp_script_is ( 'edd-stripe-js' ) ) : ?>\n\t\t<?php edd_stripe_js( true ); ?>\n\t<?php endif; ?>\n\n\t<?php do_action( 'edd_before_cc_fields' ); ?>\n\n\t<fieldset id=\"edd_cc_fields\" class=\"edd-do-validate\">\n\t\t<legend><?php _e( 'Credit Card Info', 'edds' ); ?></legend>\n\t\t<?php if( is_ssl() ) : ?>\n\t\t\t<div id=\"edd_secure_site_wrapper\">\n\t\t\t\t<span class=\"padlock\">\n\t\t\t\t\t<svg class=\"edd-icon edd-icon-lock\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"28\" viewBox=\"0 0 18 28\" aria-hidden=\"true\">\n\t\t\t\t\t\t<path d=\"M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9c0 .828-.672 1.5-1.5 1.5h-15C.672 24 0 23.328 0 22.5v-9c0-.828.672-1.5 1.5-1.5H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5c.828 0 1.5.672 1.5 1.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'edds' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\t\t?>\n\t\t<?php if ( ! empty( $existing_cards ) ) { edd_stripe_existing_card_field_radio( get_current_user_id() ); } ?>\n\n\t\t<div class=\"edd-stripe-new-card\" <?php if ( ! empty( $existing_cards ) ) { echo 'style=\"display: none;\"'; } ?>>\n\t\t\t<?php do_action( 'edd_stripe_new_card_form' ); ?>\n\t\t\t<?php do_action( 'edd_after_cc_expiration' ); ?>\n\t\t</div>\n\n\t</fieldset>\n\t<?php\n\n\tdo_action( 'edd_after_cc_fields' );\n\n\t$form = ob_get_clean();\n\n\tif ( false !== $echo ) {\n\t\techo $form;\n\t}\n\n\treturn $form;\n}",
"public function stripe_credit_card(Request $request, $subscription_uid) {\n $subscription = \\Acelle\\Model\\Subscription::findByUid($subscription_uid);\n $order_id = $subscription->getOrderID();\n $result = null;\n\n // Check billing information\n if( $this->checkBillingInformation($request, $subscription) !== true ) {\n return redirect()->away($this->checkBillingInformation($request, $subscription));\n }\n\n $payment_method = \\Acelle\\Model\\PaymentMethod::getByType(\\Acelle\\Model\\PaymentMethod::TYPE_STRIPE_CREDIT_CARD);\n $apiSecretKey = $payment_method->getOption('api_secret_key');\n $apiPublishableKey = $payment_method->getOption('api_publishable_key');\n\n try {\n \\Stripe\\Stripe::setApiKey($apiSecretKey);\n\n // validate and save posted data\n if ($request->isMethod('post')) {\n\n // Token is created using Stripe.js or Checkout!\n // Get the payment token submitted by the form:\n $token = $request->stripeToken;\n\n // Charge the user's card:\n $result = \\Stripe\\Charge::create(array(\n \"amount\" => $subscription->stripePrice(),\n \"currency\" => $subscription->currency_code,\n \"description\" => trans('messages.stripe_checkout_description', ['order' => $order_id]),\n \"source\" => $token,\n ));\n\n $payment = new Payment();\n $payment->subscription_id = $subscription->id;\n $payment->payment_method_id = $payment_method->id;\n $payment->data = serialize($result);\n $payment->status = 'success';\n $payment->action = \\Acelle\\Model\\Payment::ACTION_PAID;\n $payment->payment_method_name = trans('messages.' . $payment_method->type);\n $payment->order_id = $order_id;\n\n // billing information\n $billing_information = $request->session()->get('billing_information');\n if (isset($billing_information)) {\n $payment->tax_number = $billing_information['tax_number'];\n $payment->billing_address = $billing_information['billing_address'];\n $request->session()->forget('billing_information');\n }\n\n $payment->save();\n $subscription->setPaid();\n\n // try enabling the subscription, proceed anyway if failed\n try {\n $subscription->enable();\n } catch (\\Exception $ex) {\n // just suppress the error and leave the subscription disabled\n LaravelLog::warning(\"Cannot enable subscription {$subscription->id}, proceed anyway\");\n }\n\n return redirect()->action('PaymentController@success', $subscription->uid);\n }\n\n } catch(\\Stripe_CardError $e) {\n $error_message = \"\";\n // Since it's a decline, Stripe_CardError will be caught\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n $error_message .= 'Status is:' . $e->getHttpStatus() . \"\\n\";\n $error_message .= 'Type is:' . $err['type'] . \"\\n\";\n $error_message .= 'Code is:' . $err['code'] . \"\\n\";\n // param is '' in this case\n $error_message .= 'Param is:' . $err['param'] . \"\\n\";\n $error_message .= 'Message is:' . $err['message'] . \"\\n\";\n } catch (\\Stripe_InvalidRequestError $e) {\n $error_message = $e->getMessage();\n } catch (\\Stripe_AuthenticationError $e) {\n // Authentication with Stripe's API failed\n // (maybe you changed API keys recently)\n $error_message = $e->getMessage();\n } catch (\\Stripe_ApiConnectionError $e) {\n // Network communication with Stripe failed\n } catch (\\Stripe_Error $e) {\n // Display a very generic error to the user, and maybe send\n // yourself an email\n $error_message = $e->getMessage();\n } catch (\\Exception $e) {\n // Something else happened, completely unrelated to Stripe\n $error_message = $e->getMessage();\n }\n\n if (isset($error_message)) {\n PaymentLog::error(trans('messages.something_went_wrong_with_payment') . ': ' .$error_message);\n return view('somethingWentWrong', ['message' => trans('messages.something_went_wrong_with_payment', ['error' => $error_message])]);\n }\n\n return view('payments.stripe_credit_card', [\n 'subscription' => $subscription,\n 'apiPublishableKey' => $apiPublishableKey,\n 'result' => $result,\n 'payment_method' => $payment_method,\n ]);\n }",
"public function setCard($index,Card $val) :void\n {\n if($index>=0 && $index<=47)\n $this->cards[$index]=$val;\n }",
"public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}",
"public function setCardcode($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cardcode !== $v) {\n $this->cardcode = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_CARDCODE] = true;\n }\n\n return $this;\n }",
"public function postEditCard(EditCardRequest $request)\n {\n try {\n $expiry = explode('/', $request->expiry);\n $month = $expiry[0];\n $year = $expiry[1];\n $customerId = RecruiterProfile::where(['user_id' => Auth::user()->id])->pluck('customer_id');\n $customer = \\Stripe\\Customer::retrieve($customerId[0]);\n $card = $customer->sources->retrieve($request->cardId);\n $card->exp_month = $month;\n $card->exp_year = $year;\n $card->save();\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.card_edidted');\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }",
"public function setGiftcardAmount($value);",
"public function credit ($number)\n {\n $req = new FortieRequest();\n $req->method('PUT');\n $req->path($this->basePath)->path($number)->path('credit');\n\n return $this->send($req->build());\n }",
"public function setCreditCardToken($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->credit_card_token !== $v) {\n\t\t\t$this->credit_card_token = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::CREDIT_CARD_TOKEN;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function editCustomerAction(Request $request, Card $card)\n {\n $customer = $card->getCustomer();\n $form = $this->createForm(CustomerType::class, $customer);\n $form->handleRequest($request);\n\n if($form->isSubmitted() && $form->isValid()){\n $birthday = $request->request->get('appbundle_customer')['birthday'];\n $customer->setBirthday(new \\DateTime($birthday));\n $em = $this->getDoctrine()->getManager();\n $em->persist($customer);\n $em->flush();\n\n $this->addFlash('success', \"The customer's informations were modified.\");\n\n return $this->redirectToRoute('staff_customer_view', [\n 'number' => $card->getNumber()\n ]);\n }\n\n return $this->render('staff/customer/edit_customer.html.twig', array(\n \"form\" => $form->createView(),\n \"customer\" => $customer\n ));\n }",
"public function setCreditCardSecurity($creditCardSecurity)\n {\n $this->creditCardSecurity = $creditCardSecurity;\n\n return $this;\n }",
"public function setCustomGiftcardAmount($value);",
"public function createCreditCardProfile(int $authNetCustId, CreditCardInterface $creditCard);",
"public function newPostAction()\n {\n // The card\n $card = Mage::getModel('mbiz_cc/cc');\n\n try {\n $post = $this->getRequest()->getPost();\n\n $card->setData(array(\n 'customer' => $this->_getCustomerSession()->getCustomer(),\n 'dateval' => isset($post['dateval-month'], $post['dateval-year']) ? sprintf('%02d%02d', (int) $post['dateval-month'], $post['dateval-year'] - 2000) : null,\n 'cvv' => isset($post['cvv']) ? $post['cvv'] : null,\n 'type' => isset($post['type']) ? $post['type'] : null,\n 'owner' => isset($post['owner']) ? $post['owner'] : null,\n 'number' => isset($post['number']) ? $post['number'] : null,\n ));\n\n /* INFO:\n * To specify the token you can use the event \"cc_validate_before\"\n */\n\n $errors = $card->validate();\n\n if ($errors) {\n foreach ($errors as $error) {\n $this->_getSession()->addError($error);\n }\n } else {\n $card->save();\n $this->_getSession()->addSuccess($this->__('Credit card saved successfully.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n\n $this->_redirect('customer/cc/index');\n }",
"public function assignData( $data ) {\r\n\t\tparent::assignData( $data );\r\n\t\t\r\n\t\t$post = Mage::app()->getRequest()->getParam('payment');\r\n\t\t\r\n\t\tif( !empty( $post['payment_id'] ) ) {\r\n\t\t\t$card = $this->getPaymentInfoById( $post['payment_id'], false );\r\n\t\t\t\r\n\t\t\tif( $card && $card->getCardNumber() != '' ) {\r\n\t\t\t\t$this->getInfoInstance()->setCcLast4( substr( $card->getCardNumber(), -4 ) )\r\n\t\t\t\t\t\t\t\t\t\t->setCcType( '' );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"public function unsetCustomerCardId(): void\n {\n $this->customerCardId = [];\n }",
"function setCurrencyCode($currencycode) {\n\t\tif (strlen($currencycode) == 3) {\n\t\t\t$this->currencycode = $currencycode;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Currency Code\";\n\t\t}\n\t}",
"function setCurrencyCode($currencycode) {\n\t\tif (strlen($currencycode) == 3) {\n\t\t\t$this->currencycode = $currencycode;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Currency Code\";\n\t\t}\n\t}",
"public function storeCreditCard($obj) {\n if($obj){\n $cc_id = CreditCard::create(array(\n 'type' => $obj-> type,\n 'number' => $obj-> number,\n 'name' => $obj-> name,\n 'expirationDate' => $obj-> expirationDate\n ))->id;\n return $cc_id;\n }\n\n }",
"public function chargeCard($amount)\n {\n if ($this->isValidCard)\n $this->balance += $this->parseAmount($amount);\n }",
"function insert_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n $form['creditcard_status'] = 'active';\n $form['default_card'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no';\n }\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"creditcards\n (cc_id, date_added, date_updated, user_id, creditcard_number, creditcard_expiry, cvv2, name_on_card, phone_of_cardowner, email_of_cardowner, card_billing_address1, card_billing_address2, card_city, card_state, card_postalzip, card_country, creditcard_status, default_card, creditcard_type, authorized) \n VALUES(\n NULL,\n '\" . DATETIME24H . \"',\n '\" . DATETIME24H . \"',\n '\" . intval($userid) . \"',\n '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n '\" . $ilance->db->escape_string($form['expmon'] . $form['expyear']) . \"',\n '\" . intval($form['cvv2']) . \"',\n '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n '\" . $ilance->db->escape_string($form['phone']) . \"',\n '\" . $ilance->db->escape_string($form['email']) . \"',\n '\" . $ilance->db->escape_string($form['address1']) . \"',\n '\" . $ilance->db->escape_string($form['address2']) . \"',\n '\" . $ilance->db->escape_string($form['city']) . \"',\n '\" . $ilance->db->escape_string($form['state']) . \"',\n '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n '\" . $ilance->db->escape_string($form['countryid']) . \"',\n '\" . $ilance->db->escape_string($form['creditcard_status']) . \"',\n '\" . $ilance->db->escape_string($form['default_card']) . \"',\n '\" . $ilance->db->escape_string($form['type']) . \"',\n '\" . $ilance->db->escape_string($form['authorized']) . \"')\n \", 0, null, __FILE__, __LINE__);\n $cc_id = $ilance->db->insert_id(); \n $ilance->email->mail = fetch_user('email', $userid);\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_added_new_card');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('member_added_new_card_admin');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n return true;\n }",
"function addCreditCard($userDetails){\n\ttry{\n\t\t$cardRegister = new \\MangoPay\\CardRegistration();\n\t\t$cardRegister->UserId \t= $userDetails['userAccountId'];\n\t\t$cardRegister->Currency = $userDetails['userCurrency'];\n\t\t$createdCardRegister = $mangoPayApi->CardRegistrations->Create($cardRegister);\n\t\t$data\n\t\t\n\t\t$handle = curl_init();\n\t\tcurl_setopt($handle, CURLOPT_URL, $url);\n\t\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($handle, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); \n\t\tcurl_setopt($handle, CURLOPT_POST, true);\n\t\tcurl_setopt($handle, CURLOPT_POSTFIELDS, $data);\n\t\t$response = curl_exec($handle);\n\t\t\n\t\t\n\t\t\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t}\n\n}",
"private function createCreditCard($credit_card_details)\n {\n $creditCard = new CreditCardType();\n $creditCard->setCardNumber($credit_card_details->getCardNumber());\n $creditCard->setExpirationDate(\"XXXX\");\n $this->payment_data = new PaymentType();\n $this->payment_data->setCreditCard($creditCard);\n\n return true;\n }",
"public function testCardCustomer()\r\n {\r\n $card = new Card();\r\n $card->setCodeCard('1230456789');\r\n $customer = new Customer();\r\n $customer->setFirstName('Antoine');\r\n\r\n #Mock du repository\r\n $repository = $this->createMock(ObjectRepository::class);\r\n $repository->expects($this->any())\r\n ->method('findby')\r\n ->willReturn(null);\r\n\r\n # Mock du EntityManager\r\n $em = $this->createMock(EntityManagerInterface::class);\r\n $em->expects($this->any())\r\n ->method('getRepository')\r\n ->willReturn($repository);\r\n # On mock le cardPDF et UrlGeneratorInterface\r\n $cardPDF = $this->createMock(CardPdf::class);\r\n $urlGeneratorInterface = $this->createMock(UrlGeneratorInterface::class);\r\n\r\n # On mock le workflow\r\n $workflow = $this->createMock(WorkflowInterface::class);\r\n $workflow->expects($this->any())\r\n ->method('can')\r\n ->willReturn(true);\r\n\r\n $cm = new CardManager($em, $cardPDF, $urlGeneratorInterface, $workflow);\r\n\r\n $cm->setCardCustomer($card, $customer);\r\n $this->assertSame('Antoine', $card->getCustomer()->getFirstName());\r\n }",
"public function addNewCardToCustomer($card) {\n\n\t\treturn $this->request('/card', $card, 'POST');\n\t}",
"public function __construct($cardNo)\n {\n $this->cardNo = $cardNo;\n }",
"public function getCardcode()\n {\n return $this->cardcode;\n }",
"public function creditCardSale($extinfo,$mobileid,$userid,$creditcard,$amount,$name_on_card,$expire_month,$expire_year,$cvv2,$zip,$address,$state,$type,$processor) {\n $processor_transaction_id = App_Transaction_Transaction::GetProcessorTransactionId($mobileid);\n $extinfo[\"processor_transaction_id\"] = $processor_transaction_id;\n\n //Use WigiSafe client to take out that much money\n $wsc = new App_WigiSafeClient();\n $res = $wsc->creditCardSale($processor_transaction_id,$amount,$name_on_card,$expire_month,$expire_year,$cvv2,$zip,$address,$state,$creditcard,$zip,$address,$state,$type,$processor);\n if (!$res) {\n throw new App_Exception_WsException(\"Can not fund from this card\");\n return false;\n }\n\n $c = new App_Cellphone($mobileid);\n\n\n $balance = $c->getBalance();\n $temp_balance = $c->getTempBalance();\n\n //if (Zend_Registry::get('pp.env') === \"live\") {\n $c->addToBalance($amount);\n $balance = $c->getBalance() + $amount;\n $temp_balance = $c->getTempBalance();\n //}\n\n $u = new App_User($userid);\n\n return App_Transaction_Transaction::log(App_Transaction_Type::CREDIT_SALE_PENDING,'Info',$amount,$balance,$temp_balance,$mobileid,'0',App_Transaction_Type::getConstName(App_Transaction_Type::CREDIT_SALE_PENDING),$c->getCellphone(),\"\",$userid,\"\",$c->getAlias() . \":\" . $u->getEmail(),\"\",\"\",$extinfo);\n }",
"function spgateway_credit_MetaData() {\n return array(\n 'DisplayName' => 'spgateway - 信用卡',\n 'APIVersion' => '1.1', // Use API Version 1.1\n 'DisableLocalCredtCardInput' => false,\n 'TokenisedStorage' => false,\n );\n}",
"function saveCard()\n {\n $table = 'module_isic_card';\n $card = $this->vars[\"card_id\"];\n $this->convertValueFieldKeys();\n //print_r($this->vars);\n // there are 2 possibilites for saving card (modify existing or add new)\n if ($card) { // modify existing card\n\n $row_old = $this->isic_common->getCardRecord($card);\n $t_field_data = $this->getFieldData($row_old[\"type_id\"]);\n\n\n $r = &$this->db->query('\n UPDATE\n `module_isic_card`\n SET\n `module_isic_card`.`moddate` = NOW(),\n `module_isic_card`.`moduser` = ?,\n `module_isic_card`.`person_name` = ?,\n `module_isic_card`.`person_addr1` = ?,\n `module_isic_card`.`person_addr2` = ?,\n `module_isic_card`.`person_addr3` = ?,\n `module_isic_card`.`person_addr4` = ?,\n `module_isic_card`.`person_email` = ?,\n `module_isic_card`.`person_phone` = ?,\n `module_isic_card`.`person_position` = ?,\n `module_isic_card`.`person_class` = ?,\n `module_isic_card`.`person_stru_unit` = ?,\n `module_isic_card`.`person_bankaccount` = ?,\n `module_isic_card`.`person_bankaccount_name` = ?,\n `module_isic_card`.`person_newsletter` = ?,\n `module_isic_card`.`confirm_user` = !,\n `module_isic_card`.`confirm_payment_collateral` = !,\n `module_isic_card`.`confirm_payment_cost` = !,\n `module_isic_card`.`confirm_admin` = !\n WHERE\n `module_isic_card`.`id` = !\n ', $this->userid,\n $this->vars[\"person_name\"],\n $this->vars[\"person_addr1\"],\n $this->vars[\"person_addr2\"],\n $this->vars[\"person_addr3\"],\n $this->vars[\"person_addr4\"],\n $this->vars[\"person_email\"],\n $this->vars[\"person_phone\"],\n $this->vars[\"person_position\"],\n $this->vars[\"person_class\"],\n $this->vars[\"person_stru_unit\"],\n $this->vars[\"person_bankaccount\"],\n $this->vars[\"person_bankaccount_name\"],\n $this->vars[\"person_newsletter\"] ? 1 : 0,\n $this->vars[\"confirm_user\"] ? 1: 0,\n $this->user_type == 1 ? ($this->vars[\"confirm_payment_collateral\"] ? 1 : 0) : $row_old[\"confirm_payment_collateral\"],\n $this->user_type == 1 ? ($this->vars[\"confirm_payment_cost\"] ? 1 : 0) : $row_old[\"confirm_payment_cost\"],\n $this->user_type == 1 ? ($this->vars[\"confirm_admin\"] ? 1 : 0) : $row_old[\"confirm_admin\"],\n $card\n );\n if ($r) {\n $success = true;\n $this->isic_common->saveCardChangeLog(2, $card, $row_old, $this->isic_common->getCardRecord($card));\n $message = 'card saved ...';\n } else {\n $success = false;\n $message = 'card modify failed ...';\n }\n\n } else { // adding new card\n $success = false;\n $action = 1; // add\n $t_field_data = $this->getFieldData($this->vars[\"type_id\"]);\n //print_r($t_field_data);\n foreach ($t_field_data[\"detailview\"] as $fkey => $fval) {\n // check for disabled fields, setting these values to empty\n if (in_array($action, $fval[\"disabled\"])) {\n unset($this->vars[$fkey]);\n continue;\n }\n // check for requried fields\n if (in_array($action, $fval[\"required\"])) {\n if (!$this->vars[$fkey]) {\n $error = $error_required_fields = true;\n break;\n }\n }\n if (!$error) {\n $insert_fields[] = $this->db->quote_field_name(\"{$fkey}\");\n $t_value = '';\n switch ($fval['type']) {\n case 1: // textfield\n $t_value = $this->db->quote($this->vars[$fkey] ? $this->vars[$fkey] : '');\n break;\n case 2: // combobox\n $t_value = $this->vars[$fkey] ? $this->vars[$fkey] : 0;\n break;\n case 3: // checkbox\n $t_value = $this->vars[$fkey] ? 1 : 0;\n break;\n case 5: // date\n $t_date = $this->convertDate($this->vars[$fkey]);\n $t_value = $this->db->quote($t_date);\n break;\n default :\n break;\n }\n $insert_values[] = $t_value;\n }\n }\n if (!$error) {\n $r = &$this->db->query('INSERT INTO ' . $this->db->quote_field_name($table) . ' FIELDS (' . implode(',', $insert_fields) . ') VALUES (' . implode(',', $insert_values) . ')');\n echo \"<!-- \" . $this->db->show_query() . \" -->\\n\";\n $card = $this->db->insert_id();\n\n }\n\n if ($r && $card) {\n $success = true;\n $this->isic_common->saveCardChangeLog(1, $card, array(), $this->isic_common->getCardRecord($card));\n $message = 'new card saved ...';\n } else {\n $success = false;\n $message = 'card add failed ...';\n }\n }\n\n echo JsonEncoder::encode(array('success' => $success, 'msg' => $message));\n exit();\n \n }",
"public function add(Card $card): void\n {\n $this->set($card->getKey(), $card);\n }",
"public function askForCard()\n {\n }",
"public function setCard(Model\\CardSetting $card): self\n {\n $this->card = $card;\n\n return $this;\n }",
"public function addCard()\n {\n }",
"public function setNameOnCard($var)\n {\n GPBUtil::checkString($var, True);\n $this->name_on_card = $var;\n\n return $this;\n }",
"public function store(Request $request)\n {\n $validator = request()->validate(\n [\n 'type' => 'required|in:visa,mastercard,cihvisa,cihmastercard',\n 'number' => 'required|numeric|min:0',\n 'expMonth' => 'required|numeric|between:1,12',\n 'expYear' => 'required|numeric|between:2018,2100', // TODO: make this dynamic\n ]);\n\n $creditCard = new CreditCard();\n $creditCard->type = Input::get('type');\n $creditCard->number = Input::get('number');\n $creditCard->expMonth = Input::get('expMonth');\n $creditCard->expYear = Input::get('expYear');\n $creditCard->user_id = Auth::id();\n \n $creditCard->save();\n \n return redirect('/profile');\n }",
"public function get_card(){ return $this->_card;}",
"public function getCreditCardById($customer_id, $card_id)\n {\n \n // verify the required parameter 'customer_id' is set\n if ($customer_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_id when calling getCreditCardById');\n }\n // verify the required parameter 'card_id' is set\n if ($card_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $card_id when calling getCreditCardById');\n }\n \n // parse inputs\n $resourcePath = \"/customer/{customer_id}/credit_card/{card_id}\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"GET\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customer_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_id),\n $resourcePath\n );\n }// path params\n if ($card_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"card_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($card_id),\n $resourcePath\n );\n }\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCard'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCard', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCard', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }",
"public function setAccountCode($value);",
"function cardNumber()\n\t\t{\n\t\t\techo $this->card_number;\n\t\t}",
"public function changeCardNumber($card, $number){\n $availableCard = $this->getCardRepository()->findOneByNumber($number);\n $this->entityManager->remove($availableCard);\n $this->entityManager->flush();\n $card->setNumber($number);\n $this->save($card, true);\n }",
"function ezcreditcardType ()\n {\n $this->eZDataType( self::DATA_TYPE_STRING, ezi18n( 'kernel/classes/datatypes', 'Credit card', 'Datatype name' ), array( \n 'serialize_supported' => true , \n 'object_serialize_map' => array( \n 'data_text' => 'text' \n ) \n ) );\n }",
"public function addCardToCustomer($number, $customer)\n {\n $number = intval($number);\n if($number){\n if(strlen((string)$number) != 9){\n $this->session->getFlashBag()->add('error', 'The card number your entered is not valid.');\n return;\n }\n $card = $this->getCardRepository()->findInactiveCardByNumber($number);\n\n if(null != $card){\n $card->setCustomer($customer);\n $card->setIsActive(true);\n $this->entityManager->persist($customer);\n $this->entityManager->persist($card);\n $this->entityManager->flush();\n $this->session->getFlashBag()->add('success', 'Success ! You have a new card !');\n $addCardEvent = new CustomerAddCardEvent($card);\n $this->dispatcher->dispatch(CustomerAddCardEvent::NAME, $addCardEvent);\n\t\t\t\treturn;\n }else{\n $this->session->getFlashBag()->add('error', 'The card number your entered doesn\\'t exist.');\n return;\n }\n }else{\n $this->session->getFlashBag()->add('error', 'The card number your entered is not valid.');\n return;\n }\n\n }"
]
| [
"0.70192105",
"0.6974019",
"0.69172263",
"0.69172263",
"0.68762636",
"0.66995496",
"0.6634257",
"0.6559769",
"0.6545362",
"0.6475479",
"0.6458408",
"0.64289933",
"0.6416472",
"0.63858896",
"0.63369596",
"0.62682104",
"0.62268114",
"0.62054884",
"0.6152741",
"0.6128626",
"0.6102686",
"0.60823154",
"0.60387695",
"0.60282636",
"0.6008674",
"0.60085195",
"0.5948075",
"0.58726394",
"0.5863755",
"0.5860127",
"0.58521295",
"0.585167",
"0.58304507",
"0.5820132",
"0.58194166",
"0.5818925",
"0.581822",
"0.5794773",
"0.5775355",
"0.57732916",
"0.5756176",
"0.5745558",
"0.57397",
"0.57391745",
"0.57357556",
"0.5717186",
"0.5693506",
"0.56766075",
"0.5673793",
"0.5652101",
"0.5650365",
"0.56470716",
"0.5630219",
"0.56247103",
"0.56154597",
"0.5552872",
"0.5523647",
"0.5513071",
"0.5511094",
"0.5502374",
"0.5499492",
"0.546588",
"0.5462541",
"0.54569024",
"0.54446054",
"0.54365236",
"0.5436004",
"0.54197896",
"0.5415319",
"0.54135674",
"0.53993237",
"0.53977114",
"0.5384196",
"0.5384196",
"0.5382393",
"0.53732854",
"0.53708816",
"0.5365201",
"0.5354382",
"0.5341167",
"0.5333363",
"0.53155035",
"0.5314453",
"0.5306052",
"0.5292369",
"0.52874476",
"0.5280639",
"0.52550375",
"0.5247334",
"0.52421457",
"0.52404314",
"0.52267075",
"0.52243984",
"0.5223031",
"0.52194244",
"0.5210365",
"0.52089447",
"0.52082705",
"0.520631"
]
| 0.59725535 | 27 |
Use a Customer ID Link the charge to an existing customer by ID, doesn't require Customer information | public function UseCustomer ($customer_id) {
$this->Param('customer_id',$customer_id);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCustomer($customer_id);",
"public function setCustomerId($id);",
"abstract public function getCustomer($ID);",
"public function getCustomerId();",
"public function getCustomerId();",
"public function getCustomerId();",
"function getCustomerById_customer($id_customer)\n {\n\n\n\n $query = \"SELECT * FROM `customer` WHERE id_customer = '$id_customer'\";\n $hasil = $this->db->query($query);\n\n return $hasil;\n }",
"public function getCustomerId() {\n return $this->customerID;\n }",
"function set_customer_id($blog_id, $customer_id) {\n\t\tglobal $wpdb;\n\t\t\n\t\t$exists = $wpdb->get_var( $wpdb->prepare(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_stripe_customers WHERE blog_id = %d\", $blog_id) );\t\t\t\t\t\t\t\t\t\n\t\tif ( $exists ) {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->base_prefix}pro_sites_stripe_customers SET customer_id = %s WHERE blog_id = %d\", $customer_id, $blog_id) );\t\t\t\t\t\t\t\n\t\t} else {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"INSERT INTO {$wpdb->base_prefix}pro_sites_stripe_customers(blog_id, customer_id) VALUES (%d, %s)\", $blog_id, $customer_id) );\t\t\t\t\t\t\t\n\t\t}\n\t}",
"function customer_id($customer_id=null)\n {\n if (isset($customer_id)) $this->customer_id = intval($customer_id);\n return $this->customer_id;\n }",
"public function getCustomerId()\n {\n return $this->customer_id;\n }",
"public function getCustomerId()\n {\n return $this->customer_id;\n }",
"public function getCustomer($_ID)\n {\n return $this->getUnique(\"customers\", $_ID);\n }",
"function createCustomer($id, $stripeid) // user_charge.php, user_charge_package_10.php, user_charge_subscription.php\r\n\r\n{\r\n\r\n\tglobal $mysqli,$db_table_prefix;\r\n\r\n\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"users\r\n\r\n\t\tSET\r\n\r\n\t\tstripe_id = ?\r\n\r\n\t\tWHERE\r\n\r\n\t\tid = ?\");\r\n\r\n\t$stmt->bind_param(\"si\", $stripeid, $id);\r\n\r\n\t$result = $stmt->execute();\r\n\r\n\t$stmt->close();\r\n\r\n\treturn $result;\r\n\r\n}",
"public function changeCustomer($id, $canChangeCustomer = 1)\n {\n $document = $this->document->findOrFail($id);\n\n $customer = Customer::find( $document->customer_id );\n\n $addressBook = $customer->addresses;\n\n $theId = $customer->invoicing_address_id;\n $invoicing_address = $addressBook->filter(function($item) use ($theId) { // Filter returns a collection!\n return $item->id == $theId;\n })->first();\n\n $addressbookList = array();\n foreach ($addressBook as $address) {\n $addressbookList[$address->id] = $address->alias;\n }\n\n\n return view($this->view_path.'.change_customer', $this->modelVars() + compact('customer', 'invoicing_address', 'addressBook', 'addressbookList', 'document', 'canChangeCustomer'));\n }",
"function get_customer_to_order($customer_id) {\n\t$sql = \"SELECT cust.name, \n\t\t cust.address, \"\n\t\t .TB_PREF.\"credit_status.dissallow_invoices, \n\t\t cust.sales_type AS salestype,\n\t\t cust.dimension_id,\n\t\t cust.dimension2_id,\n\t\t stype.sales_type,\n\t\t stype.tax_included,\n\t\t stype.factor,\n\t\t cust.curr_code,\n\t\t cust.discount,\n\t\t cust.payment_terms,\n\t\t cust.pymt_discount,\n\t\t cust.credit_limit - Sum(IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2,\n\t\t\t-1, 1) * (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount),0)) as cur_credit\n\t\tFROM \".TB_PREF.\"debtors_master cust\n\t\t LEFT JOIN \".TB_PREF.\"debtor_trans trans ON trans.type!=\".ST_CUSTDELIVERY.\" AND trans.debtor_no = cust.debtor_no,\"\n\t\t .TB_PREF.\"credit_status, \"\n\t\t .TB_PREF.\"sales_types stype\n\t\tWHERE cust.sales_type=stype.id\n\t\t\tAND cust.credit_status=\".TB_PREF.\"credit_status.id\n\t\t\tAND cust.debtor_no = \".db_escape($customer_id)\n\t\t.\" GROUP by cust.debtor_no\";\n\n\t$result =db_query($sql,\"Customer Record Retreive\");\n\treturn \tdb_fetch($result);\n}",
"public function customer_by_id($id)\n {\n return $this->customers->customer_by_id($id);\n }",
"function getCcInfoByCustId($customerid) {\n $query = \"SELECT * FROM `creditcards` WHERE CustomerId='\".$customerid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }",
"public function getCustomer(int $id)\n {\n return Customer::where('id', $id)->first();\n }",
"public function charge_customer( $amount, $customer_id, $desc ) {\r\n\t\t$params = array(\r\n\t\t\t'amount' => $amount,\r\n\t\t\t'currency' => 'usd',\r\n\t\t\t'customer' => $customer_id,\r\n\t\t\t'description' => $desc\r\n\t\t);\r\n\t\t\r\n\t\treturn $this->_send_request( 'charges', $params, STRIPE_METHOD_POST );\r\n\t}",
"public function setChargeId($value)\n {\n return $this->set(self::_CHARGE_ID, $value);\n }",
"public function subscriptions($id)\n {\n\n \\Stripe\\Stripe::setApiKey(\"sk_test_QY4jsEKRBOS1VUpRcrJZIMrj\");\n\n $customer_id = 'cus_EMwyFkdGdPZ6uu';//fetch it from your stored database\n\n $charge = \\Stripe\\Charge::create([\n 'amount' => 1500, // $15.00 this time\n 'currency' => 'usd',\n 'customer' => $customer_id, // fetch it from your database which we have stored above\n ]);\n\n dd('successfylly charged');\n }",
"public function GetCustomer($customer_id) {\n\n //set up the query\n $this->sql = \"SELECT *\n FROM customers\n WHERE customerID = :customer_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':customer_id' => $customer_id,\n ]);\n }",
"public function customer($customer_id, &$data){\n if(!$this->that->config->get('koraki_registered'))\n return;\n\n if(empty($customer_id)){\n return;\n }\n\n $this->that->load->model('account/customer');\n\n $customer = $this->that->model_account_customer->getCustomer($customer_id);\n\n $this->that->load->model('localisation/country');\n\n $country_info = $this->that->model_localisation_country->getCountry($data['country_id']);\n\n $variables = array(\n \"fname\" => $customer['firstname'],\n \"lname\" => $customer['lastname'],\n \"city\" => $data['city'],\n \"country\" => $country_info['name'],\n \"country_code\" => $country_info['iso_code_2']\n );\n\n $location_array = array();\n array_push($location_array, $data['city']);\n array_push($location_array, $country_info['name']);\n $location = $data['city'] ? join(\", \", $location_array) : $country_info['name'];\n $location_verb = (empty($data['country_id']) && empty($data[0]['city'])) ? \"\" : \" from \" . $location;\n\n\n if(isset($customer) && $customer['newsletter']) {\n $post = array(\n \"variables\" => json_encode($variables),\n \"notificationText\" => empty($customer['firstname'])?\"Someone\" : $customer['firstname'] . $location_verb . \" registered as a user\",\n \"location\" => $location\n );\n\n $this->post($post);\n }\n }",
"function select_customer() {\n $data = array();\n $customer_id = $this->input->post(\"customer\");\n\n if ($this->Customer->account_number_exists($customer_id)) {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n\n if ($this->Customer->exists($customer_id)) {\n $this->sale_lib->set_customer($customer_id);\n if ($this->config->item('automatically_email_receipt')) {\n $this->sale_lib->set_email_receipt(1);\n }\n } else {\n $data['error'] = lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }",
"public function getStripeCustomerId() {\n return $this->stripe_customer_id;\n\n }",
"public function get_customer($id = null) {\n $this->db->select('*');\n if ($id != NULL) {\n $this->db->where('customer_id_pri', $id);\n }\n $this->db->order_by('customer_id_pri');\n return $this->db->get('customer');\n }",
"function wp_stripe_find_customer_subscription_charge($customer_id, $plan_id) {\n\n $customer_invoices = Stripe_Invoice::all(array('customer' => $customer_id));\n\n $matching_invoice = null; \n\n // Loop through invoices looking for a matching subscription\n foreach( $customer_invoices->data as $invoice) {\n if ( $invoice->lines->subscriptions ) {\n foreach( $invoice->lines->subscriptions as $subscription ) {\n if ( $subscription->plan->id == $plan_id ) {\n $matching_invoice = $invoice; \n break 2;\n }\n }\n }\n }\n\n // Get the charge if we found a matching invoice\n $charge = $matching_invoice ? Stripe_Charge::retrieve($matching_invoice->charge) : null;\n\n return $charge;\n}",
"public function getCustomerIdentifier()\n {\n return $this->customer_identifier;\n }",
"function getStripeCustomerId(){\n\n $getCusId = $this->common_model->getsingle(USERS,array('userId'=>$this->session->userdata('userId')));\n if($getCusId){\n return $getCusId->stripeCustomerId;\n }else{\n return FALSE;\n }\n\n }",
"public function getOrCreateCustomer();",
"function jpid_next_customer_id() {\n\treturn JPID()->db_customers->get_next_id();\n}",
"function getCustomer($db_link, $custID){\n\t\t$sql_cust = \"SELECT * FROM customer LEFT JOIN custsex ON customer.custsex_id = custsex.custsex_id LEFT JOIN custmarried ON customer.custmarried_id = custmarried.custmarried_id LEFT JOIN custsick ON customer.custsick_id = custsick.custsick_id LEFT JOIN user ON customer.user_id = user.user_id WHERE cust_id = '$custID'\";\n\t\t$query_cust = mysqli_query($db_link, $sql_cust);\n\t\tcheckSQL($db_link, $query_cust, $db_link);\n\t\t$result_cust = mysqli_fetch_assoc($query_cust);\n\n\t\treturn $result_cust;\n\t}",
"function ciniki_sapos_web_stripeCustomerCharge(&$ciniki, $tnid, $args) {\n\n if( !isset($args['stripe-token']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.238', 'msg'=>'Internal Error'));\n }\n if( !isset($args['stripe-email']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.239', 'msg'=>'Internal Error'));\n }\n if( !isset($args['charge-amount']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.244', 'msg'=>'Internal Error'));\n }\n\n //\n // Load the tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'core', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_currency = $rc['settings']['intl-default-currency'];\n\n //\n // Load stripe settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_sapos_settings', 'tnid', $tnid, 'ciniki.sapos', 'settings', 'stripe');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['settings']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.240', 'msg'=>'Stripe processing not configured'));\n }\n $stripe_settings = $rc['settings'];\n\n if( !isset($stripe_settings['stripe-sk']) || $stripe_settings['stripe-sk'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.241', 'msg'=>'Stripe processing not configured'));\n }\n\n //\n // Load stripe library\n //\n require_once($ciniki['config']['ciniki.core']['lib_dir'] . '/Stripe/init.php');\n \\Stripe\\Stripe::setApiKey($stripe_settings['stripe-sk']);\n\n //\n // Create customer\n //\n try {\n $customer = \\Stripe\\Customer::create(array(\n 'email'=>$args['stripe-email'],\n 'source'=>$args['stripe-token'],\n ));\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to setup customer: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.242', 'msg'=>$e->getMessage()));\n }\n \n //\n // Process the charge\n //\n if( $args['charge-amount'] > 0 ) {\n try {\n $charge = \\Stripe\\Charge::create(array(\n 'customer' => $customer->id,\n 'amount' => number_format($args['charge-amount'] * 100, 0, '', ''),\n 'currency' => $intl_currency,\n ));\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to charge customer: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.245', 'msg'=>$e->getMessage()));\n }\n\n //\n // Check for a balance transaction\n //\n if( isset($charge['balance_transaction']) ) {\n try {\n $balance = \\Stripe\\BalanceTransaction::retrieve($charge['balance_transaction']);\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to get balance: \" . $e->getMessage());\n }\n }\n } else {\n //\n // If nothing to charge, store the customer details as part of the transaction.\n //\n $charge = $customer;\n }\n\n //\n // Add the transaction to the ciniki_sapos_transactions\n //\n if( isset($args['invoice_id']) ) {\n $dt = new DateTime('now', new DateTimeZone('UTC'));\n if( isset($balance['fee']) ) {\n $fees = bcdiv($balance['fee'], 100, 2);\n } else {\n $fees = 0;\n }\n if( isset($charge['outcome']['seller_message']) ) {\n $gateway_status = $charge['outcome']['seller_message'];\n } else {\n $gateway_status = 'Unknown';\n }\n $transaction_args = array(\n 'invoice_id'=>$args['invoice_id'],\n 'status'=>40,\n 'transaction_type'=>20,\n 'transaction_date'=>$dt->format('Y-m-d H:i:s'),\n 'source'=>30,\n 'customer_amount'=>$args['charge-amount'],\n 'transaction_fees'=>$fees,\n 'tenant_amount'=>bcsub($args['charge-amount'], $fees, 6),\n 'user_id'=>0,\n 'notes'=>'',\n 'gateway'=>30,\n 'gateway_token'=>$charge['id'],\n 'gateway_status'=>$gateway_status,\n 'gateway_response'=>serialize($charge),\n );\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.sapos.transaction', $transaction_args);\n if( $rc['stat'] != 'ok' ) {\n error_log(\"STRIPE-ERR: Unable to record transaction: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.243', 'msg'=>$e->getMessage()));\n }\n }\n\n return array('stat'=>'ok');\n}",
"public function findById($id){\n $customer = Customer::find($id);\n return $customer;\n }",
"public function setExtCustomerId($id);",
"public function getCustomer_Id() {\n return $this->customer_Id; \n }",
"public function setCustomerId($value)\n {\n return $this->set(self::customer_id, $value);\n }",
"public function customer(){\n\t\treturn Customers::find($this->customers_id);\n\t}",
"protected function _lookupCustomerId()\n {\n return $this->_customerFactory->create()\n ->loadByEmail($this->_quote->getCustomerEmail())\n ->getId();\n }",
"public function __construct($id, $customer_id)\n {\n $this->id = $id;\n $this->customer_id = $customer_id;\n }",
"public function getCustomerByIdCustomer($id){\n $dbResult = $this->db->query(\"SELECT * FROM customer WHERE id_customer = ?\", array($id));\n return $dbResult->getResult();\n }",
"function update_customer($customer_id,$params){\n $this->company_db->update('tbl_customer', $params,array(\"id\"=>$customer_id)); \n }",
"function select_customer()\n {\n $data = array();\n $customer_id = $this->input->post(\"term\");\n \n if ($this->Customer->account_number_exists($customer_id))\n {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n \n if ($this->Customer->exists($customer_id))\n {\n $this->sale_lib->set_customer($customer_id);\n if($this->config->item('automatically_email_receipt'))\n {\n $this->sale_lib->set_email_receipt(1);\n }\n }\n else\n {\n $data['error']=lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }",
"public function getCustomer($id) {\n return $this->customerRepository->getById($id);\n }",
"public function getCustomerId()\n {\n return $this->getParameter('customerId');\n }",
"public function getChargeId()\n {\n return $this->get(self::_CHARGE_ID);\n }",
"public function getCustomer()\n {\n if (null === $customer && isset($this['CUSTOMER_ID']))\n {\n $this->customer = \\Fastbill\\Customer\\Finder::findOneById($this['CUSTOMER_ID']);\n }\n return $this->customer;\n }",
"public static function get_customer( $id=0 ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\treturn $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}customers WHERE id = %d\", $id ) );\r\n\t}",
"public function c_view($id = null)\n {\n\t\t$this->layout= 'c_default';\n\t\t$this->getC();\n $customer = $this->Customers->get($id, [\n 'contain' => ['Hires', 'Selections']\n ]);\n $this->set('customer', $customer);\n $this->set('_serialize', ['customer']);\n }",
"public function setCustomerID($customer_id)\n {\n $this->customer_id = $customer_id;\n }",
"public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }",
"public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }",
"function add_customer($params){\n $this->company_db->insert('tbl_customer', $params);\n return $this->company_db->insert_id();\n }",
"public function get_customer_byid($customer_id = \"\"){\r\n $query = $this->db->get_where('view_customer_info', array('customer_id' => $customer_id));\r\n return $query->row_array();\r\n }",
"public function getCustomerId()\n {\n if (array_key_exists(\"customerId\", $this->_propDict)) {\n return $this->_propDict[\"customerId\"];\n } else {\n return null;\n }\n }",
"public function getCustomerBy_ID($customer_id) { /* this fun is used to get customer deatails */\n\n $sqlselect = \"SELECT * FROM customer_details WHERE cust_id = '$customer_id'\";\n\n $result = $this->db->query($sqlselect);\n\n if ($result->num_rows() <= 0) {\n $response = array(\n 'status' => 0,\n 'status_message' => 'No Records Found.');\n } else {\n $response = $result->result_array();\n }\n return $response;\n }",
"function getCustomerID($userID) {\n $customerModel = $this->loadModel('Customers');\n $query = $customerModel->find()->select('id')->where([\n 'user_id' => $userID\n ])->first();\n return $query->id;\n }",
"public function update_customer($data,$id){\n\t\t\n\t\t\t$this->db->where('id',$id);\n\t\t\t$this->db->update('customers',$data);\n\t\t\tredirect('Customer');\n\t\t\n\t}",
"public function customer(): BelongsTo\n {\n return $this->belongsTo(StripeCustomer::class);\n }",
"public function setCustomerId($customerId)\n {\n $this->_customer = $this->customerRepository->getById($customerId);\n return $this;\n }",
"public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}",
"public function getCustomerId()\n {\n return $this->getValue('nb_customer_id');\n }",
"protected function getCustomerId()\n {\n return $this->customerSession->getCustomer()->getId();\n }",
"public function setCustomerId(?string $customerId): void\n {\n $this->customerId['value'] = $customerId;\n }",
"public function customerId(): int\n {\n return $this->customerId;\n }",
"private function populateCustomerReference(Customer $customer)\n {\n $customerReference = NostoCustomerManager::getCustomerReference($customer);\n if (!empty($customerReference)) {\n $this->setCustomerReference($customerReference);\n } else {\n $customerReference = NostoCustomerManager::generateCustomerReference($customer);\n NostoCustomerManager::saveCustomerReference($customer, $customerReference);\n $this->setCustomerReference($customerReference);\n }\n }",
"public function getCustomer()\n {\n return \\tabs\\api\\core\\Customer::create($this->getCusref());\n }",
"public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }",
"public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }",
"public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }",
"public function setCustomerId($value)\n {\n return $this->setParameter('customerId', $value);\n }",
"public function customer_save($id = NULL)\n {\n if ($this->input->post())\n {\n if ($this->input->post('id'))\n {\n $this->MCustomers->update(trim($this->input->post('code')));\n }\n else\n {\n $ac_receivable = $this->MSettings->get_by_company_id($this->session->user_company);\n $chart = $this->MAc_charts->get_by_id($ac_receivable['ac_receivable']);\n $siblings = $this->MAc_charts->get_by_parent_id($ac_receivable['ac_receivable']);\n if (count($siblings) > 0)\n {\n $ac_code_temp = explode('.', $siblings['code']);\n $ac_last = count($ac_code_temp) - 1;\n $ac_new = (int) $ac_code_temp[$ac_last] + 10;\n $ac_code = $chart['code'] . '.' . $ac_new;\n }\n else\n {\n $ac_code = $chart['code'] . '.10';\n }\n\n $ac_id = $this->MAc_charts->account_create($ac_receivable['ac_receivable'], $ac_code, $this->input->post('name'));\n\n // $customer = $this->MCustomers->get_latest();\n // if ( count( $customer ) > 0 ) {\n // $code = (int) $customer['code'] + 1;\n // } else {\n // $code = 1001;\n // }\n $this->MCustomers->create(trim($this->input->post('code')), $ac_id);\n }\n\n $this->session->set_flashdata('success', 'Customer saved successfully.');\n redirect('inventory/customer-list', 'refresh');\n }\n else\n {\n $data['title'] = 'POS System';\n $data['menu'] = 'inventory';\n $data['content'] = 'admin/inventory/customer/save';\n $customer = $this->MCustomers->get_latest();\n if (count($customer) > 0)\n {\n $data['code'] = (int)$customer['code'] + 1;\n }\n else\n {\n $data['code'] = 1001;\n }\n $data['customer'] = $this->MCustomers->get_by_id($id);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/template', $data);\n }\n }",
"public function getCustid()\n {\n return $this->custid;\n }",
"public function get($id)\n {\n return Customer::find($id);\n }",
"protected function _addCustomer($object) {\n\t\t$format = Mage::getStoreConfig('tax/avatax/cust_code_format', $object->getStoreId());\n\t\t$customer = Mage::getModel('customer/customer');\n\t\t$customerCode = '';\n\t\t\n\t\tif($object->getCustomerId()) {\n\t\t\t$customer->load($object->getCustomerId());\n\t\t\t$taxClass = Mage::getModel('tax/class')->load($customer->getTaxClassId())->getOpAvataxCode();\n \t$this->_request->setCustomerUsageType($taxClass);\n\t\t}\n\t\t\n\t\tswitch($format) {\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::LEGACY:\n\t\t\t\tif($customer->getId()) {\n\t\t\t\t\t$customerCode = $customer->getName() . ' (' . $customer->getId() . ')';\n\t\t\t\t} else {\n $address = $object->getBillingAddress() ? $object->getBillingAddress() : $object;\n\t\t\t\t\t$customerCode = $address->getFirstname() . ' ' . $address->getLastname() . ' (Guest)';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_EMAIL:\n\t\t\t\t$customerCode = $object->getCustomerEmail() ? $object->getCustomerEmail() : $customer->getEmail();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// New code by David Dzimianski - CSH 2013\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_MAS_ID:\n\t\t\t\t$customerCode = $object->getData('mas_id') ? '00' . $object->getData('mas_id') : '00' . $customer->getData('mas_id');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_ID:\n\t\t\tdefault:\n\t\t\t\t$customerCode = $object->getCustomerId() ? $object->getCustomerId() : 'guest-'.$object->getId();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->_request->setCustomerCode($customerCode);\n\t}",
"function getCustID($db_link){\n\t\tif (isset($_GET['cust'])) $_SESSION['cust_id'] = sanitize($db_link, $_GET['cust']);\n\t\telse header('Location: start.php');\n\t}",
"public function customer()\r\n {\r\n return $this->belongsTo(Customer::class, 'customer_id', 'id');\r\n }",
"function getCustomer($customer_id) {\n \t\n \t$sql = \"SELECT * FROM customer WHERE id=?\";\n \t\n \t$result = $this->db->query($sql, array($customer_id));\n \t\n \tif( !$result )\n \t\treturn FALSE;\n \t\n \t//personal\n \t$personal['id'] = $result['id'];\n \t$personal['name'] = $result['name'];\n \t$personal['address'] = $result['address'];\n \t$personal['identify_no'] = $result['identify_no'];\n \t$personal['birthday'] = $result['birthday'];\n \t$personal['cellphone'] = $result['cellphone'];\n \t$personal['email'] = $result['email'];\n \t$personal['gender'] = $result['gender'];\n \t$personal['marriage'] = $result['marriage'];\n \t$personal['telephone'] = $result['telephone'];\n \t$personal['thumbnail'] = $result['thumbnail'];\n \t$personal['fb_id'] = $result['fb_id'];\n \t$customer['note'] = $data[\"note\"];\n \t$personal['create_time'] = $result['create_time'];\n \t$personal['modify_time'] = $result['modify_time'];\n $personal['personality'] = $result['personality'];\n \t\n \t//children\n \t$child['boy'] = $result['child_boy'];\n \t$child['girl'] = $result['child_girl'];\n \t\n \t//visit_history\n \t$visit_records = $this->getVisitRecords($customer_id);\n \t\n \t//evaluation\n \t$evaluations = $this->getEvaluation($customer_id);\n \t\n \t//tag\n \t$tags = $this->getTags($customer_id);\n \t\n \n \t//company\n \t$company['name'] = $result['company_name'];\n \t$company['address'] = $result['company_address'];\n \t$company['phone'] = $result['company_phone'];\n \t$company['category'] = $result['company_category'];\n \t$company['title'] = $result['company_title'];\n\n \t\n \t//combine the data\n \t$data = $personal;\n \t$data['child'] = $child;\n \t$data['company'] = $company;\n \t\n \tif( $evaluations )\n \t\t$data['evaluation'] = $evaluations;\n \t\n \tif( $visit_records )\n \t\t$data['visit_history'] = $visit_records;\n \t\n \tif( $tags )\n \t\t$data['tags'] = $tags;\n\n //relationship\n $relationship = $this->getRelationship($customer_id);\n if( $relationship )\n $data['relationship'] = $relationship;\n \t\n \treturn $data;\n }",
"public function setId($customerAddressId);",
"function get_customer($customer_id)\n {\n return $this->db->get_where('customer',array('customer_id'=>$customer_id))->row_array();\n }",
"public function edit(Customer $customer, $id)\n {\n //\n $customer = Customer::with('reference', 'sales_executive', 'sales_supervisor', 'company')->find($id);\n $references = Referensi::all();\n $sales_executives = Sales::where('sales_position', 'Sales')->get();\n $sales_supervisor = Sales::where('sales_position', 'Supervisor')->get();\n $companies = Company::where('company_type', 'customer')->get();\n return view('pages.customer.create-customer', compact('customer', 'references', 'sales_executives', 'sales_supervisor', 'companies'));\n }",
"public function setCustomerTransactionId($id) {\n \t$this->customerTransactionId = $id;\n }",
"public function getCustomer();",
"public function getCustomerById($id){ \n $query = \"SELECT * FROM tbl_customer WHERE id = '$id' \";\n $result = $this->db->select($query);\n return $result;\n }",
"public function bill($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Bill::find_with_client($this, $id);\n\n }",
"public function customer_info( $customer_id ) {\r\n\t\treturn $this->_send_request( 'customers/'.$customer_id );\r\n\t}",
"public function getCreditCardById($customer_id, $card_id)\n {\n \n // verify the required parameter 'customer_id' is set\n if ($customer_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_id when calling getCreditCardById');\n }\n // verify the required parameter 'card_id' is set\n if ($card_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $card_id when calling getCreditCardById');\n }\n \n // parse inputs\n $resourcePath = \"/customer/{customer_id}/credit_card/{card_id}\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"GET\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customer_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_id),\n $resourcePath\n );\n }// path params\n if ($card_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"card_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($card_id),\n $resourcePath\n );\n }\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCard'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCard', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCard', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }",
"public function cancel(Request $request)\n{\n// Get the payment token ID submitted by the form:\n $token = $_POST['stripeToken'];\n \n $customer = \\Stripe\\Customer::create([\n 'source' => $token,\n 'email' => 'test@gmail.com',\n ]);\n $charge = \\Stripe\\Charge::create([\n 'amount' => 1000,\n 'currency' => 'usd',\n 'customer' => $customer->id,\n ]);\n print_r($charge);\n die;\n\n return redirect()->back()->with('message', 'Payment Successfully Updated.');\n \n\n\n\n}",
"public function setCustomerID($customerID)\n {\n $this->customerID = $customerID;\n return $this;\n }",
"public function setCustomerId($val)\n {\n $this->_propDict[\"customerId\"] = $val;\n return $this;\n }",
"public function getCustomerId()\n {\n return Mage::getSingleton('customer/session')->getCustomerId();\n }",
"public function getCustomerId()\n {\n return Mage::getSingleton('customer/session')->getCustomerId();\n }",
"public function customer()\n {\n return Customer::retrieve($this->customer);\n }",
"public function joinCustomer($classId);",
"public function add_customer($order) {\n\n $customerData = array(\n 'name' => $order->billing_first_name,\n 'last_name' => $order->billing_last_name,\n 'email' => $order->billing_email,\n 'requires_account' => false,\n 'phone_number' => $order->billing_phone, \n );\n\n if($this->hasAddress($order)) {\n $customerData['address'] = array(\n 'line1' => substr($order->billing_address_1, 0, 200),\n 'line2' => substr($order->billing_address_2, 0, 50),\n 'line3' => '',\n 'state' => $order->billing_state,\n 'city' => $order->billing_city,\n 'postal_code' => $order->billing_postcode,\n 'country_code' => $order->billing_country\n );\n }\n \n $response = $this->openpay_request($customerData, 'customers');\n\n if (!isset($response->error_code)) {\n // Store the ID on the user account\n if (is_user_logged_in()) {\n update_user_meta(get_current_user_id(), '_openpay_customer_id', $response->id);\n }\n\n // Store the ID in the order\n update_post_meta($order->id, '_openpay_customer_id', $response->id);\n\n return $response->id;\n } else {\n $msg = $this->handleRequestError($response->error_code);\n return new WP_Error('error', __($response->error_code.' '.$msg, 'openpay-woosubscriptions'));\n }\n }",
"public function copy_customer( $cid )\n\t{\n\t\t\n\t\t//SHOULD FIRST CHECK THAT BOTH MAGENTO DATABASES ARE THE SAME\n\t\t\n\t\t//GET TABLES WITH A FOREIGN KEY RESTRAINT TO THE customer_entity TABLE\n\t\t$cust_restraint_tables\t= $this->get_customer_restraint_tables($this->pdo_source);\n\t\t\n\t\t//GET TABLES WITH THE COLUMN customer_id THAT ARE NOT FOREIGN KEY RESTRAINT TABLES\n\t\t$cust_id_tables\t\t\t= array_diff_assoc( $this->get_customer_id_tables($this->pdo_source), $cust_restraint_tables );\n\n\t\t//ALL TABLES FOR CUSTOMER\n\t\t$tables = array_merge( $cust_restraint_tables, $cust_id_tables );\n\n\t\t//ELIMINATE TABLES FOR ORDERS\n\t\t$sales_tables\t\t\t= $this->get_sales_restraint_tables( $this->pdo_source );\n\t\t\n\t\t$sales_tables['sales_flat_order'] = 'customer_id';\n\t\t\n\t\t$tables = array_diff_key( $tables, $sales_tables );\n\t\t\n\t\t//print_r($tables);\n\t\t//print_r($sales_tables);\n\t\t//exit;\n\n\t\t//GET A LIST OF ALL THE PRIMARY KEYS IN EACH TABLE\n\t\t$primary_keys\t\t\t= $this->get_primary_keys($this->pdo_source);\n\t\t\n\n\t\t//FIND ALL TABLES WITH 2+ PRIMARY KEYS AND GET RID OF THEM\n\t\t//IF THE PROGRAM EXITED ON THIS LOOP, A ROW HAS MORE THAN 1 PRIMARY KEY AND THIS CLASS IS NOT SET UP TO HANDLE IT YET\n\t\tforeach ( $tables as $table_name=>$column_name )\n\t\t{\n\n\t\t\tif ( count( $primary_keys[$table_name] ) > 1 )\n\t\t\t{\n\t\t\t\t$result = $this->pdo_source->query('select count(*) from ' . $table_name . ' ')->fetchColumn();\n\n\t\t\t\t$rowsInTableForCid = $this->pdo_source->query('select count(*) from ' . $table_name . ' where ' . $tables[$table_name] . ' = ' . $cid)->fetchColumn();\n\t\t\t\t\n\t\t\t\tif ( $rowsInTableForCid > 0 )\n\t\t\t\t{\n\t\t\t\t\techo $table_name . ' has ' . count($primary_keys[$table_name]) . ' primary keys and ' . $result . ' rows' . \"\\n\";\n\t\t\t\t\techo 'There are ' . $rowsInTableForCid . ' rows with the customer id as the value of the column ' . $tables[$table_name] ;\n\t\t\t\t\techo 'exiting, line ' . __LINE__. \"\\n\";exit;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t//FIRST INSERT THE CUSTOMER ROW INTO THE customer_entity TABLE\n\t\t$query_source = \"select * from customer_entity where entity_id = \" . $cid . \";\";\n\t\tforeach ( $this->pdo_source->query($query_source) as $row )\n\t\t{\n\t\t\tunset( $row['entity_id'] );\n\t\t\t\n\t\t\t$query_target = \"insert into customer_entity (\" . implode(',', array_keys($row)) . \") values (\" . implode(',', array_fill(0, count($row), '?')) . \")\";\n\t\t\t\n\t\t\t//echo $query_target . \"\\n\";\n\t\t\t//print_r($row);\n\t\t\t//CREATE PARAMETERS FOR ->execute() CALL\n\t\t\t$params = array();\n\t\t\tforeach ( $row as $key=>$value)\n\t\t\t{\n\t\t\t\t$params[] = $value;\n\t\t\t}\n\t\t\t\n\t\t\t//COMMENT IN AFTER TESTING\n\t\t\t//*\n\t\t\t$st\t= $this->pdo_target->prepare($query_target);\n\t\t\t$st->execute( $params );\n\t\t\t\n\t\t\t$target_cid = $this->pdo_target->lastInsertId();\n\t\t\t//*/\n\t\t\t//$target_cid = 13734;\n\t\t\t\n\t\t\techo \"Customer Inserted to target with entity_id = \" . $target_cid . \"\\n\";\n\t\t\t\n\t\t\t//print_r($row);exit;\n\t\t}\n\t\t//RETURN THE last_insert_id AND USE IT FOR THE OTHER TABLES\n\t\n\n\t\n\t\t//THESE ARE TABLES WE CAN WORK WITH\n\t\tforeach ( $tables as $table_name=>$column_name )\n\t\t{\n\n\t\t\techo $table_name . \" \" . $column_name . \"\\n\";\n\t\t\t//GET ROWS FROM SOURCE WHERE THE SOURCE customer id IS PRESENT\n\t\t\t$query_source = \"select * from \" . $table_name . \" where \" . $column_name . \" = \" . $cid . \";\";\n\t\t\t\t\t\n\t\t\tforeach ( $this->pdo_source->query($query_source) as $row )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//print_r($row);\n\t\t\t\t\n\t\t\t\t//GET RID OF THE PRIMARY KEY\n\t\t\t\tunset( $row[$primary_keys[$table_name][0]] );\n\t\t\t\t//REPLACE FOREIGN RESTRAINT WITH THE NEW CLIENT ID\n\t\t\t\t$row[$column_name] = $target_cid;\n\t\t\t\t\n\t\t\t\t$query_target = \"insert into \" . $table_name . \" (\" . implode(',', array_keys($row)) . \") values (\" . implode(',', array_fill(0, count($row), '?')) . \")\";\n\t\t\t\t\n\t\t\t\t//echo $query_target . \"\\n\";\n\t\t\t\t//print_r($row);\n\t\t\t\t//CREATE PARAMETERS FOR ->execute() CALL\n\t\t\t\t$params = array();\n\t\t\t\tforeach ( $row as $key=>$value)\n\t\t\t\t{\n\t\t\t\t\t$params[] = $value;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$st\t= $this->pdo_target->prepare($query_target);\n\t\t\t\t$st->execute( $params );\n\t\t\t\n\t\t\t\t//exit;\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t\techo \"DONE copying customer\\n executing: \\n \\$mg->copy_sales(\". $cid .\" , \" . $target_cid . \");\\n\";\n\t\t$this->copy_sales( $cid, $target_cid );\n\t\n\t}",
"public function displayCustomer($customerid) {\n global $mwAdminDB; // db connection \n\n return ($mwAdminDB->displayCustomer($customerid));\n }",
"public function setCustomerId($var)\n {\n GPBUtil::checkString($var, True);\n $this->customer_id = $var;\n\n return $this;\n }"
]
| [
"0.650749",
"0.64770037",
"0.64075977",
"0.6096979",
"0.6096979",
"0.6096979",
"0.6096523",
"0.6042491",
"0.59913534",
"0.59608376",
"0.59227383",
"0.59227383",
"0.5898742",
"0.58971775",
"0.5885786",
"0.5881254",
"0.5877852",
"0.58723754",
"0.5848017",
"0.5838307",
"0.58331305",
"0.58271945",
"0.58219206",
"0.57852125",
"0.577744",
"0.5754303",
"0.57541686",
"0.5674773",
"0.5673723",
"0.56705403",
"0.56685835",
"0.5659557",
"0.5652971",
"0.5649985",
"0.5631987",
"0.56306535",
"0.5628777",
"0.56224805",
"0.56200975",
"0.56164324",
"0.56144637",
"0.5608488",
"0.5590475",
"0.55856",
"0.5584101",
"0.556354",
"0.55622166",
"0.5552299",
"0.5550372",
"0.55424565",
"0.55393934",
"0.5530685",
"0.5530685",
"0.551904",
"0.551217",
"0.54768485",
"0.5474664",
"0.54625463",
"0.5453817",
"0.5448032",
"0.5446363",
"0.54403675",
"0.54385674",
"0.54364204",
"0.5433117",
"0.5432894",
"0.54323983",
"0.5431842",
"0.5431119",
"0.5431119",
"0.5431119",
"0.5428444",
"0.5422242",
"0.54182637",
"0.5416707",
"0.54152954",
"0.54115355",
"0.5406132",
"0.53947264",
"0.538882",
"0.5383952",
"0.5373961",
"0.5367923",
"0.53676796",
"0.5364574",
"0.53629565",
"0.536068",
"0.53601855",
"0.535691",
"0.5347499",
"0.5346284",
"0.5342517",
"0.5342517",
"0.5341563",
"0.5332236",
"0.5331822",
"0.53307706",
"0.5317406",
"0.53104526"
]
| 0.54373944 | 64 |
Use a Plan ID Link the charge to a plan, doesn't require a Schedule | public function UsePlan($plan_id) {
$this->Param('plan_id', $plan_id, 'recur');
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function billingPlan($id)\n {\n $this->shellshock(request(), [\n 'number' => 'required|numeric',\n 'exp_month' => 'required|numeric',\n 'exp_year' => 'required|numeric',\n 'cvc' => 'required|numeric',\n ]);\n\n Stripe::setApiKey(config('turtle.billing.stripe_secret_key'));\n\n // create card token\n $token = Token::create([\n 'card' => [\n 'number' => request()->input('number'),\n 'exp_month' => request()->input('exp_month'),\n 'exp_year' => request()->input('exp_year'),\n 'cvc' => request()->input('cvc'),\n ],\n ]);\n\n // create/update customer\n if (!auth()->user()->billing_customer) {\n $customer = Customer::create([\n 'source' => $token->id,\n 'email' => auth()->user()->email,\n ]);\n }\n else {\n $customer = Customer::retrieve(auth()->user()->billing_customer);\n $customer->source = $token->id;\n $customer->save();\n }\n\n // create/update subscription\n if (!auth()->user()->billing_subscription) {\n $subscription = Subscription::create([\n 'customer' => $customer->id,\n 'items' => [['plan' => $id]],\n ]);\n }\n else {\n $subscription = Subscription::retrieve(auth()->user()->billing_subscription);\n Subscription::update($subscription->id, [\n 'items' => [[\n 'id' => $subscription->items->data[0]->id,\n 'plan' => $id,\n ]],\n ]);\n }\n\n // update user\n auth()->user()->update([\n 'billing_customer' => $customer->id,\n 'billing_subscription' => $subscription->id,\n 'billing_plan' => $id,\n 'billing_cc_last4' => $token->card->last4,\n 'billing_period_ends' => Carbon::createFromTimestamp($subscription->current_period_end),\n ]);\n\n activity('Subscribed to '.$id);\n flash('success', 'Thanks for subscribing!');\n\n return response()->json(['reload_page' => true]);\n }",
"public function getPlanIdentifier()\n {\n return $this->stripe_price;\n }",
"function TestCase_link_plan($case_id, $plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.link_plan', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"private function get_plan()\n\t{\n\t\treturn $this->m_plan;\n\t}",
"public function update(Request $request, $id)\n {\n $this->authorize('update', Plan::class);\n\n $this->validate($request, [\n 'name' => 'required',\n 'price' => 'required',\n 'duration' => 'required',\n ]);\n\n $plan = Plan::findOrFail($id);\n // Generate plan slug from plan name\n $slug = str_replace(' ','-', $request->input('name'));\n $gateway_id = str_replace(' ','_', $request->input('name'));\n $team_enable = !empty($request->input('teams_limit')) ? 1 : 0;\n $teams_limit = !empty($request->input('teams_limit')) ? $request->input('teams_limit') : NULL;\n $price = (float) $request->input('price') * 100;\n \n // Delete the plan on stripe \n $stripe_plan = \\Stripe\\Plan::retrieve($plan->gateway_id);\n $stripe_plan->delete();\n\n $interval=explode(',',$request->duration);\n //Add the Stripe Api key to\n // Recrete a new plan on stripe\n \\Stripe\\Plan::create([\n \"amount\" => $price,\n \"interval\" => $interval[1],\n \"interval_count\"=>$interval[0], \n \"product\" => [\n \"name\" => $request->input('name'),\n ],\n \"currency\" => \"usd\",\n \"id\" => $gateway_id,\n \"trial_period_days\" => $request->input('trial'),\n ]);\n\n $plan->name = $request->input('name');\n $plan->gateway_id = $gateway_id;\n $plan->price = $request->input('price');\n $plan->brand = $request->input('brand');\n $plan->contest = $request->input('contest');\n $plan->duration = $request->input('duration');\n $plan->other_info_1 =$request->input('plan_info_1');\n $plan->other_info_2 = $request->input('plan_info_2');\n //$plan->teams_enabled = $team_enable;\n //$plan->teams_limit = $teams_limit;\n $plan->active =1;\n $plan->slug = $slug;\n //$plan->trial_period_days = $request->input('trial');\n $plan->save();\n\n return redirect()->back()->with(\"status\", \"Your plan has been updated.\");\n }",
"public function getPlan();",
"public function getPlanById()\n {\n // Arrange\n // Act\n if (! isset($this->plans)) {\n $this->getsAListOfPlans();\n }\n $plans = $this->plans;\n $plan = $plans['data'][0];\n\n $plan = Ezypay::getPlan($plan['id']);\n\n // Assert\n $this->assertNotNull($plan);\n $this->assertEquals($plan['id'], $plan['id']);\n }",
"public function getBillingPlan(User $user, $id);",
"public function edit($id)\n {\n\n Log::debug(\"EDIT PLAN IN CONTROLLER\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->findPlan($id);\n\n if ($result['message'] == 'Success'){\n\n $plan = $result['plan'];\n\n $amountLen = strlen($plan->amount_decimal); \n $amount = substr_replace( $plan->amount_decimal, '.', $amountLen - 2, 0 ); \n\n $planArray[0]['id'] = $plan->id;\n $planArray[0]['product'] = $plan->product;\n $planArray[0]['interval'] = $plan->interval;\n $planArray[0]['amount'] = $amount;\n $planArray[0]['nickname'] = $plan->nickname;\n \n $plan = json_decode(json_encode($planArray), FALSE);\n \n return view('stripe.plan.create', ['plan' => $plan ]);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n }",
"public function creating(Plan $plan)//troquei o created por creating\n {\n $plan->url = Str::kebab($plan->name);\n }",
"public function setPlanId($val)\n {\n $this->plan_id = $val;\n return $this;\n }",
"public function plan_info( $plan_id ) {\r\n\t\treturn $this->_send_request( 'plans/'.$plan_id );\r\n\t}",
"public function show(Plan $plan)\n {\n //\n }",
"public function setPlan(?string $plan): self\n {\n $this->plan = $plan;\n\n return $this;\n }",
"public function show($id)\n {\n Log::debug(\"SHOW PLAN IN CONTROLLER\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->findPlan($id);\n\n if ($result['message'] == 'Success'){\n\n return new StripePlanResource($result['plan']);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }",
"public function planFind($id);",
"public function plan()\n {\n return $this->belongsTo('App\\Models\\Flights\\FlightPlan', 'plan_id');\n }",
"public static function byPlan($plan_id)\n {\n $payload = [\n 'recurringplan' => [\n 'recurringplanid' => $plan_id,\n ],\n ];\n\n return static::all($payload);\n }",
"public function show($id)\n {\n $plan = Plan::find($id);\n return $plan;\n }",
"function payplan($id=0){\r\n\t\t$row = $this->accounts_model->getAccountById($id);\r\n\r\n\t\tif(count($row) <= 0){\r\n\t\t\t$this->session->set_flashdata('error_msg', 'Account info incorrect');\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\r\n\t\tif (strpos($row['role'], 'pro_artist')) {\r\n\t\t\t$price = $row['pay_plan'] == 'annually' ? 12*12 : 18;//us$\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$price = $row['pay_plan'] == 'annually' ? 25*12 : 32;//us$\t\r\n\t\t}\r\n\r\n\t\t$this->load->view('header/header');\r\n\t\t$this->load->view('payplan_view', ['row'=>$row, 'price'=>$price]);\r\n\t\t$this->load->view('footer');\r\n\t}",
"public function billingPlanModal($id)\n {\n return view('turtle::auth.billing.plan', compact('id'));\n }",
"public function showPlan($id){\n $plan = App\\Plan::findOrFail($id);\n return view('plan.show',compact('plan'));\n }",
"public function setPlanID($planID)\n {\n $this->planID = $planID;\n return $this;\n }",
"public function plan_delete( $plan_id ) {\r\n\t\treturn $this->_send_request( 'plans/'.$plan_id, array(), STRIPE_METHOD_DELETE );\r\n\t}",
"public function plan() {\n return $this->belongsTo('Models\\Plan');\n }",
"public function show( $planId )\n\t{\n\t\t$plan = Plan::with('website', 'product')\n\t\t\t->findOrFail($planId);\n\n\t\treturn view('admin/products/billingplans/show', [\n\t\t\t'website' => $plan->product->website,\n\t\t\t'product' => $plan->product,\n\t\t\t'plan' => $plan,\n\t\t\t'periodicity' => $this->periodicity,\n\t\t]);\n\t}",
"function activateClinicPlan(){\n $clinic_id = $this->clinicInfo(\"clinic_id\");\n if( is_numeric($clinic_id) ) {\n $plan_id = $this->value('plan_id');\n \n if( is_numeric($plan_id)){\n \n //Get plan status\n $query = \"select is_public from plan where plan_id = '{$plan_id}' \"; \n $result = @mysql_query($query);\n if( $row = @mysql_fetch_array($result) ){\n $is_public = $row['is_public'];\n }\n if( (is_null($is_public) || $is_public != 1) && $this->value('act') == 'publish' ){\n $this->copy_plan_to_all_account_clinic($clinic_id, $plan_id);\n $is_public_sql = \" ,is_public = 1 \";\n }\n else{\n $is_public_sql = \"\";\n }\n \n $query = \" update plan set status = 1 $is_public_sql where plan_id = '{$plan_id}' \"; \n @mysql_query($query);\n }\n //unset($_SESSION['plan_id']);\n \n }\n // Redirect to Home page.\n header(\"location:index.php?action=therapist\");\n \n \n }",
"public function savePlan($plan)\n {\n return Stripe\\Plan::create(array(\n \"amount\" => $plan->price,\n \"interval\" => $plan->interval,\n \"name\" => $plan->name,\n \"currency\" => \"usd\",\n 'id' => $plan->level\n ));\n }",
"public function getPlan()\n {\n return Saas::getPlan($this->getPlanIdentifier());\n }",
"function wp_stripe_subscribe_customer_to_plan($email, $card, $plan_id, $description) {\n\n $customer = array(\n 'email' => $email,\n 'card' => $card,\n 'plan' => $plan_id\n );\n\n if ( $description ) {\n $customer['description'] = $description;\n }\n\n $response = Stripe_Customer::create($customer);\n\n return $response;\n}",
"public function edit(Plan $plan)\n {\n //\n }",
"public function __construct($controller, $name = \"StripePaymentDetailsForm\", $plan_id = null)\n {\n $this->plan_id = $plan_id;\n \n parent::__construct($controller, $name);\n\n // if no plan is set, log a message and disable this form\n if (!$plan_id) {\n $this->sessionMessage(\n _t(\"StripeForms.SelectStripePlan\", \"You need to select a plan before paying\"),\n \"bad\"\n );\n\n $this->makeReadOnly();\n }\n }",
"public function plan()\n {\n echo '客户要求改变计划' . PHP_EOL;\n }",
"public function switchFrequency(Plan $plan)\n {\n $subscription = new static();\n $subscription->setRawAttribute('name', $this->getRawAttribute('name'));\n $subscription->purchase()->associate($this->purchase);\n $subscription->user()->associate($this->user ? : Auth::user());\n $subscription->setParamsFromPlan($plan);\n $subscription->active = $this->active;\n $subscription->alias = $plan->alias;\n $subscription->currency = Currency::getUserCurrency();\n $subscription->price = $plan->price;\n $subscription->coupons = $plan->discounts;\n $subscription->addons = $plan->addonCoupons;\n $subscription->billingFrequency = $plan->billingFrequency;\n $subscription->trialEndsAt = $this->trialEndsAt;\n $subscription->nextBillingDate = $this->nextBillingDate;\n\n // If user has no payment methods, start non-recurring subscription\n if ($plan->price > 0 && !$subscription->user->hasPaymentMethod) {\n $subscription->endsAt = $subscription->nextBillingDate;\n }\n\n // Save new subscription, deactivate current one and return new subscription\n $subscription->save();\n $this->deactivate();\n\n // Set plan as old, because we are not going to charge customer\n $plan->old = true;\n\n return Factory::get(\n Invoice::class,\n true,\n $plan,\n Factory::get(Transaction::class, true)->fillFromSubscription($this)\n );\n }",
"public function plan()\n {\n return $this->belongsTo('App\\Plan');\n }",
"function fill_form_bp_plan($gml_id) {\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\t\" . \n\t\t\t\t\"'\" . $this->trim_gml_prefix_if_exists($gml_id) . \"'::text::uuid AS plan_gml_id,\n\t\t\t\tgmlas.xplan_name AS name,\n\t\t\t\tgmlas.nummer AS nummer,\n\t\t\t\tgmlas.internalid AS internalid,\n\t\t\t\tgmlas.beschreibung AS beschreibung,\n\t\t\t\tgmlas.kommentar AS kommentar,\n\t\t\t\tto_char(gmlas.technherstelldatum, 'DD.MM.YYYY') AS technherstelldatum,\n\t\t\t\tto_char(gmlas.genehmigungsdatum, 'DD.MM.YYYY') AS genehmigungsdatum,\n\t\t\t\tto_char(gmlas.untergangsdatum, 'DD.MM.YYYY') AS untergangsdatum,\n\t\t\t\tCASE WHEN vpa.planname IS NOT NULL OR vpa.rechtscharakter IS NOT NULL OR vpa.nummer IS NOT NULL OR vpa.verbundenerplan_href IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vpa.planname, vpa.rechtscharakter::xplan_gml.xp_rechtscharakterplanaenderung, vpa.nummer, vpa.verbundenerplan_href)]::xplan_gml.xp_verbundenerplan[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS aendert,\n\t\t\t\tCASE WHEN vpwgv.planname IS NOT NULL OR vpwgv.rechtscharakter IS NOT NULL OR vpwgv.nummer IS NOT NULL OR vpwgv.verbundenerplan_href IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vpwgv.planname, vpwgv.rechtscharakter::xplan_gml.xp_rechtscharakterplanaenderung, vpwgv.nummer, vpwgv.verbundenerplan_href)]::xplan_gml.xp_verbundenerplan[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS wurdegeaendertvon,\n\t\t\t\tgmlas.erstellungsmassstab AS erstellungsmassstab,\n\t\t\t\tgmlas.bezugshoehe AS bezugshoehe,\n\t\t\t\tst_assvg(st_transform(ST_ForceRHR(gmlas.raeumlichergeltungsbereich),\". $this->epsg .\"), 0, 8) AS newpath,\n\t\t\t\tst_astext(st_transform(ST_ForceRHR(gmlas.raeumlichergeltungsbereich),\". $this->epsg .\")) AS newpathwkt,\n\t\t\t\tCASE WHEN vm.xp_verfahrensmerkmal_vermerk IS NOT NULL OR vm.xp_verfahrensmerkmal_datum IS NOT NULL OR vm.xp_verfahrensmerkmal_signatur IS NOT NULL OR vm.xp_verfahrensmerkmal_signiert IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vm.xp_verfahrensmerkmal_vermerk, vm.xp_verfahrensmerkmal_datum, vm.xp_verfahrensmerkmal_signatur, vm.xp_verfahrensmerkmal_signiert)]::xplan_gml.xp_verfahrensmerkmal[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS verfahrensmerkmale,\n\t\t\t\tCASE\n\t\t\t\t\tWHEN count_externeref > 0\n\t\t\t\t\tTHEN array_to_json(externeref.externereferenz)\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS externereferenz,\n\t\t\t\tto_char(gmlas.veraenderungssperredatum, 'DD.MM.YYYY') AS veraenderungssperredatum,\n\t\t\t\tarray_to_json(ARRAY[(g.ags,g.rs,g.gemeindename,g.ortsteilname)]::xplan_gml.xp_gemeinde[]) AS gemeinde,\n\t\t\t\tgmlas.verfahren::xplan_gml.bp_verfahren AS verfahren,\n\t\t\t\tto_char(gmlas.inkrafttretensdatum, 'DD.MM.YYYY') AS inkrafttretensdatum,\n\t\t\t\tgmlas.durchfuehrungsvertrag AS durchfuehrungsvertrag,\n\t\t\t\tgmlas.staedtebaulichervertrag AS staedtebaulichervertrag,\n\t\t\t\tgmlas.rechtsverordnungsdatum AS rechtsverordnungsdatum,\n\t\t\t\tgmlas.rechtsstand::xplan_gml.bp_rechtsstand AS rechtsstand,\n\t\t\t\tgmlas.hoehenbezug AS hoehenbezug,\n\t\t\t\tto_char(gmlas.aufstellungsbeschlussdatum, 'DD.MM.YYYY') AS aufstellungsbeschlussdatum,\n\t\t\t\tto_char(gmlas.ausfertigungsdatum, 'DD.MM.YYYY') AS ausfertigungsdatum,\n\t\t\t\tto_char(gmlas.satzungsbeschlussdatum, 'DD.MM.YYYY') AS satzungsbeschlussdatum,\n\t\t\t\tgmlas.veraenderungssperre AS veraenderungssperre,\n\t\t\t\tarray_to_json(ARRAY[to_char(aled.value, 'DD.MM.YYYY')]::date[]) AS auslegungsenddatum,\n\t\t\t\t(gmlas.sonstplanart_codespace, gmlas.sonstplanart, NULL)::xplan_gml.bp_sonstplanart AS sonstplanart,\n\t\t\t\tgmlas.gruenordnungsplan AS gruenordnungsplan,\n\t\t\t\tto_json((pg.name, pg.kennziffer)::xplan_gml.xp_plangeber) AS plangeber,\n\t\t\t\tarray_to_json(ARRAY[to_char(alsd.value, 'DD.MM.YYYY')]::date[]) AS auslegungsstartdatum,\n\t\t\t\tarray_to_json(ARRAY[to_char(tbsd.value, 'DD.MM.YYYY')]::date[]) AS traegerbeteiligungsstartdatum,\n\t\t\t\tto_char(gmlas.aenderungenbisdatum, 'DD.MM.YYYY') AS aenderungenbisdatum,\n\t\t\t\tto_json((gmlas.status_codespace, gmlas.status, NULL)::xplan_gml.bp_status) AS status,\n\t\t\t\tarray_to_json(ARRAY[to_char(tbed.value, 'DD.MM.YYYY')]::date[]) AS traegerbeteiligungsenddatum,\n\t\t\t\tarray_to_json(gmlas.planart) AS planart,\n\t\t\t\tgmlas.erschliessungsvertrag AS erschliessungsvertrag\n\t\t\tFROM\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan gmlas LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_gemeinde gemeindelink ON gmlas.id = gemeindelink.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_gemeinde g ON gemeindelink.xp_gemeinde_pkid = g.ogr_pkid LEFT JOIN\n\t\t\t\t(\n\t\t\t\t\tSElECT\n\t\t\t\t\t\tCOUNT(*) AS count_externeref,\n\t\t\t\t\t\texternereferenzlink_sub.parent_id,\n\t\t\t\t\t\tarray_agg((e_sub.georefurl,\n\t\t\t\t\t\t\t\t(e_sub.georefmimetype_codespace, e_sub.georefmimetype, NULL)::xplan_gml.xp_mimetypes,\n\t\t\t\t\t\t\t\te_sub.art::xplan_gml.xp_externereferenzart,\n\t\t\t\t\t\t\t\te_sub.informationssystemurl,\n\t\t\t\t\t\t\t\te_sub.referenzname,\n\t\t\t\t\t\t\t\te_sub.referenzurl,\n\t\t\t\t\t\t\t\t(e_sub.referenzmimetype_codespace, e_sub.referenzmimetype, NULL)::xplan_gml.xp_mimetypes,\n\t\t\t\t\t\t\t\te_sub.beschreibung,\n\t\t\t\t\t\t\t\tto_char(e_sub.datum, 'DD.MM.YYYY'),\n\t\t\t\t\t\t\t\te_sub.typ::xplan_gml.xp_externereferenztyp\n\t\t\t\t\t\t\t)::xplan_gml.xp_spezexternereferenz) AS externereferenz\n\t\t\t\t\tFROM\n\t\t\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_externereferenz externereferenzlink_sub LEFT JOIN\n\t\t\t\t\t\t\" . $this->gmlas_schema . \".xp_spezexternereferenz e_sub ON externereferenzlink_sub.xp_spezexternereferenz_pkid = e_sub.ogr_pkid\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\texternereferenzlink_sub.parent_id\n\t\t\t\t) externeref ON gmlas.id = externeref.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_aendert_aendert aendertlink ON gmlas.id = aendertlink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".aendert aendertlinktwo ON aendertlink.child_pkid = aendertlinktwo.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_verbundenerplan vpa ON aendertlinktwo.xp_verbundenerplan_pkid = vpa.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_wurdegeaendertvon_wurdegeaendertvon wurdegeaendertvonlink ON gmlas.id = wurdegeaendertvonlink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".wurdegeaendertvon wurdegeaendertvonlinktwo ON wurdegeaendertvonlink.child_pkid = wurdegeaendertvonlinktwo.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_verbundenerplan vpwgv ON wurdegeaendertvonlinktwo.xp_verbundenerplan_pkid = vpwgv.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_verfahrensmerkmale_verfahrensmerkmale verfahrensmerkmalelink ON gmlas.id = verfahrensmerkmalelink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".verfahrensmerkmale vm ON verfahrensmerkmalelink.child_pkid = vm.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_plangeber pg ON gmlas.plangeber_xp_plangeber_pkid = pg.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_auslegungsstartdatum alsd ON gmlas.id = alsd.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_auslegungsenddatum aled ON gmlas.id = aled.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_traegerbeteiligungsstartdatum tbsd ON gmlas.id = tbsd.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".bp_plan_traegerbeteiligungsenddatum tbed ON gmlas.id = tbed.parent_id\n\t\t\tWHERE\n\t\t\t\tgmlas.id ='\" . $gml_id . \"'\n\t\t\t;\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$result = pg_fetch_assoc($ret[1]);\n\t\treturn $result;\n\t}",
"public function create_or_update_plan( $plan_data ) {\n\t\t$item_id = $plan_data['id'];\n\t\t$all_items = MS_Factory::get_transient( 'ms_stripecheckout_plans' );\n\t\t$all_items = mslib3()->array->get( $all_items );\n\n\t\tif ( ! isset( $all_items[ $item_id ] )\n\t\t || ! is_a( $all_items[ $item_id ], 'StripeCheckoutPlan' )\n\t\t) {\n\t\t\ttry {\n\t\t\t\t$item = StripeCheckoutPlan::retrieve( $item_id );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// If the plan does not exist then stripe will throw an Exception.\n\t\t\t\t$item = false;\n\t\t\t}\n\t\t\t$all_items[ $item_id ] = $item;\n\t\t} else {\n\t\t\t$item = $all_items[ $item_id ];\n\t\t}\n\n\t\t/*\n\t\t * Stripe can only update the plan-name, so we have to delete and\n\t\t * recreate the plan manually.\n\t\t */\n\t\tif ( $item && is_a( $item, 'StripeCheckoutPlan' ) ) {\n\t\t\t$item->delete();\n\t\t\t$all_items[ $item_id ] = false;\n\t\t}\n\n\t\tif ( $plan_data['amount'] > 0 ) {\n\t\t\ttry {\n\t\t\t\t$item = StripeCheckoutPlan::create( $plan_data );\n\t\t\t\t$all_items[ $item_id ] = $item;\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// Nothing.\n\t\t\t}\n\t\t}\n\n\t\tMS_Factory::set_transient(\n\t\t\t'ms_stripecheckout_plans',\n\t\t\t$all_items,\n\t\t\tHOUR_IN_SECONDS\n\t\t);\n\t}",
"public function edit(Plan $plan) {\n \n }",
"private function createPlan(){\n if(!$this->request->plan_name || !$this->request->plan_description) {\n return false;\n }\n $this->plan = Planes::create([\n 'name' => $this->request->plan_name,\n 'description' => $this->request->plan_description,\n 'price' => $this->request->price,\n 'product_id' => $this->request->product_id,\n 'balance' => $this->request->balance,\n ]);\n $this->plan = new PlanesFormatter($this->plan);\n }",
"public function actionSetup($plan)\n {\n // Redirect back to billing page if already has a plan active\n $isBillingActive = Yii::$app->user->identity->getBillingDaysLeft();\n if($isBillingActive){\n return $this->redirect(['billing/index']);\n }\n\n // Find the Pricing Option the user wants to setup\n $pricing = \\common\\models\\Pricing::findOne($plan);\n if(!$pricing){\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n // Check if is trial\n $isTrial = Yii::$app->user->identity->agent_trial_days > 0? true: false;\n\n // If user is attempting to setup a package which is for less than\n // the number of accounts he has attached, show error and redirect to billing\n $currentAccountCount = count(Yii::$app->ownedAccountManager->ownedAccounts);\n $planLimit = $pricing->pricing_account_quantity;\n if($planLimit < $currentAccountCount){\n Yii::$app->getSession()\n ->setFlash('warning', \"[Selected plan only allows $planLimit accounts. You have $currentAccountCount you administer. ] You may remove an account by clicking the <b>Remove</b> button on its right sidebar.\");\n\n return $this->redirect(['billing/index']);\n }\n\n // Calculate Discount if Available\n $discount = 0;\n if($isTrial){\n // Give 30% discount for trial users\n $discount = ($pricing->pricing_price - round($pricing->pricing_price * 0.7)) * -1;\n }\n\n // Setup new billing model\n $billingModel = new Billing();\n $billingModel->agent_id = Yii::$app->user->identity->agent_id;\n $billingModel->pricing_id = $pricing->pricing_id;\n $billingModel->billing_total = $pricing->pricing_price + $discount; // Store initial billed amount\n $billingModel->billing_email = Yii::$app->user->identity->agent_email;\n $billingModel->billing_name = Yii::$app->user->identity->agent_name;\n $billingModel->billing_currency = \"USD\";\n\n // Handle AJAX Validation\n if (Yii::$app->request->isAjax && $billingModel->load(Yii::$app->request->post())) {\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return \\yii\\widgets\\ActiveForm::validate($billingModel);\n }\n\n if($billingModel->load(Yii::$app->request->post())){\n // Token returned from 2CO after creditcard input\n $billingModel->twoco_token = Yii::$app->request->post('token');\n\n // If Token exists and record of bill is saved\n if($billingModel->twoco_token && $billingModel->save()){\n $token = Yii::$app->request->post('token');\n\n // Your sellerId(account number) and privateKey are required to make the Payment API Authorization call.\n Twocheckout::privateKey(Yii::$app->params['2co.privateKey']);\n Twocheckout::sellerId(Yii::$app->params['2co.sellerId']);\n // Your username and password are required to make any Admin API call.\n Twocheckout::username(Yii::$app->params['2co.username']);\n Twocheckout::password(Yii::$app->params['2co.password']);\n // If you want to turn off SSL verification (Please don't do this in your production environment)\n Twocheckout::verifySSL(Yii::$app->params['2co.verifySSL']); // this is set to true by default\n // To use your sandbox account set sandbox to true\n Twocheckout::sandbox(Yii::$app->params['2co.isSandbox']);\n\n\n // Use the token to create a sale\n try {\n $charge = Twocheckout_Charge::auth([\n \"merchantOrderId\" => $billingModel->billing_id,\n \"token\" => $token,\n \"currency\" => $billingModel->billing_currency,\n \"billingAddr\" => [\n // Card holder’s name. (128 characters max)\n \"name\" => $billingModel->billing_name,\n // Card holder’s street address. (64 characters max) Required\n \"addrLine1\" => $billingModel->billing_address_line1,\n // Card holder’s street address line 2. (64 characters max)\n // Required if “country” value is: CHN, JPN, RUS - Optional for all other “country” values.\n \"addrLine2\" => $billingModel->billing_address_line1? $billingModel->billing_address_line1:\"\",\n // Card holder’s city. (64 characters max) Required\n \"city\" => $billingModel->billing_city,\n /**\n * Card holder’s state. (64 characters max) Required if “country” value is ARG, AUS, BGR, CAN, CHN, CYP,\n * EGY, FRA, IND, IDN, ITA, JPN, MYS, MEX, NLD, PAN, PHL, POL, ROU, RUS, SRB, SGP, ZAF, ESP, SWE, THA, TUR,\n * GBR, USA - Optional for all other “country” values.\n */\n \"state\" => $billingModel->billing_state? $billingModel->billing_state:\"\",\n /**\n * Card holder’s zip. (16 characters max) Required if “country” value is ARG, AUS, BGR, CAN, CHN, CYP, EGY, FRA,\n * IND, IDN, ITA, JPN, MYS, MEX, NLD, PAN, PHL, POL, ROU, RUS, SRB, SGP, ZAF, ESP, SWE, THA, TUR, GBR,\n * USA - Optional for all other “country” values.\n */\n \"zipCode\" => $billingModel->billing_zip_code? $billingModel->billing_zip_code:\"\",\n // Card holder’s country. (64 characters max) Required\n \"country\" => $billingModel->country->country_iso_code_3,\n // Card holder’s email. (64 characters max) Required\n \"email\" => $billingModel->billing_email,\n // Card holder’s phone. (16 characters max) Optional\n // \"phoneNumber\" => '555-555-5555'\n ],\n \"lineItems\" => [\n [\n \"type\" => \"product\",\n \"name\" => \"Plugn \".$pricing->pricing_title.\" Plan\",\n \"price\" => $pricing->pricing_price,\n \"tangible\" => \"N\",\n \"productId\" => $pricing->pricing_id,\n \"recurrence\" => \"1 Month\",\n \"duration\" => \"Forever\",\n \"startupFee\" => $discount?$discount:\"\"\n ]\n ]\n ]);\n\n $billingModel->processTwoCheckoutSuccess($charge);\n return $this->redirect(['billing/index']);\n } catch (Twocheckout_Error $e) {\n $billingModel->processTwoCheckoutError($e);\n }\n }\n }\n\n // List of Zip / State Required Countries\n $zipStateCountries = \\common\\models\\Country::find()->select('country_id')\n ->where(['country_zipstate_required' => 1])->asArray()->all();\n\n // List of Addr Line 2 required countries\n $addrCountries = \\common\\models\\Country::find()->select('country_id')\n ->where(['country_addrline2_required' => 1])->asArray()->all();\n\n\n return $this->render('setup', [\n // Form\n 'model' => $billingModel,\n 'zipStateCountries' => json_encode($zipStateCountries),\n 'addrCountries' => json_encode($addrCountries),\n\n // Pricing\n 'pricing' => $pricing,\n 'isTrial' => $isTrial,\n\n // 2 CO\n 'processFormUrl' => Url::to(['billing/process']),\n 'environment' => Yii::$app->params['2co.environment'],\n 'sellerId' => Yii::$app->params['2co.sellerId'],\n 'publishableKey' => Yii::$app->params['2co.publishableKey'],\n ]);\n }",
"public function updating(Plan $plan)//troquei o update por updating\n {\n $plan->url = Str::kebab($plan->name);\n }",
"public function getPlanById(int $id){\n $this->open();\n\n $result = $this->query('SELECT * FROM '.$this->TABLE_NAME.' WHERE id=:id', array(\n new QueryParam(':id', $id, PDO::PARAM_INT)\n ));\n\n // Close connection\n $this->close();\n\n // Check if is found\n if($result->rowCount() > 0){\n\n // Check result\n while($row = $result->fetch(PDO::FETCH_OBJ)){\n $foundPlan = new Plan(\n $row->id,\n $row->name,\n $row->price,\n $row->detail,\n $row->docsUrl\n );\n\n return $foundPlan;\n }\n\n }\n else{\n // It isn't found so return false\n return false;\n }\n\n }",
"public function getPlan(): ?string\n {\n return $this->plan;\n }",
"public function __construct()\n {\n $this->plan = new Plan();\n }",
"private function stripePlan()\n {\n $all_plans = $this->stripeDBPlan->paginate(10);\n\n $plans = collect([]);\n\n try {\n foreach ($all_plans as $val) {\n if ($this->stripePlan->getStripePlan($val->plan_id)) {\n foreach ($this->stripeDBPlan->wherePlanId($val->plan_id)->get() as $plan) {\n $plans->push($plan);\n }\n }\n }\n } catch (ApiConnectionException $th) {\n $error_msg = $th->getMessage();\n } catch (AuthenticationException $th) {\n $error_msg = $th->getMessage();\n } catch (InvalidRequestException $th) {\n } catch (ApiErrorException $th) {\n $error_msg = $th->getError();\n }\n return view('subscription.stripePlans', [\n 'plans'=> $plans,\n ]);\n }",
"public function show(Plan $plan)\n {\n //\n return view('plan.show',['plan'=>$plan]);\n }",
"public function getPaymentPlan()\n {\n return $this->payment_plan;\n }",
"public function user_by_plan(Request $req, $id)\n {\n $this->check_account($req);\n\n // $param_insert = array(\n // 'name' => 'user_by_plan',\n // 'params' => json_encode(collect($req)->toArray()),\n // 'result' => ''\n // );\n\n // $access_log_id = $this->create_access_log($param_insert);\n\n $plan = new Plan;\n $plan = $plan->with('user', 'guide');\n $plan = $plan->where('user_id', $id);\n $plan = $plan->where('status', '!=', 'deleted');\n\n // search query\n if ($req->input('search_query')) {\n $search_query = $req->input('search_query') ? $req->input('search_query') : '';\n\n $plan = $plan->where('start_date', 'LIKE', '%'.$search_query.'%');\n }\n\n // where custom\n if ($req->input('where_by') && $req->input('where_value')) {\n $explode_by = explode('|', $req->input('where_by'));\n $explode_value = explode('|', $req->input('where_value'));\n\n if ((count($explode_by)==count($explode_value)) && ($this->check_where($explode_by, $this->fields_plans))) {\n foreach ($explode_by as $key => $value) {\n if ($explode_value[$key]=='except_active') {\n $plan = $plan->where($explode_by[$key], '!=', 'active');\n } else {\n $plan = $plan->where($explode_by[$key], '=', $explode_value[$key]);\n }\n }\n } else {\n $result = $this->generate_response($plan, 400, 'Bad Request.', true);\n\n // $this->update_access_log($access_log_id, $result);\n\n return response()->json($result, 400);\n }\n }\n\n if (!$req->input('order_by')) {\n $plan = $plan->orderBy(\"id\", \"desc\");\n }\n\n // order\n if ($req->input('order_by')) {\n if (in_array($req->input('order_by'), $this->fields_plans)) {\n $order_type = $req->input('order_type') ? $req->input('order_type') : 'asc';\n\n $plan = $plan->orderBy($req->input('order_by'), $order_type);\n } else {\n $result = $this->generate_response($plan, 400, 'Bad Request.', true);\n\n // $this->update_access_log($access_log_id, $result);\n\n return response()->json($result, 400);\n }\n }\n\n // limit\n if ($req->input('limit')) {\n $offset = $req->input('offset') ? $req->input('offset') : 0;\n\n $plan = $plan->offset($offset);\n $plan = $plan->limit($req->input('limit'));\n }\n\n $plan = $plan->get();\n\n $result = $this->generate_response($plan, 200, 'All Data.', false);\n\n // $this->update_access_log($access_log_id, $result);\n\n return response()->json($result, 200);\n }",
"function fill_form_rp_plan($gml_id) {\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\t\" . \n\t\t\t\t\"'\" . $this->trim_gml_prefix_if_exists($gml_id) . \"'::text::uuid AS plan_gml_id,\n\t\t\t\tgmlas.xplan_name AS name,\n\t\t\t\tgmlas.nummer AS nummer,\n\t\t\t\tgmlas.internalid AS internalid,\n\t\t\t\tgmlas.beschreibung AS beschreibung,\n\t\t\t\tgmlas.kommentar AS kommentar,\n\t\t\t\tto_char(gmlas.technherstelldatum, 'DD.MM.YYYY') AS technherstelldatum,\n\t\t\t\tto_char(gmlas.genehmigungsdatum, 'DD.MM.YYYY') AS genehmigungsdatum,\n\t\t\t\tto_char(gmlas.untergangsdatum, 'DD.MM.YYYY') AS untergangsdatum,\n\t\t\t\tCASE WHEN vpa.planname IS NOT NULL OR vpa.rechtscharakter IS NOT NULL OR vpa.nummer IS NOT NULL OR vpa.verbundenerplan_href IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vpa.planname, vpa.rechtscharakter::xplan_gml.xp_rechtscharakterplanaenderung, vpa.nummer, vpa.verbundenerplan_href)]::xplan_gml.xp_verbundenerplan[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS aendert,\n\t\t\t\tCASE WHEN vpwgv.planname IS NOT NULL OR vpwgv.rechtscharakter IS NOT NULL OR vpwgv.nummer IS NOT NULL OR vpwgv.verbundenerplan_href IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vpwgv.planname, vpwgv.rechtscharakter::xplan_gml.xp_rechtscharakterplanaenderung, vpwgv.nummer, vpwgv.verbundenerplan_href)]::xplan_gml.xp_verbundenerplan[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS wurdegeaendertvon,\n\t\t\t\tgmlas.erstellungsmassstab AS erstellungsmassstab,\n\t\t\t\tgmlas.bezugshoehe AS bezugshoehe,\n\t\t\t\tst_assvg(st_transform(gmlas.raeumlichergeltungsbereich,\". $this->epsg .\"), 0, 8) AS newpath,\n\t\t\t\tst_astext(st_transform(ST_ForceRHR(gmlas.raeumlichergeltungsbereich),\". $this->epsg .\")) AS newpathwkt,\n\t\t\t\tCASE WHEN vm.xp_verfahrensmerkmal_vermerk IS NOT NULL OR vm.xp_verfahrensmerkmal_datum IS NOT NULL OR vm.xp_verfahrensmerkmal_signatur IS NOT NULL OR vm.xp_verfahrensmerkmal_signiert IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vm.xp_verfahrensmerkmal_vermerk, vm.xp_verfahrensmerkmal_datum, vm.xp_verfahrensmerkmal_signatur, vm.xp_verfahrensmerkmal_signiert)]::xplan_gml.xp_verfahrensmerkmal[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS verfahrensmerkmale,\n\t\t\t\tCASE\n\t\t\t\t\tWHEN count_externeref > 0\n\t\t\t\t\tTHEN array_to_json(externeref.externereferenz)\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS externereferenz,\n\t\t\t\tgmlas.planungsregion AS planungsregion,\n\t\t\t\tgmlas.teilabschnitt AS teilabschnitt,\n\t\t\t\tgmlas.amtlicherschluessel AS amtlicherschluessel,\n\t\t\t\tgmlas.verfahren::xplan_gml.rp_verfahren AS verfahren,\n\t\t\t\tgmlas.rechtsstand::xplan_gml.rp_rechtsstand AS rechtsstand,\n\t\t\t\tto_char(gmlas.datumdesinkrafttretens, 'DD.MM.YYYY') AS datumdesinkrafttretens,\n\t\t\t\tto_char(gmlas.planbeschlussdatum, 'DD.MM.YYYY') AS planbeschlussdatum,\n\t\t\t\tto_char(gmlas.aufstellungsbeschlussdatum, 'DD.MM.YYYY') AS aufstellungsbeschlussdatum,\n\t\t\t\tto_char(gmlas.entwurfsbeschlussdatum, 'DD.MM.YYYY') AS entwurfsbeschlussdatum,\n\t\t\t\tarray_to_json(ARRAY[to_char(aled.value, 'DD.MM.YYYY')]::date[]) AS auslegungsenddatum,\n\t\t\t\t(gmlas.sonstplanart_codespace, gmlas.sonstplanart)::xplan_gml.rp_sonstplanart AS sonstplanart,\n\t\t\t\tarray_to_json(ARRAY[to_char(alsd.value, 'DD.MM.YYYY')]::date[]) AS auslegungsstartdatum,\n\t\t\t\tarray_to_json(ARRAY[to_char(tbsd.value, 'DD.MM.YYYY')]::date[]) AS traegerbeteiligungsstartdatum,\n\t\t\t\tto_char(gmlas.aenderungenbisdatum, 'DD.MM.YYYY') AS aenderungenbisdatum,\n\t\t\t\tto_json((gmlas.status_codespace, gmlas.status)::xplan_gml.rp_status) AS status,\n\t\t\t\tarray_to_json(ARRAY[to_char(tbed.value, 'DD.MM.YYYY')]::date[]) AS traegerbeteiligungsenddatum,\n\t\t\t\tgmlas.planart::xplan_gml.rp_art AS planart\n\t\t\tFROM\n\t\t\t\t\" . $this->gmlas_schema . \".rp_plan gmlas LEFT JOIN\n\t\t\t\t(\n\t\t\t\t\tSElECT\n\t\t\t\t\t\tCOUNT(*) AS count_externeref,\n\t\t\t\t\t\texternereferenzlink_sub.parent_id,\n\t\t\t\t\t\tarray_agg((e_sub.georefurl,\n\t\t\t\t\t\t\t\t(e_sub.georefmimetype_codespace, e_sub.georefmimetype, NULL)::xplan_gml.xp_mimetypes,\n\t\t\t\t\t\t\t\te_sub.art::xplan_gml.xp_externereferenzart,\n\t\t\t\t\t\t\t\te_sub.informationssystemurl,\n\t\t\t\t\t\t\t\te_sub.referenzname,\n\t\t\t\t\t\t\t\te_sub.referenzurl,\n\t\t\t\t\t\t\t\t(e_sub.referenzmimetype_codespace, e_sub.referenzmimetype, NULL)::xplan_gml.xp_mimetypes,\n\t\t\t\t\t\t\t\te_sub.beschreibung,\n\t\t\t\t\t\t\t\tto_char(e_sub.datum, 'DD.MM.YYYY'),\n\t\t\t\t\t\t\t\te_sub.typ::xplan_gml.xp_externereferenztyp\n\t\t\t\t\t\t\t)::xplan_gml.xp_spezexternereferenz) AS externereferenz\n\t\t\t\t\tFROM\n\t\t\t\t\t\t\" . $this->gmlas_schema . \".rp_plan_externereferenz externereferenzlink_sub LEFT JOIN\n\t\t\t\t\t\t\" . $this->gmlas_schema . \".xp_spezexternereferenz e_sub ON externereferenzlink_sub.xp_spezexternereferenz_pkid = e_sub.ogr_pkid\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\texternereferenzlink_sub.parent_id\n\t\t\t\t) externeref ON gmlas.id = externeref.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".rp_plan_aendert_aendert aendertlink ON gmlas.id = aendertlink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".aendert aendertlinktwo ON aendertlink.child_pkid = aendertlinktwo.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_verbundenerplan vpa ON aendertlinktwo.xp_verbundenerplan_pkid = vpa.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".rp_plan_wurdegeaendertvon_wurdegeaendertvon wurdegeaendertvonlink ON gmlas.id = wurdegeaendertvonlink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".wurdegeaendertvon wurdegeaendertvonlinktwo ON wurdegeaendertvonlink.child_pkid = wurdegeaendertvonlinktwo.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_verbundenerplan vpwgv ON wurdegeaendertvonlinktwo.xp_verbundenerplan_pkid = vpwgv.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".rp_plan_verfahrensmerkmale_verfahrensmerkmale verfahrensmerkmalelink ON gmlas.id = verfahrensmerkmalelink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".verfahrensmerkmale vm ON verfahrensmerkmalelink.child_pkid = vm.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".rp_plan_auslegungsstartdatum alsd ON gmlas.id = alsd.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".rp_plan_auslegungsenddatum aled ON gmlas.id = aled.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".rp_plan_traegerbeteiligungsstartdatum tbsd ON gmlas.id = tbsd.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".rp_plan_traegerbeteiligungsenddatum tbed ON gmlas.id = tbed.parent_id\n\t\t\tWHERE\n\t\t\t\tgmlas.id = '\" . $gml_id . \"'\n\t\t\t;\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$result = pg_fetch_assoc($ret[1]);\n\t\treturn $result;\n\t}",
"function fill_form_so_plan($gml_id) {\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\t\" . \n\t\t\t\t\"'\" . $this->trim_gml_prefix_if_exists($gml_id) . \"'::text::uuid AS plan_gml_id,\n\t\t\t\tgmlas.xplan_name AS name,\n\t\t\t\tgmlas.nummer AS nummer,\n\t\t\t\tgmlas.internalid AS internalid,\n\t\t\t\tgmlas.beschreibung AS beschreibung,\n\t\t\t\tgmlas.kommentar AS kommentar,\n\t\t\t\tto_char(gmlas.technherstelldatum, 'DD.MM.YYYY') AS technherstelldatum,\n\t\t\t\tto_char(gmlas.genehmigungsdatum, 'DD.MM.YYYY') AS genehmigungsdatum,\n\t\t\t\tto_char(gmlas.untergangsdatum, 'DD.MM.YYYY') AS untergangsdatum,\n\t\t\t\tCASE WHEN vpa.planname IS NOT NULL OR vpa.rechtscharakter IS NOT NULL OR vpa.nummer IS NOT NULL OR vpa.verbundenerplan_href IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vpa.planname, vpa.rechtscharakter::xplan_gml.xp_rechtscharakterplanaenderung, vpa.nummer, vpa.verbundenerplan_href)]::xplan_gml.xp_verbundenerplan[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS aendert,\n\t\t\t\tCASE WHEN vpwgv.planname IS NOT NULL OR vpwgv.rechtscharakter IS NOT NULL OR vpwgv.nummer IS NOT NULL OR vpwgv.verbundenerplan_href IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vpwgv.planname, vpwgv.rechtscharakter::xplan_gml.xp_rechtscharakterplanaenderung, vpwgv.nummer, vpwgv.verbundenerplan_href)]::xplan_gml.xp_verbundenerplan[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS wurdegeaendertvon,\n\t\t\t\tgmlas.erstellungsmassstab AS erstellungsmassstab,\n\t\t\t\tgmlas.bezugshoehe AS bezugshoehe,\n\t\t\t\tst_assvg(st_transform(gmlas.raeumlichergeltungsbereich,\". $this->epsg .\"), 0, 8) AS newpath,\n\t\t\t\tst_astext(st_transform(ST_ForceRHR(gmlas.raeumlichergeltungsbereich),\". $this->epsg .\")) AS newpathwkt,\n\t\t\t\tCASE WHEN vm.xp_verfahrensmerkmal_vermerk IS NOT NULL OR vm.xp_verfahrensmerkmal_datum IS NOT NULL OR vm.xp_verfahrensmerkmal_signatur IS NOT NULL OR vm.xp_verfahrensmerkmal_signiert IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vm.xp_verfahrensmerkmal_vermerk, vm.xp_verfahrensmerkmal_datum, vm.xp_verfahrensmerkmal_signatur, vm.xp_verfahrensmerkmal_signiert)]::xplan_gml.xp_verfahrensmerkmal[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS verfahrensmerkmale,\n\t\t\t\tCASE\n\t\t\t\t\tWHEN count_externeref > 0\n\t\t\t\t\tTHEN array_to_json(externeref.externereferenz)\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS externereferenz,\n\t\t\t\tto_json((pg.name, pg.kennziffer)::xplan_gml.xp_plangeber) AS plangeber,\n\t\t\t\tto_json((gmlas.planart_codespace, gmlas.planart, NULL)::xplan_gml.so_planart) AS planart\n\t\t\t\t/*ARRAY[(g.ags,g.rs,g.gemeindename,g.ortsteilname)]::xplan_gml.xp_gemeinde[] AS gemeinde*/\n\t\t\tFROM\n\t\t\t\t\" . $this->gmlas_schema . \".so_plan gmlas LEFT JOIN\n\t\t\t\t/*\" . $this->gmlas_schema . \".so_plan_gemeinde gemeindelink ON gmlas.id = gemeindelink.parent_id LEFT JOIN*/\n\t\t\t\t/*\" . $this->gmlas_schema . \".xp_gemeinde g ON gemeindelink.xp_gemeinde_pkid = g.ogr_pkid LEFT JOIN*/\n\t\t\t\t(\n\t\t\t\t\tSElECT\n\t\t\t\t\t\tCOUNT(*) AS count_externeref,\n\t\t\t\t\t\texternereferenzlink_sub.parent_id,\n\t\t\t\t\t\tarray_agg((e_sub.georefurl,\n\t\t\t\t\t\t\t\t(e_sub.georefmimetype_codespace, e_sub.georefmimetype, NULL)::xplan_gml.xp_mimetypes,\n\t\t\t\t\t\t\t\te_sub.art::xplan_gml.xp_externereferenzart,\n\t\t\t\t\t\t\t\te_sub.informationssystemurl,\n\t\t\t\t\t\t\t\te_sub.referenzname,\n\t\t\t\t\t\t\t\te_sub.referenzurl,\n\t\t\t\t\t\t\t\t(e_sub.referenzmimetype_codespace, e_sub.referenzmimetype, NULL)::xplan_gml.xp_mimetypes,\n\t\t\t\t\t\t\t\te_sub.beschreibung,\n\t\t\t\t\t\t\t\tto_char(e_sub.datum, 'DD.MM.YYYY'),\n\t\t\t\t\t\t\t\te_sub.typ::xplan_gml.xp_externereferenztyp\n\t\t\t\t\t\t\t)::xplan_gml.xp_spezexternereferenz) AS externereferenz\n\t\t\t\t\tFROM\n\t\t\t\t\t\t\" . $this->gmlas_schema . \".so_plan_externereferenz externereferenzlink_sub LEFT JOIN\n\t\t\t\t\t\t\" . $this->gmlas_schema . \".xp_spezexternereferenz e_sub ON externereferenzlink_sub.xp_spezexternereferenz_pkid = e_sub.ogr_pkid\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\texternereferenzlink_sub.parent_id\n\t\t\t\t) externeref ON gmlas.id = externeref.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_plangeber pg ON gmlas.plangeber_xp_plangeber_pkid = pg.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".so_plan_aendert_aendert aendertlink ON gmlas.id = aendertlink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".aendert aendertlinktwo ON aendertlink.child_pkid = aendertlinktwo.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_verbundenerplan vpa ON aendertlinktwo.xp_verbundenerplan_pkid = vpa.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".so_plan_wurdegeaendertvon_wurdegeaendertvon wurdegeaendertvonlink ON gmlas.id = wurdegeaendertvonlink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".wurdegeaendertvon wurdegeaendertvonlinktwo ON wurdegeaendertvonlink.child_pkid = wurdegeaendertvonlinktwo.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_verbundenerplan vpwgv ON wurdegeaendertvonlinktwo.xp_verbundenerplan_pkid = vpwgv.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".so_plan_verfahrensmerkmale_verfahrensmerkmale verfahrensmerkmalelink ON gmlas.id = verfahrensmerkmalelink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".verfahrensmerkmale vm ON verfahrensmerkmalelink.child_pkid = vm.ogr_pkid\n\t\t\tWHERE\n\t\t\t\tgmlas.id ='\" . $gml_id . \"'\n\t\t\t;\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$result = pg_fetch_assoc($ret[1]);\n\t\treturn $result;\n\t}",
"function fill_form_fp_plan($gml_id) {\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\t\" . \n\t\t\t\t\"'\" . $this->trim_gml_prefix_if_exists($gml_id) . \"'::text::uuid AS plan_gml_id,\n\t\t\t\tgmlas.xplan_name AS name,\n\t\t\t\tgmlas.nummer AS nummer,\n\t\t\t\tgmlas.internalid AS internalid,\n\t\t\t\tgmlas.beschreibung AS beschreibung,\n\t\t\t\tgmlas.kommentar AS kommentar,\n\t\t\t\tto_char(gmlas.technherstelldatum, 'DD.MM.YYYY') AS technherstelldatum,\n\t\t\t\tto_char(gmlas.genehmigungsdatum, 'DD.MM.YYYY') AS genehmigungsdatum,\n\t\t\t\tto_char(gmlas.untergangsdatum, 'DD.MM.YYYY') AS untergangsdatum,\n\t\t\t\tCASE WHEN vpa.planname IS NOT NULL OR vpa.rechtscharakter IS NOT NULL OR vpa.nummer IS NOT NULL OR vpa.verbundenerplan_href IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vpa.planname, vpa.rechtscharakter::xplan_gml.xp_rechtscharakterplanaenderung, vpa.nummer, vpa.verbundenerplan_href)]::xplan_gml.xp_verbundenerplan[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS aendert,\n\t\t\t\tCASE WHEN vpwgv.planname IS NOT NULL OR vpwgv.rechtscharakter IS NOT NULL OR vpwgv.nummer IS NOT NULL OR vpwgv.verbundenerplan_href IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vpwgv.planname, vpwgv.rechtscharakter::xplan_gml.xp_rechtscharakterplanaenderung, vpwgv.nummer, vpwgv.verbundenerplan_href)]::xplan_gml.xp_verbundenerplan[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS wurdegeaendertvon,\n\t\t\t\tgmlas.erstellungsmassstab AS erstellungsmassstab,\n\t\t\t\tgmlas.bezugshoehe AS bezugshoehe,\n\t\t\t\tst_assvg(st_transform(gmlas.raeumlichergeltungsbereich,\". $this->epsg .\"), 0, 8) AS newpath,\n\t\t\t\tst_astext(st_transform(ST_ForceRHR(gmlas.raeumlichergeltungsbereich),\". $this->epsg .\")) AS newpathwkt,\n\t\t\t\tCASE WHEN vm.xp_verfahrensmerkmal_vermerk IS NOT NULL OR vm.xp_verfahrensmerkmal_datum IS NOT NULL OR vm.xp_verfahrensmerkmal_signatur IS NOT NULL OR vm.xp_verfahrensmerkmal_signiert IS NOT NULL THEN\n\t\t\t\t\tarray_to_json(ARRAY[(vm.xp_verfahrensmerkmal_vermerk, vm.xp_verfahrensmerkmal_datum, vm.xp_verfahrensmerkmal_signatur, vm.xp_verfahrensmerkmal_signiert)]::xplan_gml.xp_verfahrensmerkmal[])\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS verfahrensmerkmale,\n\t\t\t\tCASE\n\t\t\t\t\tWHEN count_externeref > 0\n\t\t\t\t\tTHEN array_to_json(externeref.externereferenz)\n\t\t\t\t\tELSE NULL\n\t\t\t\tEND AS externereferenz,\n\t\t\t\tarray_to_json(ARRAY[to_char(aled.value, 'DD.MM.YYYY')]::date[]) AS auslegungsenddatum,\n\t\t\t\tarray_to_json(ARRAY[(g.ags,g.rs,g.gemeindename,g.ortsteilname)]::xplan_gml.xp_gemeinde[]) AS gemeinde,\n\t\t\t\tto_json((gmlas.status_codespace, gmlas.status, NULL)::xplan_gml.fp_status) AS status,\n\t\t\t\tgmlas.sachgebiet AS sachgebiet,\n\t\t\t\tto_json((pg.name, pg.kennziffer)::xplan_gml.xp_plangeber) AS plangeber,\n\t\t\t\tgmlas.rechtsstand::xplan_gml.fp_rechtsstand AS rechtsstand,\n\t\t\t\tto_char(gmlas.wirksamkeitsdatum, 'DD.MM.YYYY') AS wirksamkeitsdatum,\n\t\t\t\tarray_to_json(ARRAY[to_char(alsd.value, 'DD.MM.YYYY')]::date[]) AS auslegungsstartdatum,\n\t\t\t\tarray_to_json(ARRAY[to_char(tbsd.value, 'DD.MM.YYYY')]::date[]) AS traegerbeteiligungsstartdatum,\n\t\t\t\tto_char(gmlas.entwurfsbeschlussdatum, 'DD.MM.YYYY') AS entwurfsbeschlussdatum,\n\t\t\t\tto_char(gmlas.aenderungenbisdatum, 'DD.MM.YYYY') AS aenderungenbisdatum,\n\t\t\t\tarray_to_json(ARRAY[to_char(tbed.value, 'DD.MM.YYYY')]::date[]) AS traegerbeteiligungsenddatum,\n\t\t\t\tgmlas.verfahren::xplan_gml.fp_verfahren AS verfahren,\n\t\t\t\t(gmlas.sonstplanart_codespace, gmlas.sonstplanart, NULL)::xplan_gml.fp_sonstplanart AS sonstplanart,\n\t\t\t\tgmlas.planart::xplan_gml.fp_planart AS planart,\n\t\t\t\tto_char(gmlas.planbeschlussdatum, 'DD.MM.YYYY') AS planbeschlussdatum,\n\t\t\t\tto_char(gmlas.aufstellungsbeschlussdatum, 'DD.MM.YYYY') AS aufstellungsbeschlussdatum\n\t\t\tFROM\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan gmlas LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_gemeinde gemeindelink ON gmlas.id = gemeindelink.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_gemeinde g ON gemeindelink.xp_gemeinde_pkid = g.ogr_pkid LEFT JOIN\n\t\t\t\t(\n\t\t\t\t\tSElECT\n\t\t\t\t\t\tCOUNT(*) AS count_externeref,\n\t\t\t\t\t\texternereferenzlink_sub.parent_id,\n\t\t\t\t\t\tarray_agg((e_sub.georefurl,\n\t\t\t\t\t\t\t\t(e_sub.georefmimetype_codespace, e_sub.georefmimetype, NULL)::xplan_gml.xp_mimetypes,\n\t\t\t\t\t\t\t\te_sub.art::xplan_gml.xp_externereferenzart,\n\t\t\t\t\t\t\t\te_sub.informationssystemurl,\n\t\t\t\t\t\t\t\te_sub.referenzname,\n\t\t\t\t\t\t\t\te_sub.referenzurl,\n\t\t\t\t\t\t\t\t(e_sub.referenzmimetype_codespace, e_sub.referenzmimetype, NULL)::xplan_gml.xp_mimetypes,\n\t\t\t\t\t\t\t\te_sub.beschreibung,\n\t\t\t\t\t\t\t\tto_char(e_sub.datum, 'DD.MM.YYYY'),\n\t\t\t\t\t\t\t\te_sub.typ::xplan_gml.xp_externereferenztyp\n\t\t\t\t\t\t\t)::xplan_gml.xp_spezexternereferenz) AS externereferenz\n\t\t\t\t\tFROM\n\t\t\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_externereferenz externereferenzlink_sub LEFT JOIN\n\t\t\t\t\t\t\" . $this->gmlas_schema . \".xp_spezexternereferenz e_sub ON externereferenzlink_sub.xp_spezexternereferenz_pkid = e_sub.ogr_pkid\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\texternereferenzlink_sub.parent_id\n\t\t\t\t) externeref ON gmlas.id = externeref.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_aendert_aendert aendertlink ON gmlas.id = aendertlink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".aendert aendertlinktwo ON aendertlink.child_pkid = aendertlinktwo.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_verbundenerplan vpa ON aendertlinktwo.xp_verbundenerplan_pkid = vpa.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_wurdegeaendertvon_wurdegeaendertvon wurdegeaendertvonlink ON gmlas.id = wurdegeaendertvonlink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".wurdegeaendertvon wurdegeaendertvonlinktwo ON wurdegeaendertvonlink.child_pkid = wurdegeaendertvonlinktwo.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_verbundenerplan vpwgv ON wurdegeaendertvonlinktwo.xp_verbundenerplan_pkid = vpwgv.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_verfahrensmerkmale_verfahrensmerkmale verfahrensmerkmalelink ON gmlas.id = verfahrensmerkmalelink.parent_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".verfahrensmerkmale vm ON verfahrensmerkmalelink.child_pkid = vm.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".xp_plangeber pg ON gmlas.plangeber_xp_plangeber_pkid = pg.ogr_pkid LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_auslegungsstartdatum alsd ON gmlas.id = alsd.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_auslegungsenddatum aled ON gmlas.id = aled.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_traegerbeteiligungsstartdatum tbsd ON gmlas.id = tbsd.parent_id LEFT JOIN\n\t\t\t\t\" . $this->gmlas_schema . \".fp_plan_traegerbeteiligungsenddatum tbed ON gmlas.id = tbed.parent_id\n\t\t\tWHERE\n\t\t\t\tgmlas.id ='\" . $gml_id . \"'\n\t\t\t;\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$result = pg_fetch_assoc($ret[1]);\n\t\treturn $result;\n\t}",
"function addPlanId($id, $planid) // user_cancel_subscription.php, user_charge_subscription.php\r\n\r\n{\r\n\r\n\tglobal $mysqli,$db_table_prefix;\r\n\r\n\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"users\r\n\r\n\t\tSET\r\n\r\n\t\tplan_id = ?\r\n\r\n\t\tWHERE\r\n\r\n\t\tid = ?\");\r\n\r\n\t$stmt->bind_param(\"si\", $planid, $id);\r\n\r\n\t$result = $stmt->execute();\r\n\r\n\t$stmt->close();\r\n\r\n\treturn $result;\r\n\r\n}",
"function TestCase_unlink_plan($case_id, $plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.unlink_plan', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function show($id)\n {\n $plan = Plan::find($id);\n return view('admin.plans.show', compact('plan'));\n }",
"function wp_stripe_find_or_create_plan($amount, $interval) {\n \n /*\n * Currency - All amounts must be denominated in USD when creating charges with Stripe — the currency conversion happens automatically\n */\n $currency = 'usd';\n\n $plan = null;\n\n // Construct desired plan\n $requested_plan = array(\n 'amount' => $amount,\n 'interval' => $interval,\n 'name' => '$' . $amount/100 . '/' . $interval,\n 'currency' => $currency,\n 'id' => $amount . $interval[0] . '_wp'\n );\n\n $existing_plans = Stripe_Plan::all();\n\n // Loop through plans, looking for one that matches our desired plan\n foreach( $existing_plans->data as $existing_plan ) {\n if ( $existing_plan->amount == $requested_plan['amount'] && $existing_plan->interval == $requested_plan['interval'] ) {\n $plan = $existing_plan;\n break;\n }\n }\n\n // Create a new plan if we didn't find one that matched\n if ( !$plan ) {\n $plan = Stripe_Plan::create($requested_plan);\n }\n \n return $plan;\n}",
"public function getProviderPlanAttribute()\n {\n return $this->stripe_plan;\n }",
"public function create( Request $request, Plan $plan)\n {\n $plan = Plan::findOrFail($request->get('plan'));\n \n $request->user()\n ->newSubscription('main', $plan->stripe_plan)\n ->create($request->stripeToken);\n \n return redirect()->route('home')->with('success', 'Your plan subscribed successfully');\n }",
"public function GetPlanDetails($planID) {\n\t\t$planID = mysqli_real_escape_string($this->db, $planID);\n\t\tif ($this->CheckPlanExist($planID) == '1') {\n\t\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_premium_plans WHERE plan_id = '$planID'\") or die(mysqli_error($this->db));\n\t\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\t\treturn $data;\n\t\t} else {return false;}\n\t}",
"public function currentPlan(): string\n {\n if ($this->user->subscribedToPlan($this->owlbearPlans(), 'kanka')) {\n return Patreon::PLEDGE_OWLBEAR;\n }\n if ($this->user->subscribedToPlan($this->elementalPlans(), 'kanka')) {\n return Patreon::PLEDGE_ELEMENTAL;\n }\n\n // Free user?\n return Patreon::PLEDGE_KOBOLD;\n }",
"public static function data_for_plan_page($planid) {\n global $PAGE;\n $params = self::validate_parameters(self::data_for_plan_page_parameters(), array(\n 'planid' => $planid\n ));\n $plan = api::read_plan($params['planid']);\n self::validate_context($plan->get_context());\n\n $renderable = new output\\plan_page($plan);\n $renderer = $PAGE->get_renderer('tool_lp');\n\n $data = $renderable->export_for_template($renderer);\n\n return $data;\n }",
"public function buy(string $id)\n {\n $plan = Plan::active()\n ->where('id', id_decode($id))\n ->firstOrFail(['id', 'price', 'months', 'type', 'status']);\n\n if ($plan->type == Plan::FREE) {\n auth()\n ->user()\n ->plans()\n ->attach($plan, ['ends_at' => now()->addMonths($plan->months)]);\n\n $type = trans('plans.type.' . $plan->getType());\n\n flash(trans('plans.ready', ['plan' => $type]))->success();\n\n return redirect()->route('home');\n }\n\n $types = IdentificationType::all(['id', 'type']);\n $currencies = Currency::all(['id', 'code']);\n\n return view('app.plans.buy', compact('plan', 'types', 'currencies'));\n }",
"public function plan()\n {\n return $this->belongsTo(PolicyPlan::class);\n }",
"public function add_to_plan(Request $request, $id)\n {\n $rules = [\n 'plan_id' => 'required|numeric',\n ];\n $attrs = [\n 'plan_id' => '出团计划id',\n ];\n $this->validate($request, $rules, [], $attrs);\n\n $obj = SaleOrder::find($id);\n $obj->fill($request->all());\n $obj->save();\n return redirect('/sale_order');\n \n }",
"abstract function has_paid_plan();",
"public function upgrade($plan_id, $pay = NULL ) {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Get plan price\n $price = $this->plans->get_plan_price($plan_id);\n \n if ($price[0]->plan_price > 0) {\n \n // Require the Payments interface\n require_once APPPATH . 'interfaces/Payments.php';\n \n // Verify if $pay is not null\n if ( $pay ) {\n \n $total_to_pay = $price[0]->plan_price;\n \n // Get discount if exists\n $discount = get_user_option( 'user_coupon_value' );\n \n if ( $discount ) {\n \n // Calculate total discount\n $total = ( $discount / 100) * $price[0]->plan_price; \n \n // Set new price\n $total_to_pay = $total_to_pay - $total;\n \n }\n \n \n if ( file_exists(APPPATH . 'payments/' . ucfirst($pay) . '.php') ) {\n\n require_once APPPATH . 'payments/' . ucfirst($pay) . '.php';\n \n // Call the class\n $pay_class = ucfirst(str_replace('-', '_', $pay));\n\n $get = new $pay_class;\n \n $get->process( $plan_id, $total_to_pay, $price[0]->currency_code);\n\n } else {\n \n display_mess(47);\n\n }\n \n } else {\n \n // Delete the user coupon code\n $this->user->delete_user_option( $this->user_id, 'user_coupon_code' );\n\n // Delete the user discount value\n $this->user->delete_user_option( $this->user_id, 'user_coupon_value' );\n\n // Create the classes array variable\n $classes = [];\n\n // Get all available payments gateways\n foreach (glob(APPPATH . 'payments/*.php') as $filename) {\n\n // Require the payments gateways\n require_once $filename;\n\n // Clean the class name\n $className = str_replace([APPPATH . 'payments/', '.php'], '', $filename);\n\n // Verify if the payment's gateway is enabled\n if ( ($this->options->check_enabled(strtolower($className)) == FALSE) ) {\n\n continue;\n\n }\n\n // Call the class name\n $get = new $className();\n\n // Get class info\n $classes [] = $get->info();\n\n }\n\n // Set the layout\n $this->body = 'user/gateways';\n\n // Set the layout's content\n $this->content = [\n 'plan' => $plan_id,\n 'plann' => $price,\n 'payments' => $classes\n ];\n\n // Call the layout\n $this->user_layout();\n\n }\n \n } else {\n \n if ( $this->plans->change_plan($plan_id, $this->user_id) ) {\n \n $this->session->set_flashdata('upgrade', display_mess(105));\n \n } else {\n \n $this->session->set_flashdata('upgrade', display_mess(106));\n \n }\n \n // go to plans page\n redirect('user/plans');\n \n }\n \n }",
"public function show($id)\n {\n $plan = Plan::find($id);\n $clients = $plan->clients;\n return view('plans.show' , ['plan' => $plan , 'clients' => $clients]);\n }",
"public function plans() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n if ( $this->session->userdata( 'member' ) ) {\n show_404();\n }\n \n // Get all plans\n $get_plans = $this->plans->get_all_plans();\n \n // Get user plan\n $user_plan = $this->plans->get_user_plan($this->user_id);\n \n // Check if user plan expires soon\n $check_plan = $this->plans->check_if_plan_ended($this->user_id);\n \n $expires_soon = 0;\n \n if ( $check_plan ) {\n \n if ( $check_plan < time() + 432000 ) {\n \n $expires_soon = 1;\n \n }\n \n }\n \n $upgrade = '';\n \n if ( $this->session->flashdata('upgrade') ) {\n \n $upgrade = $this->session->flashdata('upgrade');\n \n }\n \n // Load view/user/plans.php file\n $this->body = 'user/plans';\n $this->content = ['plans' => $get_plans, 'user_plan' => $user_plan, 'expires_soon' => $expires_soon, 'upgrade' => $upgrade];\n $this->user_layout();\n \n }",
"function TestPlan_get($plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.get', array(new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function create_plan($requestData){\n \n // ### Create Plan\n try {\n // Create a new instance of Plan object\n $plan = new Plan();\n if(isset($requestData['plan'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['plan']), $plan);\n } \n // # Payment definitions for this billing plan.\n $paymentDefinition = new PaymentDefinition(); \n $paymentDefinition\n ->setAmount(new Currency($requestData['paymentDefinition']['Amount']));\n array_pop($requestData['paymentDefinition']);\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $this->setArrayToMethods(array_filter($requestData['paymentDefinition']), $paymentDefinition); \n }\n \n // Charge Models\n $chargeModel = new ChargeModel();\n $chargeModel->setAmount(new Currency($requestData['chargeModel']['Amount']));\n array_pop($requestData['chargeModel']);\n if(!empty($this->checkEmptyObject((array)$chargeModel))){\n $this->setArrayToMethods(array_filter($requestData['chargeModel']), $chargeModel); \n $paymentDefinition->setChargeModels(array($chargeModel));\n }\n \n $merchantPreferences = new MerchantPreferences();\n $baseUrl = $requestData['baseUrl'];\n\n $merchantPreferences->setReturnUrl($baseUrl.$requestData['ReturnUrl'])\n ->setCancelUrl($baseUrl.$requestData['CancelUrl']);\n if(!empty($this->checkEmptyObject($requestData['merchant_preferences']['SetupFee']))){\n $merchantPreferences->setSetupFee(new Currency($requestData['merchant_preferences']['SetupFee']));\n }\n array_pop($requestData['merchant_preferences']);\n \n if(isset($requestData['merchant_preferences'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['merchant_preferences']), $merchantPreferences);\n }\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $plan->setPaymentDefinitions(array($paymentDefinition));\n }\n if(!empty($this->checkEmptyObject((array)$merchantPreferences))){\n $plan->setMerchantPreferences($merchantPreferences);\n } \n $requestArray= clone $plan;\n $output = $plan->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $output->toArray();\n $returnArray['RAWREQUEST']=$requestArray->toJSON();\n $returnArray['RAWRESPONSE']=$output->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }",
"public function annul(User $user, planuser $plan)\n {\n $plan->update(['plan_status_id' => PlanStatus::CANCELED]);\n\n if ($plan->postpone) {\n $plan->postpone->delete();\n }\n\n return redirect()->route('users.show', $user->id)\n ->with('success', 'Se canceló el plan correctamente');\n }",
"function checkandconsumuedplan($objectid=false,$lasturl=false,$objecttype=false,$userid=false,$status=false,$newplan=false)\n\t{\t\n\t\t$date=date(\"Y-m-d\");\n\t\t\n\t\tif(!empty($objectid) && !empty($lasturl) && !empty($objecttype) && !empty($userid) && !empty($status)){\n\t\t\t\n\t\t\t$planid='';\n\t\t\t\n\t\t\tif(!empty($objectid) && !empty($objecttype) && !empty($userid)){\n\t\t\t\t\n\t\t\t\t$propertyfilter=array('objectID'=>$objectid,'objectType'=>$objecttype);\n\t\t\t\t\n\t\t\t\t$propertydetails=$this->AddProperty_model->Getotherdata('rp_dbho_plan_mapping',$propertyfilter);\n\t\t\t\t\n\t\t\t\tif(!empty($propertydetails)){\n\t\t\t\t\t\n\t\t\t\t\t$planid=$propertydetails[0]->planID;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->session->set_flashdata('message_type', 'error');\n\t\t\t\t\t$this->session->set_flashdata('message', $this->config->item(\"PropertyListing\").'No Plan Found For This Property!!!');\n\t\t\t\t\tredirect(\"$lasturl\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!empty($newplan)){\n\t\t\t\t\t$planid=$newplan;\n\t\t\t\t}\n\t\t\t\t/*............Get Plan Information Of this User Start...............*/\n\t\t\t\tif(!empty($planid) && !empty($userid)){\n\t\t\t\t\t\n\t\t\t\t\t$plandetails=$this->AddProperty_model->Getuserplandata($planid,$userid);\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($plandetails)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$planquantity=$plandetails[0]->Quantity;\n\t\t\t\t\t\t$plancurrentexpiry1=$plandetails[0]->currentExpiry;\n\t\t\t\t\t\t$plancurrentexpiry=strtotime($plancurrentexpiry1);\n\t\t\t\t\t\t$planunitconsumued=$plandetails[0]->plan_unitconsumed;\n\t\t\t\t\t\t$planstatus=$plandetails[0]->status;\n\t\t\t\t\t\t$currentdate=strtotime($date);\n\t\t\t\t\t\t$campaignID=$plandetails[0]->campaignID;\n\t\t\t\t\t\t$planupdatefilter=array('campaignID'=>$campaignID,'planID'=>$planid);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($planstatus=='Active' && $plancurrentexpiry<$currentdate){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$data=array('status'=>'Inactive');\n\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_dbho_campaignplan',$data,$planupdatefilter);\n\t\t\t\t\t\t\t$this->AddProject_model->InsertProject('rp_user_to_plan',array('planStatus'=>'Inactive'),array('userID'=>$userid,'planID'=>$planid,'planStatus'=>'Active','currencyID'=>3));\n\t\t\t\t\t\t\t$this->session->set_flashdata('message_type', 'error');\n\t\t\t\t\t\t\t$this->session->set_flashdata('message', $this->config->item(\"PropertyListing\").'Your Plan Is Expired!!!');\n\t\t\t\t\t\t\tredirect(\"$lasturl\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($planstatus=='Active' && $currentdate<=$plancurrentexpiry)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($planquantity<=$planunitconsumued){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data=array('status'=>'Inactive');\n\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_dbho_campaignplan',$data,$planupdatefilter);\n\t\t\t\t\t\t\t\t$this->AddProject_model->InsertProject('rp_user_to_plan',array('planStatus'=>'Inactive'),array('userID'=>$userid,'planID'=>$planid,'planStatus'=>'Active','currencyID'=>3));\n\t\t\t\t\t\t\t\t$this->session->set_flashdata('message_type', 'error');\n\t\t\t\t\t\t\t\t$this->session->set_flashdata('message', $this->config->item(\"PropertyListing\").'You Have Insufficient Balance. Please Update your Plan Or Use Another Plan!!!');\n\t\t\t\t\t\t\t\tredirect(\"$lasturl\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$Get_rp_user_to_plan_Details=$this->AddProperty_model->Getotherdata('rp_user_to_plan',array('userID'=>$userid,'planID'=>$planid,'planStatus'=>'Active'));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(empty($Get_rp_user_to_plan_Details)){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->session->set_flashdata('message_type', 'error');\n\t\t\t\t\t\t\t\t\t$this->session->set_flashdata('message', $this->config->item(\"PropertyListing\").'No Active Plan Found For This User!!!');\n\t\t\t\t\t\t\t\t\tredirect(\"$lasturl\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data=array('plan_unitconsumed'=>$planunitconsumued+1);\n\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_dbho_campaignplan',$data,$planupdatefilter);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!empty($Get_rp_user_to_plan_Details)){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$rpuserstoplandata=array(\n\t\t\t\t\t\t\t\t'planUpdateDate'=>date(\"Y-m-d h:i:s\"),\n\t\t\t\t\t\t\t\t'planPropertyCountBalance'=>$Get_rp_user_to_plan_Details[0]->planPropertyCountBalance-1,\n\t\t\t\t\t\t\t\t'planProjectCountBalance'=> $Get_rp_user_to_plan_Details[0]->planProjectCountBalance-1,\n\t\t\t\t\t\t\t\t'planFeaturedCountBalance'=>$Get_rp_user_to_plan_Details[0]->planFeaturedCountBalance-1,\n\t\t\t\t\t\t\t\t'planProjectFeaturedCountBalance'=>$Get_rp_user_to_plan_Details[0]->planProjectFeaturedCountBalance-1,\n\t\t\t\t\t\t\t\t'totalPropSellCount'=>$Get_rp_user_to_plan_Details[0]->totalPropSellCount-1,\n\t\t\t\t\t\t\t\t'totalPropRentCount'=>$Get_rp_user_to_plan_Details[0]->totalPropRentCount-1,\n\t\t\t\t\t\t\t\t'totalPropLeaseCount'=>$Get_rp_user_to_plan_Details[0]->totalPropLeaseCount-1,\n\t\t\t\t\t\t\t\t'planEnquiryCountBalance'=>$Get_rp_user_to_plan_Details[0]->planEnquiryCountBalance-1\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t$this->AddProject_model->InsertProject('rp_user_to_plan',$rpuserstoplandata,array('userID'=>$userid,'planID'=>$planid,'planStatus'=>'Active','currencyID'=>3));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$planlogdata=array(\t\t\t'campaignID'=>$campaignID,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'planID'=>$planid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'objectID'=>$objectid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'objectType'=>$objecttype,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'status'=>$status,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'createdOn'=>date(\"Y-m-d h:i:s\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'createdBy'=>$this->userinfo['adminUserFirstName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'createdById'=>$this->userinfo['adminUserID'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'userAccessType'=>'Admin'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t$this->AddProject_model->InsertProject('rp_dbho_plan_consumption_log',$planlogdata);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($planquantity==$planunitconsumued+1){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$data=array('status'=>'Inactive');\n\t\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_dbho_campaignplan',$data,$planupdatefilter);\n\t\t\t\t\t\t\t\t\t$this->AddProject_model->InsertProject('rp_user_to_plan',array('planStatus'=>'Inactive'),array('userID'=>$userid,'planID'=>$planid,'planStatus'=>'Active','currencyID'=>3));\n\t\t\t\t\t\t\t\t\t$planlogdata1=array(\t'campaignID'=>$campaignID,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'planID'=>$planid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'objectID'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'objectType'=>'All Unit Consumued',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'status'=>'Inactive',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'createdOn'=>date(\"Y-m-d h:i:s\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'createdBy'=>$this->userinfo['adminUserFirstName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'createdById'=>$this->userinfo['adminUserID'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'userAccessType'=>'Admin'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t$this->AddProject_model->InsertProject('rp_dbho_plan_consumption_log',$planlogdata1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\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{\n\t\t\t\t\t\t$this->session->set_flashdata('message_type', 'error');\n\t\t\t\t\t\t$this->session->set_flashdata('message', $this->config->item(\"PropertyListing\").'No Active Plan Found For This User!!!');\n\t\t\t\t\t\tredirect(\"$lasturl\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t/*............Get Plan Information Of this User Start...............*/\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t$this->session->set_flashdata('message_type', 'error');\n\t\t\t$this->session->set_flashdata('message', $this->config->item(\"PropertyListing\").'This Action Is Not Apply.Please Try Again!!!');\n\t\t\tredirect(\"$lasturl\");\t\n\t\t}\t\n\t\t\n\t}",
"public function getPlanById($id)\n {\n try {\n return $this->plan->find($id);\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return false;\n }\n }",
"public function get_plan($planId){\n try {\n $plan = Plan::get($planId, $this->_api_context);\n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $plan->toArray();\n $returnArray['RAWREQUEST']='{id:'.$planId.'}';\n $returnArray['RAWRESPONSE']=$plan->toJSON();\n return $returnArray;\n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }",
"public function getChangePlanUrl($subscription, $plan_id, $returnUrl='/')\n {\n return action(\"\\Acelle\\Cashier\\Controllers\\\\BraintreeController@changePlan\", [\n 'subscription_id' => $subscription->uid,\n 'return_url' => $returnUrl,\n 'plan_id' => $plan_id,\n ]);\n }",
"public function create($name, $id)\n {\n return $this->add(new Plan($name, $id));\n }",
"public function store(Request $request)\n {\n /* dd($request->all()); */\n $this->authorize('create', Plan::class);\n\n Stripe\\Stripe::setApiKey(env('STRIPE_SECRET'));\n \n $this->validate($request, [\n 'name' => 'required',\n 'price' => 'required',\n 'duration' => 'required',\n // 'trial' => 'present'\n // 'plan_type' => 'required',Rule::in(['one_time','recurring'])\n ]);\n // Generate pla slug from plan name\n $slug = str_replace(' ','-', $request->input('name'));\n $gateway_id = str_replace(' ','_', $request->input('name'));\n //$team_enable = !empty($request->input('teams_limit')) ? 1 : 0;\n //$teams_limit = !empty($request->input('teams_limit')) ? $request->input('teams_limit') : NULL;\n $price = (float) $request->input('price') * 100;\n \n $interval=explode(',',$request->duration);\n /* dd($interval); */\n //Add the Stripe Api key to create the plan on the stripe dashboard\n // if($request->plan_type == \"recurring\"){\n \\Stripe\\Plan::create([\n \"amount\" => $price,\n \"interval\" => $interval[1],\n \"interval_count\"=>$interval[0], \n \"product\" => [\n \"name\" => $request->name,\n ],\n \"trial_period_days\" => $request->trial,\n \"currency\" => \"usd\",\n \"id\" => $gateway_id,\n //\"trial_period_days\" => $request->input('trial'),\n ]);\n // }elseif($request->plan_type == \"one_time\"){\n // \\Stripe\\Product::create([\n // \"name\" => $request->name,\n // \"id\" => $gateway_id,\n // ]);\n // \\Stripe\\Price::create([\n // \"unit_amount\" => $price,\n // \"currency\" => \"usd\",\n // \"product\" => $gateway_id,\n // ]);\n // }\n /* dd(123); */\n $plan = new Plan([\n 'name' => $request->name,\n 'gateway_id' => $gateway_id,\n 'price' => $request->price,\n 'brand' => $request->brand,\n 'contest' => $request->contest,\n 'duration' => $request->duration,\n 'other_info_1' => $request->plan_info_1,\n 'other_info_2' => $request->plan_info_2,\n //'teams_enabled' => $team_enable,\n //'teams_limit' => $teams_limit,\n 'active' => 1,\n 'slug' => $slug,\n 'trial_period_days' => $request->trial,\n ]);\n\n $plan->save();\n\n return redirect()->back()->with(\"status\", \"Your plan has been created.\");\n }",
"public function onPlan($plan)\n {\n return ! is_null($this->subscriptions->first(function ($value) use ($plan) {\n return $value->paddle_plan_id === Cashier::getPlanId($plan) && $value->valid();\n }));\n }",
"public function show($id)\n {\n $user = Auth::user();\n if (!$user || !$user->is_back_user()) {\n return redirect()->intended(route('admin/login'));\n }\n\n $the_plan = MembershipPlan::with('price')->with('restrictions')->where('id','=',$id)->get()->first();\n if (!$the_plan){\n $the_plan = false;\n }\n\n $activities = ShopResourceCategory::all()->sortBy('name');\n $restrictions = array();\n $plan_restrictions = MembershipRestriction::with('restriction_title')->where('membership_id','=',$the_plan->id)->orderBy('restriction_id','asc')->get();\n foreach($plan_restrictions as $restriction){\n $formatted = $restriction->format_for_display_boxes();\n\n $restrictions[] = [\n 'id' => $restriction->id,\n 'title' => $restriction->restriction_title->title,\n 'description' => $formatted['description'],\n 'color' => $formatted['color']\n ];\n }\n\n $breadcrumbs = [\n 'Home' => route('admin'),\n 'Administration' => route('admin'),\n 'Back End User' => route('admin'),\n 'Permissions' => '',\n ];\n $text_parts = [\n 'title' => 'Edit Plane - Full month free',\n 'subtitle' => '',\n 'table_head_text1' => 'Backend Roles Permissions List'\n ];\n $sidebar_link= 'admin-backend-memberships-all_plans';\n\n return view('admin/membership_plans/view_plan', [\n 'breadcrumbs' => $breadcrumbs,\n 'text_parts' => $text_parts,\n 'in_sidebar' => $sidebar_link,\n 'membership_plan' => $the_plan,\n 'activities' => $activities,\n 'restrictions' => $restrictions\n ]);\n }",
"public function show($id)\n {\n $plan = App\\Plan::findOrFail($id);\n //carpeta plan, dentro show.blade.php\n //return view('plan.show', compact('plan'));\n return $plan;\n }",
"public function show($id)\n {\n return view('admin.plan.show', ['plan' => Plan::findOrFail($id)]);\n }",
"public function plan()\n {\n return $this->hasManyThrough('Modules\\Plan\\Entities\\Plan',\n 'Modules\\Plan\\Entities\\Deducible',\n \t\t\t\t\t\t\t\t'plan_deducible_id',\n 'plan_id');\n }",
"public function delete_plan($planId){\n try {\n $createdPlan = new Plan();\n $createdPlan->setId($planId);\n $result = $createdPlan->delete($this->_api_context);\n $returnArray['RESULT'] = 'Success';\n $returnArray['DELETE_PLAN'] = $result->toArray();\n $returnArray['RAWREQUEST']='{id:'.$planId.'}';\n $returnArray['RAWRESPONSE']=$result->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }",
"public function leer($idplan)\n {\n include_once 'controlador/util/bd_conexion_pdo.php';\n\n $conexion = (new Conexion())->conectarPDO();\n\n $sentencia = $conexion->prepare(\"SELECT * FROM plan WHERE idplan = :idplan\");\n $sentencia->bindParam(\":idplan\", $idplan, PDO::PARAM_INT);\n $sentencia->execute();\n\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n\n $sentencia = null;\n $conexion = null;\n\n return $resultado;\n }",
"function recharge_plan() {\n\t\t$operator_id = $_REQUEST['operator_id'];\n\t\t$plan_id = $_REQUEST['plan_category_id'];\n\t\t//$operator_mobile=country_code.$_REQUEST['contact_no'];\n\t\t// if(empty($operator_mobile)){\n\t\t// $operator_mobile='';\n\t\t// }\n\t\tif (!empty($operator_id)) {\n\t\t\t//\t$records_plan = $this -> conn -> join_two_table('recharge_plan','operator_list','recharge_operator_id','operator_id','recharge_operator_id',$operator_id);\n\t\t\t$records_plan = $this -> conn -> join_four_table_new_with_two_field('recharge_plan', 'operator_list', 'recharge_category', 'plan_category', 'recharge_operator_id', 'operator_id', 'recharge_category_id', 'recharge_category_id', 'plan_category_id', 'plan_category_id', 'recharge_operator_id', $operator_id, 'recharge_plan`.' . '`recharge_category_id', $plan_id, 'rechage_amount');\n\n\t\t\t//print_r($records_plan);\n\t\t\tif (!empty($records_plan)) {\n\t\t\t\tforeach ($records_plan as $v) {\n\t\t\t\t\t$recharge_category_id = $v['recharge_category_id'];\n\t\t\t\t\t$plan_category_id = $v['plan_category_id'];\n\n\t\t\t\t\t$plan_category_name = $v['plan_category_name'];\n\t\t\t\t\t$category_name = $v['category_name'];\n\t\t\t\t\t$operator_name = $v['operator_name'];\n\t\t\t\t\t$recharge_amount = $v['rechage_amount'];\n\t\t\t\t\t$recharge_data_pack = $v['recharge_data_pack'];\n\t\t\t\t\t$recharge_activation_code = $v['recharge_activation_code'];\n\t\t\t\t\t$recharge_talktime = $v['recharge_talktime'];\n\t\t\t\t\t$recharge_validity = $v['recharge_validity'];\n\t\t\t\t\t$recharge_desc = $v['recharge_desc'];\n\n\t\t\t\t\t$arr[] = array('recharge_category_id' => $recharge_category_id, 'category_name' => $category_name, 'plan_category_id' => $plan_category_id, 'plan_category_name' => $plan_category_name, 'operator_name' => $operator_name, 'recharge_amount' => $recharge_amount, 'recharge_data_pack' => $recharge_data_pack, 'recharge_talktime' => $recharge_talktime, 'recharge_validity' => $recharge_validity, 'recharge_desc' => $recharge_desc, 'recharge_activation_code' => $recharge_activation_code);\n\t\t\t\t}\n\t\t\t\t$post = array('status' => \"true\", \"recharge_details\" => $arr);\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"No Data Avalible\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", 'message' => 'missing parameter', 'operator_id' => $operator_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}",
"private function _SavePlan()\n\t{\n\t\t/*\n\t\t * Saving process:\n\t\t *\t\tS1: Set up values for properties of the RatePlan object that are not already defined, or not in their database correct format\n\t\t *\t\tS2: Save the record to the RatePlan table\n\t\t *\t\tS3: Remove any records in the RatePlanRateGroup table\n\t\t *\t\tS4: For each RateGroup belonging to this RatePlan:\n\t\t *\t\t\t\tadd a record to the RatePlanRateGroup table\n\t\t *\t\tS5: If the RatePlan is being Committed: (not being saved as a draft)\n\t\t *\t\t\t\tFor each draft RateGroup belonging to this RatePlan:\n\t\t *\t\t\t\t\tupdate the Archived property of the RateGroup in the RateGroup table so that it is now a committed RateGroup, not a draft\n\t\t *\t\t\t\t\tFor each draft Rate belonging to the draft RateGroup:\n\t\t *\t\t\t\t\t\tupdate the Archived property of the Rate in the Rate table so that it is now a committed Rate, not a draft\n\t\t */\n\n\t\t// S1: Set up the remaing fields required of a RatePlan record\n\t\tDBO()->RatePlan->MinMonthly\t= ltrim(DBO()->RatePlan->MinMonthly->Value, \"$\");\n\t\tDBO()->RatePlan->ChargeCap\t= ltrim(DBO()->RatePlan->ChargeCap->Value, \"$\");\n\t\tDBO()->RatePlan->UsageCap\t= ltrim(DBO()->RatePlan->UsageCap->Value, \"$\");\n\n\t\tif (SubmittedForm('AddPlan', 'Save as Draft'))\n\t\t{\n\t\t\t// Flag the plan as being a draft\n\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_DRAFT;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The plan is not being saved as a draft\n\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_ACTIVE;\n\t\t}\n\n\t\tDBO()->RatePlan->modified_employee_id\t= Flex::getUserId();\n\t\tif (!DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\t// Plan has not been saved before\n\t\t\tDBO()->RatePlan->created_employee_id\t= Flex::getUserId();\n\t\t}\n\n\t\t// If the RatePlan has already been saved as a draft then load in the details that don't get edited here, so they don't get erased\n\t\tif (DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\tDBO()->RatePlan->LoadMerge();\n\t\t}\n\n\t\t// S2: Save the plan to the database\n\t\tif (!DBO()->RatePlan->Save())\n\t\t{\n\t\t\t// Saving failed\n\t\t\treturn \"ERROR: Saving the RatePlan to the RatePlan database table failed, unexpectedly\";\n\t\t}\n\n\t\t// S3: Remove all records from the RatePlanRateGroup table where RatePlan == DBO()->RatePlan->Id->Value\n\t\t$delRatePlanRateGroup = new Query();\n\t\t$delRatePlanRateGroup->Execute(\"DELETE FROM RatePlanRateGroup WHERE RatePlan = \" . DBO()->RatePlan->Id->Value);\n\n\t\t// S4: Save each of the RateGroups associated with the RatePlan to the RatePlanRateGroup table\n\t\tDBO()->RatePlanRateGroup->RatePlan = DBO()->RatePlan->Id->Value;\n\t\tforeach ($this->_arrRateGroups as $intRateGroup)\n\t\t{\n\t\t\tDBO()->RatePlanRateGroup->Id = 0;\n\t\t\tDBO()->RatePlanRateGroup->RateGroup = $intRateGroup;\n\n\t\t\tif (!DBO()->RatePlanRateGroup->Save())\n\t\t\t{\n\t\t\t\t// Saving failed\n\t\t\t\treturn \"ERROR: Saving one of the RateGroup - RatePlan associations failed, unexpectedly.<br />The RatePlan has not been saved\";\n\t\t\t}\n\t\t}\n\n\t\t// S5: Remove all records from the rate_plan_discount table where RatePlan == DBO()->RatePlan->Id->Value\n\t\t$delRatePlanDiscount\t= new Query();\n\t\t$delRatePlanDiscount->Execute(\"DELETE FROM rate_plan_discount WHERE rate_plan_id = \" . DBO()->RatePlan->Id->Value);\n\n\t\t// S6: Remove any records from the discount table which are no longer linked to any Rate Plans (Discounts cannot be shared between Plans)\n\t\t$delUnlinkedDiscounts\t= new Query();\n\t\t$delUnlinkedDiscounts->Execute(\"DELETE FROM discount WHERE (SELECT id FROM rate_plan_discount WHERE discount_id = discount.id LIMIT 1) IS NULL\");\n\n\t\t// S7: Save each of the Discounts which are linked between this Rate Plan and a Record Type\n\t\t$aDiscountReferenceMap\t= array();\n\t\tforeach (DBL()->RecordType as $dboRecordType)\n\t\t{\n\t\t\t$sRecordTypeObjectName\t\t= \"RecordType_{$dboRecordType->Id->Value}\";\n\t\t\t$iDiscountReference\t= (int)DBO()->{$sRecordTypeObjectName}->discount_id->Value;\n\n\t\t\t// Has the Discount already been created?\n\t\t\tif ($iDiscountReference && $iDiscountReference > 0)\n\t\t\t{\n\t\t\t\tif (!array_key_exists($iDiscountReference, $aDiscountReferenceMap))\n\t\t\t\t{\n\t\t\t\t\t// Create the Discount\n\t\t\t\t\t$sDiscountObjectName\t= \"discount_{$iDiscountReference}\";\n\n\t\t\t\t\t$oDiscount\t\t\t\t\t= new Discount();\n\t\t\t\t\t$oDiscount->name\t\t\t= trim(DBO()->{$sDiscountObjectName}->name->Value);\n\t\t\t\t\t$oDiscount->description\t\t= trim(DBO()->{$sDiscountObjectName}->description->Value);\n\n\t\t\t\t\tif (DBO()->{$sDiscountObjectName}->limit_type->Value === 'UNITS')\n\t\t\t\t\t{\n\t\t\t\t\t\t$oDiscount->charge_limit\t= null;\n\t\t\t\t\t\t$oDiscount->unit_limit\t\t= abs((int)trim(DBO()->{$sDiscountObjectName}->limit->Value));\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$oDiscount->charge_limit\t= abs((float)trim(DBO()->{$sDiscountObjectName}->limit->Value));\n\t\t\t\t\t\t$oDiscount->unit_limit\t\t= null;\n\t\t\t\t\t}\n\t\t\t\t\t$oDiscount->charge_limit\t= ($oDiscount->charge_limit) ? $oDiscount->charge_limit : null;\n\t\t\t\t\t$oDiscount->unit_limit\t\t= ($oDiscount->unit_limit) ? $oDiscount->unit_limit : null;\n\n\t\t\t\t\t$oDiscount->save();\n\n\t\t\t\t\t// Create the Discount<->RatePlan Link\n\t\t\t\t\t$oRatePlanDiscount\t\t\t\t\t= new Rate_Plan_Discount();\n\t\t\t\t\t$oRatePlanDiscount->rate_plan_id\t= DBO()->RatePlan->Id->Value;\n\t\t\t\t\t$oRatePlanDiscount->discount_id\t\t= $oDiscount->id;\n\t\t\t\t\t$oRatePlanDiscount->save();\n\n\t\t\t\t\t$aDiscountReferenceMap[$iDiscountReference]\t= $oDiscount->id;\n\t\t\t\t}\n\n\t\t\t\t// Save Link\n\t\t\t\t$oDiscountRecordType\t\t\t\t\t= new Discount_Record_Type();\n\t\t\t\t$oDiscountRecordType->discount_id\t\t= $aDiscountReferenceMap[$iDiscountReference];\n\t\t\t\t$oDiscountRecordType->record_type_id\t= $dboRecordType->Id->Value;\n\t\t\t\t$oDiscountRecordType->save();\n\t\t\t}\n\t\t}\n\n\t\t// S8: If the RatePlan is being committed then all draft RateGroups used by it must be commited and all draft Rates\n\t\t// used by the draft RateGroups must be committed\n\t\tif ((SubmittedForm('AddPlan', 'Commit')) && (count($this->_arrRateGroups) > 0))\n\t\t{\n\t\t\t$strRateGroups \t= implode(',', $this->_arrRateGroups);\n\t\t\t$arrUpdate\t\t= Array(\"Archived\" => RATE_STATUS_ACTIVE);\n\t\t\t$updRateGroups \t= new StatementUpdate(\"RateGroup\", \"Archived = \". RATE_STATUS_DRAFT .\" AND Id IN ($strRateGroups)\", $arrUpdate);\n\t\t\t$updRates \t\t= new StatementUpdate(\"Rate\", \"Archived = \". RATE_STATUS_DRAFT .\" AND Id IN (SELECT Rate FROM RateGroupRate WHERE RateGroup IN ($strRateGroups))\", $arrUpdate);\n\n\t\t\tif ($updRateGroups->Execute($arrUpdate, NULL) === FALSE)\n\t\t\t{\n\t\t\t\treturn \"ERROR: Commiting one of the Draft Rate Groups, used by this Rate Plan, failed.<br />The RatePlan has not been saved\";\n\t\t\t}\n\n\t\t\tif ($updRates->Execute($arrUpdate, NULL) === FALSE)\n\t\t\t{\n\t\t\t\treturn \"ERROR: Commiting one of the Draft Rates, used by this Rate Plan, failed.<br />The RatePlan has not been saved\";\n\t\t\t}\n\t\t}\n\n\t\t// Everything has been saved\n\t\treturn TRUE;\n\t}",
"public function create($planData)\n {\n \t$planPurchase \t\t\t\t = new PlanPurchase();\n\t\t$planPurchase->user_id \t\t = $this->user->id;\n\t\t$planPurchase->plan_id \t\t = $planData->plan_id;\n\t\t$planPurchase->country_code = $planData->country_code;\n\t\t$planPurchase->gold_price = (float)$this->plan->gold_price;\n\t\t$planPurchase->transaction_id = $planData->transaction_id;\n\t\t$planPurchase->save();\n\n \t/** Add Chest Capacity value in user's table **/\n \t(new ChestService)->setUser($this->user)->expand($this->plan->bucket);\n \t\n /** Deduct User Gold **/\n $goldBalance = (new UserRepository($this->user))->deductGold($this->plan->gold_price);\n\n \t/** return the available skeleton keys **/\n \treturn ['chest_bucket'=> $this->user->buckets['chests'], 'available_gold_balance'=> $goldBalance];\n }",
"public function show($id)\n {\n $plan = Plan::findOrFail($id);\n\n if ( $plan->user->first()->id != Auth::user()->id ) {\n if ( trans('globals.teacher') == Auth::user()->role->id ) {\n abort(403);\n }\n }\n\n $user = $plan->user->first();\n\n $conceptual = ConceptualSection::findOrFail($plan->conceptual_section_id);\n\n $completion = $plan->completion_time;\n\n if ( $completion == trans('globals.evaluation.early.completion') ) {\n $completion = trans('plan.evaluation.early.completion');\n }\n elseif ( $completion == trans('globals.evaluation.expected.completion') ) {\n $completion = trans('plan.evaluation.expected.completion');\n }\n elseif ( $completion == trans('globals.evaluation.delayed.completion') ) {\n $completion = trans('plan.evaluation.delayed.completion');\n }\n else {\n $completion = trans('plan.evaluation.na.completion');\n }\n\n $data = array(\n 'plan' => $plan,\n 'teacher' => $user,\n 'conceptual' => $conceptual->conceptual_section,\n 'knowledge' => $conceptual->knowledge_area->knowledge_area,\n 'completion' => $completion\n );\n\n return view('plans.show', $data);\n }",
"public function Editplan() {\n $plan_id = $this->input->post('plan_id');\n $data = array(\n 'plan_id' => $plan_id\n );\n $this->load->view('admin/plan/edit_plan', $data);\n }",
"public function swap($subscription_id, $plan)\n {\n return ChargeBee_Subscription::update($subscription_id, [\n 'plan_id' => $plan\n ])->subscription();\n }",
"private function submitPlan(Request $request)\n\t{\n\t\tStripe::setApiKey( config('services.stripe.key') );\n\n\t\treturn Stripe::plan([\n\t\t\t'id' => str_slug( $request->nickname ),\n\t\t\t'amount' => $request->amount,\n\t\t\t'product' => 'service',\n\t\t\t'interval' => $request->interval,\n\t\t\t'currency' => $request->currency,\n\t\t]);\n\t}",
"private function set_plan(\\Saklient\\Cloud\\Resources\\DiskPlan $v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"\\\\Saklient\\\\Cloud\\\\Resources\\\\DiskPlan\");\n\t\tif (!$this->isNew) {\n\t\t\tthrow new SaklientException(\"immutable_field\", \"Immutable fields cannot be modified after the resource creation: \" . \"Saklient\\\\Cloud\\\\Resources\\\\Disk#plan\");\n\t\t}\n\t\t$this->m_plan = $v;\n\t\t$this->n_plan = true;\n\t\treturn $this->m_plan;\n\t}",
"public function destroy($id)\n {\n Log::debug(\"DESTROY PLAN\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->deletePlan($id);\n\n if ($result['message'] == 'Success'){\n\n //return new StripeDeletedPlanResource($result['plan']);\n\n session()->flash('success', 'Plan deleted successfully.');\n \n return redirect( route ('plans.index') );\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }",
"public function index()\n {\n\n Log::debug(\"INDEX PLAN\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->listPlans();\n\n if ($result['message'] == 'Success'){\n\n $plan = $result['plans'];\n\n for ( $i = 0; $i < count($plan->data); $i++) {\n \n // determine length of stripe amount field so we can add a deciaml point and display it correctly as currency\n $amountLen = strlen($plan->data[$i]['amount_decimal']); \n $amount = substr_replace( $plan->data[$i]['amount_decimal'], '.', $amountLen - 2, 0 ); \n\n $planArray[$i]['id'] = $plan->data[$i]['id'];\n $planArray[$i]['product'] = $plan->data[$i]['product'];\n $planArray[$i]['interval'] = $plan->data[$i]['interval'];\n $planArray[$i]['amount_decimal'] = $amount;\n $planArray[$i]['nickname'] = $plan->data[$i]['nickname'];\n \n }\n\n Log::debug($planArray);\n\n $plans = json_decode(json_encode($planArray), FALSE);\n \n return view('stripe.plan.index', ['plans' => $plans ]);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }",
"function copy_plan($userId,$planId,$new_name=\"\"){\n if( is_numeric($userId) && is_numeric($planId) ){\n \n if($new_name == \"\" ){\n // Retrive plan from plan table.\n $query = \"select * from plan where plan_id = '{$planId}' \";\n $result = @mysql_query($query);\n $row = @mysql_fetch_array($result);\n $new_name = $row['plan_name'];\n }\n \n // Create array for inserting record.\n $insertArr = array(\n 'plan_name'=> $new_name,\n 'parent_template_id' => NULL,\n 'user_id' => $userId,\n 'patient_id' => NULL,\n 'user_type' => 2,\n 'is_public' => NULL,\n 'creation_date' => $row['creation_date'], \n 'status' => 1\n );\n \n // Insert record.\n $result = $this->insert('plan',$insertArr);\n \n //Get new plan id\n $newlyPlanId = $this->insert_id();\n \n // Copy treatments associated with planId.\n if(is_numeric($newlyPlanId)){\n // copy treatments in the plan.\n $this->copy_plan_treatment($newlyPlanId,$planId);\n // copy articles in the plan.\n $this->copy_article($newlyPlanId,$planId);\n }\n } \n \n }",
"public function plan_renewal_ci()\n\t{\n\t\t// * there should only be 1 such renewal\n\t\t$sql = \"SELECT ci.* FROM co_component_item ci \n\t\t\tINNER JOIN co_component_set cs \n\t\t\tON ci.component_set_id = cs.id \n\t\t\tAND (ci.is_renewable = 1 OR ci.is_auto_renew_enabled = 1)\n\t\t\tAND cs.user_id = ? \n\t\t\tINNER JOIN co_item i \n\t\t\tON ci.item_id = i.id AND i.type = ?\n\t\t\tLIMIT 1\";\n\t\t\t\n\t\t$db_result = $this->db->query($sql, \n\t\t\tarray($this->id, Model_Item::TYPE_PLAN));\n\t\t$ex_component_item = Model_Component_Item::from_db($db_result);\n\t\treturn $ex_component_item;\n\t}",
"public function enablePlan($id) \n {\n try {\n\n $plan = Plan::find($id);\n $plan->active = 1;\n $plan->save();\n\n return response(['message' => 'The plan has been enabled'], 200);\n \n } catch (Exception $e) {\n return response(['message' => $e->getMessage()], 500);\n }\n }",
"public function subscribe(string $plan): Model\n {\n return MarqantPay::subscribe($this, $plan);\n }",
"abstract function is_single_plan();",
"public function update(Request $request, Plan $plan)\n {\n //\n }",
"public function edit($id)\n {\n \n\n $plan = Plan::find($id);\n\n \n \n return view('admin.plans.edit', compact('plan'));\n\n }"
]
| [
"0.70506275",
"0.69173795",
"0.68683463",
"0.655415",
"0.6432099",
"0.6403024",
"0.6376856",
"0.6375782",
"0.6323266",
"0.6262284",
"0.6248051",
"0.6169037",
"0.61502546",
"0.614658",
"0.61108524",
"0.61074877",
"0.61007094",
"0.60719943",
"0.60677534",
"0.60661846",
"0.6046173",
"0.60295784",
"0.6023856",
"0.60188997",
"0.60117257",
"0.60092425",
"0.60008454",
"0.59973127",
"0.5980089",
"0.5962542",
"0.5948399",
"0.5929938",
"0.5921727",
"0.5913988",
"0.5899066",
"0.5889395",
"0.58854395",
"0.58709913",
"0.5837235",
"0.58367485",
"0.58275586",
"0.58241636",
"0.57704353",
"0.57432467",
"0.5736906",
"0.57321024",
"0.5731343",
"0.57197356",
"0.5719692",
"0.57127255",
"0.5707585",
"0.5691351",
"0.5688677",
"0.5687109",
"0.5675612",
"0.566147",
"0.56438744",
"0.5638873",
"0.56309855",
"0.5622521",
"0.5609596",
"0.5609486",
"0.5607847",
"0.5603849",
"0.5602092",
"0.5601623",
"0.5593244",
"0.55904365",
"0.5590326",
"0.558505",
"0.55840266",
"0.55804336",
"0.55785763",
"0.5563565",
"0.556303",
"0.55432266",
"0.5543044",
"0.5539447",
"0.5530904",
"0.55245763",
"0.55172753",
"0.55159944",
"0.55107445",
"0.550697",
"0.5506343",
"0.55017596",
"0.5499347",
"0.5495565",
"0.5485498",
"0.54816604",
"0.5469173",
"0.546739",
"0.5466461",
"0.5455232",
"0.5441368",
"0.5432588",
"0.54283094",
"0.54165775",
"0.5413441",
"0.54131114"
]
| 0.65192527 | 4 |
Set Gateway ID If you have multiple gateways, specify which gateway to use. | public function UseGateway($gateway_id) {
$this->Param('gateway_id', $gateway_id);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_gateway($gateway_slug, $args) {\n\n // Set payments gateway\n md_set_gateway($gateway_slug, $args);\n \n }",
"protected function setGateway($gateway)\n {\n $this->gateway = $gateway;\n }",
"public function setGateway(GatewayInterface $gateway) {\n $this->gateway = $gateway;\n }",
"public function setGateway(GatewayInterface $gateway)\n {\n }",
"public function setGatewayId(int $gateway_id)\n {\n $this->gateway_id = $gateway_id;\n\n return $this;\n }",
"public function getGatewayId()\n {\n return $this->gateway_id;\n }",
"public function set_gateway( $gateway ) {\n\t\t$this->_gateway = $gateway;\n\n\t\t// Setup API key.\n\t\tStripeCheckout::setApiKey( $this->_gateway->get_secret_key() );\n\n\t\t// If we don't set this, Stripe will use latest version, which may break our implementation.\n\t\tStripeCheckout::setApiVersion( '2019-09-09' );\n\n\t\t// Setup plugin info.\n\t\tStripeCheckout::setAppInfo(\n\t\t\t'Membership 2 - Stripe Checkout',\n\t\t\tM2STRIPE_VERSION,\n\t\t\tsite_url()\n\t\t);\n\t}",
"function setGateway($gateway = NULL) {\n\t\t\t//set the gateway property\n\t\t\tif(isset($gateway)) {\n\t\t\t\t$this->gateway = $gateway;\n\t\t\t}\n\n\t\t\t//which one to load?\n\t\t\t$classname = \"PMProGateway\";\t//default test gateway\n\t\t\tif(!empty($this->gateway) && $this->gateway != \"free\") {\n\t\t\t\t$classname .= \"_\" . $this->gateway;\t//adding the gateway suffix\n\t\t\t}\n\n\t\t\tif(class_exists($classname) && isset($this->gateway)) {\n\t\t\t\t$this->Gateway = new $classname($this->gateway);\n\t\t\t} else {\n\t\t\t\t$this->Gateway = null;\t//null out any current gateway\n\t\t\t\t$error = new WP_Error(\"PMPro1001\", \"Could not locate the gateway class file with class name = \" . $classname . \".\");\n\t\t\t}\n\n\t\t\tif(!empty($this->Gateway)) {\n\t\t\t\treturn $this->Gateway;\n\t\t\t} else {\n\t\t\t\t//gateway wasn't setup\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"protected function getGatewayIdentifier() {\n\t\treturn $this->gatewayIdentifier;\n\t}",
"protected function getGatewayIdentifier() {\n\t\treturn $this->gatewayIdentifier;\n\t}",
"public function set_gateway_device($device)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // Validate\n //---------\n // TODO\n\n // Update tag if it exists\n //------------------------\n\n $file = new File(self::FILE_NETWORK);\n $match = $file->replace_lines('/^GATEWAYDEV=/', \"GATEWAYDEV=\\\"$device\\\"\\n\");\n\n // If tag does not exist, add it\n //------------------------------\n\n if (! $match)\n $file->add_lines(\"GATEWAYDEV=\\\"\" . $device . \"\\\"\\n\");\n }",
"public function setCustomerGateway($value) \n {\n $this->_fields['CustomerGateway']['FieldValue'] = $value;\n return;\n }",
"public function setGatewayVersion($version)\n {\n $this->_gatewayVersion = (int)$version;\n }",
"public function setGatewayIP($value)\n {\n return $this->set('GatewayIP', $value);\n }",
"public function edit(Gateway $gateway)\n {\n //\n }",
"public function updateGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Updated Gateway Details';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n //Wulian Gateway\n\n $this->validate($request,\n ['GATEWAY_NAME'=>'unique:M005_GATEWAY|required']);\n if($request->KEY == 'gateway'){\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n $gateway->FLOOR_ID = $request->FLOOR_ID ?\n $request->FLOOR_ID : $gateway->FLOOR_ID;\n $gateway->ROOM_ID = $request->ROOM_ID ?\n $request->ROOM_ID : $gateway->ROOM_ID;\n $gateway->REG_FLAG = $request->REG_FLAG ?\n $request->REG_FLAG : $gateway->REG_FLAG;\n $gateway->ONLINE_FLAG = $request->ONLINE_FLAG ?\n $request->ONLINE_FLAG : $gateway->ONLINE_FLAG;\n $gateway->GATEWAY_NAME = $request->GATEWAY_NAME ?\n $request->GATEWAY_NAME : $gateway->GATEWAY_NAME;\n $gateway->save();\n return response($gateway, 201);\n }else{\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n\n $gateway->FLOOR_ID = $request->FLOOR_ID ?\n $request->FLOOR_ID : $gateway->FLOOR_ID;\n $gateway->GATEWAY_SERIAL_NO = $request->GATEWAY_SERIAL_NO ?\n $request->GATEWAY_SERIAL_NO : $gateway->GATEWAY_SERIAL_NO;\n $gateway->GATEWAY_NAME = $request->GATEWAY_NAME ?\n $request->GATEWAY_NAME : $gateway->GATEWAY_NAME;\n $gateway->GATEWAY_IP = $request->GATEWAY_IP ?\n $request->GATEWAY_IP : $gateway->GATEWAY_IP;\n $gateway->save();\n return response($gateway, 201);\n }\n }",
"public function setGateway($gateway)\n {\n if ($this->Status == 'Created') {\n $this->setField('Gateway', $gateway);\n }\n return $this;\n }",
"public function setGateway($name)\n {\n $this->gateway = $name;\n\n return $this;\n }",
"public function setGatewayData(array $data)\n {\n $this->gateway_data = $data;\n\n return $this;\n }",
"public function setGateway(Direction $direction, Space $space) : void\n {\n $this->gateways->put($direction->getValue(), $space);\n }",
"public function getGateway() {\n return $this->gateway;\n }",
"public function add_gateway( $gateways ) {\n\t\t$gateways[] = 'Paytwit_WC_gateway';\n\t\treturn $gateways;\n\t}",
"public function setProviderGateway(ProviderGatewayContract $providerGateway)\n {\n $this->providerGateway = $providerGateway;\n }",
"public function gateway(string $gateway): Gateway\n {\n $gateway = mb_strtolower($gateway);\n\n if (! isset($this->created[$gateway])) {\n $this->created[$gateway] = $this->createGateway($gateway);\n }\n\n return $this->created[$gateway];\n }",
"public function setDefaultGateway($name){\n\t\t\tif($this->__find($name)){\n\t\t\t\tSymphony::Configuration()->set('default_gateway', $name, 'Email');\n\t\t\t\tAdministration::instance()->saveConfig();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new EmailGatewayException(__('This gateway can not be found. Can not save as default.'));\n\t\t\t}\n\t\t}",
"private function _processSingleGateway()\n {\n if($gateway = $this->gateway_library->get_first())\n {\n $this->session->set_userdata( 'gateway_id', $gateway->id );\n //now place order\n $order_id = $this->place_order();\n if($order_id > 0)\n {\n $this->set_step(0); //6\n redirect( NC_ROUTE.'/payment/order/'.$order_id);\n }\n }\n redirect( NC_ROUTE.'/cart/');\n }",
"public function getGateway()\n {\n return $this->gateway;\n }",
"public function gateway()\n {\n return $this->belongsTo('App\\Gateway', 'GATEWAY_ID' ,'GATEWAY_ID');\n }",
"public function smsGatewayCru(Request $request, $id=0)\n {\n //for save on POST request\n if ($request->isMethod('post')) {\n $this->validate($request, [\n 'gateway' => 'required|integer',\n 'name' => 'required|min:4|max:255',\n 'sender_id' => 'nullable',\n 'user' => 'required|max:255',\n 'password' => 'nullable|max:255',\n 'api_url' => 'required',\n ]);\n\n\n $data = [\n 'gateway' => $request->get('gateway',''),\n 'name' => $request->get('name',''),\n 'sender_id' => $request->get('sender_id',''),\n 'user' => $request->get('user',''),\n 'password' => $request->get('password',''),\n 'api_url' => $request->get('api_url',''),\n ];\n\n\n AppMeta::updateOrCreate(\n ['id' => $id],\n [\n 'meta_key' => 'sms_gateway',\n 'meta_value' => json_encode($data)\n ]\n );\n $msg = \"SMS Gateway \";\n $msg .= $id ? 'updated.' : 'added.';\n\n if($id){\n return redirect()->route('settings.sms_gateway.index')->with('success', $msg);\n }\n return redirect()->route('settings.sms_gateway.create')->with('success', $msg);\n }\n\n //for get request\n $gateways = AppHelper::SMS_GATEWAY_LIST;\n $gateway_id = null;\n $gateway = AppMeta::find($id);\n if($gateway) {\n $gateway_id = (json_decode($gateway->meta_value))->gateway;\n }\n\n return view('backend.settings.smsgateway_add', compact('gateways', 'gateway', 'gateway_id'));\n }",
"protected function get_gateway() {\n\n\t\treturn $this->gateway;\n\t}",
"public function updateGateway(\n $gatewayId,\n array $body\n )\n {\n return $this->_UpdateGateway_operation->call([\n 'GatewayId' => $gatewayId,\n 'body' => $body\n ]);\n }",
"public function register_gateway($gateways)\n {\n $gateways['jeeb'] = array(\n 'admin_label' => 'Jeeb',\n 'checkout_label' => 'Jeeb - Pay securely with bitcoins through Jeeb Payment Gateway.',\n );\n return $gateways;\n }",
"function getGatewayID() {\n\t\treturn commsGateway::GW_APP_LOOP_BACK;\n\t}",
"public function setTableGateway(\\Zend_Db_Table $_tableGateway)\n {\n $this->_tableGateway = $_tableGateway;\n }",
"protected function setupGateway( $package, $gateway )\n {\n \n $request = $this->getRequest();\n \n $codeRoot = $gateway->getCodeRoot();\n \n $gwName = $gateway->getName();\n $gwSrc = $gateway->getSrc();\n \n $this->protocol->subHead( 'Deploy Gateway '.$gwName.' to '.$codeRoot );\n \n if( !Fs::exists($codeRoot) )\n {\n if( !Fs::mkdir($codeRoot))\n {\n $this->protocol->error( 'Konnte das Zielverzeichnis: '.$codeRoot.' nicht anlegen.' );\n throw new GaiaException( 'Konnte das Zielverzeichnis: '.$codeRoot.' nicht anlegen.' );\n }\n }\n \n $gwSrcPath = $this->dataPath.'gateway/'.$gwSrc;\n $gwTargetPath = $codeRoot.'/'.$gwName;\n \n if( !Fs::exists($gwSrcPath) )\n {\n $error = 'Konnte keine Daten zu dem Gateway: '.$gwSrc.' unter '.$gwSrcPath.' finden.';\n $this->protocol->error( $error );\n throw new GaiaException( $error );\n }\n \n if( Fs::exists( $gwTargetPath ) )\n {\n \n if( !$this->console->question\n (\n <<<QUESTION\nEs existiert bereits ein Gateway unter: {$gwTargetPath}.\nSoll die vorhandene Installation komplett überschrieben werden?\n\nWarnung wenn du jetzt auf ja klickst werden alle Daten \ndie sich in der Installation befinden gelöscht.\nQUESTION\n ))\n {\n \n $errMsg = <<<ERROR\nDie Installation wurde abgebrochen da unter \"{$gwTargetPath}\" \nbereits eine Installation vorhanden war.\n\nZum updaten der Installation bitte das update Script verwenden.\nERROR;\n \n $this->protocol->error( $errMsg );\n throw new GaiaException( $errMsg );\n }\n \n // löschen der alten installation\n // Hoffentlich hat da jemand gut drüber nachgedacht\n Fs::del( $gwTargetPath );\n }\n \n if( !Fs::copyContent( $gwSrcPath, $gwTargetPath ) )\n {\n $error = 'Kopieren der Gatewaydaten ist fehlgeschlagen';\n $this->protocol->error( $error );\n throw new GaiaException( $error );\n }\n \n // sollten versehentlich die sessiondaten mitkopiert worden sein\n // sicherstellen dass keine alten sessiondaten kopiert wurden\n if( Fs::exists( $gwTargetPath.'/tmp/session' ) )\n {\n $this->protocol->warning( 'lösche vorhadenen sessiondaten in '.$gwTargetPath.'/tmp/session' );\n Fs::del( $gwTargetPath.'/tmp/session' );\n }\n Fs::mkdir( $gwTargetPath.'/tmp/session' );\n \n // sicher stellen, dass der cache nicht mit deployt wurde\n if( Fs::exists( $gwTargetPath.'/cache' ) )\n {\n $this->protocol->warning( 'lösche vorhadenen cache in '.$gwTargetPath.'/cache' );\n Fs::del( $gwTargetPath.'/cache' );\n }\n Fs::mkdir( $gwTargetPath.'/cache' );\n \n // bearbeiten der gmod includes\n if( Fs::exists( $gwTargetPath.'/conf/include/available_gmod' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/available_gmod in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/available_gmod' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/available_gmod' );\n \n if( Fs::exists( $gwTargetPath.'/conf/include/gmod' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/gmod in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/gmod' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/gmod' );\n \n // bearbeiten der module includes\n if( Fs::exists( $gwTargetPath.'/conf/include/available_module' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/available_module in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/available_module' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/available_module' );\n \n if( Fs::exists( $gwTargetPath.'/conf/include/module' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/module in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/module' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/module' );\n \n // bearbeiten der metadata includes\n if( Fs::exists( $gwTargetPath.'/conf/include/metadata' ) )\n {\n $this->protocol->warning( 'Leere /conf/include/metadata in '.$gwTargetPath );\n Fs::del( $gwTargetPath.'/conf/include/metadata' );\n }\n Fs::mkdir( $gwTargetPath.'/conf/include/metadata' );\n\n \n // kopieren der conf\n // conf kann aus dem request genommen werden\n // wenn nicht im request wird in der package.bdl gesucht\n $confKey = $gateway->getConfKey();\n \n\n if( $confKey )\n {\n $this->protocol->info( \"Use configuration {$confKey}\" );\n \n if( Fs::exists( $gwTargetPath.'/conf/space/'.$confKey ) )\n {\n Fs::copyContent( $gwTargetPath.'/conf/space/'.$confKey, $gwTargetPath.'/conf/' );\n }\n else \n {\n \n $fatal = <<<FATAL\nDie angefragte Konfiguration: {$confKey} existiert nicht im Gateway: {$gwTargetPath}/conf/space/\nFATAL;\n \n $this->protocol->fatal( $fatal ); \n throw new GaiaException( $fatal );\n }\n \n }\n\n \n\n }",
"public function setBillingAddressId($id);",
"public function getGateway() {\n\t\treturn self::$gateways[mt_rand(0, (self::$COUNT-1))];\n\t}",
"public function setSourceGateway($var)\n {\n GPBUtil::checkString($var, True);\n $this->source_gateway = $var;\n\n return $this;\n }",
"public function __construct( GatewayInitializer $gateway )\n {\n $this->gateway = $gateway->init();\n }",
"public function setDoorId()\n {\n if(isset($_GET['doorId']))\n {\n echo 'const doorId = '.$_GET['doorId'].';';\n }\n else\n {\n $config = new Config;\n echo 'const doorId = '.$config->defaultDoor.';';\n }\n }",
"function setCountryId( $value )\n {\n $this->CountryID = $value;\n }",
"public function getGateway(): ?GatewayInterface\n {\n if (null === $this->_gateway) {\n $this->_gateway = Commerce::getInstance()->getGateways()->getGatewayById($this->gatewayId);\n }\n\n return $this->_gateway;\n }",
"public static function gateway($key = '')\n {\n $payment_gateways = Cache::get(CACHE_PARAM_PAYMENT_GATEWAY, null);\n if (is_null($payment_gateways)) {\n $invoice_status = self::all();\n $payment_gateways = [];\n foreach ($invoice_status as $status) {\n $payment_gateways[strtoupper($status->name)] = $status->id;\n }\n Cache::put(CACHE_PARAM_PAYMENT_GATEWAY, $payment_gateways, 43200);\n }\n\n return empty($key) ? $payment_gateways : $payment_gateways[$key];\n }",
"public static function setFactory( GatewayFactory $cFactory = null )\n\t{\n\t\tstatic::$g_cFactory = $cFactory;\n\t}",
"public function setRouteID($value) {\n\t\t$this->_route_id = $value;\n\t}",
"public function set_id($setid){\n $this->id = $setid;\n }",
"public function update(Request $request, Gateway $gateway)\n {\n // dd($request, $gateway);\n $gateway->update($request->all());\n toastr()->success('Gateway Updated');\n return redirect()->back();\n }",
"public function add_gateway($id = NULL) {\n $data['title'] = \"Add New Channel\";\n\n $this->settings_model->_table_name = \"tbl_gateway_type\"; //table name\n $this->settings_model->_order_by = \"id\";\n $data['typeinfo'] = $this->settings_model->get();\n\n if (!empty($id)) \n {\n // retrive data from db by id \n \n $this->settings_model->_table_name = \"tbl_channel\"; //table name\n $this->settings_model->_order_by = \"id\";\n $val = $this->settings_model->get_by(array('id' => $id), TRUE);\n\n if ($val) { // get general info by id\n $data['ginfo'] = $val; // assign value from db \n }\n $data['cinfo'] = $this->settings_model->get_gateway_info($id);\n\n }\n \n $data['subview'] = $this->load->view('admin/gateway/gatewayadd', $data, TRUE);\n $this->load->view('admin/_layout_main', $data);\n }",
"function add_shipping_id( $available_gateways ) {\n $shipping_id = get_shipping_id();\n\n echo '<div class=\"card--inline m-b-3 position-right position-right--50\">';\n if ( isset($shipping_id) && $shipping_id ) {\n echo '<p>Shipping ID: ' . $shipping_id . '</p>';\n } else {\n echo '<p>Please contact RANDYS to add a Shipper Account ID to your account.</p>';\n }\n echo '</div>';\n}",
"public function blockGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Updated Gateway to be Blocked';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n $gateway->REG_FLAG = 4;\n $gateway->save();\n\n return \"success\";\n }",
"public function setVpnGatewayInterface($var)\n {\n GPBUtil::checkInt32($var);\n $this->vpn_gateway_interface = $var;\n\n return $this;\n }",
"public function setShippingOptionId($id){\n $this->shippingOptionId = $id;\n }",
"public function setSourceGatewayIp($var)\n {\n GPBUtil::checkString($var, True);\n $this->source_gateway_ip = $var;\n\n return $this;\n }",
"public function setclient_id($value);",
"Public Function setNetworkId($NetworkId) {\n\t\t$this->networkId = $NetworkId;\n\t\n\t}",
"public function set_id_pg($id=0){\n\t\t\t$id = (int) $id;\n\t\t\tif($id!=0){\n\t\t\t\t$this->ipg_id=$id;\n\t\t\t}else{\n\t\t\t\t$this->ipg_id=0;\n\t\t\t}\n\t\t}",
"function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }",
"public function setID($id) {\n $this->id = $id; \n }",
"public function gateway($name = null)\n {\n $name = $name ?: $this->getGateway();\n\n if ( ! isset($this->gateways[$name]))\n {\n $this->gateways[$name] = $this->resolve($name);\n }\n\n return $this->gateways[$name];\n }",
"public function test_set_gateway_config()\n {\n\n $payumBuilder = m::spy('Payum\\Core\\PayumBuilder');\n $config = [\n 'gatewayConfigs' => [\n 'gatewayName' => [\n 'factory' => 'factory',\n 'username' => 'username',\n 'password' => 'password',\n ],\n 'gatewayName2' => [\n 'factory' => 'stdClass',\n 'username' => 'username',\n 'password' => 'password',\n ],\n ],\n 'storage.gatewayConfig' => 'eloquent',\n ];\n $app = m::spy('Illuminate\\Contracts\\Foundation\\Application');\n\n $gatewayConfig = m::spy('Recca0120\\LaravelPayum\\Model\\GatewayConfig');\n $gatewayFactory = m::spy('Payum\\Core\\GatewayFactoryInterface');\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $app->shouldReceive('make')->andReturn($gatewayConfig);\n\n $gatewayConfig\n ->shouldReceive('newQuery')->andReturnSelf()\n ->shouldReceive('get')->andReturnSelf()\n ->shouldReceive('all')->andReturn([$gatewayConfig])\n ->shouldReceive('getGatewayName')->once()->andReturn('fooGateway')\n ->shouldReceive('getFactoryName')->once()->andReturn('fooFactoryName')\n ->shouldReceive('getConfig')->once()->andReturn([\n 'foo' => 'bar',\n ]);\n\n $manager = new PayumBuilderManager($payumBuilder, $config, $app);\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $manager->setGatewayConfig();\n\n foreach ($config['gatewayConfigs'] as $gatewayName => $gatewayConfig) {\n $payumBuilder->shouldReceive('addGatewayFactory')->with($gatewayName, m::on(function ($closure) use ($gatewayConfig, $gatewayFactory) {\n $closure($gatewayConfig, $gatewayFactory);\n\n return true;\n }));\n }\n }",
"public function setId($id) {\n $this->vendorData[\"ID_VENDOR\"] = (int)$id;\n }",
"private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}",
"public function setID($id){\n $this->id = $id;\n }",
"public function setIDSender($idSender){\n $this->IDsender = $idSender;\n }",
"function setId($id)\n\t{\n\t\t// Set state ID and wipe data\n\t\t$this->_id\t\t\t= $id;\n\t\t$this->_state\t\t= null;\n\t\t$this->_suburbs\t\t= null;\n\t}",
"public function __construct(DataGatewayInterface $gateway)\n {\n $this->gateway = $gateway;\n }",
"public function setID($id){\n $this->ID = $id;\n }",
"public function setID($id);",
"public function delete_gateway($id = NULL) \n {\n $this->settings_model->_table_name = \"tbl_channel\"; // table name\n $this->settings_model->_primary_key = \"id\"; // $id\n $this->settings_model->delete($id); \n \n $type = \"success\";\n $message = \"频道信息成功删除!\";\n set_message($type, $message);\n redirect('admin/gateway/gateway');\n \n }",
"public function update(UpdatePaymentGatewaysRequest $request, $id)\n {\n if (! Gate::allows('payment_gateway_edit')) {\n return prepareBlockUserMessage();\n }\n $request = $this->saveFiles($request);\n $payment_gateway = PaymentGateway::findOrFail($id);\n $payment_gateway->update($request->all());\n\n\n flashMessage( 'success', 'update' );\n return redirect()->route('admin.payment_gateways.index');\n }",
"public function setID($id) {\n\t\t$this->id = $id;\n\t}",
"public function setID($id)\n {\n $this->ID = $id;\n }",
"public function setShipmentId($id)\n {\n if (is_string($id) || is_numeric($id)) {\n $this->options['ShipmentId'] = $id;\n } else {\n $this->log('Tried to set ShipmentId to invalid value', 'Warning');\n\n return false;\n }\n }",
"public function setID($id)\n {\n $this->id = $id;\n }",
"public function setMicrosoftTunnelSiteId(?string $value): void {\n $this->getBackingStore()->set('microsoftTunnelSiteId', $value);\n }",
"public function registerGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Registered a Gateway';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n $this->validate($request,['GATEWAY_NAME'=>'required']);\n if (!isset($request->GATEWAY_ID, $request->FLOOR_ID,\n $request->GATEWAY_NAME)) {\n abort(400, 'Malformed syntax.');\n }\n\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n\n if ($gateway->REG_FLAG == 1) {\n \tabort(409, 'Entity is already registered');\n }\n else {\n \t$gateway->FLOOR_ID = $request->FLOOR_ID;\n\t $gateway->ROOM_ID = $request->ROOM_ID;\n\t $gateway->GATEWAY_NAME = $request->GATEWAY_NAME;\n\t $gateway->REG_FLAG = 1;\n\t $gateway->save();\n }\n\n return response($gateway, 201);\n }",
"function set_region_id($link, $data, $value) // Colorize: green\n { // Colorize: green\n return set_property_value($link, $data, \"region_id\", $value); // Colorize: green\n }",
"public function __construct(PaymentGatewayInterface $paymentGateway)\n {\n $this->paymentGateway = $paymentGateway;\n }",
"public function getVpnGatewayInterface()\n {\n return isset($this->vpn_gateway_interface) ? $this->vpn_gateway_interface : 0;\n }",
"public function deleteGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Deleted a Gateway';\n\n //Find Gateway from DB\n $gateway = Gateway::findorFail($request->GATEWAY_ID);\n\n\n\n if($request->KEY == 'gateway'){\n $remote_ip = $gateway->GATEWAY_IP;\n $remote_port = env(\"PORT_GATEWAY\");\n\n if($gateway){\n //Get Devices based on Gateway\n $devices = $gateway->devices()->get();\n\n //Uncomment for Production\n //Delete Plotted Device on Floor Map\n foreach ($gateway->devices()->get() as $key => $device) {\n $this->deleteDevicePlot($device);\n }\n\n //if request has \"FORCE\" parameter, directly delete gateway form db\n if ($request->FORCE == true) {\n\n $gateway->devices()->delete();\n $gateway->delete();\n $this->auditLogs($ip,$host,$module,$instruction);\n\n return \"success\";\n }\n //Unregister Gateway to OPS\n $data = '{\"mode\":\"deleteGateway\"}';\n $message = $this->encryptMessage($data);\n $sRet = $this->sendToSocket($remote_ip,$remote_port,$message);\n\n $retArr = json_decode($sRet,true);\n if($retArr[\"function\"] == 'gatewayDeleted'){\n //Uncomment for Production\n //Delete Devices based on Gateway\n $gateway->devices()->delete();\n $gateway->delete();\n $this->auditLogs($ip,$host,$module,$instruction);\n }else{\n $this->auditLogs($ip,$host,$module,'Cannot contact Gateway to be:'.$gateway->GATEWAY_NAME);\n return 'gateway';\n }\n\n return \"success\";\n }\n }else{\n $gateway->REG_FLAG = 9;\n $gateway->save();\n return \"success\";\n }\n\n }",
"function set_id($id)\r\n {\r\n $this->set_default_property(self :: PROPERTY_ID, $id);\r\n }",
"public function set($id, $instance);",
"public function setDestinationId($destinationId):void\r\n {\r\n $this->destinationId = $destinationId;\r\n }",
"function setId($id)\n\t{\n\t\t// Set suburb ID and wipe data\n\t\t$this->_id\t\t\t= $id;\n\t\t$this->_suburb\t= null;\n\t}",
"public function setID($id){\n $this->id=$id;\n }",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"function set_id($id)\n {\n $this->id = $id;\n }",
"public function setBillingProfileId($billing_profile_id);",
"function setGroupID( $groupID ) \n {\n $this->setValueByFieldName( 'navbargroup_id', $groupID);\n }",
"public function __call($gateway_name, array $data = array()) {\n\t\t\n\t\t$sdata = serialize($data);\n\t\tif(isset($this->_gateways[$gateway_name][$sdata]))\n\t\t\treturn $this->_gateways[$gateway_name][$sdata];\n\t\t\n\t\t$gateway = $this->getGateway($gateway_name);\n\t\t\n\t\tif($gateway instanceof self) {\n\t\t\t$gateway->setName($gateway_name);\n\t\t\t$gateway->setData($data);\n\t\t}\n\t\t\n\t\treturn $this->_gateways[$gateway_name][$sdata] = $gateway;\n\t}",
"function set_agreement_id($agreement_id)\n {\n $this->set_default_property(self :: PROPERTY_AGREEMENT_ID, $agreement_id);\n }",
"public function delete_gateway_device()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $file = new File(self::FILE_NETWORK);\n $file->delete_lines('/GATEWAYDEV=\\\".*\\\"/i');\n\n $interfaces = new Iface_Manager();\n $ethlist = $interfaces->get_interface_details();\n $wanif = \"\";\n\n foreach ($ethlist as $eth => $info) {\n if (isset($info['role']) && ($info['role'] == Role::ROLE_EXTERNAL)) {\n $wanif = $eth;\n break;\n }\n }\n\n if ($wanif)\n $this->set_gateway_device($wanif);\n }",
"function set_id($id)\n {\n $this->set_default_property(self :: PROPERTY_ID, $id);\n }",
"function set_client($client_id) {\n $this->_client_id_param = array(\"clientID\" => $client_id);\n }",
"public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}",
"protected function registerGateways()\n {\n $this->container['gateway.fastcgi'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\Gateway\\Fastcgi($c['dispatcher']);\n });\n\n $this->container['gateway.php-fpm'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\Gateway\\PhpFpm($c['dispatcher']);\n });\n }",
"public function getSourceGateway()\n {\n return $this->source_gateway;\n }"
]
| [
"0.7070939",
"0.7032529",
"0.69883823",
"0.6752199",
"0.6599843",
"0.654597",
"0.64548",
"0.62824106",
"0.60924757",
"0.60924757",
"0.6017569",
"0.59679115",
"0.5948079",
"0.57182544",
"0.56409574",
"0.56119275",
"0.55651915",
"0.55635893",
"0.5553248",
"0.5455811",
"0.5339118",
"0.5336203",
"0.52948576",
"0.52939916",
"0.52882975",
"0.52481544",
"0.522268",
"0.5197363",
"0.5192688",
"0.5158405",
"0.5118489",
"0.51157737",
"0.5112989",
"0.510541",
"0.5032417",
"0.49995908",
"0.496527",
"0.49550432",
"0.49509418",
"0.49234182",
"0.49149585",
"0.48776698",
"0.48723397",
"0.48588297",
"0.4850421",
"0.48484838",
"0.48466083",
"0.48432213",
"0.48414087",
"0.4828558",
"0.48192948",
"0.48151737",
"0.48025724",
"0.47975245",
"0.47960675",
"0.47874522",
"0.47775996",
"0.4770707",
"0.4770098",
"0.4761751",
"0.47565094",
"0.4743799",
"0.4740161",
"0.4731643",
"0.47313172",
"0.47248903",
"0.47187695",
"0.4691955",
"0.4686862",
"0.4685426",
"0.46753123",
"0.46751034",
"0.46739486",
"0.46604314",
"0.46594682",
"0.46555716",
"0.46335968",
"0.46335688",
"0.46301538",
"0.46289453",
"0.46264052",
"0.46110985",
"0.46102414",
"0.46069777",
"0.46056694",
"0.459458",
"0.45942694",
"0.45942694",
"0.45875725",
"0.45801136",
"0.4579156",
"0.45785373",
"0.45775875",
"0.45757094",
"0.45739263",
"0.45720237",
"0.45604503",
"0.45583013",
"0.45557144"
]
| 0.65958315 | 6 |
Set Recurring Schedule Sets the payment schedule | public function Schedule($interval, $free_trial = 0, $occurrences = FALSE, $start_date = FALSE, $end_date = FALSE) {
$this->Param('interval', $interval, 'recur');
if ($free_trial != 0) {
$this->Param('free_trial', $free_trial, 'recur');
}
if ($occurrences) {
$this->Param('occurrences', $occurrences, 'recur');
}
if ($start_date) {
$this->Param('start_date', $start_date, 'recur');
}
if($end_date) {
$this->Param('end_date', $end_date, 'recur');
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setRecurring($recurring)\n {\n $this->recurring = $recurring;\n\n return $this;\n }",
"public function setIsRecurring($isRecurring)\n {\n $this->isRecurring = $isRecurring;\n }",
"public function setSchedule($schedule)\n {\n $this->schedule = $schedule;\n }",
"public function chargeRecurringProfiles(Mage_Cron_Model_Schedule $schedule){\n\t\tif (!Mage::getStoreConfig('payment/gpndatarecurring/activecron'))\n\t\t\treturn false;\n\t\t\n\t\t$_resource = Mage::getSingleton('core/resource');\n\t\t$sql = '\n\t\t\tSELECT\n\t\t\t\tCASE srp.period_unit\n\t\t\t\t\tWHEN \"day\" \t\t\tTHEN FLOOR(DATEDIFF(NOW(), srp.updated_at) / srp.period_frequency)\n\t\t\t\t\tWHEN \"week\" \t\tTHEN FLOOR(FLOOR(DATEDIFF(NOW(), srp.updated_at) / 7) / srp.period_frequency)\n\t\t\t\t\tWHEN \"semi_month\" \tTHEN FLOOR(FLOOR(DATEDIFF(NOW(), srp.updated_at) / 14) / srp.period_frequency)\n\t\t\t\t\tWHEN \"month\" \t\tTHEN FLOOR(PERIOD_DIFF(DATE_FORMAT(NOW(), \"%Y%m\"), DATE_FORMAT(srp.updated_at, \"%Y%m\")) - (DATE_FORMAT(NOW(), \"%d\") < DATE_FORMAT(srp.updated_at, \"%d\")) / srp.period_frequency)\n\t\t\t\t\tWHEN \"year\" \t\tTHEN FLOOR(YEAR(NOW()) - YEAR(srp.updated_at) - (DATE_FORMAT(NOW(), \"%m%d\") < DATE_FORMAT(srp.updated_at, \"%m%d\")) / srp.period_frequency)\n\t\t\t\tEND\n\t\t\t\tAS billing_count,\n\t\t\t\tsrp.*\n\t\t\tFROM '.$_resource->getTableName('sales_recurring_profile').' AS srp\n\t\t\tWHERE\n\t\t\t\tsrp.method_code = \"gpndatarecurring\" AND\n\t\t\t\tsrp.state = \"active\" AND\n\t\t\t\tsrp.updated_at <= NOW() AND\n\t\t\t\tsrp.start_datetime <= NOW() AND\n\t\t\t\t(\n\t\t\t\t\t(\n\t\t\t\t\t\tsrp.start_datetime > srp.updated_at AND\n\t\t\t\t\t\tsrp.start_datetime <= NOW()\n\t\t\t\t\t)\n\t\t\t\t\tOR\n\t\t\t\t\t(\n\t\t\t\t\t\tsrp.start_datetime <= srp.updated_at AND\n\t\t\t\t\t\tNOW() >= CASE srp.period_unit\n\t\t\t\t\t\t\tWHEN \"day\" \t\t\tTHEN DATE_ADD(srp.updated_at, INTERVAL srp.period_frequency DAY)\n\t\t\t\t\t\t\tWHEN \"week\" \t\tTHEN DATE_ADD(srp.updated_at, INTERVAL srp.period_frequency WEEK)\n\t\t\t\t\t\t\tWHEN \"semi_month\" \tTHEN DATE_ADD(srp.updated_at, INTERVAL (srp.period_frequency * 2) WEEK)\n\t\t\t\t\t\t\tWHEN \"month\" \t\tTHEN DATE_ADD(srp.updated_at, INTERVAL srp.period_frequency MONTH)\n\t\t\t\t\t\t\tWHEN \"year\" \t\tTHEN DATE_ADD(srp.updated_at, INTERVAL srp.period_frequency YEAR)\n\t\t\t\t\t\tEND\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t';\n\t\t\n\t\t$connection = $_resource->getConnection('core_read');\n\t\t$recurring = Mage::getModel('gpndata/paymentrecurring');\n\t\t\n\t\tforeach ($connection->fetchAll($sql) as $profileArr) {\n\t\t\t\n\t\t\t$profile = Mage::getModel('sales/recurring_profile')->addData($profileArr);\n\t\t\t$orders = $profile->getResource()->getChildOrderIds($profile);\n\t\t\t$countBillingCycling = count($orders);\n\t\t\tif ($profile->getInitAmount())\n\t\t\t\t$countBillingCycling--;\n\t\t\t\n\t\t\tif ($profile->getBillFailedLater()){ // Auto Bill on Next Cycle\n\t\t\t\t// multi charges\n\t\t\t\tfor ($i = 0; $i < $profile->getBillingCount(); $i++){\n\t\t\t\t\tif ($recurring->chargeRecurringProfile($profile)){\n\t\t\t\t\t\t$countBillingCycling++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($profile->getPeriodMaxCycles() && $countBillingCycling >= $profile->getPeriodMaxCycles()){\n\t\t\t\t\t\t$profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_SUSPENDED);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// single charge\n\t\t\t\tif ($recurring->chargeRecurringProfile($profile))\n\t\t\t\t\t$countBillingCycling++;\n\t\t\t\t\n\t\t\t\tif ($profile->getPeriodMaxCycles() && $countBillingCycling >= $profile->getPeriodMaxCycles())\n\t\t\t\t\t$profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_SUSPENDED);\n\t\t\t}\n\t\t}\n }",
"public function setRecurringNumber($recurring_number);",
"public function setRevenueScheduleType(string $revenue_schedule_type): void\n {\n $this->_revenue_schedule_type = $revenue_schedule_type;\n }",
"protected function schedule(Schedule $schedule)\n {\n\n /**\n * Get next-available time from YunoJuno\n * and store it in the Settings table\n *\n * @return void\n */\n $schedule->call(function () {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://app.yunojuno.com/p/peabay');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');\n $page = curl_exec($ch);\n curl_close($ch);\n\n $page = preg_replace('/\\s+/', '', $page);\n preg_match('/\\<strong\\>Next\\ \\;Available\\:(.*?)\\<\\/strong\\>/', $page, $matches);\n $nextAvailable = count($matches) > 0 ? $matches[1] : 'Unavailable';\n $nextAvailable = str_replace(' ', ' ', $nextAvailable);\n $nextAvailable = strtotime($nextAvailable);\n\n if ($nextAvailable !== false) {\n \\App\\Models\\Settings::firstOrCreate(['name' => 'next_available']);\n \\App\\Models\\Settings::where('name', 'next_available')->update(['value' => $nextAvailable]);\n }\n })->hourly();\n }",
"protected function schedule(Schedule $schedule)\n { \n //Cambiar el estado de las pasantias a \"Cerrado\" cuando llegue la fecha de fin\n $schedule->call(function(){\n $pasantias = PropuestaPasantia::whereHas('estado', function($q){\n $q->where('nombre', 'Disponible');\n })->get();\n\n foreach($pasantias as $pasantia){\n $estado = Estado::where('nombre', 'Cerrado')->first();\n $today = date('d/m/Y', strtotime(Carbon::now()->toDateString()));\n if($pasantia->fecha_fin == $today){\n $pasantia->estado()->associate($estado);\n $pasantia->save();\n }\n }\n })->timezone('America/Argentina/Salta')->dailyAt('23:59');\n\n // Cambiar estado a 'No regular' de las presentaciones que no fueron regularizadas luego de 6 meses\n $schedule->call(new VerificarRegularidad)->timezone('America/Argentina/Salta')->dailyAt('00:00');\n }",
"protected function schedule(Schedule $schedule){\n\n $schedule->call(function(Cardinity $cardinity){\n\n /*\n $pdo = DB::getPdo();\n $res = $pdo->query('SELECT * FROM payments GROUP BY user_id DESC HAVING end_access_date <= CURDATE() ORDER BY end_access_date');\n\n $payments = $res->fetchAll(\\PDO::FETCH_CLASS, Payment::class);\n\n foreach($payments as $paymentDb){\n $user = User::where('id', $paymentDb->user_id)->first();\n\n if((bool)$user->is_subscription_renewable){\n $payment = $cardinity->renewSubscribe($paymentDb);\n SubscriptionController::successPayment($paymentDb->plan(), $payment, $user);\n }\n }\n */\n\n $users = User::where('is_email_valid', false)\n ->where('role', 'client')\n ->where('created_at', '<', Carbon::create()->addDay(-7)->format('Y-m-d H:i:s'))\n ->whereNull('start_subscribe_date')\n ->get();\n\n\n if(count($users) > 0) foreach($users as $user){\n $user->forceDelete();\n }\n\n// })->everyMinute();\n })->twiceDaily(1, 11);\n\n\n }",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n if(Schema::hasTable('subscriptions')) {\n $now = Carbon::Now('utc');\n $activeSubscription = Subscription::whereIn('status', ['ACTIVE', 'ON-HOLD'])->whereDate('end_date', '>', $now)->orWhere('end_date', null)->get();\n foreach($activeSubscription as $subscription) {\n $schedule->call(function() use ($subscription){\n // charge people subscription amount\n $subscription->chargeSubscriptionPrice('background');\n })->cron($subscription->cronFrequency());\n }\n }\n\n //Upcoming webinar reminder email\n $schedule->command('webinar:reminder')->everyMinute();\n }",
"public function set_recurring_period( $recurring_period, $recurring_period_type = self::RECUR_PERIOD_TYPE_DAYS ) {\n\t\t$this->payment['recurring_period'] = $recurring_period;\n\t\t$this->payment['recurring_period_type'] = $recurring_period_type;\n\t\t$this->update_meta( 'recurring_period', $this->payment['recurring_period'] );\n\t\t$this->update_meta( 'recurring_period_type', $this->payment['recurring_period_type'] );\n\t}",
"public function setSchedule($schedule = false) {\n if ($schedule === false) {\n return false;\n }\n\n if (!CronExpression::isValidExpression($schedule)) {\n throw new \\Exception(\"Invalid schedule, must use cronjob format\");\n }\n\n $this->schedule = CronExpression::factory($schedule);\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {amoController::setWaybills();})\n ->cron('0 0-23/3 * * *');\n $schedule->call(function () {amoController::getStatistics();})\n ->hourly();\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->command('revenue:update')\n ->everyTenMinutes();\n // $schedule->command('say:hello')\n // ->everyMinute();\n }",
"protected function _checkoutRecurring()\r\n {\r\n /** @var Mage_Sales_Model_Order $order */\r\n $order = Mage::getModel('sales/order');\r\n\r\n $item = new Varien_Object($this->_recurringProfile->getOrderItemInfo());\r\n\r\n $this->_price = $item->getBasePrice() * $item->getQty();\r\n\r\n $additionalInfo = $this->_recurringProfile->getAdditionalInfo();\r\n\r\n // check isset TrialBilling\r\n // Trial Billing Frequency <= 0 or isn't numeric => failure\r\n if ($this->_recurringProfile->getTrialBillingAmount()\r\n && $this->_recurringProfile->getTrialPeriodFrequency()\r\n && $this->_recurringProfile->getTrialPeriodMaxCycles()\r\n && $this->_recurringProfile->getTrialPeriodUnit()\r\n && (string)(int) $this->_recurringProfile->getTrialPeriodFrequency() === ltrim($this->_recurringProfile->getTrialPeriodFrequency(), '0')\r\n && (int) $this->_recurringProfile->getTrialPeriodFrequency() > 0\r\n ) {\r\n $trialPeriodMaxCycles = (int)$this->_recurringProfile->getTrialPeriodMaxCycles();\r\n if (!isset($additionalInfo['trialPeriodMaxCycles'])) {\r\n $additionalInfo['trialPeriodMaxCycles'] = $trialPeriodMaxCycles;\r\n $this->_recurringProfile->setAdditionalInfo($additionalInfo);\r\n $this->_price = $this->_recurringProfile->getTrialBillingAmount();\r\n $this->_periodType = Mage_Sales_Model_Recurring_Profile::PAYMENT_TYPE_TRIAL;\r\n }\r\n elseif (isset($additionalInfo['trialPeriodMaxCycles']) && $additionalInfo['trialPeriodMaxCycles'] > 0) {\r\n $this->_price = $this->_recurringProfile->getTrialBillingAmount();\r\n $this->_periodType = Mage_Sales_Model_Recurring_Profile::PAYMENT_TYPE_TRIAL;\r\n }\r\n }\r\n\r\n // calculate total amount\r\n $this->_shippingAmount = $item->getBaseShippingAmount();\r\n $this->_taxAmount = $item->getBaseTaxAmount();\r\n $this->_amount = $this->_price + $this->_shippingAmount + $this->_taxAmount;\r\n\r\n // init order\r\n /** @var Mage_Sales_Model_Order_Item $orderItem */\r\n $orderItem = Mage::getModel('sales/order_item')\r\n ->setName($item->getName())\r\n ->setSku($item->getSku())\r\n ->setDescription($item->getDescription())\r\n ->setQtyOrdered($item->getQty())\r\n ->setBasePrice($item->getBasePrice())\r\n ->setBaseTaxAmount($item->getBaseTaxAmount())\r\n ->setBaseRowTotalInclTax($item->getBaseRowTotalInclTax());\r\n\r\n $order->addItem($orderItem);\r\n\r\n $shippingInfo = $this->_recurringProfile->getShippingAddressInfo();\r\n $shippingAddress = Mage::getModel('sales/order_address')\r\n ->setData($shippingInfo)\r\n ->setId(null);\r\n\r\n // get base currency code\r\n $orderInfo = new Varien_Object($this->_recurringProfile->getOrderInfo());\r\n $currencyCode = $orderInfo->getBaseCurrencyCode();\r\n\r\n $order->setShippingAddress($shippingAddress);\r\n $order->setBaseCurrencyCode($currencyCode);\r\n\r\n /** @var Mage_Sales_Model_Order_Payment $payment */\r\n $payment = Mage::getModel('sales/order_payment');\r\n $payment->setOrder($order);\r\n $payment->setIsRecurring(true);\r\n $payment->setIsInitialFee(true);\r\n\r\n $customerId = $this->_recurringProfile->getCustomerId();\r\n $payment->setCustomerId($customerId);\r\n\r\n $tokenId = $additionalInfo['token']['saved_token'];\r\n $payment->setTokenId($tokenId);\r\n\r\n /** @var Eway_Rapid31_Model_Method_Saved $ewaySave */\r\n $ewaySave = Mage::getModel('ewayrapid/method_saved');\r\n\r\n $paymentAction = Mage::getStoreConfig('payment/ewayrapid_general/payment_action');\r\n if ($paymentAction == Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE) {\r\n $ewaySave->authorize($payment, $this->_amount);\r\n } elseif ($paymentAction == Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) {\r\n $ewaySave->capture($payment, $this->_amount);\r\n }\r\n if (!$payment->getTransactionId()) {\r\n throw new Exception('Transaction is not available');\r\n } else {\r\n $this->_txdId = $payment->getTransactionId();\r\n }\r\n /** @todo: change status of order = \"eWAY Authorised\"\r\n * now status order = \"processing\"\r\n */\r\n }",
"protected function schedule(Schedule $schedule): void\n {\n //\n }",
"protected function schedule(Schedule $schedule)\n\t{\n\t}",
"public function registerSchedule($schedule)\n {\n }",
"function Set_Scheduled_Payments($schedule, $structure, $module, $status, $merge=true)\n{\n\t$log = ECash::getLog('scheduling');\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\n\t$application_id = $structure->application_id;\n\t$transaction_type = $structure->payment_type;\n\n\t// Context is based on the type of payments the agent\n\t// set up for the customer. We use this for reporting\n\t// to determine if the payment is a collections payment, etc. \n\tswitch($transaction_type)\n\t{\n\t\tcase 'payment_arrangement':\n\t\t\t$context = 'arrangement';\n\t\t\tbreak;\n\t\tcase 'partial_payment':\n\t\t\t$context = 'partial';\n\t\t\tbreak;\n\t\tcase 'next_payment_adjustment':\n\t\tcase 'manual_payment':\n\t\t\t$context = 'manual';\n\t\t\tbreak;\n\t\tcase 'ad_hoc':\n\t\t\t$context = 'generated';\n\t\t\tbreak;\n\t}\n\t\n\tif(! $application = ECash::getApplicationById($application_id))\n\t{\n\t\tthrow new Exception(\"Cannot locate application $application_id\");\n\t}\n\n\t$graces = Get_Grace_Periods();\n\t$fees_applied = 0.0;\n\t$princ_applied = 0.0;\n\n\t$new_schedule = array();\n\n\t$base = $structure->payment_type;\n\t$num_payments = intval($structure->$base->num);\n\n\t$renewal = ECash::getFactory()->getRenewalClassByApplicationID($application_id);\n\t$balance_info = Fetch_Balance_Information($application_id);\n\n\t$balance = array(\n\t\t'principal' \t\t=> $balance_info->principal_pending,\n\t\t'fee' \t\t\t\t=> $balance_info->fee_pending,\n\t\t'service_charge' \t=> $balance_info->service_charge_pending,\n\t);\n\n\t$total_balance = array_sum($balance);\n\n\t$rules = $application->getBusinessRules();\n\t$rate_calc = $application->getRateCalculator();\n\t\n\t/**\n\t * Find the last date we're paid up till. We'll calculate from this point\n\t * up till the payment date.\n\t */\n\t$paid_to = Interest_Calculator::getInterestPaidPrincipalAndDate($schedule, FALSE, $rules);\n\t$paid_to_date = $paid_to['date'];\n\t\n\t$service_charge_type = $rules['service_charge']['svc_charge_type'];\n\t\n\tif(isset($rules['check_payment_type']))\n\t{\n\t\t$check_type = $rules['check_payment_type'];\n\t}\n\telse\n\t{\n\t\t$check_type = 'ACH';\n\t}\n\n\t$non_ach_array = array('adjustment_internal', 'credit_card', 'moneygram', 'money_order', 'western_union');\n \tif($check_type != 'ACH')\n {\n\t\t$non_ach_array[] = 'personal_check';\n }\n\n\tfor ($i = 0; $i < $num_payments; $i++)\n\t{\n\t\t$payment = $structure->$base->rows[$i];\n\t\t$payment_amount = floatval($payment->actual_amount);\n\t\t$due_date = date(\"Y-m-d\", strtotime($payment->date));\n\t\t$payment_type = $payment->payment_type;\n\n\t\t//Set the interest amount's initial value, grab it from the row.\n\t\t$interest_amount = floatval($payment->interest_amount);\n\t\t\n\t\t//Start building comments\n\t\t$agent = ECash::getAgent();\n\t\t$comment = \"[Payment created by \" . $agent->getFirstLastName() . \"]\";\t\t\n\t\tif (($payment->desc))\n\t\t{\n\t\t\t$comment .= \" \" . $payment->desc;\n\t\t}\n\n\t\t/**\n\t\t * If the payment type is non-ach, we use the same day as the due date.\n\t\t */\n\t\tif (in_array($payment_type, $non_ach_array))\n\t\t{\n\t\t\t$action_date = $due_date;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/**\n\t\t\t * We should already be doing input validation on the front-end to prevent due dates \n\t\t\t * for today or in the past, but just in case we'll try and handle it here.\n\t\t\t */\n\t\t\tif(strtotime($due_date) > strtotime(date('Y-m-d')) \n\t\t\t&& strtotime($pd_calc->Get_Last_Business_Day($due_date)) >= strtotime(date('Y-m-d')))\n\t\t\t{\n\t\t\t\t$action_date = $pd_calc->Get_Last_Business_Day($due_date);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$action_date = date('Y-m-d');\n\t\t\t}\n\t\t}\n\n\t\t//Do stuff that's specific to a service charge type\n\t\tswitch ($service_charge_type)\n\t\t{\n\t\t\tcase 'Daily':\n\t\t\t\t$interest_amount = $rate_calc->calculateCharge($balance['principal'], $paid_to_date, $due_date);\n\n\t\t\t\t// Don't accrue past default date\n\t\t\t\tif ($rules['loan_type_model'] == 'CSO')\n\t\t\t\t{\n\t\t\t\t\tif ($renewal->hasDefaulted($application_id))\n\t\t\t\t\t\t$interest_amount = 0.00;\n\t\t\t\t}\n\n\t\t\t\t//[#47687] dont use $structure->payment->interest_range(s) from the submit, use the calculated paid to interest date\n\t\t\t\t//If its not a manual payment, or the date is in the future, let's add an interest comment\n\t\t\t\tif ($interest_amount > 0 && ($base != 'manual_payment' || (strtotime($paid_to_date) < strtotime($due_date))))\n\t\t\t\t{\n\t\t\t\t\t$days_diff = Date_Util_1::dateDiff(strtotime($paid_to_date), strtotime($due_date));\n\t\t\t\t\t$comment .= \" [Service Charge includes Interest of $interest_amount for $days_diff days ({$paid_to_date} thru {$due_date})]\";\n\t\t\t\t\t$intcomment = \"Interest accrued for $days_diff days ({$paid_to_date} thru {$due_date})\";\n\t\t\t\t}\n\t\t\t\t//log the current balances before we modify the balances.\n\t\t\t\t$log->Write(\"Balances - P: {$balance['principal']} F: {$balance['fee']} INT: {$interest_amount} SC: {$balance['service_charge']} | AMT: $payment_amount\");\n\n\t\t\t\t//add interest to what is owed if the date is in the future Subtract amount from total balance\n\t\t\t\tif(((strtotime($paid_to_date) < strtotime($due_date))))\n\t\t\t\t{\n\t\t\t\t\t$balance['service_charge'] = bcadd($balance['service_charge'], $interest_amount, 2);\n\t\t\t\t\t$total_balance = bcadd($total_balance, $interest_amount, 2);\n\t\t\t\t\t$total_balance = bcsub($total_balance, $payment_amount, 2);\n\t\t\t\t}\n\n\t\t\t\t//allocate amounts! Amount allocation comes AFTER the adjustments are made\n\t\t\t\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance(-$payment_amount, $balance);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Fixed':\n\t\t\tdefault:\n\t\t\t\t//build fixed interest comments\n\t\t\t\t$comment .= \"[Fixed Service Charge]\";\n\t\t\t\t$intcomment = \"[Fixed Interest Charge]\";\n\n\t\t\t\t//Log the current balances before we modify the interest.\n\t\t\t\t$log->Write(\"Balances - P: {$balance['principal']} F: {$balance['fee']} INT: {$interest_amount} SC: {$balance['service_charge']} | AMT: $payment_amount\");\n\n\t\t\t\t//allocate amounts! We're allocating amounts BEFORE the adjustments are made!\n\t\t\t\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance(-$payment_amount, $balance);\n\n\t\t\t\t//We're not assessing a service charge on applications with fixed interest! [#31223]\n\t\t\t\t$interest_amount = 0;\n\t\t\t\t$log->Write(\"Fixed interest loan. Not assessing any interest\");\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (count($amounts))\n\t\t{\n\t\t\tif($base == 'manual_payment')\n\t\t\t{\n\t\t\t\t$effects_princ = false;\n\t\t\t\tforeach($amounts as $amount_balance)\n\t\t\t\t{\n\t\t\t\t\tif ($amount_balance->event_amount_type == 'principal' && abs($amount_balance->amount) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$effects_princ = true;\n\t\t\t\t\t\t$effected_princ_amount = abs($amount_balance->amount);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($interest_amount > 0 && ( $base != 'manual_payment' || (strtotime($paid_to_date) < strtotime($due_date))))\n\t\t\t{\n\t\t\t\t//Check and see if the date is the date of the next service charge\n\t\t\t\t//If it is, don't register a new charge. Complete the current one [Agean #11047]\n\t\t\t\t//If payment arrangments are redone for the same day exclude payment arrangments from this. I hate you so much, Will [#17906]\n\t\t\t\tif ($base != 'payment_arrangement' && $status->next_service_charge_date != 'N/A' && strtotime($status->next_service_charge_date) == strtotime($due_date) && strtotime($due_date) <= time())\n\t\t\t\t{\n\t\t\t\t\t//Complete the current service charge\n\t\t\t\t\t$trids = Record_Current_Scheduled_Events_To_Register($due_date, $application_id, $status->next_service_charge_id);\n\t\t\t\t\tforeach ($trids as $trid)\n\t\t\t\t\t{\n\t\t\t\t\t\tPost_Transaction($application_id, $trid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$log->Write( __FUNCTION__ . \" :: Adding Interest: \".$interest_amount);\n\t\t\t\t\t$intamounts = Array(Event_Amount::MakeEventAmount('service_charge', abs($interest_amount)));\n\t\t\t\t\t$event = Schedule_Event::MakeEvent($action_date, $action_date, $intamounts, 'assess_service_chg', $intcomment, 'scheduled');\n\t\t\t\t\t$new_schedule[] = $event;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$log->Write( __FUNCTION__ . \" :: Adding with payment event amounts: \".print_r($amounts, true));\n\t\t\t//non ach\n\t\t\tif (in_array($payment_type, $non_ach_array))\n\t\t\t{\n\t\t\t\t$event = Schedule_Event::MakeEvent($action_date, $due_date, $amounts, $payment_type, $comment, 'scheduled', $context);\n\t\t\t}\n\t\t\telse //ach\n\t\t\t{\n\t\t\t\t$event = Schedule_Event::MakeEvent($action_date, $due_date, $amounts, $payment_type, $comment, 'scheduled', $context);\n\t\t\t}\n\t\t\t$new_schedule[] = $event;\n\t\t}\n\n\t\tif(strtotime($due_date) > strtotime($last_payment)) $last_payment = $due_date;\n\n\t\t/**\n\t\t * Update the Paid to Date - This is where we start to calculate interest from\n\t\t * when there is more than one payment and we're using Daily Interest\t\t \n\t\t */ \n \t\t$paid_to_date = $due_date;\n\t}\n\n\tif (isset($structure->$base->discount_amount) &&\n\t\t(floatval($structure->$base->discount_amount) > 0.0))\n\t{\n\t\tif (($structure->$base->discount_desc))\n\t\t{\n\t\t\t$comment = $structure->$base->discount_desc;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$comment = \"Discount adjustment\";\n\t\t}\n\n\t\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance($structure->$base->discount_amount, $balance);\n\t\t$new_schedule[] = Schedule_Event::MakeEvent($last_payment, $last_payment, $amounts, 'adjustment_internal', $comment, 'scheduled', 'arrangement');\n\t}\n\n\tif ($merge)\n\t{\n\t\t$new_schedule = Merge_Schedules($schedule, $new_schedule);\n\t}\n\n\treturn $new_schedule;\n}",
"protected function schedule(Schedule $schedule)\n {\n //\n }",
"protected function schedule(Schedule $schedule)\n {\n //\n }",
"protected function schedule(Schedule $schedule)\n {\n //\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->command('reminder')\n ->hourly();\n \n $schedule->command('refresh:token')->dailyAt('00:30');\n }",
"public function testRecurringReassign() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'product_variation',\n 'unit_price' => [\n 'amount' => '100',\n 'currency_code' => 'USD',\n ],\n ]);\n /** @var \\Drupal\\commerce_recurring\\Entity\\RecurringInterface $recurring */\n $recurring = $this->createEntity('commerce_recurring', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'uid' => $this->loggedInUser->id(),\n 'order_items' => [$order_item],\n ]);\n\n $this->assertTrue($recurring->hasLinkTemplate('reassign-form'));\n\n $this->drupalGet($recurring->toUrl('reassign-form'));\n $this->getSession()->getPage()->fillField('customer_type', 'new');\n $this->waitForAjaxToFinish();\n\n $values = [\n 'mail' => 'commerce_recurring@example.com',\n ];\n $this->submitForm($values, 'Reassign recurring');\n\n $this->assertEquals($recurring->toUrl('collection', ['absolute' => TRUE])->toString(), $this->getSession()->getCurrentUrl());\n\n // Reload the recurring.\n \\Drupal::service('entity_type.manager')->getStorage('commerce_recurring')->resetCache([$recurring->id()]);\n $recurring = Recurring::load($recurring->id());\n $this->assertEquals($recurring->getOwner()->getEmail(), 'commerce_recurring@example.com');\n $this->assertEquals($recurring->getEmail(), 'commerce_recurring@example.com');\n }",
"public function setSchedule ()\n {\n $this->loadComponent('DateTime');\n $this->loadModel('ScheduleTime');\n $data = $this->Auth->user();\n $id_fortune = $data['id'];\n $days = $this->DateTime->allDayInWeek();\n $months = $this->DateTime->allDayInMonth();\n $times = $this->ScheduleTime->getListTime();\n if ($this->Check->isId($id_fortune)) {\n $this->set([\n 'times' => $times,\n 'days' => $months,\n 'id' => $id_fortune\n ]);\n } else{\n $this->Flash->error(__('Id not found'));\n }\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {\n\n $unassigned_orders = Order::where('status','New')->get();\n foreach($unassigned_orders as $order){\n $pharmacies = Pharmacy::where('area_id',$order->address->area_id)->get();\n if( empty($pharmacies->first()) ){continue;}\n $pharmacy = $pharmacies->sortBy('priority')->first();\n\n $order->update([\n 'pharmacy_id' => $pharmacy->id,\n 'status' => 'Processing',\n ]);\n }\n })->everyminute();\n }",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n\n $schedule->call(function () {\n\n $Capitals=Capital::where([['has_ended',0],['has_requested',0],['has_confirmed_payment',1],['has_reinvested',0]])->get();\n\n foreach ($Capitals as $Capital) {\n \n $Profits=$Capital->profit;\n\n $count_profit=$Profits->count();\n\n //get roi period\n $roi_period=Config::where('id',1)->first()->roi_period;\n\n if($count_profit>=$roi_period){continue;}\n\n //allocate daily profit\n //get roi value\n $roi_value=Config::where('id',1)->first()->roi_value;\n\n $invested_capital=$Capital->amount;\n\n $daily_roi=($roi_value/100)*$invested_capital;\n\n $profit=new Profit;\n\n $profit->user_id=$Capital->user->id;\n\n $profit->capital_id=$Capital->capital->id;\n\n $profit->amount=$daily_roi;\n\n $profit->has_requested=0;\n\n $profit->has_paid=0;\n\n $profit->automate=0;\n\n $profit->save();\n\n }\n\n //DB::table('recent_users')->delete();\n })->everyMinute();;\n\n\n\n }",
"public function setAllowCustomAssignmentSchedule($val)\n {\n $this->_propDict[\"allowCustomAssignmentSchedule\"] = $val;\n return $this;\n }",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n $schedule->call('App\\Http\\Controllers\\RequestKPController@rejectExpiredRequests')\n ->daily();\n $schedule->call('App\\Http\\Controllers\\RequestSkripsiController@rejectExpiredRequests')\n ->daily();\n\n // steven add new\n // kp\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangKPController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangKPController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // skripsi\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangSkripsiController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangSkripsiController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // tesis\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangTesisController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangTesisController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // hard cover kp, skripsi, tesis api to store db every daily\n // on going status\n // validated status\n // first ongoing \n $schedule->call('App\\Http\\Controllers\\AdminHardcoverKPController@storeOngoingHardcoverKPByAPI')\n // ->daily();\n ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverSkripsiController@storeOngoingHardcoverSkripsiByAPI')\n // ->daily();\n ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverTesisController@storeOngoingHardcoverTesisByAPI')\n ->daily();\n // ->everyMinute();\n // second validated\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverKPController@storeValidateHardcoverKPByAPI')\n ->daily();\n // ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverSkripsiController@storeValidateHardcoverSkripsiByAPI')\n ->daily();\n // ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverTesisController@storeValidateHardcoverTesisByAPI')\n ->daily();\n // ->everyMinute(); \n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->call(function (){\n $users=Destinatario::all();\n\n //insertar usuarios de base de datos para poder el boletin cada mes//\n //funcion para enviar el correo\n //me envia el correo dependiendo de las personas\n foreach ($users as $user){\n Mail::to($user->correo)->send(new \\App\\Mail\\Boletin());\n }\n })->monthlyOn(15,'15:35');\n }",
"function nhymxu_weekly_cron_job_recurrence( $schedules ) {\n\t$schedules['weekly'] = array(\n\t\t'display' => 'weekly',\n\t\t'interval' => 604800,\n\t);\n\treturn $schedules;\n}",
"protected function schedule(Schedule $schedule)\n {\n $schedule->command('morning_schedule')->dailyAt('7:00');\n }",
"protected function schedule(Schedule $schedule)\n {\n $this->schedule = $schedule;\n\n $this->__scheduleCrawlProxy();\n $this->__scheduleCleanProxy();\n $this->__scheduleScrapeWebCategory();\n $this->__scheduleScrapeWebProduct();\n $this->__scheduleUpdateWebCategory();\n $this->__scheduleUpdateWebProduct();\n// $this->__scheduleHorizonSnapshot();\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->command('notify:rehabilitations')->twiceDaily(1, 22);\n }",
"public function clear_recurring_period(){\n\t\t$this->payment['recurring_period'] = null;\n\t\t$this->payment['recurring_period_type'] = null;\n\t\t$this->update_meta( 'recurring_period', $this->payment['recurring_period'] );\n\t\t$this->update_meta( 'recurring_period_type', $this->payment['recurring_period_type'] );\n\t}",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n $schedule->command('init:attendance')->monthlyOn(1);\n }",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n $schedule->command('openexchangerates:sync')->dailyAt('16:00')->withoutOverlapping();\n $schedule->command('reservations:room:schedule-reminder')->everyMinute()->withoutOverlapping();\n $schedule->command('subscriptions:reset-complimentary')->dailyAt('16:00')->between('16:00', '18:00')->everyMinute()->withoutOverlapping();\n \n if(config('features.subscription.invoice')) {\n \t\n\t $schedule->command('subscriptions:generate-invoice')->dailyAt('17:00')->between('17:00', '19:00')->everyFiveMinutes()->withoutOverlapping();\n\t $schedule->command('subscriptions:pay-invoice')->dailyAt('20:00')->between('20:00', '23:00')->everyTenMinutes()->withoutOverlapping();\n\t \n }\n\n //$schedule->command('recommendations:job')->hourly()->withoutOverlapping();\n\n $schedule->command('recommendations:business-opportunity')->cron('*/15 * * * *')->withoutOverlapping();\n\n $schedule->command('broadcasts:activity')->everyMinute()->withoutOverlapping();\n $schedule->command('clear:group')->dailyAt('16:00')->everyFiveMinutes()->withoutOverlapping();\n\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->call(function(){\n $orders = order::where('approved', 'pending')->get();\n foreach ($orders as $order) {\n $order->approved = 'cancelled';\n $order->save();\n }\n })->daily();\n\n $schedule->call(function(){\n $orders = Order::whereNotNull('until')->get();\n foreach ($orders as $order) {\n $service = Service::where('cost', $order->amount)->first();\n $username = $order->username;\n if (Carbon::parse(now())->diffInDays($order->until, false) <= 0) {\n \tif (is_null($order->until)) {\n\t\t\t\t\t\t$until = \"NULL\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$until = $order->until;\n\t\t\t\t\t\t$order->until = null;\n\t\t\t\t\t\t$order->save();\n\t\t\t\t\t\tLog::debug('Neteko Paslaugos: ' . $username . '---'. $service->name);\n\t\t\t\t\t}\n\n\t\t\t\t\t$host = env('Server_IP');\n\t $port = env('Server_PORT');\n\t $password = env('Server_PASS');\n\t $timeout = 3;\n\t $rcon = new Rcon($host, $port, $password, $timeout);\n\n\t if ($rcon->connect()){\n\n \t$rcon->sendCommand('pex user '.$username. 'group set lavonas'); \n \t$rcon->sendCommand('broadcast '.$username. ' Neteko paslaugos, nes jos galiojimas pasibaigė');\n \t\n \t}\n\t\t\t\t}\n\t\t\t}})->daily();\n\n $schedule->call(function(){\n $orders = Order::where('approved', 'done')->whereNull('until')->where('service_name', '!=', 'atleiskit')->delete();\n $orders2 = Order::where('approved', 'cancelled')->delete();\n })->weeklyOn(1, '7:00');;\n\n }",
"protected function schedule(Schedule $schedule)\n {\n // process day subscriptions at end of day\n // - if no event add noTip\n // - archive subscriptions\n // - activate waiting subscriptions\n // - set package section\n $schedule->call(function() {\n new \\App\\Http\\Controllers\\Cron\\ProcessDaysSubscription();\n })->timezone('GMT')->dailyAt('00:01');\n\n // send for email_schedule each minute\n $schedule->call(function() {\n new \\App\\Http\\Controllers\\Cron\\SendMail();\n })->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n\t{\n\t\t// $schedule->command(static::class)->everyMinute();\n\t}",
"public function schedule(Schedule $schedule): void\n\t{\n\t\t// $schedule->command(static::class)->everyMinute();\n\t}",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n // $schedule->command('mail:reminder')->everyMinute();\n \n // Scheduled mail to users to remind them it's the day orders are going to be send.\n $schedule->command('mail:reminder')->weekly()->sundays()->at('9:00');\n $schedule->command('mail:reminder')->weekly()->wednesdays()->at('9:00');\n\n // Scheduled mail to cyclist to remind him/her they are next on the schedule to go and pick up the orders.\n $schedule->command('mail:cyclist')->weekly()->mondays()->at('18:00');\n $schedule->command('mail:cyclist')->weekly()->thursdays()->at('18:00');\n\n // $schedule->command('mail:cyclist')->everyMinute();\n\n }",
"protected function schedule(Schedule $schedule)\n {\n // Fila de execuções do site programada\n $schedule->command('queue:work')->everyMinute();\n // Atualiza Ratings dos animes e mangás do site todos os dias.\n $schedule->call(function () {\n DB::table('animes')->join('lista_usuarios_animes','animes.id','=','lista_usuarios_animes.id_anime')\n //->where('animes.id','=', 'lista_usuarios_animes.id_anime')\n ->update([\n 'animes.totaln' => DB::raw('(select sum(MiX_lista_usuarios_animes.voto) from MiX_lista_usuarios_animes where \n MiX_lista_usuarios_animes.id_anime = MiX_animes.id AND (MiX_lista_usuarios_animes.voto != 0) )')\n ,'animes.totalv' => DB::raw('(select count(voto) from MiX_lista_usuarios_animes where \n MiX_lista_usuarios_animes.id_anime = MiX_animes.id AND (MiX_lista_usuarios_animes.voto != 0) )')]);\n })->timezone('America/Recife')->dailyAt('04:00'); //daily\n }",
"protected function schedule(Schedule $schedule)\n {\n // 15分钟关闭没有支付的订单\n $schedule->call(function () {\n Order::where('status', 'wait')->where('created_at', '<', now()->subMinute(15))->update(['status' => 'close']);\n })->everyFifteenMinutes();\n\n // 5分钟游记通过审核\n $schedule->call(function () {\n Travel::where('status', 'audit')->where('updated_at', '<', now()->subMinute(5))->chunk(100, function ($travels) {\n foreach ($travels as $travel) {\n $travel->update(['status' => 'adopt']);\n event(new TravelStatusChange($travel));\n }\n });\n })->everyFiveMinutes();\n }",
"public function setSchedule($schedule)\n\t{\n\t\tif ($schedule === '') {\n\t\t\t$schedule = '* * * * * *';\n\t\t} elseif ($schedule === null) {\n\t\t\t$this->_schedule = $schedule;\n\t\t\treturn;\n\t\t}\n\t\t$schedule = trim($schedule);\n\t\t$this->_schedule = $schedule;\n\t\t$this->_attr = [];\n\t\tif (strlen($schedule) > 1 && $schedule[0] == '@') {\n\t\t\tif (is_numeric($triggerTime = substr($schedule, 1))) {\n\t\t\t\t$this->_triggerTime = (int) $triggerTime;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (self::$_validatorCache) {\n\t\t\t$minuteValidator = self::$_validatorCache['m'];\n\t\t\t$hourValidator = self::$_validatorCache['h'];\n\t\t\t$domValidator = self::$_validatorCache['dom'];\n\t\t\t$monthValidator = self::$_validatorCache['mo'];\n\t\t\t$dowValidator = self::$_validatorCache['dow'];\n\t\t\t$yearValidator = self::$_validatorCache['y'];\n\t\t\t$fullValidator = self::$_validatorCache['f'];\n\t\t} else {\n\t\t\t$minute = '(?:[0-9]|[1-5][0-9])';\n\t\t\t$minuteStar = '\\*(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$minuteRegex = $minute . '(?:\\-(?:[1-9]|[1-5][0-9]))?(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$hour = '(?:[0-9]|1[0-9]|2[0-3])';\n\t\t\t$hourStar = '\\*(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$hourRegex = $hour . '(?:\\-(?:[1-9]|1[0-9]|2[0-3]))?(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$dom = '(?:(?:[1-9]|[12][0-9]|3[01])W?)';\n\t\t\t$domWOW = '(?:[1-9]|[12][0-9]|3[01])';\n\t\t\t$domStar = '\\*(?:\\/(?:[1-9]|[12][0-9]|3[01]))?';\n\t\t\t$domRegex = '(?:' . $dom . '(?:\\-' . $dom . ')?(?:\\/' . $domWOW . ')?|' . '(?:L(?:\\-[1-5])?)' . ')';\n\t\t\t$month = '(?:[1-9]|1[012]|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][1] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][2] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][3] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][4] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][5] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][6] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][7] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][8] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][9] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][10] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][11] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][12] . ')';\n\t\t\t$monthStar = '\\*(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$monthRegex = $month . '(?:\\-' . $month . ')?(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$dow = '(?:[0-6]|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][0] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][1] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][2] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][3] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][4] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][5] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][6] . ')';\n\t\t\t$dowStar = '\\*(?:\\/[0-6])?';\n\t\t\t$dowRegex = '(?:[0-6]L|' . $dow . '(?:(?:\\-' . $dow . ')?(?:\\/[0-6])?|#[1-5])?)';\n\t\t\t$year = '(?:19[7-9][0-9]|20[0-9][0-9])';\n\t\t\t$yearStar = '\\*(?:\\/[0-9]?[0-9])?';\n\t\t\t$yearRegex = $year . '(?:\\-' . $year . ')?(?:\\/[0-9]?[0-9])?';\n\t\t\t$fullValidator = '/^(?:(@(?:annually|yearly|monthly|weekly|daily|hourly))|' .\n\t\t\t\t'(?#minute)((?:' . $minuteStar . '|' . $minuteRegex . ')(?:\\,(?:' . $minuteStar . '|' . $minuteRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#hour)((?:' . $hourStar . '|' . $hourRegex . ')(?:\\,(?:' . $hourStar . '|' . $hourRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoM)(\\?|(?:(?:' . $domStar . '|' . $domRegex . ')(?:,(?:' . $domStar . '|' . $domRegex . '))*))[\\s]+' .\n\t\t\t\t'(?#month)((?:' . $monthStar . '|' . $monthRegex . ')(?:\\,(?:' . $monthStar . '|' . $monthRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoW)(\\?|(?:' . $dowStar . '|' . $dowRegex . ')(?:\\,(?:' . $dowStar . '|' . $dowRegex . '))*)' .\n\t\t\t\t'(?#year)(?:[\\s]+' .\n\t\t\t\t\t'((?:' . $yearStar . '|' . $yearRegex . ')(?:\\,(?:' . $yearStar . '|' . $yearRegex . '))*)' .\n\t\t\t\t')?' .\n\t\t\t')$/i';\n\n\t\t\t$minuteValidator = '/^(\\*|' . $minute . ')(?:\\-(' . $minute . '))?(?:\\/(' . $minute . '))?$/i';\n\t\t\t$hourValidator = '/^(\\*|' . $hour . ')(?:\\-(' . $hour . '))?(?:\\/(' . $hour . '))?$/i';\n\t\t\t$domValidator = '/^(\\*|\\?|L|' . $domWOW . ')(W)?(?:\\-(' . $domWOW . ')(W)?)?(?:\\/(' . $domWOW . '))?$/i';\n\t\t\t$monthValidator = '/^(\\*|' . $month . ')(?:\\-(' . $month . '))?(?:\\/(' . $month . '))?$/i';\n\t\t\t$dowValidator = '/^(\\*|\\?|' . $dow . ')(L)?(?:\\-(' . $dow . ')(L)?)?(?:\\/(' . $dow . '))?(?:#([1-5]))?$/i';\n\t\t\t$yearValidator = '/^(\\*|' . $year . ')(?:\\-(' . $year . '))?(?:\\/([1-9]?[0-9]))?$/i';\n\t\t\tself::$_validatorCache = [\n\t\t\t\t\t'm' => $minuteValidator,\n\t\t\t\t\t'h' => $hourValidator,\n\t\t\t\t\t'dom' => $domValidator,\n\t\t\t\t\t'mo' => $monthValidator,\n\t\t\t\t\t'dow' => $dowValidator,\n\t\t\t\t\t'y' => $yearValidator,\n\t\t\t\t\t'f' => $fullValidator,\n\t\t\t\t];\n\t\t}\n\n\t\t$i = 0;\n\t\tdo {\n\t\t\tif (!preg_match($fullValidator, $schedule, $matches)) {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $schedule);\n\t\t\t}\n\t\t\tif ($matches[1]) {\n\t\t\t\tforeach (self::$_intervals as $interval => $intervalSchedule) {\n\t\t\t\t\tif ($interval == $matches[1]) {\n\t\t\t\t\t\t$schedule = $intervalSchedule;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($matches[1]);\n\n\t\t$this->_attr[self::MINUTE] = [];\n\t\tforeach (explode(',', $matches[2]) as $match) {\n\t\t\tif (preg_match($minuteValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['min' => 0, 'end' => 59];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['min' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $data['min'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 59; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MINUTE][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::HOUR] = [];\n\t\tforeach (explode(',', $matches[3]) as $match) {\n\t\t\tif (preg_match($hourValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['hour' => 0, 'end' => 23];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['hour' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 23; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::HOUR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_MONTH] = [];\n\t\tforeach (explode(',', $matches[4]) as $match) {\n\t\t\tif (preg_match($domValidator, $match, $m2)) {\n\t\t\t\t$data = ['dom' => $m2[1]]; // *, ?, \\d, L\n\t\t\t\t$data['domWeekday'] = $m2[2] ?? null;\n\t\t\t\t$data['end'] = $m2[3] ?? ($m2[1] != 'L' ? $m2[1] : null);\n\t\t\t\t//$data['endWeekday'] = $m2[4] ?? null;\n\t\t\t\t$data['endWeekday'] = $m2[4] ?? (($m2[3] ?? null) ? null : $data['domWeekday']);\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 31; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_MONTH][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::MONTH_OF_YEAR] = [];\n\t\tforeach (explode(',', $matches[5]) as $match) {\n\t\t\tif (preg_match($monthValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['moy' => 1, 'end' => 12];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['moy' => (int) $this->translateMonthOfYear($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[2]) && $m2[2]) ? (int) $this->translateMonthOfYear($m2[2]) : $data['moy'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 12; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MONTH_OF_YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_WEEK] = [];\n\t\tforeach (explode(',', $matches[6]) as $match) {\n\t\t\tif (preg_match($dowValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*' || $m2[1] === '?') {\n\t\t\t\t\t$data = ['dow' => 0, 'end' => 6];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['dow' => (int) $this->translateDayOfWeek($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[3]) && $m2[3]) ? (int) $this->translateDayOfWeek($m2[3]) : $data['dow'];\n\t\t\t\t}\n\t\t\t\t$data['lastDow'] = $m2[2] ?? null;\n\t\t\t\t$data['lastEnd'] = $m2[4] ?? null;\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\t$data['week'] = $m2[6] ?? null;\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 6; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_WEEK][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::YEAR] = [];\n\t\t$matches[7] ??= '*';\n\t\tforeach (explode(',', $matches[7]) as $match) {\n\t\t\tif (preg_match($yearValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['year' => self::YEAR_MIN];\n\t\t\t\t\t$data['end'] = self::YEAR_MAX;\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['year' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = self::YEAR_MAX; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\t}",
"protected function schedule(Schedule $schedule)\n {\n {\n $schedule->call(function(){\n\n $usersArray = [];\n $invoices = Invoice::where('is_paid', '0')\n ->where('is_sent','0')\n ->where('last_pay_day', '<=' , Carbon::now()->addDay(1))->get();\n\n foreach ($invoices as $invoice) {\n $invoice->is_sent = 1;\n $invoice->save();\n $usersArray[$invoice->user->id] = $invoice->user;\n }\n foreach ($usersArray as $user) {\n \\Event::fire(new SmsEvent($user));\n }\n return true;\n })->everyFiveMinutes();\n }\n }",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')->hourly();\n //* Du lieu chay that\n $schedule->command('weekView:reset')->weekly();\n $schedule->command('monthView:reset')->monthly();\n $schedule->command('yearView:reset')->yearly();\n\n //* Du lieu chay thu\n // $schedule->command('dayView:reset')->everyMinute();\n // $schedule->command('monthView:reset')->everyTwoMinutes();\n // $schedule->command('yearView:reset')->everyThreeMinutes();\n }",
"protected function schedule(Schedule $schedule)\n {\n// $schedule->command('regverification:clean')\n// ->daily();\n// $schedule->command('activity:begin:remind')\n// ->dailyAt('12:30');\n// $schedule->command('teammember:report:pendingenrollmentrequests')\n// ->dailyAt('22:00');\n// // not need to remind\n//// $schedule->command('activity:report:pendingalbumimages')\n//// ->dailyAt('09:10');\n// $schedule->command(\"storage:tmp:clean -e '3 days'\")\n// ->dailyAt('03:00');\n// $schedule->command(\"attendant:export -l gaoxin_attendants -t yuandingshan@jh008.com\")\n// ->dailyAt('08:00');\n }",
"public function setSchedule(Schedule $schedule): UpdateScheduleService\n {\n $this->schedule = $schedule;\n return $this;\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->command('notify:endrbtcontent')->daily();\n $schedule->command('notify:endcontractrenew')->daily();\n $schedule->command('notify:roadmapstartdate')->daily();\n $schedule->command('contract:auto_renew')->daily();\n\n\n $schedule->command('notify:endcontract')->weeklyOn(1, '8:00'); //weekly each monday at 10:00\n $schedule->command('notify:attachments')->weeklyOn(1, '08:15'); //weekly each monday at 10:15\n\n // $schedule->command(\"queue:work --tries=3 --daemon\");\n\n }",
"protected function schedule(Schedule $schedule)\n {\n $hour = date('h');\n if($hour%2 == 0)\n $exec = 1;\n else\n $exec = 0;\n\n switch ($exec) {\n case 1:\n $schedule->call('App\\Http\\Controllers\\CronController@getRefreshAccessToken')->hourly();\n $schedule->call('App\\Http\\Controllers\\CronController@projects')->hourly();\n break;\n case 0:\n $schedule->call('App\\Http\\Controllers\\CronController@getRefreshAccessToken')->hourly();\n $schedule->call('App\\Http\\Controllers\\CronController@subTasks')->hourly();\n break;\n default:\n break;\n }\n\n $schedule->call('App\\Http\\Controllers\\CronController@sendWeeklyMail')->saturdays()->at('04:30');\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->command('tarea:clientecumpleanios')->dailyAt('9:01');\n $schedule->command('tarea:soatvencido')->dailyAt('9:01');\n $schedule->command('tarea:reviciontecnicavencida')->dailyAt('9:01');\n $schedule->command('tarea:licenciavencido')->dailyAt('9:01');\n $schedule->command('tarea:cambioaciete')->everyMinute();\n $schedule->command('tarea:cambioaceitex2')->cron('0 */72 * * *');\n }",
"public function setSchedule(?GovernanceSchedule $value): void {\n $this->getBackingStore()->set('schedule', $value);\n }",
"protected function schedule(Schedule $schedule)\n {\n //$schedule->command('clickm')->everyMinute();\n }",
"protected function schedule(Schedule $schedule) // elimino ogni settimana gli indirizzi che non hanno più un utente o uno shipment, stessa cosa con le carte di credito per utenti e invoices\n {\n $schedule->call( \n function () \n {\n $addresses = Address::all();\n $users = User::all();\n $shipments = Shipment::all();\n $add_ids = $addresses->pluck('id');\n $users_ids = $users->pluck('address_id');\n $ship_ids = $shipments->pluck('address_id');\n\n $add_ids = $add_ids->diff($users_ids);\n $add_ids = $add_ids->diff($ship_ids);\n\n Address::destroy( $add_ids );\n\n\n $invoices = Invoice::all();\n $creditCards = CreditCard::all();\n $cardIds = $creditCards->pluck('id');\n $invIds = $invoices->pluck('credit_card_id');\n\n $cardIds = $cardIds->diff($invIds);\n \n foreach ($cardIds as $cardId) \n {\n $card = CreditCard::find($cardId);\n if ( $card->user_id == NULL ) $card->delete();\n }\n })->weekly()->timezone('Europe/Rome');//->everyMinute();\n }",
"public function setStartAndDueDateTime(?WorkbookDocumentTaskSchedule $value): void {\n $this->getBackingStore()->set('startAndDueDateTime', $value);\n }",
"protected function schedule(Schedule $schedule)\n {\n // Get the start time\n $started = date('h:i:s');\n\n if (config('app.env') === 'prod') {\n // At 6am, fire off the job to grab all the data for that year.\n $schedule->job(new FetchAppData($started))->dailyAt('06:00');\n\n // And once again at 6pm for redundancy, just in case.\n $schedule->job(new FetchAppData($started))->dailyAt('18:00');\n }\n\n if (config('app.env') === 'dev') {\n // Do it once in the middle of the night also for the dev DB.\n $schedule->job(new FetchAppData($started))->dailyAt('01:00');\n }\n\n // Once a year on August 1st at 12:00am, move the current academic year\n // setting to whatever the current year is.\n $schedule->job(new SetAcademicYear())->cron('0 0 1 8 *');\n }",
"protected function schedule(Schedule $schedule)\n {\n\n\n // $billerId = JosPostpaid::select('billerRequestId')->orderBy('requestId','desc')->first();\n // $response = $schedule->command(Http::withHeaders([\n // 'MAC' => '632b046efead2c90494545b4c0a526d7e7545ca65ec6494119cd10dba8eb387b',\n // 'CLIENT_CODE' => 'CAPRI-DWTH8PYN9N3F',\n // ])->post('http://132.145.231.191/vasb2b/dev/Api/query',[\n // 'id' => $billerId,\n // ]))->everyFiveMinutes();\n\n\n // $billerId = Prepaid::select('billerRequestId')->orderBy('id','desc')->first();\n $billerId = DB::table('prepaid_payment_histories')->select('requestId')->where(['status' => 'PENDING'])->first();\n\n \n // dd($billerId->billerRequestId,$billerId->phone);\n $response = $schedule->command(Http::withHeaders([\n 'MAC' => '632b046efead2c90494545b4c0a526d7e7545ca65ec6494119cd10dba8eb387b',\n 'CLIENT_CODE' => 'CAPRI-DWTH8PYN9N3F',\n ])->post('http://132.145.231.191/vasb2b/dev/Api/query',[\n 'id' =>$billerId->requestId,\n ]))->everyFiveMinutes()\n ->sendOutPutTo('localhost/Ebill/services/file.txt');\n\n \n // $schedule->command('inspire')->hourly();\n }",
"protected function schedule(Schedule $schedule)\n {\n\n /* Funciona */ \n $schedule->command('usuarios:cumples')->timezone('America/Lima')->at('08:00');\n\n $schedule->command('estado:cumples')->timezone('America/Lima')->at('08:00');\n \n $schedule->command('active:cumples')->timezone('America/Lima')->monthly(); \n $schedule->command('deleted:comcumple')->timezone('America/Lima')->monthly(); \n $schedule->command('deleted:tarjeta')->timezone('America/Lima')->monthly(); \n\n\n $schedule->command('estado:conferencias')->timezone('America/Lima')->hourly();\n\n \n }",
"public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyFiveMinutes();\n }",
"public function schedule(Schedule $schedule)\n {\n // $schedule->command(static::class)->everyMinute();\n }",
"protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')->everyMinute();\n// $schedule->command('process:timers')->everyMinute();\n// $schedule->command('travel_sender')->everyFiveMinutes();\n// $schedule->command('travel_cleaner')->everyFiveMinutes();\n// $schedule->command('auction:purchases')->everyFiveMinutes();\n//\n }",
"protected function schedule(Schedule $schedule)\n {\n\n $schedule->call(function () {\n $appointment = Appointment::get();\n for ($i = 0; $i < sizeof($appointment); $i++) {\n $appointObject = $appointment[$i]; // 약속 객체 한개\n $cur_time = new \\DateTime(); // 현재 시간\n $appoint_date = new \\DateTime($appointObject->date . ' ' . $appointObject->date_time); // 약속 날짜\n $date_gap = date_diff($cur_time, $appoint_date); // 현재 시간과 약속 시간의 차이\n if ($date_gap->invert == 1) { // 현재 시간이 약속 시간을 지난 경우 -> 약속 종료 상태로 변경\n if ($appointObject->status == 1) {\n $member = Member::where('Member.appointment_id', $appointObject->id)->get();\n //약속 멤버 모두에게 약속 종료 알림 보내기\n foreach ($member as $object) {\n $user = User::find($object->user_id);\n $user->latitude = 0;\n $user->longitude = 0;\n if ($object->success == 0) {\n $object->Fine_final = $object->Fine_current;\n }\n $user->save();\n\n $object->save();\n }\n\n// NotificationController::SendGameNotification($appointObject->id,$date_gap->h * 60 + $date_gap->i,0,100,$pageTime,array()); //push 알람 보내기\n }\n $appointObject->status = 2; //status가 0이든 1이든 종료상태로\n } else { // 약속 시작 전 또는 진행 중\n\n // 초 단위 차이\n $time_gap = $date_gap->h * 60 * 60 + $date_gap->i * 60 + $date_gap->s;\n // 설정된 타이머(초)\n $timer = 120 * 60; //2시간\n\n\n // 총 게임 진행 시간(초)\n $totalGameTime = $timer;\n // **약속 실행전**\n if ($appointObject->status == 0) {\n if ($date_gap->days == 0) { // 현재 날짜와 같음\n\n if ($time_gap <= $totalGameTime) {\n // 시작 상태로 변경하기\n $appointObject->status = 1;\n $appointObject->radius = 20000;\n\n }\n }\n } // **약속 실행중**\n else {\n\n\n $appointObject->radius = $appointObject->radius - ((20000 / $timer) * 60);\n if ($appointObject->radius < 100)\n $appointObject->radius = 100; //100미터까지\n\n $member = Member::join('users', 'Member.user_id', '=', 'users.id')->where('Member.appointment_id', $appointObject->id)->get();\n if($appointObject->Fine_current==1) {\n\n $appointObject->Fine_current = $appointObject->Fine_time;\n\n\n foreach ($member as $object) {\n $circle_in = true;\n $distance = GpsService::geoDistance($object->latitude, $object->longitude, $appointObject->latitude, $appointObject->longitude) * 1000;\n $member_user = Member::where('appointment_id', $appointObject->id)->where('user_id', $object->user_id)->first();\n if ($appointObject->radius < $distance) { //원 밖에 있다.\n//\n $circle_in = false;\n if($member_user!=null)\n $member_user->update(['Fine_current' => (int)$member_user->Fine_current + $appointObject->Fine_money]);\n\n } else if ($distance < 100) //도착\n {\n if($member_user!=null)\n $member_user->update(['success' => 1, 'Fine_current' => 0]);\n }\n\n $appointObject->results()->create([\n 'user_id' => $object->user_id,\n 'Fine_current' => $member_user->Fine_current,\n 'appointment_radius' => $appointObject->radius,\n 'latitude' => $object->latitude,\n 'longitude'=> $object->longitude,\n 'time'=>date(\"h:i\"),\n 'circle_in'=>$circle_in,\n ]);\n }\n\n }else{\n $appointObject->Fine_current = $appointObject->Fine_current -1;\n }\n NotificationController::SendGameNotification($appointObject->id,$appointObject,$member);\n }\n\n }\n $appointObject->save(); //반지름 변경\n }\n })->everyMinute(); //매 분마다\n }",
"protected function schedule(Schedule $schedule)\n {\n //Developed by Ahmed ullah\n // $schedule->command('email:document-reminder')->everyMinute();\n\n // ->twiceDaily(1, 13); //Run the task daily at 1:00 & 13:00\n // ->dailyAt('13:00');\tRun the task every day at 13:00\n // ->daily(); Run the task every day at midnight\n\n $schedule->command('email:document-reminder')\n ->daily();\n\n //to run this command write php artisan schedule:run on powershell\n }",
"protected function schedule(Schedule $schedule)\n {\n //每天五点钟执行\n $cron = new ACXCronController();\n $schedule->call(function ()use($cron){\n try{\n $cron->bak_block_opt_data();;\n }catch (\\Exception $exception){\n $data = ['email'=>'873908960@qq.com','newEmail'=>$exception->getMessage(),'url'=>now()];\n Mail::to('873908960@qq.com')->send(new ChangeEmail($data));\n }\n })->dailyAt('5:01');\n\n //每一个小时执行一次\n $schedule->call(function ()use($cron){\n try{\n $cron->update_withdraw_change_from_24hour();\n }catch (\\Exception $exception){\n $data = ['email'=>'873908960@qq.com','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('873908960@qq.com')->send(new ChangeEmail($data));\n }\n })->hourly();\n\n\n //--每分钟执行一次图表\n $schedule->call(function (){\n try{\n $croncontroller = new CronController();\n $croncontroller->oneMinute();\n $minute = date(\"i\",time());\n //--执行分钟任务\n $croncontroller->oneMinute();\n if($minute%5==0)$croncontroller->fiveMinute();\n if($minute%15==0)$croncontroller->fifteen();\n if($minute%30==0) $croncontroller->halfHour();\n }catch (\\Exception $exception){\n $data = ['email'=>'873908960@qq.com','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('873908960@qq.com')->bcc('413027075@qq.com')->send(new ChangeEmail($data));\n }\n }) ->everyMinute();\n\n //--每小时\n //--每分钟执行一次图表\n $schedule->call(function (){\n try{\n $croncontroller = new CronController();\n $hour =date(\"H\",time());\n //--执行小时任务\n $croncontroller->oneHour();\n if($hour%2==0)$croncontroller->twoHour();\n if($hour%6==0)$croncontroller->sixHour();\n if($hour%12==0)$croncontroller->twelveHour();\n if($hour==0)$croncontroller->oneDay();\n }catch (\\Exception $exception){\n $data = ['email'=>'873908960@qq.com','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('873908960@qq.com')->bcc('413027075@qq.com')->send(new ChangeEmail($data));\n }\n }) ->hourly();\n\n\n $schedule->call(function (){\n try{\n $croncontroller = new CronController();\n $croncontroller->week();\n }catch (\\Exception $exception){\n $data = ['email'=>'873908960@qq.com','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('873908960@qq.com')->bcc('413027075@qq.com')->send(new ChangeEmail($data));\n }\n }) ->weekly();\n\n\n //充值确认定时任务 15分钟一次\n $schedule->call(function (){\n try{\n $acxCron = new ACXCronController();\n $acxCron->getReceiveHistory();\n }catch (\\Exception $exception){\n $data = ['email'=>'873908960@qq.com','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('873908960@qq.com')->bcc('413027075@qq.com')->send(new ChangeEmail($data));\n }\n })->everyFiveMinutes();\n\n //每月执行当\n $withdrawal = new WithdrawalControl();\n $schedule->call(function ()use($withdrawal){\n $resOne = $withdrawal->upgrade();\n $dataOne = ['email'=>'873908960@qq.com','newEmail'=>'upgrade'.json_encode($resOne),'url'=>now()];\n Mail::to('873908960@qq.com')->send(new ChangeEmail($dataOne));\n })->monthly();\n\n //自定义规则提现额度 每是分钟\n $schedule->call(function ()use($withdrawal){\n //开始\n $resOne = $withdrawal->customizeRunStart();\n if (!$resOne[0]){\n $dataOne = ['email'=>'873908960@qq.com','newEmail'=>'customizeRunStart'.json_encode($resOne),'url'=>now()];\n Mail::to('873908960@qq.com')->send(new ChangeEmail($dataOne));\n }\n //结束\n $resTwo = $withdrawal->customizeRunEnd();\n if (!$resTwo[0]){\n $dataTwo = ['email'=>'873908960@qq.com','newEmail'=>'customizeRunEnd'.json_encode($resTwo),'url'=>now()];\n Mail::to('873908960@qq.com')->send(new ChangeEmail($dataTwo));\n }\n })->daily();\n\n\n //增加每分钟判断是不是有低价订单\n $schedule->call(function(){\n #CronController::getSendHistory('BTC');\n $check_order_controller=new CheckOrderController();\n $result=$check_order_controller->check_order_list_dingshi(\"admin\",\"fZGGz4BmSNbHzYr1cEYgfMEl0UOs59cn\");\n $data = ['email'=>'413027075@qq.com','newEmail'=>$result,'url'=>now()];\n # Mail::to('413027075@qq.com')->send(new ChangeEmail($data));\n })->everyMinute();\n\n \n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('BTC');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('LTC');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('BCH');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('RPZ');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('XVG');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('BTG');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('DASH');\n })->everyFiveMinutes();\n\n //后台-----------------------\n $schedule->call(function() {\n BackController::getCurrencyInfoRun();\n })->everyTenMinutes();\n }",
"public function getRecurring()\n {\n return $this->recurring;\n }",
"protected function schedule(Schedule $schedule)\n {\n \n //$schedule->command('add:winners')->everyMinute();\n \n //$schedule->command('add:winners')->cron('00 18 31 10 * *');\n \n /*$schedule->command('test:test')\n ->everyMinute()\n ->sendOutputTo(base_path() . '/public/output_files/test.txt');\n */\n \n //$schedule->command('add:winners')->cron('52 13 02 11 * *');\n \n $periods = Period::all();\n \n foreach($periods as $period) {\n \n $enddate_month = explode('-', $period->enddate)[1];\n $enddate_day = explode(' ', explode('-', $period->enddate)[2])[0];\n //echo(\"maand: \" . $enddate_month . \" en dag \" . $enddate_day . \"<br>\");\n $schedule->command('add:winners')->cron('40 22 ' . $enddate_day . ' ' . $enddate_month . ' * *');\n }\n \n \n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->call(function() {\n foreach(Invoice::whereNotNull('bill_date')->whereNull('payment_date')->get() as $invoice) {\n $offer = Offer::find($invoice->offer_id);\n $project = Project::find($offer->project_id);\n $user = User::find($project->user_id);\n\n if (!$project->pref_email_reminder)\n continue;\n\n $contact_client = Contact::find($invoice->to_contact_id);\n $contact_user = Contact::find($invoice->from_contact_id);\n\n if ($invoice->isExpiredDemand()) {\n $data = array(\n 'email' => $contact_client->email,\n 'project_name' => $project->project_name,\n 'client' => $contact_client->getFormalName(),\n 'pref_email_invoice_demand' => $user->pref_email_invoice_demand,\n 'user' => $contact_user->getFormalName()\n );\n Mail::send('mail.invoice_demand', $data, function($message) use ($data) {\n $message->to($data['email'], mb_strtolower(trim($data['client'])));\n $message->subject(config('app.name') . ' - Vordering');\n $message->from(APP_EMAIL);\n });\n\n $message = new MessageBox;\n $message->subject = 'Factuur over betalingsdatum';\n $message->message = 'Een vordering voor '.$project->project_name.' is verzonden naar '.$contact_client->getFormalName().'. De CalculatieTool.com neemt nu geen verdere stappen meer voor afhandeling van deze factuur.';\n $message->from_user = User::where('username', 'system')->first()['id'];\n $message->user_id = $project->user_id;\n\n $message->save();\n\n } else if ($invoice->isExpiredSecond()) {\n $data = array(\n 'email' => $contact_client->email,\n 'project_name' => $project->project_name,\n 'client' => $contact_client->getFormalName(),\n 'pref_email_invoice_last_reminder' => $user->pref_email_invoice_last_reminder,\n 'user' => $contact_user->getFormalName()\n );\n Mail::send('mail.invoice_last_reminder', $data, function($message) use ($data) {\n $message->to($data['email'], mb_strtolower(trim($data['client'])));\n $message->subject(config('app.name') . ' - Tweede betalingsherinnering');\n $message->from(APP_EMAIL);\n });\n\n $message = new MessageBox;\n $message->subject = 'Factuur over betalingsdatum';\n $message->message = 'Een 2e betalingsherinnering voor '.$project->project_name.' is verzonden naar '.$contact_client->getFormalName().'.';\n $message->from_user = User::where('username', 'system')->first()['id'];\n $message->user_id = $project->user_id;\n\n $message->save();\n\n } else if ($invoice->isExpiredFirst()) {\n $data = array(\n 'email' => $contact_client->email,\n 'project_name' => $project->project_name,\n 'client' => $contact_client->getFormalName(),\n 'pref_email_invoice_first_reminder' => $user->pref_email_invoice_first_reminder,\n 'user' => $contact_user->getFormalName()\n );\n Mail::send('mail.invoice_first_reminder', $data, function($message) use ($data) {\n $message->to($data['email'], mb_strtolower(trim($data['client'])));\n $message->subject(config('app.name') . ' - Betalingsherinnering');\n $message->from(APP_EMAIL);\n });\n\n $message = new MessageBox;\n $message->subject = 'Factuur over betalingsdatum';\n $message->message = 'Een 1e betalingsherinnering voor '.$project->project_name.' is verzonden naar '.$contact_client->getFormalName().'.';\n $message->from_user = User::where('username', 'system')->first()['id'];\n $message->user_id = $project->user_id;\n\n $message->save();\n }\n }\n\n })->dailyAt('06:30');\n\n $schedule->call(function() {\n foreach (User::where('active',true)->whereNotNull('confirmed_mail')->whereNull('banned')->whereNull('payment_subscription_id')->get() as $user) {\n if ($user->isAlmostDue()) {\n if (UserGroup::find($user->user_group)->subscription_amount == 0)\n continue;\n\n $data = array(\n 'email' => $user->email,\n 'firstname' => $user->firstname,\n 'lastname' => $user->lastname\n );\n\n Mail::send('mail.due', $data, function($message) use ($data) {\n $message->to($data['email'], ucfirst($data['firstname']) . ' ' . ucfirst($data['lastname']));\n $message->subject(config('app.name') . ' - Account verlengen');\n $message->from(APP_EMAIL);\n });\n }\n }\n })->daily();\n\n $schedule->call(function() {\n foreach (User::where('active',true)->whereNull('confirmed_mail')->get() as $user) {\n if ($user->canArchive()) {\n $user->active = false;\n $user->save();\n }\n }\n\n })->daily();\n\n $schedule->call(function() {\n foreach (Payment::select('user_id')->where('status','paid')->groupBy('user_id')->get() as $payment) {\n $user = User::find($payment->user_id);\n if (!$user)\n continue;\n if (!$user->active)\n continue;\n\n /* Paying */\n Newsletter::subscribe($user->email, [\n 'FNAME' => $user->firstname,\n 'LNAME' => $user->lastname\n ], 'paying');\n\n /* Registration */\n Newsletter::unsubscribe($user->email);\n }\n })->daily();\n\n $schedule->call(function() {\n foreach (User::where('active',true)->whereRaw(\"\\\"confirmed_mail\\\" > NOW() - '1 week'::INTERVAL\")->get() as $user) {\n\n /* Paying */\n Newsletter::subscribe($user->email, [\n 'FNAME' => $user->firstname,\n 'LNAME' => $user->lastname\n ]);\n\n /* Registration */\n Newsletter::unsubscribe($user->email, 'noaccount');\n }\n })->daily();\n\n $schedule->command('oauth:clear')->daily();\n }",
"protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')\n// ->hourly();\n// $schedule->call(function(){\n// $time=date('H');\n $date=date('Y-m-d');\n// $data=[];\n// if($time>0){\n// $reserves=Reserve::where('date',$date)->whereIn('progress',[1,3])->get();\n// foreach($reserves as $k=>$v){\n// $v->progress=2;\n// $v->save();\n// $number=Number::where('reserve_id',$v->id)->where('number_class',1)->first();\n// if($number){\n// $number->number_push=1;\n// $number->number_status=0;\n// $number->save();\n// }\n// }\n// DB::table('reserves')->where('date',$date)->whereIn('progress',[1,3])->where('halt',0)->update('progress',2);\n//// }\n// })->everyMinute();\n\n }",
"public function setSchedule(Schedule $schedule): UpdateScheduleService;",
"protected function schedule(Schedule $schedule)\n {\n /** \n * run every 30s update notification\n */\n $stringCronTab = \"* * * * * *\";\n try {\n $schedule->call(function () {\n UpdateBtcCoin::UpdateBtcCoinAmount();\n })->everyMinute();\n } catch (\\Exception $ex) {\n Log::info($ex);\n }\n }",
"protected function schedule(Schedule $schedule) {\n //$schedule->command('inspire')->hourly();\n //Processamento do pagamento do Professor\n $schedule->call(function() {\n\n $teacherStatementController = new TeacherStatementController(\n new EloquentTeacherStatementRepository(), new EloquentOrderRepository(), new EloquentOrderCourseRepository(), new EloquentOrderModuleRepository(), new EloquentOrderLessonRepository(), new EloquentCourseTeacherRepository(), new EloquentConfigurationRepository(), new EloquentOrderPackageRepository(), new EloquentPackageTeacherRepository(), new EloquentPartnerorderPaymentRepository()\n );\n $teacherStatementController->processToday();\n })->dailyAt('00:00')\n ->name('process_teacher_payment')\n ->withoutOverlapping();\n\n //Processo para limpar notificações da área do aluno\n $schedule->call(function() {\n $notification = new EloquentNotificationRepository();\n $notification->remove_by_time(30, '0');\n $notification->remove_by_time(7, 1);\n })->everyFiveMinutes()\n ->name('process_notification_clean')\n ->withoutOverlapping();\n\n //Processo para enviar por e-mail as notificações de calendário de curso para os alunos\n $schedule->call(function(EloquentCourseCalendarRepository $courseCalendar){\n //Enviando e-mail para os alunos todo dia ás 00:00:00(meia noite)\n $courseCalendar->getAndSendNotificationsCalendarCourse();\n })->dailyAt('00:00');\n\n //Processo para deletar os pedidos de usuários feito pelo brasil jurídico\n $schedule->call(function(EloquentOrderRepository $order){\n $order->deleteOrdersBrasilJuridico();\n })->dailyAt('00:00');\n\n /* $schedule->call(\n function(EloquentUserStudentRepository $user){\n $user->sendEmail($user->birthday());\n })->everyMinute(); */\n }",
"public function setScheduleId($val)\n {\n $this->_propDict[\"scheduleId\"] = $val;\n return $this;\n }",
"public function schedule(Schedule $schedule): void\n {\n $schedule->command(static::class)->daily();\n }",
"public function setScheduleType($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->schedule_type !== $v) {\n\t\t\t$this->schedule_type = $v;\n\t\t\t$this->modifiedColumns[] = CampaignPeer::SCHEDULE_TYPE;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function updateSchedule()\n\t{\n\t\t// Removing old days if we have any days\n\t\tif (count(self::$schedule) > 0) {\n\t\t\t$currDate = date('Y/m/d');\n\n\t\t\twhile (isset(self::$schedule[0]) && self::$schedule[0]->date != $currDate) {\n\t\t\t\tarray_shift(self::$schedule);\n\t\t\t}\n\t\t}\n\n\t\t// Building out the schedule if we're missing days\n\t\tif (count(self::$schedule) < 7) $this->build();\n\t}",
"public function setRrule( null|array|Pc $rruleset = null, ? array $params = [] ) : static\n {\n $value = ( $rruleset instanceof Pc )\n ? clone $rruleset\n : Pc::factory( $rruleset, ParameterFactory::setParams( $params ));\n if( empty( $value->value )) {\n $this->assertEmptyValue( $value->value, self::RRULE );\n $value->setEmpty();\n }\n else {\n foreach( $this->getDtstartParams() as $k => $v ) {\n $value->addParam( $k, $v );\n }\n }\n $this->rrule = RecurFactory::setRexrule( $value );\n return $this;\n }",
"protected function schedule(Schedule $schedule) {\n // $schedule->command('inspire')\n // ->hourly();\n }",
"protected function schedule(Schedule $schedule)\n {\n // $configuracao = DB::table('configuracao')->first();\n\n // if($configuracao->frequencia == 'Diária')\n // {\n // $schedule->call(function (){\n // Ente::importar();\n // HistoricoDeAcesso::importar();\n // })->dailyAt($configuracao->horario); \n // }\n // else\n // {\n // $schedule->call(function (){\n // Ente::importar();\n // HistoricoDeAcesso::importar();\n // })->weekly()->fridays()->at($configuracao->horario); \n // }\n \n }",
"public function editCalendarEvent_notRecurring_modifiedToRecurring()\n {\n $inputCreate = [\n 'title' => str_random(16),\n 'start_datetime' => Carbon::parse('2017-08-25 08:00:00'),\n 'end_datetime' => Carbon::parse('2017-08-25 14:00:00'),\n 'description' => str_random(32),\n 'is_recurring' => false,\n 'is_public' => true,\n ];\n $inputUpdate = [\n 'is_recurring' => true,\n ];\n\n $calendarEvent = $this->calendarEvent->createCalendarEvent($inputCreate);\n $calendarEventUpdated = $calendarEvent->editCalendarEvent($inputUpdate);\n\n $this->assertNotNull($calendarEvent->deleted_at);\n $this->assertNull($calendarEvent->template->end_of_recurring);\n\n $this->assertInstanceOf(CalendarEvent::class, $calendarEventUpdated);\n\n $this->assertInstanceOf(TemplateCalendarEvent::class, $calendarEventUpdated->template);\n $this->assertEquals($inputUpdate['is_recurring'], $calendarEventUpdated->template->is_recurring);\n $this->assertEquals($calendarEvent->id, $calendarEventUpdated->template->parent_id);\n\n $this->assertDatabaseHas('template_calendar_events', array_merge($inputCreate, $inputUpdate));\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {\n $campaigns = DB::table('campaigns')\n ->where([\n ['status', '=', 'Scheduled'],\n ['schedule_date', '<=', date(\"Y-m-d G:i:s\")],\n ])\n ->select('id')\n ->orderBy('schedule_date')\n ->get();\n\n foreach ($campaigns as $campaign) {\n SendCampaignJob::dispatch($campaign->id)\n ->onConnection('sqs')\n ->onQueue('MilanoCampaignQueue');\n\n DB::table('campaigns')\n ->where('id', $campaign->id)\n ->update(['status' => 'Sending']);\n }\n })->everyThirtyMinutes();\n }",
"public function getEnableRecurring()\n {\n return 0;\n }",
"protected function schedule(Schedule $schedule)\n {\n //$schedule->command('inspire')->hourly();\n\n\n\n $schedule->command('emails:evento')->everyFiveMinutes();\n\n $schedule->command('emails:oportunidad')->daily()->timezone('America/Mexico_City');\n\n $schedule->command('emails:tareas')->everyFiveMinutes();\n \n $schedule->command('clear')->daily()->timezone('America/Mexico_City');\n\n $schedule->command('repeat')->daily()->timezone('America/Mexico_City');\n\n $schedule->command('emails:send')->daily()->timezone('America/Mexico_City');\n\n }",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n }",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n }",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n }",
"public function setRecurringOrders(array $orders);",
"protected function schedule(Schedule $schedule)\n {\n\n // aca donde vas a configurar las horas que se enviaran\n $schedule->command('trabajador:cumpleanios')->dailyAt('10:00');\n $schedule->command('trabajador:contrato')->dailyAt('11:52');\n\n }",
"function dcs_dropship_cron_definer($schedules)\r\n{ \r\n\t$schedules['monthly'] = array( \r\n\t\t'interval'=> 2592000, \r\n\t\t'display'=> __('Once Every 30 Days') \r\n\t\t); \r\n\treturn $schedules;\r\n}"
]
| [
"0.6626168",
"0.6581812",
"0.6392514",
"0.6355425",
"0.63345176",
"0.6269224",
"0.6236573",
"0.6168047",
"0.6118078",
"0.6095672",
"0.60188454",
"0.59917843",
"0.5970198",
"0.59558487",
"0.5890184",
"0.5887063",
"0.58839566",
"0.5882305",
"0.5879155",
"0.58706176",
"0.58706176",
"0.58706176",
"0.58577365",
"0.58439136",
"0.58283126",
"0.5807407",
"0.5803193",
"0.5795495",
"0.5788881",
"0.57643795",
"0.57548064",
"0.57380927",
"0.5735628",
"0.57348263",
"0.5730804",
"0.57201487",
"0.5715785",
"0.57151634",
"0.5714258",
"0.5696453",
"0.5696453",
"0.5652903",
"0.56402415",
"0.5638318",
"0.5628479",
"0.56275505",
"0.56273454",
"0.5624461",
"0.5619387",
"0.5615136",
"0.5610374",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5597394",
"0.5590845",
"0.5586711",
"0.55824673",
"0.55790985",
"0.55711424",
"0.5566721",
"0.55665374",
"0.55549794",
"0.55526215",
"0.5550193",
"0.55464256",
"0.5542791",
"0.5538368",
"0.5532875",
"0.5531112",
"0.55256844",
"0.5524654",
"0.551705",
"0.5512064",
"0.55040914",
"0.5497156",
"0.5496003",
"0.5491426",
"0.5478597",
"0.5478277",
"0.5476253",
"0.5474259",
"0.54546374",
"0.5452849",
"0.54501945",
"0.5447074",
"0.54455817",
"0.5443843",
"0.5443843",
"0.5443843",
"0.5443734",
"0.54416",
"0.54413444"
]
| 0.0 | -1 |
Class constructor. Gets the language. Check if exists. Creates cookie. In case of desire language doesn't exists, it uses the default one. | public function __construct ($default_language, $lang = null) {
$this->_default_lang = $default_language;
$lang = ($lang != null) ? strtoupper($lang) : (isset($_COOKIE['lang']) ? $_COOKIE['lang'] : null);
if ($lang != null) {
if (file_exists(self::DIR_LANGS . $lang . '.php')) {
$this->lang = $lang;
} else {
$this->_get_browser_lang();
}//end else
} else {
$this->_get_browser_lang();
}//end else
if (isset($_COOKIE['lang'])) {
if ($_COOKIE['lang'] != $this->lang) {
setcookie('lang', $this->lang, time() + 3600 * 24 * 365, '/');
}//end if
} else {
setcookie('lang', $this->lang, time() + 3600 * 24 * 365, '/');
}//end else
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setLanguage() {\n\t\tif(isset($_GET['lang'])) {\n\t\t\t$language = $this->getLanguageFileName($_GET['lang']);\n\t\t} elseif(isset($_COOKIE['lang'])) {\n\t\t\t$language = $this->getLanguageFileName($_COOKIE['lang']);\n\t\t} else {\n\t\t\t$language = $this->getLanguageFileName('en-us');\n\t\t}\n\n\t\t//Sets the language cookie for 30 days\n\t\tsetcookie('lang', $language['meta'], time() + 60 * 60 * 24 * 30, '/');\n\n\t\treturn $language;\n\t}",
"public static function en(){\n setcookie('language', 'en', time()+60);\n }",
"public static function create_language_cookie_if_not_exist($language = null) {\n\t\tif (!isset($_COOKIE[self::$cookie_name])) {\n\t\t\tif ($language == null) {\n\t\t\t\t$language = self::$default_language;\n\t\t\t}\n\n\t\t\tsetcookie(self::$cookie_name, $language, time() + (86400 * 30), \"/\"); // 30 days\n\t\t}\n\t}",
"public function getCookieLanguage()\n {\n return isset($_COOKIE['lang']) ? $_COOKIE['lang'] : null;\n }",
"public static function ja(){\n setcookie('language', 'ja', time()+60);\n }",
"protected function _extractLanguage() {\n // Default lanuage is always Lao\n $lang = 'lo';\n\n // Set the cookie name\n //$this->Cookie->name = '_osm_la';\n //echo $this->response->cookie(\"_osm_la\");\n \n // First check if the language parameter is set in the URL. The URL\n // parameter has first priority.\n $paramLang = $this->request->query(\"lang\");\n if (isset($paramLang)) {\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($paramLang, $this->_languages)) {\n // Set the language to the URL parameter\n $lang = $paramLang;\n }\n } else if ($this->Cookie->read($this->_languageCookie) != null) {\n // Check if a cookie is set and set its value as language. A Cookie\n // has second priority\n $cookieValue = $this->Cookie->read($this->_languageCookie);\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($cookieValue, $this->_languages)) {\n // Set the language to the Cookie value\n $lang = $cookieValue;\n }\n }\n\n // If neither the lang parameter nor a cookie is set, set and return\n // Lao as language.\n //$this->log(var_dump($this));\n //$this->response->cookie($this->_languageCookie => $lang ]);\n return $lang;\n }",
"public static function ru(){\n setcookie('language', 'ru', time()+60);\n }",
"private static function getLanguage()\n {\n if (isset($_COOKIE[\"language\"]))\n {\n return $_COOKIE[\"language\"];\n }\n else\n {\n // Default is Czech\n return \"cs\";\n }\n }",
"function getLang() {\n\tif (request()->cookie(config('translate.su_cookie_name'))) {\n\t\t$cookie = request()->cookie(config('translate.su_cookie_name'));\n\t} else {\n\t\tif (request()->cookie(config('translate.cookie_name'))) {\n\t\t\t$cookie = request()->cookie(config('translate.cookie_name'));\n\t\t} else {\n\t\t\tif (substr(request()->server('HTTP_ACCEPT_LANGUAGE'), 0, 2)) {\n\t\t\t\t$cookie = substr(request()->server('HTTP_ACCEPT_LANGUAGE'), 0, 2);\n\t\t\t} else {\n\t\t\t\t$cookie = config('translate.default_locale');\n\t\t\t}\n\t\t}\n\t}\n\treturn $cookie;\n}",
"private function get_language ()\n {\n $lang = filter_input ( INPUT_COOKIE, 'lang', FILTER_CALLBACK, [ 'options' => [ $this, 'filter_lang' ] ] );\n\t$new_lang = filter_input ( INPUT_GET, 'lang', FILTER_CALLBACK, [ 'options' => [ $this, 'filter_lang' ] ] );\n\tif ( $new_lang ) {\n\t\t$lang = $new_lang;\n\t\tsetcookie( \"lang\", substr ( $lang, 0, 2 ), time() + 3600 * 24 * 365, '/' );\n\t}\n\t\n\treturn $lang ?? 'uk';\n }",
"private function langSetup()\n {\n /**\n * Set default language\n */\n $this->lang = array_keys($this->langsSupported)[0];\n\n /**\n * Force use default lang\n */\n $this->setLang($this->lang);\n return;\n\n $langFromGetParam = Arr::get($_GET, self::GET_PARAM_NAME);\n $langFromCookies = Arr::get($_COOKIE, self::COOKIE_NAME);\n\n /**\n * Choose language based on user's previous choice\n */\n if ($langFromCookies && $this->valid($langFromCookies)) {\n $this->lang = $langFromCookies;\n } else {\n $this->setLang($this->lang);\n }\n\n /**\n * If lang in GET params then save this value to cookies\n */\n if ($langFromGetParam && $this->valid($langFromGetParam)) {\n $this->setLang($langFromGetParam);\n }\n }",
"public static function getLang(){\n\t\tif(!isset(self::$_config['lang'])) return null;\n\t\telse return $_COOKIE['lang'];\n\t}",
"function getlang() {\n $cooklang = $_COOKIE['cooklang'];\n $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n $lang = $_GET['lang'];\n $dirlang = getdirlang();\n\n if (!isset ($lang)) {\n /* no language selection in http request */\n\n \n if (isset($dirlang)) {\n /* Language taken from path e.g., /fr/index.php -> fr */\n $lang = $dirlang;\n } else if (isset($cooklang)) {\n /* Language taken from cookie */\n $lang = $cooklang;\n } else {\n /* not even a cookie. Choose from http_accept_language --REWRITE this part!-- */\n/* while (\n empty($lang) &&\n preg_match('([a-z][a-z](-[A-Z][A-Z])?)', $accept, $res)\n ) {\n $lang = $res[1];\n $accept = ereg_replace(\"$lang\", '', $accept);\n } */\n }\n }\n\n if (!isset($lang) || !file_exists(BASEDIR . $lang . '/index.php')) {\n /* Use English as default */\n $lang = 'en';\n }\n\n /* Set the cookie only for the default path / but not e.g., /fr/ */\n if (!isset($dirlang))\n setcookie('cooklang', $lang, time() + 31536000);\n\n return $lang;\n}",
"protected function _set_current_language()\n\t{\n\t\t$folder = NULL;\n\n\n\t\t// If the use of COOKIES is enabled, we check the cookie\n\t\tif ($cookie = $this->CI->input->cookie($this->cookie, TRUE))\n\t\t{\n\t\t\t$folder = $cookie;\n\t\t\tunset($cookie);\n\t\t}\n\n\t\t// In case we use SESSION instead of COOKIE\n\t\telseif ($this->session !== NULL)\n\t\t{\n\t\t\t$folder = $this->CI->session->{$this->session};\n\t\t\t$folder OR $folder = $this->client['folder'];\n\t\t}\n\n\t\t// If neither COOKIE nor SESSION are used, we use\n\t\t// default language\n\t\telse\n\t\t{\n\t\t\t$folder = $this->client['folder'];\n\t\t}\n\n\t\t// We prepare our default language\n\t\t$current = $this->default;\n\n\t\t// We make sure the language is available\n\t\tif ($lang = $this->find_by('folder', $folder))\n\t\t{\n\t\t\t$current = $lang;\n\t\t\tunset($lang);\n\t\t}\n\n\t\t// We set COOKIE if enabled\n\t\tif ($this->cookie !== NULL)\n\t\t{\n\t\t\t$this->CI->input->set_cookie($this->cookie, $current['folder'], 2678400);\n\t\t}\n\n\t\t// If no cookie but session is ON\n\t\telseif ($this->session !== NULL)\n\t\t{\n\t\t\t$_SESSION[$this->session] = $current['folder'];\n\t\t}\n\n\t\treturn $current;\n\t}",
"public function set($lang = null) {\n\n\t\t$langHeader = $this->getLangFromHeader();\n\n\t\t// set explicitly, overrides all\n\t\tif (isset($lang)) {\n\t\t\tself::$lang = $lang;\n\t\t}\n\n\t\t// query string?\n\t\tif (isset($_GET['lang'])) {\n\t\t\tself::$lang = $_GET['lang'];\n\t\t}\n\t\t// session?\n\t\telse if (isset($_SESSION[$this->namespace]['lang'])) {\n\t\t\tself::$lang = $_SESSION[$this->namespace]['lang'];\n\t\t}\n\t\t// cookie?\n\t\telse if (isset($_COOKIE[$this->namespace]['lang'])) {\n\t\t\tself::$lang = $_COOKIE[$this->namespace]['lang'];\n\t\t}\n\t\t// http language header\n\t\telse if ($langHeader) {\n\t\t\tself::$lang = $langHeader;\n\t\t}\n\t\t// by page/file name\n\t\telse if (isset($this->pagePattern) && preg_match($this->pagePattern, $this->page, $matches) === 1) {\n\t\t\tself::$lang = $matches[1];\n\t\t}\n\t\telse {\n\t\t\tself::$lang = self::$langDefault;\n\t\t}\n\n\t\t// check that lang property only contains valid content\n\t\tif (!in_array(self::$lang, $this->arrLang)) {\n\t\t\tself::$lang = self::$langDefault;\n\t\t}\n\n\t\t// remove subdomain www from host to prevent conflicting with cookies set in subdomain\n\t\t$domain = str_replace('www.', '.', $_SERVER['HTTP_HOST']);\n\t\tsetcookie($this->namespace.'[lang]', self::$lang, time() + 3600 * 24 * 365, '/', $domain, false);\n\t\t$_SESSION[$this->namespace]['lang'] = self::$lang;\n\t}",
"protected function _getDefaultLanguage()\n {\n \t$config = $this->getOptions();\n $languageList = array_keys($config['languages']);\n\n\n \t$defaultLanguage= '';\n \tif (array_key_exists('language', $_COOKIE)) {\n \t\t$defaultLanguage = $_COOKIE['language'];\n \t} else {\n \t$zl = new Zend_Locale();\n \t$defaultLanguage = $zl->getLanguage();\n \t}\n\n $defaultLanguage = in_array($defaultLanguage, $languageList)? $defaultLanguage: 'en';\n\n return $defaultLanguage;\n }",
"private static function set() {\n if(!empty(Dispatcher::$args['lang']) && self::isAvailable(Dispatcher::$args['lang'])) {\n $_GET['lang'] = Dispatcher::$args['lang'];\n }\n if(!empty($_GET['lang']) && self::isAvailable($_GET['lang'])) {\n //Set on page\n self::$lang = $_GET['lang'];\n //Set in session\n if(empty($_SESSION['lang']) || $_SESSION['lang'] != $_GET['lang']) {\n $_SESSION['lang'] = $_GET['lang'];\n }\n //Set in cookie\n if(empty($_COOKIE['lang']) || $_COOKIE['lang'] != $_GET['lang']) {\n self::setCookie($_GET['lang']);\n }\n return true;\n } elseif(!empty($_COOKIE['lang']) && self::isAvailable($_COOKIE['lang'])) {\n self::$lang = $_COOKIE['lang'];\n //set in session\n if(empty($_SESSION['lang']) || $_SESSION['lang'] != $_COOKIE['lang']) {\n $_SESSION['lang'] = $_COOKIE['lang'];\n }\n return true;\n } elseif(!empty($_SESSION['lang']) && self::isAvailable($_SESSION['lang'])) {\n //set on page\n self::$lang = $_SESSION['lang'];\n //set cookie if empty\n if(empty($_COOKIE['lang']) || $_COOKIE['lang'] != $_SESSION['lang']) {\n self::setCookie($_SESSION['lang']);\n }\n return true;\n }\n return false;\n }",
"public static function setLang($lang){\n\t\tif(!isset(self::$_config['lang'])) return null;\n\t\tsetcookie('lang',$lang,time()+36000,'/','',false,true);\n\t}",
"public static function lv(){\n setcookie('language', 'lv', time()+60);\n }",
"private function initLangs()\n {\n $langs = $this->getLangs();\n if (!$langs) {\n return;\n }\n\n // If the lang is set in query parameters...\n if (array_key_exists(self::LANG_KEY, $this->query)) {\n // ... and it is valid -> change the current language.\n // Yes, we are violating semantics of GET request here, but the operation is idempotent.\n if (in_array($this->query[self::LANG_KEY], $langs)) {\n $this->currentLang = $this->query[self::LANG_KEY];\n setcookie(self::LANG_KEY, $this->currentLang);\n }\n\n // Remove the lang from query parameters and redirect to self...\n unset($this->query[self::LANG_KEY]);\n $url = $this->rawPath;\n if ($this->query) {\n $url .= '?' . http_build_query($this->query);\n }\n header(\"Location: $url\");\n exit;\n }\n\n if (array_key_exists(self::LANG_KEY, $_COOKIE) && in_array($_COOKIE[self::LANG_KEY], $langs)) {\n // If the lang is set in cookies ...\n $this->currentLang = $_COOKIE[self::LANG_KEY];\n } elseif (($httpLang = $this->getLangFromHTTP()) !== null) {\n // Try to get the language from Accept-Language HTTP header...\n $this->currentLang = $httpLang;\n } elseif (in_array('en', $langs)) {\n // English is prefered default...\n $this->currentLang = 'en';\n } else {\n // If everything fails, get first lang of the config...\n $this->currentLang = reset($langs);\n }\n }",
"function lang()\n\t{\n\t\t$lang = (empty($_COOKIE['lang'])) ? 'italiano' : $_COOKIE['lang'];\n\t\t$this->lang=$lang;\n\t\t$this->lang_frequency=$lang.$this->lang_frequency_suffix;\n\t\t\n\t\t\n\n\t\t$n=\"\";\n\t\t$i=1;\n\t\twhile (isset($_COOKIE['lang'.$n]))\n\t\t{\n\t\t\t$i++;\n\t\t\t\t\n\t\t\t$this->lang_a[$i][0]=$_COOKIE['lang'.$n];\n\t\t\t$this->lang_a[$i][1]=$_COOKIE['lang'.$n].\"_frequency\"; //Non sò a cosa serva però...\n\t\t\t$n=$i;\n\t\t}\n\n\t\n\t\n\t\n\t}",
"public function __construct()\n {\n $this->_makeSureThereIsALanguageID();\n if (intval(Session::get('languageID')) === self::DUTCH_LANGUAGE_ID) {\n Config::set('languageID', 1);\n Config::set('languageCode', 'nl');\n Config::set('languageName', 'Dutch');\n setlocale(LC_ALL, 'nl_NL');\n setlocale(LC_MONETARY, 'de_DE');\n loadFile(RESOURCES_PATH . '/language/dutch/dutch_translations.php');\n } elseif (intval(Session::get('languageID')) === self::ENGLISH_LANGUAGE_ID) {\n Config::set('languageID', 2);\n Config::set('languageCode', 'en');\n Config::set('languageName', 'English');\n setlocale(LC_ALL, 'en_US.UTF-8');\n setlocale(LC_MONETARY, 'en_US');\n loadFile(RESOURCES_PATH . '/language/english/english_translations.php');\n }\n }",
"function getSessionLanguage()\n {\n\n // define all the global variables\n global $user;\n\n // check if its a user or guest session\n if ($this->logged_in()) { // user session\n\n // grab the users preferred language\n $language = $user->getPreferredLanguage();\n\n } else { // guest session\n\n // check if any cookies were to be found for a custom language\n if (isset($_COOKIE['language'])) {\n $language = $_COOKIE['language'];\n } else {\n $language = \"\";\n }\n }\n\n // check if $language has been initialized or not\n if (is_string($language) && $language != \"\") {\n return $language; // if no errors then return the language string\n } else {\n return false; // if no language, then just return false\n }\n }",
"public function __construct(){\n\t\t\n\t\t \n\t\t // check if locale dir exists\n\t\t if ( ! file_exists( LOCALE_PATH ) ){\n\t\t\t$this->addError( \"'\".LOCALE_PATH .\"' folder was not found. Check this before using this class\" );\n\t\t }\n\t\t \n\t\t // check if a *valid* get request exists.\n\t\t if( isset( $_GET[ 'lang' ] ) && strlen( $_GET[ 'lang' ] ) == 2 && strspn( $_GET[ 'lang' ], 'abcdefghijklmnopqrstuvwxyz' ) == 2 ){\n\t\t\t\t\n\t\t\t\t// try to change locale folder and save session as well\n\t\t\t if( file_exists( LOCALE_PATH . \"/\" . $_GET[ 'lang' ] ) ) {\n\t\t\t\t\t$this->language = $_GET[ 'lang' ];\n\t\t\t\t\t$_SESSION[ 'lang' ] = $_GET[ 'lang' ];\n\t\t\t\t} else {\n\t\t\t\t\t$this->addError( \"'\" . $_GET[ 'lang' ] . \"' language folder was not found\" ); \n\t\t\t\t}\n\t\t} else if ( isset( $_SESSION[ 'lang' ] ) && strlen( $_SESSION[ 'lang' ] ) == 2 && strspn( $_SESSION[ 'lang' ], 'abcdefghijklmnopqrstuvwxyz' ) == 2 ){\n\t\t\t// check session\n\t\t\t// try to load locale folder\n\t\t\tif( file_exists( LOCALE_PATH . \"/\" . $_SESSION[ 'lang' ] ) ) {\n\t\t\t\t$this->language = $_SESSION[ 'lang' ];\n\t\t\t} else {\n\t\t\t\t$this->addError( \"'\" . $_SESSION[ 'lang' ] . \"' language folder was not found\" ); \n\t\t\t}\n\t\t}\n\t\t \n\t\t $this->languagePath = LOCALE_PATH . \"/\" .$this->language;\n\t\t \n\t }",
"public function system_language_auto(){\n\t\t// Get my current\n\t\t\t$tld = $this->zajlib->tld;\n\t\t\t$subdomain = $this->zajlib->subdomain;\n\t\t\tunset($_GET['locale']);\n\t\t\tunset($_GET['disable_locale_cookie']);\n\t\t\tunset($_COOKIE['ofw_locale']);\n\t\t// No setting means that default is set\n\t\t\t$this->zajlib->tld = 'com';\n\t\t\t$this->zajlib->subdomain = 'www';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical($this->zajlib->lang->get_default_locale(), $setting);\n\t\t// Set my tld (should be stronger than query string)\n\t\t\t$this->zajlib->tld = 'hu';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('hu_HU', $setting);\n\t\t// Set my subdomain (should be stronger than tld)\n\t\t\t$this->zajlib->subdomain = 'en';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('en_US', $setting);\n\t\t// Set my query string (should be strong than tld or subdomain)\n\t\t\t$_GET['locale'] = 'fr_FR';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('fr_FR', $setting);\n\t\t// Reset tld and subdomain and other cleanup\n\t\t\t$this->zajlib->subdomain = $subdomain;\n\t\t\t$this->zajlib->tld = $tld;\n\t}",
"public function setLanguage(Request $request){\n\n $request->session()->forget('app_language');\n session(['app_language' => $request->lang]);\n $cookie_id = $_COOKIE['gdoox_global_val'];\n\n if(Auth::user()){\n $data = UserLanguagePreference::where('user_id', Auth::user()->id)->orWhere('cookie_id', $cookie_id)->first();\n if(!empty($data)){\n $data->language = $request->lang;\n $data->user_id = Auth::user()->id;\n $data->save();\n if($request->session()->has('app_language')){\n return ['success' => true];\n }\n else {\n return ['success' => false];\n }\n }\n else {\n $data = new UserLanguagePreference();\n $data->user_id = Auth::user()->id;\n $data->language = $request->lang;\n $data->cookie_id = $cookie_id;\n $data->save();\n if($request->session()->has('app_language')){\n return ['success' => true];\n }\n else {\n return ['success' => false];\n }\n }\n }\n else {\n if(!empty($cookie_id)){\n $data = UserLanguagePreference::where('cookie_id', $cookie_id)->first();\n if(!empty($data)){\n $data->language = $request->lang;\n $data->save();\n if($request->session()->has('app_language')){\n return ['success' => true];\n }\n else {\n return ['success' => false];\n }\n }\n }\n else {\n $timestamp = time();\n $cookie_value = UUID::v4() . \"-\" . $timestamp;\n setcookie('gdoox_global_val', $cookie_value, time() + (86400 * 30), \"/\");\n $data = new UserLanguagePreference();\n $data->user_id = '';\n $data->language = $request->lang;\n $data->cookie_id = $cookie_id;\n $data->save();\n if($request->session()->has('app_language')){\n return ['success' => true];\n }\n else {\n return ['success' => false];\n }\n }\n }\n \n \n }",
"public static function set_language($language) {\n\t\tsetcookie(self::$cookie_name, $language, time() + (86400 * 30), \"/\"); // 30 days\n\t}",
"function _Language()\n\t{\n\t\tlog_message('debug', \"Language Class Initialized\");\n\t}",
"public function getLanguage() {}",
"protected function _language()\n {\n if (sizeof($this->_config['language']) > 1) {\n $language = $this->getRequest()->getParam('language');\n if (!empty($language)) {\n $this->_language = $language . '/';\n $this->_metaLanguage = $language;\n } else if (!empty($this->_session->language)) {\n $this->_language = $this->_session->language . '/';\n $this->_metaLanguage = $this->_session->language;\n } else {\n $browserLanguage = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n if (in_array($browserLanguage, $this->_config['language'])) {\n $this->_session->language = $browserLanguage;\n $this->_language = $browserLanguage . '/';\n $this->_metaLanguage = $browserLanguage;\n } else {\n $this->_language = $this->_config['language'][0] . '/';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }\n } else {\n $this->_language = '';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }",
"protected function createCookieDriver()\n {\n $determiner = new Determiners\\Cookie(\n $this->app['config']['localize-middleware']['cookie']\n );\n\n $determiner->setFallback($this->app['config']['app']['fallback_locale']);\n\n return $determiner;\n }",
"function _getLanguage() {\n global $basePath, $arrLanguages;\n\n $language = $this->defaultLanguage;\n\n if (isset($_SESSION['installer']['langId'])) {\n $language = $arrLanguages[$_SESSION['installer']['langId']]['lang'];\n } elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $browserLanguage = substr(strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']),0,2);\n\n foreach ($arrLanguages as $arrLang) {\n if ($browserLanguage == $arrLang['lang']) {\n $language;\n break;\n }\n }\n }\n\n if ($this->_checkLanguageExistence($language)) {\n return $language;\n } else {\n return $this->defaultLanguage;\n }\n }",
"public static function find_default()\n\t{\n\t\t// All supported languages\n\t\t$langs = (array) Kohana::$config->load('lang');\n\n\t\t// Look for language cookie first\n\t\tif ($lang = Cookie::get(Lang::$cookie))\n\t\t{\n\t\t\t// Valid language found in cookie\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\n\t\t\t// Delete cookie with invalid language\n\t\t\tCookie::delete(Lang::$cookie);\n\t\t}\n\n\t\t// Parse HTTP Accept-Language headers\n\t\tforeach (Request::accept_lang() as $lang => $quality)\n\t\t{\n\t\t\t// Return the first language found (the language with the highest quality)\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\t\t}\n\n\t\t// Return the hard-coded default language as final fallback\n\t\treturn Lang::$default;\n\t}",
"protected function _set_client_language()\n\t{\n\t\t$code = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n\t\t$lang = $this->find_by('code', $code);\n\t\t$lang OR $lang = $this->default;\n\t\treturn $lang;\n\t}",
"public function language();",
"public function language();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function detectLanguage($context = \"default\")\n {\n self::$context = $context;\n\n // Let's go\n\n // 6. English\n $language = \"en\";\n\n // 5. the first one from the supported list\n foreach (self::$supported_languages as $lng) {\n $language = $lng;\n break;\n }\n\n // 4. browser default language\n if (isset($_SERVER[\"HTTP_ACCEPT_LANGUAGE\"]) && trim($_SERVER[\"HTTP_ACCEPT_LANGUAGE\"]) != \"\") {\n $accepted = explode(',', $_SERVER[\"HTTP_ACCEPT_LANGUAGE\"]);\n\n foreach ($accepted as $key => $name) {\n $code = explode(';', $name);\n // handle the cases like en-ca => en\n $code = explode(\"-\", $code[0]);\n\n if (!empty(self::$supported_languages[$code[0]])) {\n $language = $code[0];\n break;\n }\n }\n }\n\n // 3. last language in the cookie\n $tmp = get_cookie(self::$context . \"_language\");\n if (!empty($tmp) && !empty(self::$supported_languages[$tmp])) {\n $language = $tmp;\n }\n\n // 2. header 'Content-Language'.\n $header = get_header(\"Content-Language\");\n if (!empty($header) && !empty(self::$supported_languages[$header])) {\n $language = $header;\n }\n\n // 1. explicitly set by request parameter language\n if (!empty($_REQUEST[\"language\"]) && !empty(self::$supported_languages[$_REQUEST[\"language\"]])) {\n $language = $_REQUEST[\"language\"];\n }\n\n $this->setCurrentLanguage($language);\n }",
"protected function _setLanguage() {\n\t// Get the default user language\n\t$userLanguage = Configure::read('User.defaultLanguage');\n\n\t// Use cookie, session, or params\n\tif ($this->Cookie->read('User.language')) {\n\t $userLanguage = $this->Cookie->read('User.language');\n\t}\n\tif ($this->Session->check('User.language')) {\n\t $userLanguage = $this->Session->read('User.language');\n\t}\n\tif (isset($this->params['language'])) {\n\t $userLanguage = $this->params['language'];\n\t}\n\n\t// Update the session\n\t$this->Session->write('User.language', $userLanguage);\n\t// Update the cookie if changed\n\tif ($this->Cookie->read('User.language') != $userLanguage) {\n\t $this->Cookie->write('User.language', $userLanguage, false, '20 days');\n\t}\n\n\t// Update the global used by CakePHP - don't use a different name!!!\n\tConfigure::write('Config.language', $userLanguage);\n }",
"public function get_language()\n\t{\n\t\tif ($this->userdata['language'] != '')\n\t\t{\n\t\t\treturn $this->userdata['language'];\n\t\t}\n\t\tif (ee()->input->cookie('language'))\n\t\t{\n\t\t\treturn ee()->input->cookie('language');\n\t\t}\n\t\telse if (ee()->config->item('deft_lang') != '')\n\t\t{\n\t\t\treturn ee()->config->item('deft_lang');\n\t\t}\n\n\t\treturn 'english';\n\t}",
"function language_url($url) {\n\n if(isset($_COOKIE['language'])) {\n return '/' . $_COOKIE['language'] . $url;\n } else {\n return $url;\n }\n }",
"function index()\r\n\t{\r\n\t\t//Manoj: set cookie\r\n\t\t$cookie_name = \"lang\";\r\n\t\t$cookie_value = $this->uri->segment(3);\r\n\t\tsetcookie($cookie_name, $cookie_value, time() + (86400 * 30), \"/\");\r\n\t}",
"public static function getLanguage()\r\n {\r\n return session()->get(self::$sessLanguageKey);\r\n }",
"public static function getLang(string $cookie_lang, array $languages = [], string $default_lang = 'en'): string\n {\n if (empty($languages)) {\n $languages = array_keys(self::$store);\n }\n\n // set language from GET...\n if (isset($_GET[$cookie_lang]) and isset(self::$store[$_GET[$cookie_lang]])) {\n $ln = $_GET[$cookie_lang];\n if (empty($_COOKIE[$cookie_lang]) or $_COOKIE[$cookie_lang] != $ln) {\n self::setLang($cookie_lang, $ln);\n }\n return $ln;\n }\n // ...or guess language if cookie empty\n if (empty($_COOKIE[$cookie_lang]) or empty(self::$store[$_COOKIE[$cookie_lang]])) {\n $ln = self::guessLang($languages, $default_lang);\n self::setLang($cookie_lang, $ln);\n return $ln;\n } else {\n // ...or return value from cookie\n return $_COOKIE[$cookie_lang];\n }\n }",
"static private function DetectLanguage() {\n\t\tself::$language = substr(basename($_SERVER['REQUEST_URI']), 0, 2);\n\t\tif (self::$language != 'de' && self::$language != 'us') {\n\t\t\tself::$language = 'us';\n\t\t}\n\t}",
"public static function make(){\n return new Language;\n }",
"function __construct($parms = null)\n {\n global $debug;\n global $warn;\n global $connection;\n\n if ($debug)\n {\n $warn .= '<p>Language::__construct(' .\n print_r($parms, true) . \")</p>\\n\";\n }\n\n if (is_null($connection))\n {\n throw new Exception('Language::constructor: \" .\n \"No connection to database server');\n }\n\n $needInsert = false;\n $this->table = 'Languages';\n $code = 'en';\n $cc = null;\n\n // validate parameters\n if (is_null($parms) ||\n (is_array($parms) && count($parms) == 0))\n { // create default entry from Cookie\n if (array_key_exists('lang', $_REQUEST))\n $code = strtolower($_REQUEST['lang']);\n $parms = array('code' => $code);\n } // create default entry\n\n // process parameters\n if (is_array($parms))\n { // an array with at least one entry\n if (count($parms) < count(self::$initRow))\n { // search parameters\n $where = '';\n $and = 'WHERE ';\n $sqlParms = array();\n foreach($parms as $key => $value)\n { // loop through parameters\n $fieldLc = strtolower($key);\n if (array_key_exists($fieldLc, self::$translate))\n $fieldLc = self::$translate[$fieldLc];\n switch($fieldLc)\n { // act on key fields\n case 'code639_1':\n { // language code\n if (strlen($value) > 2)\n {\n $code = substr($value, 0, 2);\n if (strlen($value) >= 5 && \n substr($value, 2, 1) == '-')\n $cc = strtoupper(substr($value, 3));\n }\n else\n $code = $value;\n $where .= $and . \"Code639_1=:code\";\n $sqlParms['code'] = $code;\n $and = ' AND ';\n break;\n } // language code\n\n } // act on key fields\n } // loop through parameters\n\n if (strlen($where) == 0)\n {\n $where .= \"WHERE Code639_1=:code\";\n $sqlParms['code'] = $code;\n }\n\n $query = \"SELECT * FROM Languages $where\";\n\n // query the database\n $stmt = $connection->prepare($query);\n $queryText = debugPrepQuery($query, $sqlParms);\n\n if ($stmt->execute($sqlParms))\n { // success\n if ($debug)\n $warn .= \"<p>Language::__construct: \" . __LINE__ . \n \" query='$queryText'</p>\\n\";\n\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $count = count($result);\n if ($count == 1)\n { // existing record\n $dbrow = $result[0];\n $needInsert = false;\n } // existing record\n else\n if ($count == 0)\n { // create a new record\n // set defaults\n $dbrow = self::$initRow;\n $dbrow['code639_1'] = $code;\n $dbrow['name'] = \"Language: '$code'\";\n $needInsert = true;\n } // create new record\n else\n { // error performing query\n $this->msg .= \"Language::__construct: '$queryText' \" .\n \"returns $count records. \";\n } // error performing query\n } // success\n else\n { // error performing query\n $this->msg .=\"Language::__construct: '$queryText' \" .\n print_r($stmt->errorInfo(),true);\n } // error performing query\n } // search parameters\n else\n { // build from existing record\n $dbrow = $parms;\n $needInsert = false;\n } // build from existing record\n } // an array with at least one entry\n else\n { // unsupported parameter type\n throw new Exception(\"Language::__construct: \" .\n \"parameter must be an array: is \" .\n gettype($parms));\n } // unsupported parameter type\n\n\n // invoke constructor of base class\n parent::__construct($dbrow,\n 'Languages');\n $this->needInsert = $needInsert;\n\n if (!is_null($cc))\n {\n $this->extras['cc'] = $cc;\n }\n\n // diagnostic output if debug is set\n $this->dump('Language Record constructed:');\n }",
"protected static function getLanguageService() {}",
"public function language(string $language);",
"public function get_language()\n {\n }",
"public static function run() {\n\n // We are looking for language in the user's cookie\n if (isset($_COOKIE['x-language-id'])) {\n $isset = LangHelper::getLanguageByParam('id', $_COOKIE['x-language-id']);\n if ($isset !== null) {\n return $isset['id'];\n }\n }\n\n // Let's look at the language of the browser\n if (getenv('HTTP_ACCEPT_LANGUAGE')) {\n $arr = explode(';', getenv('HTTP_ACCEPT_LANGUAGE'));\n foreach ($arr as $val) {\n $val = preg_replace(\"/^q=[\\d\\.]+,?/\", '', $val);\n $isset = LangHelper::getLanguageByParam('locale', substr($val, 0, 2));\n if ($isset !== null) {\n return $isset['id'];\n }\n }\n }\n\n // Default language\n $lang_id = LangHelper::getLanguage('id');\n if ($lang_id !== null) {\n return $lang_id;\n }\n\n }",
"public function language($language_code)\n\t{\n\t\t$check = DB::select(\"SELECT COUNT(*) as count FROM langs WHERE code = '\".escape($language_code).\"'\")[0];\n\t\tif ($check->count > 0)\n\t\t{\n\t\t\tsetcookie('lang', $language_code,time()+31556926,'/');\n\t\t} else {\n\t\t\treturn 'Language not found';\n\t\t}\n\t\treturn redirect()->to('/');\n\t}",
"public function getSiteDefaultLanguage();",
"private function setLanguage()\n\t{\n\t\tif (isset($_GET['language']))\n\t\t\t$id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0;\n\t\tif (!isset($id_lang))\n\t\t\t$id_lang = ($this->getIdByHAL());\n\t\t$this->lang = $this->xml_file->lang[(int)($id_lang)];\n\t}",
"public function settingLanguage() {}",
"public function __construct() \n {\n //$session->start();\n\n //$request = new Request();\n //echo $request->query->get('lang');\n //$language = (null == $request->query->get('lang')) ? $request->query->get('lang') : 'en';\n //echo $language;die;\n //$session->set('language', $language);\n //echo $request->setLocale($language);\n }",
"static function getLanguage (){\n return self::$language;\n }",
"public function getLocale($lang = \"\")\n {\n if(!in_array($lang, getAvailableLanguages())) $lang = DEFAULT_LANG;\n if($this->lang == $lang)\n {\n return;\n }\n\n global $sDB;\n $this->lang = $lang;\n\n if(LANG_USE_CACHE && file_exists($this->getTemplateRootAbs().\"lang_\".$lang.\".php\"))\n {\n $langCache = file_get_contents($this->getTemplateRootAbs().\"lang_\".$lang.\".php\");\n if(strlen($langCache) > 3)\n {\n $langCache = unserialize(substr($langCache, 3));\n if(is_array($langCache))\n {\n foreach($langCache as $key => $val)\n {\n $this->LANG_SET[$key] = $val;\n }\n return;\n }\n }\n }\n\n // load global language variables e.g. \"de\" for \"deDE\"\n $res = $sDB->execLocalization(\"SELECT * FROM `localization` WHERE `loc_language` = '\".mysql_real_escape_string(substr($lang, 0, 2)).\"';\");\n while($row = mysql_fetch_object($res))\n {\n $this->LANG_SET[$row->loc_key] = $row->loc_val;\n }\n\n // load country specific overrides\n $res = $sDB->execLocalization(\"SELECT * FROM `localization` WHERE `loc_language` = '\".mysql_real_escape_string($lang).\"';\");\n while($row = mysql_fetch_object($res))\n {\n $this->LANG_SET[$row->loc_key] = $row->loc_val;\n }\n }",
"public static function loadLang() {\n\t\tif (!is_object($GLOBALS['LANG'])) {\n\n\t\t\trequire_once t3lib_extMgm::extPath('lang') . 'lang.php';\n\t\t\t//TODO see pt_tool smarty!\n\t\t\t$GLOBALS['LANG'] = t3lib_div::makeInstance('language');\n\t\t\t$GLOBALS['LANG']->csConvObj = t3lib_div::makeInstance('t3lib_cs');\n\t\t}\n\t\tif (is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->config['config']['language']) {\n\t\t\t$LLkey = $GLOBALS['TSFE']->config['config']['language'];\n\t\t\t$GLOBALS['LANG']->init($LLkey);\n\t\t}\n\n\t}",
"function default_lang()\n {\n $browser_lang = !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ',') : '';\n $browser_lang = substr($browser_lang, 0,2);\n if(array_key_exists($browser_lang, $this->languages))\n return $browser_lang;\n else{\n reset($this->languages);\n return key($this->languages);\n }\n }",
"public function __construct() {\n\t\t$this->languages[WCF::getLanguage()->getLanguageID()] = WCF::getLanguage();\n\t\t$this->languages[0] = WCF::getLanguage();\n\t\tparent::__construct();\n\t}",
"function init($language='')\n {\n global $iConfig, $aLanguage;\n\n $def_lang = $iConfig['default_lng'];\n if (empty($language)) $language = $def_lang;\n $path = sprintf('language/%2s_lang.php', $language);\n\n if (!file_exists($path))\n {\n $path=sprintf('language/%2s_lang.php', 'en'); \n } \n if (file_exists($path))\n {\n include_once($path);\n return $lang; \n }\n return FALSE;\n }",
"public function Lang() {\n $this->langFolder = FILES['LOCALE'].(file_exists(FILES['LOCALE'].((locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) !== null) ? \n locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) : \"en_US\").\"/global.lang\") ? locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) : \"en_US\").\"/\";\n return $this;\n }",
"public function language(){\n\t\tdefined('MGK_LANGUAGE')\n\t\t || define('MGK_LANGUAGE', $this->lang );\n\n\t\t$language = MGK_LANGUAGE;\t\n\t\t$file_lang = MGK_APPLICATION_DIRECTORY.'/_language/'.$language.'.json';\n\t\t$this->mgkLang = new Amaguk_lang( $language );\t\t\t\n\t\t$this->mgkLang->read_lang($file_lang);\t\t\t\n\t}",
"abstract public function get_app_language();",
"function initLanguage() {\n global $_ARRLANG, $basePath, $language;\n\n $language = $this->_getLanguage();\n\n require_once($basePath.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$language.'.lang.php');\n }",
"public function __construct(string $language = null)\n {\n if ($language !== null) {\n $this->language = $this->getLanguage($language);\n }\n }",
"public function language()\n {\n if(is_null($this->defaultLanguage)) {\n $config = $this->settings('config');\n\n if(!isset($config['i18n'])) {\n $config['i18n'] = 'en_US';\n }\n\n $settings = $this->path('settings');\n $path = $settings.'/i18n/'.$config['i18n'].'.php';\n\n $translations = array();\n\n if(file_exists($path)) {\n $translations = $this->settings('i18n/'.$config['i18n']);\n }\n\n $this->defaultLanguage = $this('language', $translations);\n }\n\n return $this->defaultLanguage;\n }",
"public static function setLang(string $cookie_lang, string $ln)\n {\n setcookie($cookie_lang, $ln, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 30, '/');\n }",
"private function _makeSureThereIsALanguageID()\n {\n if (empty(Session::get('languageID'))) {\n if (strstr(URL::getDomainExtension(), 'localhost')\n || strstr(URL::getDomainExtension(), 'nl')\n ) {\n Session::save('languageID', 1);\n } elseif (strstr(URL::getDomainExtension(), 'com')) {\n Session::save('languageID', 2);\n }\n }\n }",
"public function getLang();",
"private function initDefaultLanguage()\r\n\t{\r\n\t\t$default_language = $this->xml->xpath(\"configuration/config[@name='languages']/language[position()=1]/@code\");\r\n\t\t\r\n\t\tif ( count($default_language) > 0)\r\n\t\t{\r\n\t\t\t$this->default_language = (string) $default_language[0][\"code\"];\r\n\t\t}\t\t\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->default_language = null;\r\n\t\t}\r\n\r\n\t\treturn $this->default_language;\r\n\t}",
"public function getCookieLocale()\n {\n return $this->request->cookie('locale');\n }",
"function setWpLocale($lang) {\n\t$localLocale = $_COOKIE['dk_locale'];\n\t$currentSite = get_current_blog_id();\n\t$siteDetail = get_blog_details($currentSite);\n\n\tif ($localLocale == 'en_CA' || $currentSite == '3') {\n\t\t$val = 'en_CA';\n\t\theader( 'Location: '. $siteDetail->siteurl);\n\t\tsetcookie(\"dk_locale\", $val, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $val);\n\n\t\treturn $val;\n\t} else if($localLocale == 'fr_CA' || $currentSite == '2') {\n\t\t$val = 'fr_CA';\n\t\theader( 'Location: '. $siteDetail->siteurl);\n\t\tsetcookie(\"dk_locale\", $val, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $val);\n\n\t\treturn $val;\n\t} else {\n\t\tsetcookie(\"dk_locale\", $lang, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $lang);\n\t\treturn $lang;\n\t}\n\t\n}",
"function initLangCode()\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\t// lang_code is only required in $this->fetchnodedata\n\t\tif (!is_object($ilUser))\n\t\t{\n\t\t\t$this->lang_code = \"en\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->lang_code = $ilUser->getCurrentLanguage();\n\t\t}\n\t}",
"public function setLanguage($language = null){\n\t\t\tif ($language)\n\t\t\t\t$_SESSION['language'] = $language;\n\n\t\t\tif (@!$_SESSION['language'])\n\t\t\t\t$_SESSION['language'] = $this->default_language;\n\t\t\t\t//$_SESSION['language'] = $this->detectLanguage();\n\n if ($this->checkLanguage($_SESSION['language'])) {\n \t$lang = $_SESSION['language'];\n \treturn $lang;\n }\n else {\n \treturn $this->default_language;\n }\n\t\t}",
"private function setLang(){\n\n\t\tif( isset($_GET['lang']) )\n\t\t\t$lang\t= $_GET['lang'];\n\n\t\telse{\n\t\t\t$sess_lang\t= session('lang');\n\t\t\t$lang\t\t= $sess_lang ? $sess_lang : App::getLocale();\n\t\t}\n\n\t\tsession(['lang'=>$lang]);\n\t\tApp::setLocale( $lang );\n\t}",
"function init(){\n if( Yii::$app->user->isGuest ){\n Yii::$app->getResponse()->redirect(array('/df/logout',302));\n Yii::$app->end();\n }\n parent::init();\n if( isset($_REQUEST['_lang']) ){\n Yii::$app->language = $_REQUEST['_lang'];\n Yii::$app->session['_lang'] = Yii::$app->language;\n }else if( isset(Yii::$app->session['_lang']) ){\n Yii::$app->language = Yii::$app->session['_lang'];\n }else{\n Yii::$app->language = 'es_ve';\n Yii::$app->session['_lang'] = Yii::$app->language;\n }\n}",
"protected function getLanguage()\n {\n $lang = 1;\n try {\n $lang = Registry::get('lang');\n } catch (\\Exception $e) {\n if (!empty($_SESSION['lang'])) {\n $lang = $_SESSION['lang'];\n }\n\n if (!empty($this->user->languageId)) {\n $lang = $this->user->languageId;\n }\n\n $this->setLanguage($lang);\n }\n\n return $lang;\n }",
"public function languageObject()\n {\n if (!$this->language)\n {\n $this->language = $this->attribute('language_id') ? eZContentLanguage::fetch( $this->attribute('language_id') ) : false;\n }\n \n return $this->language;\n }",
"private function setLang( $lang ) {\n\t\tif( in_array( $lang, $this->mLanguages ) ) {\n\t\t\t$this->mLang = $lang;\n\t\t\t\n\t\t\tsetcookie(\"soxred_lang\", $this->mLang, time()+60*60*24*365);\n\t\t}\n\t}",
"protected function initializeAction() {\n\t\t$httpRequest = $this->request->getHttpRequest();\n\t\tif ($httpRequest->hasCookie('GIB_GradingTool_Language')) {\n\t\t\t$cookie = $httpRequest->getCookie('GIB_GradingTool_Language');\n\t\t\t$language = $cookie->getValue();\n\t\t\tif (array_key_exists($language, $this->settings['languages'])) {\n\t\t\t\t// requested language is valid, therefore we use it\n\t\t\t\t$locale = new \\TYPO3\\Flow\\I18n\\Locale($language);\n\t\t\t} else {\n\t\t\t\t// requested language is invalid, we fall back to default language\n\t\t\t\t$locale = new \\TYPO3\\Flow\\I18n\\Locale($this->settings['defaultLanguage']);\n\t\t\t}\n\t\t} else {\n\t\t\t$locale = new \\TYPO3\\Flow\\I18n\\Locale($this->settings['defaultLanguage']);\n\t\t}\n\n\t\t$this->i18nService->getConfiguration()->setCurrentLocale($locale);\n\n\n\t}",
"static private function CreateLanguageMessage() {\n\t\tif (!IllaUser::loggedIn()) {\n\t\t\t$german_browser = (ereg('de', $_SERVER['HTTP_ACCEPT_LANGUAGE']) ? true : false);\n\t\t}else {\n\t\t\t$german_browser = IllaUser::german();\n\t\t}\n\t\tif (($german_browser && self::isEnglish()) || (!$german_browser && self::isGerman())) {\n\t\t\t$short_filename = substr_replace(basename($_SERVER['PHP_SELF']), '', 0, 2);\n\t\t\t$path = str_replace($short_filename, '', $_SERVER['PHP_SELF']);\n\t\t\t$path = substr_replace($path, '', - 2, 2);\n\n\t\t\tif (count($_GET) > 0) {\n\t\t\t\t$getparams = array();\n\t\t\t\tforeach ($_GET as $key => $value) {\n\t\t\t\t\t$getparams[] = htmlentities($key) . '=' . htmlentities($value);\n\t\t\t\t}\n\t\t\t\t$getparams = '?' . implode('&', $getparams);\n\t\t\t}else {\n\t\t\t\t$getparams = '';\n\t\t\t}\n\n\t\t\tif (self::isEnglish() && file_exists('de' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Deine bevorzugte Sprache scheint Deutsch zu sein. Klick hier um zur deutschen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Your favoured language seems to be German. Click here to view the German version of this page.</a>', 'note');\n\t\t\t} elseif (self::isGerman() && file_exists('us' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Deine bevorzugte Sprache scheint Englisch zu sein. Klick hier um zur englischen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Your favoured language seems to be English. Click here to view the English version of this page.</a>', 'note');\n\t\t\t}\n\t\t}\n\t}",
"static function get()\n\t{\n\t\treturn self::$lang;\n\t}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}"
]
| [
"0.74363446",
"0.7336603",
"0.72527003",
"0.70751953",
"0.6992766",
"0.69846064",
"0.6956935",
"0.69214267",
"0.6902246",
"0.6731746",
"0.6694129",
"0.6638939",
"0.6623871",
"0.6563098",
"0.6481587",
"0.6446854",
"0.640243",
"0.636519",
"0.63343775",
"0.6307495",
"0.62820816",
"0.62703925",
"0.6265559",
"0.62507665",
"0.621256",
"0.6163855",
"0.61217993",
"0.60869503",
"0.60818523",
"0.6052888",
"0.60059726",
"0.59937465",
"0.5989884",
"0.5969612",
"0.59618896",
"0.59618896",
"0.59486556",
"0.59486556",
"0.59486556",
"0.59486556",
"0.59486556",
"0.59486556",
"0.59339935",
"0.5929729",
"0.59271944",
"0.5915827",
"0.5903399",
"0.59024113",
"0.5892159",
"0.58897877",
"0.58432996",
"0.58332634",
"0.5832971",
"0.5815136",
"0.58088696",
"0.5805137",
"0.5794292",
"0.57857585",
"0.5776967",
"0.57744956",
"0.57730514",
"0.5767099",
"0.57618433",
"0.57574844",
"0.57551134",
"0.5754096",
"0.5751775",
"0.5738326",
"0.57161105",
"0.5712525",
"0.5708704",
"0.5706008",
"0.57002276",
"0.56932753",
"0.56894606",
"0.5687807",
"0.5684082",
"0.5668331",
"0.56559557",
"0.5654752",
"0.5645685",
"0.563802",
"0.56377935",
"0.56357855",
"0.5624981",
"0.56216335",
"0.5619259",
"0.5606527",
"0.55976355",
"0.5596073",
"0.5596073",
"0.5596073",
"0.5596073",
"0.5596073",
"0.5596073",
"0.5596073",
"0.5595953",
"0.5595953",
"0.5595953",
"0.5595953"
]
| 0.74361664 | 1 |
end __construct Gets the browser language and check if is in languages acepted | private function _get_browser_lang () {
$browser_lang = strtoupper(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));
$this->lang = $browser_lang;
/*
$this->lang = in_array($browser_lang, $this->_accept_langs)
? $browser_lang
: $this->_default_lang;
*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function language();",
"public function language();",
"static private function DetectLanguage() {\n\t\tself::$language = substr(basename($_SERVER['REQUEST_URI']), 0, 2);\n\t\tif (self::$language != 'de' && self::$language != 'us') {\n\t\t\tself::$language = 'us';\n\t\t}\n\t}",
"public function initializeLanguages() {}",
"abstract public function get_app_language();",
"public function getSystemLanguages() {}",
"public function getSystemLanguages() {}",
"public function get_language()\n {\n }",
"public function __construct(){\n\t\t\n\t\t \n\t\t // check if locale dir exists\n\t\t if ( ! file_exists( LOCALE_PATH ) ){\n\t\t\t$this->addError( \"'\".LOCALE_PATH .\"' folder was not found. Check this before using this class\" );\n\t\t }\n\t\t \n\t\t // check if a *valid* get request exists.\n\t\t if( isset( $_GET[ 'lang' ] ) && strlen( $_GET[ 'lang' ] ) == 2 && strspn( $_GET[ 'lang' ], 'abcdefghijklmnopqrstuvwxyz' ) == 2 ){\n\t\t\t\t\n\t\t\t\t// try to change locale folder and save session as well\n\t\t\t if( file_exists( LOCALE_PATH . \"/\" . $_GET[ 'lang' ] ) ) {\n\t\t\t\t\t$this->language = $_GET[ 'lang' ];\n\t\t\t\t\t$_SESSION[ 'lang' ] = $_GET[ 'lang' ];\n\t\t\t\t} else {\n\t\t\t\t\t$this->addError( \"'\" . $_GET[ 'lang' ] . \"' language folder was not found\" ); \n\t\t\t\t}\n\t\t} else if ( isset( $_SESSION[ 'lang' ] ) && strlen( $_SESSION[ 'lang' ] ) == 2 && strspn( $_SESSION[ 'lang' ], 'abcdefghijklmnopqrstuvwxyz' ) == 2 ){\n\t\t\t// check session\n\t\t\t// try to load locale folder\n\t\t\tif( file_exists( LOCALE_PATH . \"/\" . $_SESSION[ 'lang' ] ) ) {\n\t\t\t\t$this->language = $_SESSION[ 'lang' ];\n\t\t\t} else {\n\t\t\t\t$this->addError( \"'\" . $_SESSION[ 'lang' ] . \"' language folder was not found\" ); \n\t\t\t}\n\t\t}\n\t\t \n\t\t $this->languagePath = LOCALE_PATH . \"/\" .$this->language;\n\t\t \n\t }",
"function _Language()\n\t{\n\t\tlog_message('debug', \"Language Class Initialized\");\n\t}",
"function check_language () {\n \n global $CONF;\n $supported_languages \t\t\t= array ('de', 'en');\n $lang_array \t\t\t\t\t\t= preg_split ('/(\\s*,\\s*)/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n \n if (is_array ($lang_array)) {\n \n $lang_first \t\t\t\t\t= strtolower ((trim (strval ($lang_array[0]))));\n $lang_first \t\t\t\t\t= substr ($lang_first, 0, 2);\n \n if (in_array ($lang_first, $supported_languages)) {\n \n $lang \t\t\t\t\t\t= $lang_first;\n \n } else {\n \n $lang \t\t\t\t\t\t= $CONF['default_language'];\n \n }\n } else {\n \n $lang\t\t\t\t\t\t\t = $CONF['default_language'];\n \n }\n \n return $lang;\n}",
"public static function getSystemLanguages() {}",
"public function settingLanguage() {}",
"public function languages();",
"private function langSetup()\n {\n /**\n * Set default language\n */\n $this->lang = array_keys($this->langsSupported)[0];\n\n /**\n * Force use default lang\n */\n $this->setLang($this->lang);\n return;\n\n $langFromGetParam = Arr::get($_GET, self::GET_PARAM_NAME);\n $langFromCookies = Arr::get($_COOKIE, self::COOKIE_NAME);\n\n /**\n * Choose language based on user's previous choice\n */\n if ($langFromCookies && $this->valid($langFromCookies)) {\n $this->lang = $langFromCookies;\n } else {\n $this->setLang($this->lang);\n }\n\n /**\n * If lang in GET params then save this value to cookies\n */\n if ($langFromGetParam && $this->valid($langFromGetParam)) {\n $this->setLang($langFromGetParam);\n }\n }",
"protected function getLanguages() {}",
"function signup_get_available_languages()\n {\n }",
"public function __construct()\n {\n $this->_makeSureThereIsALanguageID();\n if (intval(Session::get('languageID')) === self::DUTCH_LANGUAGE_ID) {\n Config::set('languageID', 1);\n Config::set('languageCode', 'nl');\n Config::set('languageName', 'Dutch');\n setlocale(LC_ALL, 'nl_NL');\n setlocale(LC_MONETARY, 'de_DE');\n loadFile(RESOURCES_PATH . '/language/dutch/dutch_translations.php');\n } elseif (intval(Session::get('languageID')) === self::ENGLISH_LANGUAGE_ID) {\n Config::set('languageID', 2);\n Config::set('languageCode', 'en');\n Config::set('languageName', 'English');\n setlocale(LC_ALL, 'en_US.UTF-8');\n setlocale(LC_MONETARY, 'en_US');\n loadFile(RESOURCES_PATH . '/language/english/english_translations.php');\n }\n }",
"public function getLanguage() {}",
"public function setYiiLang(){\r\n $get_lang = Yii::app()->getRequest()->getParam(Yii::app()->urlManager->languageParam);//check if we have lang in url\r\n if (!in_array($get_lang,array_keys(Yii::app()->params['translatedLanguages'])) &&\r\n isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\r\n $langList = Util::sortByPriority($_SERVER['HTTP_ACCEPT_LANGUAGE']);\r\n foreach ($langList as $lang => $quality) {\r\n foreach (Defaults::$supportedLanguages as $supported) {\r\n if (strcasecmp($supported, $lang) == 0) {\r\n Yii::app()->language = $supported;\r\n break 2;\r\n }\r\n }\r\n }\r\n }\r\n }",
"public function init()\n {\n \theader('content-type: text/html; charset=utf8');\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\n \t$this->tr = Application_Form_FrmLanguages::getCurrentlanguage();\n\t}",
"public function __construct () {\n\t\tparent::__construct();\n\t\t$this->load->library(\"language\");\n\t}",
"function lixlpixel_detect_lang()\n{\n lixlpixel_get_env_var('HTTP_ACCEPT_LANGUAGE');\n lixlpixel_get_env_var('HTTP_USER_AGENT');\n\n $_AL=strtolower($GLOBALS['HTTP_ACCEPT_LANGUAGE']);\n $_UA=strtolower($GLOBALS['HTTP_USER_AGENT']);\n\n // Try to detect Primary language if several languages are accepted.\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(strpos($_AL, $K)===0)\n return $K;\n }\n \n // Try to detect any language if not yet detected.\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(strpos($_AL, $K)!==false)\n return $K;\n }\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(preg_match(\"//[\\[\\( ]{$K}[;,_\\-\\)]//\",$_UA))\n return $K;\n }\n\n // Return default language if language is not yet detected.\n return $GLOBALS['_DLANG'];\n}",
"protected function _language()\n {\n if (sizeof($this->_config['language']) > 1) {\n $language = $this->getRequest()->getParam('language');\n if (!empty($language)) {\n $this->_language = $language . '/';\n $this->_metaLanguage = $language;\n } else if (!empty($this->_session->language)) {\n $this->_language = $this->_session->language . '/';\n $this->_metaLanguage = $this->_session->language;\n } else {\n $browserLanguage = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n if (in_array($browserLanguage, $this->_config['language'])) {\n $this->_session->language = $browserLanguage;\n $this->_language = $browserLanguage . '/';\n $this->_metaLanguage = $browserLanguage;\n } else {\n $this->_language = $this->_config['language'][0] . '/';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }\n } else {\n $this->_language = '';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }",
"abstract protected function initializeCulture();",
"private function initLangs()\n {\n $langs = $this->getLangs();\n if (!$langs) {\n return;\n }\n\n // If the lang is set in query parameters...\n if (array_key_exists(self::LANG_KEY, $this->query)) {\n // ... and it is valid -> change the current language.\n // Yes, we are violating semantics of GET request here, but the operation is idempotent.\n if (in_array($this->query[self::LANG_KEY], $langs)) {\n $this->currentLang = $this->query[self::LANG_KEY];\n setcookie(self::LANG_KEY, $this->currentLang);\n }\n\n // Remove the lang from query parameters and redirect to self...\n unset($this->query[self::LANG_KEY]);\n $url = $this->rawPath;\n if ($this->query) {\n $url .= '?' . http_build_query($this->query);\n }\n header(\"Location: $url\");\n exit;\n }\n\n if (array_key_exists(self::LANG_KEY, $_COOKIE) && in_array($_COOKIE[self::LANG_KEY], $langs)) {\n // If the lang is set in cookies ...\n $this->currentLang = $_COOKIE[self::LANG_KEY];\n } elseif (($httpLang = $this->getLangFromHTTP()) !== null) {\n // Try to get the language from Accept-Language HTTP header...\n $this->currentLang = $httpLang;\n } elseif (in_array('en', $langs)) {\n // English is prefered default...\n $this->currentLang = 'en';\n } else {\n // If everything fails, get first lang of the config...\n $this->currentLang = reset($langs);\n }\n }",
"public function get_desired_languages();",
"public function hasLanguage() : bool;",
"public function test_get_supported_languages()\n {\n $ocr = new \\App\\Modules\\OCR\\OCR();\n\n $lang = $ocr->supportedLanguages();\n\n PHPUnit::assertContains(\n 'eng',\n $lang,\n );\n\n }",
"function httpbl_lang()\n {\n foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language)\n { if ($language=='fr') { return 'fr'; } }\n return 'en';\n }",
"private function _detectUserLanguage() {\n $locale = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n preg_match_all(\"/([a-z]{2})-?([a-z]{2})?/i\", $locale, $languages);\n\n $this->_generateLanguageList();\n\n if (!$this->_setLanguage($languages))\n $this->defaultLanguage = 'en';\n }",
"function __construct() {\r\n\t\t\t\tparent :: __construct();\r\n\t\t\t\t$this->langdef = DEFLANG;\r\n\t\t}",
"public function language()\n {\n \tif ( is_english() ){\n\t\t $this->session->engels = false;\n\t } else {\n\t\t $this->session->engels = true;\n }\n\t redirect($this->agent->referrer());\n }",
"private static function checkLanguages()\n {\n $acceptLanguage = self::getAcceptLanguage();\n self::$languages = array();\n\n if (!empty($acceptLanguage)) {\n $httpLanguages = preg_split('/q=([\\d\\.]*)/', $acceptLanguage, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n\n $languages = array();\n $key = 0;\n foreach (array_reverse($httpLanguages) as $value) {\n $value = trim($value, ',; .');\n if (is_numeric($value)) {\n $key = $value;\n } else {\n $languages[$key] = explode(',', $value);\n }\n }\n krsort($languages);\n\n foreach ($languages as $value) {\n self::$languages = array_merge(self::$languages, $value);\n }\n }\n }",
"function getSessionLanguage()\n {\n\n // define all the global variables\n global $user;\n\n // check if its a user or guest session\n if ($this->logged_in()) { // user session\n\n // grab the users preferred language\n $language = $user->getPreferredLanguage();\n\n } else { // guest session\n\n // check if any cookies were to be found for a custom language\n if (isset($_COOKIE['language'])) {\n $language = $_COOKIE['language'];\n } else {\n $language = \"\";\n }\n }\n\n // check if $language has been initialized or not\n if (is_string($language) && $language != \"\") {\n return $language; // if no errors then return the language string\n } else {\n return false; // if no language, then just return false\n }\n }",
"protected function checkIfLanguagesExist() {}",
"function __construct()\n {\n // ie $this->lang\n $this->setupLocale();\n }",
"public function __construct() {\n\t\t$this->original_locale = is_admin() ? get_user_locale() : get_locale();\n\t\t$this->available_languages = array_merge( array( 'en_US' ), get_available_languages() );\n\t}",
"function default_lang()\n {\n $browser_lang = !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ',') : '';\n $browser_lang = substr($browser_lang, 0,2);\n if(array_key_exists($browser_lang, $this->languages))\n return $browser_lang;\n else{\n reset($this->languages);\n return key($this->languages);\n }\n }",
"function init(){\n if( Yii::$app->user->isGuest ){\n Yii::$app->getResponse()->redirect(array('/df/logout',302));\n Yii::$app->end();\n }\n parent::init();\n if( isset($_REQUEST['_lang']) ){\n Yii::$app->language = $_REQUEST['_lang'];\n Yii::$app->session['_lang'] = Yii::$app->language;\n }else if( isset(Yii::$app->session['_lang']) ){\n Yii::$app->language = Yii::$app->session['_lang'];\n }else{\n Yii::$app->language = 'es_ve';\n Yii::$app->session['_lang'] = Yii::$app->language;\n }\n}",
"function lang() {\r\n\t\tif($this->language === \"french\") {\r\n\t\t\tforeach($this->config['lang_fr'] as $tag_name) {\r\n\t\t\t\t$this->code = preg_replace('/<' . $tag_name . '([^<>]*)>/', '<' . $tag_name . ' lang=\"fr\" xml:lang=\"fr\"$1>', $this->code);\r\n\t\t\t\t$this->code = preg_replace('/<' . $tag_name . ' lang=\"fr\" xml:lang=\"fr\"([^<>]*) lang=\"fr\" xml:lang=\"fr\"([^<>]*)>/', '<' . $tag_name . ' lang=\"fr\" xml:lang=\"fr\"$1$2>', $this->code);\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($this->language === \"english_and_french\") {\r\n\t\t\tpreg_match_all('/<body[^<>]*>(.*?)<\\/body>/is', $this->code, $matches);\r\n\t\t\t$initial_body_code = $body_code = $matches[1][0];\r\n\t\t\t$replace_count = -1;\r\n\t\t\twhile($replace_count != 0) {\r\n\t\t\t\t$body_code = preg_replace('/<(\\w*)([^<>]*)>\\s*([^<>\\/]*[^\\s])\\s*\\/\\s*([^<>\\/]{1,})\\s*</is', '<$1$2><span lang=\"en\" xml:lang=\"en\">$3</span> / <span lang=\"fr\" xml:lang=\"fr\">$4</span><', $body_code, -1, $replace_count);\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_body_code, $body_code, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"lang\", $ct);\r\n\t\treturn true;\r\n\t}",
"function initLangCode()\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\t// lang_code is only required in $this->fetchnodedata\n\t\tif (!is_object($ilUser))\n\t\t{\n\t\t\t$this->lang_code = \"en\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->lang_code = $ilUser->getCurrentLanguage();\n\t\t}\n\t}",
"public function getAllowedLanguages() {}",
"private static function set() {\n if(!empty(Dispatcher::$args['lang']) && self::isAvailable(Dispatcher::$args['lang'])) {\n $_GET['lang'] = Dispatcher::$args['lang'];\n }\n if(!empty($_GET['lang']) && self::isAvailable($_GET['lang'])) {\n //Set on page\n self::$lang = $_GET['lang'];\n //Set in session\n if(empty($_SESSION['lang']) || $_SESSION['lang'] != $_GET['lang']) {\n $_SESSION['lang'] = $_GET['lang'];\n }\n //Set in cookie\n if(empty($_COOKIE['lang']) || $_COOKIE['lang'] != $_GET['lang']) {\n self::setCookie($_GET['lang']);\n }\n return true;\n } elseif(!empty($_COOKIE['lang']) && self::isAvailable($_COOKIE['lang'])) {\n self::$lang = $_COOKIE['lang'];\n //set in session\n if(empty($_SESSION['lang']) || $_SESSION['lang'] != $_COOKIE['lang']) {\n $_SESSION['lang'] = $_COOKIE['lang'];\n }\n return true;\n } elseif(!empty($_SESSION['lang']) && self::isAvailable($_SESSION['lang'])) {\n //set on page\n self::$lang = $_SESSION['lang'];\n //set cookie if empty\n if(empty($_COOKIE['lang']) || $_COOKIE['lang'] != $_SESSION['lang']) {\n self::setCookie($_SESSION['lang']);\n }\n return true;\n }\n return false;\n }",
"function determine_locale()\n {\n }",
"private function _detectLanguage() {\n if (isset($_GET['language']) && is_file('lang/'. $_GET['language'] .'.lang.php'))\n return $_GET['language'];\n\n $session = PHPSession::getInstance();\n\n if (isset($session['language']))\n return $session['language'];\n\n return $this->_getWebBrowserLanguage();\n }",
"public function Lang() {\n $this->langFolder = FILES['LOCALE'].(file_exists(FILES['LOCALE'].((locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) !== null) ? \n locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) : \"en_US\").\"/global.lang\") ? locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) : \"en_US\").\"/\";\n return $this;\n }",
"public function __construct() {\n\t\t$this->languages[WCF::getLanguage()->getLanguageID()] = WCF::getLanguage();\n\t\t$this->languages[0] = WCF::getLanguage();\n\t\tparent::__construct();\n\t}",
"public function init()\r\n {\r\n \theader('content-type: text/html; charset=utf8');\r\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\r\n \t$this->tr = Application_Form_FrmLanguages::getCurrentlanguage();\r\n \t$this->type = 1;\r\n\t}",
"function resolveLanguageFromBrowser()\n {\n $ret = false;\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $env = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n $aLangs = preg_split(\n ';[\\s,]+;',\n substr($env, 0, strpos($env . ';', ';')), -1,\n PREG_SPLIT_NO_EMPTY\n );\n foreach ($aLangs as $langCode) {\n $lang = $langCode . '-' . SGL_Translation::getFallbackCharset();\n if (SGL_Translation::isAllowedLanguage($lang)) {\n $ret = $lang;\n break;\n }\n }\n }\n return $ret;\n }",
"function loadLanguage() {\r\n\t\tstatic $loaded ;\r\n\t\tif (!$loaded) {\r\n\t\t\t$lang = & JFactory::getLanguage() ;\r\n\t\t\t$tag = $lang->getTag();\r\n\t\t\tif (!$tag)\r\n\t\t\t\t$tag = 'en-GB' ;\t\t\t\r\n\t\t\t$lang->load('com_osmembership', JPATH_ROOT, $tag);\r\n\t\t\t$loaded = true ;\t\r\n\t\t}\t\t\r\n\t}",
"public function init()\r\n\t{\r\n\t\t$this->tr=Application_Form_FrmLanguages::getCurrentlanguage();\r\n\t\theader('content-type: text/html; charset=utf8');\r\n\t\tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\r\n\t}",
"public function init()\r\n {\r\n \t$this->tr=Application_Form_FrmLanguages::getCurrentlanguage();\r\n \theader('content-type: text/html; charset=utf8');\r\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\r\n\t}",
"function getCurrentLanguage() {\n if(strtolower($_SERVER['HTTP_HOST'][0].$_SERVER['HTTP_HOST'][1]) == \"en\") {\n return \"en\";\n }\n return \"cs\";\n}",
"protected function loadJavaScriptLanguageStrings() {}",
"public function getLang();",
"public static function loadLang() {\n\t\tif (!is_object($GLOBALS['LANG'])) {\n\n\t\t\trequire_once t3lib_extMgm::extPath('lang') . 'lang.php';\n\t\t\t//TODO see pt_tool smarty!\n\t\t\t$GLOBALS['LANG'] = t3lib_div::makeInstance('language');\n\t\t\t$GLOBALS['LANG']->csConvObj = t3lib_div::makeInstance('t3lib_cs');\n\t\t}\n\t\tif (is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->config['config']['language']) {\n\t\t\t$LLkey = $GLOBALS['TSFE']->config['config']['language'];\n\t\t\t$GLOBALS['LANG']->init($LLkey);\n\t\t}\n\n\t}",
"function _load_languages()\r\n\t{\r\n\t\t// Load the form validation language file\r\n\t\t$this->lang->load('form_validation');\r\n\r\n\t\t// Load the DataMapper language file\r\n\t\t$this->lang->load('datamapper');\r\n\t}",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"private function checkFrontendLanguage() {\r\n\t\t// search for the corresponding Joomla language \r\n\t\t// Read the languages dir to find new installed languages\r\n\t\t// This method returns a list of JLanguage objects with the related inforamtion\r\n\t\t$systemLanguages = JLanguage::getKnownLanguages(JPATH_SITE);\r\n\t\tif(array_key_exists($this->lang_code, $systemLanguages)) {\r\n\t\t\t$this->jLanguage = JLanguage::getInstance($this->lang_code);\r\n\t\t\tif($this->jLanguage != null) {\r\n\t\t\t\t$this->iso = $this->jLanguage->get('locale');\r\n\t\t\t\t$this->backwardlang = $this->jLanguage->get('backward');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->jLanguage = null;\r\n\t\t}\r\n\t}",
"function initLanguage() {\n global $_ARRLANG, $basePath, $language;\n\n $language = $this->_getLanguage();\n\n require_once($basePath.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$language.'.lang.php');\n }",
"function languageDetect()\n {\n global $iConfig;\n\n $langs = array();\n\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))\n {\n\n preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\\s*(;\\s*q\\s*=\\s*(1|0\\.[0-9]+))?/', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse); // break up string into pieces (languages and q factors)\n\n if (count($lang_parse[1]))\n {\n// $langs = array_combine($lang_parse[1], $lang_parse[4]); // create a list like \"en\" => 0.8 // PHP5 only\n foreach ($lang_parse[1] as $k => $v) $langs[$v] = $lang_parse[4][$k]; // replace \"array_combine\" for PHP4\n\n foreach ($langs as $lang => $val) {\n if ($val === '') $langs[$lang] = 1; // set default to 1 for any without q factor\n }\n arsort($langs, SORT_NUMERIC); // sort list based on value\n }\n }\n\n foreach ($langs as $lang => $val)\n {\n $lang_2s = substr($lang, 0,2);\n $path = sprintf('language/%s_lang.php', $lang_2s);\n if (file_exists($path)) return $lang_2s;\n }\n\n return $iConfig['default_lng'];\n }",
"public function __construct ($default_language, $lang = null) {\n\n\t\t$this->_default_lang = $default_language;\n\n\t\t$lang = ($lang != null) ? strtoupper($lang) : (isset($_COOKIE['lang']) ? $_COOKIE['lang'] : null);\n\n\t\tif ($lang != null) {\n\n\t\t\tif (file_exists(self::DIR_LANGS . $lang . '.php')) {\n\n\t\t\t\t$this->lang = $lang;\n\n\t\t\t} else {\n\n\t\t\t\t$this->_get_browser_lang();\n\n\t\t\t}//end else\n\n\t\t} else {\n\n\t\t\t$this->_get_browser_lang();\n\n\t\t}//end else\n\n\t\tif (isset($_COOKIE['lang'])) {\n\n\t\t\tif ($_COOKIE['lang'] != $this->lang) {\n\n\t\t\t\tsetcookie('lang', $this->lang, time() + 3600 * 24 * 365, '/');\n\n\t\t\t}//end if\n\n\t\t} else {\n\n\t\t\tsetcookie('lang', $this->lang, time() + 3600 * 24 * 365, '/');\n\n\t\t}//end else\n\n\t}",
"public function getAvailableLanguages() {}",
"protected function _extractLanguage() {\n // Default lanuage is always Lao\n $lang = 'lo';\n\n // Set the cookie name\n //$this->Cookie->name = '_osm_la';\n //echo $this->response->cookie(\"_osm_la\");\n \n // First check if the language parameter is set in the URL. The URL\n // parameter has first priority.\n $paramLang = $this->request->query(\"lang\");\n if (isset($paramLang)) {\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($paramLang, $this->_languages)) {\n // Set the language to the URL parameter\n $lang = $paramLang;\n }\n } else if ($this->Cookie->read($this->_languageCookie) != null) {\n // Check if a cookie is set and set its value as language. A Cookie\n // has second priority\n $cookieValue = $this->Cookie->read($this->_languageCookie);\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($cookieValue, $this->_languages)) {\n // Set the language to the Cookie value\n $lang = $cookieValue;\n }\n }\n\n // If neither the lang parameter nor a cookie is set, set and return\n // Lao as language.\n //$this->log(var_dump($this));\n //$this->response->cookie($this->_languageCookie => $lang ]);\n return $lang;\n }",
"function load_language($language,$class){\n\t}",
"function detectLangCode() {\n\t\t// If HTTP_ACCEPT_LANGUAGE is empty use defaultLangCode:\n\t\tif(empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n\t\t\t$this->_langCode = $this->_defaultLangCode;\n\t\t\treturn;\n\t\t}\n\n\t\t// Split up the HTTP_ACCEPT_LANGUAGE header:\n\t\t$acceptedLanguages = preg_split('/,\\s*/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\t\t\n\t\t$currentLangCode = $this->_defaultLangCode;\n\t\t$currentLangQuality = 0.0;\n\t\t\n\t\tforeach($acceptedLanguages as $acceptedLanguage) {\n\t\t\t// Parse the language string:\n\t\t\t$match = preg_match($this->_regExpAcceptLangCode, $acceptedLanguage, $matches);\n\t\t\t// Check if the syntax is valid:\n\t\t\tif(!$match) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// Get and split the language code:\t\n\t\t\t$langCodeParts = explode ('-', $matches[1]);\n\t\t\t\n\t\t\t// Get the language quality given as float value:\n\t\t\tif(isset($matches[2])) {\n\t\t\t\t$langQuality = (float)$matches[2];\n\t\t\t} else {\n\t\t\t\t// Missing language quality value is maximum quality:\n\t\t\t\t$langQuality = 1.0;\n\t\t\t}\n\n\t\t\t// Go through it until the language code is empty:\n\t\t\twhile(count($langCodeParts)) {\n\t\t\t\t// Join the current langCodeParts:\n\t\t\t\t$langCode = strtolower(join('-', $langCodeParts));\n\t\t\t\t// Check if the langCode is in the available list:\n\t\t\t\tif(in_array($langCode, $this->_availableLangCodes)) {\n\t\t\t\t\t// Check the quality setting:\n\t\t\t\t\tif ($langQuality > $currentLangQuality) {\n\t\t\t\t\t\t$currentLangCode = $langCode;\n\t\t\t\t\t\t$currentLangQuality = $langQuality;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If strict mode is set, don't minimalize the language code:\n\t\t\t\tif($this->_strictMode) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// else chop off the right part:\n\t\t\t\tarray_pop($langCodeParts);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_langCode = $currentLangCode;\n\t}",
"private function detectLanguage()\n {\n $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n\n switch (mb_strtolower($lang)) {\n case 'ru':\n return 'russian';\n\n default:\n return 'english';\n }\n }",
"static private function CreateLanguageMessage() {\n\t\tif (!IllaUser::loggedIn()) {\n\t\t\t$german_browser = (ereg('de', $_SERVER['HTTP_ACCEPT_LANGUAGE']) ? true : false);\n\t\t}else {\n\t\t\t$german_browser = IllaUser::german();\n\t\t}\n\t\tif (($german_browser && self::isEnglish()) || (!$german_browser && self::isGerman())) {\n\t\t\t$short_filename = substr_replace(basename($_SERVER['PHP_SELF']), '', 0, 2);\n\t\t\t$path = str_replace($short_filename, '', $_SERVER['PHP_SELF']);\n\t\t\t$path = substr_replace($path, '', - 2, 2);\n\n\t\t\tif (count($_GET) > 0) {\n\t\t\t\t$getparams = array();\n\t\t\t\tforeach ($_GET as $key => $value) {\n\t\t\t\t\t$getparams[] = htmlentities($key) . '=' . htmlentities($value);\n\t\t\t\t}\n\t\t\t\t$getparams = '?' . implode('&', $getparams);\n\t\t\t}else {\n\t\t\t\t$getparams = '';\n\t\t\t}\n\n\t\t\tif (self::isEnglish() && file_exists('de' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Deine bevorzugte Sprache scheint Deutsch zu sein. Klick hier um zur deutschen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Your favoured language seems to be German. Click here to view the German version of this page.</a>', 'note');\n\t\t\t} elseif (self::isGerman() && file_exists('us' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Deine bevorzugte Sprache scheint Englisch zu sein. Klick hier um zur englischen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Your favoured language seems to be English. Click here to view the English version of this page.</a>', 'note');\n\t\t\t}\n\t\t}\n\t}",
"private function __construct() {\n $this->_language = $this->_detectLanguage();\n\n $this->_i18n = include 'lang/'. $this->_language .'.lang.php';\n\n $this->setLocale();\n }",
"public function getBrowserLanguages()\n {\n if(array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {\n return $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n }\n\n\n return null;\n }",
"protected function _set_client_language()\n\t{\n\t\t$code = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n\t\t$lang = $this->find_by('code', $code);\n\t\t$lang OR $lang = $this->default;\n\t\treturn $lang;\n\t}",
"function __construct() {\n\t\t//echo '__construc';\n\t\t//$this->getLang('article', 'article');\n\t\t//jieqi_loadlang('article', 'article');\n\t}",
"public function getLanguages() {}",
"function check_language($lang)\n{\n\tif(!isset($_SESSION[\"lang\"]))\n\t{\n\t\t$langs = explode(\";\", $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\t\tif(strpos($langs[0], \"es\") !== false)\n\t\t\t$_SESSION[\"lang\"] = \"es\";\n\t\telse\n\t\t\t$_SESSION[\"lang\"] = \"en\";\t\t\n\t}\n\t\t\n\t//drozas: Check if the user has tried to set the language, and change it then\n\tif(isset($lang))\n\t\t$_SESSION[\"lang\"] = $lang;\n\t\n}",
"function __construct() {\r\n\t\t//$language =& JFactory::getLanguage();\r\n\t\t//$language->load('com_jafilia');\r\n\t\tparent::__construct();\t\t\r\n\t}",
"function lang()\n\t{\n\t\t$lang = (empty($_COOKIE['lang'])) ? 'italiano' : $_COOKIE['lang'];\n\t\t$this->lang=$lang;\n\t\t$this->lang_frequency=$lang.$this->lang_frequency_suffix;\n\t\t\n\t\t\n\n\t\t$n=\"\";\n\t\t$i=1;\n\t\twhile (isset($_COOKIE['lang'.$n]))\n\t\t{\n\t\t\t$i++;\n\t\t\t\t\n\t\t\t$this->lang_a[$i][0]=$_COOKIE['lang'.$n];\n\t\t\t$this->lang_a[$i][1]=$_COOKIE['lang'.$n].\"_frequency\"; //Non sò a cosa serva però...\n\t\t\t$n=$i;\n\t\t}\n\n\t\n\t\n\t\n\t}",
"private function _getUserAgentLanguage()\n {\n $matches = $languages = [];\n\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n // ISO Language Codes, 2-letters: ISO 639-1, <Country tag>[-<Country subtag>]\n // Simplified language syntax detection: xx[-yy]\n preg_match_all(\n '/([a-z]{1,8}(-[a-z]{1,8})?)\\s*(;\\s*q\\s*=\\s*(1|0\\.[0-9]+))?/i',\n $_SERVER['HTTP_ACCEPT_LANGUAGE'],\n $matches\n );\n\n if (count($matches[1])) {\n $languages = array_combine($matches[1], $matches[4]);\n foreach ($languages as $lang => $val) {\n if ($val === '') {\n $languages[$lang] = 1;\n }\n }\n arsort($languages, SORT_NUMERIC);\n }\n foreach ($languages as $lang => $val) {\n if (self::isASupportedLanguage(strtoupper($lang))) {\n $this->acceptedLanguage = $lang;\n break;\n }\n }\n }\n }",
"public function language(){\n\t\tdefined('MGK_LANGUAGE')\n\t\t || define('MGK_LANGUAGE', $this->lang );\n\n\t\t$language = MGK_LANGUAGE;\t\n\t\t$file_lang = MGK_APPLICATION_DIRECTORY.'/_language/'.$language.'.json';\n\t\t$this->mgkLang = new Amaguk_lang( $language );\t\t\t\n\t\t$this->mgkLang->read_lang($file_lang);\t\t\t\n\t}",
"public function SetUpLanguages()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->_languages = null;\n \n // Basic error checking.\n if ($this->_my_server instanceof c_comdef_server) {\n $langs = $this->_my_server->GetServerLangs();\n \n if (is_array($langs) && count($langs)) {\n foreach ($langs as $key => $value) {\n $this->_languages[$key] = 0;\n }\n }\n }\n }",
"private function _getWebBrowserLanguage() {\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && ! empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $navigatorLanguageList = array_flip($this->getLanguageList());\n\n foreach ($navigatorLanguageList as $k => &$v)\n $v = substr($k, 0, 2);\n\n $navigatorLanguageList = array_flip($navigatorLanguageList);\n\n foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $rawLanguageData) {\n $languageData = explode(';', $rawLanguageData);\n $preferredLanguage = substr(array_shift($languageData), 0, 2);\n\n if (is_file('lang/'. $navigatorLanguageList[$preferredLanguage] .'.lang.php'))\n return $navigatorLanguageList[$preferredLanguage];\n }\n die;\n }\n\n return 'english';\n }",
"private function set_lang()\n\t{\n\t\t//print_r($this->CI->uri->rsegment_array());\n\t\t//echo $this->CI->uri->ruri_string();\n\t\t\n\t\t// Set from default config\n\t\t$this->lang = $this->lang_default;\n\t\t\t\t\n\t\t// Set from browser\n\t\tif ($this->detect_browser)\n\t\t{\n\t\t\t$this->lang = $this->detect_browser_lang();\n\t\t}\n\n\t\t// Set from session\n\t\t$this->set_session();\n\t\t\n\t\t// Set from URI\n\t\t$first_segment = $this->CI->uri->segment(1);\n\t\tif (in_array($first_segment, $this->langs))\n\t\t{\n\t\t\t$this->lang = $first_segment;\n\t\t\t$this->set_session($first_segment);\n\t\t}\n\t}",
"private function getBrowserLanguage()\n {\n // getting http instruction if not provided\n $str = (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : \"\");\n // exploding accepted languages\n $langs = explode(',', $str);\n\n return $langs;\n }",
"public function supportsLanguageSwitch(): bool;",
"public function system_language_auto(){\n\t\t// Get my current\n\t\t\t$tld = $this->zajlib->tld;\n\t\t\t$subdomain = $this->zajlib->subdomain;\n\t\t\tunset($_GET['locale']);\n\t\t\tunset($_GET['disable_locale_cookie']);\n\t\t\tunset($_COOKIE['ofw_locale']);\n\t\t// No setting means that default is set\n\t\t\t$this->zajlib->tld = 'com';\n\t\t\t$this->zajlib->subdomain = 'www';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical($this->zajlib->lang->get_default_locale(), $setting);\n\t\t// Set my tld (should be stronger than query string)\n\t\t\t$this->zajlib->tld = 'hu';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('hu_HU', $setting);\n\t\t// Set my subdomain (should be stronger than tld)\n\t\t\t$this->zajlib->subdomain = 'en';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('en_US', $setting);\n\t\t// Set my query string (should be strong than tld or subdomain)\n\t\t\t$_GET['locale'] = 'fr_FR';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('fr_FR', $setting);\n\t\t// Reset tld and subdomain and other cleanup\n\t\t\t$this->zajlib->subdomain = $subdomain;\n\t\t\t$this->zajlib->tld = $tld;\n\t}",
"public static function en(){\n setcookie('language', 'en', time()+60);\n }",
"public function __construct() {\n $this->browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n $this->language = in_array($this->browser_lang, $this->accept_languages)\n ? $this->browser_lang\n : $this->default_lang;\n if(!empty($_COOKIE['language']) AND in_array($_COOKIE['language'], $this->accept_languages)) {\n $this->language = $_COOKIE['language'];\n }\n\n // go for the query parameter defined in .htaccess\n if(!empty($_GET['q'])) {\n $string = rtrim($_GET['q'], '/');\n $expl = explode('/', $string);\n $this->request = implode(DS, $expl);\n foreach($expl as $part) {\n $crumbs[$part] = ucwords(str_replace(array('_','-'), ' ', $part));\n }\n $this->title = $this->title.' - '.ucwords(str_replace(array('_','-'), ' ', end($expl)));\n $content_path = 'content'.DS.$this->language.DS.$this->request.'.php';\n }\n\n $this->content_path = 'content'.DS.$this->language.DS.$this->request.'.php';\n }",
"public function __construct()\n {\n global $Registry; \n $this->registry =& $Registry;\n \n // load init language files\n $this->load('init');\n $this->load('init_lang'); \n \n $this->lang_meta = $this->registry->_lang_meta;\n $this->lang = $this->registry->_lang; \n }",
"protected function __construct() {\n\n if(empty(self::$validLocale))\n self::loadConfig();\n\n self::$currentLocale = self::$validLocale[0];\n }",
"public function getLang()\n {\n \t$lang_path = 'lang/';\n if(isset($_GET['lang']))\n {\n Yii::app()->session[\"lang\"] = $_GET['lang']; \n }\n \n if(!file_exists($lang_path.Yii::app()->session[\"lang\"].'.ini'))\n {\n\t\t\tYii::app()->session[\"lang\"] = 'sr';\n }\n\t\t\n\t\t$this->langArray= parse_ini_file($lang_path.Yii::app()->session[\"lang\"].'.ini'); \n }",
"private static function getLanguage()\n {\n if (isset($_COOKIE[\"language\"]))\n {\n return $_COOKIE[\"language\"];\n }\n else\n {\n // Default is Czech\n return \"cs\";\n }\n }",
"function getRespectSysLanguage() ;",
"public function init(): void {\n if (!isset($this->language)) {\n $this->language = $this->selectLang();\n $this->getTranslator()->setLang($this->language);\n }\n /*if ($redirect && $this->urlLang !== $this->language) {\n $this->getPresenter()->forward('this', ['lang' => $this->language]);\n }*/\n }",
"public function detectLanguage() {\n\t\t\tif ($_SERVER['HTTP_ACCEPT_LANGUAGE']) {\n\t\t\t\t$this->languages = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n\t\t\t\t$this->language = substr($this->languages,0,2);\n\t\t\t\treturn $this->language;\n\t\t\t}\n\t\t\telse if ($_SERVER['HTTP_USER_AGENT']) {\n $this->user_agent = explode(\";\" , $_SERVER['HTTP_USER_AGENT']);\n\n\t\t\t\tfor ($i=0; $i < sizeof($this->user_agent); $i++) {\n\t\t\t\t\t$this->languages = explode(\"-\",$this->user_agent[$i]);\n\t\t\t\t\tif (sizeof($this->languages) == 2) {\n\t\t\t\t\t\tif (strlen(trim($this->languages[0])) == 2) {\n\t\t\t\t\t\t\t$size = sizeof($this->language);\n\t\t\t\t\t\t\t$this->language[$size]=trim($this->languages[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $this->language[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->language = $this->default_language;\n\t\t\t\treturn $this->language;\n\t\t\t}\n\t\t}",
"function mLANG(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$LANG;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:231:3: ( 'lang' ) \n // Tokenizer11.g:232:3: 'lang' \n {\n $this->matchString(\"lang\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }"
]
| [
"0.7355413",
"0.7355413",
"0.7228588",
"0.72249216",
"0.7095907",
"0.70864546",
"0.70852286",
"0.70807153",
"0.70752335",
"0.70179117",
"0.69878113",
"0.69487673",
"0.6917999",
"0.69048834",
"0.68999183",
"0.68750554",
"0.6834487",
"0.68326",
"0.6821681",
"0.68089026",
"0.68056685",
"0.68004936",
"0.67871964",
"0.6784878",
"0.67764807",
"0.6775033",
"0.67557114",
"0.6754884",
"0.67539346",
"0.6740826",
"0.673616",
"0.6734663",
"0.6733292",
"0.6724294",
"0.67222613",
"0.6714749",
"0.6707718",
"0.66936135",
"0.66761297",
"0.66759646",
"0.6669789",
"0.66579354",
"0.6651757",
"0.6650686",
"0.66473925",
"0.6630835",
"0.66233635",
"0.65984267",
"0.6588545",
"0.6574711",
"0.65590525",
"0.65514046",
"0.6550378",
"0.6541711",
"0.65328145",
"0.65303636",
"0.6528747",
"0.6523768",
"0.6523449",
"0.6523449",
"0.6523449",
"0.6523449",
"0.6523449",
"0.6523449",
"0.65156096",
"0.6514203",
"0.65127134",
"0.6510932",
"0.6504085",
"0.6503408",
"0.6497258",
"0.6497193",
"0.6495193",
"0.64883554",
"0.64779145",
"0.6464111",
"0.646356",
"0.645597",
"0.6453013",
"0.6452383",
"0.6442898",
"0.64377904",
"0.64371043",
"0.64317125",
"0.64254093",
"0.6422853",
"0.6421596",
"0.6419116",
"0.6416518",
"0.63754517",
"0.63632333",
"0.6354923",
"0.63537014",
"0.6350753",
"0.63504857",
"0.6344261",
"0.63413763",
"0.63408536",
"0.6338466",
"0.6326589"
]
| 0.7323759 | 2 |
end _get_browser_lang Require the language file and save it contents insisde the "$t" attributte | public function get_translations ($type = 'file') {
if ($this->lang != null) {
if ($type == 'file') {
$this->t = $this->_get_translations_from_file();
} elseif ($type == 'db') {
$this->t = $this->_get_translations_from_db();
}//end elsefi
}//end if
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function codepress_get_lang($filename)\n {\n }",
"function save_langfile()\n\t{\n\t\t//-----------------------------------------\n\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно определить ID языка\");\n\t\t}\n\n\t\tif ($this->ipsclass->input['lang_file'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Вы должны указать имя языкового модуля, вернитесь назад и попробуйте еще раз\");\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'languages', 'where' => \"lid='\".$this->ipsclass->input['id'].\"'\" ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно найти язык по введенному ID\");\n\t\t}\n\n\t\t$lang_file = CACHE_PATH.\"cache/lang_cache/\".$row['ldir'].\"/\".$this->ipsclass->input['lang_file'];\n\n\t\tif (! file_exists( $lang_file ) )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно найти файл '$lang_file', проверьте есть ли он.\");\n\t\t}\n\n\t\tif (! is_writeable( $lang_file ) )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно записать в файл '$lang_file', проверьте права доступа (CHMOD) и, если необходимо установить права доступа 0777. IPB не может сделать это за вас\");\n\t\t}\n\n\t\t$barney = array();\n\n\t\tforeach ($this->ipsclass->input as $k => $v)\n\t\t{\n\t\t\tif ( preg_match( \"/^XX_(\\S+)$/\", $k, $match ) )\n\t\t\t{\n\t\t\t\tif ( isset($this->ipsclass->input[ $match[0] ]) )\n\t\t\t\t{\n\t\t\t\t\t$v = str_replace(\"'\", \"'\", stripslashes($_POST[ $match[0] ]) );\n\t\t\t\t\t$v = str_replace(\"<\", \"<\", $v );\n\t\t\t\t\t$v = str_replace(\">\", \">\", $v );\n\t\t\t\t\t$v = str_replace(\"&\", \"&\", $v );\n\t\t\t\t\t$v = str_replace(\"\\r\", \"\", $v );\n\n\t\t\t\t\t$barney[ $match[1] ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( count($barney) < 1 )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Что-то сделано не так, вернитесь назад и попробуйте еще раз\");\n\t\t}\n\n\t\t$start = \"<?php\\n\\n\".'$lang = array('.\"\\n\";\n\n\t\tforeach($barney as $key => $text)\n\t\t{\n\t\t\t$text = preg_replace(\"/\\n{1,}$/\", \"\", $text);\n\t\t\t$start .= \"\\n'\".$key.\"' => \\\"\".str_replace( '\"', '\\\"', $text).\"\\\",\";\n\t\t}\n\n\t\t$start .= \"\\n\\n);\\n\\n?\".\">\";\n\n\t\tif ($fh = fopen( $lang_file, 'w') )\n\t\t{\n\t\t\tfwrite($fh, $start );\n\t\t\tfclose($fh);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя сделать запись в $lang_file\");\n\t\t}\n\n\t\tif ( $this->ipsclass->input['id'] )\n\t\t{\n\t\t\t$this->ipsclass->admin->done_screen(\"Язык обновлен\", \"Управление языками\", \"{$this->ipsclass->form_code}&code=edit&id={$this->ipsclass->input['id']}\", 'redirect' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->admin->done_screen(\"Язык обновлен\", \"Управление языками\", \"{$this->ipsclass->form_code}\", 'redirect' );\n\t\t}\n\t}",
"protected function getLocalLangFileName() {}",
"private function _get_translations_from_file () {\n\n\t\t$lang = file_exists(self::DIR_LANGS . $this->lang . '.php')\n\t\t\t\t\t? $this->lang : $this->_default_lang;\n\n\t\trequire self::DIR_LANGS . $lang . '.php';\n\n\t\treturn $t;\n\n\t}",
"function _getLanguageFile()\n\t{\n\t\tglobal $_CB_framework;\n\t\t$UElanguagePath=$_CB_framework->getCfg('absolute_path').'/components/com_comprofiler/plugin/user/plug_cbjemmyattending';\n\t\tif (file_exists($UElanguagePath.'/language/'.$_CB_framework->getCfg('lang').'.php')) {\n\t\t\tinclude_once($UElanguagePath.'/language/'.$_CB_framework->getCfg('lang').'.php');\n\t\t} else {\n\t\t\tinclude_once($UElanguagePath.'/language/english.php');\n\t\t}\n\t}",
"static private function CreateLanguageMessage() {\n\t\tif (!IllaUser::loggedIn()) {\n\t\t\t$german_browser = (ereg('de', $_SERVER['HTTP_ACCEPT_LANGUAGE']) ? true : false);\n\t\t}else {\n\t\t\t$german_browser = IllaUser::german();\n\t\t}\n\t\tif (($german_browser && self::isEnglish()) || (!$german_browser && self::isGerman())) {\n\t\t\t$short_filename = substr_replace(basename($_SERVER['PHP_SELF']), '', 0, 2);\n\t\t\t$path = str_replace($short_filename, '', $_SERVER['PHP_SELF']);\n\t\t\t$path = substr_replace($path, '', - 2, 2);\n\n\t\t\tif (count($_GET) > 0) {\n\t\t\t\t$getparams = array();\n\t\t\t\tforeach ($_GET as $key => $value) {\n\t\t\t\t\t$getparams[] = htmlentities($key) . '=' . htmlentities($value);\n\t\t\t\t}\n\t\t\t\t$getparams = '?' . implode('&', $getparams);\n\t\t\t}else {\n\t\t\t\t$getparams = '';\n\t\t\t}\n\n\t\t\tif (self::isEnglish() && file_exists('de' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Deine bevorzugte Sprache scheint Deutsch zu sein. Klick hier um zur deutschen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Your favoured language seems to be German. Click here to view the German version of this page.</a>', 'note');\n\t\t\t} elseif (self::isGerman() && file_exists('us' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Deine bevorzugte Sprache scheint Englisch zu sein. Klick hier um zur englischen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Your favoured language seems to be English. Click here to view the English version of this page.</a>', 'note');\n\t\t\t}\n\t\t}\n\t}",
"public function getLang()\n {\n \t$lang_path = 'lang/';\n if(isset($_GET['lang']))\n {\n Yii::app()->session[\"lang\"] = $_GET['lang']; \n }\n \n if(!file_exists($lang_path.Yii::app()->session[\"lang\"].'.ini'))\n {\n\t\t\tYii::app()->session[\"lang\"] = 'sr';\n }\n\t\t\n\t\t$this->langArray= parse_ini_file($lang_path.Yii::app()->session[\"lang\"].'.ini'); \n }",
"abstract public function get_app_language();",
"public function language();",
"public function language();",
"function lang() {\r\n\t\t\tload_plugin_textdomain( 'rv-portfolio', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\r\n\t\t}",
"function make_lang_var()\n\t{\n\t\t// Pfad einbinden\n\t\tglobal $pfad;\n\n\t\t// Backend Sprache\n\t}",
"function pnLangLoad()\n{\n\t// See if a language update is required\n $newlang = pnVarCleanFromInput('newlang');\n if (!empty($newlang)) {\n $lang = $newlang;\n pnSessionSetVar('lang', $newlang);\n } else {\n $detectlang = pnConfigGetVar('language_detect');\n $defaultlang = pnConfigGetVar('language');\n\n switch ($detectlang) { \n case 1: // Detect Browser Language\n\t\t $cnvlanguage=cnvlanguagelist();\n $currentlang='';\n \t $langs = preg_split ('/[,;]/',$_SERVER['HTTP_ACCEPT_LANGUAGE']);\n \t foreach ($langs as $lang) {\n \t \t if (isset($cnvlanguage[$lang]) && file_exists('language/' . pnVarPrepForOS($cnvlanguage[$lang]) . '/global.php')) {\n \t \t $currentlang=$cnvlanguage[$lang];\n \t \t break;\n \t \t }\n \t }\n if ($currentlang=='')\n \t $currentlang=$defaultlang;\n \t \t break;\n default:\n $currentlang=$defaultlang; \n }\n $lang = pnSessionGetVar('lang');\n }\n \n // Load global language defines\n\t// these are deprecated and will be moved to the relevant modules\n\t// with .8x\n if (isset ($lang) && file_exists('language/' . pnVarPrepForOS($lang) . '/global.php')) {\n $currentlang = $lang;\n } else {\n $currentlang = pnConfigGetVar('language');\n pnSessionSetVar('lang', $currentlang);\n }\n\t$oscurrentlang = pnVarPrepForOS($currentlang);\n\tif (file_exists('language/' . $oscurrentlang . '/global.php')) {\n\t include 'language/' . $oscurrentlang . '/global.php';\n\t}\n\n\t// load the languge language file\n\tif (file_exists('language/languages.php')) {\n\t\tinclude 'language/languages.php';\n\t}\n\n\t// load the core language file\n\tif (file_exists('language/' . $oscurrentlang . '/core.php')) {\n\t\tinclude 'language/' . $oscurrentlang . '/core.php';\n\t}\n\n\t// V4B RNG\n\tif (file_exists('language/' . $oscurrentlang . '/v4blib.php')) {\n\t\tinclude 'language/' . $oscurrentlang . '/v4blib.php';\n\t}\n\t// V4B RNG\n\n\t// set the correct locale\n\t// note: windows has different requires for the setlocale funciton to other OS's\n\t// See: http://uk.php.net/setlocale\n\tif (stristr(getenv('OS'), 'windows')) {\n\t\t// for windows we either use the _LOCALEWIN define or the existing language code\n\t\tif (defined('_LOCALEWIN')) {\n\t\t\tsetlocale(LC_ALL, _LOCALEWIN);\n\t\t} else {\n\t\t\tsetlocale(LC_ALL, $currentlang);\n\t\t}\n\t} else {\n\t\t// for other OS's we use the _LOCALE define\n\t\tsetlocale(LC_ALL, _LOCALE);\n\t}\n}",
"function choose_lang() {\n\tglobal $lang;\n\t\n\t// Get lang file array\n\t$lang_ar = glob('include/text_??.json');\n\t\n\t// Display lang list\n\techo \"<SELECT ID=c_lang NAME=\\\"lang\\\">\\n\";\n\t$lang_count = count($lang_ar);\n\tfor ($i = 0; $i < $lang_count; $i++) {\n\t\t$lang_val = preg_replace(\"/^.*text_(..)\\.json$/\", \"$1\", $lang_ar[$i]);\n\t\techo \"<OPTION VALUE=$lang_val\";\n\t\tif ($lang_val == $lang) {\n\t\t\techo \" SELECTED\";\n\t\t}\n\t\techo \">$lang_val</OPTION>\";\n\t}\n\techo \"</SELECT>\\n\";\n}",
"public function language(){\n\t\tdefined('MGK_LANGUAGE')\n\t\t || define('MGK_LANGUAGE', $this->lang );\n\n\t\t$language = MGK_LANGUAGE;\t\n\t\t$file_lang = MGK_APPLICATION_DIRECTORY.'/_language/'.$language.'.json';\n\t\t$this->mgkLang = new Amaguk_lang( $language );\t\t\t\n\t\t$this->mgkLang->read_lang($file_lang);\t\t\t\n\t}",
"private function _getWebBrowserLanguage() {\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && ! empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $navigatorLanguageList = array_flip($this->getLanguageList());\n\n foreach ($navigatorLanguageList as $k => &$v)\n $v = substr($k, 0, 2);\n\n $navigatorLanguageList = array_flip($navigatorLanguageList);\n\n foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $rawLanguageData) {\n $languageData = explode(';', $rawLanguageData);\n $preferredLanguage = substr(array_shift($languageData), 0, 2);\n\n if (is_file('lang/'. $navigatorLanguageList[$preferredLanguage] .'.lang.php'))\n return $navigatorLanguageList[$preferredLanguage];\n }\n die;\n }\n\n return 'english';\n }",
"public function lang() {\n\t\t\tload_plugin_textdomain( 'cherry-site-shortcodes', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n\t\t}",
"private function read() \n {\n if ($this->lang == '') $this->lang = App::getLocale();\n $this->path = base_path().'/resources/lang/'.$this->lang.'/'.$this->file.'.php';\n $this->arrayLang = Lang::get($this->file);\n if (gettype($this->arrayLang) == 'string') $this->arrayLang = array();\n }",
"function parselang()\n{\n $langdir = realpath(__DIR__ . \"/../../lang\") . DIRECTORY_SEPARATOR;\n $langfile = $langdir . \"lang.json\";\n $langfile = file_get_contents($langfile);\n $lang = json_decode($langfile, true);\n $lfile = $langdir . 'language.' . $lang[\"lang\"] . '.php';\n return (file_exists($lfile)) ? $lfile : $langdir . 'language.en.php';\n}",
"private function _get_browser_lang () {\n\n\t\t$browser_lang = strtoupper(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));\n\n\t\t$this->lang = $browser_lang;\n/*\n\t\t$this->lang = in_array($browser_lang, $this->_accept_langs)\n\t\t\t\t\t\t? $browser_lang\n\t\t\t\t\t\t: $this->_default_lang;\n*/\n\t}",
"function get_lang ()\r\n {\r\n return $_SESSION[\"lang\"];\r\n }",
"public static function loadCDNLanguage() {\n\t\tglobal $_LANG, $CONFIG;\n\n\t\t$currentDir = getcwd();\n\t\tchdir( dirname( __FILE__ ) . '/lang/' );\n\t\t$availableLangs = glob( '*.txt' );\n\n\t\t$language = isset( $_SESSION[ 'Language' ] ) ? $_SESSION[ 'Language' ] : $CONFIG[ 'Language' ];\n\t\t$language = ucfirst( $language ) . '.txt';\n\n\t\tif( ! in_array( $language, $availableLangs ) ) {\n\t\t\t$language = 'English.txt';\n\t\t}\n\n\t\t$templang = file_get_contents( dirname( __FILE__ ) . '/lang/' . $language );\n\t\teval ( $templang );\n\t\tchdir( $currentDir );\n\t}",
"public function settingLanguage() {}",
"function getLanguage($url, $ln = null, $type = null) {\n\t// Type 2: Change the path for the /requests/ folder location\n\t// Set the directory location\n\tif($type == 2) {\n\t\t$languagesDir = '../languages/';\n\t} else {\n\t\t$languagesDir = './languages/';\n\t}\n\t// Search for pathnames matching the .png pattern\n\t$language = glob($languagesDir . '*.php', GLOB_BRACE);\n\n\tif($type == 1) {\n\t\t// Add to array the available images\n\t\tforeach($language as $lang) {\n\t\t\t// The path to be parsed\n\t\t\t$path = pathinfo($lang);\n\t\t\t\n\t\t\t// Add the filename into $available array\n\t\t\t$available .= '<li><a href=\"'.$url.'index.php?lang='.$path['filename'].'\">'.ucfirst(strtolower($path['filename'])).'</a></li>';\n\t\t}\n\t\treturn substr($available, 0, -3);\n\t} else {\n\t\t// If get is set, set the cookie and stuff\n\t\t$lang = 'Venezuela'; // DEFAULT LANGUAGE\n\t\tif($type == 2) {\n\t\t\t$path = '../languages/';\n\t\t} else {\n\t\t\t$path = './languages/';\n\t\t}\n\t\tif(isset($_GET['lang'])) {\n\t\t\tif(in_array($path.$_GET['lang'].'.php', $language)) {\n\t\t\t\t$lang = $_GET['lang'];\n\t\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t\t} else {\n\t\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t\t}\n\t\t} elseif(isset($_COOKIE['lang'])) {\n\t\t\tif(in_array($path.$_COOKIE['lang'].'.php', $language)) {\n\t\t\t\t$lang = $_COOKIE['lang'];\n\t\t\t}\n\t\t} else {\n\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t}\n\n\t\tif(in_array($path.$lang.'.php', $language)) {\n\t\t\treturn $path.$lang.'.php';\n\t\t}\n\t}\n}",
"function load_t2s_text(){\n\tglobal $config, $t2s_langfile, $t2s_text_stand, $templatepath;\n\t\n\tif (file_exists($templatepath.'/lang/'.$t2s_langfile)) {\n\t\t$TL = parse_ini_file($templatepath.'/lang/'.$t2s_langfile, true);\n\t} else {\n\t\tLOGGING(\"For selected T2S language no translation file still exist! Please go to LoxBerry Plugin translation and create a file for selected language \".substr($config['TTS']['messageLang'],0,2),3);\n\t\texit;\n\t}\n\treturn $TL;\n}",
"function setLanguage() {\n\t\tif(isset($_GET['lang'])) {\n\t\t\t$language = $this->getLanguageFileName($_GET['lang']);\n\t\t} elseif(isset($_COOKIE['lang'])) {\n\t\t\t$language = $this->getLanguageFileName($_COOKIE['lang']);\n\t\t} else {\n\t\t\t$language = $this->getLanguageFileName('en-us');\n\t\t}\n\n\t\t//Sets the language cookie for 30 days\n\t\tsetcookie('lang', $language['meta'], time() + 60 * 60 * 24 * 30, '/');\n\n\t\treturn $language;\n\t}",
"public function action_web_language() {\n $package = Model::factory('package');\n $errors = array();\n $postvalue = $this->request->post();\n $action = $this->request->action();\n if(isset($postvalue['dynamic_lang']) && $postvalue['dynamic_lang']!=\"\"){\n $dynamic_lang = $postvalue['dynamic_lang'];\n }\n $language_setting_array = WEB_DB_LANGUAGE;\n if (isset($postvalue['web_lang_radio']) && $postvalue['web_lang_radio'] == 2 && Validation::factory(array_merge($_FILES,$postvalue))) {\n $validator = $package->validate_web_language(array_merge($_FILES,$postvalue));\n if ($validator->check()) {\n $get_site_info=$package->get_site_info();\n $domain_name=$get_site_info[0]['domain_name'];\n if (!empty($_FILES['web_language_file']['name'])) {\n $image_type = explode('.', $_FILES['web_language_file']['name']);\n $image_type = end($image_type);\n $image_name = $dynamic_lang.'_customize.' . $image_type;\n $fileName = $dynamic_lang.'_customize.xml';\n \n $target_path=CUSTOMLANGPATH.'i18n/';\n if (!is_dir($target_path) ) {\n Message::error(__('mentioned directory not availabe'));\n $this->request->redirect('/package/preferences');\n }\n \n $illegal_words = array('unlink', 'unset', 'exit;', 'break;');\n $file_handle = fopen($_FILES['web_language_file']['tmp_name'], \"r\");\n while (!feof($file_handle)) {\n $line_of_text = fgets($file_handle);\n if ($this->match($illegal_words, strtolower($line_of_text))) {\n Message::error(__('faile_upload_changes_made_info'));\n $this->request->redirect('/package/preferences');\n }\n }\n fclose($file_handle);\n \n \n\n /* if (file_exists($target_path . $image_name) && file_exists($target_path . $fileName)) {\n rename($target_path . $image_name, $target_path . 'en_customize.php');\n } elseif (file_exists($target_path . $image_name)) {\n rename($target_path . $image_name, $target_path . $fileName);\n }*/\n if (file_exists($target_path . $image_name)) {\n unlink($target_path . $image_name);\n }\n \n move_uploaded_file($_FILES['web_language_file']['tmp_name'], $target_path . $image_name);\n //rename($target_path . $image_name, $target_path . $fileName);\n chmod($target_path . $image_name, 0777);\n try {\n \n //print_r($target_path.$image_name); exit;\n //print_r($target_path.$image_name); exit;\n\t\t\t\t\t$fileContents = file_get_contents($target_path.$image_name); \n\t\t\t\t\t$fileContents=preg_replace('/[\\x00-\\x1f]/','',htmlspecialchars($fileContents));\t\t\t\t\t\n $xml_system = simplexml_load_string($fileContents) or die(\"Error: Cannot create object\");\n \n } catch (Exception $ex) {\n throw new Exception($ex);\n // Message::error(__('fail_upload_checkfile_error_info'));\n // $this->request->redirect('/package/preferences');\n }\n \n $child_array='';\n \n foreach ($xml_system->children()->string as $value) { \n $name=(string)$value['name']; \n $value_string=(string) ($value);\n $value_string=htmlentities($value_string);\n $value_string= str_replace('\"', \"'\", $value_string);\n $child_array.='\"'.$name.'\"'.'=>'.'\"'. $value_string.'\"'.',';\n } \n if (file_exists($target_path .$dynamic_lang.'.php')) {\n unlink($target_path.$dynamic_lang.'.php');\n }\n \n $string=\"<?php defined('SYSPATH') or die('No direct script access.');\"\n . \"return \";\n \n $fp = fopen($target_path.$dynamic_lang.'.php', 'w');\n chmod($target_path . $dynamic_lang.'.php', 0777);\n fwrite($fp, print_r($string, TRUE));\n fwrite($fp, print_r('['.$child_array.']', TRUE));\n fwrite($fp, print_r(';', TRUE));\n fclose($fp);\n \n $language_setting_array[$dynamic_lang] = 2;\n $data = array('website_language_settings', $language_setting_array);\n $status = $package->update_language_colorcode($data);\n Message::success(__('file_upload_succ_info'));\n $this->request->redirect('/package/preferences');\n } else {\n Message::error(__('fail_upload_error_info'));\n $this->request->redirect('/package/preferences');\n }\n } else {\n $errors = $validator->errors('errors');\n Message::error(__('file_upload_warning_info'));\n }\n } else {\n if (isset($postvalue['web_lang_radio']) && $postvalue['web_lang_radio'] == 1) {\n $validator = $package->validate_web_language($postvalue);\n if ($validator->check()) {\n $language_setting_array[$dynamic_lang] = 1;\n $data = array('website_language_settings', $language_setting_array);\n $status = $package->update_language_colorcode($data);\n Message::success(__('file_default_upload_succ_info'));\n $this->request->redirect('/package/preferences');\n } else {\n $errors = $validator->errors('errors');\n Message::error(__('fail_upload_default_info'));\n }\n } else {\n Message::error(__('fail_upload_default_info'));\n $this->request->redirect('/package/preferences');\n }\n }\n $this->template->meta_description = CLOUD_SITENAME . \" | Preferences \";\n $this->template->meta_keywords = CLOUD_SITENAME . \" | Preferences \";\n $this->template->title = CLOUD_SITENAME . \" | \" . __('Preferences');\n $this->template->page_title = __('Preferences');\n $this->template->content = View::factory(\"admin/package_plan/preferences\")->bind('action', $action)->bind('postvalue', $postvalue)->bind('errors', $errors);\n }",
"public function getSystemLanguages() {}",
"function getlang() {\n $cooklang = $_COOKIE['cooklang'];\n $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n $lang = $_GET['lang'];\n $dirlang = getdirlang();\n\n if (!isset ($lang)) {\n /* no language selection in http request */\n\n \n if (isset($dirlang)) {\n /* Language taken from path e.g., /fr/index.php -> fr */\n $lang = $dirlang;\n } else if (isset($cooklang)) {\n /* Language taken from cookie */\n $lang = $cooklang;\n } else {\n /* not even a cookie. Choose from http_accept_language --REWRITE this part!-- */\n/* while (\n empty($lang) &&\n preg_match('([a-z][a-z](-[A-Z][A-Z])?)', $accept, $res)\n ) {\n $lang = $res[1];\n $accept = ereg_replace(\"$lang\", '', $accept);\n } */\n }\n }\n\n if (!isset($lang) || !file_exists(BASEDIR . $lang . '/index.php')) {\n /* Use English as default */\n $lang = 'en';\n }\n\n /* Set the cookie only for the default path / but not e.g., /fr/ */\n if (!isset($dirlang))\n setcookie('cooklang', $lang, time() + 31536000);\n\n return $lang;\n}",
"public function getSystemLanguages() {}",
"public function system_language_file_variables(){\n\t // Verify app level lang\n $my_files = $this->zajlib->file->get_files('app/lang/', true);\n foreach($my_files as $f){\n $file = str_ireplace('app/lang/', '', $this->zajlib->file->get_relative_path($f));\n $fdata = explode('.', $file);\n // Check for old data\n if(strlen($fdata[1]) < 5) $this->zajlib->test->notice(\"Found old language file format: \".$file);\n else{\n $file = trim($fdata[0], '/');\n $this->verify_single_language_file($file);\n }\n }\n\n\t\t// Get all of the plugins (local lang files are in _project plugin)\n\t\tforeach($this->zajlib->plugin->get_plugins('app') as $plugin){\n\t\t\t$my_files = $this->zajlib->file->get_files('plugins/'.$plugin.'/lang/', true);\n\t\t\tforeach($my_files as $f){\n\t\t\t\t$file = str_ireplace('plugins/'.$plugin.'/lang/', '', $this->zajlib->file->get_relative_path($f));\n\t\t\t\t$fdata = explode('.', $file);\n\t\t\t\t// Check for old data\n\t\t\t\tif(strlen($fdata[1]) < 5) $this->zajlib->test->notice(\"Found old language file format: \".$file);\n\t\t\t\telse{\n\t\t\t\t\t$file = trim($fdata[0], '/');\n\t\t\t\t\t$this->verify_single_language_file($file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Get all of the plugins (local lang files are in _project plugin)\n\t\tforeach($this->zajlib->plugin->get_plugins('system') as $plugin){\n\t\t\t$my_files = $this->zajlib->file->get_files('system/plugins/'.$plugin.'/lang/', true);\n\t\t\tforeach($my_files as $f){\n\t\t\t\t$file = str_ireplace('system/plugins/'.$plugin.'/lang/', '', $this->zajlib->file->get_relative_path($f));\n\t\t\t\t$fdata = explode('.', $file);\n\t\t\t\t// Check for old data\n\t\t\t\tif(strlen($fdata[1]) < 5) $this->zajlib->test->notice(\"Found old language file format: \".$file);\n\t\t\t\telse{\n\t\t\t\t\t$file = trim($fdata[0], '/');\n\t\t\t\t\t$this->verify_single_language_file($file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function doTranslate($file,$languages){\n\techo \"\\n\\n=============================\\n\";\n\techo \"Translating $file\\n\";\n\techo \"=============================\\n\";\n\t$filenamepart=explodeFile($file);\n\t$buffer=file_get_contents($file);\n\t//loop through the languages\n\tforeach ($languages as $key=>$lang){\n\t\techo \"-----------------------------\\n\";\n\t\techo \"Translating to language $key\\n\";\n\t\techo \"-----------------------------\\n\";\n\t\t$posR=0;\n\t\t$translated = \"\";\n\t\twhile (true){\n\t\t\t//find next occurence of a data-i18n attribute\n\t\t\t$pos1 = getNextDataI18N($buffer,$posR+1);\n\t\t\t\n\t\t\t//if there is no more occurence, there's nothing more to do; break this loop\n\t\t\tif ($pos1==false) {break;}\n\t\t\t\n\t\t\t//else extract the dataName from this attribute\n\t\t\t$pos2 = getNextQuote($buffer,$pos1+1);\n\t\t\t$dataName = getTextBetween($buffer,$pos1,$pos2);\n\t\t\n\t\t\t//append with text that comes before the string to be translated\n\t\t\t$posL = getNextGt($buffer,$pos2);\n\t\t\t$translated .= getTextBefore($buffer,$posR,$posL);\n\t\t\t\n\t\t\t//append with translation of said string\n\t\t\t$replaceText = getI18nText($dataName,$lang);\n\t\t\techo \"* $dataName=$replaceText\\n\";\t\n\t\t\t$translated .= $replaceText;\n\t\t\t\n\t\t\t//go to end of translated string\n\t\t\t$posR = getNextLt($buffer,$posL);\n\t\t\t$pos1 = $posR;\n\t\t\n\t\t}\n\t\t//append part of file after last translated string\n\t\t$translated .= substr($buffer,$posR,-1);// getTextAfter($buffer,$posR);\n\t\t\n\t\t//if language directory does not exist, create it\n\t\t$directory = $filenamepart[0].\"$key/\"; \n\t\tif (!is_dir($directory)) {\n\t\t\tmkdir($directory);\n\t\t\techo \"* created directory $directory\\n\";\n\t\t}\n\t\t\n\t\t//create file for language\n\t\t$newFile=$directory.$filenamepart[1];\n\t\tfile_put_contents($newFile,$translated);\n\t\t\n\t}\n}",
"function getRespectSysLanguage() ;",
"public static function getSystemLanguages() {}",
"public function get_language()\n {\n }",
"private function changeLangFileContent() \n {\n $this->read();\n $this->arrayLang[$this->key] = $this->value;\n $this->save();\n }",
"public function localization() {\n\t\t\tload_plugin_textdomain( 'bitlive-custom-codes', false, __DIR__ . '/languages/' );\n\t\t}",
"function themes_get_language($script = 'global')\n{\n}",
"function includeLocalLang()\t{\n\t\t$llFile = t3lib_extMgm::extPath('f2contentce').'Resources/Private/Language/locallang.xml';\n\t\t$LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang);\n\t\treturn $LOCAL_LANG;\n\t}",
"function forum_lang( $old_lang ){\n\n\t$loc = HOME . '_plugins/Forum/lang/';\n\tif( file_exists( $loc . LANG . '.php' ) )\n\t\trequire $loc . LANG . '.php';\n\telse\n\t\trequire $loc . 'English.php';\n\n\treturn array_merge( $old_lang, $lang );\n}",
"public function getLang();",
"public function create_new_lang()\n {\n $root_directory = FCPATH.\"application/language/\";\n $scan_root_directory = array_diff(scandir($root_directory),array('.','..'));\n $data['root_dir'] = $scan_root_directory;\n\n // Application Languages\n $directory = FCPATH.\"application/language/english\";\n $file_lists = scandir($directory,0);\n $total_file = count($file_lists);\n $language_Files = array();\n\n for($i = 2; $i< $total_file; $i++) \n {\n array_push($language_Files, $file_lists[$i]);\n }\n\n for ($i = 0; $i < count($language_Files); $i++) \n {\n $file_name = $language_Files[$i];\n include FCPATH.\"application/language/english/\".$file_name;\n $data['file_name'][$i] = $file_name;\n }\n\n // datatables plugins language\n $directory2 = FCPATH.\"assets/modules/datatables/language/english.json\";\n $plugin_file = file_get_contents($directory2);\n $plugin_file_contents = json_decode($plugin_file,TRUE);\n\n $lang = array();\n\n foreach ($plugin_file_contents as $key => $value) \n {\n if($key == \"oPaginate\")\n {\n foreach ($value as $key1 => $value1) \n {\n $lang[$key1] = $value1;\n }\n\n } else if ($key =='oAria') {\n\n foreach ($value as $key1 => $value1) \n {\n $lang[$key1] = $value1;\n }\n } else {\n $lang[$key] = $value;\n\n } \n }\n\n\n // Addon Language\n $addon_directory = FCPATH.\"application/modules/\";\n $scan_directory = scandir($addon_directory,0);\n $addon_files = array();\n\n for ($i = 2; $i < count($scan_directory) ; $i++) \n {\n array_push($addon_files, $scan_directory[$i]);\n }\n\n $addon_lang_folder = array();\n for ($i = 0; $i < count($addon_files); $i++) \n {\n $module_directory = FCPATH.\"application/modules/\".$addon_files[$i].\"/language\";\n if(file_exists($module_directory))\n {\n $scan_module_directories = array_diff(scandir($module_directory),array('.','..'));\n if(!empty($scan_module_directories))\n {\n $addon_name = $addon_directory.$addon_files[$i];\n array_push($addon_lang_folder,$addon_name);\n }\n }\n }\n\n\n $addon_dir_arr = array();\n for ($i = 0; $i < count($addon_lang_folder); $i++) \n {\n $addon_lang_file = $addon_lang_folder[$i];\n $addon_lang_file_dir = $addon_lang_file.\"/language/english/\";\n $addon_lang_file_dir_scan[] = scandir($addon_lang_file_dir,1);\n array_push($addon_dir_arr,$addon_lang_file_dir_scan[$i][0]);\n }\n $data['addons'] = $addon_dir_arr;\n\n $data['body'] = 'admin/multi_language/add_language';\n $data['page_title'] = $this->lang->line(\"New Language\");\n $this->_viewcontroller($data);\n }",
"public function getLanguage() {}",
"public function load_lang() {\n /** Set our unique textdomain string */\n $textdomain = 'ninja-forms';\n\n /** The 'plugin_locale' filter is also used by default in load_plugin_textdomain() */\n $locale = apply_filters( 'plugin_locale', get_locale(), $textdomain );\n\n /** Set filter for WordPress languages directory */\n $wp_lang_dir = apply_filters(\n 'ninja_forms_wp_lang_dir',\n WP_LANG_DIR . '/ninja-forms/' . $textdomain . '-' . $locale . '.mo'\n );\n\n /** Translations: First, look in WordPress' \"languages\" folder = custom & update-secure! */\n load_textdomain( $textdomain, $wp_lang_dir );\n\n /** Translations: Secondly, look in plugin's \"lang\" folder = default */\n $plugin_dir = trailingslashit( basename( dirname( dirname( __FILE__ ) ) ) ) . basename( dirname( __FILE__ ) );\n $lang_dir = apply_filters( 'ninja_forms_lang_dir', $plugin_dir . '/lang/' );\n load_plugin_textdomain( $textdomain, FALSE, $lang_dir );\n }",
"function load_texts($file)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid language file found in language folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__LANGUAGE__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}",
"public function passo3() {\n $filename= 'f' . gmdate('YmdHis');\n foreach ($this->langarr as $k => $v):\n\n $path = ROOT.DS.'app'.DS.'locale'.DS.$v;\n if (!file_exists($path)) mkdir($path);\n \t$path .= DS.'LC_MESSAGES';\n if (!file_exists($path)) mkdir($path);\n \t$file = $path.DS.$filename;\n if (!file_exists($path)) touch($file);\n\n $file = new File($path.DS.$filename);\n $tmprec = $this->Traducao->find('all',array('conditions' => array('Traducao.locale' => $k)));\n foreach ($tmprec as $rec):\n $file->write('msgid \"' .$rec['Traducao']['msgid'] .'\"'.\"\\n\");\n $file->write('msgstr \"'.$rec['Traducao']['msgstr'].'\"'.\"\\n\");\n endforeach;\n $file->close();\n\n if (file_exists($path.DS.'default.po'))\n rename ($path.DS.'default.po',$path.DS.'default.po.old'.gmdate('YmdHis'));\n\t \n rename ($path.DS.$filename,$path.DS.'default.po');\n endforeach;\n }",
"function load_textdomain(){\n\t\tload_theme_textdomain('wa_wcc_txt', get_template_directory() . '/lang/');\n\t}",
"function get_browser_lang($deflang)\n\t{\n\t\tif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2) {\n\t\t\treturn substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n\t\t}\n\t\treturn $deflang;\n\t}",
"function getPNlanguage()\n{\n\tpnBlockLoad('Core', 'thelang');\n// All entries use ISO 639-2/T\n\t$lang['ara'] = \"Arabic\";\n\t$lang['alb'] = \"Albanian\"; \n\t$lang['bul'] = \"Bulgarian\";\n\t$lang['zho'] = \"Chinese\";\n\t$lang['cat'] = \"Catalan\";\n\t$lang['ces'] = \"Czech\";\n\t$lang['hrv'] = \"Croatian HRV\";\n\t$lang['cro'] = \"Croatian CRO\";\n\t$lang['dan'] = \"Danish\";\n\t$lang['nld'] = \"Dutch\";\n\t$lang['eng'] = \"English\";\n\t$lang['epo'] = \"Esperanto\";\n\t$lang['est'] = \"Estonian\";\n\t$lang['fin'] = \"Finnish\";\n\t$lang['fra'] = \"French\";\n\t$lang['deu'] = \"German\";\n\t$lang['ell'] = \"Greek\";\n\t$lang['heb'] = \"Hebrew\";\n\t$lang['hun'] = \"Hungarian\";\n\t$lang['isl'] = \"Icelandic\";\n\t$lang['ind'] = \"Indonesian\";\n\t$lang['ita'] = \"Italian\";\n\t$lang['jpn'] = \"Japanese\";\n\t$lang['kor'] = \"Korean\";\n\t$lang['lav'] = \"Latvian\";\n\t$lang['lit'] = \"Lithuanian\";\n\t$lang['mas'] = \"Malay\";\n\t$lang['mkd'] = \"Macedonian\";\n\t$lang['nor'] = \"Norwegian\";\n\t$lang['pol'] = \"Polish\";\n\t$lang['por'] = \"Portuguese\";\n\t$lang['ron'] = \"Romanian\";\n\t$lang['rus'] = \"Russian\";\n\t$lang['slv'] = \"Slovenian\";\n\t$lang['spa'] = \"Spanish\";\n\t$lang['swe'] = \"Swedish\";\n\t$lang['tha'] = \"Thai\";\n\t$lang['tur'] = \"Turkish\";\n\t$lang['ukr'] = \"Ukrainian\";\n\t$lang['yid'] = \"Yiddish\";\n\n\treturn strtolower($lang[pnSessionGetVar('lang')]);\n}",
"private function generateLangFileContent($lang) {\n $files = glob(resource_path('lang/' . $lang . '/*.php'));\n $strings = [];\n\n // Add locale_lang to file\n $strings['locale_lang'] = $lang;\n\n // Add content from PHP files\n foreach ($files as $file) {\n $name = basename($file, '.php');\n $strings[$name] = require $file;\n }\n\n // Add content from json file\n $simpleWordsFileName = resource_path('lang/' . $lang . '.json');\n if (file_exists($simpleWordsFileName)) {\n $simpleWordsJson = json_decode(file_get_contents($simpleWordsFileName));\n foreach ($simpleWordsJson as $key => $value) {\n $strings[$key] = $value;\n }\n }\n\n return json_encode($strings);\n }",
"function i18n() {\n // Translations can be filed in the /languages/ directory\n load_theme_textdomain('mo_theme', get_template_directory() . '/languages');\n\n $locale = get_locale();\n $locale_file = get_template_directory() . \"/languages/$locale.php\";\n if (is_readable($locale_file))\n require_once($locale_file);\n\n }",
"function load_default_textdomain($locale = \\null)\n {\n }",
"function languages() {\n load_plugin_textdomain('wcpdomain', false, dirname(plugin_basename(__FILE__)) . '/languages');\n }",
"protected function generateLocalLang() {}",
"function get_chevereto_safe_lang() {\n\tglobal $backup_lang;\n\tforeach($backup_lang as $key=>$value) {\n\t\t$safe_lang[$key] = get_lang_txt($key);\n\t}\n\tunset($safe_lang['critical_js']);\n\tunset($safe_lang['critical_js_step_1']);\n\tunset($safe_lang['critical_js_step_2']);\n\treturn $safe_lang;\n}",
"private static function loadLanguage($lang){\n\t\t$descriptions = array();\n\n\t\t$locale = 'locale/'.$lang.'.php';\n\t\trequire($locale);\n\n\t\treturn (object)$descriptions;\n\t}",
"private function init_tftp_lang_path() {\n $dir = $this->sccppath[\"tftp_lang_path\"];\n foreach ($this->extconfigs->getextConfig('sccp_lang') as $lang_key => $lang_value) {\n $filename = $dir . DIRECTORY_SEPARATOR . $lang_value['locale'];\n if (!file_exists($filename)) {\n if (!mkdir($filename, 0777, true)) {\n die('Error create lang dir');\n }\n }\n }\n }",
"function get_backup_lang() {\n\tglobal $backup_lang; return $backup_lang;\n}",
"function publishLanguage($p_lname, $option){\n\tjosSpoofCheck();\n\t$config = '';\n\n\t$fp = fopen('../configuration.php', 'r');\n\twhile(!feof($fp)){\n\t\t$buffer = fgets($fp, 4096);\n\t\tif(strstr($buffer, \"\\$mosConfig_lang\")){\n\t\t\t$config .= \"\\$mosConfig_lang = \\\"$p_lname\\\";\\n\";\n\t\t} else{\n\t\t\t$config .= $buffer;\n\t\t}\n\t}\n\tfclose($fp);\n\n\tif($fp = fopen('../configuration.php', 'w')){\n\t\tfputs($fp, $config, strlen($config));\n\t\tfclose($fp);\n\t\tmosRedirect('index2.php?option=com_languages', _LANGUAGE_SAVED . \" $p_lname\");\n\t} else{\n\t\tmosRedirect('index2.php?option=com_languages', 'Ошибка!');\n\t}\n\n}",
"public function getBackOfficeLanguage();",
"protected function setLang() {\n \n /*\n //setlocale (LC_ALL,\"russian\");\n //setlocale (LC_ALL,\"\");\n $locale = 'ru_RU';\n putenv('LANG='.$locale);\n setlocale(LC_ALL,\"\");\n setlocale(LC_MESSAGES,$locale);\n setlocale(LC_CTYPE,$locale);\n \n //putenv(\"LANG=ru_RU\");\n \n bindtextdomain (\"messages\", XPATH_TEMPLATE_FRONT . DS . 'locale');\n textdomain (\"messages\");\n bind_textdomain_codeset(\"messages\", \"UTF-8\");*/\n \n //setlocale(LC_MESSAGES, $this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n putenv(\"LC_MESSAGES=\".$this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n bindtextdomain('messages', XPATH_TEMPLATE_FRONT . DS . 'locale' . DS);\n bind_textdomain_codeset('messages', 'UTF-8');\n textdomain('messages');\n }",
"public function lang(): string;",
"function load_textdomain($domain, $mofile, $locale = \\null)\n {\n }",
"function GetDefaultLang() : string\n{\n return 'ar';\n}",
"function lang() {\r\n\t\tif($this->language === \"french\") {\r\n\t\t\tforeach($this->config['lang_fr'] as $tag_name) {\r\n\t\t\t\t$this->code = preg_replace('/<' . $tag_name . '([^<>]*)>/', '<' . $tag_name . ' lang=\"fr\" xml:lang=\"fr\"$1>', $this->code);\r\n\t\t\t\t$this->code = preg_replace('/<' . $tag_name . ' lang=\"fr\" xml:lang=\"fr\"([^<>]*) lang=\"fr\" xml:lang=\"fr\"([^<>]*)>/', '<' . $tag_name . ' lang=\"fr\" xml:lang=\"fr\"$1$2>', $this->code);\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($this->language === \"english_and_french\") {\r\n\t\t\tpreg_match_all('/<body[^<>]*>(.*?)<\\/body>/is', $this->code, $matches);\r\n\t\t\t$initial_body_code = $body_code = $matches[1][0];\r\n\t\t\t$replace_count = -1;\r\n\t\t\twhile($replace_count != 0) {\r\n\t\t\t\t$body_code = preg_replace('/<(\\w*)([^<>]*)>\\s*([^<>\\/]*[^\\s])\\s*\\/\\s*([^<>\\/]{1,})\\s*</is', '<$1$2><span lang=\"en\" xml:lang=\"en\">$3</span> / <span lang=\"fr\" xml:lang=\"fr\">$4</span><', $body_code, -1, $replace_count);\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_body_code, $body_code, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"lang\", $ct);\r\n\t\treturn true;\r\n\t}",
"public function Lang() {\n $this->langFolder = FILES['LOCALE'].(file_exists(FILES['LOCALE'].((locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) !== null) ? \n locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) : \"en_US\").\"/global.lang\") ? locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']) : \"en_US\").\"/\";\n return $this;\n }",
"function getFileContent($file_name, $lang) {\n\t// stores the file's content\n\t$file_content = \"\";\n\n\t// build path to the data folder, where the .txt files are located\n\t$data_path = dirname(dirname(__FILE__)).\"/data/\";\n\n\t// check if the file is language independent\n\tif (file_exists($data_path.$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$file_name.\".txt\");\n\t// check if the file is language dependent\n\t}else if (file_exists($data_path.$lang.\"/\".$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$lang.\"/\".$file_name.\".txt\");\n\t}\n\n\t// check if the file_get_contents() returned a failure\n\tif ($file_content === False) {\n\t\t// it did\n\t\t// the content couldn't be retrieved, so set this file's content to an empty string\n\t\t$file_content = \"\";\n\t}\n\n\t// return this file's content\n\treturn($file_content);\n}",
"public function system_language_auto(){\n\t\t// Get my current\n\t\t\t$tld = $this->zajlib->tld;\n\t\t\t$subdomain = $this->zajlib->subdomain;\n\t\t\tunset($_GET['locale']);\n\t\t\tunset($_GET['disable_locale_cookie']);\n\t\t\tunset($_COOKIE['ofw_locale']);\n\t\t// No setting means that default is set\n\t\t\t$this->zajlib->tld = 'com';\n\t\t\t$this->zajlib->subdomain = 'www';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical($this->zajlib->lang->get_default_locale(), $setting);\n\t\t// Set my tld (should be stronger than query string)\n\t\t\t$this->zajlib->tld = 'hu';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('hu_HU', $setting);\n\t\t// Set my subdomain (should be stronger than tld)\n\t\t\t$this->zajlib->subdomain = 'en';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('en_US', $setting);\n\t\t// Set my query string (should be strong than tld or subdomain)\n\t\t\t$_GET['locale'] = 'fr_FR';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('fr_FR', $setting);\n\t\t// Reset tld and subdomain and other cleanup\n\t\t\t$this->zajlib->subdomain = $subdomain;\n\t\t\t$this->zajlib->tld = $tld;\n\t}",
"protected function loadJavaScriptLanguageStrings() {}",
"function acp_load_language( $file=\"\" )\n {\n \tif ( ! $this->lang_id )\n \t{\n \t\t$this->lang_id = $this->member['language'] ? $this->member['language'] : $this->vars['default_language'];\n\n\t\t\tif ( ($this->lang_id != $this->vars['default_language']) and ( ! is_dir( ROOT_PATH.\"cache/lang_cache/\".$this->lang_id ) ) )\n\t\t\t{\n\t\t\t\t$this->lang_id = $this->vars['default_language'];\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Still nothing?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( ! $this->lang_id )\n\t\t\t{\n\t\t\t\t$this->lang_id = 'en';\n\t\t\t}\n\t\t}\n \t\n \t//-----------------------------------------\n \t// Load it\n \t//-----------------------------------------\n\n \tif( file_exists( ROOT_PATH.\"cache/lang_cache/\".$this->lang_id.\"/\".$file.\".php\" ) )\n \t{\n\t require_once( ROOT_PATH.\"cache/lang_cache/\".$this->lang_id.\"/\".$file.\".php\" );\n\t \n\t if ( is_array( $lang ) )\n\t {\n\t\t\t\tforeach ($lang as $k => $v)\n\t\t\t\t{\n\t\t\t\t\t$this->acp_lang[ $k ] = $v;\n\t\t\t\t}\n\t }\n }\n \n unset($lang);\n }",
"private static function getLanguage()\n {\n if (isset($_COOKIE[\"language\"]))\n {\n return $_COOKIE[\"language\"];\n }\n else\n {\n // Default is Czech\n return \"cs\";\n }\n }",
"protected function _writeLocale()\n {\n $text = $this->_tpl['locale'];\n \n $file = $this->_class_dir . DIRECTORY_SEPARATOR . \"/Locale/en_US.php\";\n if (file_exists($file)) {\n $this->_outln('Locale file exists.');\n } else {\n $this->_outln('Writing locale file.');\n file_put_contents($file, $text);\n }\n }",
"function common_current_language(){\r\n\tif($_SESSION['lang'] == 'id'){\r\n\t\treturn 'Bahasa Indonesia';\r\n\t}\r\n\telse if($_SESSION['lang'] == 'en'){\r\n\t\treturn 'English';\r\n\t}\r\n}",
"private function _detectLanguage() {\n if (isset($_GET['language']) && is_file('lang/'. $_GET['language'] .'.lang.php'))\n return $_GET['language'];\n\n $session = PHPSession::getInstance();\n\n if (isset($session['language']))\n return $session['language'];\n\n return $this->_getWebBrowserLanguage();\n }",
"function i18n() {\n\tload_theme_textdomain( 'project', Project_PATH . '/languages' );\n }",
"function lang()\n\t{\n\t\t$lang = (empty($_COOKIE['lang'])) ? 'italiano' : $_COOKIE['lang'];\n\t\t$this->lang=$lang;\n\t\t$this->lang_frequency=$lang.$this->lang_frequency_suffix;\n\t\t\n\t\t\n\n\t\t$n=\"\";\n\t\t$i=1;\n\t\twhile (isset($_COOKIE['lang'.$n]))\n\t\t{\n\t\t\t$i++;\n\t\t\t\t\n\t\t\t$this->lang_a[$i][0]=$_COOKIE['lang'.$n];\n\t\t\t$this->lang_a[$i][1]=$_COOKIE['lang'.$n].\"_frequency\"; //Non sò a cosa serva però...\n\t\t\t$n=$i;\n\t\t}\n\n\t\n\t\n\t\n\t}",
"protected function getLanguages() {}",
"public static function loadLang() {\n\t\tif (!is_object($GLOBALS['LANG'])) {\n\n\t\t\trequire_once t3lib_extMgm::extPath('lang') . 'lang.php';\n\t\t\t//TODO see pt_tool smarty!\n\t\t\t$GLOBALS['LANG'] = t3lib_div::makeInstance('language');\n\t\t\t$GLOBALS['LANG']->csConvObj = t3lib_div::makeInstance('t3lib_cs');\n\t\t}\n\t\tif (is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->config['config']['language']) {\n\t\t\t$LLkey = $GLOBALS['TSFE']->config['config']['language'];\n\t\t\t$GLOBALS['LANG']->init($LLkey);\n\t\t}\n\n\t}",
"function load_lang_file($file_name = \"basic\"){\r\n $ci = & get_instance();\r\n $ci->session->set_userdata('lang_file', $file_name);\r\n}",
"function tpl_language()\n{\n global $smarty, $lang, $config;\n\n $smarty->assign('lang', $lang);\n $smarty->assign('config', $config);\n}",
"function getdirlang() {\n $script = $_SERVER['PHP_SELF'];\n\n if (isset($script) && preg_match('^/[a-z][a-z]/', $script)) {\n $lang = substr($script, 1, 2);\n if (file_exists(BASEDIR . $lang . '/index.php'))\n return $lang;\n }\n\n /* Return \"en\" (English) by default just like getlang() */\n return null;\n}",
"function yourextension_lang(){\n load_plugin_textdomain('yourextension', false, basename( dirname( __FILE__ ) ) . '/languages');\n}",
"function load_theme_textdomain($domain, $path = \\false)\n {\n }",
"function get_lang_txt($lang_string) {\n\tglobal $lang, $backup_lang;\n\treturn (check_value($lang[$lang_string])) ? $lang[$lang_string] : $backup_lang[$lang_string];\n}",
"public function get_language()\n\t{\n\t\tif ($this->userdata['language'] != '')\n\t\t{\n\t\t\treturn $this->userdata['language'];\n\t\t}\n\t\tif (ee()->input->cookie('language'))\n\t\t{\n\t\t\treturn ee()->input->cookie('language');\n\t\t}\n\t\telse if (ee()->config->item('deft_lang') != '')\n\t\t{\n\t\t\treturn ee()->config->item('deft_lang');\n\t\t}\n\n\t\treturn 'english';\n\t}",
"protected function _language()\n {\n if (sizeof($this->_config['language']) > 1) {\n $language = $this->getRequest()->getParam('language');\n if (!empty($language)) {\n $this->_language = $language . '/';\n $this->_metaLanguage = $language;\n } else if (!empty($this->_session->language)) {\n $this->_language = $this->_session->language . '/';\n $this->_metaLanguage = $this->_session->language;\n } else {\n $browserLanguage = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n if (in_array($browserLanguage, $this->_config['language'])) {\n $this->_session->language = $browserLanguage;\n $this->_language = $browserLanguage . '/';\n $this->_metaLanguage = $browserLanguage;\n } else {\n $this->_language = $this->_config['language'][0] . '/';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }\n } else {\n $this->_language = '';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }",
"function export_language($k,$v,$export_data,$type) {\n $filename= 'f' . gmdate('YmdHis');\n \n\t $path = ROOT . DS . $type . DS . 'Locale' . DS;\n\t\t\n\t\t $path .= $v;\n if (!file_exists($path)){ mkdir($path); }\n\t\t// die;\n $path .= DS.'LC_MESSAGES';\n\t\t \n if (!file_exists($path)) mkdir($path);\n $file = $path.DS.$filename;\n if (!file_exists($path)) touch($file);\n\t\t$this->loadModel('Translation');\n $file = new File($path.DS.$filename);\n\t\t\n $tmprec = $export_data;\n\t\t\n foreach ($tmprec as $rec):\n $file->write('msgid \"' .$rec['msgid'] .'\"'.\"\\n\");\n $file->write('msgstr \"'.$rec['msgstr'].'\"'.\"\\n\");\n endforeach;\n $file->close();\n\t\t // pr($tmprec); die;\n\n if (file_exists($path.DS.'default.po'))\n rename ($path.DS.'default.po',$path.DS.'default.po.old'.gmdate('YmdHis'));\n\t\t\trename ($path.DS.$filename,$path.DS.'default.po');\n\t\t\t\n\t return 1;\n\t\t\n }",
"public function copyContentToLanguageFromNonDefaultLanguage() {}",
"public function copyContentToLanguageFromNonDefaultLanguage() {}",
"public function loadLanguage() {\n\t\t$this->languageLoaded = true;\n\t\t$filename = TMP_DIR.TMP_FILE_PREFIX.$this->data['languageCode'].'_'.$this->data['languageEncoding'].'_wcf.setup.php';\n\t\t\n\t\tif (!file_exists($filename)) {\n\t\t\t$xml = new XML(TMP_DIR.TMP_FILE_PREFIX.'setup_'.$this->data['languageCode'].'.xml');\n\t\t\t\n\t\t\t// compile an array with XML::getElementTree\n\t\t\t$languageXML = $xml->getElementTree('language');\n\n\t\t\t// extract attributes (language code, language name)\n\t\t\t//$languageXML = array_merge($languageXML, $languageXML['attrs']);\n\n\t\t\t// get language items\n\t\t\t$categoriesToCache = array();\n\t\t\tforeach ($languageXML['children'] as $key => $languageCategory) {\n\t\t\t\t// language category does not exist yet, create it\n\t\t\t\tif (isset($languageCategory['children'])) {\n\t\t\t\t\tforeach ($languageCategory['children'] as $key2 => $languageitem) {\n\t\t\t\t\t\t$categoriesToCache[] = array( 'name' => $languageitem['attrs']['name'], 'cdata' => $languageitem['cdata']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// update language files here\n\t\t\tif (count($categoriesToCache) > 0) {\n\t\t\t\t$file = new File($filename);\n\t\t\t\t$file->write(\"<?php\\n/**\\n* WoltLab Community Framework\\n* language: \".$this->data['languageCode'].\"\\n* encoding: \".$this->data['languageEncoding'].\"\\n* category: WCF Setup\\n* generated at \".gmdate(\"r\").\"\\n* \\n* DO NOT EDIT THIS FILE\\n*/\\n\");\n\t\t\t\tforeach ($categoriesToCache as $value => $name) {\n\t\t\t\t\t// simple_xml returns values always UTF-8 encoded\n\t\t\t\t\t// manual decoding to charset necessary\n\t\t\t\t\tif ($this->data['languageEncoding'] != 'UTF-8') {\n\t\t\t\t\t\t$name['cdata'] = StringUtil::convertEncoding('UTF-8', $this->data['languageEncoding'], $name['cdata']);\n\t\t\t\t\t}\n\t\t\t\t\t$file->write(\"\\$this->items[\\$this->languageID]['\".$name['name'].\"'] = '\".str_replace(\"'\", \"\\'\", $name['cdata']).\"';\\n\");\n\t\t\t\t\t\n\t\t\t\t\t// compile dynamic language variables\n\t\t\t\t\tif (strpos($name['cdata'], '{') !== false) {\n\t\t\t\t\t\t$file->write(\"\\$this->dynamicItems[\\$this->languageID]['\".$name['name'].\"'] = '\".str_replace(\"'\", \"\\'\", self::getScriptingCompiler()->compileString($name['name'], $name['cdata'])).\"';\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\n\t\t\t\t$file->write(\"?>\");\n\t\t\t\t$file->close();\n\t\t\t}\n\t\t}\n\n\t\tinclude_once($filename);\n\t\t$this->setLocale();\n\t}",
"function produire_fichier_langue($langue, $module, $items, $producteur='')\n{\n\tksort($items);\n\t$initiale = '';\n\t$contenu = array();\n\tforeach($items as $k => $v) {\n\t\tif ($initiale != strtoupper($k[0])) {\n\t\t\t$initiale = strtoupper($k[0]);\n\t\t\t$contenu[]= \"\\n// $initiale\";\n\t\t}\n\t\tif (!is_string($v)) {\n\t\t\t$t = str_replace(\"'\", '\\\\\\'', $v[1]);\n\t\t\tif ($v[2] == 'inutile')\n\t\t\t\t$contenu[]= \"/*\\t\" . $v[0] .\"\\n\\t'$k' => '$t',*/\"; \n\t\t\telse {\n\t\t\t\t$com = !$v[0] ? '' : (\"/*\\t\". $v[0] .\" */\\n\");\n\t\t\t\t$contenu[]= \"$com\\t'$k' => '$t',\"; \n\t\t\t}\n\t\t} else {\n\t\t\t$t = str_replace(\"'\", '\\\\\\'', $v);\n\t\t\t$t = str_replace('\\\\\\\\n', \"' . \\\"\\\\n\\\" .'\", $t);\n\t\t\t$contenu[]= \"\\t'$k' => '$t',\";\n\t\t}\n\t}\n\tif (!strpos($producteur, _LANGONET_SIGNATURE)) \n\t\t$producteur = \"\\n\" . _LANGONET_SIGNATURE . \"\\n\" . preg_replace(\",\\\\n[/#]*,\", \"\\n/// \", $producteur);\n\n\treturn '<'. \"?php\\n\" . $producteur . '\n// Module: ' . $module . '\n// Langue: ' . $langue . '\n// Date: ' . date('d-m-Y H:i:s') . '\n// Items: ' . count($items) . '\n\nif (!defined(\\'_ECRIRE_INC_VERSION\\')) return;\n\n$GLOBALS[$GLOBALS[\\'idx_lang\\']] = array(\n' .\n\t join(\"\\n\", $contenu) .\n\t \"\\n);\\n?\".'>';\n}",
"function _tc($fileName, $args = array())\n{\n global $lc_defaultLang;\n global $lc_lang;\n\n $langs = array($lc_lang, $lc_defaultLang);\n foreach ($langs as $lng) {\n $file = I18N . 'ctn/' . $lng . '/' . $fileName . '.' . $lng;\n if (is_file($file) && file_exists($file)) {\n $content = file_get_contents($file);\n if (count($args)) {\n foreach ($args as $key => $value) {\n $regex = '/'.$key.'\\b/i';\n $content = preg_replace($regex, $value, $content);\n }\n }\n return $content;\n }\n }\n return '';\n}",
"protected function createJavaScriptLanguageLabelsFromFiles() {}",
"public function getFromLanguage(): string;",
"function languagelist()\n{\n\t // Need to ensure this is loaded for language defines\n\tpnBlockLoad('Core', 'thelang');\n\t// All entries use ISO 639-2/T\n\t// hilope - added all 469 languages available under ISO 639-2\n\t\n\t$lang['aar'] = _LANGUAGE_AAR; // Afar\n\t$lang['abk'] = _LANGUAGE_ABK; // Abkhazian\n\t$lang['ace'] = _LANGUAGE_ACE; // Achinese\n\t$lang['ach'] = _LANGUAGE_ACH; // Acoli\n\t$lang['ada'] = _LANGUAGE_ADA; // Adangme\n\t$lang['ady'] = _LANGUAGE_ADY; // Adyghe; Adygei\n\t$lang['afa'] = _LANGUAGE_AFA; // Afro-Asiatic (Other)\n\t$lang['afh'] = _LANGUAGE_AFH; // Afrihili\n\t$lang['afr'] = _LANGUAGE_AFR; // Afrikaans\n\t$lang['aka'] = _LANGUAGE_AKA; // Akan\n\t$lang['akk'] = _LANGUAGE_AKK; // Akkadian\n\t$lang['ale'] = _LANGUAGE_ALE; // Aleut\n\t$lang['alg'] = _LANGUAGE_ALG; // Algonquian languages\n\t$lang['amh'] = _LANGUAGE_AMH; // Amharic\n\t$lang['ang'] = _LANGUAGE_ANG; // English, Old\n\t$lang['apa'] = _LANGUAGE_APA; // Apache languages\n\t$lang['ara'] = _LANGUAGE_ARA; // Arabic\n\t$lang['arc'] = _LANGUAGE_ARC; // Aramaic\n\t$lang['arg'] = _LANGUAGE_ARG; // Aragonese\n\t$lang['arn'] = _LANGUAGE_ARN; // Araucanian\n\t$lang['arp'] = _LANGUAGE_ARP; // Arapaho\n\t$lang['art'] = _LANGUAGE_ART; // Artificial (Other)\n\t$lang['arw'] = _LANGUAGE_ARW; // Arawak\n\t$lang['asm'] = _LANGUAGE_ASM; // Assamese\n\t$lang['ast'] = _LANGUAGE_AST; // Asturian; Bable\n\t$lang['ath'] = _LANGUAGE_ATH; // Athapascan languages\n\t$lang['aus'] = _LANGUAGE_AUS; // Australian languages\n\t$lang['ava'] = _LANGUAGE_AVA; // Avaric\n\t$lang['ave'] = _LANGUAGE_AVE; // Avestan\n\t$lang['awa'] = _LANGUAGE_AWA; // Awadhi\n\t$lang['aym'] = _LANGUAGE_AYM; // Aymara\n\t$lang['aze'] = _LANGUAGE_AZE; // Azerbaijani\n\t$lang['bad'] = _LANGUAGE_BAD; // Banda\n\t$lang['bai'] = _LANGUAGE_BAI; // Bamileke languages\n\t$lang['bak'] = _LANGUAGE_BAK; // Bashkir\n\t$lang['bal'] = _LANGUAGE_BAL; // Baluchi\n\t$lang['bam'] = _LANGUAGE_BAM; // Bambara\n\t$lang['ban'] = _LANGUAGE_BAN; // Balinese\n\t$lang['bas'] = _LANGUAGE_BAS; // Basa\n\t$lang['bat'] = _LANGUAGE_BAT; // Baltic (Other)\n\t$lang['bej'] = _LANGUAGE_BEJ; // Beja\n\t$lang['bel'] = _LANGUAGE_BEL; // Belarusian\n\t$lang['bem'] = _LANGUAGE_BEM; // Bemba\n\t$lang['ben'] = _LANGUAGE_BEN; // Bengali\n\t$lang['ber'] = _LANGUAGE_BER; // Berber (Other)\n\t$lang['bho'] = _LANGUAGE_BHO; // Bhojpuri\n\t$lang['bih'] = _LANGUAGE_BIH; // Bihari\n\t$lang['bik'] = _LANGUAGE_BIK; // Bikol\n\t$lang['bin'] = _LANGUAGE_BIN; // Bini\n\t$lang['bis'] = _LANGUAGE_BIS; // Bislama\n\t$lang['bla'] = _LANGUAGE_BLA; // Siksika\n\t$lang['bnt'] = _LANGUAGE_BNT; // Bantu (Other)\n\t$lang['bod'] = _LANGUAGE_BOD; // Tibetan\n\t$lang['bos'] = _LANGUAGE_BOS; // Bosnian\n\t$lang['bra'] = _LANGUAGE_BRA; // Braj\n\t$lang['bre'] = _LANGUAGE_BRE; // Breton\n\t$lang['btk'] = _LANGUAGE_BTK; // Batak (Indonesia)\n\t$lang['bua'] = _LANGUAGE_BUA; // Buriat\n\t$lang['bug'] = _LANGUAGE_BUG; // Buginese\n\t$lang['bul'] = _LANGUAGE_BUL; // Bulgarian\n\t$lang['byn'] = _LANGUAGE_BYN; // Blin; Bilin\n\t$lang['cad'] = _LANGUAGE_CAD; // Caddo\n\t$lang['cai'] = _LANGUAGE_CAI; // Central American Indian (Other)\n\t$lang['car'] = _LANGUAGE_CAR; // Carib\n\t$lang['cat'] = _LANGUAGE_CAT; // Catalan; Valencian\n\t$lang['cau'] = _LANGUAGE_CAU; // Caucasian (Other)\n\t$lang['ceb'] = _LANGUAGE_CEB; // Cebuano\n\t$lang['cel'] = _LANGUAGE_CEL; // Celtic (Other)\n\t$lang['ces'] = _LANGUAGE_CES; // Czech\n\t$lang['cha'] = _LANGUAGE_CHA; // Chamorro\n\t$lang['chb'] = _LANGUAGE_CHB; // Chibcha\n\t$lang['che'] = _LANGUAGE_CHE; // Chechen\n\t$lang['chg'] = _LANGUAGE_CHG; // Chagatai\n\t$lang['chk'] = _LANGUAGE_CHK; // Chuukese\n\t$lang['chm'] = _LANGUAGE_CHM; // Mari\n\t$lang['chn'] = _LANGUAGE_CHN; // Chinook jargon\n\t$lang['cho'] = _LANGUAGE_CHO; // Choctaw\n\t$lang['chp'] = _LANGUAGE_CHP; // Chipewyan\n\t$lang['chr'] = _LANGUAGE_CHR; // Cherokee\n\t$lang['chu'] = _LANGUAGE_CHU; // Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic\n\t$lang['chv'] = _LANGUAGE_CHV; // Chuvash\n\t$lang['chy'] = _LANGUAGE_CHY; // Cheyenne\n\t$lang['cmc'] = _LANGUAGE_CMC; // Chamic languages\n\t$lang['cop'] = _LANGUAGE_COP; // Coptic\n\t$lang['cor'] = _LANGUAGE_COR; // Cornish\n\t$lang['cos'] = _LANGUAGE_COS; // Corsican\n\t$lang['cpe'] = _LANGUAGE_CPE; // Creoles and pidgins, English based (Other)\n\t$lang['cpf'] = _LANGUAGE_CPF; // Creoles and pidgins, French-based (Other)\n\t$lang['cpp'] = _LANGUAGE_CPP; // Creoles and pidgins,\n\t$lang['cre'] = _LANGUAGE_CRE; // Cree\n\t$lang['crh'] = _LANGUAGE_CRH; // Crimean Tatar; Crimean Turkish\n\t$lang['crp'] = _LANGUAGE_CRP; // Creoles and pidgins (Other)\n\t$lang['csb'] = _LANGUAGE_CSB; // Kashubian\n\t$lang['cus'] = _LANGUAGE_CUS; // Cushitic (Other)\n\t$lang['cym'] = _LANGUAGE_CYM; // Welsh\n\t$lang['dak'] = _LANGUAGE_DAK; // Dakota\n\t$lang['dan'] = _LANGUAGE_DAN; // Danish\n\t$lang['dar'] = _LANGUAGE_DAR; // Dargwa\n\t$lang['day'] = _LANGUAGE_DAY; // Dayak\n\t$lang['del'] = _LANGUAGE_DEL; // Delaware\n\t$lang['den'] = _LANGUAGE_DEN; // Slave (Athapascan)\n\t$lang['deu'] = _LANGUAGE_DEU; // German\n\t$lang['dgr'] = _LANGUAGE_DGR; // Dogrib\n\t$lang['din'] = _LANGUAGE_DIN; // Dinka\n\t$lang['div'] = _LANGUAGE_DIV; // Divehi\n\t$lang['doi'] = _LANGUAGE_DOI; // Dogri\n\t$lang['dra'] = _LANGUAGE_DRA; // Dravidian (Other)\n\t$lang['dsb'] = _LANGUAGE_DSB; // Lower Sorbian\n\t$lang['dua'] = _LANGUAGE_DUA; // Duala\n\t$lang['dum'] = _LANGUAGE_DUM; // Dutch, Middle\n\t$lang['dyu'] = _LANGUAGE_DYU; // Dyula\n\t$lang['dzo'] = _LANGUAGE_DZO; // Dzongkha\n\t$lang['efi'] = _LANGUAGE_EFI; // Efik\n\t$lang['egy'] = _LANGUAGE_EGY; // Egyptian (Ancient)\n\t$lang['eka'] = _LANGUAGE_EKA; // Ekajuk\n\t$lang['ell'] = _LANGUAGE_ELL; // Greek, Modern\n\t$lang['elx'] = _LANGUAGE_ELX; // Elamite\n\t$lang['eng'] = _LANGUAGE_ENG; // English\n\t$lang['enm'] = _LANGUAGE_ENM; // English, Middle\n\t$lang['epo'] = _LANGUAGE_EPO; // Esperanto\n\t$lang['est'] = _LANGUAGE_EST; // Estonian\n\t$lang['eus'] = _LANGUAGE_EUS; // Basque\n\t$lang['ewe'] = _LANGUAGE_EWE; // Ewe\n\t$lang['ewo'] = _LANGUAGE_EWO; // Ewondo\n\t$lang['fan'] = _LANGUAGE_FAN; // Fang\n\t$lang['fao'] = _LANGUAGE_FAO; // Faroese\n\t$lang['fas'] = _LANGUAGE_FAS; // Persian\n\t$lang['fat'] = _LANGUAGE_FAT; // Fanti\n\t$lang['fij'] = _LANGUAGE_FIJ; // Fijian\n\t$lang['fin'] = _LANGUAGE_FIN; // Finnish\n\t$lang['fiu'] = _LANGUAGE_FIU; // Finno-Ugrian (Other)\n\t$lang['fon'] = _LANGUAGE_FON; // Fon\n\t$lang['fra'] = _LANGUAGE_FRA; // French\n\t$lang['frm'] = _LANGUAGE_FRM; // French, Middle\n\t$lang['fro'] = _LANGUAGE_FRO; // French, Old\n\t$lang['fry'] = _LANGUAGE_FRY; // Frisian\n\t$lang['ful'] = _LANGUAGE_FUL; // Fulah\n\t$lang['fur'] = _LANGUAGE_FUR; // Friulian\n\t$lang['gaa'] = _LANGUAGE_GAA; // Ga\n\t$lang['gay'] = _LANGUAGE_GAY; // Gayo\n\t$lang['gba'] = _LANGUAGE_GBA; // Gbaya\n\t$lang['gem'] = _LANGUAGE_GEM; // Germanic (Other)\n\t$lang['gez'] = _LANGUAGE_GEZ; // Geez\n\t$lang['gil'] = _LANGUAGE_GIL; // Gilbertese\n\t$lang['gla'] = _LANGUAGE_GLA; // Gaelic; Scottish Gaelic\n\t$lang['gle'] = _LANGUAGE_GLE; // Irish\n\t$lang['glg'] = _LANGUAGE_GLG; // Galician\n\t$lang['glv'] = _LANGUAGE_GLV; // Manx\n\t$lang['gmh'] = _LANGUAGE_GMH; // German, Middle High\n\t$lang['goh'] = _LANGUAGE_GOH; // German, Old High\n\t$lang['gon'] = _LANGUAGE_GON; // Gondi\n\t$lang['gor'] = _LANGUAGE_GOR; // Gorontalo\n\t$lang['got'] = _LANGUAGE_GOT; // Gothic\n\t$lang['grb'] = _LANGUAGE_GRB; // Grebo\n\t$lang['grc'] = _LANGUAGE_GRC; // Greek, Ancient\n\t$lang['grn'] = _LANGUAGE_GRN; // Guarani\n\t$lang['guj'] = _LANGUAGE_GUJ; // Gujarati\n\t$lang['gwi'] = _LANGUAGE_GWI; // Gwich´in\n\t$lang['hai'] = _LANGUAGE_HAI; // Haida\n\t$lang['hat'] = _LANGUAGE_HAT; // Haitian; Haitian Creole\n\t$lang['hau'] = _LANGUAGE_HAU; // Hausa\n\t$lang['haw'] = _LANGUAGE_HAW; // Hawaiian\n\t$lang['heb'] = _LANGUAGE_HEB; // Hebrew\n\t$lang['her'] = _LANGUAGE_HER; // Herero\n\t$lang['hil'] = _LANGUAGE_HIL; // Hiligaynon\n\t$lang['him'] = _LANGUAGE_HIM; // Himachali\n\t$lang['hin'] = _LANGUAGE_HIN; // Hindi\n\t$lang['hit'] = _LANGUAGE_HIT; // Hittite\n\t$lang['hmn'] = _LANGUAGE_HMN; // Hmong\n\t$lang['hmo'] = _LANGUAGE_HMO; // Hiri Motu\n\t$lang['hrv'] = _LANGUAGE_HRV; // Croatian\n\t$lang['hsb'] = _LANGUAGE_HSB; // Upper Sorbian\n\t$lang['hun'] = _LANGUAGE_HUN; // Hungarian\n\t$lang['hup'] = _LANGUAGE_HUP; // Hupa\n\t$lang['hye'] = _LANGUAGE_HYE; // Armenian\n\t$lang['iba'] = _LANGUAGE_IBA; // Iban\n\t$lang['ibo'] = _LANGUAGE_IBO; // Igbo\n\t$lang['ido'] = _LANGUAGE_IDO; // Ido\n\t$lang['iii'] = _LANGUAGE_III; // Sichuan Yi\n\t$lang['ijo'] = _LANGUAGE_IJO; // Ijo\n\t$lang['iku'] = _LANGUAGE_IKU; // Inuktitut\n\t$lang['ile'] = _LANGUAGE_ILE; // Interlingue\n\t$lang['ilo'] = _LANGUAGE_ILO; // Iloko\n\t$lang['ina'] = _LANGUAGE_INA; // Interlingua (International Auxiliary Language Association)\n\t$lang['inc'] = _LANGUAGE_INC; // Indic (Other)\n\t$lang['ind'] = _LANGUAGE_IND; // Indonesian\n\t$lang['ine'] = _LANGUAGE_INE; // Indo-European (Other)\n\t$lang['inh'] = _LANGUAGE_INH; // Ingush\n\t$lang['ipk'] = _LANGUAGE_IPK; // Inupiaq\n\t$lang['ira'] = _LANGUAGE_IRA; // Iranian (Other)\n\t$lang['iro'] = _LANGUAGE_IRO; // Iroquoian languages\n\t$lang['isl'] = _LANGUAGE_ISL; // Icelandic\n\t$lang['ita'] = _LANGUAGE_ITA; // Italian\n\t$lang['jav'] = _LANGUAGE_JAV; // Javanese\n\t$lang['jbo'] = _LANGUAGE_JBO; // Lojban\n\t$lang['jpn'] = _LANGUAGE_JPN; // Japanese\n\t$lang['jpr'] = _LANGUAGE_JPR; // Judeo-Persian\n\t$lang['jrb'] = _LANGUAGE_JRB; // Judeo-Arabic\n\t$lang['kaa'] = _LANGUAGE_KAA; // Kara-Kalpak\n\t$lang['kab'] = _LANGUAGE_KAB; // Kabyle\n\t$lang['kac'] = _LANGUAGE_KAC; // Kachin\n\t$lang['kal'] = _LANGUAGE_KAL; // Kalaallisut; Greenlandic\n\t$lang['kam'] = _LANGUAGE_KAM; // Kamba\n\t$lang['kan'] = _LANGUAGE_KAN; // Kannada\n\t$lang['kar'] = _LANGUAGE_KAR; // Karen\n\t$lang['kas'] = _LANGUAGE_KAS; // Kashmiri\n\t$lang['kat'] = _LANGUAGE_KAT; // Georgian\n\t$lang['kau'] = _LANGUAGE_KAU; // Kanuri\n\t$lang['kaw'] = _LANGUAGE_KAW; // Kawi\n\t$lang['kaz'] = _LANGUAGE_KAZ; // Kazakh\n\t$lang['kbd'] = _LANGUAGE_KBD; // Kabardian\n\t$lang['kha'] = _LANGUAGE_KHA; // Khasi\n\t$lang['khi'] = _LANGUAGE_KHI; // Khoisan (Other)\n\t$lang['khm'] = _LANGUAGE_KHM; // Khmer\n\t$lang['kho'] = _LANGUAGE_KHO; // Khotanese\n\t$lang['kik'] = _LANGUAGE_KIK; // Kikuyu; Gikuyu\n\t$lang['kin'] = _LANGUAGE_KIN; // Kinyarwanda\n\t$lang['kir'] = _LANGUAGE_KIR; // Kirghiz\n\t$lang['kmb'] = _LANGUAGE_KMB; // Kimbundu\n\t$lang['kok'] = _LANGUAGE_KOK; // Konkani\n\t$lang['kom'] = _LANGUAGE_KOM; // Komi\n\t$lang['kon'] = _LANGUAGE_KON; // Kongo\n\t$lang['kor'] = _LANGUAGE_KOR; // Korean\n\t$lang['kos'] = _LANGUAGE_KOS; // Kosraean\n\t$lang['kpe'] = _LANGUAGE_KPE; // Kpelle\n\t$lang['krc'] = _LANGUAGE_KRC; // Karachay-Balkar\n\t$lang['kro'] = _LANGUAGE_KRO; // Kru\n\t$lang['kru'] = _LANGUAGE_KRU; // Kurukh\n\t$lang['kua'] = _LANGUAGE_KUA; // Kuanyama; Kwanyama\n\t$lang['kum'] = _LANGUAGE_KUM; // Kumyk\n\t$lang['kur'] = _LANGUAGE_KUR; // Kurdish\n\t$lang['kut'] = _LANGUAGE_KUT; // Kutenai\n\t$lang['lad'] = _LANGUAGE_LAD; // Ladino\n\t$lang['lah'] = _LANGUAGE_LAH; // Lahnda\n\t$lang['lam'] = _LANGUAGE_LAM; // Lamba\n\t$lang['lao'] = _LANGUAGE_LAO; // Lao\n\t$lang['lat'] = _LANGUAGE_LAT; // Latin\n\t$lang['lav'] = _LANGUAGE_LAV; // Latvian\n\t$lang['lez'] = _LANGUAGE_LEZ; // Lezghian\n\t$lang['lim'] = _LANGUAGE_LIM; // Limburgan; Limburger; Limburgish\n\t$lang['lin'] = _LANGUAGE_LIN; // Lingala\n\t$lang['lit'] = _LANGUAGE_LIT; // Lithuanian\n\t$lang['lol'] = _LANGUAGE_LOL; // Mongo\n\t$lang['loz'] = _LANGUAGE_LOZ; // Lozi\n\t$lang['ltz'] = _LANGUAGE_LTZ; // Luxembourgish; Letzeburgesch\n\t$lang['lua'] = _LANGUAGE_LUA; // Luba-Lulua\n\t$lang['lub'] = _LANGUAGE_LUB; // Luba-Katanga\n\t$lang['lug'] = _LANGUAGE_LUG; // Ganda\n\t$lang['lui'] = _LANGUAGE_LUI; // Luiseno\n\t$lang['lun'] = _LANGUAGE_LUN; // Lunda\n\t$lang['luo'] = _LANGUAGE_LUO; // Luo (Kenya and Tanzania)\n\t$lang['lus'] = _LANGUAGE_LUS; // lushai\n\t$lang['mad'] = _LANGUAGE_MAD; // Madurese\n\t$lang['mag'] = _LANGUAGE_MAG; // Magahi\n\t$lang['mah'] = _LANGUAGE_MAH; // Marshallese\n\t$lang['mai'] = _LANGUAGE_MAI; // Maithili\n\t$lang['mak'] = _LANGUAGE_MAK; // Makasar\n\t$lang['mal'] = _LANGUAGE_MAL; // Malayalam\n\t$lang['man'] = _LANGUAGE_MAN; // Mandingo\n\t$lang['map'] = _LANGUAGE_MAP; // Austronesian (Other)\n\t$lang['mar'] = _LANGUAGE_MAR; // Marathi\n\t$lang['mas'] = _LANGUAGE_MAS; // Masai\n\t$lang['mdf'] = _LANGUAGE_MDF; // Moksha\n\t$lang['mdr'] = _LANGUAGE_MDR; // Mandar\n\t$lang['men'] = _LANGUAGE_MEN; // Mende\n\t$lang['mga'] = _LANGUAGE_MGA; // Irish, Middle\n\t$lang['mic'] = _LANGUAGE_MIC; // Micmac\n\t$lang['min'] = _LANGUAGE_MIN; // Minangkabau\n\t$lang['mis'] = _LANGUAGE_MIS; // Miscellaneous languages\n\t$lang['mkd'] = _LANGUAGE_MKD; // Macedonian\n\t$lang['mkh'] = _LANGUAGE_MKH; // Mon-Khmer (Other)\n\t$lang['mlg'] = _LANGUAGE_MLG; // Malagasy\n\t$lang['mlt'] = _LANGUAGE_MLT; // Maltese\n\t$lang['mnc'] = _LANGUAGE_MNC; // Manchu\n\t$lang['mni'] = _LANGUAGE_MNI; // Manipuri\n\t$lang['mno'] = _LANGUAGE_MNO; // Manobo languages\n\t$lang['moh'] = _LANGUAGE_MOH; // Mohawk\n\t$lang['mol'] = _LANGUAGE_MOL; // Moldavian\n\t$lang['mon'] = _LANGUAGE_MON; // Mongolian\n\t$lang['mos'] = _LANGUAGE_MOS; // Mossi\n\t$lang['mri'] = _LANGUAGE_MRI; // Maori\n\t$lang['msa'] = _LANGUAGE_MSA; // Malay\n\t$lang['mul'] = _LANGUAGE_MUL; // Multiple languages\n\t$lang['mun'] = _LANGUAGE_MUN; // Munda languages\n\t$lang['mus'] = _LANGUAGE_MUS; // Creek\n\t$lang['mwr'] = _LANGUAGE_MWR; // Marwari\n\t$lang['mya'] = _LANGUAGE_MYA; // Burmese\n\t$lang['myn'] = _LANGUAGE_MYN; // Mayan languages\n\t$lang['myv'] = _LANGUAGE_MYV; // Erzya\n\t$lang['nah'] = _LANGUAGE_NAH; // Nahuatl\n\t$lang['nai'] = _LANGUAGE_NAI; // North American Indian\n\t$lang['nap'] = _LANGUAGE_NAP; // Neapolitan\n\t$lang['nau'] = _LANGUAGE_NAU; // Nauru\n\t$lang['nav'] = _LANGUAGE_NAV; // Navajo; Navaho\n\t$lang['nbl'] = _LANGUAGE_NBL; // Ndebele, South; South Ndebele\n\t$lang['nde'] = _LANGUAGE_NDE; // Ndebele, North; North Ndebele\n\t$lang['ndo'] = _LANGUAGE_NDO; // Ndonga\n\t$lang['nds'] = _LANGUAGE_NDS; // Low German; Low Saxon; German, Low; Saxon, Low\n\t$lang['nep'] = _LANGUAGE_NEP; // Nepali\n\t$lang['new'] = _LANGUAGE_NEW; // Newari; Nepal Bhasa\n\t$lang['nia'] = _LANGUAGE_NIA; // Nias\n\t$lang['nic'] = _LANGUAGE_NIC; // Niger-Kordofanian (Other)\n\t$lang['niu'] = _LANGUAGE_NIU; // Niuean\n\t$lang['nld'] = _LANGUAGE_NLD; // Dutch; Flemish\n\t$lang['nno'] = _LANGUAGE_NNO; // Norwegian Nynorsk; Nynorsk, Norwegian\n\t$lang['nob'] = _LANGUAGE_NOB; // Norwegian Bokmċl; Bokmċl, Norwegian\n\t$lang['nog'] = _LANGUAGE_NOG; // Nogai\n\t$lang['non'] = _LANGUAGE_NON; // Norse, Old\n\t$lang['nor'] = _LANGUAGE_NOR; // Norwegian\n\t$lang['nso'] = _LANGUAGE_NSO; // Sotho, Northern\n\t$lang['nub'] = _LANGUAGE_NUB; // Nubian languages\n\t$lang['nwc'] = _LANGUAGE_NWC; // Classical Newari; Old Newari; Classical Nepal Bhasa\n\t$lang['nya'] = _LANGUAGE_NYA; // Chichewa; Chewa; Nyanja\n\t$lang['nym'] = _LANGUAGE_NYM; // Nyamwezi\n\t$lang['nyn'] = _LANGUAGE_NYN; // Nyankole\n\t$lang['nyo'] = _LANGUAGE_NYO; // Nyoro\n\t$lang['nzi'] = _LANGUAGE_NZI; // Nzima\n\t$lang['oci'] = _LANGUAGE_OCI; // Occitan; Provençal\n\t$lang['oji'] = _LANGUAGE_OJI; // Ojibwa\n\t$lang['ori'] = _LANGUAGE_ORI; // Oriya\n\t$lang['orm'] = _LANGUAGE_ORM; // Oromo\n\t$lang['osa'] = _LANGUAGE_OSA; // Osage\n\t$lang['oss'] = _LANGUAGE_OSS; // Ossetian; Ossetic\n\t$lang['ota'] = _LANGUAGE_OTA; // Turkish, Ottoman\n\t$lang['oto'] = _LANGUAGE_OTO; // Otomian languages\n\t$lang['paa'] = _LANGUAGE_PAA; // Papuan (Other)\n\t$lang['pag'] = _LANGUAGE_PAG; // Pangasinan\n\t$lang['pal'] = _LANGUAGE_PAL; // Pahlavi\n\t$lang['pam'] = _LANGUAGE_PAM; // Pampanga\n\t$lang['pan'] = _LANGUAGE_PAN; // Panjabi; Punjabi\n\t$lang['pap'] = _LANGUAGE_PAP; // Papiamento\n\t$lang['pau'] = _LANGUAGE_PAU; // Palauan\n\t$lang['peo'] = _LANGUAGE_PEO; // Persian, Old\n\t$lang['phi'] = _LANGUAGE_PHI; // Philippine (Other)\n\t$lang['phn'] = _LANGUAGE_PHN; // Phoenician\n\t$lang['pli'] = _LANGUAGE_PLI; // Pali\n\t$lang['pol'] = _LANGUAGE_POL; // Polish\n\t$lang['pon'] = _LANGUAGE_PON; // Pohnpeian\n\t$lang['por'] = _LANGUAGE_POR; // Portuguese\n\t$lang['pra'] = _LANGUAGE_PRA; // Prakrit languages\n\t$lang['pro'] = _LANGUAGE_PRO; // Provençal, Old\n\t$lang['pus'] = _LANGUAGE_PUS; // Pushto\n\t$lang['qaa-qtz'] = _LANGUAGE_QAA_QTZ; // Reserved for local use\n\t$lang['que'] = _LANGUAGE_QUE; // Quechua\n\t$lang['raj'] = _LANGUAGE_RAJ; // Rajasthani\n\t$lang['rap'] = _LANGUAGE_RAP; // Rapanui\n\t$lang['rar'] = _LANGUAGE_RAR; // Rarotongan\n\t$lang['roa'] = _LANGUAGE_ROA; // Romance (Other)\n\t$lang['roh'] = _LANGUAGE_ROH; // Raeto-Romance\n\t$lang['rom'] = _LANGUAGE_ROM; // Romany\n\t$lang['ron'] = _LANGUAGE_RON; // Romanian\n\t$lang['run'] = _LANGUAGE_RUN; // Rundi\n\t$lang['rus'] = _LANGUAGE_RUS; // Russian\n\t$lang['sad'] = _LANGUAGE_SAD; // Sandawe\n\t$lang['sag'] = _LANGUAGE_SAG; // Sango\n\t$lang['sah'] = _LANGUAGE_SAH; // Yakut\n\t$lang['sai'] = _LANGUAGE_SAI; // South American Indian (Other)\n\t$lang['sal'] = _LANGUAGE_SAL; // Salishan languages\n\t$lang['sam'] = _LANGUAGE_SAM; // Samaritan Aramaic\n\t$lang['san'] = _LANGUAGE_SAN; // Sanskrit\n\t$lang['sas'] = _LANGUAGE_SAS; // Sasak\n\t$lang['sat'] = _LANGUAGE_SAT; // Santali\n\t$lang['sco'] = _LANGUAGE_SCO; // Scots\n\t$lang['scr'] = _LANGUAGE_SCR; // Serbo-Croatian\n\t$lang['sel'] = _LANGUAGE_SEL; // Selkup\n\t$lang['sem'] = _LANGUAGE_SEM; // Semitic (Other)\n\t$lang['sga'] = _LANGUAGE_SGA; // Irish, Old\n\t$lang['sgn'] = _LANGUAGE_SGN; // Sign Languages\n\t$lang['shn'] = _LANGUAGE_SHN; // Shan\n\t$lang['sid'] = _LANGUAGE_SID; // Sidamo\n\t$lang['sin'] = _LANGUAGE_SIN; // Sinhalese\n\t$lang['sio'] = _LANGUAGE_SIO; // Siouan languages\n\t$lang['sit'] = _LANGUAGE_SIT; // Sino-Tibetan (Other)\n\t$lang['sla'] = _LANGUAGE_SLA; // Slavic (Other)\n\t$lang['slk'] = _LANGUAGE_SLK; // Slovak\n\t$lang['slv'] = _LANGUAGE_SLV; // Slovenian\n\t$lang['sma'] = _LANGUAGE_SMA; // Southern Sami\n\t$lang['sme'] = _LANGUAGE_SME; // Northern Sami\n\t$lang['smi'] = _LANGUAGE_SMI; // Sami languages (Other)\n\t$lang['smj'] = _LANGUAGE_SMJ; // Lule Sami\n\t$lang['smn'] = _LANGUAGE_SMN; // Inari Sami\n\t$lang['smo'] = _LANGUAGE_SMO; // Samoan\n\t$lang['sms'] = _LANGUAGE_SMS; // Skolt Sami\n\t$lang['sna'] = _LANGUAGE_SNA; // Shona\n\t$lang['snd'] = _LANGUAGE_SND; // Sindhi\n\t$lang['snk'] = _LANGUAGE_SNK; // Soninke\n\t$lang['sog'] = _LANGUAGE_SOG; // Sogdian\n\t$lang['som'] = _LANGUAGE_SOM; // Somali\n\t$lang['son'] = _LANGUAGE_SON; // Songhai\n\t$lang['sot'] = _LANGUAGE_SOT; // Sotho, Southern\n\t$lang['spa'] = _LANGUAGE_SPA; // Spanish; Castilian\n\t$lang['sqi'] = _LANGUAGE_SQI; // Albanian\n\t$lang['srd'] = _LANGUAGE_SRD; // Sardinian\n\t$lang['srp'] = _LANGUAGE_SRP; // Serbian\n\t$lang['srr'] = _LANGUAGE_SRR; // Serer\n\t$lang['ssa'] = _LANGUAGE_SSA; // Nilo-Saharan (Other)\n\t$lang['ssw'] = _LANGUAGE_SSW; // Swati\n\t$lang['suk'] = _LANGUAGE_SUK; // Sukuma\n\t$lang['sun'] = _LANGUAGE_SUN; // Sundanese\n\t$lang['sus'] = _LANGUAGE_SUS; // Susu\n\t$lang['sux'] = _LANGUAGE_SUX; // Sumerian\n\t$lang['swa'] = _LANGUAGE_SWA; // Swahili\n\t$lang['swe'] = _LANGUAGE_SWE; // Swedish\n\t$lang['syr'] = _LANGUAGE_SYR; // Syriac\n\t$lang['tah'] = _LANGUAGE_TAH; // Tahitian\n\t$lang['tai'] = _LANGUAGE_TAI; // Tai (Other)\n\t$lang['tam'] = _LANGUAGE_TAM; // Tamil\n\t$lang['tat'] = _LANGUAGE_TAT; // Tatar\n\t$lang['tel'] = _LANGUAGE_TEL; // Telugu\n\t$lang['tem'] = _LANGUAGE_TEM; // Timne\n\t$lang['ter'] = _LANGUAGE_TER; // Tereno\n\t$lang['tet'] = _LANGUAGE_TET; // Tetum\n\t$lang['tgk'] = _LANGUAGE_TGK; // Tajik\n\t$lang['tgl'] = _LANGUAGE_TGL; // Tagalog\n\t$lang['tha'] = _LANGUAGE_THA; // Thai\n\t$lang['tig'] = _LANGUAGE_TIG; // Tigre\n\t$lang['tir'] = _LANGUAGE_TIR; // Tigrinya\n\t$lang['tiv'] = _LANGUAGE_TIV; // Tiv\n\t$lang['tkl'] = _LANGUAGE_TKL; // Tokelau\n\t$lang['tlh'] = _LANGUAGE_TLH; // Klingon; tlhlngan-Hol\n\t$lang['tli'] = _LANGUAGE_TLI; // Tlingit\n\t$lang['tmh'] = _LANGUAGE_TMH; // Tamashek\n\t$lang['tog'] = _LANGUAGE_TOG; // Tonga (Nyasa)\n\t$lang['ton'] = _LANGUAGE_TON; // Tonga (Tonga Islands)\n\t$lang['tpi'] = _LANGUAGE_TPI; // Tok Pisin\n\t$lang['tsi'] = _LANGUAGE_TSI; // Tsimshian\n\t$lang['tsn'] = _LANGUAGE_TSN; // Tswana\n\t$lang['tso'] = _LANGUAGE_TSO; // Tsonga\n\t$lang['tuk'] = _LANGUAGE_TUK; // Turkmen\n\t$lang['tum'] = _LANGUAGE_TUM; // Tumbuka\n\t$lang['tup'] = _LANGUAGE_TUP; // Tupi languages\n\t$lang['tur'] = _LANGUAGE_TUR; // Turkish\n\t$lang['tut'] = _LANGUAGE_TUT; // Altaic (Other)\n\t$lang['tvl'] = _LANGUAGE_TVL; // Tuvalu\n\t$lang['twi'] = _LANGUAGE_TWI; // Twi\n\t$lang['tyv'] = _LANGUAGE_TYV; // Tuvinian\n\t$lang['udm'] = _LANGUAGE_UDM; // Udmurt\n\t$lang['uga'] = _LANGUAGE_UGA; // Ugaritic\n\t$lang['uig'] = _LANGUAGE_UIG; // Uighur\n\t$lang['ukr'] = _LANGUAGE_UKR; // Ukrainian\n\t$lang['umb'] = _LANGUAGE_UMB; // Umbundu\n\t$lang['und'] = _LANGUAGE_UND; // Undetermined\n\t$lang['urd'] = _LANGUAGE_URD; // Urdu\n\t$lang['uzb'] = _LANGUAGE_UZB; // Uzbek\n\t$lang['vai'] = _LANGUAGE_VAI; // Vai\n\t$lang['ven'] = _LANGUAGE_VEN; // Venda\n\t$lang['vie'] = _LANGUAGE_VIE; // Vietnamese\n\t$lang['vol'] = _LANGUAGE_VOL; // Volapük\n\t$lang['vot'] = _LANGUAGE_VOT; // Votic\n\t$lang['wak'] = _LANGUAGE_WAK; // Wakashan languages\n\t$lang['wal'] = _LANGUAGE_WAL; // Walamo\n\t$lang['war'] = _LANGUAGE_WAR; // Waray\n\t$lang['was'] = _LANGUAGE_WAS; // Washo\n\t$lang['wen'] = _LANGUAGE_WEN; // Sorbian languages\n\t$lang['wln'] = _LANGUAGE_WLN; // Walloon\n\t$lang['wol'] = _LANGUAGE_WOL; // Wolof\n\t$lang['xal'] = _LANGUAGE_XAL; // Kalmyk\n\t$lang['xho'] = _LANGUAGE_XHO; // Xhosa\n\t$lang['yao'] = _LANGUAGE_YAO; // Yao\n\t$lang['yap'] = _LANGUAGE_YAP; // Yapese\n\t$lang['yid'] = _LANGUAGE_YID; // Yiddish\n\t$lang['yor'] = _LANGUAGE_YOR; // Yoruba\n\t$lang['ypk'] = _LANGUAGE_YPK; // Yupik languages\n\t$lang['zap'] = _LANGUAGE_ZAP; // Zapotec\n\t$lang['zen'] = _LANGUAGE_ZEN; // Zenaga\n\t$lang['zha'] = _LANGUAGE_ZHA; // Zhuang; Chuang\n\t$lang['zho'] = _LANGUAGE_ZHO; // Chinese\n\t$lang['znd'] = _LANGUAGE_ZND; // Zande\n\t$lang['zul'] = _LANGUAGE_ZUL; // Zulu\n\t$lang['zun'] = _LANGUAGE_ZUN; // Zuni\n\t// Non-ISO entries are written as x_[language name]\n\t$lang['x_all'] = _ALL; // all languages\n\t$lang['x_brazilian_portuguese'] = _LANGUAGE_X_BRAZILIAN_PORTUGUESE; // Brazilian Portuguese\n\t$lang['x_rus_koi8r'] = _LANGUAGE_X_RUS_KOI8R; // Russian KOI8-R\n\t// end of list\n\treturn $lang;\n}",
"function load_lang() {\n\tglobal $mybb, $lang;\n\t\n\t// prevent non existing language file\n\t$lang->hideforums = 'Hide Forums';\n\t$lang->load('hideforums',false,true);\n}",
"function includeLocalLang()\t{\r\n\t\tglobal $LANG;\r\n\t\t$LOCAL_LANG = $LANG->includeLLFile('EXT:f4_lucene_workshop/locallang.xml',FALSE);\r\n\t\treturn $LOCAL_LANG;\r\n\t}",
"public function generateLanguages()\n {\n $files = FileLibrary::get();\n $fLang = Lang::getFallback();\n\n foreach ($files as $file) {\n foreach (Lang::allLocales() as $lang => $langName) {\n if (!isset($file->languages[$lang])) {\n $language = array_except($file->languages[$fLang]->toArray(), 'lang_id');\n $language['lang'] = $lang;\n $language = FileLibraryLanguage::create($language);\n echo '- File ID: ' . $language->file_id . ', Lang: ' . $language->lang . '<br>';\n }\n }\n }\n }",
"function lh_load_theme_textdomain(){\n load_theme_textdomain(LANG_NAMESPACE, get_template_directory() . '/lang');\n}",
"function httpbl_lang()\n {\n foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language)\n { if ($language=='fr') { return 'fr'; } }\n return 'en';\n }",
"function wp_set_lang_dir()\n {\n }"
]
| [
"0.7161825",
"0.7048829",
"0.67417705",
"0.6610356",
"0.65643156",
"0.65589243",
"0.65457344",
"0.64832115",
"0.6461322",
"0.6461322",
"0.645868",
"0.64113784",
"0.6399944",
"0.63605165",
"0.6359534",
"0.63508886",
"0.6333479",
"0.6329497",
"0.63255316",
"0.63132656",
"0.6311995",
"0.6274186",
"0.625361",
"0.62337166",
"0.6224866",
"0.6221927",
"0.6198719",
"0.6191473",
"0.6190019",
"0.61891466",
"0.61880237",
"0.6185595",
"0.6185548",
"0.6170806",
"0.6147641",
"0.6147463",
"0.61286736",
"0.61139685",
"0.6096996",
"0.60954416",
"0.60917705",
"0.60893637",
"0.60820407",
"0.6073156",
"0.6060162",
"0.6059135",
"0.60551053",
"0.60480523",
"0.6042267",
"0.60351574",
"0.6028778",
"0.6027162",
"0.6025852",
"0.6024208",
"0.60227597",
"0.6021549",
"0.60197103",
"0.6012138",
"0.60084105",
"0.6006447",
"0.60025877",
"0.59958774",
"0.5995745",
"0.59944314",
"0.5980174",
"0.59700817",
"0.5963115",
"0.59559053",
"0.5953556",
"0.59522206",
"0.59522116",
"0.59510255",
"0.5948223",
"0.5947368",
"0.5936933",
"0.5936637",
"0.59334797",
"0.593284",
"0.5931959",
"0.5920176",
"0.5919594",
"0.5911553",
"0.5908626",
"0.5906534",
"0.5898935",
"0.58960587",
"0.58942074",
"0.58941513",
"0.5893588",
"0.58881545",
"0.5883861",
"0.5883777",
"0.58813757",
"0.5865718",
"0.5859888",
"0.5850332",
"0.5847906",
"0.5847225",
"0.58442277",
"0.584293",
"0.58412427"
]
| 0.0 | -1 |
end get_translations Get the translations inside the file | private function _get_translations_from_file () {
$lang = file_exists(self::DIR_LANGS . $this->lang . '.php')
? $this->lang : $this->_default_lang;
require self::DIR_LANGS . $lang . '.php';
return $t;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract function getTranslations();",
"public function getTranslations()\n {\n }",
"private function translations()\n {\n $this['translator'] = $this->share($this->extend('translator', function ($translator) {\n $translator->addLoader('yaml', new TranslationFileLoader());\n\n $translator->addResource('yaml', 'config/locales/pt-br.yml', 'pt-br');\n $translator->addResource('yaml', 'config/locales/en-us.yml', 'en-us');\n $translator->addResource('yaml', 'config/locales/es-es.yml', 'es-es');\n\n return $translator;\n }));\n }",
"public function translations() {\n return $this->client->get(self::$apiName, array());\n }",
"function load_t2s_text(){\n\tglobal $config, $t2s_langfile, $t2s_text_stand, $templatepath;\n\t\n\tif (file_exists($templatepath.'/lang/'.$t2s_langfile)) {\n\t\t$TL = parse_ini_file($templatepath.'/lang/'.$t2s_langfile, true);\n\t} else {\n\t\tLOGGING(\"For selected T2S language no translation file still exist! Please go to LoxBerry Plugin translation and create a file for selected language \".substr($config['TTS']['messageLang'],0,2),3);\n\t\texit;\n\t}\n\treturn $TL;\n}",
"function codepress_get_lang($filename)\n {\n }",
"protected function getTranslations() {\n\t\treturn $this->_viewHelper->getTranslations();\n\t}",
"protected function getTranslation()\n {\n $language = $this->request->getBestLanguage();\n\n // Check if we have a translation file for that lang\n // TODO 处理英文\n if (file_exists(APP_PATH . \"/app/messages/\" . $language . \".php\")) {\n require_once APP_PATH. '/app/messages/'. $language . \".php\";\n } else {\n require_once APP_PATH. '/app/messages/zh-CN.php';\n // Fallback to some default\n// require \"../messages/en.php\";\n }\n\n // Return a translation object\n return new NativeArray(\n array(\n \"content\" => $messages\n )\n );\n }",
"function load_texts($file)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid language file found in language folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__LANGUAGE__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}",
"function translation() {\n\t\t\n\t\t// only use, if we have it...\n\t\tif( function_exists('load_plugin_textdomain') ) {\n\t\t\n\t\t\t// load it\n\t\t\tload_plugin_textdomain( \n\t\t\t\n\t\t\t\t// unique name\n\t\t\t\t'cp-multisite', \n\t\t\t\t\n\t\t\t\t// deprecated argument\n\t\t\t\tfalse,\n\t\t\t\t\n\t\t\t\t// path to directory containing translation files\n\t\t\t\tplugin_dir_path( CPMU_PLUGIN_FILE ) . 'languages/'\n\t\t\t\t\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"function getTranslationObject();",
"protected function sectionTranslations()\n {\n $found = []; // translations found in latte templates\n foreach (glob('template/*.latte') as $file) {\n $tempFileContents = file_get_contents($file);\n Assert::string($tempFileContents);\n preg_match_all('~\\{=(\"([^\"]+)\"|\\'([^\\']+)\\')\\|translate\\}~i', $tempFileContents, $matches);\n $found = array_merge($found, $matches[2]);\n }\n $found = array_unique($found);\n $output = '<h1><i class=\"fa fa-globe\"></i> ' . $this->tableAdmin->translate('Translations')\n . '</h1><div id=\"agenda-translations\">'\n . '<form action=\"\" method=\"post\" onsubmit=\"return confirm(\\''\n . $this->tableAdmin->translate('Are you sure?') . '\\')\">'\n . Tools::htmlInput('translations', '', 1, array('type' => 'hidden'))\n . Tools::htmlInput('token', '', end($_SESSION['token']), 'hidden')\n . Tools::htmlInput('old_name', '', '', array('type' => 'hidden', 'id' => 'old_name'))\n . '<table class=\"table table-striped\"><thead><tr><th style=\"width:'\n . intval(100 / (count($this->MyCMS->TRANSLATIONS) + 1)) . '%\">'\n . Tools::htmlInput('one', '', false, 'radio') . '</th>';\n $translations = $keys = [];\n $localisation = new L10n($this->prefixUiL10n, $this->MyCMS->TRANSLATIONS);\n foreach ($this->MyCMS->TRANSLATIONS as $key => $value) {\n $output .= \"<th>$value</th>\";\n $translations[$key] = $localisation->readLocalisation($key);\n $keys = array_merge($keys, array_keys($translations[$key]));\n }\n $output .= '</tr></thead><tbody>' . PHP_EOL;\n $keys = array_unique($keys);\n natcasesort($keys);\n foreach ($keys as $key) {\n $output .= '<tr><th>'\n . Tools::htmlInput('one', '', $key, array('type' => 'radio', 'class' => 'translation')) . ' '\n . Tools::h((string) $key) . '</th>';\n foreach ($this->MyCMS->TRANSLATIONS as $code => $value) {\n $output .= '<td>' . Tools::htmlInput(\n \"tr[$code][$key]\",\n '',\n Tools::set($translations[$code][$key], ''),\n ['class' => 'form-control form-control-sm', 'title' => \"$code: $key\"]\n ) . '</td>';\n }\n $output .= '</tr>' . PHP_EOL;\n if ($key = array_search($key, $found)) {\n unset($found[$key]);\n }\n }\n $output .= '<tr><td>' . Tools::htmlInput(\n 'new[0]',\n '',\n '',\n array('class' => 'form-control form-control-sm', 'title' => $this->tableAdmin->translate('New record'))\n ) . '</td>';\n foreach ($this->MyCMS->TRANSLATIONS as $key => $value) {\n $output .= '<td>' . Tools::htmlInput(\n \"new[$key]\",\n '',\n '',\n ['class' => 'form-control form-control-sm',\n 'title' => $this->tableAdmin->translate('New record') . ' (' . $value . ')']\n ) . '</td>';\n }\n $output .= '</tr></tbody></table>\n <button name=\"translations\" type=\"submit\" class=\"btn btn-secondary\"><i class=\"fa fa-save\"></i> '\n . $this->tableAdmin->translate('Save') . '</button>\n <button name=\"delete\" type=\"submit\" class=\"btn btn-secondary\" value=\"1\"><i class=\"fa fa-dot-circle\"></i>\n <i class=\"fa fa-trash\"></i> ' . $this->tableAdmin->translate('Delete') . '</button>\n <fieldset class=\"d-inline-block position-relative\"><div class=\"input-group\" id=\"rename-fieldset\">'\n . '<div class=\"input-group-prepend\">\n <button class=\"btn btn-secondary\" type=\"submit\"><i class=\"fa fa-dot-circle\"></i> '\n . '<i class=\"fa fa-i-cursor\"></i> ' . $this->tableAdmin->translate('Rename') . '</button>\n </div>'\n . Tools::htmlInput('new_name', '', '', array('class' => 'form-control', 'id' => 'new_name'))\n . '</div></fieldset>\n </form></div>' . PHP_EOL;\n $output .= count($found) ? '<h2 class=\"mt-4\">' .\n $this->tableAdmin->translate('Missing translations in templates') . '</h2><ul>' : '';\n foreach ($found as $value) {\n $output .= '<li><code>' . Tools::h($value) . '</code></li>' . PHP_EOL;\n }\n $output .= count($found) ? '</ul>' : '';\n return $output;\n }",
"function wp_get_available_translations()\n {\n }",
"protected function loadTranslations()\n {\n if (!isset($this->translations[$this->language])) {\n $file = $this->getTranslationFile($this->language);\n $content = file_get_contents($file);\n $translations = json_decode($content, true);\n if (!is_array($translations)) {\n throw new \\InvalidArgumentException(\"Could not parse JSON translation file: \" . $file);\n }\n\n $this->translations[$this->language] = $translations;\n }\n\n return $this->translations[$this->language];\n }",
"public static function getTranslations() {\n $settings = self::getSettings();\n return json_decode($settings->translations, true);\n }",
"private function extractGettextStrings()\n {\n $translation = null;\n $translationObjects = array();\n $lookupDirectories = array(\n Strata::getVendorPath() . 'strata-mvc' . DIRECTORY_SEPARATOR . 'strata' . DIRECTORY_SEPARATOR . 'src',\n Strata::getSrcPath(),\n Strata::getThemesPath(),\n );\n\n foreach ($lookupDirectories as $directory) {\n $translationObjects = $this->recurseThroughDirectory($directory);\n\n // Merge all translation objects into a bigger one\n foreach ($translationObjects as $t) {\n if (is_null($translation)) {\n $translation = $t;\n } else {\n $translation->mergeWith($t);\n }\n }\n }\n\n return $translation;\n }",
"public function load_translation() {\n\t\t\t$locale = apply_filters( 'plugin_locale', determine_locale(), 'sv_core' );\n\t\t\tload_textdomain( 'sv_core', dirname( __FILE__ ) . '/languages/sv_core-'.$locale.'.mo' );\n\t\t}",
"public function getTranslationsForFile(File $file, $onlyUpdated);",
"public function synchTranslations() {\n\t\t//header('Content-type: text/html; charset=utf-8');\n\t\t$player = User::getUser();\n\t\t$lang = $this->params['lang'];\n\n\t\t//ONLY English!\n\t\t$lang = \"EN\";\n\t\tif (!$player or $player->canAccess('Super Admin Interface') !== TRUE or strlen($lang) != 2) {\n\t\t\tDooUriRouter::redirect(Doo::conf()->APP_URL);\n\t\t\treturn false;\n\t\t}\n\n\t\t$file_names = array();\n\t\t$path = Doo::conf()->SITE_PATH . 'protected';\n\t\tExternalController::scanFileNameRecursivly($path, $file_names);\n\n\t\t//$translator = Doo::translator('Csv', Doo::conf()->SITE_PATH . 'protected/lang/' . $lang . '/' . $lang . //'.csv');\n\t\t$translator = Doo::translator('database', $lang);\n\n\t\t$fileResult = array();\n\n\t\tforeach ($file_names as $file) {\n\n\t\t\tif (file_exists($file)) {\n\n\t\t\t\t$content = file_get_contents($file);\n\n\t\t\t\t$clen = strlen($content);\n\n\t\t\t\t$pos = 0;\n\t\t\t\twhile ($pos = strpos($content, 'this'.'->__(', $pos))\n\t\t\t\t{\n\t\t\t\t\tif ($pos)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Get ''\n\t\t\t\t\t\tif ($content[$pos+9]==\"'\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$res = \"\";\n\t\t\t\t\t\t\t$pos1 = strpos($content, \"'\", $pos+1);\n\t\t\t\t\t\t\t$pos2 = strpos($content, \"'\", $pos1+1);\n\n\t\t\t\t\t\t\tfor ($i=$pos1+1;$i<$pos2;$i++)\n\t\t\t\t\t\t\t\t$res .= $content[$i];\n\t\t\t\t\t\t\t$fileResult[] = $res;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Get \"\"\n\t\t\t\t\t\tif ($content[$pos+9]=='\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$res = \"\";\n\t\t\t\t\t\t\t$pos1 = strpos($content, '\"', $pos+1);\n\t\t\t\t\t\t\t$pos2 = strpos($content, '\"', $pos1+1);\n\n\t\t\t\t\t\t\tfor ($i=$pos1+1;$i<$pos2;$i++)\n\t\t\t\t\t\t\t\t$res .= $content[$i];\n\t\t\t\t\t\t\t$fileResult[] = $res;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$pos++;\n\t\t\t\t}\n\n\t\t\t\t// Check for snController - used when this can not be used\n\t\t\t\t$pos = 0;\n\t\t\t\twhile ($pos = strpos($content, 'snController'.'->__(', $pos))\n\t\t\t\t{\n\t\t\t\t\tif ($pos)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Get ''\n\t\t\t\t\t\tif ($content[$pos+17]==\"'\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$res = \"\";\n\t\t\t\t\t\t\t$pos1 = strpos($content, \"'\", $pos+1);\n\t\t\t\t\t\t\t$pos2 = strpos($content, \"'\", $pos1+1);\n\n\t\t\t\t\t\t\tfor ($i=$pos1+1;$i<$pos2;$i++)\n\t\t\t\t\t\t\t\t$res .= $content[$i];\n\t\t\t\t\t\t\t$fileResult[] = $res;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Get \"\"\n\t\t\t\t\t\tif ($content[$pos+17]=='\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$res = \"\";\n\t\t\t\t\t\t\t$pos1 = strpos($content, '\"', $pos+1);\n\t\t\t\t\t\t\t$pos2 = strpos($content, '\"', $pos1+1);\n\n\t\t\t\t\t\t\tfor ($i=$pos1+1;$i<$pos2;$i++)\n\t\t\t\t\t\t\t\t$res .= $content[$i];\n\t\t\t\t\t\t\t$fileResult[] = $res;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$pos++;\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\techo \"No file\";\n\t\t\t}\n\t\t}\n $fileResult = array_unique($fileResult);\n //Fetch and compare texts from database with collected fileresults to find unused texts and delete them\n if (!empty($fileResult)) {\n echo \"TRANSLATION KEY DELETION: <br/><br/>\";\n\n $dRows = 0;\n $screentexts = new GeScreenTexts();\n $params['select'] = \"{$screentexts->_table}.ID_TEXT, {$screentexts->_table}.TransKey\";\n $dbKeys = Doo::db()->find('GeScreenTexts', $params);\n foreach($dbKeys as $text) {\n $key = array_search($text->TransKey, $fileResult);\n // If key isn't used, delete it\n if(!$key) {\n $query = \"DELETE FROM ge_screentexts WHERE ID_TEXT={$text->ID_TEXT}\";\n echo \"Deleted: $text->TransKey<br/>\";\n Doo::db()->query($query);\n $dRows++;\n }\n }\n echo \"$dRows keys deleted<br/><br/>\";\n }\n\n\t\t//Loop thru the collected fileresults and find new untranslated texts and insert them\n\t\tif (!empty($fileResult)) {\n\t\t\techo \"FILE TRANSLATION: <br/><br/>\";\n\n\t\t\t$nRows = 0;\n\t\t\tforeach ($fileResult as $item)\n\t\t\t{\n\t\t\t\t$query = \"SELECT COUNT(*) as n FROM ge_screentexts WHERE TransKey=\" .'\"' . $item . '\"';\n\n\t\t\t\t$o = (object)Doo::db()->fetchRow($query);\n\t\t\t\t$n = $o->n;\n\n\t\t\t\tif ($n==0)\n\t\t\t\t{\n\t\t\t\t\t$query = \"INSERT INTO ge_screentexts\".\n\t\t\t\t\t\t\t \"(TransKey,TransTextEN,TransTextDA,TransTextDE,TransTextFR,TransTextES,TransTextRO,TransTextLT,TransTextBG,\".\n\t\t\t\t\t\t\t \"TransTextNL,TransTextEL,TransTextTR,TransTextZH,TransTextIS,TransTextBR,TransTextTH,TransTextPT,TransTextRU,\".\n\t\t\t\t\t\t\t \"TransTextPL,TransTextFI,TransTextFA,TransTextDR,TransTextNO,TransTextSE,TransTextHU,TransTextAR,TransTextET)\".\n\t\t\t\t\t\t\t \"VALUES (\".'\"'.$item.'\",\"'.$item.'\"'.\",'','','','','','','','','','','','','','','','','','','','','','','','','')\";\n\t\t\t\t\techo \"New: $item<br/>\";\n\t\t\t\t\tDoo::db()->query($query);\n\t\t\t\t\t//echo \" - $query<br/>\";\n\t\t\t\t\t$nRows++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\techo \"$nRows new rows added<br/>\";\n\t\t}\n\n\n\t\techo \"<p>Synch translations done</p>\";\n\t\texit;\n\n\t}",
"protected function registerTranslations()\n {\n $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'kustomer');\n }",
"function loadLocale($translation) {\n\t\t\treturn include($translation);\n\t\t}",
"public function loadTranslations()\n {\n $oTranslation = new Translation($this->sLang, $this->sBundleName);\n $this->aView[\"lang\"] = $this->sLang;\n $this->aView[\"tr\"] = $oTranslation->getTranslations();\n }",
"function update_translations()\n\t{\n\t\t$this->load->library('translator');\n\t\t\n\t\t//application language folder\n\t\t$language_folder=APPPATH.'language/';\n\t\t\n\t\t//template language \n\t\t$language='base';\n\t\t\n\t\t//path to the language folder\n\t\t$language_path=$language_folder.$language;\n\t\t\n\t\t//get a list of all translation files for the given language \n\t\t$files=$this->translator->get_language_files_array($language_path);\n\t\t\n\t\t//will be updated with additons from the BASE language file\n\t\t$target_language=$this->config->item(\"language\");\n\t\t\n\t\tif (!$target_language)\n\t\t{\n\t\t\techo \"language $target_language was not found\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tforeach($files as $file)\n\t\t{\n\t\t\t$target_filepath=$language_folder.'/'.$target_language.'/'.$file;\n\n\t\t\t//merge source and target language file to fill in missing translations for the target language\n\t\t\t$data['translations']=$this->translator->merge_language_keys($language_path.'/'.$file,$target_filepath);\n\t\t\t$data['language_name']=$target_language;\n\t\t\t$data['translation_file']=$file;\n\t\t\t\n\t\t\t//target language file content\n\t\t\t$content='<?php '.\"\\n\\n\".$this->load->view('translator/save',$data,TRUE);\n\t\t\t\n\t\t\t//update the target language file\n\t\t\t$save_result=@file_put_contents($target_filepath,$content);\n\t\t\t\n\t\t\tif($save_result)\n\t\t\t{\n\t\t\t\techo \"Language file updated: \" . $target_filepath.'<br />';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<div style='color:red;'>Language file update failed: \" . $target_filepath.'</div>';\n\t\t\t}\n\t\t}\t\t\n\t}",
"protected function extract_strings() {\n\t\t$translations = new Translations();\n\n\t\t// Add existing strings first but don't keep headers.\n\t\tif ( ! empty( $this->merge ) ) {\n\t\t\t$existing_translations = new Translations();\n\t\t\tPo::fromFile( $this->merge, $existing_translations );\n\t\t\t$translations->mergeWith( $existing_translations, Merge::ADD | Merge::REMOVE );\n\t\t}\n\n\t\tPotGenerator::setCommentBeforeHeaders( $this->get_file_comment() );\n\n\t\t$this->set_default_headers( $translations );\n\n\t\t// POT files have no Language header.\n\t\t$translations->deleteHeader( Translations::HEADER_LANGUAGE );\n\n\t\t// Only relevant for PO files, not POT files.\n\t\t$translations->setHeader( 'PO-Revision-Date', 'YEAR-MO-DA HO:MI+ZONE' );\n\n\t\tif ( $this->domain ) {\n\t\t\t$translations->setDomain( $this->domain );\n\t\t}\n\n\t\tunset( $this->main_file_data['Version'], $this->main_file_data['License'], $this->main_file_data['Domain Path'], $this->main_file_data['Text Domain'] );\n\n\t\t$is_theme = isset( $this->main_file_data['Theme Name'] );\n\n\t\t// Set entries from main file data.\n\t\tforeach ( $this->main_file_data as $header => $data ) {\n\t\t\tif ( empty( $data ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$translation = new Translation( '', $data );\n\n\t\t\tif ( $is_theme ) {\n\t\t\t\t$translation->addExtractedComment( sprintf( '%s of the theme', $header ) );\n\t\t\t} else {\n\t\t\t\t$translation->addExtractedComment( sprintf( '%s of the plugin', $header ) );\n\t\t\t}\n\n\t\t\t$translations[] = $translation;\n\t\t}\n\n\t\ttry {\n\t\t\tif ( ! $this->skip_php ) {\n\t\t\t\t$options = [\n\t\t\t\t\t// Extract 'Template Name' headers in theme files.\n\t\t\t\t\t'wpExtractTemplates' => $is_theme,\n\t\t\t\t\t// Extract 'Title' and 'Description' headers from pattern files.\n\t\t\t\t\t'wpExtractPatterns' => $is_theme,\n\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t'extensions' => [ 'php' ],\n\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t];\n\t\t\t\tPhpCodeExtractor::fromDirectory( $this->source, $translations, $options );\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_blade ) {\n\t\t\t\t$options = [\n\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t'extensions' => [ 'blade.php' ],\n\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t];\n\t\t\t\tBladeCodeExtractor::fromDirectory( $this->source, $translations, $options );\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_js ) {\n\t\t\t\tJsCodeExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'js', 'jsx' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t\tMapCodeExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'map' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_block_json ) {\n\t\t\t\tBlockExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'schema' => JsonSchemaExtractor::BLOCK_JSON_SOURCE,\n\t\t\t\t\t\t'schemaFallback' => JsonSchemaExtractor::BLOCK_JSON_FALLBACK,\n\t\t\t\t\t\t// Only look for block.json files, nothing else.\n\t\t\t\t\t\t'restrictFileNames' => [ 'block.json' ],\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'json' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_theme_json ) {\n\t\t\t\t// This will look for the top-level theme.json file, as well as\n\t\t\t\t// any JSON file within the top-level styles/ directory.\n\t\t\t\tThemeJsonExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'schema' => JsonSchemaExtractor::THEME_JSON_SOURCE,\n\t\t\t\t\t\t'schemaFallback' => JsonSchemaExtractor::THEME_JSON_FALLBACK,\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'json' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\tWP_CLI::error( $e->getMessage() );\n\t\t}\n\n\t\tforeach ( $this->exceptions as $file => $exception_translations ) {\n\t\t\t/** @var Translation $exception_translation */\n\t\t\tforeach ( $exception_translations as $exception_translation ) {\n\t\t\t\tif ( ! $translations->find( $exception_translation ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->subtract_and_merge ) {\n\t\t\t\t\t$translation = $translations[ $exception_translation->getId() ];\n\t\t\t\t\t$exception_translation->mergeWith( $translation );\n\t\t\t\t}\n\n\t\t\t\tunset( $translations[ $exception_translation->getId() ] );\n\t\t\t}\n\n\t\t\tif ( $this->subtract_and_merge ) {\n\t\t\t\tPotGenerator::toFile( $exception_translations, $file );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $this->skip_audit ) {\n\t\t\t$this->audit_strings( $translations );\n\t\t}\n\n\t\treturn $translations;\n\t}",
"function load_script_translations($file, $handle, $domain)\n {\n }",
"protected function loadLocalization() {}",
"protected function translations(): array\n {\n return $this->cache->get('translations', function (): array {\n return array_values(array_map(function (SplFileInfo $file): string {\n return $file->getBasename('.yaml');\n }, iterator_to_array(\n Finder::create()->in($this->config->get('translations_path'))->name('*.yaml')\n )));\n });\n }",
"public function getTranslations()\n {\n return $this->language;\n }",
"public function getTranlations($file)\n {\n $data = File::get($file);\n\n //\tTry to pick up all Lang functions from file\n preg_match_all('/(trans|Lang::get)\\(([^\\)]*)\\)/imU', $data, $matches, PREG_PATTERN_ORDER);\n\n //\treturn empty array if none found\n if (empty($matches[ 2 ])) {\n return [];\n }\n\n //\treturn unique translations\n $files = array_unique($matches[ 2 ]);\n\n //\tclean up\n foreach ($files as &$item) {\n\n //\tSet parameters [], if we have parameters on our translatios, fill it up next\n $parameters = [];\n\n //\tseparate parameters path from parameters\n preg_match('/,\\s*\\t*(\\[.*\\])/i', $item, $parts);\n if (!empty($parts)) {\n\n $item = str_replace($parts[ 0 ], '', $item);\n $_parameters = $parts[ 1 ];\n\n preg_match_all('/(\"|\\')([^\\'\"]*)(\"|\\')\\s*\\t*\\n*\\r*=\\s*>/iU', $_parameters, $keys);\n\n if (empty($keys[ 2 ])) {\n $parameters = array_fill_keys($keys[ 2 ], 'val');\n }\n }\n\n $_i = trim(str_replace(['\\'', '\"'], '', $item));\n\n $item = [\n 'lang_query' => $_i,\n 'valid' => (preg_match('/[^0-9a-zA-Z\\._]/', $_i) == 0),\n 'group' => substr($_i, 0, strpos($_i, '.')),\n 'line' => substr($_i, strpos($_i, '.') + 1),\n 'parameters' => $parameters,\n ];\n }\n\n return $files;\n }",
"static public function getTranslate()\r\n {\r\n return Warecorp_Translate::getTranslate();\r\n }",
"public function translated();",
"public function translated();",
"public function translations()\n {\n $this->loadTranslationsFrom(__DIR__.'/Resources/Lang', $this->packageName);\n\n $this->publishes([\n __DIR__.'/path/to/translations' => resource_path('lang/vendor/courier'),\n ], $this->packageName.'-translations');\n }",
"function loadTranslation($language = 'en')\n{\n $content = json_decode(file_get_contents(TRANSLATIONS_FOLDER . DS . $language . '.json'), true);\n if ($content && count($content)) {\n return $content;\n } else {\n return $language == 'en' ? array() : loadTranslation('en');\n }\n}",
"public function getTranslationsForKey($key);",
"public function localization() {\n\t\t\tload_plugin_textdomain( 'bitlive-custom-codes', false, __DIR__ . '/languages/' );\n\t\t}",
"private function read() \n {\n if ($this->lang == '') $this->lang = App::getLocale();\n $this->path = base_path().'/resources/lang/'.$this->lang.'/'.$this->file.'.php';\n $this->arrayLang = Lang::get($this->file);\n if (gettype($this->arrayLang) == 'string') $this->arrayLang = array();\n }",
"public static function get_translate(){\n return self::$translate;\n }",
"public function get_translations ($type = 'file') {\n\n\t\tif ($this->lang != null) {\n\n\t\t\tif ($type == 'file') {\n\n\t\t\t\t$this->t = $this->_get_translations_from_file();\n\n\t\t\t} elseif ($type == 'db') {\n\n\t\t\t\t$this->t = $this->_get_translations_from_db();\n\n\t\t\t}//end elsefi\n\n\t\t}//end if\n\n\t}",
"protected function load_translations() {\n\t\t// load the plugin text domain\n\t\tload_plugin_textdomain( 'mailchimp-for-wp', false, 'mailchimp-for-wp-pro/languages/' );\n\t}",
"function doTranslate($file,$languages){\n\techo \"\\n\\n=============================\\n\";\n\techo \"Translating $file\\n\";\n\techo \"=============================\\n\";\n\t$filenamepart=explodeFile($file);\n\t$buffer=file_get_contents($file);\n\t//loop through the languages\n\tforeach ($languages as $key=>$lang){\n\t\techo \"-----------------------------\\n\";\n\t\techo \"Translating to language $key\\n\";\n\t\techo \"-----------------------------\\n\";\n\t\t$posR=0;\n\t\t$translated = \"\";\n\t\twhile (true){\n\t\t\t//find next occurence of a data-i18n attribute\n\t\t\t$pos1 = getNextDataI18N($buffer,$posR+1);\n\t\t\t\n\t\t\t//if there is no more occurence, there's nothing more to do; break this loop\n\t\t\tif ($pos1==false) {break;}\n\t\t\t\n\t\t\t//else extract the dataName from this attribute\n\t\t\t$pos2 = getNextQuote($buffer,$pos1+1);\n\t\t\t$dataName = getTextBetween($buffer,$pos1,$pos2);\n\t\t\n\t\t\t//append with text that comes before the string to be translated\n\t\t\t$posL = getNextGt($buffer,$pos2);\n\t\t\t$translated .= getTextBefore($buffer,$posR,$posL);\n\t\t\t\n\t\t\t//append with translation of said string\n\t\t\t$replaceText = getI18nText($dataName,$lang);\n\t\t\techo \"* $dataName=$replaceText\\n\";\t\n\t\t\t$translated .= $replaceText;\n\t\t\t\n\t\t\t//go to end of translated string\n\t\t\t$posR = getNextLt($buffer,$posL);\n\t\t\t$pos1 = $posR;\n\t\t\n\t\t}\n\t\t//append part of file after last translated string\n\t\t$translated .= substr($buffer,$posR,-1);// getTextAfter($buffer,$posR);\n\t\t\n\t\t//if language directory does not exist, create it\n\t\t$directory = $filenamepart[0].\"$key/\"; \n\t\tif (!is_dir($directory)) {\n\t\t\tmkdir($directory);\n\t\t\techo \"* created directory $directory\\n\";\n\t\t}\n\t\t\n\t\t//create file for language\n\t\t$newFile=$directory.$filenamepart[1];\n\t\tfile_put_contents($newFile,$translated);\n\t\t\n\t}\n}",
"protected function load()\n {\n $this->translations = array();\n \n if ($this->language) {\n if ($this->cachepath) {\n if (file_exists($cache = $this->cachepath.'/'.$this->language.'.php')) {\n $this->translations = include($cache);\n }\n } else {\n if (!empty($this->filepaths)) {\n foreach ($this->filepaths as $filepath) {\n $this->loadFilePath($filepath);\n }\n }\n }\n }\n }",
"function wp_load_translations_early()\n {\n }",
"function GetLocalizedTexts()\n\t{\n\t\t$result = $this->sendRequest(\"GetLocalizedTexts\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"function getTranslationsOfModule($module)\n {\n $translations = [];\n $resourcesLangPath = $this->getResourcesLangPath($module);\n $iniFiles = $this->getIniFilesOfModule($module);\n foreach ($iniFiles as $file => $data)\n $translations[str_replace('.ini', '', $data)] = parse_ini_file (\"$resourcesLangPath/$data\");\n\n return $translations;\n }",
"function scan_templates_for_translations () {\r\n $this->CI->load->helper( 'file' );\r\n $filename = config_item( 'dummy_translates_filename' );\r\n\r\n // Clean Pattern for new file\r\n $clean_pattern = \"<?php\\n\";\r\n\r\n // Emptying file\r\n write_file( $filename, $clean_pattern );\r\n\r\n $path = realpath( config_item( 'current_template_uri' ) );\r\n $directory = new RecursiveDirectoryIterator( $path );\r\n $iterator = new RecursiveIteratorIterator( $directory );\r\n\r\n // Regex for no deprecated twig templates\r\n $regex = '/^((?!DEPRECATED).)*\\.twig$/i';\r\n $file_iterator = new RegexIterator( $iterator, $regex, RecursiveRegexIterator::GET_MATCH );\r\n\r\n $files = 0;\r\n $arr_strings = array();\r\n\r\n foreach( $file_iterator as $name => $object ) {\r\n $files++;\r\n\r\n // Mega regex for Quoted String tokens with escapable quotes\r\n // http://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes\r\n $pattern = '/{%\\s?trans\\s?((?<![\\\\\\\\])[\\'\"])((?:.(?!(?<![\\\\\\\\])\\1))*.?)\\1/';\r\n $current_file = fopen( $name, 'r' );\r\n\r\n while ( ( $buffer = fgets( $current_file ) ) !== false ) {\r\n if ( preg_match_all( $pattern, $buffer, $matches ) ) {\r\n foreach( $matches[ 2 ] as $match ) {\r\n // Escaping quotes not yet escaped\r\n $match = preg_replace( '/(?<![\\\\\\\\])(\\'|\")/', \"\\'\", $match );\r\n array_push( $arr_strings, \"echo _( '$match' );\\n\" );\r\n }\r\n }\r\n }\r\n\r\n fclose( $current_file );\r\n }\r\n\r\n // Remove duplicates\r\n $arr_strings = array_unique( $arr_strings );\r\n write_file( $filename, implode( $arr_strings ), 'a' );\r\n\r\n $result = array(\r\n 'templates' => $files,\r\n 'strings' => count( $arr_strings ),\r\n 'output' => $filename,\r\n 'lint' => check_php_file_syntax( $filename )\r\n );\r\n\r\n return $result;\r\n }",
"function load_custom_plugin_translation_file( $mofile, $domain ) { \n\t\n\t// folder location\n\t$folder = WP_PLUGIN_DIR . '/kinogeneva-translations/languages/';\n\t\n\t// filename ending\n\t$file = '-' . get_locale() . '.mo';\n\t\n\t$plugins = array(\n\t\t'buddypress',\n\t\t'bxcft',\n\t\t'wp-user-groups',\n\t\t'kleo_framework',\n\t\t'invite-anyone',\n\t\t'bp-groups-taxo',\n\t\t'bp-docs'\n\t);\n\t\n\tforeach ($plugins as &$plugin) {\n\t\tif ( $plugin === $domain ) {\n\t\t $mofile = $folder.$domain.$file;\n\t }\n\t}\n\n return $mofile;\n\n}",
"public function getStrings ()\n {\n return $this->translate;\n }",
"public function initLocalization() {\n $moFiles = scandir(trailingslashit($this->dir) . 'languages/');\n foreach ($moFiles as $moFile) {\n if (strlen($moFile) > 3 && substr($moFile, -3) == '.mo' && strpos($moFile, get_locale()) > -1) {\n load_textdomain('WP_Visual_Chat', trailingslashit($this->dir) . 'languages/' . $moFile);\n }\n }\n }",
"public function getTranslation($key = '')\n {\n return self::$translations[$key];\n }",
"function wp_get_translation_updates()\n {\n }",
"public function getTranslations()\n {\n return $this->translations;\n }",
"function getDictionary ()\n\t{\n\t\t$dictionary = array ();\n\t\tinclude ('framework/i18n/dictionary_en.php');\n\t\t$file = 'framework/i18n/dictionary_'.$_SESSION['brimLanguage'].'.php';\n\t\tif (file_exists ($file))\n\t\t{\n\t\t\tinclude ($file);\n\t\t}\n\t\treturn $dictionary;\n\t}",
"private function load(): void\n {\n $paths = $this->getPaths();\n\n $this->locales['app'] = $this->loadTranslations($paths['app']);\n\n foreach ($paths['vendors'] as $path) {\n $this->locales['vendor-php'] = $this->loadTranslations($path);\n $this->locales['vendor-json'] = $this->loadJsonTranslations($path);\n }\n }",
"public function getTranslationsForFile($file)\n {\n $data = TranslationContentQuery::create()\n ->select(array('Content', 'TranslationKey.KeyName'))\n ->filterByTranslationFile($file)\n ->joinWithTranslationKey()\n ->find();\n\n $return = array();\n foreach ($data as $line) {\n $return[$line['TranslationKey.KeyName']] = $line['Content'];\n }\n\n return $return;\n }",
"function localize($phrase) {\n global $translations;\n /* Static keyword is used to ensure the file is loaded only once */\n if ($translations[$phrase])\n return $translations[$phrase];\n else\n return $phrase;\n}",
"public function getMultilingual();",
"protected function registerTranslations()\n {\n $this->loadTranslationsFrom($this->packagePath('resources/lang'), 'support');\n }",
"private static function translator()\n {\n $files = ['Lang', 'Smiley'];\n $folder = static::$root.'Translator'.'/';\n\n self::call($files, $folder);\n\n $files = ['LanguageKeyNotFoundException', 'LanguageNotSupportedException'];\n $folder = static::$root.'Translator/Exceptions'.'/';\n\n self::call($files, $folder);\n }",
"function load_custom_kinogeneva_translation_file() {\n\t$mofile = WP_PLUGIN_DIR . '/kinogeneva-translations/languages/kinogeneva-' . get_locale() . '.mo';\n\tload_textdomain( 'kinogeneva', $mofile );\n}",
"function i18n() {\n // Translations can be filed in the /languages/ directory\n load_theme_textdomain('mo_theme', get_template_directory() . '/languages');\n\n $locale = get_locale();\n $locale_file = get_template_directory() . \"/languages/$locale.php\";\n if (is_readable($locale_file))\n require_once($locale_file);\n\n }",
"private function registerTranslations()\n {\n $langPath = $this->getBasePath() . '/resources/lang';\n\n $this->loadTranslationsFrom($langPath, $this->package);\n $this->publishes([\n $langPath => base_path(\"resources/lang/arcanedev/{$this->package}\"),\n ], 'translations');\n }",
"public function getAllTranslationByLanguage();",
"protected function getTranslateTools() {}",
"function lang() {\r\n\t\t\tload_plugin_textdomain( 'rv-portfolio', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\r\n\t\t}",
"public function translate();",
"function i18n() {\n\tload_theme_textdomain( 'project', Project_PATH . '/languages' );\n }",
"public function loadMainTrans()\n {\n $translationPath = $this->_getTransPath();\n require $translationPath.\"/main.php\";\n\n //Return a translation object\n $mainTranslate = new Phalcon\\Translate\\Adapter\\NativeArray(array(\n \"content\" => $messages\n ));\n\n //Set $mt as main translation object\n $this->view->setVar(\"mt\", $mainTranslate);\n }",
"public function getTranslationsForLanguage($language);",
"protected function registerTranslations()\n {\n $this->loadTranslationsFrom($this->packagePath('resources/lang'), 'password');\n }",
"private function load_localization() {\n $plugin_i18n = new PLUGINNAME_i18n($this->getter()->get_translation_slug);\n add_action('plugins_loaded', array($plugin_i18n, 'load_plugin_textdomain'));\n }",
"function wp_get_installed_translations($type)\n {\n }",
"function getTrans($locale = true) {\n\t$dir = Storage::directories('config/translate');\n\t$return = null;\n\t$langs = [];\n\tforeach ($dir as $val) {\n\t\t$langs[substr($val, -2)] = Storage::allFiles('config/translate/'.substr($val, -2));\n\t}\n\n\tforeach ($langs as $lang_k => $lang) {\n\t\tforeach ($lang as $j => $value) {\n\t\t\t$key = 'config/translate/'.substr($lang_k, -2);\n\t\t\t$key = explode($key, $value)[1];\n\t\t\t$key = implode('.', explode('/', substr(substr($key, 0, -5), 1)));\n\n\t\t\t$data = trim(Storage::get($value));\n\t\t\t$data = json_decode($data, true);\n\t\t\t$data = array_dot($data);\n\n\t\t\t$langs[$lang_k][$key] = $data;\n\t\t\tunset($langs[$lang_k][$j]);\n\t\t}\n\t}\n\n\tif (!$locale) {\n\t\t$return = array_dot($langs);\n\t} else {\n\t\tif (is_bool($locale)) {\n\t\t\t$return = array_dot($langs[getLang()]);\n\t\t} else {\n\t\t\t$return = array_dot($langs[$locale]);\n\t\t}\n\t}\n\n\treturn json_encode(array_dot($return));\n}",
"public function load_textdomain()\n {\n }",
"public function translationMessages()\n {\n return [];\n }",
"function &getTranslations(){\n\t\tif ( isset( $this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$translations = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$translations = array_merge($translations, $tables[$tablename]->getTranslations());\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $translations;\n\t\treturn $translations;\n\t\t\n\t}",
"function localization() {\n load_plugin_textdomain( 'cynetique-labels', false, dirname( plugin_basename( __FILE__ ) ) . '/language/' );\n}",
"function __($text)\n{\n $sys = getSysInfo();\n $lang = $sys[\"lang\"];\n //set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'].getPathFromDocRoot().'locales'.FILE_SEPARATOR.$lang);\n if ($lang == \"\") {\n //do nothing\n return $text;\n } else {\n require_once('locales'.FILE_SEPARATOR.$lang.FILE_SEPARATOR.$lang.'.php');\n //$translation = getTranslation($text);\n $translation = call_user_func('getTranslation_'.$lang, $text);\n if ($translation == \"\") {\n return $text;\n //maybe send an error email to admin?\n } else {\n return $translation;\n }\n }\n}",
"public function translation()\n {\n $kirby = $this->model->kirby();\n $lang = $this->model->language();\n return $kirby->translation($lang);\n }",
"public function translate($path) {\n return Locale::get($path);\n }",
"public function load_textdomain() {\n\t\t\t// Set filter for plugin's languages directory\n\t\t\t$lang_dir = dirname( plugin_basename( $this->file ) ) . '/languages/';\n\t\t\t$lang_dir = apply_filters( 'edd_social_discounts_languages_directory', $lang_dir );\n\n\t\t\t// Traditional WordPress plugin locale filter\n\t\t\t$locale = apply_filters( 'plugin_locale', get_locale(), 'edd-social-discounts' );\n\t\t\t$mofile = sprintf( '%1$s-%2$s.mo', 'edd-social-discounts', $locale );\n\n\t\t\t// Setup paths to current locale file\n\t\t\t$mofile_local = $lang_dir . $mofile;\n\t\t\t$mofile_global = WP_LANG_DIR . '/edd-social-discounts/' . $mofile;\n\n\t\t\tif ( file_exists( $mofile_global ) ) {\n\t\t\t\t// Look in global /wp-content/languages/edd-auto-register folder\n\t\t\t\tload_textdomain( 'edd-social-discounts', $mofile_global );\n\t\t\t} elseif ( file_exists( $mofile_local ) ) {\n\t\t\t\t// Look in local /wp-content/plugins/edd-auto-register/languages/ folder\n\t\t\t\tload_textdomain( 'edd-social-discounts', $mofile_local );\n\t\t\t} else {\n\t\t\t\t// Load the default language files\n\t\t\t\tload_plugin_textdomain( 'edd-social-discounts', false, $lang_dir );\n\t\t\t}\n\t\t}",
"public function load_textdomain() {\n\t\t// Set filter for plugin's languages directory\n\t\t$lang_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/';\n\t\t$lang_dir = apply_filters( 'bbp_notices_languages', $lang_dir );\n\n\t\t// Traditional WordPress plugin locale filter\n\t\t$locale = apply_filters( 'plugin_locale', get_locale(), 'bbpress-notices' );\n\t\t$mofile = sprintf( '%1$s-%2$s.mo', 'bbpress-notices', $locale );\n\n\t\t// Setup paths to current locale file\n\t\t$mofile_local = $lang_dir . $mofile;\n\t\t$mofile_global = WP_LANG_DIR . '/bbpress-notices/' . $mofile;\n\n\t\tif ( file_exists( $mofile_global ) ) {\n\t\t\t// Look in global /wp-content/languages/bbpress-notices folder\n\t\t\tload_textdomain( 'bbpress-notices', $mofile_global );\n\t\t} elseif ( file_exists( $mofile_local ) ) {\n\t\t\t// Look in local /wp-content/plugins/bbpress-notices/languages/ folder\n\t\t\tload_textdomain( 'bbpress-notices', $mofile_local );\n\t\t} else {\n\t\t\t// Load the default language files\n\t\t\tload_plugin_textdomain( 'bbpress-notices', false, $lang_dir );\n\t\t}\n\t}",
"function get_translations_for_domain($domain)\n {\n }",
"public function load_lang() {\n /** Set our unique textdomain string */\n $textdomain = 'ninja-forms';\n\n /** The 'plugin_locale' filter is also used by default in load_plugin_textdomain() */\n $locale = apply_filters( 'plugin_locale', get_locale(), $textdomain );\n\n /** Set filter for WordPress languages directory */\n $wp_lang_dir = apply_filters(\n 'ninja_forms_wp_lang_dir',\n WP_LANG_DIR . '/ninja-forms/' . $textdomain . '-' . $locale . '.mo'\n );\n\n /** Translations: First, look in WordPress' \"languages\" folder = custom & update-secure! */\n load_textdomain( $textdomain, $wp_lang_dir );\n\n /** Translations: Secondly, look in plugin's \"lang\" folder = default */\n $plugin_dir = trailingslashit( basename( dirname( dirname( __FILE__ ) ) ) ) . basename( dirname( __FILE__ ) );\n $lang_dir = apply_filters( 'ninja_forms_lang_dir', $plugin_dir . '/lang/' );\n load_plugin_textdomain( $textdomain, FALSE, $lang_dir );\n }",
"function _load_languages()\r\n\t{\r\n\t\t// Load the form validation language file\r\n\t\t$this->lang->load('form_validation');\r\n\r\n\t\t// Load the DataMapper language file\r\n\t\t$this->lang->load('datamapper');\r\n\t}",
"public function lang() {\n\t\t\tload_plugin_textdomain( 'cherry-site-shortcodes', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n\t\t}",
"function install_translations() {\n $db = DB::getInstance();\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/translation.sql'))->error()) {\n return true;\n }\n else {\n System::addMessage('error', rt('An error occurred during the installation of your chosen language'));\n }\n return false;\n}",
"abstract public function getTranslationIn(string $locale);",
"abstract public function getTranslationIn(string $locale);",
"abstract public function getTranslationIn(string $locale);",
"function __construct() {\n\t\t$this->addTranslation(__FILE__);\n\t}",
"function inspiry_load_translation_from_child() {\n\t\tload_child_theme_textdomain( 'framework', get_stylesheet_directory() . '/languages' );\n\t}",
"function _get() {\n if( file_exists($this->_template) ) {\n $this->_text = file($this->_template);\n }\n else {\n $this->_text = array(\"Template file {$this->_template} could not be found.\");\n }\n }",
"function doEachFile() {\n //open Kohana directory\n $kohana_path = getcwd() . '/i18n/';\n if (is_dir($kohana_path)) {\n $kohana_dir = opendir($kohana_path);\n }\n else {\n die('Could not open Kohana lang file directory.');\n }\n \n //loop through files in the kohana directory, find matching ionize file, and translate\n while (($kohana_file = readdir($kohana_dir)) !== false) {\n if(filetype($kohana_path . $kohana_file) != 'dir') {\n //get lang code for current file\n $lang_code = str_replace('.php', '', $kohana_file);\n //open matching folder in Ionize directory\n $ionize_path = getcwd() . '/language/' . $lang_code;\n if (is_dir($ionize_path)) {\n $ionize_dir = opendir($ionize_path);\n }\n else {\n die('Could not open Ionize ' . $lang_code . ' lang file directory.');\n }\n while (($ionize_file = readdir($ionize_dir)) !== false) {\n //if current file is the needed lang file, translate\n if($ionize_file == 'theme_lang.php') {\n translateFile($kohana_path . '/' . $kohana_file, $ionize_path . '/' . $ionize_file);\n }\n }\n }\n }\n \n}",
"function mbifthen_load_textdomain() {\r\n\tload_plugin_textdomain( 'multibanco-ifthen-software-gateway-for-woocommerce', false, dirname( plugin_basename( __FILE__ ) ).'/lang/' );\r\n}",
"public static function translations(Client $client, $id) {\n $req = $client->newRequest(\"GET\", \"/{accountname}/events/{id}/translate\");\n $req->addParameter(\"id\", $id);\n\n\n $result = $req->run(\"json\");\n return $result;\n }",
"protected function getLocalLangFileName() {}",
"function getFileContent($file_name, $lang) {\n\t// stores the file's content\n\t$file_content = \"\";\n\n\t// build path to the data folder, where the .txt files are located\n\t$data_path = dirname(dirname(__FILE__)).\"/data/\";\n\n\t// check if the file is language independent\n\tif (file_exists($data_path.$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$file_name.\".txt\");\n\t// check if the file is language dependent\n\t}else if (file_exists($data_path.$lang.\"/\".$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$lang.\"/\".$file_name.\".txt\");\n\t}\n\n\t// check if the file_get_contents() returned a failure\n\tif ($file_content === False) {\n\t\t// it did\n\t\t// the content couldn't be retrieved, so set this file's content to an empty string\n\t\t$file_content = \"\";\n\t}\n\n\t// return this file's content\n\treturn($file_content);\n}",
"function _getLanguageFile()\n\t{\n\t\tglobal $_CB_framework;\n\t\t$UElanguagePath=$_CB_framework->getCfg('absolute_path').'/components/com_comprofiler/plugin/user/plug_cbjemmyattending';\n\t\tif (file_exists($UElanguagePath.'/language/'.$_CB_framework->getCfg('lang').'.php')) {\n\t\t\tinclude_once($UElanguagePath.'/language/'.$_CB_framework->getCfg('lang').'.php');\n\t\t} else {\n\t\t\tinclude_once($UElanguagePath.'/language/english.php');\n\t\t}\n\t}",
"public function setup_i18n() {\n\t\tload_plugin_textdomain( 'woocommerce-bundle-rate-shipping', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n\t}"
]
| [
"0.802727",
"0.76204044",
"0.71835136",
"0.7033942",
"0.7028132",
"0.7024281",
"0.7023306",
"0.7019202",
"0.7006672",
"0.69839656",
"0.6970647",
"0.6964823",
"0.69473624",
"0.69473505",
"0.6891581",
"0.68759376",
"0.68569237",
"0.6839383",
"0.6822441",
"0.67612034",
"0.6735228",
"0.6723069",
"0.672085",
"0.6720264",
"0.67193264",
"0.6716031",
"0.6714576",
"0.6698933",
"0.66929305",
"0.6678878",
"0.6668477",
"0.6668477",
"0.66555727",
"0.66548693",
"0.665221",
"0.66438943",
"0.6630651",
"0.66303533",
"0.6619777",
"0.6611636",
"0.65837854",
"0.6579124",
"0.6578122",
"0.6571314",
"0.656732",
"0.65333974",
"0.65206295",
"0.6488531",
"0.6480477",
"0.64788234",
"0.6467691",
"0.6402215",
"0.63586503",
"0.6339439",
"0.6322382",
"0.6315907",
"0.63081676",
"0.6297598",
"0.6289117",
"0.6281537",
"0.6271959",
"0.6221747",
"0.62187546",
"0.6212605",
"0.61974996",
"0.6190654",
"0.6183013",
"0.6173263",
"0.616583",
"0.6164784",
"0.6163131",
"0.61571115",
"0.6138689",
"0.613395",
"0.6130247",
"0.61273456",
"0.6127061",
"0.6122764",
"0.6121163",
"0.6114",
"0.6109673",
"0.61029726",
"0.6099904",
"0.6097738",
"0.6094609",
"0.6088491",
"0.608459",
"0.6080398",
"0.6080398",
"0.6080398",
"0.6078714",
"0.60692114",
"0.60677916",
"0.60637295",
"0.6063348",
"0.6054653",
"0.6053276",
"0.6049637",
"0.6040727",
"0.60358405"
]
| 0.824139 | 0 |
end _get_translations_from_file Get the translations inside the database | private function _get_translations_from_db () {
try {
$db = Db::init();
$sql = 'SELECT key_word, value
FROM arka_web.language
WHERE lang = :lang';
$sth = $db->dbh->prepare($sql);
$sth->execute(array(':lang' => $this->lang));
$t = $sth->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);
return array_map('reset', $t );
} catch (\PDOException $e) {
echo '<b>Error [' . $e->getLine() . ']: </b>' . $e->getMessage();
}//end catch
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _get_translations_from_file () {\n\n\t\t$lang = file_exists(self::DIR_LANGS . $this->lang . '.php')\n\t\t\t\t\t? $this->lang : $this->_default_lang;\n\n\t\trequire self::DIR_LANGS . $lang . '.php';\n\n\t\treturn $t;\n\n\t}",
"protected abstract function getTranslations();",
"public function synchTranslations() {\n\t\t//header('Content-type: text/html; charset=utf-8');\n\t\t$player = User::getUser();\n\t\t$lang = $this->params['lang'];\n\n\t\t//ONLY English!\n\t\t$lang = \"EN\";\n\t\tif (!$player or $player->canAccess('Super Admin Interface') !== TRUE or strlen($lang) != 2) {\n\t\t\tDooUriRouter::redirect(Doo::conf()->APP_URL);\n\t\t\treturn false;\n\t\t}\n\n\t\t$file_names = array();\n\t\t$path = Doo::conf()->SITE_PATH . 'protected';\n\t\tExternalController::scanFileNameRecursivly($path, $file_names);\n\n\t\t//$translator = Doo::translator('Csv', Doo::conf()->SITE_PATH . 'protected/lang/' . $lang . '/' . $lang . //'.csv');\n\t\t$translator = Doo::translator('database', $lang);\n\n\t\t$fileResult = array();\n\n\t\tforeach ($file_names as $file) {\n\n\t\t\tif (file_exists($file)) {\n\n\t\t\t\t$content = file_get_contents($file);\n\n\t\t\t\t$clen = strlen($content);\n\n\t\t\t\t$pos = 0;\n\t\t\t\twhile ($pos = strpos($content, 'this'.'->__(', $pos))\n\t\t\t\t{\n\t\t\t\t\tif ($pos)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Get ''\n\t\t\t\t\t\tif ($content[$pos+9]==\"'\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$res = \"\";\n\t\t\t\t\t\t\t$pos1 = strpos($content, \"'\", $pos+1);\n\t\t\t\t\t\t\t$pos2 = strpos($content, \"'\", $pos1+1);\n\n\t\t\t\t\t\t\tfor ($i=$pos1+1;$i<$pos2;$i++)\n\t\t\t\t\t\t\t\t$res .= $content[$i];\n\t\t\t\t\t\t\t$fileResult[] = $res;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Get \"\"\n\t\t\t\t\t\tif ($content[$pos+9]=='\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$res = \"\";\n\t\t\t\t\t\t\t$pos1 = strpos($content, '\"', $pos+1);\n\t\t\t\t\t\t\t$pos2 = strpos($content, '\"', $pos1+1);\n\n\t\t\t\t\t\t\tfor ($i=$pos1+1;$i<$pos2;$i++)\n\t\t\t\t\t\t\t\t$res .= $content[$i];\n\t\t\t\t\t\t\t$fileResult[] = $res;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$pos++;\n\t\t\t\t}\n\n\t\t\t\t// Check for snController - used when this can not be used\n\t\t\t\t$pos = 0;\n\t\t\t\twhile ($pos = strpos($content, 'snController'.'->__(', $pos))\n\t\t\t\t{\n\t\t\t\t\tif ($pos)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Get ''\n\t\t\t\t\t\tif ($content[$pos+17]==\"'\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$res = \"\";\n\t\t\t\t\t\t\t$pos1 = strpos($content, \"'\", $pos+1);\n\t\t\t\t\t\t\t$pos2 = strpos($content, \"'\", $pos1+1);\n\n\t\t\t\t\t\t\tfor ($i=$pos1+1;$i<$pos2;$i++)\n\t\t\t\t\t\t\t\t$res .= $content[$i];\n\t\t\t\t\t\t\t$fileResult[] = $res;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Get \"\"\n\t\t\t\t\t\tif ($content[$pos+17]=='\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$res = \"\";\n\t\t\t\t\t\t\t$pos1 = strpos($content, '\"', $pos+1);\n\t\t\t\t\t\t\t$pos2 = strpos($content, '\"', $pos1+1);\n\n\t\t\t\t\t\t\tfor ($i=$pos1+1;$i<$pos2;$i++)\n\t\t\t\t\t\t\t\t$res .= $content[$i];\n\t\t\t\t\t\t\t$fileResult[] = $res;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$pos++;\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\techo \"No file\";\n\t\t\t}\n\t\t}\n $fileResult = array_unique($fileResult);\n //Fetch and compare texts from database with collected fileresults to find unused texts and delete them\n if (!empty($fileResult)) {\n echo \"TRANSLATION KEY DELETION: <br/><br/>\";\n\n $dRows = 0;\n $screentexts = new GeScreenTexts();\n $params['select'] = \"{$screentexts->_table}.ID_TEXT, {$screentexts->_table}.TransKey\";\n $dbKeys = Doo::db()->find('GeScreenTexts', $params);\n foreach($dbKeys as $text) {\n $key = array_search($text->TransKey, $fileResult);\n // If key isn't used, delete it\n if(!$key) {\n $query = \"DELETE FROM ge_screentexts WHERE ID_TEXT={$text->ID_TEXT}\";\n echo \"Deleted: $text->TransKey<br/>\";\n Doo::db()->query($query);\n $dRows++;\n }\n }\n echo \"$dRows keys deleted<br/><br/>\";\n }\n\n\t\t//Loop thru the collected fileresults and find new untranslated texts and insert them\n\t\tif (!empty($fileResult)) {\n\t\t\techo \"FILE TRANSLATION: <br/><br/>\";\n\n\t\t\t$nRows = 0;\n\t\t\tforeach ($fileResult as $item)\n\t\t\t{\n\t\t\t\t$query = \"SELECT COUNT(*) as n FROM ge_screentexts WHERE TransKey=\" .'\"' . $item . '\"';\n\n\t\t\t\t$o = (object)Doo::db()->fetchRow($query);\n\t\t\t\t$n = $o->n;\n\n\t\t\t\tif ($n==0)\n\t\t\t\t{\n\t\t\t\t\t$query = \"INSERT INTO ge_screentexts\".\n\t\t\t\t\t\t\t \"(TransKey,TransTextEN,TransTextDA,TransTextDE,TransTextFR,TransTextES,TransTextRO,TransTextLT,TransTextBG,\".\n\t\t\t\t\t\t\t \"TransTextNL,TransTextEL,TransTextTR,TransTextZH,TransTextIS,TransTextBR,TransTextTH,TransTextPT,TransTextRU,\".\n\t\t\t\t\t\t\t \"TransTextPL,TransTextFI,TransTextFA,TransTextDR,TransTextNO,TransTextSE,TransTextHU,TransTextAR,TransTextET)\".\n\t\t\t\t\t\t\t \"VALUES (\".'\"'.$item.'\",\"'.$item.'\"'.\",'','','','','','','','','','','','','','','','','','','','','','','','','')\";\n\t\t\t\t\techo \"New: $item<br/>\";\n\t\t\t\t\tDoo::db()->query($query);\n\t\t\t\t\t//echo \" - $query<br/>\";\n\t\t\t\t\t$nRows++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\techo \"$nRows new rows added<br/>\";\n\t\t}\n\n\n\t\techo \"<p>Synch translations done</p>\";\n\t\texit;\n\n\t}",
"public function getTranslations()\n {\n }",
"public function getTranslationsForFile($file)\n {\n $data = TranslationContentQuery::create()\n ->select(array('Content', 'TranslationKey.KeyName'))\n ->filterByTranslationFile($file)\n ->joinWithTranslationKey()\n ->find();\n\n $return = array();\n foreach ($data as $line) {\n $return[$line['TranslationKey.KeyName']] = $line['Content'];\n }\n\n return $return;\n }",
"public function getTranlations($file)\n {\n $data = File::get($file);\n\n //\tTry to pick up all Lang functions from file\n preg_match_all('/(trans|Lang::get)\\(([^\\)]*)\\)/imU', $data, $matches, PREG_PATTERN_ORDER);\n\n //\treturn empty array if none found\n if (empty($matches[ 2 ])) {\n return [];\n }\n\n //\treturn unique translations\n $files = array_unique($matches[ 2 ]);\n\n //\tclean up\n foreach ($files as &$item) {\n\n //\tSet parameters [], if we have parameters on our translatios, fill it up next\n $parameters = [];\n\n //\tseparate parameters path from parameters\n preg_match('/,\\s*\\t*(\\[.*\\])/i', $item, $parts);\n if (!empty($parts)) {\n\n $item = str_replace($parts[ 0 ], '', $item);\n $_parameters = $parts[ 1 ];\n\n preg_match_all('/(\"|\\')([^\\'\"]*)(\"|\\')\\s*\\t*\\n*\\r*=\\s*>/iU', $_parameters, $keys);\n\n if (empty($keys[ 2 ])) {\n $parameters = array_fill_keys($keys[ 2 ], 'val');\n }\n }\n\n $_i = trim(str_replace(['\\'', '\"'], '', $item));\n\n $item = [\n 'lang_query' => $_i,\n 'valid' => (preg_match('/[^0-9a-zA-Z\\._]/', $_i) == 0),\n 'group' => substr($_i, 0, strpos($_i, '.')),\n 'line' => substr($_i, strpos($_i, '.') + 1),\n 'parameters' => $parameters,\n ];\n }\n\n return $files;\n }",
"public function getTranslationsForFile(File $file, $onlyUpdated);",
"function load_texts($file)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid language file found in language folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__LANGUAGE__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}",
"protected function getTranslation()\n {\n $language = $this->request->getBestLanguage();\n\n // Check if we have a translation file for that lang\n // TODO 处理英文\n if (file_exists(APP_PATH . \"/app/messages/\" . $language . \".php\")) {\n require_once APP_PATH. '/app/messages/'. $language . \".php\";\n } else {\n require_once APP_PATH. '/app/messages/zh-CN.php';\n // Fallback to some default\n// require \"../messages/en.php\";\n }\n\n // Return a translation object\n return new NativeArray(\n array(\n \"content\" => $messages\n )\n );\n }",
"private function extractGettextStrings()\n {\n $translation = null;\n $translationObjects = array();\n $lookupDirectories = array(\n Strata::getVendorPath() . 'strata-mvc' . DIRECTORY_SEPARATOR . 'strata' . DIRECTORY_SEPARATOR . 'src',\n Strata::getSrcPath(),\n Strata::getThemesPath(),\n );\n\n foreach ($lookupDirectories as $directory) {\n $translationObjects = $this->recurseThroughDirectory($directory);\n\n // Merge all translation objects into a bigger one\n foreach ($translationObjects as $t) {\n if (is_null($translation)) {\n $translation = $t;\n } else {\n $translation->mergeWith($t);\n }\n }\n }\n\n return $translation;\n }",
"protected function loadTranslations()\n {\n if (!isset($this->translations[$this->language])) {\n $file = $this->getTranslationFile($this->language);\n $content = file_get_contents($file);\n $translations = json_decode($content, true);\n if (!is_array($translations)) {\n throw new \\InvalidArgumentException(\"Could not parse JSON translation file: \" . $file);\n }\n\n $this->translations[$this->language] = $translations;\n }\n\n return $this->translations[$this->language];\n }",
"function &getTranslations(){\n\t\tif ( isset( $this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$translations = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$translations = array_merge($translations, $tables[$tablename]->getTranslations());\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $translations;\n\t\treturn $translations;\n\t\t\n\t}",
"function getTranslationObject();",
"protected function getTranslations() {\n\t\treturn $this->_viewHelper->getTranslations();\n\t}",
"public static function getTranslations() {\n $settings = self::getSettings();\n return json_decode($settings->translations, true);\n }",
"public function get_translations ($type = 'file') {\n\n\t\tif ($this->lang != null) {\n\n\t\t\tif ($type == 'file') {\n\n\t\t\t\t$this->t = $this->_get_translations_from_file();\n\n\t\t\t} elseif ($type == 'db') {\n\n\t\t\t\t$this->t = $this->_get_translations_from_db();\n\n\t\t\t}//end elsefi\n\n\t\t}//end if\n\n\t}",
"protected function translations(): array\n {\n return $this->cache->get('translations', function (): array {\n return array_values(array_map(function (SplFileInfo $file): string {\n return $file->getBasename('.yaml');\n }, iterator_to_array(\n Finder::create()->in($this->config->get('translations_path'))->name('*.yaml')\n )));\n });\n }",
"function load_t2s_text(){\n\tglobal $config, $t2s_langfile, $t2s_text_stand, $templatepath;\n\t\n\tif (file_exists($templatepath.'/lang/'.$t2s_langfile)) {\n\t\t$TL = parse_ini_file($templatepath.'/lang/'.$t2s_langfile, true);\n\t} else {\n\t\tLOGGING(\"For selected T2S language no translation file still exist! Please go to LoxBerry Plugin translation and create a file for selected language \".substr($config['TTS']['messageLang'],0,2),3);\n\t\texit;\n\t}\n\treturn $TL;\n}",
"private function translations()\n {\n $this['translator'] = $this->share($this->extend('translator', function ($translator) {\n $translator->addLoader('yaml', new TranslationFileLoader());\n\n $translator->addResource('yaml', 'config/locales/pt-br.yml', 'pt-br');\n $translator->addResource('yaml', 'config/locales/en-us.yml', 'en-us');\n $translator->addResource('yaml', 'config/locales/es-es.yml', 'es-es');\n\n return $translator;\n }));\n }",
"function doTranslate($file,$languages){\n\techo \"\\n\\n=============================\\n\";\n\techo \"Translating $file\\n\";\n\techo \"=============================\\n\";\n\t$filenamepart=explodeFile($file);\n\t$buffer=file_get_contents($file);\n\t//loop through the languages\n\tforeach ($languages as $key=>$lang){\n\t\techo \"-----------------------------\\n\";\n\t\techo \"Translating to language $key\\n\";\n\t\techo \"-----------------------------\\n\";\n\t\t$posR=0;\n\t\t$translated = \"\";\n\t\twhile (true){\n\t\t\t//find next occurence of a data-i18n attribute\n\t\t\t$pos1 = getNextDataI18N($buffer,$posR+1);\n\t\t\t\n\t\t\t//if there is no more occurence, there's nothing more to do; break this loop\n\t\t\tif ($pos1==false) {break;}\n\t\t\t\n\t\t\t//else extract the dataName from this attribute\n\t\t\t$pos2 = getNextQuote($buffer,$pos1+1);\n\t\t\t$dataName = getTextBetween($buffer,$pos1,$pos2);\n\t\t\n\t\t\t//append with text that comes before the string to be translated\n\t\t\t$posL = getNextGt($buffer,$pos2);\n\t\t\t$translated .= getTextBefore($buffer,$posR,$posL);\n\t\t\t\n\t\t\t//append with translation of said string\n\t\t\t$replaceText = getI18nText($dataName,$lang);\n\t\t\techo \"* $dataName=$replaceText\\n\";\t\n\t\t\t$translated .= $replaceText;\n\t\t\t\n\t\t\t//go to end of translated string\n\t\t\t$posR = getNextLt($buffer,$posL);\n\t\t\t$pos1 = $posR;\n\t\t\n\t\t}\n\t\t//append part of file after last translated string\n\t\t$translated .= substr($buffer,$posR,-1);// getTextAfter($buffer,$posR);\n\t\t\n\t\t//if language directory does not exist, create it\n\t\t$directory = $filenamepart[0].\"$key/\"; \n\t\tif (!is_dir($directory)) {\n\t\t\tmkdir($directory);\n\t\t\techo \"* created directory $directory\\n\";\n\t\t}\n\t\t\n\t\t//create file for language\n\t\t$newFile=$directory.$filenamepart[1];\n\t\tfile_put_contents($newFile,$translated);\n\t\t\n\t}\n}",
"protected function load()\n {\n $this->translations = array();\n \n if ($this->language) {\n if ($this->cachepath) {\n if (file_exists($cache = $this->cachepath.'/'.$this->language.'.php')) {\n $this->translations = include($cache);\n }\n } else {\n if (!empty($this->filepaths)) {\n foreach ($this->filepaths as $filepath) {\n $this->loadFilePath($filepath);\n }\n }\n }\n }\n }",
"public function translations() {\n return $this->client->get(self::$apiName, array());\n }",
"function loadTranslation($language = 'en')\n{\n $content = json_decode(file_get_contents(TRANSLATIONS_FOLDER . DS . $language . '.json'), true);\n if ($content && count($content)) {\n return $content;\n } else {\n return $language == 'en' ? array() : loadTranslation('en');\n }\n}",
"public function getTranslationsForKey($key);",
"function load_script_translations($file, $handle, $domain)\n {\n }",
"protected function extract_strings() {\n\t\t$translations = new Translations();\n\n\t\t// Add existing strings first but don't keep headers.\n\t\tif ( ! empty( $this->merge ) ) {\n\t\t\t$existing_translations = new Translations();\n\t\t\tPo::fromFile( $this->merge, $existing_translations );\n\t\t\t$translations->mergeWith( $existing_translations, Merge::ADD | Merge::REMOVE );\n\t\t}\n\n\t\tPotGenerator::setCommentBeforeHeaders( $this->get_file_comment() );\n\n\t\t$this->set_default_headers( $translations );\n\n\t\t// POT files have no Language header.\n\t\t$translations->deleteHeader( Translations::HEADER_LANGUAGE );\n\n\t\t// Only relevant for PO files, not POT files.\n\t\t$translations->setHeader( 'PO-Revision-Date', 'YEAR-MO-DA HO:MI+ZONE' );\n\n\t\tif ( $this->domain ) {\n\t\t\t$translations->setDomain( $this->domain );\n\t\t}\n\n\t\tunset( $this->main_file_data['Version'], $this->main_file_data['License'], $this->main_file_data['Domain Path'], $this->main_file_data['Text Domain'] );\n\n\t\t$is_theme = isset( $this->main_file_data['Theme Name'] );\n\n\t\t// Set entries from main file data.\n\t\tforeach ( $this->main_file_data as $header => $data ) {\n\t\t\tif ( empty( $data ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$translation = new Translation( '', $data );\n\n\t\t\tif ( $is_theme ) {\n\t\t\t\t$translation->addExtractedComment( sprintf( '%s of the theme', $header ) );\n\t\t\t} else {\n\t\t\t\t$translation->addExtractedComment( sprintf( '%s of the plugin', $header ) );\n\t\t\t}\n\n\t\t\t$translations[] = $translation;\n\t\t}\n\n\t\ttry {\n\t\t\tif ( ! $this->skip_php ) {\n\t\t\t\t$options = [\n\t\t\t\t\t// Extract 'Template Name' headers in theme files.\n\t\t\t\t\t'wpExtractTemplates' => $is_theme,\n\t\t\t\t\t// Extract 'Title' and 'Description' headers from pattern files.\n\t\t\t\t\t'wpExtractPatterns' => $is_theme,\n\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t'extensions' => [ 'php' ],\n\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t];\n\t\t\t\tPhpCodeExtractor::fromDirectory( $this->source, $translations, $options );\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_blade ) {\n\t\t\t\t$options = [\n\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t'extensions' => [ 'blade.php' ],\n\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t];\n\t\t\t\tBladeCodeExtractor::fromDirectory( $this->source, $translations, $options );\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_js ) {\n\t\t\t\tJsCodeExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'js', 'jsx' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t\tMapCodeExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'map' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_block_json ) {\n\t\t\t\tBlockExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'schema' => JsonSchemaExtractor::BLOCK_JSON_SOURCE,\n\t\t\t\t\t\t'schemaFallback' => JsonSchemaExtractor::BLOCK_JSON_FALLBACK,\n\t\t\t\t\t\t// Only look for block.json files, nothing else.\n\t\t\t\t\t\t'restrictFileNames' => [ 'block.json' ],\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'json' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_theme_json ) {\n\t\t\t\t// This will look for the top-level theme.json file, as well as\n\t\t\t\t// any JSON file within the top-level styles/ directory.\n\t\t\t\tThemeJsonExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'schema' => JsonSchemaExtractor::THEME_JSON_SOURCE,\n\t\t\t\t\t\t'schemaFallback' => JsonSchemaExtractor::THEME_JSON_FALLBACK,\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'json' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\tWP_CLI::error( $e->getMessage() );\n\t\t}\n\n\t\tforeach ( $this->exceptions as $file => $exception_translations ) {\n\t\t\t/** @var Translation $exception_translation */\n\t\t\tforeach ( $exception_translations as $exception_translation ) {\n\t\t\t\tif ( ! $translations->find( $exception_translation ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->subtract_and_merge ) {\n\t\t\t\t\t$translation = $translations[ $exception_translation->getId() ];\n\t\t\t\t\t$exception_translation->mergeWith( $translation );\n\t\t\t\t}\n\n\t\t\t\tunset( $translations[ $exception_translation->getId() ] );\n\t\t\t}\n\n\t\t\tif ( $this->subtract_and_merge ) {\n\t\t\t\tPotGenerator::toFile( $exception_translations, $file );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $this->skip_audit ) {\n\t\t\t$this->audit_strings( $translations );\n\t\t}\n\n\t\treturn $translations;\n\t}",
"function wp_get_available_translations()\n {\n }",
"protected function sectionTranslations()\n {\n $found = []; // translations found in latte templates\n foreach (glob('template/*.latte') as $file) {\n $tempFileContents = file_get_contents($file);\n Assert::string($tempFileContents);\n preg_match_all('~\\{=(\"([^\"]+)\"|\\'([^\\']+)\\')\\|translate\\}~i', $tempFileContents, $matches);\n $found = array_merge($found, $matches[2]);\n }\n $found = array_unique($found);\n $output = '<h1><i class=\"fa fa-globe\"></i> ' . $this->tableAdmin->translate('Translations')\n . '</h1><div id=\"agenda-translations\">'\n . '<form action=\"\" method=\"post\" onsubmit=\"return confirm(\\''\n . $this->tableAdmin->translate('Are you sure?') . '\\')\">'\n . Tools::htmlInput('translations', '', 1, array('type' => 'hidden'))\n . Tools::htmlInput('token', '', end($_SESSION['token']), 'hidden')\n . Tools::htmlInput('old_name', '', '', array('type' => 'hidden', 'id' => 'old_name'))\n . '<table class=\"table table-striped\"><thead><tr><th style=\"width:'\n . intval(100 / (count($this->MyCMS->TRANSLATIONS) + 1)) . '%\">'\n . Tools::htmlInput('one', '', false, 'radio') . '</th>';\n $translations = $keys = [];\n $localisation = new L10n($this->prefixUiL10n, $this->MyCMS->TRANSLATIONS);\n foreach ($this->MyCMS->TRANSLATIONS as $key => $value) {\n $output .= \"<th>$value</th>\";\n $translations[$key] = $localisation->readLocalisation($key);\n $keys = array_merge($keys, array_keys($translations[$key]));\n }\n $output .= '</tr></thead><tbody>' . PHP_EOL;\n $keys = array_unique($keys);\n natcasesort($keys);\n foreach ($keys as $key) {\n $output .= '<tr><th>'\n . Tools::htmlInput('one', '', $key, array('type' => 'radio', 'class' => 'translation')) . ' '\n . Tools::h((string) $key) . '</th>';\n foreach ($this->MyCMS->TRANSLATIONS as $code => $value) {\n $output .= '<td>' . Tools::htmlInput(\n \"tr[$code][$key]\",\n '',\n Tools::set($translations[$code][$key], ''),\n ['class' => 'form-control form-control-sm', 'title' => \"$code: $key\"]\n ) . '</td>';\n }\n $output .= '</tr>' . PHP_EOL;\n if ($key = array_search($key, $found)) {\n unset($found[$key]);\n }\n }\n $output .= '<tr><td>' . Tools::htmlInput(\n 'new[0]',\n '',\n '',\n array('class' => 'form-control form-control-sm', 'title' => $this->tableAdmin->translate('New record'))\n ) . '</td>';\n foreach ($this->MyCMS->TRANSLATIONS as $key => $value) {\n $output .= '<td>' . Tools::htmlInput(\n \"new[$key]\",\n '',\n '',\n ['class' => 'form-control form-control-sm',\n 'title' => $this->tableAdmin->translate('New record') . ' (' . $value . ')']\n ) . '</td>';\n }\n $output .= '</tr></tbody></table>\n <button name=\"translations\" type=\"submit\" class=\"btn btn-secondary\"><i class=\"fa fa-save\"></i> '\n . $this->tableAdmin->translate('Save') . '</button>\n <button name=\"delete\" type=\"submit\" class=\"btn btn-secondary\" value=\"1\"><i class=\"fa fa-dot-circle\"></i>\n <i class=\"fa fa-trash\"></i> ' . $this->tableAdmin->translate('Delete') . '</button>\n <fieldset class=\"d-inline-block position-relative\"><div class=\"input-group\" id=\"rename-fieldset\">'\n . '<div class=\"input-group-prepend\">\n <button class=\"btn btn-secondary\" type=\"submit\"><i class=\"fa fa-dot-circle\"></i> '\n . '<i class=\"fa fa-i-cursor\"></i> ' . $this->tableAdmin->translate('Rename') . '</button>\n </div>'\n . Tools::htmlInput('new_name', '', '', array('class' => 'form-control', 'id' => 'new_name'))\n . '</div></fieldset>\n </form></div>' . PHP_EOL;\n $output .= count($found) ? '<h2 class=\"mt-4\">' .\n $this->tableAdmin->translate('Missing translations in templates') . '</h2><ul>' : '';\n foreach ($found as $value) {\n $output .= '<li><code>' . Tools::h($value) . '</code></li>' . PHP_EOL;\n }\n $output .= count($found) ? '</ul>' : '';\n return $output;\n }",
"public function loadTranslations()\n {\n $oTranslation = new Translation($this->sLang, $this->sBundleName);\n $this->aView[\"lang\"] = $this->sLang;\n $this->aView[\"tr\"] = $oTranslation->getTranslations();\n }",
"private function getTranslations( $domain )\n\t{\n\t\tif( !isset( $this->translations[$domain] ) )\n\t\t{\n\t\t\tif( !isset( $this->translationSources[$domain] ) )\n\t\t\t{\n\t\t\t\t$msg = sprintf( 'No translation directory for domain \"%1$s\" available', $domain );\n\t\t\t\tthrow new \\Aimeos\\MW\\Translation\\Exception( $msg );\n\t\t\t}\n\n\t\t\t// Reverse locations so the former gets not overwritten by the later\n\t\t\t$locations = array_reverse( $this->getTranslationFileLocations( $this->translationSources[$domain], $this->getLocale() ) );\n\n\t\t\tforeach( $locations as $location )\n\t\t\t{\n\t\t\t\tif( ( $content = file_get_contents( $location ) ) === false ) {\n\t\t\t\t\tthrow new \\Aimeos\\MW\\Translation\\Exception( 'No translation file \"%1$s\" available', $location );\n\t\t\t\t}\n\n\t\t\t\tif( ( $content = unserialize( $content ) ) === false ) {\n\t\t\t\t\tthrow new \\Aimeos\\MW\\Translation\\Exception( 'Invalid content in translation file \"%1$s\"', $location );\n\t\t\t\t}\n\n\t\t\t\t$this->translations[$domain][] = $content;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->translations[$domain];\n\t}",
"protected function loadLocalization() {}",
"public function getAllTranslationByLanguage();",
"public function translations()\n\t{\n\t\treturn $this->hasMany($this->getTranslatorClassName(), 'original_id');\n\t}",
"public function translations()\n {\n $locales = config('translatable.locales');\n $fallback_locale = config('translatable.fallback_local');\n unset($locales[$fallback_locale]);\n $translations_count = count($locales);\n if ($translations_count === 1) {\n return $this->hasOne(get_class() . 'Translation');\n } else {\n return $this->hasMany(get_class(), 'Translation');\n }\n }",
"function install_translations() {\n $db = DB::getInstance();\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/translation.sql'))->error()) {\n return true;\n }\n else {\n System::addMessage('error', rt('An error occurred during the installation of your chosen language'));\n }\n return false;\n}",
"function codepress_get_lang($filename)\n {\n }",
"function scan_templates_for_translations () {\r\n $this->CI->load->helper( 'file' );\r\n $filename = config_item( 'dummy_translates_filename' );\r\n\r\n // Clean Pattern for new file\r\n $clean_pattern = \"<?php\\n\";\r\n\r\n // Emptying file\r\n write_file( $filename, $clean_pattern );\r\n\r\n $path = realpath( config_item( 'current_template_uri' ) );\r\n $directory = new RecursiveDirectoryIterator( $path );\r\n $iterator = new RecursiveIteratorIterator( $directory );\r\n\r\n // Regex for no deprecated twig templates\r\n $regex = '/^((?!DEPRECATED).)*\\.twig$/i';\r\n $file_iterator = new RegexIterator( $iterator, $regex, RecursiveRegexIterator::GET_MATCH );\r\n\r\n $files = 0;\r\n $arr_strings = array();\r\n\r\n foreach( $file_iterator as $name => $object ) {\r\n $files++;\r\n\r\n // Mega regex for Quoted String tokens with escapable quotes\r\n // http://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes\r\n $pattern = '/{%\\s?trans\\s?((?<![\\\\\\\\])[\\'\"])((?:.(?!(?<![\\\\\\\\])\\1))*.?)\\1/';\r\n $current_file = fopen( $name, 'r' );\r\n\r\n while ( ( $buffer = fgets( $current_file ) ) !== false ) {\r\n if ( preg_match_all( $pattern, $buffer, $matches ) ) {\r\n foreach( $matches[ 2 ] as $match ) {\r\n // Escaping quotes not yet escaped\r\n $match = preg_replace( '/(?<![\\\\\\\\])(\\'|\")/', \"\\'\", $match );\r\n array_push( $arr_strings, \"echo _( '$match' );\\n\" );\r\n }\r\n }\r\n }\r\n\r\n fclose( $current_file );\r\n }\r\n\r\n // Remove duplicates\r\n $arr_strings = array_unique( $arr_strings );\r\n write_file( $filename, implode( $arr_strings ), 'a' );\r\n\r\n $result = array(\r\n 'templates' => $files,\r\n 'strings' => count( $arr_strings ),\r\n 'output' => $filename,\r\n 'lint' => check_php_file_syntax( $filename )\r\n );\r\n\r\n return $result;\r\n }",
"function translation() {\n\t\t\n\t\t// only use, if we have it...\n\t\tif( function_exists('load_plugin_textdomain') ) {\n\t\t\n\t\t\t// load it\n\t\t\tload_plugin_textdomain( \n\t\t\t\n\t\t\t\t// unique name\n\t\t\t\t'cp-multisite', \n\t\t\t\t\n\t\t\t\t// deprecated argument\n\t\t\t\tfalse,\n\t\t\t\t\n\t\t\t\t// path to directory containing translation files\n\t\t\t\tplugin_dir_path( CPMU_PLUGIN_FILE ) . 'languages/'\n\t\t\t\t\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"function update_translations()\n\t{\n\t\t$this->load->library('translator');\n\t\t\n\t\t//application language folder\n\t\t$language_folder=APPPATH.'language/';\n\t\t\n\t\t//template language \n\t\t$language='base';\n\t\t\n\t\t//path to the language folder\n\t\t$language_path=$language_folder.$language;\n\t\t\n\t\t//get a list of all translation files for the given language \n\t\t$files=$this->translator->get_language_files_array($language_path);\n\t\t\n\t\t//will be updated with additons from the BASE language file\n\t\t$target_language=$this->config->item(\"language\");\n\t\t\n\t\tif (!$target_language)\n\t\t{\n\t\t\techo \"language $target_language was not found\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tforeach($files as $file)\n\t\t{\n\t\t\t$target_filepath=$language_folder.'/'.$target_language.'/'.$file;\n\n\t\t\t//merge source and target language file to fill in missing translations for the target language\n\t\t\t$data['translations']=$this->translator->merge_language_keys($language_path.'/'.$file,$target_filepath);\n\t\t\t$data['language_name']=$target_language;\n\t\t\t$data['translation_file']=$file;\n\t\t\t\n\t\t\t//target language file content\n\t\t\t$content='<?php '.\"\\n\\n\".$this->load->view('translator/save',$data,TRUE);\n\t\t\t\n\t\t\t//update the target language file\n\t\t\t$save_result=@file_put_contents($target_filepath,$content);\n\t\t\t\n\t\t\tif($save_result)\n\t\t\t{\n\t\t\t\techo \"Language file updated: \" . $target_filepath.'<br />';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<div style='color:red;'>Language file update failed: \" . $target_filepath.'</div>';\n\t\t\t}\n\t\t}\t\t\n\t}",
"public function getTranslations()\n {\n return $this->language;\n }",
"function GetLocalizedTexts()\n\t{\n\t\t$result = $this->sendRequest(\"GetLocalizedTexts\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"private function read() \n {\n if ($this->lang == '') $this->lang = App::getLocale();\n $this->path = base_path().'/resources/lang/'.$this->lang.'/'.$this->file.'.php';\n $this->arrayLang = Lang::get($this->file);\n if (gettype($this->arrayLang) == 'string') $this->arrayLang = array();\n }",
"function getDictionary ()\n\t{\n\t\t$dictionary = array ();\n\t\tinclude ('framework/i18n/dictionary_en.php');\n\t\t$file = 'framework/i18n/dictionary_'.$_SESSION['brimLanguage'].'.php';\n\t\tif (file_exists ($file))\n\t\t{\n\t\t\tinclude ($file);\n\t\t}\n\t\treturn $dictionary;\n\t}",
"public function getTranslationsForLanguage($language);",
"public function load_translation() {\n\t\t\t$locale = apply_filters( 'plugin_locale', determine_locale(), 'sv_core' );\n\t\t\tload_textdomain( 'sv_core', dirname( __FILE__ ) . '/languages/sv_core-'.$locale.'.mo' );\n\t\t}",
"public function translated();",
"public function translated();",
"public function getTranslations()\n {\n return $this->translations;\n }",
"function loadLocale($translation) {\n\t\t\treturn include($translation);\n\t\t}",
"public function translations()\n {\n $this->loadTranslationsFrom(__DIR__.'/Resources/Lang', $this->packageName);\n\n $this->publishes([\n __DIR__.'/path/to/translations' => resource_path('lang/vendor/courier'),\n ], $this->packageName.'-translations');\n }",
"function wp_load_translations_early()\n {\n }",
"public function initLocalization() {\n $moFiles = scandir(trailingslashit($this->dir) . 'languages/');\n foreach ($moFiles as $moFile) {\n if (strlen($moFile) > 3 && substr($moFile, -3) == '.mo' && strpos($moFile, get_locale()) > -1) {\n load_textdomain('WP_Visual_Chat', trailingslashit($this->dir) . 'languages/' . $moFile);\n }\n }\n }",
"public function loadLang(){\n\n if($this->id == -1 || empty($this->databasePath))\n return \"\";\n\n $sqlQuery = 'SELECT L.lang_code as lang FROM books_languages_link BLL, languages L WHERE BLL.lang_code = L.id AND BLL.book = '.$this->id;\n\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n return $row['lang'];\n \n return \"\";\n }",
"public function languages_get() {\n\t\t$language_files = array();\n\t\t$all_files = $this->crud_model->get_list_of_language_files();\n\t\t$counter = 0;\n\t\tforeach ($all_files as $file) {\n\t\t\t$info = pathinfo($file);\n\t\t\tif( isset($info['extension']) && strtolower($info['extension']) == 'json') {\n\t\t\t\t$inner_array = array();\n\t\t\t\t$file_name = explode('.json', $info['basename']);\n\t\t\t\t$inner_array = array(\n\t\t\t\t\t'id' => $counter++,\n\t\t\t\t\t'value' => $file_name[0],\n\t\t\t\t\t'displayedValue' => ucfirst($file_name[0])\n\t\t\t\t);\n\n\t\t\t\tarray_push($language_files, $inner_array);\n\t\t\t}\n\t\t}\n\t\treturn $language_files;\n\t}",
"protected function load_translations() {\n\t\t// load the plugin text domain\n\t\tload_plugin_textdomain( 'mailchimp-for-wp', false, 'mailchimp-for-wp-pro/languages/' );\n\t}",
"public function getMultilingual();",
"function wp_get_translation_updates()\n {\n }",
"function getTranslationsOfModule($module)\n {\n $translations = [];\n $resourcesLangPath = $this->getResourcesLangPath($module);\n $iniFiles = $this->getIniFilesOfModule($module);\n foreach ($iniFiles as $file => $data)\n $translations[str_replace('.ini', '', $data)] = parse_ini_file (\"$resourcesLangPath/$data\");\n\n return $translations;\n }",
"function get_translations_for_domain($domain)\n {\n }",
"public function getStrings ()\n {\n return $this->translate;\n }",
"static public function getTranslate()\r\n {\r\n return Warecorp_Translate::getTranslate();\r\n }",
"public function getTranslations()\n {\n return $this->hasMany(NewsItemLang::class, ['news_item_id' => 'id']);\n }",
"function load_custom_plugin_translation_file( $mofile, $domain ) { \n\t\n\t// folder location\n\t$folder = WP_PLUGIN_DIR . '/kinogeneva-translations/languages/';\n\t\n\t// filename ending\n\t$file = '-' . get_locale() . '.mo';\n\t\n\t$plugins = array(\n\t\t'buddypress',\n\t\t'bxcft',\n\t\t'wp-user-groups',\n\t\t'kleo_framework',\n\t\t'invite-anyone',\n\t\t'bp-groups-taxo',\n\t\t'bp-docs'\n\t);\n\t\n\tforeach ($plugins as &$plugin) {\n\t\tif ( $plugin === $domain ) {\n\t\t $mofile = $folder.$domain.$file;\n\t }\n\t}\n\n return $mofile;\n\n}",
"static function getList_languages(){\n \t$configFile = dirname ( __FILE__ ).'/../config/'.DIRECTORY_SEPARATOR.'config_languages.php';\n \t$tmp=require($configFile);\n \t foreach ($tmp as $code=>$item){\n \t$tmp[$code]=Language::t(Yii::app()->language,'Backend.Language.List',$item);\n }\n return $tmp;\n }",
"public function getTranslations( $language )\n\t{\n\t\t$sql = <<<TRANSLATIONS\nSELECT\n\t*\nFROM\n\t`i18n_messages` m\nLEFT JOIN\n\ti18n_translations t ON m.id=t.id_message AND lang =?\nORDER BY\n\tt.translation ASC, m.message ASC\nTRANSLATIONS;\n\n\treturn $this->GetArray( $sql, array( $language, 'tag' => 'Get all translations for current language' ) );\n\t}",
"public function loadDictionary()\n {\n if (self::$dictionary_loaded) {\n return true;\n }\n\n if ($this->use_apcu) {\n do {\n if (!apcu_exists(\"dictionary_supported_languages\")) {\n break;\n }\n\n self::$supported_languages = apcu_fetch(\"dictionary_supported_languages\");\n if (empty(self::$supported_languages)) {\n break;\n }\n\n if (!apcu_exists(\"dictionary_languages\")) {\n break;\n }\n self::$languages = apcu_fetch(\"dictionary_languages\");\n if (empty(self::$languages)) {\n break;\n }\n\n if (!apcu_exists(\"dictionary_countries\")) {\n break;\n }\n self::$countries = apcu_fetch(\"dictionary_countries\");\n if (empty(self::$countries)) {\n break;\n }\n\n if (!apcu_exists(\"dictionary_texts\")) {\n break;\n }\n self::$texts = apcu_fetch(\"dictionary_texts\");\n if (empty(self::$texts)) {\n break;\n }\n\n return true;\n } while (false);\n }\n\n $json_array = [];\n\n $json = file_get_contents($this->localization_path . \"config.json\");\n if ($json === false) {\n throw new \\Exception(\"Translation file '\" . $this->localization_path . \"config.json\" . \"' cannot be loaded or does not exist!\");\n }\n\n try {\n json_to_array($json, $json_array);\n } catch (\\Throwable $ex) {\n throw new \\Exception(\"Translation file '\" . $this->localization_path . \"config.json\" . \"' is invalid!\" . \"\\n\\n\" . $ex->getMessage());\n }\n\n $json = file_get_contents($this->localization_path . \"languages.json\");\n if ($json === false) {\n throw new \\Exception(\"Translation file '\" . $this->localization_path . \"languages.json\" . \"' cannot be loaded or does not exist!\");\n }\n\n try {\n json_to_array($json, $json_array[\"languages\"]);\n } catch (\\Throwable $ex) {\n throw new \\Exception(\"Translation file '\" . $this->localization_path . \"languages.json\" . \"' is invalid!\" . \"\\n\\n\" . $ex->getMessage());\n }\n\n $json = file_get_contents($this->localization_path . \"countries.json\");\n if ($json === false) {\n throw new \\Exception(\"Translation file '\" . $this->localization_path . \"countries.json\" . \"' cannot be loaded or does not exist!\");\n }\n\n try {\n json_to_array($json, $json_array[\"countries\"]);\n } catch (\\Throwable $ex) {\n throw new \\Exception(\"Translation file '\" . $this->localization_path . \"countries.json\" . \"' is invalid!\" . \"\\n\\n\" . $ex->getMessage());\n }\n\n $json = file_get_contents($this->localization_path . \"texts.json\");\n if ($json === false) {\n throw new \\Exception(\"Translation file '\" . $this->localization_path . \"texts.json\" . \"' cannot be loaded or does not exist!\");\n }\n\n try {\n json_to_array($json, $json_array[\"texts\"]);\n } catch (\\Throwable $ex) {\n throw new \\Exception(\"Translation file '\" . $this->localization_path . \"texts.json\" . \"' is invalid!\" . \"\\n\\n\" . $ex->getMessage());\n }\n\n if (!empty($this->additional_localization_files)) {\n foreach ($this->additional_localization_files as $localization_file) {\n $json = file_get_contents($localization_file);\n if ($json === false) {\n throw new \\Exception(\"Translation file '\" . $localization_file . \"' cannot be loaded or does not exist!\");\n }\n\n try {\n $translation_texts = [];\n json_to_array($json, $translation_texts);\n\n $json_array[\"texts\"] = array_merge($json_array[\"texts\"], $translation_texts);\n } catch (\\Throwable $ex) {\n throw new \\Exception(\"Translation file '\" . $localization_file . \"' is invalid!\" . \"\\n\\n\" . $ex->getMessage());\n }\n }\n }\n\n if (!empty($json_array[\"interface_languages\"])) {\n foreach ($json_array[\"interface_languages\"] as $lang_code) {\n self::$supported_languages[$lang_code] = $lang_code;\n }\n }\n\n if (!empty($json_array[\"languages\"])) {\n foreach ($json_array[\"languages\"] as $text_id => &$translations) {\n foreach ($translations as $lang_code => $translation) {\n self::$languages[$lang_code][$text_id] = $translation;\n }\n }\n }\n\n if (!empty($json_array[\"countries\"])) {\n foreach ($json_array[\"countries\"] as $text_id => &$translations) {\n foreach ($translations as $lang_code => $translation) {\n self::$countries[$lang_code][$text_id] = $translation;\n }\n }\n }\n\n if (!empty($json_array[\"texts\"])) {\n foreach ($json_array[\"texts\"] as $text_id => &$translations) {\n foreach ($translations as $lang_code => $translation) {\n self::$texts[$lang_code][$text_id] = $translation;\n }\n }\n }\n\n self::$dictionary_loaded = true;\n\n foreach (self::$supported_languages as $lng) {\n self::$current_language = $lng;\n break;\n }\n\n if ($this->use_apcu) {\n apcu_store(\"dictionary_supported_languages\", self::$supported_languages);\n apcu_store(\"dictionary_languages\", self::$languages);\n apcu_store(\"dictionary_countries\", self::$countries);\n apcu_store(\"dictionary_texts\", self::$texts);\n }\n\n return true;\n }",
"function getTranslation ($languageCode) {\n\t\t$trans = $this->getAllChildTables ('translatedPages', 'language_code', ORDER_ASC, \n\t\t\t\tarray (new WhereClause ('language_code', $languageCode, '=')));\n\t\tif ((count ($trans) >= 1) and (! isError ($trans))) {\n\t\t\t$tPageArray = $trans[0]; /*Normally I should get only one*/\n\t\t\t$creator = &$this->getCreator ();\n\t\t\t$tPage = $creator->newTranslatedPage ();\n\t\t\t$tPage->initFromArray ($tPageArray);\n\t\t\treturn $tPage;\n\t\t}\n\t\n\t\treturn new Error ('PAGE_TRANSLATION_DOESNT_EXIST', $languageCode);\n\t}",
"function _readLocaleInfo() {\n// $row = $this->select01($sql);\n// if (!$row) {\n// return false;\n// }\n $sql = $this->mkSQL('SELECT * FROM %I WHERE id = %Q', $this->tablePrfx.'lang', $this->_locale);\n return $this->select01($sql);\n }",
"protected function registerTranslations()\n {\n $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'kustomer');\n }",
"function getFileContent($file_name, $lang) {\n\t// stores the file's content\n\t$file_content = \"\";\n\n\t// build path to the data folder, where the .txt files are located\n\t$data_path = dirname(dirname(__FILE__)).\"/data/\";\n\n\t// check if the file is language independent\n\tif (file_exists($data_path.$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$file_name.\".txt\");\n\t// check if the file is language dependent\n\t}else if (file_exists($data_path.$lang.\"/\".$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$lang.\"/\".$file_name.\".txt\");\n\t}\n\n\t// check if the file_get_contents() returned a failure\n\tif ($file_content === False) {\n\t\t// it did\n\t\t// the content couldn't be retrieved, so set this file's content to an empty string\n\t\t$file_content = \"\";\n\t}\n\n\t// return this file's content\n\treturn($file_content);\n}",
"public function localeContents()\n {\n $ref = defined('static::REF_KEY') ? static::REF_KEY : ($this->table??'data');\n return $this->hasOne('App\\\\Models\\\\MultiLanguageContent', 'ref_id', 'id')->where('ref', $ref)->where('locale', config('app.locale'));\n }",
"protected function prepareFileContents() {\n\t\t// convert all language values to utf-8\n\t\tif (!typo3Lib::isTypo3BackendInUtf8Mode()) {\n\t\t\t$this->localLang = typo3Lib::utf8($this->localLang, TRUE, array('default'));\n\t\t}\n\n\t\t$mainFileContent = array('meta' => $this->prepareMeta());\n\t\t$languages = sgLib::getSystemLanguages();\n\t\tforeach ($languages as $langKey) {\n\t\t\t$mainFileContent = array_merge_recursive(\n\t\t\t\t$mainFileContent,\n\t\t\t\t$this->getLangContent($this->localLang[$langKey], $langKey)\n\t\t\t);\n\t\t}\n\n\t\t// prepare Content for the main file\n\t\t$languageFiles[$this->absFile] = $this->array2xml($mainFileContent, 'T3locallang');\n\n\t\treturn $languageFiles;\n\t}",
"private function load(): void\n {\n $paths = $this->getPaths();\n\n $this->locales['app'] = $this->loadTranslations($paths['app']);\n\n foreach ($paths['vendors'] as $path) {\n $this->locales['vendor-php'] = $this->loadTranslations($path);\n $this->locales['vendor-json'] = $this->loadJsonTranslations($path);\n }\n }",
"public static function load(string $lang): array\n {\n if (isset(static::$_cache[$lang])) {\n return static::$_cache[$lang];\n }\n\n // New translation table\n $table = [[]];\n\n // Split the language: language, region, locale, etc\n $parts = explode('-', $lang);\n\n // Loop through Paths\n foreach ([$parts[0], implode(DIRECTORY_SEPARATOR, $parts)] as $path) {\n // Load files\n $files = Core::findFile('i18n', $path);\n\n // Loop through files\n if (!empty($files)) {\n $t = [[]];\n foreach ($files as $file) {\n // Merge the language strings into the sub table\n $t[] = Core::load($file);\n }\n $table[] = $t;\n }\n }\n\n $table = array_merge(...array_merge(...$table));\n\n // Cache the translation table locally\n return static::$_cache[$lang] = $table;\n }",
"private function parseMo() {\n /*\n * TODO: gucken, ob file existiert\n */\n $content = file_get_contents(BASE_PATH.'/lang/'.LANGUAGE.'.mo');\n\t $fileSize = strlen($content);\n\t \n\t // Find the byte order of the MO file creator\n\t $byteOrder = substr($content, 0, 4);\n\t \n\t // Little endian\n\t if ($byteOrder == \"\\xde\\x12\\x04\\x95\") {\n\t \t$tmpl = \"V\";\n\t // Big endian\n\t } elseif ($byteOrder == \"\\x95\\x04\\x12\\xde\") {\n\t $tmpl = \"N\";\n\t // Wrong magic number. Not a valid MO file.\n\t } else {\n\t return 'wrong magic number';\n\t }\n\t \n\t // Check the MO format revision number\n\t $revision = unpack($tmpl, substr($content, 4, 4));\n\t if ($revision[1] > 0) return 'wrong revision';\n\t \n\t // Number of strings\n\t $numberOfStrings = unpack($tmpl, substr($content, 8, 4));\n\t \n\t // Offset to the beginning of the original strings\n\t $offo = unpack($tmpl, substr($content, 12, 4));\n\t \n\t // Offset to the beginning of the translated strings\n\t $offt = unpack($tmpl, substr($content, 16, 4));\n\t \n\t $trans = array();\n\t for ($i = 0; $i < $numberOfStrings[1]; $i++) {\n\t // The first word is the length of the string\n\t $len = unpack($tmpl, substr($content, $offo[1]+($i*8), 4));\n\t \n\t // The second word is the offset of the string\n\t $off = unpack($tmpl, substr($content, $offo[1]+($i*8)+4, 4));\n\t \n\t // Original string\n\t $stro = substr($content, $off[1], $len[1]);\n\t \n\t // The first word is the length of the string\n\t $len = unpack($tmpl, substr($content, $offt[1]+($i*8), 4));\n\t \n\t // The second word is the offset of the string\n\t $off = unpack($tmpl, substr($content, $offt[1]+($i*8)+4, 4));\n\t \n\t // Translated string\n\t $strt = substr($content, $off[1], $len[1]);\n\t \n\t // Hash it baby\n\t $trans[$stro] = $strt;\n\t \n\t }\n\t \n\t return $trans;\n }",
"final public static function load_gettext($from) {\n static $byte = NULL;\n\n\n if (is_null($byte)) {\n $byte = function ($length, $endian, &$resource) {\n return unpack(($endian ? 'N' : 'V') . $length, fread($resource, 4 * $length));\n };\n }\n\n\n if ( ! is_file($from)) {\n return FALSE;\n }\n\n\n $out = array();\n $resource = fopen($from, 'rb');\n\n $test = $byte(1, $endian, $resource);\n $part = strtolower(substr(dechex($test[1]), -8));\n $endian = '950412de' === $part ? FALSE : ('de120495' === $part ? TRUE : NULL);\n\n $test = $byte(1, $endian, $resource);// revision\n $test = $byte(1, $endian, $resource);// bytes\n $all = $test[1];\n\n // offsets\n $test = $byte(1, $endian, $resource);\n $omax = $test[1];// original\n\n $test = $byte(1, $endian, $resource);\n $tmax = $test[1];// translate\n\n // tables\n fseek($resource, $omax);// original\n $otmp = $byte(2 *$all, $endian, $resource);\n\n fseek($resource, $tmax);// translate\n $ttmp = $byte(2 *$all, $endian, $resource);\n\n for ($i = 0; $i < $all; $i += 1) {\n $orig = -1;\n\n if ($otmp[$i * 2 + 1] <> 0) {\n fseek($resource, $otmp[$i * 2 + 2]);\n $orig = fread($resource, $otmp[$i * 2 + 1]);\n }\n\n if ($ttmp[$i * 2 + 1] <> 0) {\n fseek($resource, $ttmp[$i * 2 + 2]);\n $out[$orig] = fread($resource, $ttmp[$i * 2 + 1]);\n }\n }\n\n fclose($resource);\n unset($out[-1]);\n\n return $out;\n }",
"function &getTranslation($name){\n\t\tif ( isset( $this->_cache[__FUNCTION__][$name] ) ) return $this->_cache[__FUNCTION__][$name];\n\t\t$tables =& $this->tables();\n\t\t$columns = array();\n\t\tforeach ( array_keys($tables) as $tablename ){\n\t\t\t$columns = array_merge($columns, $tables[$tablename]->getTranslation($name));\n\t\t}\n\t\t$this->_cache[__FUNCTION__][$name] =& $columns;\n\t\treturn $columns;\n\t}",
"public static function loadLanguages()\n\t{\n\t\tself::$_LANGUAGES = array();\n\t\t$result = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'Language`');\n\t\tforeach ($result AS $row)\n\t\t\tself::$_LANGUAGES[(int)$row['LanguageId']] = $row;\n\t}",
"function acp_load_language( $file=\"\" )\n {\n \tif ( ! $this->lang_id )\n \t{\n \t\t$this->lang_id = $this->member['language'] ? $this->member['language'] : $this->vars['default_language'];\n\n\t\t\tif ( ($this->lang_id != $this->vars['default_language']) and ( ! is_dir( ROOT_PATH.\"cache/lang_cache/\".$this->lang_id ) ) )\n\t\t\t{\n\t\t\t\t$this->lang_id = $this->vars['default_language'];\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Still nothing?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( ! $this->lang_id )\n\t\t\t{\n\t\t\t\t$this->lang_id = 'en';\n\t\t\t}\n\t\t}\n \t\n \t//-----------------------------------------\n \t// Load it\n \t//-----------------------------------------\n\n \tif( file_exists( ROOT_PATH.\"cache/lang_cache/\".$this->lang_id.\"/\".$file.\".php\" ) )\n \t{\n\t require_once( ROOT_PATH.\"cache/lang_cache/\".$this->lang_id.\"/\".$file.\".php\" );\n\t \n\t if ( is_array( $lang ) )\n\t {\n\t\t\t\tforeach ($lang as $k => $v)\n\t\t\t\t{\n\t\t\t\t\t$this->acp_lang[ $k ] = $v;\n\t\t\t\t}\n\t }\n }\n \n unset($lang);\n }",
"public function handle()\n {\n $paths = $this->getPaths();\n $translations = [];\n\n // Default laravel translations.\n $files = File::allFiles(\n resource_path('lang/en')\n );\n\n foreach ($files as $file) {\n $fullPath = $file->getPathname();\n $group = str_replace('.php', '', $file->getFilename());\n foreach (File::getRequire($fullPath) as $key => $translation) {\n foreach ($this->makeRows($group, $key, $translation) as $row) {\n if ($row['key'] === 'validation.custom.attribute-name') {\n continue;\n }\n\n $translations[$row['key']] = $row['value'];\n }\n }\n }\n\n // Find translations in files\n $finder = new Finder();\n $finder\n ->in($paths)\n ->name('*.php')\n ->notName('FindTranslations.php')\n ->files();\n\n // Init parser.\n $parser = (new ParserFactory)->create(ParserFactory::ONLY_PHP7, new Lexer());\n foreach ($finder as $file) {\n if (preg_match_all('/lg(\\(((?:[^()]*|(?-2))*)\\))/', $file->getContents(), $matches)) {\n foreach ($matches[0] as $caller) {\n $functionInfo = $parser->parse('<?php ' . $caller . ' ?>');\n $functionInfo = $functionInfo[0];\n $i = 0;\n $key = '';\n $value = '';\n foreach ($functionInfo->expr->args as $argument) {\n if ($argument->value->getType() === 'Scalar_String') {\n if (!$i) {\n $key = $argument->value->value;\n } else {\n $value = preg_replace('!\\s+!', ' ', $argument->value->value);\n }\n }\n $i++;\n }\n $translations[$key] = $value;\n }\n }\n }\n\n // Map translations.\n $mappedTranslations = [];\n foreach ($translations as $key => $text) {\n $data = compact('key');\n foreach (translate()->languages() as $language) {\n $data[$language->iso_code] = $text;\n }\n $mappedTranslations[] = $data;\n }\n\n // Add key, languages to header.\n $mappedTranslations = array_prepend($mappedTranslations, array_keys(array_first($mappedTranslations)));\n\n // Write translations to the file.\n $this->writeToFile($mappedTranslations);\n\n // Import to DB.\n if ($this->option('import')) {\n $this->call('translations:import');\n }\n\n cache()->forget('translations');\n }",
"public function getTranslationsById()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n if (!$trans->getId()) {\n continue;\n }\n $out[$trans->getId()] = $trans;\n }\n\n return$out;\n }",
"protected function importContents($filename, $locale, $bundlename,\n $domain = 'messages')\n {\n $em = $this->getContainer()->get('doctrine')->getManager();\n\n $translator_format = $this->getContainer()\n ->getParameter('translator_format');\n $loader = Loader::create($translator_format);\n $locale_file_contents = $loader->load($filename, $locale, $domain);\n $repository = $locale_file_contents->all();\n\n // Import all the messages for this domain into the document manager\n foreach ($repository[$domain] as $translation_key => $translation) {\n // Check if it's already in?\n $translation_entry = $em\n ->getRepository('WebTranslatorBundle:Translation')\n ->findOneBy(\n array('translation_key' => $translation_key,\n 'domain' => $domain,\n 'bundlename' => $bundlename));\n // Escape escaped double quotes (from our exportContents)\n $translation = str_replace('\\\"', '\"', $translation);\n if (!empty($translation_entry)) {\n $msgs = $translation_entry->getMessages();\n\n $message = $em\n ->getRepository('WebTranslatorBundle:Message')\n ->findOneBy(\n array('translation' => $translation_entry,\n 'locale' => $locale));\n if (null === $message) {\n $message = new Message();\n $message->setTranslation($translation_entry);\n $message->setLocale($locale);\n $message->setMessage($translation);\n\n $msgs->add($message);\n\n $translation_entry->setMessages($msgs);\n\n $em->persist($message);\n $em->persist($translation_entry);\n }\n\n } else {\n $entry = new Translation();\n $entry->setTranslationKey($translation_key);\n $entry->setDomain($domain);\n $entry->setBundlename($bundlename);\n\n $message = new Message();\n $message->setTranslation($entry);\n $message->setLocale($locale);\n $message->setMessage($translation);\n\n $em->persist($message);\n $em->persist($entry);\n }\n }\n\n $em->flush();\n }",
"function getAllTranslations()\n {\n $translations = [];\n $modules = $this->getAllModulesOfProject();\n sort($modules);\n\n foreach ($modules as $module)\n {\n $trans = $this->getTranslationsOfModule($module);\n if ($trans)\n {\n foreach ($trans as $value)\n {\n foreach ($value as $key => $val)\n {\n $langsAvailable = $this->getAvailableLangsOfKey($key);\n\n if (!isset($translations[$key]))\n {\n $translations[$key] = [\n 'key' => $key,\n 'value' => $val,\n 'module' => $module->name,\n 'locale' => implode(', ', $langsAvailable)\n ];\n }\n else\n {\n $isPrivateModulo = $this->modulesRegistry->isPrivateModule($module->name);\n if ($isPrivateModulo)\n {\n $translations[$key] = [\n 'key' => $key,\n 'value' => $val,\n 'module' => $module->name,\n 'locale' => implode(', ', $langsAvailable)\n ];\n }\n }\n }\n }\n }\n }\n return $translations;\n }",
"function getTrans($locale = true) {\n\t$dir = Storage::directories('config/translate');\n\t$return = null;\n\t$langs = [];\n\tforeach ($dir as $val) {\n\t\t$langs[substr($val, -2)] = Storage::allFiles('config/translate/'.substr($val, -2));\n\t}\n\n\tforeach ($langs as $lang_k => $lang) {\n\t\tforeach ($lang as $j => $value) {\n\t\t\t$key = 'config/translate/'.substr($lang_k, -2);\n\t\t\t$key = explode($key, $value)[1];\n\t\t\t$key = implode('.', explode('/', substr(substr($key, 0, -5), 1)));\n\n\t\t\t$data = trim(Storage::get($value));\n\t\t\t$data = json_decode($data, true);\n\t\t\t$data = array_dot($data);\n\n\t\t\t$langs[$lang_k][$key] = $data;\n\t\t\tunset($langs[$lang_k][$j]);\n\t\t}\n\t}\n\n\tif (!$locale) {\n\t\t$return = array_dot($langs);\n\t} else {\n\t\tif (is_bool($locale)) {\n\t\t\t$return = array_dot($langs[getLang()]);\n\t\t} else {\n\t\t\t$return = array_dot($langs[$locale]);\n\t\t}\n\t}\n\n\treturn json_encode(array_dot($return));\n}",
"public function getTranslation($key = '')\n {\n return self::$translations[$key];\n }",
"private function getTranslatedFields() {\n $langs = explode(',',$_REQUEST['translations']);\n\t\t$translations = array();\n\t\tforeach($langs as $lang){\t\t\n\t\t\t$translations[$lang] = array(\n\t\t\t\t'id' => (int) $_REQUEST['TranslationID'.$lang],\n\t\t\t\t'pagetitle' => $_REQUEST['pagetitle'.$lang],\n\t\t\t\t'longtitle' => $_REQUEST['longtitle'.$lang],\n\t\t\t\t'menutitle' => $_REQUEST['menutitle'.$lang],\n\t\t\t\t'introtext' => $_REQUEST['introtext'.$lang],\n\t\t\t\t'description' => $_REQUEST['description'.$lang],\n\t\t\t\t'content' => $_REQUEST['content'.$lang],\n\t\t\t);\n\t\t\tforeach($translations[$lang] as $key => $val){\n\t\t\t\tif($translations[$lang][$key] == null){\n\t\t\t\t $translations[$lang][$key] = '';\n\t\t\t\t};\n\t\t\t};\t\n\t\t};\n\t\treturn $translations;\t\t\n\t}",
"public function passo3() {\n $filename= 'f' . gmdate('YmdHis');\n foreach ($this->langarr as $k => $v):\n\n $path = ROOT.DS.'app'.DS.'locale'.DS.$v;\n if (!file_exists($path)) mkdir($path);\n \t$path .= DS.'LC_MESSAGES';\n if (!file_exists($path)) mkdir($path);\n \t$file = $path.DS.$filename;\n if (!file_exists($path)) touch($file);\n\n $file = new File($path.DS.$filename);\n $tmprec = $this->Traducao->find('all',array('conditions' => array('Traducao.locale' => $k)));\n foreach ($tmprec as $rec):\n $file->write('msgid \"' .$rec['Traducao']['msgid'] .'\"'.\"\\n\");\n $file->write('msgstr \"'.$rec['Traducao']['msgstr'].'\"'.\"\\n\");\n endforeach;\n $file->close();\n\n if (file_exists($path.DS.'default.po'))\n rename ($path.DS.'default.po',$path.DS.'default.po.old'.gmdate('YmdHis'));\n\t \n rename ($path.DS.$filename,$path.DS.'default.po');\n endforeach;\n }",
"private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }",
"public static function get_translate(){\n return self::$translate;\n }",
"function getLanguages($langList){\n\t$languages = array();\n\tforeach ($langList as $lang){\n\t\t$json=file_get_contents (\"FINAL/locales/translation-$lang.json\");\n\t\t//we want an associative array, thus second parameter is true\n\t\t$languages[$lang] = json_decode($json,true);\n\t\t//print_r($obj);\n\t}\n\treturn $languages;\n}",
"public function loadMainTrans()\n {\n $translationPath = $this->_getTransPath();\n require $translationPath.\"/main.php\";\n\n //Return a translation object\n $mainTranslate = new Phalcon\\Translate\\Adapter\\NativeArray(array(\n \"content\" => $messages\n ));\n\n //Set $mt as main translation object\n $this->view->setVar(\"mt\", $mainTranslate);\n }",
"function _load_languages()\r\n\t{\r\n\t\t// Load the form validation language file\r\n\t\t$this->lang->load('form_validation');\r\n\r\n\t\t// Load the DataMapper language file\r\n\t\t$this->lang->load('datamapper');\r\n\t}",
"public function getTemplatesFromDB();",
"protected function loadMessagesFromDb($category,$language)\n\t{\n\t\t$sql=<<<EOD\nSELECT t1.message AS message, t2.translation AS translation\nFROM {$this->sourceMessageTable} t1, {$this->translatedMessageTable} t2\nWHERE t1.id=t2.id AND t1.category=:category AND t2.language=:language\nEOD;\n\t\t$command=$this->getDbConnection()->createCommand($sql);\n\t\t$command->bindValue(':category',$category);\n\t\t$command->bindValue(':language',$language);\n\t\t$messages=array();\n\t\tforeach($command->queryAll() as $row)\n\t\t\t$messages[$row['message']]=$row['translation'];\n\n\t\treturn $messages;\n\t}",
"public static function get_files($name, $location, $translation)\n\t{\n\t\t$path = \\Laravel\\Bundle::path($location);\n\n\t\tif ( ! is_file($path.'language/'.$translation.'/'.$name.'.php'))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$language['from'] = require $path.'language/'.\\Laravel\\Config::get('language-builder::builder.base_lang').'/'.$name.'.php';\n\t\t$language['to'] = require $path.'language/'.$translation.'/'.$name.'.php';\n\n\t\treturn $language;\n\t}",
"public function translationManagement()\n {\n $langListFromDB = $this->service->getLanguageCodeList();\n $dataTransFromDB = $this->service->getTranslateList('', '');\n $langList = ($langListFromDB->status == SDBStatusCode::OK)?$langListFromDB->data:array();\n $dataTrans = ($dataTransFromDB->status == SDBStatusCode::OK)?$dataTransFromDB->data:array();\n $dataComboFilter = $this->service->getNewTransComboList();\n return view(\"dev/translation\", compact(['dataTrans', 'langList', 'dataComboFilter']));\n }",
"public function translationsAll()\n {\n return $this->hasMany($this->translatableModel, 'source_id');\n }",
"public function system_language_file_variables(){\n\t // Verify app level lang\n $my_files = $this->zajlib->file->get_files('app/lang/', true);\n foreach($my_files as $f){\n $file = str_ireplace('app/lang/', '', $this->zajlib->file->get_relative_path($f));\n $fdata = explode('.', $file);\n // Check for old data\n if(strlen($fdata[1]) < 5) $this->zajlib->test->notice(\"Found old language file format: \".$file);\n else{\n $file = trim($fdata[0], '/');\n $this->verify_single_language_file($file);\n }\n }\n\n\t\t// Get all of the plugins (local lang files are in _project plugin)\n\t\tforeach($this->zajlib->plugin->get_plugins('app') as $plugin){\n\t\t\t$my_files = $this->zajlib->file->get_files('plugins/'.$plugin.'/lang/', true);\n\t\t\tforeach($my_files as $f){\n\t\t\t\t$file = str_ireplace('plugins/'.$plugin.'/lang/', '', $this->zajlib->file->get_relative_path($f));\n\t\t\t\t$fdata = explode('.', $file);\n\t\t\t\t// Check for old data\n\t\t\t\tif(strlen($fdata[1]) < 5) $this->zajlib->test->notice(\"Found old language file format: \".$file);\n\t\t\t\telse{\n\t\t\t\t\t$file = trim($fdata[0], '/');\n\t\t\t\t\t$this->verify_single_language_file($file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Get all of the plugins (local lang files are in _project plugin)\n\t\tforeach($this->zajlib->plugin->get_plugins('system') as $plugin){\n\t\t\t$my_files = $this->zajlib->file->get_files('system/plugins/'.$plugin.'/lang/', true);\n\t\t\tforeach($my_files as $f){\n\t\t\t\t$file = str_ireplace('system/plugins/'.$plugin.'/lang/', '', $this->zajlib->file->get_relative_path($f));\n\t\t\t\t$fdata = explode('.', $file);\n\t\t\t\t// Check for old data\n\t\t\t\tif(strlen($fdata[1]) < 5) $this->zajlib->test->notice(\"Found old language file format: \".$file);\n\t\t\t\telse{\n\t\t\t\t\t$file = trim($fdata[0], '/');\n\t\t\t\t\t$this->verify_single_language_file($file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function testCanLoadLanguageFilesFromSpecifiedPath()\n {\n $this->translator->load();\n $messages = $this->translator->all();\n $this->assertArrayHasKey('test_message', $messages);\n }",
"abstract public function getTranslationIn(string $locale);"
]
| [
"0.8148177",
"0.7855648",
"0.7272375",
"0.71528506",
"0.69653505",
"0.68676955",
"0.6843297",
"0.6785391",
"0.66842604",
"0.6682659",
"0.665749",
"0.6593393",
"0.65636605",
"0.6546424",
"0.65306324",
"0.6529498",
"0.6522443",
"0.6503572",
"0.64689654",
"0.64660966",
"0.64558864",
"0.6455654",
"0.64477545",
"0.6437543",
"0.64181656",
"0.640535",
"0.63733655",
"0.6371195",
"0.63560444",
"0.63149",
"0.6300099",
"0.62961215",
"0.6278223",
"0.6248186",
"0.6235071",
"0.6225694",
"0.6225106",
"0.6202206",
"0.61992776",
"0.61984915",
"0.61606807",
"0.6152347",
"0.61504334",
"0.6132485",
"0.6114174",
"0.6101035",
"0.6101035",
"0.6095975",
"0.6089821",
"0.60617596",
"0.60614836",
"0.605349",
"0.60497975",
"0.6036632",
"0.5985101",
"0.59822685",
"0.597276",
"0.59650815",
"0.59608716",
"0.5951593",
"0.5951201",
"0.5937389",
"0.59371376",
"0.59311783",
"0.5920821",
"0.5919938",
"0.5898371",
"0.58952487",
"0.58948225",
"0.5871442",
"0.586754",
"0.5861372",
"0.58539623",
"0.5849722",
"0.58431435",
"0.5839796",
"0.5836092",
"0.5836065",
"0.58317125",
"0.5829474",
"0.58062",
"0.57997274",
"0.57891804",
"0.5785908",
"0.5784512",
"0.5779723",
"0.57769406",
"0.57705975",
"0.5768544",
"0.57542133",
"0.5751372",
"0.5736328",
"0.5721666",
"0.57189333",
"0.57035017",
"0.5700869",
"0.5699838",
"0.5695296",
"0.5693224",
"0.56923836"
]
| 0.69984734 | 4 |
Run the database seeds. | public function run()
{
$customers = [
[
'name' => 'Zimmo',
'active' => 1,
],
[
'name' => 'Monotote',
'active' => 1,
],
[
'name' => 'Pedal',
'active' => 1,
],
[
'name' => 'Phierator',
'active' => 1,
]
];
DB::table('customers')->insert($customers);
} | {
"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 |
constructor with $db as database connection | public function __construct($db){
$this->conn = $db;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct($db) {\n $this->db = $db;\n }",
"function __construct($db) {\r\n\t\t$this->db = $db;\r\n\t}",
"public function __construct($db) {\r\n\r\n $this->conn = $db;\r\n\r\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db) {\r\n $this->conn = $db;\r\n }",
"public function __construct($db)\r\n {\r\n $this->conn = $db;\r\n }",
"public function __construct($db) \n\t{\n\t\t$this->db = $db->getConn(); \n\t}",
"public function __construct($db) {\n $this->db = $db;\n }",
"public function __construct($db)\r\n {\r\n $this->conn = $db;\r\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->_db = $db;\n }",
"public function __construct(&$db) {\n $this->db = $db;\n }",
"public function __construct(&$db) {\n $this->db = $db;\n }",
"public function __construct(&$db) {\n $this->db = $db;\n }",
"public function __construct($db) {\n\t\t\t$this->conn = $db;\n\t\t}",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct($db)\n\t{\n\t\t$this->conn = $db;\n\t}",
"public function __construct($db) {\n\t\t$this->db = $db;\n\t}",
"public function __construct($db) {\n $this->_db = $db;\n }",
"public function __construct($db) {\n $this->_db = $db;\n }",
"public function __construct($db)\n {\n $this->db = $db;\n }",
"public function __construct($db)\n {\n $this->db = $db;\n }",
"public function __construct($db)\n {\n $this->db = $db;\n }",
"public function __construct($db)\r\n {\r\n $this->conn = $db;\r\n }",
"public function __construct($db)\n {\n $this->conn = $db;\n }",
"public function __construct(&$db)\r\n {\r\n $this->_db = $db;\r\n }",
"public function __construct($db){\r\n $this->db = $db;\r\n }",
"public function __construct($db=null)\n {\n $this->db = $db;\n }",
"public function __construct($db){\n\t\t$this->conn = $db;\n\t}",
"public function __construct($db){\n\t\t$this->conn = $db;\n\t}",
"public function __construct($db){\n\t\t$this->conn = $db;\n\t}",
"public function __construct($db){\n\t\t$this->conn = $db;\n\t}",
"function __construct($db) {\n\t\t\n\t\t// set db object to given db object\n\t\t$this->db = $db;\n\t\t\n\t}",
"public function __construct($db){\n $this->conn = $db;\n }",
"public function __construct($db){\n\t\t\t$this->conn = $db;\n\t\t}",
"public function __construct($db){\n\t\t\t$this->conn = $db;\n\t\t}",
"public function __construct($db){\n $this->conn = $db;\n \n }",
"public function __construct($db){\n $this->conn = $db;\n \t}",
"public function __construct($db){\n $this->conn = $db;\n \t}",
"public function __construct($db){\r\n \t$this->conn = $db;\r\n }",
"public function __construct($db) {\n\t\t\t$this->myDB = $db;\n\t\t}"
]
| [
"0.887094",
"0.8836854",
"0.8794315",
"0.8782656",
"0.8782656",
"0.87762517",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8766189",
"0.87605137",
"0.87567043",
"0.87561655",
"0.87505203",
"0.87446517",
"0.87446517",
"0.87446517",
"0.87418157",
"0.87323743",
"0.87323743",
"0.87323743",
"0.87268746",
"0.8717069",
"0.8717069",
"0.8717069",
"0.8711909",
"0.87075186",
"0.8702426",
"0.87023294",
"0.8700695",
"0.8700695",
"0.86997926",
"0.8695736",
"0.8695736",
"0.8693924",
"0.86638135",
"0.8661487",
"0.86138576",
"0.86036575",
"0.8598794",
"0.8598794",
"0.8598794",
"0.8598794",
"0.85930413",
"0.8577493",
"0.8576936",
"0.8576936",
"0.8568375",
"0.8566628",
"0.8566628",
"0.8555083",
"0.8549572"
]
| 0.0 | -1 |
query to insert record | function create(){
$query = "INSERT INTO
" . $this->table_name . "
SET
email=:email, subject=:subject, message=:message";
// prepare query
$stmt = $this->conn->prepare($query);
// sanitize
$this->name=htmlspecialchars(strip_tags($this->email));
$this->description=htmlspecialchars(strip_tags($this->subject));
$this->category_id=htmlspecialchars(strip_tags($this->message));
// bind values
$stmt->bindParam(":email", $this->email);
$stmt->bindParam(":subject", $this->subject);
$stmt->bindParam(":message", $this->message);
// execute query
if($stmt->execute()){
return true;
}else{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function recInsert($record) {\n $conn = Query::connect();\n $col = $conn->SelectLimit(\"select*from \".static::getTable(),1);\n $sql = $conn->GetInsertSQL($col,$record);\n $rs = $conn->Execute($sql);\n return $conn->ErrorNo();\n }",
"function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }",
"function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}",
"public function insert(){\n\n global $db;\n\n /** Insert sql query */\n $sql = \"INSERT INTO tbl_calculator (num1, num2, oper, answer)\n VALUES (\" . $this->num1 .\", \" . $this->num2 . \", '\" .$this->oper. \"', \" .$this->answer. \" )\";\n\n /** insert result maintain in log file */ \n error_log($sql);\n\n if ($db->query($sql) === TRUE) {\n error_log(\"New record created successfully\");\n } else {\n error_log(\"Error: \" . $sql . \"<br>\" . $db->error);\n }\n return;\n }",
"public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}",
"protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}",
"public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}",
"protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }",
"function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_person_detail (psd_ps_id, psd_dp_id, psd_tax_no, psd_id_card_no, psd_passport_no, psd_picture, psd_blood_id, psd_reli_id, psd_nation_id, psd_race_id, psd_psst_id, psd_birthdate, psd_birth_pv_id, psd_gd_id, psd_account_no, psd_ba_id, psd_facebook, psd_twitter, psd_website, psd_email, psd_cellphone, psd_phone, psd_ex_phone, psd_work_phone, psd_lodge_id, psd_lodge_no, psd_lodge_phone, psd_addcur_no, psd_addcur_pv_id, psd_addcur_amph_id, psd_addcur_dist_id, psd_addcur_zipcode, psd_addhome_no, psd_addhome_pv_id, psd_addhome_amph_id, psd_addhome_dist_id, psd_addhome_zipcode)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id, $this->psd_dp_id, $this->psd_tax_no, $this->psd_id_card_no, $this->psd_passport_no, $this->psd_picture, $this->psd_blood_id, $this->psd_reli_id, $this->psd_nation_id, $this->psd_race_id, $this->psd_psst_id, $this->psd_birthdate, $this->psd_birth_pv_id, $this->psd_gd_id, $this->psd_account_no, $this->psd_ba_id, $this->psd_facebook, $this->psd_twitter, $this->psd_website, $this->psd_email, $this->psd_cellphone, $this->psd_phone, $this->psd_ex_phone, $this->psd_work_phone, $this->psd_lodge_id, $this->psd_lodge_no, $this->psd_lodge_phone, $this->psd_addcur_no, $this->psd_addcur_pv_id, $this->psd_addcur_amph_id, $this->psd_addcur_dist_id, $this->psd_addcur_zipcode, $this->psd_addhome_no, $this->psd_addhome_pv_id, $this->psd_addhome_amph_id, $this->psd_addhome_dist_id, $this->psd_addhome_zipcode));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}",
"function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}",
"public function insert() {\n $query = \"INSERT INTO {$this->Table} SET \";\n if($this->Fields) {\n foreach ($this->Fields as $key => $item) {\n if($item['ignore'] != true && $this->$key != \"\" && $this->$key !== null) {\n if($first === false) $query .= \", \";\n $query .= $key.\" = '\".$this->escape($this->$key).\"'\";\n $first = false;\n }\n }\n }\n $result = $this->query($query);\n $this->clear();\n return $result;\n }",
"public function insertRecord ($sqlString);",
"function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}",
"abstract public function insertRecord($tableName, $record);",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }",
"public function insert(){\n $sql = \"INSERT INTO author(\n name,\n job,\n created_at\n )\n VALUES(\n 'tgedf', 'sdvsdv', NOW())\";\n return $this->pdo->exec($sql);\n\n }",
"public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}",
"protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }",
"public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }",
"public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }",
"public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }",
"abstract public function insert();",
"function insert(){\n\t\t\t$sql=\"INSERT INTO $this->table (surveyor_type,payment_purpose,payment_amount,division,record_hide,user_id) VALUES (:surveyorType,:paymentPurpose,:paymentAmount,:division,:recordHide,:userId)\";\n\t\t\t$stmt = $this->dbConn->prepare($sql);\n\t\t\t$stmt->bindParam(\":surveyorType\",$this->paymentSurveyor);\n\t\t\t$stmt->bindParam(\":paymentPurpose\",$this->paymentPurpose);\n\t\t\t$stmt->bindParam(\":paymentAmount\",$this->paymentAmount);\n\t\t\t$stmt->bindParam(\":division\",$_SESSION['division']);\n\t\t\t$stmt->bindParam(\":recordHide\",$this->recordHide);\n\t\t\t$stmt->bindParam(\":paymentAmount\",$this->paymentAmount);\n\t\t\t$stmt->bindParam(\":userId\",$this->userId);\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}",
"function insert ()\n\t\t{\n\t\t\t(string) $dbQuery = \"\";\n\t\t\t\n\t\t\t$dbQuery = \"INSERT INTO $this->criterio_table \";\n\t\t \t$dbQuery .= \"(\";\n\t\t \t\n\t\t\t$dbQuery .= $this->nombre_field.\",\";\n\t\t\t$dbQuery .= $this->descripcion_field.\",\";\n\t\t\t$dbQuery .= $this->puntajeMaximo_field.\",\";\n\t\t\t\n\t\t\t$dbQuery = preg_replace('/,$/', ' ', $dbQuery);\n\t\t\t$dbQuery .= \") \";\n\t\t\t$dbQuery .= \" VALUES (\";\n\t\t \t\n\t\t\t$dbQuery .= \" '$this->nombre',\";\n\t\t\t$dbQuery .= \" '$this->descripcion',\";\n\t\t\t$dbQuery .= \" $this->puntajeMaximo ,\";\n\t\t\t\n\t\t \t\n\t\t \t$dbQuery = preg_replace('/,$/', ' ', $dbQuery);\n\t\t \t$dbQuery .= \") \";\n\t\t \n\t\t \t$this->db->query( $dbQuery );\n\t\t\t\n\t\t\t$this->idcriterio = mysql_insert_id();\n\t\t\tif ($this->db->affected_rows() == 0) return false;\n\t\t\treturn true;\n\t\t}",
"function insert() {\n\t \n\t \t$sql = \"INSERT INTO evs_database.evs_group (gru_id, gru_name, gru_head_dept,gru_company_id)\n\t \tVALUES(?, ?, ?,?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->gru_id, $this->gru_name, $this->gru_head_dept ,$this->gru_company_id));\n\t }",
"public function insert($data);",
"protected function _insert()\n\t{\n\t}",
"public function insert($query) {\n $query = \"\n insert into `user`(`name`,`age`) values('a',20),('b',18),('c',19);\n \";\n $this->db->query($query);\n }",
"public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}",
"function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}",
"function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}",
"protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }",
"public function insertRecords(){\n // Get the sql statement\n $sql = $this->insertSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->paramsValues as $key=>$value) {\n $stmt->bindParam($this->params['columnNamePdo'][$key], $this->paramsValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }",
"public abstract function insert();",
"public function queryInsert($table, $data) : bool;",
"protected function _insert()\n\t{\n\t\t// INSERT INTO 'table'\n\t\t$this->_query = 'INSERT INTO '.$this->_table.' (';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$vals .= ($first) ? ('') : (', '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $key;\n\t\t\t$vals .= \"'$value'\";\n\t\t} // foreach\n\n\t\t$this->_query .= \") VALUES ($vals);\";\n\n\t\treturn $this->_query;\n\t}",
"public function insertRequestToDb()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$columns = \"\";\n\t\t\t$values = \"\";\n\t\t\twhile($rowColumn = $this->columnsInfo->fetch_assoc())//$info->fetch_row\n\t\t\t{\n\t\t\t\tif($rowColumn[\"EXTRA\"] == \"auto_increment\")\n\t\t\t\t\tcontinue;\n\t\t\t\t$columns = $columns.\", \".$rowColumn[\"COLUMN_NAME\"];\n\t\t\t\t$val = \"\";\n\t\t\t\tif($rowColumn[\"COLUMN_NAME\"] == \"sid_a\")\n\t\t\t\t\t$val = $_SESSION[\"sid\"];\n\t\t\t\telse if($rowColumn[\"COLUMN_NAME\"] == \"date_a\")\n\t\t\t\t\t$val = \"now()\";\n\t\t\t\telse $val = $this->insertColumnValue($_REQUEST[$rowColumn[\"COLUMN_NAME\"]], $rowColumn[\"IS_NULLABLE\"], $rowColumn[\"DATA_TYPE\"], $rowColumn[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t$values = \"$values, $val\";\n\t\t\t}\n\t\t\t$columns = substr($columns, 2, strlen($columns));\n\t\t\t$values = substr($values, 2, strlen($values));\n\n\t\t\t$query = \"INSERT INTO $this->table ($columns) values($values);\";\n\t\t\t$GLOBALS[\"db\"]->query($query);\n\t\t\t//$info->free();\n\t\t}",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"function insertQuery($sql)\n {\n\t\t\tif($this->rsQry = $this->parse($sql)) \n {\n\t\t\t\t$this->sql = $sql;\n\t\t\t\t\n\t\t\t\t$this->no_of_rows = $this->getNRows();\n\t\t $this->no_of_colums = $this->getNCols(); //Fetch no of rows affected....\n\t\t\t\t$this->close();\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n else\n { \n //echo \"Exit Part\";\n\t\t\t\treturn 0x00; \n\t\t\t}\n\t\t}",
"public function createRecord()\n {\n $sql = sprintf(\n \"INSERT INTO %s (%s) values (%s)\", \"Cubans\",\n implode(\", \", array_keys($this->arrayKeysValues())),\n \":\" . implode(\", :\", array_keys($this->arrayKeysValues()))\n );\n $statement = $this->connect->prepare($sql);\n\t\t$statement->execute($this->arrayKeysValues());\n }",
"public function insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }",
"public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }",
"public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}",
"public function insert() {\n \n }",
"function insert() {\n\t\t$sql = \"INSERT INTO umgroup (GpID, GpNameT, GpNameE, GpDesc, GpStID)\n\t\t\t\tVALUES(?, ?, ?, ?, ?)\";\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpID, $this->GpNameT, $this->GpNameE, $this->GpDesc, $this->GpStID));\n\t\t$this->last_insert_id = $this->ums->insert_id();\n\t\t$this->last_insert_GpNameT = $this->GpNameT;\n\t\t//echo $this->last_insert_GpNameT;\n\t}",
"public function insert($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"INSERT \";\n\t\t$p = $this->clean($params);\t\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']);\t\n\t\t$DB->exec($statement);\t\n\t}",
"private function _insert($data){\n \t\n \tif(isset($data['date_established'] )){\n \t\t$data['date_established'] = Application_Core_Utilities::ukDateToMysql($data['date_established']);\n \t}\n \t\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }",
"function insert(){\n\t\t\t$result = $this->consult();\n\t\t\tif(count($result) > 0){\n\t\t\t\t$this->form_data[\"id_paciente\"] = $result[0]->id_paciente;\n\t\t\t\t$this->id_paciente = $result[0]->id_paciente;\n\t\t\t\treturn $this->update();\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\t$this->db->trans_start();\n\t\t\t\t$this->db->insert('paciente', $this->form_data);\n\t\t\t\t$this->db->trans_complete();\n\t\t\t\treturn array(\"message\"=>\"ok\");\n\t\t\t} catch (Exception $e){\n\t\t\t\treturn array(\"message\"=>\"error\");\n\t\t\t}\n\t\t}",
"public static function insert()\n {\n }",
"public function insert() {\r\n // Rôle : insérer l'objet courant dans la base de données\r\n // Retour : true / false\r\n // Paramètre : aucun\r\n \r\n // Vérification de l'id\r\n if (!empty($this->getId())) {\r\n debug(get_class($this).\"->insert() : l'objet courant a déjà un id\");\r\n return false;\r\n }\r\n \r\n // Construction de la requête\r\n $sql = \"INSERT INTO `\".$this->getTable().\"` SET \";\r\n $param = [];\r\n $start = true;\r\n \r\n foreach ($this->getChamps() as $nom => $champs) {\r\n if ($nom === $this->getPrimaryKey() or !$champs->getAttribut(\"inBdd\")) {\r\n continue;\r\n }\r\n if ($start) {\r\n $sql .= \"`$nom` = :$nom\";\r\n $start = false;\r\n } else {\r\n $sql .= \", `$nom` = :$nom\";\r\n }\r\n \r\n $param[\":$nom\"] = $champs->getValue();\r\n }\r\n \r\n $sql .= \";\";\r\n \r\n // Préparation de la requête\r\n $req = self::getBdd()->prepare($sql);\r\n \r\n // Exécution de la requête\r\n if (!$req->execute($param)) {\r\n debug(get_class($this).\"->insert() : échec de la requête $sql\");\r\n return false;\r\n }\r\n \r\n // Assignation de l'id\r\n if ($req->rowCount() === 1) {\r\n $this->set($this->getPrimaryKey(), self::getBdd()->lastInsertId());\r\n return true;\r\n } else {\r\n debug(get_class($this).\"->insert() : aucune entrée, ou bien plus d'une entrée, créée\");\r\n return false;\r\n }\r\n }",
"function insert() {\n\t \t$sql = \"INSERT INTO evs_database.evs_key_component (kcp_key_component_detail_en, kcp_key_component_detail_th, kcp_cpn_id)\n\t \t\t\tVALUES(?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->kcp_key_component_detail_en, $this->kcp_key_component_detail_th, $this->kcp_cpn_id));\n\t\n\t }",
"function my_insert_record( $table_name , $datas ){\r\n \r\n\tglobal $connection;\r\n\r\n\t$build_query = \" INSERT INTO `\".$table_name .\"` SET \" ;\r\n\tforeach( $datas as $field => $value ){\r\n\t\r\n\t\t$build_query .= \"`\".$field .\"` = \". $value . \", \";\r\n\t\r\n\t}\r\n\t\r\n\t$insert_query = rtrim( trim($build_query) , \",\" ); \r\n \r\n\tif( my_query( $insert_query ) ){\r\n\t\treturn $connection->insert_id; \r\n\t}\r\n\treturn false;\r\n\r\n}",
"function insert ($conn , $table , $fields , $values) {\n\n\t\t$fields = implode(\",\", $fields) ;\n\t\t$values = implode(\"','\", $values) ;\n\n\t\t// insert querry\n\t\t$sql=\"INSERT INTO $table (id, $fields) VALUES ('', '$values')\" ;\n\t\t$result =mysql_query($sql ,$conn ) ;\n\n\n\t\tif (mysql_affected_rows()>0) {\n\t\t\treturn TRUE ;\n\n\t\t}\n\n\t\telse {\n\t\t\tdie(\"Error : \".mysql_error()) ;\n\t\t}\n\t}",
"public function insert(...$field_values);",
"public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }",
"protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}",
"private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }",
"public function insert()\n {\n }",
"public function insert()\n {\n }",
"public function Do_insert_Example1(){\n\n\t}",
"public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }",
"public final function insert()\n {\n // Run beforeCreate event methods and stop when one of them return bool false\n if ($this->runBefore('create') === false)\n return false;\n\n // Create tablename\n $tbl = '{db_prefix}' . $this->tbl;\n\n // Prepare query and content arrays\n $fields = array();\n $values = array();\n $keys = array();\n\n // Build insert fields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n // Regardless of all further actions, check and cleanup the value\n $val = $this->checkFieldvalue($fld, $val);\n\n // Put fieldname and the fieldtype to the fields array\n $fields[$fld] = $this->getFieldtype($fld);\n\n // Object or array values are stored serialized to db\n $values[] = is_array($val) || is_object($val) ? serialize($val) : $val;\n }\n\n // Add name of primary key field\n $keys[0] = $this->pk;\n\n // Run query and store insert id as pk value\n $this->data->{$this->pk} = $this->db->insert('insert', $tbl, $fields, $values, $keys);\n\n return $this->data->{$this->pk};\n }",
"public function insert($conn, $data){\n\t\t$sql_fields=\"\";\n\t\t$sql_vals=\"\";\n\t\t$id_included=false;\n\t\t\n\t\tforeach($data as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif (!$id_included && $field_info[\"id\"]){\n\t\t\t\t$id_included=true;\n\t\t\t}\n\t\t\t\n\t\t\tif ($sql_fields!=\"\"){\n\t\t\t\t$sql_fields = $sql_fields . \", \";\n\t\t\t}\n\t\t\t$sql_fields = $sql_fields . \"`\" . $field . \"`\";\n\t\t\t\n\t\t\tif ($sql_vals!=\"\"){\n\t\t\t\t$sql_vals = $sql_vals . \", \";\n\t\t\t}\n\t\t\t\n\t\t\t$sql_vals = $sql_vals . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t}\n\t\t\n\t\t$sql=\"INSERT INTO `\" . $this->table_name . \"` (\" . $sql_fields . \") VALUES (\" . $sql_vals . \")\";\n\t\t\n\t\t$res=$conn->exec($sql);\n\t\tif ($res===FALSE){ \n\t\t\treturn $res;\n\t\t}\n\t\tif (!$id_included && $this->id!=\"\"){\n\t\t\tif ($this->fields[$this->id][\"auto\"]){\n\t\t\t\treturn $conn->lastInsertId();\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}",
"function QueryInsert($table, $data) {\r\n $q = \"INSERT INTO `\" . $this->pre . $table . \"` \";\r\n $v = '';\r\n $n = '';\r\n\r\n foreach ($data as $key => $val) {\r\n $n.=\"`$key`, \";\r\n if (strtolower($val) == 'null')\r\n $v.=\"NULL, \";\r\n elseif (strtolower($val) == 'now()')\r\n $v.=\"NOW(), \";\r\n elseif (strtolower($val) == 'unix_timestamp()')\r\n $v.=\"UNIX_TIMESTAMP(), \";\r\n else\r\n $v.= \"'\" . $this->escape($val) . \"', \";\r\n }\r\n\r\n $q .= \"(\" . rtrim($n, ', ') . \") VALUES (\" . rtrim($v, ', ') . \");\";\r\n\r\n //echoLine( $q );\r\n\r\n if ($this->query($q)) {\r\n //$this->free_result();\r\n return mysql_insert_id($this->link_id); //this can't be done on non autoincremented tables;\r\n }\r\n else\r\n return false;\r\n }",
"function insert($query, $param_type, $param_value_array) {\n $sql = $this->connection->prepare($query);\n $this->bindQueryParams($sql, $param_type, $param_value_array);\n $sql->execute();\n $insertId = $sql->insert_id;\n return $insertId;\n }",
"public function insert($loyPrg);",
"public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\t\r\n\t\t\tif (isset ( $this->title )) {\r\n\t\t\t\t$insertCols .= \"dsh_title, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->title;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->desc )) {\r\n\t\t\t\t$insertCols .= \"dsh_desc, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->desc;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->portlet )) {\r\n\t\t\t\t$insertCols .= \"dsh_portlet, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->portlet;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->hide )) {\r\n\t\t\t\t$insertCols .= \"dsh_hide, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->hide;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdDate;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedDate;\r\n\t\t\t}\r\n\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the auto-increment property, only if the primary column is auto-increment\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }",
"public function insertRow($row);",
"protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }",
"public function insert(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->INSERT,$parametro);\n//\t\t\tdie();\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_INSERT\",$this->INSERT);\n\t\t}\n\t\treturn $resultado;\n\t}",
"public abstract function Insert();",
"public function insert()\n {\n \n }",
"public function insert()\n {\n $this->id = insert($this);\n }",
"protected function saveInsert()\n {\n }",
"public function insertSql()\n {\n $sql = \"INSERT INTO \" . $this->dbName . '.' . $this->table\n . \" (\" . implode($this->fields, \", \") . \")\n VALUES (:\" . implode($this->fields, \", :\") . \");\";\n\n $this->query = $sql;\n }",
"public static function Insert(){\r\n }",
"public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }",
"function insert($conn,$table,$data)\n {\n }",
"public function insert($sql){\n\t $query = DB::query(Database::INSERT, $sql);\n\t return $query->execute($this->database);\n\t}",
"public function insert($table);",
"public function insert( )\n {\n $sql_insert_string = $this->formatInsertCommand( );\n if ( $sql_insert_string == false )\n return false;\n\n $l_result = $this->query( $sql_insert_string );\n $this->clearDataBuffer( );\n if($l_result)\n return @mysql_insert_id(underQL::$db_handle);\n\n return false;\n }",
"public function insert($connection, $table, $rows);",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"public function insert(array $params);",
"public function insert($query){\n\t\t$bool = $this->update($query);\n\t\treturn $bool;\n\t}",
"public function insert()\n {\n # code...\n }",
"function insert($tbl,$cols) {\n $sql = $this->build_sql_insert($tbl, $cols);\n try{\n $this->execute($sql);\n }catch(Exception $e){\n if($this->errno==1062){ // Duplicate Record\n return false;\n }\n throw $e;\n }\n return $this->last_id();\n }",
"public function insertstudents ($student_number , $age ,$id_nationality ){\n $sqlQuery = \" INSERT INTO students (student_number , age , id_nationality ) \";\n $sqlQuery .= \" VALUES ( $student_number , $age , $id_nationality)\";\n $result = $this -> getDbManager () -> executeInsertQuery ( $sqlQuery );\n return $result ;\n }",
"public function insertRow($query,$params=[]){\r\n\t\t\ttry {\r\n\t\t\t\t$dbquery=$this->db->prepare($query);\r\n\t\t\t\t$dbquery->execute($params);\r\n\t\t\t\treturn true;\r\n\t\t\t} catch (PDOException $e) {\r\n\t\t\tthrow new Exception($e->getMessage());\r\n\t\t\t}\r\n\t\t}",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->last_query();\n\t \t // $this->db->insert_id();\n\t}",
"function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }",
"function Insert(){\r\n $query = \"INSERT INTO userschedules\r\n (userName,organizationId,branchId,locationCode,date,startingTime,signedIn,finishingTime,signedOut,status)\r\n VALUES('$this->userName',$this->organizationId,$this->branchId,'$this->locationCode','$this->date',\r\n '$this->startingTime','$this->signedIn','$this->finishingTime','$this->signedOut','$this->status')\";\r\n include(\"includes/dbConnection.php\");\t\t\t\r\n $executeQuery = $db->prepare($query);\r\n $executeQuery->execute() or exit(\"Error: INSERT query failed.\");\r\n }",
"public function _insertar($objeto) {\n\t\t$this->db->setTable_name( $this->table_name );\t\t\n\t\t$this->db->setIs_query(false);\n\t\t\n\t\t$query = $this->_create_query_insertar( $objeto );\n\t\t// echo \"<br> $query <br>\\n\";\n\t\t\n\t\tif ( $this->db->getDriver() == amaguk_database_connection::DB_DRIVER_POSTGRESL ){\n\t\t\t$this->db->setField_key_name( $this->fields[0] );\n\t\t\t\n\t\t\t$this->db->insert_query( $query );\n\t\t}else{\n\t\t\t$this->db->query( $query );\n\t\t}\t\t\n\t\t\n\t\t$this->where=\"\";\n\t\t//print $query;\n\t\t$this->clearCondition();\n\t\t\n\t}",
"public function insert() {\n\t\t$this->insert_user();\n\t}",
"public function insert(Table $table, $row);",
"public function insert($medAccount);",
"public function insert()\n\t{\n\t\t$sql_array = array();\n\t\tforeach ($this->object_config as $name => $null)\n\t\t{\n\t\t\t$sql_array[$name] = $this->validate_property($this->$name, $this->object_config[$name]);\n\t\t}\n\n\t\t$sql = 'INSERT INTO ' . $this->sql_table . ' ' . $this->db->sql_build_array('INSERT', $sql_array);\n\t\t$this->db->sql_query($sql);\n\n\t\tif ($id = $this->db->sql_nextid())\n\t\t{\n\t\t\t$this->{$this->sql_id_field} = $id;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function yy_r102(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -2]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0])->fields($this->yystack[$this->yyidx + 0]->minor[1]);\n }"
]
| [
"0.72295344",
"0.72084016",
"0.71116924",
"0.7097333",
"0.7095761",
"0.70293355",
"0.7025007",
"0.70184445",
"0.6986873",
"0.6985234",
"0.6981424",
"0.6967289",
"0.6956188",
"0.692987",
"0.692174",
"0.6879948",
"0.6872559",
"0.6853117",
"0.6840738",
"0.68396926",
"0.6838916",
"0.6833698",
"0.6813434",
"0.6809066",
"0.679378",
"0.67790437",
"0.6776827",
"0.67726576",
"0.676945",
"0.67489016",
"0.6745832",
"0.6742941",
"0.6740376",
"0.67253816",
"0.6720163",
"0.6712797",
"0.6708044",
"0.67049605",
"0.67049605",
"0.6696627",
"0.6675146",
"0.6672891",
"0.66667306",
"0.66470844",
"0.6645872",
"0.6638501",
"0.66374195",
"0.66317946",
"0.6624304",
"0.6609722",
"0.66032124",
"0.65968996",
"0.6596174",
"0.6590943",
"0.65895766",
"0.6584867",
"0.6581956",
"0.6575555",
"0.65694714",
"0.65694714",
"0.65674686",
"0.6566529",
"0.6566041",
"0.65614796",
"0.65534216",
"0.6550613",
"0.65453655",
"0.6538395",
"0.6535756",
"0.6534244",
"0.6532319",
"0.6525331",
"0.65184504",
"0.6512463",
"0.65120643",
"0.65109897",
"0.65078104",
"0.64942783",
"0.6494211",
"0.6492921",
"0.64824915",
"0.6468301",
"0.6466037",
"0.64626706",
"0.64399344",
"0.6439338",
"0.64369243",
"0.6419647",
"0.64194727",
"0.6419273",
"0.64171857",
"0.6410973",
"0.64080715",
"0.6398188",
"0.6393234",
"0.6385376",
"0.6375556",
"0.6371905",
"0.6370515",
"0.636572",
"0.63657147"
]
| 0.0 | -1 |
query to insert record | function update(){
$query = "UPDATE
" . $this->table_name . "
SET
email=:email, subject=:subject, message=:message
WHERE
id = :id";
// prepare query
$stmt = $this->conn->prepare($query);
// sanitize
$this->id=htmlspecialchars(strip_tags($this->id));
$this->name=htmlspecialchars(strip_tags($this->email));
$this->description=htmlspecialchars(strip_tags($this->subject));
$this->category_id=htmlspecialchars(strip_tags($this->message));
// bind values
$stmt->bindParam(":id", $this->id);
$stmt->bindParam(":email", $this->email);
$stmt->bindParam(":subject", $this->subject);
$stmt->bindParam(":message", $this->message);
// execute query
if($stmt->execute()){
return true;
}else{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function recInsert($record) {\n $conn = Query::connect();\n $col = $conn->SelectLimit(\"select*from \".static::getTable(),1);\n $sql = $conn->GetInsertSQL($col,$record);\n $rs = $conn->Execute($sql);\n return $conn->ErrorNo();\n }",
"function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }",
"function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}",
"public function insert(){\n\n global $db;\n\n /** Insert sql query */\n $sql = \"INSERT INTO tbl_calculator (num1, num2, oper, answer)\n VALUES (\" . $this->num1 .\", \" . $this->num2 . \", '\" .$this->oper. \"', \" .$this->answer. \" )\";\n\n /** insert result maintain in log file */ \n error_log($sql);\n\n if ($db->query($sql) === TRUE) {\n error_log(\"New record created successfully\");\n } else {\n error_log(\"Error: \" . $sql . \"<br>\" . $db->error);\n }\n return;\n }",
"public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}",
"protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}",
"public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}",
"protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }",
"function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_person_detail (psd_ps_id, psd_dp_id, psd_tax_no, psd_id_card_no, psd_passport_no, psd_picture, psd_blood_id, psd_reli_id, psd_nation_id, psd_race_id, psd_psst_id, psd_birthdate, psd_birth_pv_id, psd_gd_id, psd_account_no, psd_ba_id, psd_facebook, psd_twitter, psd_website, psd_email, psd_cellphone, psd_phone, psd_ex_phone, psd_work_phone, psd_lodge_id, psd_lodge_no, psd_lodge_phone, psd_addcur_no, psd_addcur_pv_id, psd_addcur_amph_id, psd_addcur_dist_id, psd_addcur_zipcode, psd_addhome_no, psd_addhome_pv_id, psd_addhome_amph_id, psd_addhome_dist_id, psd_addhome_zipcode)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id, $this->psd_dp_id, $this->psd_tax_no, $this->psd_id_card_no, $this->psd_passport_no, $this->psd_picture, $this->psd_blood_id, $this->psd_reli_id, $this->psd_nation_id, $this->psd_race_id, $this->psd_psst_id, $this->psd_birthdate, $this->psd_birth_pv_id, $this->psd_gd_id, $this->psd_account_no, $this->psd_ba_id, $this->psd_facebook, $this->psd_twitter, $this->psd_website, $this->psd_email, $this->psd_cellphone, $this->psd_phone, $this->psd_ex_phone, $this->psd_work_phone, $this->psd_lodge_id, $this->psd_lodge_no, $this->psd_lodge_phone, $this->psd_addcur_no, $this->psd_addcur_pv_id, $this->psd_addcur_amph_id, $this->psd_addcur_dist_id, $this->psd_addcur_zipcode, $this->psd_addhome_no, $this->psd_addhome_pv_id, $this->psd_addhome_amph_id, $this->psd_addhome_dist_id, $this->psd_addhome_zipcode));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}",
"function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}",
"public function insert() {\n $query = \"INSERT INTO {$this->Table} SET \";\n if($this->Fields) {\n foreach ($this->Fields as $key => $item) {\n if($item['ignore'] != true && $this->$key != \"\" && $this->$key !== null) {\n if($first === false) $query .= \", \";\n $query .= $key.\" = '\".$this->escape($this->$key).\"'\";\n $first = false;\n }\n }\n }\n $result = $this->query($query);\n $this->clear();\n return $result;\n }",
"public function insertRecord ($sqlString);",
"function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}",
"abstract public function insertRecord($tableName, $record);",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }",
"public function insert(){\n $sql = \"INSERT INTO author(\n name,\n job,\n created_at\n )\n VALUES(\n 'tgedf', 'sdvsdv', NOW())\";\n return $this->pdo->exec($sql);\n\n }",
"public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}",
"protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }",
"public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }",
"public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }",
"public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }",
"abstract public function insert();",
"function insert(){\n\t\t\t$sql=\"INSERT INTO $this->table (surveyor_type,payment_purpose,payment_amount,division,record_hide,user_id) VALUES (:surveyorType,:paymentPurpose,:paymentAmount,:division,:recordHide,:userId)\";\n\t\t\t$stmt = $this->dbConn->prepare($sql);\n\t\t\t$stmt->bindParam(\":surveyorType\",$this->paymentSurveyor);\n\t\t\t$stmt->bindParam(\":paymentPurpose\",$this->paymentPurpose);\n\t\t\t$stmt->bindParam(\":paymentAmount\",$this->paymentAmount);\n\t\t\t$stmt->bindParam(\":division\",$_SESSION['division']);\n\t\t\t$stmt->bindParam(\":recordHide\",$this->recordHide);\n\t\t\t$stmt->bindParam(\":paymentAmount\",$this->paymentAmount);\n\t\t\t$stmt->bindParam(\":userId\",$this->userId);\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}",
"function insert ()\n\t\t{\n\t\t\t(string) $dbQuery = \"\";\n\t\t\t\n\t\t\t$dbQuery = \"INSERT INTO $this->criterio_table \";\n\t\t \t$dbQuery .= \"(\";\n\t\t \t\n\t\t\t$dbQuery .= $this->nombre_field.\",\";\n\t\t\t$dbQuery .= $this->descripcion_field.\",\";\n\t\t\t$dbQuery .= $this->puntajeMaximo_field.\",\";\n\t\t\t\n\t\t\t$dbQuery = preg_replace('/,$/', ' ', $dbQuery);\n\t\t\t$dbQuery .= \") \";\n\t\t\t$dbQuery .= \" VALUES (\";\n\t\t \t\n\t\t\t$dbQuery .= \" '$this->nombre',\";\n\t\t\t$dbQuery .= \" '$this->descripcion',\";\n\t\t\t$dbQuery .= \" $this->puntajeMaximo ,\";\n\t\t\t\n\t\t \t\n\t\t \t$dbQuery = preg_replace('/,$/', ' ', $dbQuery);\n\t\t \t$dbQuery .= \") \";\n\t\t \n\t\t \t$this->db->query( $dbQuery );\n\t\t\t\n\t\t\t$this->idcriterio = mysql_insert_id();\n\t\t\tif ($this->db->affected_rows() == 0) return false;\n\t\t\treturn true;\n\t\t}",
"function insert() {\n\t \n\t \t$sql = \"INSERT INTO evs_database.evs_group (gru_id, gru_name, gru_head_dept,gru_company_id)\n\t \tVALUES(?, ?, ?,?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->gru_id, $this->gru_name, $this->gru_head_dept ,$this->gru_company_id));\n\t }",
"public function insert($data);",
"protected function _insert()\n\t{\n\t}",
"public function insert($query) {\n $query = \"\n insert into `user`(`name`,`age`) values('a',20),('b',18),('c',19);\n \";\n $this->db->query($query);\n }",
"public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}",
"function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}",
"function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}",
"protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }",
"public function insertRecords(){\n // Get the sql statement\n $sql = $this->insertSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->paramsValues as $key=>$value) {\n $stmt->bindParam($this->params['columnNamePdo'][$key], $this->paramsValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }",
"public abstract function insert();",
"public function queryInsert($table, $data) : bool;",
"protected function _insert()\n\t{\n\t\t// INSERT INTO 'table'\n\t\t$this->_query = 'INSERT INTO '.$this->_table.' (';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$vals .= ($first) ? ('') : (', '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $key;\n\t\t\t$vals .= \"'$value'\";\n\t\t} // foreach\n\n\t\t$this->_query .= \") VALUES ($vals);\";\n\n\t\treturn $this->_query;\n\t}",
"public function insertRequestToDb()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$columns = \"\";\n\t\t\t$values = \"\";\n\t\t\twhile($rowColumn = $this->columnsInfo->fetch_assoc())//$info->fetch_row\n\t\t\t{\n\t\t\t\tif($rowColumn[\"EXTRA\"] == \"auto_increment\")\n\t\t\t\t\tcontinue;\n\t\t\t\t$columns = $columns.\", \".$rowColumn[\"COLUMN_NAME\"];\n\t\t\t\t$val = \"\";\n\t\t\t\tif($rowColumn[\"COLUMN_NAME\"] == \"sid_a\")\n\t\t\t\t\t$val = $_SESSION[\"sid\"];\n\t\t\t\telse if($rowColumn[\"COLUMN_NAME\"] == \"date_a\")\n\t\t\t\t\t$val = \"now()\";\n\t\t\t\telse $val = $this->insertColumnValue($_REQUEST[$rowColumn[\"COLUMN_NAME\"]], $rowColumn[\"IS_NULLABLE\"], $rowColumn[\"DATA_TYPE\"], $rowColumn[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t$values = \"$values, $val\";\n\t\t\t}\n\t\t\t$columns = substr($columns, 2, strlen($columns));\n\t\t\t$values = substr($values, 2, strlen($values));\n\n\t\t\t$query = \"INSERT INTO $this->table ($columns) values($values);\";\n\t\t\t$GLOBALS[\"db\"]->query($query);\n\t\t\t//$info->free();\n\t\t}",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"function insertQuery($sql)\n {\n\t\t\tif($this->rsQry = $this->parse($sql)) \n {\n\t\t\t\t$this->sql = $sql;\n\t\t\t\t\n\t\t\t\t$this->no_of_rows = $this->getNRows();\n\t\t $this->no_of_colums = $this->getNCols(); //Fetch no of rows affected....\n\t\t\t\t$this->close();\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n else\n { \n //echo \"Exit Part\";\n\t\t\t\treturn 0x00; \n\t\t\t}\n\t\t}",
"public function createRecord()\n {\n $sql = sprintf(\n \"INSERT INTO %s (%s) values (%s)\", \"Cubans\",\n implode(\", \", array_keys($this->arrayKeysValues())),\n \":\" . implode(\", :\", array_keys($this->arrayKeysValues()))\n );\n $statement = $this->connect->prepare($sql);\n\t\t$statement->execute($this->arrayKeysValues());\n }",
"public function insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }",
"public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }",
"public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}",
"public function insert() {\n \n }",
"function insert() {\n\t\t$sql = \"INSERT INTO umgroup (GpID, GpNameT, GpNameE, GpDesc, GpStID)\n\t\t\t\tVALUES(?, ?, ?, ?, ?)\";\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpID, $this->GpNameT, $this->GpNameE, $this->GpDesc, $this->GpStID));\n\t\t$this->last_insert_id = $this->ums->insert_id();\n\t\t$this->last_insert_GpNameT = $this->GpNameT;\n\t\t//echo $this->last_insert_GpNameT;\n\t}",
"public function insert($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"INSERT \";\n\t\t$p = $this->clean($params);\t\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']);\t\n\t\t$DB->exec($statement);\t\n\t}",
"private function _insert($data){\n \t\n \tif(isset($data['date_established'] )){\n \t\t$data['date_established'] = Application_Core_Utilities::ukDateToMysql($data['date_established']);\n \t}\n \t\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }",
"function insert(){\n\t\t\t$result = $this->consult();\n\t\t\tif(count($result) > 0){\n\t\t\t\t$this->form_data[\"id_paciente\"] = $result[0]->id_paciente;\n\t\t\t\t$this->id_paciente = $result[0]->id_paciente;\n\t\t\t\treturn $this->update();\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\t$this->db->trans_start();\n\t\t\t\t$this->db->insert('paciente', $this->form_data);\n\t\t\t\t$this->db->trans_complete();\n\t\t\t\treturn array(\"message\"=>\"ok\");\n\t\t\t} catch (Exception $e){\n\t\t\t\treturn array(\"message\"=>\"error\");\n\t\t\t}\n\t\t}",
"public static function insert()\n {\n }",
"public function insert() {\r\n // Rôle : insérer l'objet courant dans la base de données\r\n // Retour : true / false\r\n // Paramètre : aucun\r\n \r\n // Vérification de l'id\r\n if (!empty($this->getId())) {\r\n debug(get_class($this).\"->insert() : l'objet courant a déjà un id\");\r\n return false;\r\n }\r\n \r\n // Construction de la requête\r\n $sql = \"INSERT INTO `\".$this->getTable().\"` SET \";\r\n $param = [];\r\n $start = true;\r\n \r\n foreach ($this->getChamps() as $nom => $champs) {\r\n if ($nom === $this->getPrimaryKey() or !$champs->getAttribut(\"inBdd\")) {\r\n continue;\r\n }\r\n if ($start) {\r\n $sql .= \"`$nom` = :$nom\";\r\n $start = false;\r\n } else {\r\n $sql .= \", `$nom` = :$nom\";\r\n }\r\n \r\n $param[\":$nom\"] = $champs->getValue();\r\n }\r\n \r\n $sql .= \";\";\r\n \r\n // Préparation de la requête\r\n $req = self::getBdd()->prepare($sql);\r\n \r\n // Exécution de la requête\r\n if (!$req->execute($param)) {\r\n debug(get_class($this).\"->insert() : échec de la requête $sql\");\r\n return false;\r\n }\r\n \r\n // Assignation de l'id\r\n if ($req->rowCount() === 1) {\r\n $this->set($this->getPrimaryKey(), self::getBdd()->lastInsertId());\r\n return true;\r\n } else {\r\n debug(get_class($this).\"->insert() : aucune entrée, ou bien plus d'une entrée, créée\");\r\n return false;\r\n }\r\n }",
"function insert() {\n\t \t$sql = \"INSERT INTO evs_database.evs_key_component (kcp_key_component_detail_en, kcp_key_component_detail_th, kcp_cpn_id)\n\t \t\t\tVALUES(?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->kcp_key_component_detail_en, $this->kcp_key_component_detail_th, $this->kcp_cpn_id));\n\t\n\t }",
"function my_insert_record( $table_name , $datas ){\r\n \r\n\tglobal $connection;\r\n\r\n\t$build_query = \" INSERT INTO `\".$table_name .\"` SET \" ;\r\n\tforeach( $datas as $field => $value ){\r\n\t\r\n\t\t$build_query .= \"`\".$field .\"` = \". $value . \", \";\r\n\t\r\n\t}\r\n\t\r\n\t$insert_query = rtrim( trim($build_query) , \",\" ); \r\n \r\n\tif( my_query( $insert_query ) ){\r\n\t\treturn $connection->insert_id; \r\n\t}\r\n\treturn false;\r\n\r\n}",
"function insert ($conn , $table , $fields , $values) {\n\n\t\t$fields = implode(\",\", $fields) ;\n\t\t$values = implode(\"','\", $values) ;\n\n\t\t// insert querry\n\t\t$sql=\"INSERT INTO $table (id, $fields) VALUES ('', '$values')\" ;\n\t\t$result =mysql_query($sql ,$conn ) ;\n\n\n\t\tif (mysql_affected_rows()>0) {\n\t\t\treturn TRUE ;\n\n\t\t}\n\n\t\telse {\n\t\t\tdie(\"Error : \".mysql_error()) ;\n\t\t}\n\t}",
"public function insert(...$field_values);",
"public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }",
"protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}",
"private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }",
"public function insert()\n {\n }",
"public function insert()\n {\n }",
"public function Do_insert_Example1(){\n\n\t}",
"public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }",
"public final function insert()\n {\n // Run beforeCreate event methods and stop when one of them return bool false\n if ($this->runBefore('create') === false)\n return false;\n\n // Create tablename\n $tbl = '{db_prefix}' . $this->tbl;\n\n // Prepare query and content arrays\n $fields = array();\n $values = array();\n $keys = array();\n\n // Build insert fields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n // Regardless of all further actions, check and cleanup the value\n $val = $this->checkFieldvalue($fld, $val);\n\n // Put fieldname and the fieldtype to the fields array\n $fields[$fld] = $this->getFieldtype($fld);\n\n // Object or array values are stored serialized to db\n $values[] = is_array($val) || is_object($val) ? serialize($val) : $val;\n }\n\n // Add name of primary key field\n $keys[0] = $this->pk;\n\n // Run query and store insert id as pk value\n $this->data->{$this->pk} = $this->db->insert('insert', $tbl, $fields, $values, $keys);\n\n return $this->data->{$this->pk};\n }",
"public function insert($conn, $data){\n\t\t$sql_fields=\"\";\n\t\t$sql_vals=\"\";\n\t\t$id_included=false;\n\t\t\n\t\tforeach($data as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif (!$id_included && $field_info[\"id\"]){\n\t\t\t\t$id_included=true;\n\t\t\t}\n\t\t\t\n\t\t\tif ($sql_fields!=\"\"){\n\t\t\t\t$sql_fields = $sql_fields . \", \";\n\t\t\t}\n\t\t\t$sql_fields = $sql_fields . \"`\" . $field . \"`\";\n\t\t\t\n\t\t\tif ($sql_vals!=\"\"){\n\t\t\t\t$sql_vals = $sql_vals . \", \";\n\t\t\t}\n\t\t\t\n\t\t\t$sql_vals = $sql_vals . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t}\n\t\t\n\t\t$sql=\"INSERT INTO `\" . $this->table_name . \"` (\" . $sql_fields . \") VALUES (\" . $sql_vals . \")\";\n\t\t\n\t\t$res=$conn->exec($sql);\n\t\tif ($res===FALSE){ \n\t\t\treturn $res;\n\t\t}\n\t\tif (!$id_included && $this->id!=\"\"){\n\t\t\tif ($this->fields[$this->id][\"auto\"]){\n\t\t\t\treturn $conn->lastInsertId();\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}",
"function QueryInsert($table, $data) {\r\n $q = \"INSERT INTO `\" . $this->pre . $table . \"` \";\r\n $v = '';\r\n $n = '';\r\n\r\n foreach ($data as $key => $val) {\r\n $n.=\"`$key`, \";\r\n if (strtolower($val) == 'null')\r\n $v.=\"NULL, \";\r\n elseif (strtolower($val) == 'now()')\r\n $v.=\"NOW(), \";\r\n elseif (strtolower($val) == 'unix_timestamp()')\r\n $v.=\"UNIX_TIMESTAMP(), \";\r\n else\r\n $v.= \"'\" . $this->escape($val) . \"', \";\r\n }\r\n\r\n $q .= \"(\" . rtrim($n, ', ') . \") VALUES (\" . rtrim($v, ', ') . \");\";\r\n\r\n //echoLine( $q );\r\n\r\n if ($this->query($q)) {\r\n //$this->free_result();\r\n return mysql_insert_id($this->link_id); //this can't be done on non autoincremented tables;\r\n }\r\n else\r\n return false;\r\n }",
"function insert($query, $param_type, $param_value_array) {\n $sql = $this->connection->prepare($query);\n $this->bindQueryParams($sql, $param_type, $param_value_array);\n $sql->execute();\n $insertId = $sql->insert_id;\n return $insertId;\n }",
"public function insert($loyPrg);",
"public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\t\r\n\t\t\tif (isset ( $this->title )) {\r\n\t\t\t\t$insertCols .= \"dsh_title, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->title;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->desc )) {\r\n\t\t\t\t$insertCols .= \"dsh_desc, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->desc;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->portlet )) {\r\n\t\t\t\t$insertCols .= \"dsh_portlet, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->portlet;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->hide )) {\r\n\t\t\t\t$insertCols .= \"dsh_hide, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->hide;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdDate;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedDate;\r\n\t\t\t}\r\n\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the auto-increment property, only if the primary column is auto-increment\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }",
"public function insertRow($row);",
"protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }",
"public function insert(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->INSERT,$parametro);\n//\t\t\tdie();\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_INSERT\",$this->INSERT);\n\t\t}\n\t\treturn $resultado;\n\t}",
"public abstract function Insert();",
"public function insert()\n {\n \n }",
"public function insert()\n {\n $this->id = insert($this);\n }",
"protected function saveInsert()\n {\n }",
"public function insertSql()\n {\n $sql = \"INSERT INTO \" . $this->dbName . '.' . $this->table\n . \" (\" . implode($this->fields, \", \") . \")\n VALUES (:\" . implode($this->fields, \", :\") . \");\";\n\n $this->query = $sql;\n }",
"public static function Insert(){\r\n }",
"public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }",
"function insert($conn,$table,$data)\n {\n }",
"public function insert($sql){\n\t $query = DB::query(Database::INSERT, $sql);\n\t return $query->execute($this->database);\n\t}",
"public function insert($table);",
"public function insert( )\n {\n $sql_insert_string = $this->formatInsertCommand( );\n if ( $sql_insert_string == false )\n return false;\n\n $l_result = $this->query( $sql_insert_string );\n $this->clearDataBuffer( );\n if($l_result)\n return @mysql_insert_id(underQL::$db_handle);\n\n return false;\n }",
"public function insert($connection, $table, $rows);",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"public function insert(array $params);",
"public function insert($query){\n\t\t$bool = $this->update($query);\n\t\treturn $bool;\n\t}",
"public function insert()\n {\n # code...\n }",
"function insert($tbl,$cols) {\n $sql = $this->build_sql_insert($tbl, $cols);\n try{\n $this->execute($sql);\n }catch(Exception $e){\n if($this->errno==1062){ // Duplicate Record\n return false;\n }\n throw $e;\n }\n return $this->last_id();\n }",
"public function insertstudents ($student_number , $age ,$id_nationality ){\n $sqlQuery = \" INSERT INTO students (student_number , age , id_nationality ) \";\n $sqlQuery .= \" VALUES ( $student_number , $age , $id_nationality)\";\n $result = $this -> getDbManager () -> executeInsertQuery ( $sqlQuery );\n return $result ;\n }",
"public function insertRow($query,$params=[]){\r\n\t\t\ttry {\r\n\t\t\t\t$dbquery=$this->db->prepare($query);\r\n\t\t\t\t$dbquery->execute($params);\r\n\t\t\t\treturn true;\r\n\t\t\t} catch (PDOException $e) {\r\n\t\t\tthrow new Exception($e->getMessage());\r\n\t\t\t}\r\n\t\t}",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->last_query();\n\t \t // $this->db->insert_id();\n\t}",
"function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }",
"function Insert(){\r\n $query = \"INSERT INTO userschedules\r\n (userName,organizationId,branchId,locationCode,date,startingTime,signedIn,finishingTime,signedOut,status)\r\n VALUES('$this->userName',$this->organizationId,$this->branchId,'$this->locationCode','$this->date',\r\n '$this->startingTime','$this->signedIn','$this->finishingTime','$this->signedOut','$this->status')\";\r\n include(\"includes/dbConnection.php\");\t\t\t\r\n $executeQuery = $db->prepare($query);\r\n $executeQuery->execute() or exit(\"Error: INSERT query failed.\");\r\n }",
"public function _insertar($objeto) {\n\t\t$this->db->setTable_name( $this->table_name );\t\t\n\t\t$this->db->setIs_query(false);\n\t\t\n\t\t$query = $this->_create_query_insertar( $objeto );\n\t\t// echo \"<br> $query <br>\\n\";\n\t\t\n\t\tif ( $this->db->getDriver() == amaguk_database_connection::DB_DRIVER_POSTGRESL ){\n\t\t\t$this->db->setField_key_name( $this->fields[0] );\n\t\t\t\n\t\t\t$this->db->insert_query( $query );\n\t\t}else{\n\t\t\t$this->db->query( $query );\n\t\t}\t\t\n\t\t\n\t\t$this->where=\"\";\n\t\t//print $query;\n\t\t$this->clearCondition();\n\t\t\n\t}",
"public function insert() {\n\t\t$this->insert_user();\n\t}",
"public function insert(Table $table, $row);",
"public function insert($medAccount);",
"public function insert()\n\t{\n\t\t$sql_array = array();\n\t\tforeach ($this->object_config as $name => $null)\n\t\t{\n\t\t\t$sql_array[$name] = $this->validate_property($this->$name, $this->object_config[$name]);\n\t\t}\n\n\t\t$sql = 'INSERT INTO ' . $this->sql_table . ' ' . $this->db->sql_build_array('INSERT', $sql_array);\n\t\t$this->db->sql_query($sql);\n\n\t\tif ($id = $this->db->sql_nextid())\n\t\t{\n\t\t\t$this->{$this->sql_id_field} = $id;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function yy_r102(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -2]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0])->fields($this->yystack[$this->yyidx + 0]->minor[1]);\n }"
]
| [
"0.72295344",
"0.72084016",
"0.71116924",
"0.7097333",
"0.7095761",
"0.70293355",
"0.7025007",
"0.70184445",
"0.6986873",
"0.6985234",
"0.6981424",
"0.6967289",
"0.6956188",
"0.692987",
"0.692174",
"0.6879948",
"0.6872559",
"0.6853117",
"0.6840738",
"0.68396926",
"0.6838916",
"0.6833698",
"0.6813434",
"0.6809066",
"0.679378",
"0.67790437",
"0.6776827",
"0.67726576",
"0.676945",
"0.67489016",
"0.6745832",
"0.6742941",
"0.6740376",
"0.67253816",
"0.6720163",
"0.6712797",
"0.6708044",
"0.67049605",
"0.67049605",
"0.6696627",
"0.6675146",
"0.6672891",
"0.66667306",
"0.66470844",
"0.6645872",
"0.6638501",
"0.66374195",
"0.66317946",
"0.6624304",
"0.6609722",
"0.66032124",
"0.65968996",
"0.6596174",
"0.6590943",
"0.65895766",
"0.6584867",
"0.6581956",
"0.6575555",
"0.65694714",
"0.65694714",
"0.65674686",
"0.6566529",
"0.6566041",
"0.65614796",
"0.65534216",
"0.6550613",
"0.65453655",
"0.6538395",
"0.6535756",
"0.6534244",
"0.6532319",
"0.6525331",
"0.65184504",
"0.6512463",
"0.65120643",
"0.65109897",
"0.65078104",
"0.64942783",
"0.6494211",
"0.6492921",
"0.64824915",
"0.6468301",
"0.6466037",
"0.64626706",
"0.64399344",
"0.6439338",
"0.64369243",
"0.6419647",
"0.64194727",
"0.6419273",
"0.64171857",
"0.6410973",
"0.64080715",
"0.6398188",
"0.6393234",
"0.6385376",
"0.6375556",
"0.6371905",
"0.6370515",
"0.636572",
"0.63657147"
]
| 0.0 | -1 |
/ This file contains functions for parsing strings comming from the socket that reads from a Mozart process. | function fromSocketToString($chain)
{
return trim($chain);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function parse($string);",
"protected function _parseServerString($server) {\n\t\t$socketTransport = 'unix://';\n\t\tif (strpos($server, $socketTransport) === 0) {\n\t\t\treturn array(substr($server, strlen($socketTransport)), 0);\n\t\t}\n\t\tif (substr($server, 0, 1) === '[') {\n\t\t\t$position = strpos($server, ']:');\n\t\t\tif ($position !== false) {\n\t\t\t\t$position++;\n\t\t\t}\n\t\t} else {\n\t\t\t$position = strpos($server, ':');\n\t\t}\n\t\t$port = 11211;\n\t\t$host = $server;\n\t\tif ($position !== false) {\n\t\t\t$host = substr($server, 0, $position);\n\t\t\t$port = substr($server, $position + 1);\n\t\t}\n\t\treturn array($host, (int)$port);\n\t}",
"#[Pure]\nfunction http_parse_message($message) {}",
"function server_parse($socket, $expected_response)\n{\n $server_response = '';\n $counter = 0;\n while (substr($server_response, 3, 1) != ' ') {\n if (!($server_response = fgets($socket, 256))) {\n $counter++;\n if ($counter % 100 == 0) {\n echo json_encode([\"message\" => \"Error fetching response from server $expected_response\"]);\n sleep(1);\n }\n }\n }\n if (!(substr($server_response, 0, 3) == $expected_response)) {\n echo json_encode([\"message\" => 'Unable to send e-mail.\"' . $server_response . '\"' . \" $expected_response\"]);\n }\n}",
"public function parse($string);",
"function readPayload($string) {\n // initialize our \"pointer\"\n $p = 0;\n // read in the command\n $command = readPayloadString($string, $p);\n // increase the pointer past 10 bytes\n $p += 10;\n // initialize return array\n $return = array();\n // keep reading in strings until we have met the length\n while ($p < strlen($string))\n $return[] = readPayloadString($string, $p);\n // return the array of strings\n return $return;\n}",
"function _parseMessageText($messagetext)\n{\n \t//Purpose: parse and assign variables from $messagetext.\n\t_log(\"parseMessageText: Starting.\",\"info\");\n \tglobal $caasnode,$caasfarm,$custnum,$ipaddress,$ostype,$action,$osversion,$hpfacility,$sitename,$siteid,$applist;\n\n\t$pattern='/ (\\w+)=/i';\n\t$replacement='&${1}=';\n\t$mystring=preg_replace($pattern, $replacement, $messagetext);\n\t$myarray=array();\n\tparse_str($mystring,$myarray);\n\t//print_r($myarray);\n\n\t// variable from messagetext\n\t$caasnode=$myarray['caasnode'];\n\t$caasfarm=$myarray['caasfarm'];\n\t$custnum=$myarray['customernumber'];\n\t$ipaddress=$myarray['ipaddress'];\n\t$ostype=$myarray['ostype'];\n\t$action=$myarray['action'];\n\t$osversion=$myarray['osversion'];\n\t$hpfacility=$myarray['hpfacility'];\n\t$sitename=$myarray['SiteName'];\n\t$siteid=$myarray['siteid'];\n\t$applist=$myarray['applist'];\n\n\t// modify some variables for data consistency\n\t$caasnode=strtolower($caasnode);\n\t$ostype=strtolower($ostype);\n\t$sitename=rtrim($sitename,\"'\");\t\t// remove trailing single-quote. \n\t$applist = stripslashes($applist);\t// remove backslashes\n\t//$applist = rtrim($applist,\"'\");\t\t// remove single-quote.\n\t$applist = rtrim($applist);\t\t\t// remove whitespace.\n\t$applist = trim($applist,\"'\");\t// remove single-quote.\n\t$applist = trim($applist,'\"');\t// remove double-quotes.\n\t$applist = strtoupper($applist);\t// set to UPPERCASE.\n\n\t// remove escape characters or double-quotes\n\t$siteid = stripslashes($siteid);\n\t$siteid = str_replace(\"\\\"\", \"\", $siteid); \n\t$sitename = stripslashes($sitename);\n\t$sitename = str_replace(\"\\\"\", \"\", $sitename); \n\t$sitename = str_replace(\"'\", \"\", $sitename); // remove single-quotes\n\t$osversion = stripslashes($osversion);\n\t$osversion = str_replace(\"\\\"\", \"\", $osversion); \n\t\n\t//_setOsVars($ostype,$osversion);\n\t\n\t// log variables\n\t_log(\"parseMessageText: caasnode = $caasnode\",\"info\");\n\t_log(\"parseMessageText: cassfarm = $caasfarm\",\"info\");\n\t_log(\"parseMessageText: custnum = $custnum\",\"info\");\n\t_log(\"parseMessageText: ipaddress = $ipaddress\",\"info\");\n\t_log(\"parseMessageText: ostype = $ostype\",\"info\");\n\t_log(\"parseMessageText: action = $action\",\"info\");\n\t_log(\"parseMessageText: osversion = $osversion\",\"info\");\n\t_log(\"parseMessageText: hpfacility = $hpfacility\",\"info\");\n\t_log(\"parseMessageText: sitename = $sitename\",\"info\");\n\t_log(\"parseMessageText: applist = $applist\",\"info\");\n\n\t_log(\"parseMessageText: Exiting.\",\"info\");\n}",
"public function parse(string $input);",
"function readUTF();",
"function string_parse($string, $data = array(), $return = FALSE)\n\t{\n\t\treturn $this->_parse($string, $data, $return);\n }",
"abstract public function parse();",
"abstract public function parse();",
"abstract public function parse();",
"abstract public function parse();",
"protected function parseResponse() \n {\n if (($line=fgets($this->socket)) === false) {\n throw new Exception('Failed reading data from redis socket.'); \n }\n $type=$line[0];\n $line=substr($line, 1, -2);\n switch ($type) {\n case '+': // Status reply\n return true;\n case '-': // Error reply\n throw new Exception('Redis error: '.$line);\n case ':': // Integer reply\n // no cast to int as it is in the range of a signed 64 bit integer\n return $line;\n case '$': // Bulk replies\n if ($line=='-1') {\n return null; \n }\n $length=$line+2;\n $data='';\n while ($length>0) {\n if (($block=fread($this->socket, $length))===false) {\n throw new Exception(\n 'Failed reading data from redis connection socket.'\n ); \n }\n $data.=$block;\n $length-= function_exists('mb_strlen')\n ? mb_strlen($block, '8bit')\n : strlen($block);\n }\n return substr($data, 0, -2);\n case '*': // Multi-bulk replies\n $count=(int)$line;\n $data=array();\n for ($i=0;$i<$count;$i++) {\n $data[]=$this->parseResponse(); \n }\n return $data;\n default:\n throw new Exception('Unable to parse data received from redis.');\n }\n }",
"function tidy_parse_string($input, $config = null, $encoding = null) {}",
"abstract public function parse ();",
"public function parseString($input, $config = null, $encoding = null) {}",
"function _parseMessageText($messagetext)\n{\n \t//parse out several variables for Caas\n\t_log(\"parseMessageText: Starting.\",\"info\");\n \tglobal $caasnode, $ipaddress, $hpmid, $coreid, $caasfarm, $ostype, $action;\n\tglobal $osversion, $hpfacility, $custnum, $sitename, $siteid;\n\n\t$pattern='/ (\\w+)=/i';\n\t$replacement='&${1}=';\n\t$mystring=preg_replace($pattern, $replacement, $messagetext);\n\t$myarray=array();\n\tparse_str($mystring,$myarray);\n\t//print_r($myarray);\n\n\t$title=$myarray['title'];\n\t$caasnode=$myarray['caasnode'];\n\t$caasnode=strtolower($caasnode);\n\t$hpmid=$myarray['hpmid'];\n\t$coreid=$myarray['coreid'];\n\t$caasfarm=$myarray['caasfarm'];\n\t$custnum=$myarray['customernumber'];\n\t$ostype=$myarray['ostype'];\n\t$ostype=strtolower($ostype);\n\t$osversion=$myarray['osversion'];\n\t_setOsType();\n\t$action=$myarray['action'];\n\t$ipaddress=$myarray['ipaddress'];\n\t$hpfacility=$myarray['hpfacility'];\n\t$sitename=$myarray['SiteName'];\n\t$sitename=rtrim($sitename,\"'\");\t\t// remove trailing single-quote. \n\t$siteid=$myarray['siteid'];\n\t$siteid=rtrim($siteid,\"'\");\t\t// remove trailing single-quote. \n\t$hpsanodeid=$myarray['hpmid'];\n\t\n\t// remove escape characters or double-quotes\n\t$siteid = stripslashes($siteid);\n\t$siteid = str_replace(\"\\\"\", \"\", $siteid); \n\t$sitename = stripslashes($sitename);\t\t // remove slashes\n\t$sitename = str_replace(\"\\\"\", \"\", $sitename); // remove double-quotes\n\t$sitename = str_replace(\"'\", \"\", $sitename); // remove single-quotes\n\t$osversion = stripslashes($osversion);\n\t$osversion = str_replace(\"\\\"\", \"\", $osversion); \n\t\n\t\n\t_log(\"parseMessageText: caasnode = $caasnode\",\"info\");\n\t_log(\"parseMessageText: coreid = $coreid\",\"info\");\n\t_log(\"parseMessageText: custnum = $custnum\",\"info\");\n\t_log(\"parseMessageText: sitename = $sitename\",\"info\");\n\t_log(\"parseMessageText: siteid = $siteid\",\"info\");\n\t_log(\"parseMessageText: ostype = $ostype\",\"info\");\n\t_log(\"parseMessageText: osversion = $osversion\",\"info\");\n\t_log(\"parseMessageText: caasfarm = $caasfarm\",\"info\");\n\t_log(\"parseMessageText: ipaddress = $ipaddress\",\"info\");\n\t_log(\"parseMessageText: hpfacility = $hpfacility\",\"info\");\n\t_log(\"parseMessageText: hpsanodeid = $hpsanodeid\",\"info\");\n\t_log(\"parseMessageText: action = $action\",\"info\");\n\t_log(\"parseMessageText: Exiting.\",\"info\");\n}",
"function readPayloadString($string, &$p) {\n // make sure that we're reading in a string\n if (ord($string[$p++]) != 2)\n return null;\n // grab the length of the string\n $length = hexdec(sprintf(\"%02X\", ord($string[$p++])).sprintf(\"%02X\", ord($string[$p++])));;\n // initialize the return string\n $return = \"\";\n // read through over characters with length and append the string\n for ($i = 0; $i < $length; $i++)\n $return .= substr($string, $p++, 1);\n // return the string back\n return $return;\n}",
"function read_mpint(&$payload) {\n return read_string($payload);\n}",
"function read_string(&$payload) {\n $length = read_uint32($payload);\n $string = \\substr($payload, 0, $length);\n $payload = \\substr($payload, $length);\n\n return $string;\n}",
"public function parseMessage($str)\n\t{\n\t\t$strExp = explode(':', $str);\n\n\t\t$nick = explode('!', $strExp[1])[0];\n\t\tunset($strExp[0]);\n\t\tunset($strExp[1]);\n\t\t$message = implode(':', $strExp);\n\n\t\treturn array('nick' => $nick, 'content' => $message);\n\t}",
"public static function parse_str($str)\n {\n }",
"public function parse();",
"public function parse();",
"public function parse();",
"function http_spreaker_parse($txt)\n{\n $needed_parts = array('nonce'=>1, 'username'=>1, 'timestamp'=>1, 'response'=>1);\n $data = array();\n $data = explode(\":\",$txt);\n $arrayReturn = array();\n if(count($needed_parts) != count($data)){\n \treturn false;\n }\n $i = 0;\n foreach($needed_parts as $key => $val){\n \t$arrayReturn[$key] = $data[$i];\n \t$i++;\n }\n return $arrayReturn;\n}",
"public function parse( $line ) {\n\t\tlist( $host, , $channel ) = explode( ' ', $line, 3 );\n\n\t\t$this->host = new IRCHostname( $host );\n\t\t$this->channel = substr( $channel, 1 );\n\t}",
"public function process($string);",
"abstract function decode($socket, $data);",
"protected function readDevice()\n {\n $trame = '';\n $i=0;\n while (strlen($trame)==0 && $i < 3) {\n $trame = $this->readTrame();\n $i++;\n }\n\n echo date('Y-m-d H:i:s T').\" Read attempt : \".$i.\" for \".strlen($trame).\" octet(s)\\n\";\n\n $trame = chop(substr($trame, 1, -1)); // on supprime les caracteres de debut et fin de trame\n\n $messages = explode(chr(10), $trame); // on separe les messages de la trame\n $new = [];\n foreach ($messages as $msg) {\n $ligne = explode(' ', $msg, 3);\n if (count($ligne)<2) {\n continue;\n }\n $new[$ligne[0]] = $ligne[1];\n }\n return $new;\n }",
"function getresp()\r\n {\r\n \tif (!$this->_socket || !is_resource($this->_socket)) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$response = \"\";\r\n\t\t$res = fread($this->_socket, 8000);\r\n\t\t preg_match_all('/^\\d{3}/m', $res, $response);\r\n\t\t/*do {\r\n \t\t$res = fgets($this->_socket, 512);\r\n \t\t$response .= $res;\r\n \t} while (substr($res, 3, 1) != \" \");\r\n \t*/\r\n\t\t\r\n \t//$this->debug(str_replace(\"\\r\\n\", \"\\n\", $response));\r\n \t$this->debug(str_replace(\"\\r\\n\", \"\\n\", $res));\r\n \treturn $response[0];\r\n }",
"protected function parse($str)\n {\n }",
"abstract public function process($inputString);",
"public function parse(string $content);",
"public function parse(string $content);",
"function ParseMsg($msg) {\n\t$parts = explode(\"&\",$msg);\n\t$result = array();\n\tforeach($parts as $i => $value) {\n\t\t$bits = explode(\"=\", $value, 2);\n\t\t$result[$bits[0]] = urldecode($bits[1]);\n\t}\n\n\treturn $result;\n}",
"private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}",
"function MBunserialize($serial_str)\n{\n $serial_str = preg_replace_callback('!s:(\\d+):\"(.*?)\";!s', function($match){return 's:'.strlen($match['2']).':\"'.$match['2'] . '\";';}, $serial_str);\n $serial_str= str_replace(\"\\r\", \"\", $serial_str);\n return unserialize($serial_str);\n}",
"function _parseLine($line) {\n\t$line = trim($line);\n\n\t$array = array();\n\n\tif (preg_match('/^-(.*):$/',$line)) {\n\t\t// It's a mapped sequence\n\t\t$key = trim(substr(substr($line,1),0,-1));\n\t\t$array[$key] = '';\n\t} elseif ($line[0] == '-' && substr($line,0,3) != '---') {\n\t\t// It's a list item but not a new stream\n\t\tif (strlen($line) > 1) {\n\t\t$value = trim(substr($line,1));\n\t\t// Set the type of the value. Int, string, etc\n\t\t$value = $this->_toType($value);\n\t\t$array[] = $value;\n\t\t} else {\n\t\t$array[] = array();\n\t\t}\n\t} elseif (preg_match('/^(.+):/',$line,$key)) {\n\t\t// It's a key/value pair most likely\n\t\t// If the key is in double quotes pull it out\n\t\tif (preg_match('/^([\"\\'](.*)[\"\\'](\\s)*:)/',$line,$matches)) {\n\t\t$value = trim(str_replace($matches[1],'',$line));\n\t\t$key = $matches[2];\n\t\t} else {\n\t\t// Do some guesswork as to the key and the value\n\t\t$explode = explode(':',$line);\n\t\t$key = trim($explode[0]);\n\t\tarray_shift($explode);\n\t\t$value = trim(implode(':',$explode));\n\t\t}\n\n\t\t// Set the type of the value. Int, string, etc\n\t\t$value = $this->_toType($value);\n\t\tif (empty($key)) {\n\t\t$array[] = $value;\n\t\t} else {\n\t\t$array[$key] = $value;\n\t\t}\n\t}\n\treturn $array;\n\t}",
"abstract public function parse( $line );",
"function sock_read($i=0)\n\t{\n\t\t$s = fgets($this->sock,4096);\n\n\t\t$this->log($s);\n\t\tif($s=='')\n\t\t{\n\t\t\tif($i==30)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsleep(1);\n\t\t\t\treturn $this->sock_read($i+1);\n\t\t\t}\n\t\t}\n\t\treturn $s;\n\t}",
"public function parseRequest($message);",
"function command_query($sock, $input) {\n\t// extract key and value\n\tif ($input[0] != '\"' || ($pos = strpos($input, '\"', 1)) === false) {\n\t\tprint(\"\\tSyntax error\\n\");\n\t\treturn;\n\t}\n print \"input:$input #$pos\\n\";\n $query = substr($input, 1, $pos-1);\n print \"query: $query\\n\";\n\t// send the command\n\t$buffer = chr(1) . chr(mb_strlen($query, 'ascii')+1) . $query.chr(0);\n print(\"sending $buffer#\\n\");\n\tfwrite($sock, $buffer);\n\t$response = fread($sock, 1);\n\tif (ord($response) != 1) {\n\t\tprint(\"\\tERROR\\n\");\n\t\treturn;\n\t}\n\t$response = fread($sock, 4);\n\t$length = unpack('Nint', $response);\n\t$length = $length['int'];\n\t$value = null;\n\tif ($length > 0) {\n\t\t$value = fread($sock, $length);\n\t\tprint(\"$value\\n\");\n\t}\n}",
"public function parse(string $string): array;",
"public function readMsg()\n\t{\n\t\tglobal $_THRESH, $_LOCKTHRESH;\n\t\t\n\t\tif($this->_SERIAL->_ckOpened() == false) { return \"fail\";}\n\t\t$this->_SERIAL->serialflush();\n\t\t\n\t\t$result = -5;\n\t\t$data = \"\";\n\t\t$i = 0;\n\t\t\n\t\t//This regex looks for any whitespace characters (\\n, char(10), etc.)\n\t\twhile (!preg_match(\"/[\\s,]+/\", $data))\n\t\t{\n\t\t\tif($i >=75000) {\n\t\t\t\treturn \"failed to read data. Value of loop: \".$i;\n\t\t\t}\n\t\t\n\t\t\t$i++;\n\t\t\t$data .= $this->_SERIAL->readPort();\n\t\t}\n\n\t\t$arr = str_split($data);\n\n\t\t// First byte of incoming message determines what type it is.\n\t\t$resultID = $arr[0];\n\n\t\t// after type is determined these statements extract relevant data from rest of the message.\n\t\tif ($resultID == \"s\")\n\t\t{\n\t\t\t$value = (ord($arr[3])*256)+ord($arr[4]);\n\n\t\t\tif($value > $_THRESH)\n\t\t\t\t$result = 1; // Filled\n\t\t\telse \n\t\t\t\t$result = 0; // UnFilled\n\t\t}\n\t\telseif ($resultID == \"l\")\n\t\t{\n\t\t\t$value = (ord($arr[3])*256)+ord($arr[4]);\n\n\t\t\tif($value < $_LOCKTHRESH) \n\t\t\t\t$result = 1; // UnLocked\n\t\t\telse \n\t\t\t\t$result = 0; // locked\n\t\t}\n\t\telseif ($resultID == \"a\")\n\t\t{\n\t\t\t$result = 1; // message was confirmed\n\t\t}\n\t\telseif ($resultID == \"n\")\n\t\t{\n\t\t\t$iDplusCol = Array(0 => ord($arr[1]), 1 => ord($arr[2]));\n\t\t\treturn $iDplusCol; // new column was found return the number of boxes\n\t\t}\n\t\telseif ($resultID == \"t\")\n\t\t{\n\t\t\t$result= ord($arr[3]); // returns the size of queried box\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"function readsockline($socket)\n{\n $line = '';\n while (true)\n {\n $byte = socket_read($socket, 1024);\n if ($byte == '')\n break;\n $line .= $byte;\n }\n\n return trim($line);\n}",
"public function read(): string\n {\n $chunk = fgets($this->getSocket());\n\n if ($chunk === false || $chunk === '') {\n throw new FaktoryException('Error while reading line from the server.');\n }\n\n $prefix = $chunk[0];\n $payload = substr($chunk, 1, -2);\n\n switch ($prefix) {\n case '+':\n return $payload;\n\n case '$':\n $size = (int) $payload;\n\n if ($size === -1) {\n return '';\n }\n\n $bulkData = '';\n $bytesLeft = ($size += 2);\n\n do {\n $chunk = fread($this->getSocket(), min($bytesLeft, 4096));\n\n if ($chunk === false || $chunk === '') {\n throw new FaktoryException('Error while reading bytes from the server.');\n }\n\n $bulkData .= $chunk;\n $bytesLeft = $size - strlen($bulkData);\n } while ($bytesLeft > 0);\n\n return substr($bulkData, 0, -2);\n\n case ':':\n return $payload;\n\n case '-':\n throw new FaktoryException('Server returned an error: ' . $payload);\n\n default:\n throw new FaktoryException(\"Unknown response prefix: '$prefix'.\");\n }\n }",
"private function parseMessage() {\n\n\t\t# Regexp to parse a formatted message\n\t\t# The message should come in format of\n\t\t# :(.*)\\!(.*)\\@(.*) PRIVMSG #channelname \\:(.*) for regular chatter\n\t\t# thus returning nickname, realname, hostmask, (command, arguments) || (botname: command (arguments)) || (chatter)\n\t\t$matched = false;\n\n # Try to match against the bots name!\n # This could mean it is a direct message in chan followed by a command request\n if(!$matched) {\n $pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:('.$this->config['username'].')\\:(?: +)?([^\\s]*) (.*)/';\n preg_match($pattern, $this->inbound, $matches);\n if(count($matches) > 1) {\n $matched = true;\n $this->lastMessage = array(\n 'nickname' => $matches[1],\n 'realname' => $matches[2],\n 'hostname' => $matches[3],\n 'command' => $matches[5],\n 'args' => rtrim($matches[6],\"\\n\\r\"),\n 'chatter' => ''\n );\n # Have to match a case whereby a command of 'botname: command' with no args is provided (for help)\n # If this case occurs we have to do some arg movement otherwise the command parser won't get a hit\n if($this->lastMessage['args'] != \"\" && $this->lastMessage['command'] == '') {\n $this->lastMessage['command'] = $this->lastMessage['args'];\n $this->lastMessage['args'] = \"\";\n }\n }\n }\n\n\t\tif(!$matched) {\n\t\t\t$pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:(.*)/';\n\t\t\tpreg_match($pattern, $this->inbound, $matches);\n\t\t\tif(count($matches) > 1) {\n\t\t\t\t$this->lastMessage = array(\n\t\t\t\t\t'nickname' => $matches[1],\n\t\t\t\t\t'realname' => $matches[2],\n\t\t\t\t\t'hostname' => $matches[3],\n\t\t\t\t\t'command' => '',\n\t\t\t\t\t'args' => '',\n\t\t\t\t\t'chatter' => rtrim($matches[4],\"\\n\\r\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"function extractCommand( $str ) {\n\t\t$this->errno = 0;\n\t\t$this->errinfo = \"\";\n\t\t\n\t\tif( strstr( $str, \"OPEN\" ) ) {\n\t\t\t$command = \"OPEN\";\n\t\t}\n\t\telse if( strstr( $str, \"IN-LINE FIND\" ) ) {\n\t\t\t$command = \"INFIND\";\n\t\t}\n\t\telse if( strstr( $str, \"IN-LINE, FIND\" ) ) {\n\t\t\t$command = \"INFIND\";\n\t\t}\n\t\telse if( strstr( $str, \"FIND\" ) ) {\n\t\t\t$command = \"FIND\";\n\t\t}\n\t\telse if( strstr( $str, \"IN-LINE REPLACE\" ) ) {\n\t\t\t$command = \"INREPLACE\";\n\t\t}\n\t\telse if( strstr( $str, \"IN-LINE, REPLACE\" ) ) {\n\t\t\t$command = \"INREPLACE\";\n\t\t}\n\t\telse if( strstr( $str, \"REPLACE\" ) ) {\n\t\t\t$command = \"REPLACE\";\n\t\t}\n\t\telse if( strstr( $str, \"IN-LINE AFTER, ADD\" ) ) {\n\t\t\t$command = \"INAFTERADD\";\n\t\t}\n\t\telse if( strstr( $str, \"AFTER, ADD\" ) ) {\n\t\t\t$command = \"AFTERADD\";\n\t\t}\n\t\telse if( strstr( $str, \"IN-LINE BEFORE, ADD\" ) ) {\n\t\t\t$command = \"INBEFOREADD\";\n\t\t}\n\t\telse if( strstr( $str, \"BEFORE, ADD\" ) ) {\n\t\t\t$command = \"BEFOREADD\";\n\t\t}\n\t\telse if( strstr( $str, \"SAVE/CLOSE\" ) ) {\n\t\t\t$command = \"CLOSE\";\n\t\t}\n\t\telse if( strstr( $str, \"COPY\" ) ) {\n\t\t\t$command = \"COPY\";\n\t\t}\n\t\telse if( strstr( $str, \"SQL\" ) ) {\n\t\t\t$command = \"SQL\";\n\t\t}\n\t\telse if( strstr( $str, \"INCREMENT\" ) ) {\n\t\t\t$command = \"INCREMENT\";\n\t\t}\n\t\telse {\n\t\t\t$command = \"UNKNOWN\";\n\t\t}\n\t\t\n\t\treturn $command;\n\t}",
"protected function parse() {}",
"public static function decomposeMsg (string $msg) : array {\n\t\tif (($pos = strpos ($msg, ':')) === false || ($command = \\DataLib::isInt (substr ($msg, 0, $pos))) === false || !Command::isCommand ($command)) {\n\t\t\treturn [ Command::INVALID ];\n\t\t}\n\t\treturn [\n\t\t\t$command,\n\t\t\tjson_decode (substr ($msg, $pos + 1), true)\n\t\t];\n\t}",
"public function parsePayload()\n {\n $_MTI_url = 'http://ii.nlm.nih.gov/cgi-bin/II/Interactive/interactiveMTI.pl'; \n $dom = new DOMDocument;\n $fields = array('InputText' => urlencode($this->_payload));\n\n $curl_ressource = curl_init();\n \n curl_setopt($curl_ressource,CURLOPT_URL, $_MTI_url);\n curl_setopt($curl_ressource,CURLOPT_POST, count($fields));\n curl_setopt($curl_ressource,CURLOPT_POSTFIELDS, $fields);\n curl_setopt($curl_ressource, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($curl_ressource, CURLOPT_TIMEOUT, 40);\n \n // Parses result html to extract MTI semantical parser results\n $dom->loadHTML(curl_exec($curl_ressource));\n $pres = $dom->getElementsByTagName('pre');\n \n foreach($pres as $pre)\n if(strstr($pre->nodeValue,\"Command: MTI\"))\n {\n $array = explode(\"\\n\", $pre->nodeValue);\n array_shift($array);\n array_shift($array);\n array_shift($array);\n array_shift($array);\n $result = implode(\"\\n\", $array); \n $this->_parsed_payload = $result; \n }\n \n curl_close($curl_ressource);\n \n return $result;\n }",
"function msgsrv_open ($host, $port, $appname, $username, $password) {}",
"public abstract function parse($text);",
"function _getReply() {\n $data = \"\";\n \n while($str = fgets($this->conn)) \n\t {\n\t\t$data .= $str;\n\t\tif(substr($str,3,1) == \" \")\n\t\t break;\n } \n \n if($this->debug) fwrite($this->debug,$data);\n print nl2br($data);\n $reply = array(\n 'code' => substr($str,0,3),\n 'msg' => substr($str,4)\n ); \n return $reply;\n}",
"protected function main()\r\n {\r\n // save incomming data and chop the leading white space\r\n $this->_raw = chop( fgets( $this->_conn ) );\r\n \r\n $this->debug( '<- ' . $this->_raw );\r\n \r\n $data = explode( ' ', $this->_raw );\r\n \r\n // first make sure we are connected and registered on the server\r\n if ( ! $this->_loggedOn )\r\n {\r\n // if not logged on, wait with processing events till we can login\r\n if ( strstr( $this->_raw, \"Found your hostname\" ) )\r\n {\r\n // save the servername so we can use it to identify server notices\r\n $this->_serverName = substr( $data[0], 1 );\r\n \r\n // start login\r\n $this->login();\r\n }\r\n }\r\n else\r\n {\r\n $this->observe( $data );\r\n }\r\n \r\n // if we are still connecting continue monitoring the data\r\n if ( ! feof( $this->_conn ) )\r\n {\r\n $this->main();\r\n }\r\n else\r\n {\r\n // we are disconnected so remove the socket\r\n unset( $this->_conn );\r\n \r\n // reconnect if required\r\n if ( $this->_autoReconnect )\r\n {\r\n $this->reconnect();\r\n }\r\n else\r\n {\r\n $this->log( \"Disconnected from server.\" );\r\n \r\n exit;\r\n }\r\n }\r\n }",
"private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n $ctx = json_decode($matches[2], true);\n if (isset($ctx['receive'])) {\n $this->in[] = [$matches[1], $matches[2]];\n $offset++;\n continue;\n }\n\n $this->out[] = [$matches[1], $matches[2]];\n }\n\n $offset++;\n }\n }",
"public function readString()\n {\n $len = $this->readUInt16();\n\n if($len <=0 || $this->getBytesAvailable() < $len){\n return false;\n }\n\n $key = '/a'. $len . 'k';\n $arr = unpack('@' . $this->position . $key, $this->data);\n $this->position += $len;\n return $arr['k'];\n }",
"function wp_parse_str($input_string, &$result)\n {\n }",
"function parseAbstractString($string) {\r\n\t$array_ensembe = array();\r\n\t$ensembles = explode(';', $string);\r\n\tforeach($ensembles as $k=>$ensemble) {\r\n\t\tlist($ensemble_valeur, $valeurs) = explode(':', $ensemble);\r\n\t\t$array_ensembe[$k]['ensemble'] = $ensemble_valeur;\r\n\t\t$valeurs = explode(',', $valeurs);\r\n\t\t$array_ensembe[$k]['valeurs'] = array();\r\n\t\tforeach($valeurs as $j=>$valeur) {\r\n\t\t\tlist($array_ensembe[$k]['valeurs'][$j]['titre'], $array_ensembe[$k]['valeurs'][$j]['nom'], $type) = explode('|', $valeur);\r\n\t\t\tlist($type, $array_ensembe[$k]['valeurs'][$j]['defaut']) = explode('(', $type);\r\n\t\t\tlist($type, $enum) = explode('[', $type);\r\n\t\t\tif (!empty($enum)) $array_ensembe[$k]['valeurs'][$j]['enum'] = explode('/', $enum);\r\n\t\t\t$array_ensembe[$k]['valeurs'][$j]['type'] = $type;\r\n\t\t}\r\n\t}\r\n\treturn $array_ensembe;\r\n}",
"function parse($code)\n {\n // Workaround mbstring overloading\n if (function_exists('mb_internal_encoding'))\n {\n $enc = mb_internal_encoding();\n mb_internal_encoding('8bit');\n }\n\n if (self::EOL_CRLF === $this->targetEol)\n {\n $tr = array();\n if (false !== strpos($code, \"\\r\")) $tr[\"\\r\"] = \"\\r\\n\";\n if (false !== strpos($code, \"\\n\")) $tr[\"\\n\"] = \"\\r\\n\";\n\n if ($tr)\n {\n if (2 === count($tr)) $tr = array(\"\\r\\n\" => \"\\r\\n\") + $tr;\n $code = strtr($code, $tr);\n }\n }\n else\n {\n if (self::EOL_UNIX !== $this->targetEol) user_error(\"Target EOL set to EOL_UNIX\", USER_WARNING);\n $this->targetEol = self::EOL_UNIX;\n\n if (false !== strpos($code, \"\\r\"))\n {\n $code = str_replace(\"\\r\\n\", \"\\n\", $code);\n $code = strtr($code, \"\\r\", \"\\n\");\n }\n }\n\n $this->headParser = $this;\n $this->tokens = $this->getTokens($code, false);\n $code = implode('', $this->parseTokens());\n\n function_exists('mb_internal_encoding') and mb_internal_encoding($enc);\n\n return $code;\n }",
"public function parse(string $value);",
"public function onReceive(string $str)\n {\n }",
"public function onReceive(string $str)\n {\n }",
"private function read_reply() {\n\t\t\t$reply = fgets($this->connection);\n\t\t\t$status = substr($reply, 0, 1);\n\t\t\t$reply = trim(substr($reply, 1));\n\t\t\tswitch ($status) {\n\t\t\t\tcase '-': // error\n\t\t\t\t\tthrow new Exception($reply);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+': // single line\n\t\t\t\t\tif ($reply == 'OK') return true;\n\t\t\t\t\treturn $reply;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ':': // integer\n\t\t\t\t\treturn (integer)$reply;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '$': // bulk\n\t\t\t\t\treturn $this->bulk_reply($reply);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\t$resp = array();\n\t\t\t\t\tfor ($i=0; $i < $reply; $i++) { \n\t\t\t\t\t\t$resp[$i] = $this->read_reply();\n\t\t\t\t\t}\n\t\t\t\t\treturn $resp;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception('Unexpected response');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"public function getParsedInput();",
"public function baseRead($socket)\n {\n while($buffer = fread($socket, self::READ_BUFFER_SIZE))\n {\n $this->_recvBuffer .= $buffer; \n }\n \n if($this->_recvBuffer)\n {\n if(!$this->onMessage)\n {\n return ;\n }\n \n // protocol has been set\n if($this->protocol)\n {\n $parser = $this->protocol;\n while($this->_recvBuffer)\n {\n // already know current package length \n if($this->_currentPackageLength)\n {\n // we need more buffer\n if($this->_currentPackageLength > strlen($this->_recvBuffer))\n {\n break;\n }\n }\n else\n {\n // try to get the current package length\n $this->_currentPackageLength = $parser::input($this->_recvBuffer, $this);\n // need more buffer\n if($this->_currentPackageLength === 0)\n {\n break;\n }\n elseif($this->_currentPackageLength > 0 && $this->_currentPackageLength <= self::$maxPackageSize)\n {\n // need more buffer\n if($this->_currentPackageLength > strlen($this->_recvBuffer))\n {\n break;\n }\n }\n // error package\n else\n {\n $this->close('error package. package_length='.var_export($this->_currentPackageLength, true));\n }\n }\n \n // recvived the whole data \n self::$statistics['total_request']++;\n $one_request_buffer = substr($this->_recvBuffer, 0, $this->_currentPackageLength);\n $this->_recvBuffer = substr($this->_recvBuffer, $this->_currentPackageLength);\n $this->_currentPackageLength = 0;\n try\n {\n call_user_func($this->onMessage, $this, $parser::decode($one_request_buffer, $this));\n }\n catch(Exception $e)\n {\n self::$statistics['throw_exception']++;\n echo $e;\n }\n }\n if($this->_status !== self::STATUS_CLOSED && feof($socket))\n {\n $this->destroy();\n return;\n }\n return;\n }\n self::$statistics['total_request']++;\n // protocol not set\n try \n {\n call_user_func($this->onMessage, $this, $this->_recvBuffer);\n }\n catch(Exception $e)\n {\n self::$statistics['throw_exception']++;\n echo $e;\n }\n $this->_recvBuffer = '';\n if($this->_status !== self::STATUS_CLOSED && feof($socket))\n {\n $this->destroy();\n return;\n }\n }\n else if(feof($socket))\n {\n $this->destroy();\n return;\n }\n }",
"public function parse(){\n try {\n $table = new HomeNet_Model_DbTable_Apikeys();\n $apikey = $table->fetchRowById($this->apikey);\n\n $table = new HomeNet_Model_DbTable_Devices();\n $device = $table->fetchRowByHouseNodeDevice($apikey->house, $this->_packet->fromNode, $this->_packet->fromDevice);\n\n if(!$device && (!$device->command == $this->_packet->command)){\n throw new Zend_Exception('Cannot find matching device');\n }\n $this->saveDatapoint();\n /*\n $table = new HomeNet_Model_DbTable_Components();\n $component = $table->fetchAllByDevice($this->fromDevice);*/\n\n } catch (Zend_Exception $e){\n return $e->message();\n }\n return 'true';\n }",
"function get_string() {\n\t\t$str = $this->_parse();\n return $str;\n }",
"private function getServerResponse() {\r\n\t\t$data = \"\";\r\n\t\twhile ( $str = fgets ( $this->conn, 4096 ) ) {\r\n\t\t\t$data .= $str;\r\n\t\t\tif (substr ( $str, 3, 1 ) == \" \") {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($this->debug)\r\n\t\t\techo $data . \"<br>\";\r\n\t\treturn $data;\r\n\t}",
"function COM_string_decode($string,$length=-1) {\r\n\t$value = trim(preg_replace('/[^\\w\\d\\.\\,\\-\\& ]/', '', html_entity_decode($string)));\r\n\tif ($length > 0) {\r\n\t\t$value = substr($value,0,$length);\r\n\t}\r\n\treturn $value;\r\n}",
"protected function tryParseCommands()\n {\n $result = [];\n\n for($dataLen = strlen($this->buffer); $dataLen >= 4;) {\n // reading length of received command\n $commandLenBytes = substr($this->buffer, 0, 4);\n $commandLen = intval(bin2hex($commandLenBytes), 16);\n if($dataLen < $commandLen+4) {\n // waiting more bytes to parse\n break;\n }\n $commandBytes = gzuncompress(substr($this->buffer, 4, $commandLen));\n $command = json_decode($commandBytes, true);\n $result[] = $command;\n // cut parsed bytes from buffer\n $this->buffer = substr($this->buffer, $commandLen + 4);\n $dataLen = strlen($this->buffer);\n }\n\n return $result;\n }",
"function parse_idle_response($response) {\n // check total length\n if (count($response)<16){\n return result_response_parse_error('response length != 16');\n }\n // check STX\n if ($response[0]!=STX) {\n return result_response_parse_error('response STX error');\n }\n // check command\n if ($response[1]!=CMD_IDLE && $response[1]!=CMD_SYNCHRONIZE_TIME) {\n return result_response_parse_error('response CMD error');\n }\n // check checksum\n $data = array_slice($response,2,12);\n $checksum = calc_checksum($response[1],$data);\n if ($checksum!=$response[14]) {\n return result_response_parse_error('response CHECKSUM error');\n }\n // check ETX\n if ($response[15]!=ETX) {\n return result_response_parse_error('response ETX error');\n }\n $rdata = array(\n 'cmd' => $response[1],\n 'value' => bytes_to_string($data),\n );\n return result_success_data($rdata);\n}",
"private static function readString($handle, $length) {\n\t\treturn self::readUnpacked($handle, 'a*', $length);\n\t}",
"public function parse($text);",
"abstract protected function read ();",
"function processReqString ($req) {\r\n\r\n\t$question = explode(\"|\", $req);\r\n\tif(sizeof($req) ==0 ) {\r\n\t\techo 'error: The provided string is incorrect';\r\n\t\treturn null;\r\n\t}\r\n\t$arr = array_map(\"splitQuestions\", $question);\r\n\treturn $arr;\r\n\r\n\r\n}",
"private function getServerResponse() {\n\t\t$data=\"\";\n\t\twhile($str = fgets($this->conn,4096)) {\n\t\t\t$data .= $str;\n\t\t\tif(substr($str,3,1) == \" \") { break; }\n\t\t}\n\t\tif($this->debug) echo $data . \"<br>\";\n\t\treturn $data;\n\t}",
"function SI_parseUserAgent($ua) {\n\t$browser['platform']\t= \"Indeterminable\";\n\t$browser['browser']\t\t= \"Indeterminable\";\n\t$browser['version']\t\t= \"Indeterminable\";\n\t$browser['majorver']\t= \"Indeterminable\";\n\t$browser['minorver']\t= \"Indeterminable\";\n\t\n\t\n\t// Test for platform\n\tif (eregi('Win',$ua)) {\n\t\t$browser['platform'] = \"Windows\";\n\t\t}\n\telse if (eregi('Mac',$ua)) {\n\t\t$browser['platform'] = \"Macintosh\";\n\t\t}\n\telse if (eregi('Linux',$ua)) {\n\t\t$browser['platform'] = \"Linux\";\n\t\t}\n\t\n\t\n\t// Test for browser type\n\tif (eregi('Mozilla/4',$ua) && !eregi('compatible',$ua)) {\n\t\t$browser['browser'] = \"Netscape\";\n\t\teregi('Mozilla/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Mozilla/5',$ua) || eregi('Gecko',$ua)) {\n\t\t$browser['browser'] = \"Mozilla\";\n\t\teregi('rv(:| )([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[2];\n\t\t}\n\tif (eregi('Safari',$ua)) {\n\t\t$browser['browser'] = \"Safari\";\n\t\t$browser['platform'] = \"Macintosh\";\n\t\teregi('Safari/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t\n\t\tif (eregi('125',$browser['version'])) {\n\t\t\t$browser['version'] \t= 1.2;\n\t\t\t$browser['majorver']\t= 1;\n\t\t\t$browser['minorver']\t= 2;\n\t\t\t}\n\t\telse if (eregi('100',$browser['version'])) {\n\t\t\t$browser['version'] \t= 1.1;\n\t\t\t$browser['majorver']\t= 1;\n\t\t\t$browser['minorver']\t= 1;\n\t\t\t}\n\t\telse if (eregi('85',$browser['version'])) {\n\t\t\t$browser['version'] \t= 1.0;\n\t\t\t$browser['majorver']\t= 1;\n\t\t\t$browser['minorver']\t= 0;\n\t\t\t}\n\t\telse if ($browser['version']<85) {\n\t\t\t$browser['version'] \t= \"Pre-1.0 Beta\";\n\t\t\t}\n\t\t}\n\tif (eregi('iCab',$ua)) {\n\t\t$browser['browser'] = \"iCab\";\n\t\teregi('iCab/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Firefox',$ua)) {\n\t\t$browser['browser'] = \"Firefox\";\n\t\teregi('Firefox/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Firebird',$ua)) {\n\t\t$browser['browser'] = \"Firebird\";\n\t\teregi('Firebird/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Phoenix',$ua)) {\n\t\t$browser['browser'] = \"Phoenix\";\n\t\teregi('Phoenix/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Camino',$ua)) {\n\t\t$browser['browser'] = \"Camino\";\n\t\teregi('Camino/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Chimera',$ua)) {\n\t\t$browser['browser'] = \"Chimera\";\n\t\teregi('Chimera/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Netscape',$ua)) {\n\t\t$browser['browser'] = \"Netscape\";\n\t\teregi('Netscape[0-9]?/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('MSIE',$ua)) {\n\t\t$browser['browser'] = \"Internet Explorer\";\n\t\teregi('MSIE ([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Opera',$ua)) {\n\t\t$browser['browser'] = \"Opera\";\n\t\teregi('Opera( |/)([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[2];\n\t\t}\n\tif (eregi('OmniWeb',$ua)) {\n\t\t$browser['browser'] = \"OmniWeb\";\n\t\teregi('OmniWeb/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Konqueror',$ua)) {\n\t\t$browser['platform'] = \"Linux\";\n\n\t\t$browser['browser'] = \"Konqueror\";\n\t\teregi('Konqueror/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Crawl',$ua) || eregi('bot',$ua) || eregi('slurp',$ua) || eregi('spider',$ua)) {\n\t\t$browser['browser'] = \"Crawler/Search Engine\";\n\t\t}\n\tif (eregi('Lynx',$ua)) {\n\t\t$browser['browser'] = \"Lynx\";\n\t\teregi('Lynx/([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\tif (eregi('Links',$ua)) {\n\t\t$browser['browser'] = \"Links\";\n\t\teregi('\\(([[:digit:]\\.]+)',$ua,$b);\n\t\t$browser['version'] = $b[1];\n\t\t}\n\t\n\t\n\t// Determine browser versions\n\tif ($browser['browser']!='Safari' && $browser['browser'] != \"Indeterminable\" && $browser['browser'] != \"Crawler/Search Engine\" && $browser['version'] != \"Indeterminable\") {\n\t\t// Make sure we have at least .0 for a minor version\n\t\t$browser['version'] = (!eregi('\\.',$browser['version']))?$browser['version'].\".0\":$browser['version'];\n\t\t\n\t\teregi('^([0-9]*).(.*)$',$browser['version'],$v);\n\t\t$browser['majorver'] = $v[1];\n\t\t$browser['minorver'] = $v[2];\n\t\t}\n\tif (empty($browser['version']) || $browser['version']=='.0') {\n\t\t$browser['version']\t\t= \"Indeterminable\";\n\t\t$browser['majorver']\t\t= \"Indeterminable\";\n\t\t$browser['minorver']\t\t= \"Indeterminable\";\n\t\t}\n\t\n\treturn $browser;\n\t}",
"public function parseString($rawString)\n\t{\n\t\t$lines = explode(\"\\n\", trim((string) $rawString));\n\t\treturn $this->parseLines($lines);\n\t}",
"abstract public static function decode($string): array;",
"function readFrame ()\n {\n $start = microtime( true );\n $data = $buf = '';\n \n $rc = socket_recv($this->socket, $buf, 1, 0);\n // rc === 0: EOF / FIN received\n // rc === false: RST received / connection forcefully closed by remote side\n \n if ( $rc === 0 || $rc === false )\n {\n // EOF / FIN recvd\n $this->reconnect();\n return $this->readFrame();\n }\n \n // Read until end of frame (\\0)\n while ( ord($buf) != 0 )\n {\n $data .= $buf;\n \n $rc = socket_recv($this->socket, $buf, 1, 0);\n \n if ( $rc === false || $rc === 0 )\n {\n $this->reconnect();\n return $this->readFrame();\n }\n }\n \n // Verify next byte is \\n\n $rc = socket_recv($this->socket, $buf, 1, 0);\n if ( $rc === false || $rc === 0 || ord($buf) != 10 )\n {\n $this->reconnect();\n return $this->readFrame();\n }\n \n list ($header, $body) = explode(\"\\n\\n\", $data, 2);\n $header = explode(\"\\n\", $header);\n $headers = array();\n \n $command = NULL;\n foreach ( $header as $v )\n {\n if ( isset($command) )\n {\n list ($name, $value) = explode(':', $v, 2);\n $headers[$name] = trim($value);\n } else\n {\n $command = $v;\n }\n }\n \n $frame = new StompFrame($command, $headers, trim($body));\n if ( isset($frame->headers['amq-msg-type']) && $frame->headers['amq-msg-type'] == 'MapMessage' )\n {\n return new MapMessage($frame);\n } else {\n return $frame;\n }\n }",
"private function readMessage()\n {\n $fromIp = \"\";\n $fromPort = 0;\n $msg = null;\n \n if (!@socket_recvfrom($this->socket, $msg, 65535, 0, $fromIp, $fromPort)) {\n $err_no = socket_last_error($this->socket);\n if ($err_no == 4) {\n \techo \"\\n\\nCaught SIGINT, quiting...\\n\";\n \t$this->keepRunning = false;\n }\n }\n\n if (!$msg) {\n \treturn false;\n }\n\n if ($this->fromIp === null && $this->fromPort === null) {\n \t$this->fromIp = $fromIp;\n \t$this->fromPort = $fromPort;\n } else if ($this->fromIp != $fromIp || $this->fromPort != $fromPort) {\n \tdie(sprintf(\"Error: sender changed from %s:%d to %s:%d, aborting...\\n\", $this->fromIp, $this->fromPort, $fromIp, $fromPort));\n }\n \n return [\n \t\"timestamp\"\t=> microtime(true),\n \t\"msg\" \t\t=> $msg,\n \t\"from_ip\" \t=> $fromIp,\n \t\"from_port\"\t=> $fromPort\n ];\n }",
"public function parse($buffer)\n {\n $pos = 1; // The remain length is start from second byte.\n $remainLen = \\Mqtt\\Message\\Util::decodeRemainLength($buffer, $pos);\n $this->header->setRemainLen($remainLen);\n $this->header->parseVarHeader($buffer, $pos);\n $this->parseBody($buffer, $pos);\n }",
"protected function _parseHeader() {}",
"public static function extractMsg (string $msg) : string {\n\t\tif (($pos = strpos ($msg, ':')) === false || ($command = \\DataLib::isInt (substr ($msg, 0, $pos))) === false || !Command::isCommand ($command)) {\n\t\t\treturn '';\n\t\t}\n\t\treturn substr ($msg, $pos + 1);\n\t}",
"public static function parse(string $string): self;",
"public function read(&$error_string = NULL)\r\n {\r\n $data = \"\";\r\n\r\n do {\r\n // Read header\r\n $header = fread($this->connection, 2);\r\n if (!$header) {\r\n $error_string = \"Reading header from websocket failed.\";\r\n throw new ConnectionException($error_string);\r\n }\r\n\r\n $opcode = ord($header[0]) & 0x0F;\r\n $final = ord($header[0]) & 0x80;\r\n $masked = ord($header[1]) & 0x80;\r\n $payload_len = ord($header[1]) & 0x7F;\r\n\r\n // Get payload length extensions\r\n $ext_len = 0;\r\n if ($payload_len >= 0x7E) {\r\n $ext_len = 2;\r\n if ($payload_len == 0x7F)\r\n $ext_len = 8;\r\n $header = fread($this->connection, $ext_len);\r\n if (!$header) {\r\n $error_string = \"Reading header extension from websocket failed.\";\r\n throw new ConnectionException($error_string);\r\n }\r\n\r\n // Set extented paylod length\r\n $payload_len = 0;\r\n for ($i = 0; $i < $ext_len; $i++)\r\n $payload_len += ord($header[$i]) << ($ext_len - $i - 1) * 8;\r\n }\r\n\r\n // Get Mask key\r\n if ($masked) {\r\n $mask = fread($this->connection, 4);\r\n if (!$mask) {\r\n $error_string = \"Reading header mask from websocket failed.\";\r\n throw new ConnectionException($error_string);\r\n }\r\n }\r\n\r\n // Get payload\r\n $frame_data = '';\r\n while ($payload_len > 0) {\r\n $frame = fread($this->connection, $payload_len);\r\n if (!$frame) {\r\n $error_string = \"Reading payload from websocket failed.\";\r\n throw new ConnectionException($error_string);\r\n }\r\n $payload_len -= strlen($frame);\r\n $frame_data .= $frame;\r\n }\r\n\r\n // Handle ping requests (sort of) send pong and continue to read\r\n if ($opcode == 9) {\r\n // Assamble header: FINal 0x80 | Opcode 0x0A + Mask on 0x80 with zero payload\r\n fwrite($this->connection, chr(0x8A) . chr(0x80) . pack(\"N\", rand(1, 0x7FFFFFFF)));\r\n continue;\r\n\r\n // Close\r\n } elseif ($opcode == 8) {\r\n fclose($this->connection);\r\n\r\n // 0 = continuation frame, 1 = text frame, 2 = binary frame\r\n } elseif ($opcode < 3) {\r\n // Unmask data\r\n $data_len = strlen($frame_data);\r\n if ($masked)\r\n for ($i = 0; $i < $data_len; $i++)\r\n $data .= $frame_data[$i] ^ $mask[$i % 4];\r\n else\r\n $data .= $frame_data;\r\n } else\r\n continue;\r\n } while (!$final);\r\n\r\n return $data;\r\n }",
"static function Parse ($data)\n\t{\n\t\t$irc = \"/^(?:\\:(\\S+)\\s+)(\\w+)(?:\\s+(?!:)(.*?))?(?:\\s+:(.+))?$/\";\n\t\tpreg_match($irc, $data, $matches);\n\t\t$return = array(\n\t\t\t'origin' => (isset($data[1])) ? $data[1] : \"\",\n\t\t\t'command' => $data[2],\n\t\t\t'params' => (isset($data[3])) ? explode(\" \",$data[3]) : array(),\n\t\t);\n\t\tif (isset($data[4]))\n\t\t{\n\t\t\t$return['params'][] = $data[4];\n\t\t\t$return['freeform'] = TRUE;\n\t\t}\n\t\treturn $return;\n\t}",
"public function read_string() { return $this->read_bytes(); }",
"function mclogparse($str) {\n\n\t// Prevent HTML interpretation\n\t$str = '<span id=\"mclogparse\">'.htmlspecialchars($str);\n\n\t// Colors\n\t$fgColors = array(\n\t\t30 => 'black',\n\t\t31 => 'red',\n\t\t32 => 'green',\n\t\t33 => 'yellow',\n\t\t34 => '#0055ff', // blue\n\t\t35 => 'magenta',\n\t\t36 => 'cyan',\n\t\t37 => 'white'\n\t);\n\n\t// Replace color codes\n\tforeach(array_keys($fgColors) as $color)\n\t\t$str = preg_replace(\"/\\x1B\\[\".$color.';(1m|22m)/','</span><span style=\"color: '.$fgColors[$color].';\">',$str);\n\t\n\t// Replace \"default\" codes with closing span\n\t$str = preg_replace(\"/\\x1B\\[(0;39|0;49)?m/\",'</span>', $str);\n\t\n\t// Color message types\n\t$str = strtr($str,array(\n\t\t'[INFO]' => '[<span style=\"color: #77ccff;\">INFO</span>]',\n\t\t'[WARNING]' => '[<span style=\"color: yellow;\">WARNING</span>]',\n\t\t'[SEVERE]' => '[<span style=\"color: red;\">SEVERE</span>]'\n\t));\n\t\n\treturn $str;\n\t\n}",
"function imap_test($imap_stream, $string) {\n print \"<tr><td>\".sm_encode_html_special_chars($string).\"</td></tr>\";\n $response = sqimap_run_command_list($imap_stream, trim($string),false, $responses, $message,false);\n array_push($response, $responses . ' ' .$message);\n return $response;\n}",
"function getFromServer($requestString)\n{\n\t//Connection information\n\t$protIP = \"tcp://127.0.0.1\";\n\t$portsFile = \"ports.txt\";\n\t$timeout = 10; //in seconds\n\t\n\t//Deserialize ports\n\t$ports = getPorts($portsFile);\n\t\n\t//Obtain index to last port (where primary should be running)\n\t$last_ind = (int)(count($ports)-1);\n\t\n\t//Election related (in case the primary goes down)\n\t$callElections = false;\n\t$oldPrimary = (int)$ports[(int)$last_ind];\n\t\n\t//Try Connecting\n\t$fp = fsockopen($protIP, (int)$ports[$last_ind],$errno, $errstr, $timeout);\n\twhile($fp == false)\n\t{\n\t\t//The time has come to electe a new leader!\n\t\t$callElections = true;\n\t\t//Mark old primary\n\t\t$oldPrimary = (int)$ports[$last_ind];\n\t\t$last_ind--;\n\t\tif($last_ind < 0)\n\t\t{\n\t\t\texit(\"Ran out of destination servers! Oh no :(\");\n\t\t}\n\t\t//Try reconnecting\n\t\t$fp = fsockopen($protIP, (int)$ports[$last_ind],$errno, $errstr, $timeout);\n\t\techo \"Trying to connect to \".$ports[$last_ind].\"\\r\\n\";\t\n\t}\t\n\tif($callElections)\n\t{\n\t\t//Generate a Primary Request String\n\t\t$primaryReq = getPrimaryRequest($oldPrimary);\n\t\t\n\t\t//Send the request to the back-end\n\t\tsendRequest($fp, $primaryReq);\n\t\t\n\t\t//Get election response\n\t\t$r = getResponse($fp);\n\t\t\n\t\t//Remove faulty ports --improve in the future by wrapping write access with a mutex\n\t\t$contents = \"\";\n\t\tfor($i = 0; $i <= $last_ind; $i++)\n\t\t{\n\t\t\t$contents = $contents.$ports[$i].\";\";\n\t\t}\n\t\tfile_put_contents($portsFile, $contents);\n\t\t\n\t\t//Close connection\n\t\tfclose($fp); \n\t}\n\t//Reopen connection\n\t$fp = fsockopen($protIP, (int)$ports[$last_ind],$errno, $errstr, $timeout);\n\t\n\t//send original request to the server\n\tsendRequest($fp, $requestString);\n\t\n\t//obtain response\n\t$responseArr = getResponse($fp);\n\t\n\t//close connection\n\tfclose($fp);\n\t\n\treturn $responseArr;\n}",
"function read_xml_string( $str )\n {\n $this->init();\n $this->parser = xml_parser_create($this->encoding);\n xml_set_object( $this->parser, $this );\n xml_set_element_handler( $this->parser, \"_tag_open\", \"_tag_close\" );\n xml_set_character_data_handler( $this->parser, \"_cdata\" );\n xml_parse( $this->parser, $str );\n xml_parser_free( $this->parser );\n }",
"public function readString()\n {\n $stringReference = $this->readInteger();\n\n //Check if this is a reference string\n if (($stringReference & 0x01) == 0) {\n // reference string\n $stringReference = $stringReference >> 1;\n if ($stringReference >= count($this->_referenceStrings)) {\n $this->throwZendException('Undefined string reference: {0}',[$stringReference]);\n }\n // reference string found\n return $this->_referenceStrings[$stringReference];\n }\n\n $length = $stringReference >> 1;\n if ($length) {\n $string = $this->_stream->readBytes($length);\n $this->_referenceStrings[] = $string;\n } else {\n $string = \"\";\n }\n return $string;\n }",
"function mi_command($command, $mi_url, &$mi_type, &$errors, &$status){\n\t$a=explode(\":\",$mi_url);\n\n\tswitch ($a[0]) {\n\t\tcase \"udp\":\n\t\t\t$mi_type=\"udp\";\n\t\t\tif (strlen($a[1])==0){\n\t\t\t\t$errors[] = \"No host found in UDP MI URL <\".$mi_url.\">\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (strlen($a[2])==0){\n\t\t\t\t$errors[] = \"No port found in UDP MI URL <\".$mi_url.\">\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$output = write2udp(trim($command),$a[1]/*host*/,$a[2]/*port*/,$errors,$status);\n\t\t\tbreak;\n\n\t\tcase \"xmlrpc\":\n\t\t\t$mi_type=\"xmlrpc\";\n\t\t\tif (strlen($a[1])==0){\n\t\t\t\t$errors[] = \"No host found in XMLRPC MI URL <\".$mi_url.\">\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (strlen($a[2])==0){\n\t\t\t\t$errors[] = \"No port found in XMLRPC MI URL <\".$mi_url.\">\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$output = write2xmlrpc(trim($command),$a[1]/*host*/,$a[2]/*port*/,$errors,$status);\n\t\t\tbreak;\n\n\t\tcase \"fifo\":\n\t\t\t$mi_type=\"fifo\";\n\t\t\tif (strlen($a[1])==0){\n\t\t\t\t$errors[] = \"No file found in FIFO MI URL <\".$mi_url.\">\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$output = write2fifo(trim($command), $a[1] /*fifo filename*/, $errors, $status);\n\t\t\tbreak;\n\n\t\tcase \"json\":\n\t\t\t$mi_type=\"json\";\n\t\t\tif (strlen($a[1])==0){\n\t\t\t\t$errors[] = \"No URL found in JSON MI URL <\".$mi_url.\">\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$output = write2json(trim($command),substr($mi_url,5)/*URL*/,$errors,$status);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$errors[] = \"Unknwon type[\".$a[0].\"] for MI URL <\".$mi_url.\">\";\n\t\t\treturn;\n\t}\n\n\tif ($status && preg_match(\"/([0-9][0-9][0-9])/\",$status,$matches) ) {\n\t\tif ( $matches[0] >=300) { \n\t\t\t$errors[] = \"MI command failed with \".$status;\n\t\t}\n\t}\n\tif ($errors) {\n\t\techo \"<font color='red'>\".$errors[0].\"</font>\";\n\t}\n\n return $output; \n}",
"function parse_ms_string( $ms_string ) {\n\n\tswitch ( strlen( trim( $ms_string ) ) ) {\n\t\tcase 0: return 0;\n\t\tcase 1: return $ms_string * 100;\n\t\tcase 2: return $ms_string * 10;\n\t\tdefault: return (int) substr( $ms_string, 0, 3 );\n\t}\n}",
"public function __construct($payload) {\n\t\tif (preg_match(\"/^[\\\\x00-\\\\x7f]+\\$/\", $payload) !== 1)\n\t\t\tthrow new InvalidArgumentException(\"payload contains non-ASCII character\");\n\t\t$this->payload = $this->readout = $payload;\n\t\t$chr[48] = '131112'; // 0\n\t\t$chr[49] = '111213'; // 1\n\t\t$chr[50] = '111312'; // 2\n\t\t$chr[51] = '111411'; // 3\n\t\t$chr[52] = '121113'; // 4\n\t\t$chr[53] = '121212'; // 5\n\t\t$chr[54] = '121311'; // 6\n\t\t$chr[55] = '111114'; // 7\n\t\t$chr[56] = '131211'; // 8\n\t\t$chr[57] = '141111'; // 9\n\t\t$chr[65] = '211113'; // A\n\t\t$chr[66] = '211212'; // B\n\t\t$chr[67] = '211311'; // C\n\t\t$chr[68] = '221112'; // D\n\t\t$chr[69] = '221211'; // E\n\t\t$chr[70] = '231111'; // F\n\t\t$chr[71] = '112113'; // G\n\t\t$chr[72] = '112212'; // H\n\t\t$chr[73] = '112311'; // I\n\t\t$chr[74] = '122112'; // J\n\t\t$chr[75] = '132111'; // K\n\t\t$chr[76] = '111123'; // L\n\t\t$chr[77] = '111222'; // M\n\t\t$chr[78] = '111321'; // N\n\t\t$chr[79] = '121122'; // O\n\t\t$chr[80] = '131121'; // P\n\t\t$chr[81] = '212112'; // Q\n\t\t$chr[82] = '212211'; // R\n\t\t$chr[83] = '211122'; // S\n\t\t$chr[84] = '211221'; // T\n\t\t$chr[85] = '221121'; // U\n\t\t$chr[86] = '222111'; // V\n\t\t$chr[87] = '112122'; // W\n\t\t$chr[88] = '112221'; // X\n\t\t$chr[89] = '122121'; // Y\n\t\t$chr[90] = '123111'; // Z\n\t\t$chr[45] = '121131'; // -\n\t\t$chr[46] = '311112'; // .\n\t\t$chr[32] = '311211'; //\n\t\t$chr[36] = '321111'; // $\n\t\t$chr[47] = '112131'; // /\n\t\t$chr[43] = '113121'; // +\n\t\t$chr[37] = '211131'; // %\n\t\t$chr[128] = '121221'; // ($)\n\t\t$chr[129] = '311121'; // (/)\n\t\t$chr[130] = '122211'; // (+)\n\t\t$chr[131] = '312111'; // (%)\n\t\t$chr[42] = '111141'; // start-stop\n\t\t\n\t\t$code_ext = '';\n\t\t$clen = strlen($payload);\n\t\t$encode = self::$map;\n\t\tfor ($i = 0 ; $i < $clen; ++$i) {\n\t\t\t$code_ext .= $encode[ord($payload[$i])];\n\t\t}\n\t\t// checksum\n\t\t$code_ext .= $this->checksum_code93($code_ext);\n\t\t// add start and stop codes\n\t\t$payload = '*'.$code_ext.'*';\n\t\t$bars = /*. (Bar[int]) .*/ array();\n\t\t$clen = strlen($payload);\n\t\tfor ($i = 0; $i < $clen; ++$i) {\n\t\t\t$char = ord($payload[$i]);\n\t\t\tfor ($j = 0; $j < 6; ++$j) {\n\t\t\t\t$bars[] = new Bar(($j % 2) == 0, (int) $chr[$char][$j], 1, 0);\n\t\t\t}\n\t\t}\n\t\t$bars[] = new Bar(true, 1, 1, 0);\n\t\t$this->bars = $bars;\n\t}"
]
| [
"0.5961725",
"0.5769011",
"0.572008",
"0.57028186",
"0.5656862",
"0.5645145",
"0.56071687",
"0.5594111",
"0.54855645",
"0.5470218",
"0.5426138",
"0.5426138",
"0.5426138",
"0.5426138",
"0.54045355",
"0.54004407",
"0.539159",
"0.53682953",
"0.535925",
"0.5352743",
"0.5329993",
"0.53097045",
"0.5266876",
"0.52477133",
"0.5223876",
"0.5223876",
"0.5223876",
"0.5204524",
"0.5191689",
"0.5177782",
"0.5177166",
"0.51687545",
"0.5144225",
"0.51424605",
"0.5140874",
"0.51344216",
"0.51344216",
"0.5104341",
"0.510359",
"0.50903344",
"0.50892806",
"0.5085411",
"0.5060455",
"0.50593555",
"0.50334865",
"0.5030068",
"0.5023914",
"0.5016109",
"0.50021595",
"0.49959326",
"0.4989987",
"0.49881306",
"0.49767172",
"0.49591216",
"0.49448928",
"0.4928418",
"0.49213246",
"0.4913623",
"0.49057785",
"0.48978066",
"0.4893387",
"0.48885027",
"0.48770475",
"0.48601907",
"0.48482156",
"0.48482156",
"0.484602",
"0.48391446",
"0.48373288",
"0.48111123",
"0.48080152",
"0.48060405",
"0.48038357",
"0.47914648",
"0.4789264",
"0.47869197",
"0.47743875",
"0.4763625",
"0.4761492",
"0.47573575",
"0.47411537",
"0.47398856",
"0.47393918",
"0.47360727",
"0.4736063",
"0.47285715",
"0.47246605",
"0.47229588",
"0.4701567",
"0.46985677",
"0.46965185",
"0.46909764",
"0.4690811",
"0.4681969",
"0.46814382",
"0.46763855",
"0.4676367",
"0.46736115",
"0.4673242",
"0.4663229"
]
| 0.52336 | 24 |
Add action 'plugins_loaded' to instantiate main class. | function wpdb_demo_table() {
global $wpdb_table;
// activate the demo
$wpdb_table->create('table_demo', 'id mediumint(9) NOT NULL AUTO_INCREMENT,
time datetime DEFAULT "0000-00-00 00:00:00" NOT NULL,
UNIQUE KEY id (id)' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _initLoadPlugin() {\n\t\t$front = Zend_Controller_Front::getInstance();\n\t\t$front->registerPlugin(new Plugins_Myplugin() );\t\n\t}",
"public static function init()\n {\n add_action('plugins_loaded', array(self::instance(), '_setup'));\n }",
"public function initializePlugin();",
"private function setup_actions() {\n\t\tadd_option( self::OPTION_ACTIVE_PLUGINS, array() );\n\n\t\t// Loaded at priority 5 because all plugins are typically loaded before 'plugins_loaded'\n\t\tadd_action( 'plugins_loaded', array( $this, 'include_active_plugins' ), 5 );\n\n\t\tadd_action( 'init', array( $this, 'action_init' ) );\n\t}",
"public function load()\n {\n // Register initialization method.\n add_action('init', [$this, 'init'], 10, 0);\n }",
"public function bootPlugin();",
"protected function _initPlugins()\n {\n $front = Zend_Controller_Front::getInstance();\n $front->registerPlugin(new Mylib_Controller_Plugin_Auth());\n $front->registerPlugin(new Mylib_Controller_Plugin_Routes());\n }",
"public function action_init() {\n\t\t// Allow people to customize what capability is required in order to view this menu\n\t\t$this->capability = apply_filters( 'wpcom_vip_plugins_ui_capability', $this->capability );\n\n\t\t// Controls where this menu is added\n\t\t$this->parent_menu_slug = apply_filters( 'wpcom_vip_plugins_ui_parent_menu_slug', $this->parent_menu_slug );\n\n\t\t// Allows hiding of certain plugins from the UI\n\t\t$this->hidden_plugins = apply_filters( 'wpcom_vip_plugins_ui_hidden_plugins', $this->hidden_plugins );\n\n\t\tadd_action( 'admin_menu', array( $this, 'action_admin_menu_add_menu_item' ) );\n\n\t\tadd_action( 'wpcom_vip_plugins_ui_menu_page', array( $this, 'cleanup_active_plugins_option' ) );\n\n\t\tadd_action( 'admin_post_' . self::ACTION_PLUGIN_ACTIVATE, array( $this, 'action_admin_post_plugin_activate' ) );\n\t\tadd_action( 'admin_post_' . self::ACTION_PLUGIN_DEACTIVATE, array( $this, 'action_admin_post_plugin_deactivate' ) );\n\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'action_enqueue_scripts' ) );\n\t}",
"public function instantiate() {\n\n\t\trequire_once $this->plugin_dir_path . 'includes/class-genesis-simple-hooks-admin.php';\n\t\t$this->admin = new Genesis_Simple_Hooks_Admin();\n\t\t$this->admin->init();\n\n\t}",
"abstract public function register_plugin();",
"public function plugin_construction() {\t\r\n\t\r\n\t}",
"public function init_plugin()\n {\n }",
"protected function _registerPlugins()\n\t{\n\t\t//$aclPlugin = new AclPlugins($adminAclController);\n\t\t//$logPlugin = new LogPlugins();\n\t\t\n\t\t//Daophp::getInstance() -> registerPlugin('acl', $aclPlugin);\n\t\t//Daophp::getInstance() -> registerPlugin('log', $logPlugin);\n\t}",
"function __construct() {\n\t\t$request = Request::getInstance();\n\t\t$plugin = Plugin::getInstance();\n\t\t$plugin->triggerEvents('load' . $request->getController());\n\t}",
"function activator()\n{\n require_once plugin_dir_path( __FILE__ ) . 'includes/Activator.php';\n\tActivator::activate();\n}",
"function testplugin_autoloader()\n{\n\treturn new TestPlugin();\n}",
"function Doku_Event_Handler() {\n\n // load action plugins\n $plugin = NULL;\n $pluginlist = plugin_list('action');\n\n foreach ($pluginlist as $plugin_name) {\n $plugin =& plugin_load('action',$plugin_name);\n\n if ($plugin !== NULL) $plugin->register($this);\n }\n }",
"public function onPluginsInitialized()\n\t{\n\t\tif ($this->isAdmin())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->enable([\n\t\t\t'onTwigExtensions' => ['onTwigExtensions', 0]\n\t\t]);\n\t}",
"public function __construct() {\n require_once __DIR__ . '/vendor/autoload.php';\n $this->define_constants();\n register_activation_hook( __FILE__, array( $this, 'activate' ) ); \n add_action( 'plugins_loaded', array( $this, 'init_plugin' ) ); \n }",
"public function index() {\n\t\t$params = func_get_args();\n\t\t$this->_loadPlugin(...$params);\n\t}",
"public function plugins_loaded()\n\t{\n\t\t// Have the login plugin use frontend notifictions plugin\n\t\tif ( apply_filters( \"{$this->prefix}/create_object/use_sewn_notifications\", true ) )\n\t\t{\n\t\t\tif (! class_exists('Sewn_Notifications') ) {\n\t\t\t\tadd_filter( \"{$this->prefix}/create_object/use_sewn_notifications\", '__return_false', 9999 );\n\t\t\t}\n\t\t}\n\t}",
"function __construct() {\n add_action( 'plugins_loaded', array( $this, 'ssSearchPluginsLoadedHandlers' ) );\n }",
"public function admin_init () {\n $data = get_plugin_data(__FILE__);\n $this->plugin_name = $data['Name'];\n $this->plugin_version = $data['Version'];\n $this->plugin_slug = plugin_basename(__FILE__, '.php');\n $this->plugin_name_sanitized = basename(__FILE__, '.php');\n\n // init updater class to plugin updates check\n $this->updater();\n }",
"public function activatePlugin();",
"public function onLoad()\n {\n $plugins = $this->getPluginHandler();\n $plugins->getPlugin('Message');\n }",
"function Plugin()\n\t{\n\t\t$this->Plugin_Base();\n\t}",
"static public function init() {\n\n\t\tadd_action( 'plugins_loaded', __CLASS__ . '::setup_hooks' );\n\t}",
"public function init(){\n\t\tadd_action( 'admin_init', array( $this, 'init_plugin' ), 20 );\n\t}",
"public function plugins_loadedWPaction() {\n\t\tload_plugin_textdomain ( get_class ( $this ), false, dirname ( plugin_basename ( $this->application()->filename ) ) . \"/languages/\" );\n\t\twp_enqueue_style ( 'jquery-ui_smoothness', $this->application ()->pluginuri () . '/library/public/css/smoothness/jquery-ui-1.8.13.custom.css', null, $this->application ()->version () );\n\t\twp_enqueue_style ( 'v35v_style_css', $this->application ()->pluginuri () . '/library/public/css/style.css', null, $this->application ()->version () );\n\t\twp_enqueue_script ( 'v35v_script_js', $this->application ()->pluginuri () . '/library/public/js/script.js', null, $this->application ()->version () );\n\t}",
"public function plugins_loaded()\n\t{\n\t\t//If base plugin isn't active yet, warn the user\n\t\tif(!$this->base_plugin_active())\n\t\t{\n\t\t\t//If we are in the admin, let's print a warning then return\n\t\t\tif(is_admin())\n\t\t\t{\n\t\t\t\tadd_action('admin_notices', array($this, 'base_plugin_inactive_notice'));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->base_plugin_version_supported())\n\t\t{\n\t\t\t//If we are in the admin, let's print a warning then return\n\t\t\tif(is_admin())\n\t\t\t{\n\t\t\t\tadd_action('admin_notices', array($this, 'base_plugin_version_unsupported_notice'));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif(is_admin() && $this->base_plugin_active() && class_exists('mtekk_adminKit'))\n\t\t{\n\t\t\t//Check to see if someone else has setup the extensions settings tab\n\t\t\tif(has_action('bcn_after_settings_tabs', 'bcn_extensions_tab') === false)\n\t\t\t{\n\t\t\t\t//All versions prior to 6.3.0 used a different extensions tab format\n\t\t\t\tif(!defined('breadcrumb_navxt::version') || version_compare(breadcrumb_navxt::version, '6.2.60', '<'))\n\t\t\t\t{\n\t\t\t\t\trequire_once(dirname(__FILE__) . '/bcn_extensions_tab_62.php');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trequire_once(dirname(__FILE__) . '/bcn_extensions_tab.php');\n\t\t\t\t}\n\t\t\t\tadd_action('bcn_after_settings_tabs', 'bcn_extensions_tab');\n\t\t\t}\n\t\t\t$this->admin_setup();\n\t\t}\n\t}",
"private static function load_plugins()\n\t{\n\t\tstatic $loaded;\n\t\t\n\t\tif ($loaded === NULL)\n\t\t{\n\t\t\tglobal $doc;\n\t\t\t\n\t\t\t$key = $doc['page_id'];\n\t\t\t\n\t\t\t$plugins = TC::config('tc.plugins');\n\t\t\t\n\t\t\t$plugin_files = $plugins['global'];\n\t\t\t\n\t\t\tif (isset($plugins[$key]) && is_array($plugins[$key]))\n\t\t\t{\n\t\t\t\t$plugin_files = array_merge($plugin_files, $plugins[$key]);\n\t\t\t}\n\t\t\t\n\t\t\t//echo '<div style=\"padding:20px; background:#efefef;font-size:16px;color:#333;text-align:left;\"><pre>';\n\t\t\t\n\t\t\tforeach ($plugin_files as $plugin)\n\t\t\t{\n\t\t\t\t$plugin = TC_PLUGINS_PATH.'/plugins.'.$plugin.'.php';\n\t\t\t\t$plugin_basename = basename($plugin);\n\t\t\t\t\n\t\t\t\tif (file_exists($plugin))\n\t\t\t\t{\n\t\t\t\t\tinclude($plugin);\n\t\t\t\t\t\n\t\t\t\t\t$cleanup = array('plugins.', '.php', '.');\n\t\t\t\t\t$cleaned = array('', '', '_');\n\t\t\t\t\t\n\t\t\t\t\t$plugin_name = ucwords(strtolower(str_replace($cleanup, $cleaned, $plugin_basename)));\n\t\t\t\t\t$plugin_class_name = 'TC_'.$plugin_name;\n\t\t\t\t\t\n\t\t\t\t\tglobal ${$plugin_name};\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\t//$plugin_class = new ReflectionClass($plugin_class_name);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// autoload? // ${$plugin_name} = $plugin_class->newInstance();\n\t\t\t\t\t\tTC::$plugins[$plugin_name] = 1;\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* ... */\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//echo '<div style=\"padding:20px; background:#efefef;font-size:16px;color:#333;text-align:left;\"><pre>';\n\t\t\t\t\t//var_dump($plugin_name);\n\t\t\t\t\t//var_dump($plugin_class);\n\t\t\t\t\t//var_dump($contact_form);\n\t\t\t\t\t//echo '</pre></div>';\n\t\t\t\t\t\n\t\t\t\t\t//echo \"\\n\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//echo \"\\nskipped:\\n\";\n\t\t\t\t\t//var_dump(basename($plugin));\n\t\t\t\t\t//echo \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//echo '</pre></div>';\n\t\t\t\n\t\t\t$loaded = true;\n\t\t}\n\t}",
"abstract protected function activate_plugin();",
"public function __construct ()\n {\n // TODO Auto-generated Constructor\n $this->pluginLoader = new Zend_Loader_PluginLoader();\n //die('running');\n }",
"public static function run () {\n if( ! defined('ICL_SITEPRESS_VERSION') ) return;\n\n // init our plugin on the p2p_init action hook\n if(isset($_REQUEST['icl_ajx_action']) && function_exists('_p2p_init') ){\n add_action('init', array(__CLASS__, 'early_init') );\n }\n else {\n add_action('p2p_init', array(__CLASS__, 'init'), 14 );\n }\n\n // shows admin notices\n add_action('admin_notices', array(__CLASS__,'admin_notices') );\n\n }",
"public function plugin_classes() {\n\t\t$this->options = new Options( $this ) ;\n\t\t$this->helpers = new Helpers( $this );\n\t\t$this->core = new Core( $this );\n\t}",
"private function __construct() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'textdomain' ) );\n\t\tadd_action( 'plugins_loaded', array( $this, 'load_files' ) );\n\t}",
"public function onLoad() {\n\t\tglobal $app;\n\n\t\t//* Register for actions\n\t\t$app->plugins->registerAction('backup_download', $this->plugin_name, 'backup_action');\n\t\t$app->plugins->registerAction('backup_restore', $this->plugin_name, 'backup_action');\n\t\t$app->plugins->registerAction('backup_delete', $this->plugin_name, 'backup_action');\n\t\t//$app->plugins->registerAction('backup_download_mail', $this->plugin_name, 'backup_action_mail');\n\t\t$app->plugins->registerAction('backup_restore_mail', $this->plugin_name, 'backup_action_mail');\n\t\t$app->plugins->registerAction('backup_delete_mail', $this->plugin_name, 'backup_action_mail');\n\t}",
"public function main_load() {\n\t\tadd_action( 'admin_init', array( $this, 'custom_admin_init_action' ) );\n\t\tadd_action( 'add_meta_boxes', array( $this, 'add_meta_boxes_action' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'custom_admin_enqueue_scripts' ) );\n\t\tadd_action( 'pre_get_posts', array( $this, 'custom_pre_get_posts_action' ) );\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'custom_restrict_manage_posts_action' ) );\n\t\tadd_filter( 'posts_where', array( $this, 'custom_posts_where_filter' ), 10, 2 );\n\t}",
"public function __construct() {\n\n\t\t\t/* Load plugin files */\n\t\t\tself::load_plugin_files();\n\t\t}",
"public static function load_module() {\n // Register taxonomy\n add_action('init', [__CLASS__, 'register_taxonomy']);\n }",
"private function __construct() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'textdomain' ) );\n\t\tadd_action( 'plugins_loaded', array( $this, 'load_files' ) );\n\t}",
"public function __construct()\n {\n add_action('admin_menu', array($this, 'add_plugin_page'));\n add_action('admin_init', array($this, 'page_init'));\n add_filter('cron_schedules', array($this, 'filter_cron_schedules'));\n register_activation_hook(__FILE__, array($this, 'plugin_activate'));\n register_deactivation_hook(__FILE__, array($this, 'plugin_deactivate'));\n }",
"protected function load() {\n\t\tadd_action( 'tml_uninstall_recaptcha/recaptcha.php', array( $this, 'uninstall' ) );\n\n\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ) );\n\t\tadd_action( 'admin_init', array( $this, 'admin_init' ) );\n\t}",
"public function onPluginsInitialized()\n {\n if (!$this->isAdmin()) {\n return;\n }\n\n $this->enable([\n 'onAdminTwigTemplatePaths' => ['onAdminTwigTemplatePaths', 0]\n ]);\n\n $this->useShortCode();\n }",
"public function plugin_activate(){\n\t\t\n\t\t//call our custom content type function\n\t \t$this->register_location_content_type();\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}",
"public function run () {\n\t\trequire_once $this->pluginFile;\n\t}",
"function wpcom_rest_api_v2_load_plugin( $class_name ) {\n\tglobal $wpcom_rest_api_v2_plugins;\n\n\tif ( ! isset( $wpcom_rest_api_v2_plugins ) ) {\n\t\t$_GLOBALS['wpcom_rest_api_v2_plugins'] = $wpcom_rest_api_v2_plugins = array();\n\t}\n\n\tif ( ! isset( $wpcom_rest_api_v2_plugins[ $class_name ] ) ) {\n\t\t$wpcom_rest_api_v2_plugins[ $class_name ] = new $class_name;\n\t}\n}",
"public function onPluginsInitialized()\n\t{\n\t\tif ( $this->isAdmin() ) {\n\t\t\t$this->active = false;\n\t\t\treturn;\n\t\t}\n\n\t\t$this->enable([\n//\t\t\t'onTwigSiteVariables' => ['onTwigSiteVariables', 0]\n\t\t\t'onTwigPageVariables' => ['onTwigSiteVariables', 0]\n\t\t]);\n\t}",
"public function loadPlugins() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('loadPlugins', func_get_args()));\n }",
"private function _initView()\n {\n App::front()->registerPlugin(new App_Controller_Plugin_View());\n }",
"function loadPlugins() {\n\n\t\t// load and parse the plugins file ...\n\t\tif ($plugins = $this->xml_parser->parseXml('plugins.xml')) {\n\n\t\t\t// take each plugin tag ...\n\t\t\tforeach ($plugins['ASECO_PLUGINS']['PLUGIN'] as $plugin) {\n\n\t\t\t\t// showup message\n\t\t\t\t$this->console_text('[Aseco] Load plugin [' . $plugin . ']');\n\n\t\t\t\t// and include the value between ...\n\t\t\t\trequire_once('plugins/' . $plugin);\n\t\t\t}\n\t\t}\n\t}",
"public function plugin_classes() {\r\n\t\t$this->filesystem = new PDT_Filesystem( $this );\r\n\t\t$this->auth = new PDT_Auth( $this );\r\n\t\t$this->api = new PDT_Api( $this );\r\n\t\t$this->plugins = new PDT_Plugins( $this );\r\n\t\t$this->installed = new PDT_Installed( $this );\r\n\t\t$this->cases = new PDT_Cases( $this );\r\n\t\t$this->clues = new PDT_Clues( $this );\r\n\t\t$this->detective = new PDT_Detective( $this );\r\n\t}",
"static\tpublic \tfunction\tinit() {\n\t\t\t/**\n\t\t\t * Implement any processes that need to happen before the plugin is instantiated. \n\t\t\t */\n\t\t\t\n\t\t\t//Instantiate the plugin and return it. \n\t\t\treturn new self();\n\t\t}",
"protected function loadModule()\n {\n require_once 'Autoload/MyPluginAutoload.php';\n\n do_action('nautzick_load_module');\n \n MyPluginAutoload::getInstance();\n }",
"public function load()\n {\n ObserverHandler::addMHook('init_view_registered_engines', $this->getName(), 'init_view_registered_engines');\n ObserverHandler::addMHook('result_search', $this->getName(), 'result_search');\n }",
"function plugins_loaded(){\r\n\r\n\t\t$this->plugin_integration();\r\n\r\n\t\tWP_Job_Manager_Field_Editor_Job_Writepanels::get_instance();\r\n\t\tif( $this->wprm_active() ) WP_Job_Manager_Field_Editor_Resume_Writepanels::get_instance();\r\n\t}",
"public function init() {\n\t\t$this->load_actions();\n\t}",
"function mt_load_plugins($mod) {\n\n global $CONFIG;\n\n if (is_plugin_enabled($mod)) {\n if (file_exists($CONFIG->pluginspath . $mod)) {\n if (!include($CONFIG->pluginspath . $mod . \"/start.php\")) {\n // misconfigured plugin\n }\n \n// if (!$cached_view_paths) {\n if (is_dir($CONFIG->pluginspath . $mod . \"/views\")) {\n if ($handle = opendir($CONFIG->pluginspath . $mod . \"/views\")) {\n while ($viewtype = readdir($handle)) {\n if (!in_array($viewtype,array('.','..','.svn','CVS')) && is_dir($CONFIG->pluginspath . $mod . \"/views/\" . $viewtype)) {\n mt_autoregister_views(\"\",$CONFIG->pluginspath . $mod . \"/views/\" . $viewtype,$CONFIG->pluginspath . $mod . \"/views/\", $viewtype);\n }\n }\n }\n }\n// }\n }\n }\n}",
"private static function plugins()\n {\n $files = ['Plugins'];\n $folder = static::$root.'Plugins'.'/';\n\n self::call($files, $folder);\n\n $files = ['AutoloadFileNotFoundException', 'InfoStructureException'];\n $folder = static::$root.'Plugins/Exceptions'.'/';\n\n self::call($files, $folder);\n }",
"function __construct() {\n\t\tPluginUpdateIgnore::__construct();\n\t\tadd_action('admin_head-plugins.php', array(&$this, 'admin_jquery'));\n\t\tadd_action('admin_head-plugins.php', array(&$this, 'admin_css'));\n\t\tadd_action('admin_footer-plugins.php', array(&$this, 'admin_js'));\n\t}",
"function hello_yoda_load(){\n if (current_user_can('activate_plugins')){\n add_action( 'admin_head', 'vader_css' );\n add_action( 'admin_notices', 'hello_yoda' );\n } else{\n add_action( 'admin_head', 'yoda_css' );\n add_action( 'admin_notices', 'hello_yoda' );\n }\n\n }",
"public function init() {\n parent::init();\n if (!is_object($this->api)) {\n $class = $this->api;\n $this->api = new $class;\n }\n $this->loadPlugins();\n }",
"public function __construct() {\n\t\t\n\t\t$this->pluginLoader = new Zend_Loader_PluginLoader ();\n\t}",
"public function loadPlugins()\n\t{\n\t\t$this->pluginsToLoad = array_unique($this->pluginsToLoad);\n\n\t\t$pluginsToLoad = $this->pluginsToLoad;\n\n\t\tif($this->doLoadAlwaysActivatedPlugins)\n\t\t{\n\t\t\t$pluginsToLoad = array_merge($this->pluginsToLoad, $this->pluginToAlwaysEnable);\n\t\t}\n\n\t\tforeach($pluginsToLoad as $pluginName)\n\t\t{\n\t\t\t$newPlugin = $this->loadPlugin($pluginName);\n\n\t\t\t// if we have to load the plugins\n\t\t\t// and if this plugin is activated\n\t\t\tif($this->doLoadPlugins\n\t\t\t\t&& $this->isPluginEnabled($pluginName))\n\t\t\t{\n\t\t\t\t$newPlugin->registerTranslation( $this->languageToLoad );\n\t\t\t\t$this->addPluginObservers( $newPlugin );\n\t\t\t\t$this->addLoadedPlugin( $pluginName, $newPlugin);\n\n\t\t\t\t$newPlugin->postLoad();\n\t\t\t}\n\t\t}\n\t}",
"public function initSinglePlugins()\n {\n $this->collSinglePlugins = new ObjectCollection();\n $this->collSinglePluginsPartial = true;\n\n $this->collSinglePlugins->setModel('\\Plugins');\n }",
"function adminer_object() {\r\n include_once \"./plugins/plugin.php\";\r\n \r\n // autoloader\r\n foreach (glob(\"plugins/*.php\") as $filename) {\r\n include_once \"./$filename\";\r\n }\r\n \r\n $plugins = array(\r\n // specify enabled plugins here\r\n // new AdminerDumpXml,\r\n // new AdminerTinymce,\r\n // new AdminerFileUpload(\"data/\"),\r\n // new AdminerSlugify,\r\n // new AdminerTranslation,\r\n // new AdminerForeignSystem,\r\n // new AdminerLoginPasswordLess(password_hash(\"\", PASSWORD_DEFAULT)),\r\n );\r\n \r\n /* It is possible to combine customization and plugins:\r\n class AdminerCustomization extends AdminerPlugin {\r\n }\r\n return new AdminerCustomization($plugins);\r\n */\r\n class AdminerCustomization extends AdminerPlugin {\r\n function login($login, $password) {\r\n // validate user submitted credentials\r\n return true;\r\n }\r\n }\r\n return new AdminerCustomization($plugins);\r\n \r\n // return new AdminerPlugin($plugins);\r\n}",
"function bg_startPlugin(){\n add_action( 'init', 'bg_PatchEditor' );\n add_action( 'admin_init', 'bg_AddAdminSettings' );\n add_action( 'admin_menu', 'bg_AddPluginMenu' );\n}",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n $request = Craft::$app->getRequest();\n\n // Register asset bundle only for non-console site requests\n if ($request->getIsSiteRequest() && !$request->getIsConsoleRequest()) {\n $this->registerFrontendAssets();\n }\n\n // Do something after we're installed\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n }\n }\n );\n\n /**\n * Logging in Craft involves using one of the following methods:\n *\n * Craft::trace(): record a message to trace how a piece of code runs. This is mainly for development use.\n * Craft::info(): record a message that conveys some useful information.\n * Craft::warning(): record a warning message that indicates something unexpected has happened.\n * Craft::error(): record a fatal error that should be investigated as soon as possible.\n *\n * Unless `devMode` is on, only Craft::warning() & Craft::error() will log to `craft/storage/logs/web.log`\n *\n * It's recommended that you pass in the magic constant `__METHOD__` as the second parameter, which sets\n * the category to the method (prefixed with the fully qualified class name) where the constant appears.\n *\n * To enable the Yii debug toolbar, go to your user account in the AdminCP and check the\n * [] Show the debug toolbar on the front end & [] Show the debug toolbar on the Control Panel\n *\n * http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html\n */\n Craft::info(\n Craft::t('cookie-consent', '{name} plugin loaded', [\n 'name' => $this->name,\n ]),\n __METHOD__\n );\n }",
"private function define_admin_hooks()\n {\n $this->loader->add_action('init',$this,'load_options');\n $this->loader->add_action('plugins_loaded','WordPress_Reactro_Admin', 'load_framework');\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Register our CP routes\n Event::on(\n UrlManager::class,\n UrlManager::EVENT_REGISTER_CP_URL_RULES,\n function(RegisterUrlRulesEvent $event) {\n $event->rules['open-id-login'] = 'open-id-login/default/defaults';\n }\n );\n \n // Do something after we're installed\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_LOAD_PLUGINS,\n function() {\n $this->executeLogic();\n }\n );\n\n/**\n * Logging in Craft involves using one of the following methods:\n *\n * Craft::trace(): record a message to trace how a piece of code runs. This is mainly for development use.\n * Craft::info(): record a message that conveys some useful information.\n * Craft::warning(): record a warning message that indicates something unexpected has happened.\n * Craft::error(): record a fatal error that should be investigated as soon as possible.\n *\n * Unless `devMode` is on, only Craft::warning() & Craft::error() will log to `craft/storage/logs/web.log`\n *\n * It's recommended that you pass in the magic constant `__METHOD__` as the second parameter, which sets\n * the category to the method (prefixed with the fully qualified class name) where the constant appears.\n *\n * To enable the Yii debug toolbar, go to your user account in the AdminCP and check the\n * [] Show the debug toolbar on the front end & [] Show the debug toolbar on the Control Panel\n *\n * http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html\n */\n Craft::info(\n Craft::t(\n 'open-id-login',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"function loadPlugins() {\n\n\t\t// load and parse the plugins file\n\t\tif ($plugins = $this->xml_parser->parseXml('plugins.xml')) {\n\t\t\tif (!empty($plugins['XASECO2_PLUGINS']['PLUGIN'])) {\n\t\t\t\t// take each plugin tag\n\t\t\t\tforeach ($plugins['XASECO2_PLUGINS']['PLUGIN'] as $plugin) {\n\t\t\t\t\t// log plugin message\n\t\t\t\t\t$this->console_text('[XAseco2] Load plugin [' . $plugin . ']');\n\t\t\t\t\t// include the plugin\n\t\t\t\t\trequire_once('plugins/' . $plugin);\n\t\t\t\t\t$this->plugins[] = $plugin;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\ttrigger_error('Could not read/parse plugins list plugins.xml !', E_USER_ERROR);\n\t\t}\n\t}",
"private function define_public_hooks() {\n\n\t\t$plugin_public = new APS_Public( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_public, 'load_helpers' );\n\t\t$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );\n\t\t$this->loader->add_filter( 'woocommerce_locate_template', $plugin_public, 'woocommerce_override_template', 1, 3 );\n\t}",
"public function __construct() {\r\n add_action( 'plugins_loaded', [ $this, 'update_db_check' ] );\r\n \r\n }",
"function bbboing_plugin_loaded() {\r\n add_action( \"init\", \"bbboing_init\" );\r\n add_action( \"oik_loaded\", \"bbboing_oik_loaded\" );\r\n add_action( \"oik_add_shortcodes\", \"bbboing_oik_add_shortcodes\" );\r\n add_action( \"admin_notices\", \"bbboing_activation\" );\r\n}",
"public function init() {\n\t\tadd_filter( 'plugin_action_links_meta-box/meta-box.php', [ $this, 'plugin_links' ], 20 );\n\n\t\t// Add a shared top-level admin menu and Dashboard page. Use priority 5 to show Dashboard at the top.\n\t\tadd_action( 'admin_menu', [ $this, 'add_menu' ], 5 );\n\t\tadd_action( 'admin_menu', [ $this, 'add_submenu' ], 5 );\n\n\t\t// If no admin menu, then hide the About page.\n\t\tadd_action( 'admin_head', [ $this, 'hide_page' ] );\n\n\t\t// Redirect to about page after activation.\n\t\tadd_action( 'activated_plugin', [ $this, 'redirect' ], 10, 2 );\n\t}",
"public function onPluginsInitialized()\n {\n if ($this->isAdmin()) {\n // For speed-up when the admin plugin is active\n $this->active = false;\n } else {\n if ($this->config->get('plugins.googlemaps.enabled')) {\n // if the plugin is active globally, subscribe to additional events\n $this->enable([\n 'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0],\n 'onPageInitialized' => ['onPageInitialized', 0]\n ]);\n }\n }\n }",
"public function loadPlugins()\n {\n try {\n $pluginModel = Plugin::model(); \n $records = $pluginModel->findAllByAttributes(array('active'=>1));\n \n foreach ($records as $record) {\n $this->loadPlugin($record->name, $record->id);\n }\n } catch (Exception $exc) {\n // Something went wrong, maybe no database was present so we load no plugins\n }\n\n $this->dispatchEvent(new PluginEvent('afterPluginLoad', $this)); // Alow plugins to do stuff after all plugins are loaded\n }",
"public static function loadPlugins(){\n\n\t\t// check to make sure the plugins directory exists\n\t\tif( !self::_pluginsDirectoryExists() )\n\t\t\treturn;\n\n\t\t// scan the directory, searching for plugins that fit the stereotype\n\t\tself::_scanForPlugins();\n\t}",
"public function onPluginsInitialized()\n {\n if ($this->isAdmin()) {\n $this->active = false;\n return;\n }\n\n /** @var Uri $uri */\n $uri = $this->grav['uri'];\n $route = $this->config->get('plugins.random.route');\n\n if ($route && $route == $uri->path()) {\n $this->enable([\n 'onPageInitialized' => ['onPageInitialized', 0]\n ]);\n }\n }",
"private function __construct() {\n\t\t$plugin = Tribe__Events__Main::instance();\n\n\t\tadd_action( 'admin_menu', array( $this, 'register_menu_item' ) );\n\t\tadd_action( 'current_screen', array( $this, 'action_request' ) );\n\t\tadd_action( 'init', array( $this, 'init' ) );\n\n\t\t// check if the license is valid each time the page is accessed\n\t\tadd_action( 'tribe_aggregator_page_request', array( $this, 'check_for_license_updates' ) );\n\n\t\t// filter the plupload default settings to remove mime type restrictions\n\t\tadd_filter( 'plupload_default_settings', array( $this, 'filter_plupload_default_settings' ) );\n\n\t\t// Setup Tabs Instance\n\t\t$this->tabs = Tribe__Events__Aggregator__Tabs::instance();\n\n\t\ttribe_notice( 'tribe-aggregator-legacy-import-plugins-active', array( $this, 'notice_legacy_plugins' ), 'type=warning' );\n\t}",
"public function load()\n {\n if (is_admin()) {\n add_action('admin_menu', array($this, 'addMenus'), 100);\n }\n }",
"function __construct(){\n //Actions\n add_action('init', array($this, 'init'), 1);\n \n }",
"public function __construct() {\n\t\t// TODO Auto-generated Constructor\n\t\t$this->pluginLoader = new Zend_Loader_PluginLoader ();\n\t\t\n\t}",
"public function __construct()\n {\n \tglobal $psp;\n\n \t$this->the_plugin = $psp;\n\t\t\t$this->module_folder = $this->the_plugin->cfg['paths']['plugin_dir_url'] . 'modules/remote_support/';\n\t\t\t$this->module = $this->the_plugin->cfg['modules']['remote_support'];\n\n\t\t\tif (is_admin()) {\n\t add_action('admin_menu', array( &$this, 'adminMenu' ));\n\t\t\t}\n\n\t\t\t// load the ajax helper\n\t\t\trequire_once( $this->the_plugin->cfg['paths']['plugin_dir_path'] . 'modules/remote_support/ajax.php' );\n\t\t\tnew pspRemoteSupportAjax( $this->the_plugin );\n }",
"final public function load() {\n $this->childLoad();\n \\add_action('admin_menu', [$this, 'addAdminMenuEntries']);\n }",
"protected function preRun()\n {\n if (@class_exists('Plugin_PreRun') &&\n in_array('Iface_PreRun', class_implements('Plugin_PreRun'))) {\n $preRun = new Plugin_PreRun();\n $preRun->process();\n }\n }",
"public function initialize() {\n\n // callback to run after theme is loaded\n add_action(\"init\", function() {\n $this->addServiceProvider( FractalProvider::class );\n $this->addServiceProvider( RouterProvider::class );\n });\n\n\n /**\n * This causes the plugin's routes to kick in only if WordPress experiences a 404\n */\n add_action(\"wp\", function() {\n\n if( is_404() )\n $this->dispatch();\n\n });\n\n // code to run when admin is loaded\n add_action(\"admin_init\", function() {\n $this->addServiceProvider( PlatesProvider::class );\n });\n\n //\n add_action(\"admin_menu\", function() {\n\n new SettingsPage($this);\n\n });\n }",
"private function initializePlugins() {\r\n if (isset($this->settings[\"loadJsPlugins\"])) {\r\n if (count($this->settings[\"loadJsPlugins\"])) {\r\n foreach ($this->settings[\"loadJsPlugins\"] as $pluginName) {\r\n $this->addPlugin($pluginName);\r\n }\r\n }\r\n }\r\n unset($this->settings[\"loadJsPlugins\"]);\r\n }",
"protected function init() {\n // Provides info to parent class, so do it early.\n if (is_admin() ) {\n $this->pluginAdmin = new Yfp_Ganalytics_Basic_Admin(__FILE__);\n }\n else {\n $this->pluginCommon = new Yfp_Ganalytics_Basic_Common();\n\n // Don't track if we aren't enabled.\n if ($this->pluginCommon->optIsEnabled()) {\n // The location of the code depends on the inHead option.\n add_action(\n $this->pluginCommon->optInHead() ? self::TOP_HOOK : self::BOTTOM_HOOK,\n array($this, 'insert_js_code')\n );\n }\n else {\n // Add a comment so we can tell the plugin is functioning, but disabled.\n add_action(\n $this->pluginCommon->optInHead() ? self::TOP_HOOK : self::BOTTOM_HOOK,\n array($this, 'disabled_message')\n );\n }\n }\n }",
"public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}",
"function load_jnews_plugin_activation() {\n\t\trequire_once get_parent_theme_file_path( 'tgm/class-jnews-plugin-activation.php' );\n\t\trequire_once get_parent_theme_file_path( 'tgm/class-tgm-plugin-activation.php' );\n\n\t\t$GLOBALS['jnews_tgmpa'] = JNews_Plugin_Activation::get_instance();\n\t}",
"function __construct(){\n //\"Constants\" setup\n $this->plugin_url = plugin_dir_url(__FILE__).'/';\n $this->plugin_path = plugin_dir_path(__FILE__).'/';\n //Initialize the options\n $this->get_options();\n //check requirements\n register_activation_hook(__FILE__, array(&$this,'check_requirements'));\n //get sub-packages\n requireDir(plugin_dir_path(__FILE__).'/lib/inc');\n //here are some examples to get started with\n if(class_exists('PageTemplater')){\n add_action( 'plugins_loaded', array( 'PageTemplater', 'get_instance' ) );\n }\n if(class_exists('MSDSimpleSectionedPage')){\n add_action('admin_print_footer_scripts',array('MSDSimpleSectionedPage','info_footer_hook') ,100); \n add_action('admin_enqueue_scripts',array('MSDSimpleSectionedPage','enqueue_admin')); \n }\n if(class_exists('MSDSectionedPage')){\n add_action('admin_print_footer_scripts',array('MSDSectionedPage','info_footer_hook') ,100); \n add_action('admin_enqueue_scripts',array('MSDSectionedPage','enqueue_admin')); \n add_action( 'init', array( 'MSDSectionedPage', 'add_metaboxes' ) );\n }\n }",
"function init_hooks() {\n\tregister_activation_hook( __FILE__, __NAMESPACE__ . '\\activate_plugin' );\n\tregister_deactivation_hook( __FILE__, __NAMESPACE__ . '\\deactivate_plugin' );\n\tregister_uninstall_hook( __FILE__, __NAMESPACE__ . '\\uninstall_plugin' );\n}",
"private function hooks() {\n\t\t\t// check for EDD when plugin is activated\n\t\t\tadd_action( 'admin_init', array( $this, 'activation' ), 1 );\n\t\t\t\n\t\t\t// plugin meta\n\t\t\tadd_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 );\n\n\t\t\t// settings link on plugin page\n\t\t\tadd_filter( 'plugin_action_links_' . $this->basename, array( $this, 'settings_link' ), 10, 2 );\n\t\t\t\n\t\t\t// insert actions\n\t\t\tdo_action( 'edd_sd_setup_actions' );\n\t\t}",
"public function __construct()\n {\n\n add_action('plugins_loaded', array($this, 'load_textdomain'));\n\n }",
"function __construct(){\n\t\t\t// if ( is_plugin_active( 'advanced-custom-fields-pro/acf.php' ) ) {\n //plugin is activated\n// }\n\t\t\tif(class_exists('acf')){\n\t\t\t\tadd_action( 'plugins_loaded', array( &$this, 'constants'), \t1);\n\t\t\t\tadd_action( 'plugins_loaded', array( &$this, 'required'), \t2);\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\tadd_action( 'admin_notices', array( &$this, 'acfpro_missing_notice' ) );\n\t\t\t}\n\t\t\t\n\n\t\t}",
"public function init() {\n // Check if Elementor installed and activated\n if ( ! did_action( 'elementor/loaded' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_missing_main_plugin' ) );\n return;\n }\n\n // Check for required Elementor version\n if ( ! version_compare( ELEMENTOR_VERSION, MINIMUM_ELEMENTOR_VERSION, '>=' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_minimum_elementor_version' ) );\n return;\n }\n\n // Check for required PHP version\n if ( version_compare( PHP_VERSION, MINIMUM_PHP_VERSION, '<' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_minimum_php_version' ) );\n return;\n }\n\n // Once we get here, We have passed all validation checks so we can safely include our plugin\n require_once( 'plugin.php' );\n }",
"function __construct() {\n\n // Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively.\n register_activation_hook( __FILE__, array( $this, 'activate' ) );\n \n // MOVE uninstall feature to uninstall.php\n //register_uninstall_hook( __FILE__, array( $this, 'uninstall' ) );\n\n // Register hook executes just before WordPress determines which template page to load\n //add_action( 'template_redirect', array( $this, 'increase_counter_when_home_visited' ) );\n \n // Add extra submenu to the admin panel\n add_action( 'admin_menu', array( $this, 'create_menu_admin_panel' ) );\n \n // Handle POST request, admin_action_($action)\n //add_action( 'admin_action_tk_slideshow_action', array( $this, 'tk_slideshow_admin_action' ) );\n\n add_action( 'admin_post_tk_slideshow_new_action', array( $this, 'tk_slideshow_admin_new_action' ) );\n add_action( 'admin_post_tk_slideshow_edit_action', array( $this, 'tk_slideshow_admin_edit_action' ) );\n \n }",
"public function init() { \n // Check if Elementor installed and activated\n if ( ! did_action( 'elementor/loaded' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_missing_main_plugin' ) );\n return;\n }\n \n // Check for required Elementor version\n if ( ! version_compare( ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_minimum_elementor_version' ) );\n return;\n }\n \n // Check for required PHP version\n if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_minimum_php_version' ) );\n return;\n }\n \n add_action( 'elementor/elements/categories_registered', 'add_elementor_widget_categories' );\n\n // Once we get here, We have passed all validation checks so we can safely include our plugin\n // require_once( __DIR__ . '/handlers/UtterancesHandler.php' );\n // require_once( __DIR__ . '/handlers/ResponsesHandler.php' );\n // require_once( __DIR__ . '/handlers/WidgetHandler.php' );\n\n Init::register_handlers([\n Handlers\\ResponsesHandler,\n ]);\n // $this->register_handlers( __DIR__ . '/handlers/');\n\n require_once( 'plugin.php' );\n }",
"public function loadPlugins()\n\t{\n\t\tif (!$this->_pluginsLoaded && !$this->_loadingPlugins)\n\t\t{\n\t\t\tif (craft()->isInstalled())\n\t\t\t{\n\t\t\t\t// Prevent this function from getting called twice.\n\t\t\t\t$this->_loadingPlugins = true;\n\n\t\t\t\t// Find all of the enabled plugins\n\t\t\t\t// TODO: swap the SELECT statements after next breakpoint\n\t\t\t\t$rows = craft()->db->createCommand()\n\t\t\t\t\t//->select('id, class, version, schemaVersion, settings, installDate')\n\t\t\t\t\t->select('*')\n\t\t\t\t\t->from('plugins')\n\t\t\t\t\t->where('enabled=1')\n\t\t\t\t\t->queryAll();\n\n\t\t\t\t$names = array();\n\n\t\t\t\tforeach ($rows as $row)\n\t\t\t\t{\n\t\t\t\t\t$plugin = $this->_getPlugin($row['class']);\n\n\t\t\t\t\tif ($plugin)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_autoloadPluginClasses($plugin);\n\n\t\t\t\t\t\t// Clean it up a bit\n\t\t\t\t\t\t$row['settings'] = JsonHelper::decode($row['settings']);\n\t\t\t\t\t\t$row['installDate'] = DateTime::createFromString($row['installDate']);\n\n\t\t\t\t\t\t$this->_enabledPluginInfo[$row['class']] = $row;\n\n\t\t\t\t\t\t$lcPluginHandle = mb_strtolower($plugin->getClassHandle());\n\t\t\t\t\t\t$this->_plugins[$lcPluginHandle] = $plugin;\n\t\t\t\t\t\t$this->_enabledPlugins[$lcPluginHandle] = $plugin;\n\t\t\t\t\t\t$names[] = $plugin->getName();\n\n\t\t\t\t\t\t$plugin->setSettings($row['settings']);\n\n\t\t\t\t\t\t$plugin->isInstalled = true;\n\t\t\t\t\t\t$plugin->isEnabled = true;\n\n\t\t\t\t\t\t// If we're not updating, check if the plugin's version number changed, but not its schema version.\n\t\t\t\t\t\tif (!craft()->isInMaintenanceMode() && $this->hasPluginVersionNumberChanged($plugin) && !$this->doesPluginRequireDatabaseUpdate($plugin))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Update our record of the plugin's version number\n\t\t\t\t\t\t\tcraft()->db->createCommand()->update(\n\t\t\t\t\t\t\t\t'plugins',\n\t\t\t\t\t\t\t\tarray('version' => $plugin->getVersion()),\n\t\t\t\t\t\t\t\t'id = :id',\n\t\t\t\t\t\t\t\tarray(':id' => $row['id'])\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\n\t\t\t\t// Sort plugins by name\n\t\t\t\t$this->_sortPlugins($names, $this->_enabledPlugins);\n\n\t\t\t\t// Now that all of the components have been imported, initialize all the plugins\n\t\t\t\tforeach ($this->_enabledPlugins as $plugin)\n\t\t\t\t{\n\t\t\t\t\t$plugin->init();\n\t\t\t\t}\n\n\t\t\t\t$this->_loadingPlugins = false;\n\t\t\t}\n\n\t\t\t$this->_pluginsLoaded = true;\n\n\t\t\t// Fire an 'onLoadPlugins' event\n\t\t\t$this->onLoadPlugins(new Event($this));\n\t\t}\n\t}",
"private function init_hooks() {\n\t\t\tadd_action( 'init', array( $this, 'init' ), 0 );\n\t\t\tregister_activation_hook( __FILE__, array( $this, 'activate' ) );\n\n\t\t\t// Plugin update notifications\n\t\t\tadd_action( 'admin_init', array( $this, 'plugin_update' ) );\n\t\t}"
]
| [
"0.6988967",
"0.6867921",
"0.6820224",
"0.67735267",
"0.67594945",
"0.6627784",
"0.65019065",
"0.64966214",
"0.6425329",
"0.64099854",
"0.6404265",
"0.64031833",
"0.63772523",
"0.63423973",
"0.63204527",
"0.63198894",
"0.63135135",
"0.6277083",
"0.6272205",
"0.626528",
"0.623039",
"0.62289256",
"0.6227126",
"0.6223412",
"0.62232286",
"0.6220307",
"0.62148124",
"0.62121075",
"0.6209429",
"0.61777943",
"0.61775607",
"0.61631393",
"0.6127755",
"0.6125072",
"0.61048764",
"0.6099169",
"0.60951185",
"0.6089778",
"0.60752296",
"0.6072405",
"0.60691315",
"0.60685754",
"0.60615706",
"0.6060217",
"0.6060144",
"0.6034374",
"0.6031817",
"0.6029137",
"0.60066974",
"0.6000527",
"0.59967613",
"0.5985928",
"0.5979647",
"0.59736055",
"0.59681785",
"0.5961102",
"0.59543955",
"0.5951715",
"0.5950683",
"0.5943993",
"0.5937526",
"0.5937504",
"0.5905836",
"0.59042776",
"0.5897196",
"0.5896674",
"0.5896265",
"0.58768815",
"0.5869801",
"0.58657134",
"0.5860746",
"0.5858745",
"0.5858125",
"0.58578354",
"0.5855438",
"0.5843658",
"0.58389246",
"0.58359987",
"0.582003",
"0.5819148",
"0.58190066",
"0.58187324",
"0.5813252",
"0.5807398",
"0.58050084",
"0.5800718",
"0.57957155",
"0.57952154",
"0.5791556",
"0.5783569",
"0.5782121",
"0.577967",
"0.5776598",
"0.57760584",
"0.5764722",
"0.5750258",
"0.5749465",
"0.57431734",
"0.5734155",
"0.57214963",
"0.5716577"
]
| 0.0 | -1 |
Methode magique pour initialiser ma BDD | public function __construct() {
$this->db = database::getInstance();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test___construct() {\n\t\t}",
"public function test___construct() {\n\t\t}",
"public function testInit()\n {\n\n }",
"protected function setUp() {\r\n $this->object = new ValidaDados;\r\n }",
"protected function _initTest(){\n }",
"protected function setUp()\n {\n $this->object = new sejour(1, 'Classe de mer', 170, '2016-05-02', 10);\n }",
"protected function setUp() {\r\n $this->object = new Candidato('03592075101');\r\n }",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp(): void\n {\n // O parametro 'true' é passado para o constructor da classe Validator para informar que é o PHPUnit que esta sendo executado\n // Isso serve para que a funcion que valida blacklist não faça uma requisição á API, pois o PHPUnit não permite requisições externas\n $this->_validator = new Validator(true);\n $this->_data_send = new DataSend();\n }",
"public function setUp()\n {\n $this->amount = 500;\n $this->currency = 'RUB';\n $this->sector = 222;\n $this->password = 'qwprc1';\n $this->id = 400;\n\n parent::setUp();\n }",
"public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }",
"protected function setUp() {\n\t$this->object = new Competition(20);\n\t$this->assertNotNull($this->object);\n }",
"public function setUp()\n {\n $this->object = new BudgetRepository;\n parent::setUp();\n }"
]
| [
"0.7454006",
"0.7454006",
"0.7392696",
"0.73190594",
"0.73007923",
"0.7269789",
"0.71912056",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.71394503",
"0.7139265",
"0.7139265",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.71391195",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.7138269",
"0.71121",
"0.7098664",
"0.7073858",
"0.7064547",
"0.7035449"
]
| 0.0 | -1 |
Run the database seeds. | public function run()
{
$mul_rows= [
[
'name' => 'Admin',
'email' => 'admin@gmail.com',
'password' => Hash::make('adminpass'),
'profile' => 'profile.jpeg',
'type' => '0',
'phone' => '09977123456',
'address' => 'Yangon',
'dob' => '1997/07/22',
'create_user_id' => '1',
'updated_user_id' => '1',
],
[
'name' => 'User',
'email' => 'user@gmail.com',
'password' => Hash::make('userpass'),
'profile' => 'profile.jpeg',
'type' => '1',
'phone' => '09977123489',
'address' => 'Yangon',
'dob' => '1996/05/21',
'create_user_id' => '1',
'updated_user_id' => '1',
]
];
foreach ($mul_rows as $rows) {
$insert= DB::table('users')->insert($rows);
}
} | {
"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 |
this file is now split into seperate files dictionary that stores DB settings | function getDBsettings () {
return array (
'DBserver' => "localhost",
'DBname' => "wideworldimporters",
'DBport' => 3306,
'DBuser' => "wwi",
'DBpass' => ''
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function &db_config()\n {\n static $database;\n if ( file_exists(APPPATH.'config/database.php') ) \n {\n require_once APPPATH.'config/database.php';\n\n if ( isset($database) ) \n {\n foreach( $database as $key => $val ) \n {\n $database[$key] = $val;\n }\n return $database;\n }\n }\n }",
"private function getCrendentials()\n {\n $db = parse_ini_file('db.ini');\n $this->username = $db['user'];\n $this->password = $db['password'];\n $this->host = $db['host'];\n $this->dbname = $db['dbname'];\n }",
"function spi_collect_db_settings() {\n\n\t# Source DB Settings\n\t# ------------------------------------------------------------------\n\n\t$source = get_option('spi-dbase');\n\tif(empty($source)) {\n\n\t\t# Source DB Connection Settings\n\n\t\t$source->dbname\t\t\t= '';\n\t\t$source->dbhost\t\t\t= '';\n\t\t$source->dbuser\t\t\t= '';\n\t\t$source->dbpass\t\t\t= '';\n\t\t$source->dbbasepfix\t\t= '';\n\t\t$source->dbuserpfix\t\t= '';\n\t\t$source->dbpassoption\t= 1;\n\t\t$source->utf8encode\t= 0;\n\t}\n\n\t# Misc definitions\n\t# ------------------------------------------------------------------\n\n\t$def = get_option('spi-def');\n\n\t\t$def->user_batch\t= 100;\n\t\t$def->required\t\t= 'dbname,dbuser,dbpass,dbhost,dbbasepfix,dbpassoption';\n\t\t$def->wp_tags\t\t= false;\n\t\t$def->parse_bbcode\t= true;\n\n\tupdate_option('spi-def', $def);\n\n\t# Table/Data mapping\n\t# ------------------------------------------------------------------\n\n\t$map = get_option('spi-map');\n\n\t\t# USERS Table Mappings\n\n\t\t$map['tables']->users\t\t\t\t= true;\n\t\t\t$map['users']->table\t\t\t= 'user';\n\t\t\t$map['users']->select\t\t\t= '';\n\t\t\t$map['users']->where\t\t\t= '';\n\t\t\t$map['users']->ID\t\t\t\t= 'userid';\n\t\t\t$map['users']->user_login\t\t= 'username';\n\t\t\t$map['users']->user_pass\t\t= 'password';\n\t\t\t$map['users']->user_nicename\t= 'username';\n\t\t\t$map['users']->user_email\t\t= 'email';\n\t\t\t$map['users']->user_url\t\t\t= 'homepage';\n\t\t\t$map['users']->user_registered\t= '#timestamp:joindate';\n\t\t\t$map['users']->display_name\t\t= 'username';\n\n\t\t# SFGROUPS Table Mappings\n\n\t\t$map['tables']->sfgroups\t\t\t= true;\n\t\t\t$map['sfgroups']->table\t\t\t= 'forum';\n\t\t\t$map['sfgroups']->select\t\t= 'SELECT * FROM <%dbname%>.<%dbbasepfix%>forum WHERE parentid = -1 ORDER BY forumid';\n\t\t\t\t\t\t\t\t\t\t\t\t# Need a SELECT since vBulletin groups are denoted with a -1\n\t\t\t\t\t\t\t\t\t\t\t\t# in the parentid field in the forum table.\n\t\t\t$map['sfgroups']->where\t\t\t= 'WHERE parentid = -1';\n\t\t\t$map['sfgroups']->group_id\t\t= 'forumid';\n\t\t\t$map['sfgroups']->group_name\t= 'title_clean';\n\t\t\t$map['sfgroups']->group_desc\t= 'description_clean';\n\t\t\t$map['sfgroups']->group_seq\t\t= 'displayorder';\n\n\t\t# SFFORUMS Table Mappings\n\n\t\t$map['tables']->sfforums\t\t\t= true;\n\t\t\t$map['sfforums']->table\t\t\t= 'forum';\n\t\t\t$map['sfforums']->select\t\t= 'SELECT * FROM <%dbname%>.<%dbbasepfix%>forum WHERE parentid <> -1 ORDER BY forumid';\n\t\t\t\t\t\t\t\t\t\t\t\t# Need a SELECT to get all the forums that are not a group.\n\t\t\t$map['sfforums']->where\t\t\t= 'WHERE parentid <> -1';\n\t\t\t$map['sfforums']->forum_id\t\t= 'forumid';\n\t\t\t$map['sfforums']->forum_name \t= 'title_clean';\n\t\t\t$map['sfforums']->group_id \t\t= 'parentid';\n\t\t\t$map['sfforums']->forum_seq \t= 'displayorder';\n\t\t\t$map['sfforums']->forum_desc \t= 'description_clean';\n\t\t\t$map['sfforums']->forum_slug \t= 'title_clean';\n\n\t\t# SFTOPICS Table Mappings\n\n\t\t$map['tables']->sftopics\t\t\t= true;\n\t\t\t$map['sftopics']->table\t\t\t= 'thread';\n\t\t\t$map['sftopics']->select\t\t= 'SELECT threadid, title, dateline, NOT(open) AS open, forumid, postuserid, sticky, views, lastpostid\n\t\t\t\t\t\t\t\t\t\t\t\tFROM <%dbname%>.<%dbbasepfix%>thread WHERE forumid = <%forum_id%> ORDER BY threadid';\n\t\t\t\t\t\t\t\t\t\t\t\t# Need SELECT since the vBulletin 'open' column is 1=open, 0=closed,\n\t\t\t\t\t\t\t\t\t\t\t\t# but SP 'topic_status' is 1=close, 0=open.\n\t\t\t$map['sftopics']->topic_id\t\t= 'threadid';\n\t\t\t$map['sftopics']->topic_name\t= 'title';\n\t\t\t$map['sftopics']->topic_date\t= '#timestamp:dateline';\n\t\t\t$map['sftopics']->topic_status\t= 'open';\n\t\t\t$map['sftopics']->forum_id\t\t= 'forumid';\n\t\t\t$map['sftopics']->user_id\t\t= 'postuserid';\n\t\t\t$map['sftopics']->topic_pinned\t= 'sticky';\n\t\t\t$map['sftopics']->topic_opened\t= 'views';\n\t\t\t$map['sftopics']->topic_slug\t= 'title';\n\t\t\t$map['sftopics']->post_id\t\t= 'lastpostid';\n\n\t\t# SFPOSTS Table Mappings\n\n\t\t$map['tables']->sfposts\t\t\t\t= true;\n\t\t\t$map['sfposts']->table\t\t\t= 'post';\n\t\t\t$map['sfposts']->select\t\t\t= '';\n\t\t\t$map['sfposts']->post_id\t\t= 'postid';\n\t\t\t$map['sfposts']->topic_id\t\t= 'threadid';\n\t\t\t$map['sfposts']->forum_id\t\t= '#query:SELECT forumid FROM <%dbname%>.<%dbuserpfix%>thread WHERE threadid = <%topic_id%>';\n\t\t\t$map['sfposts']->post_content \t= 'pagetext';\n\t\t\t$map['sfposts']->post_date\t\t= '#timestamp:dateline';\n\t\t\t$map['sfposts']->user_id\t\t= 'userid';\n\t\t\t$map['sfposts']->post_index\t\t= '#default:0';\n\t\t\t$map['sfposts']->poster_ip\t\t= 'ipaddress';\n\n\t\t# USERMETA Table Mappings\n\n\t\t$map['tables']->usermeta\t\t\t= false; # Needs improvement. May not be working.\n\t\t\t$map['usermeta']->nickname\t\t= '#query:SELECT username FROM <%dbname%>.<%dbuserpfix%>user WHERE userid = <%user_id%>';\n\t\t\t$map['usermeta']->description\t= '#query:SELECT field1 FROM <%dbname%>.<%dbuserpfix%>userfield WHERE userid = <%user_id%>';\n\t\t\t$map['usermeta']->aim\t\t\t= '#query:SELECT aim FROM <%dbname%>.<%dbuserpfix%>user WHERE userid = <%user_id%>';\n\t\t\t$map['usermeta']->yim\t\t\t= '#query:SELECT yahoo FROM <%dbname%>.<%dbuserpfix%>user WHERE userid = <%user_id%>';\n\n\n\tupdate_option('spi-map', $map);\n\n\t# ------------------------------------------------------------------\n\t# Form: vBulletin\n\t# ------------------------------------------------------------------\n\n\t$required = explode(',', $def->required);\n\t$bullet = '<img src=\"'.SPI_URL.'importers/logos/bullet.png\" alr=\"\" />';\n\t$icon = '<td>'.$bullet.'</td>';\n\t$noicon = '<td></td>';\n\n\t?>\n\t<div id=\"spiForm\" class=\"spiMainPanel\">\n\t<h3>Before you start...</h3>\n\t<p>In vBulletin, the sub forums are structured differently in the database than how Simple:Press is structured.\n\t If a vBulletin sub forum is imported using the Simple:Press Importing tool, they will not show up in the Simple:Press forum or\n\t admin panel because this difference makes it difficult to handle sub forums.</p>\n\t<p>In order to work around the issue, one of two things can be done. The easiest thing to do is change the sub forums in vBulletin\n\t to normal forums before the import, then change them back to sub forums in Simple:Press after.\n\t The other slightly more technical solution is to modify the WordPress database after the import if nothing has been changed beforehand.\n\t This requires going into the sfforums table of the WordPress database and editing any sub forum's group_id to the appropriate group\n\t (usually the same group_id as its parent).</p>\n\t<p>During the import, sub forums will inherit the forum_id of its parent instead of a legitimate group_id - which is why they do not show\n\t up in the forum or the Simple:Press admin panel. After editing the table, the sub forums should show up as normal forums and can\n\t be changed back to sub forums in the Simple:Press admin panel.</p>\n\n\n\t<h3>Source Forum Data: vBulletin</h3>\n\t<h4>To perform the import we require access to the source vBulletin database. Please supply the following:</h4>\n\t<form name=\"vBulletin2spimport\" method=\"post\" action=\"<?php echo(admin_url()); ?>admin.php?page=sp-import/admin/spimport-setup.php&sys=vbulletin\">\n\n\t\t<input type=\"hidden\" id=\"s2\" name=\"s2\" value=\"s2\" />\n\t\t<input type=\"hidden\" id=\"selectsource\" name=\"selectsource\" value=\"vbulletin.php\"\n\n\t\t<p><b><?php echo($bullet); ?> Required Data</b></p>\n\n\t\t<table id=\"sourcedata\" class=\"form-table\">\n\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\"><label for=\"dbname\">vBulletin Database Name:</label></th>\n\t\t\t\t<?php if(in_array('dbname', $required)) {echo $icon;} else {echo $noicon;} ?>\n\t\t\t\t<td><input type=\"text\" class=\"regular-text\" id=\"dbname\" name=\"dbname\" value=\"<?php echo($source->dbname); ?>\" /></td>\n\t\t\t</tr>\n\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\"><label for=\"dbuser\">vBulletin Database User Name:</label></th>\n\t\t\t\t<?php if(in_array('dbuser', $required)) {echo $icon;} else {echo $noicon;} ?>\n\t\t\t\t<td><input type=\"text\" class=\"regular-text\" id=\"dbuser\" name=\"dbuser\" value=\"<?php echo($source->dbuser); ?>\" /></td>\n\t\t\t</tr>\n\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\"><label for=\"dbpass\">vBulletin Database Password:</label></th>\n\t\t\t\t<?php if(in_array('dbpass', $required)) {echo $icon;} else {echo $noicon;} ?>\n\t\t\t\t<td><input type=\"text\" class=\"regular-text\" id=\"dbpass\" name=\"dbpass\" value=\"<?php echo($source->dbpass); ?>\" /></td>\n\t\t\t</tr>\n\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\"><label for=\"dbhost\">vBulletin Database Host:</label></th>\n\t\t\t\t<?php if(in_array('dbhost', $required)) {echo $icon;} else {echo $noicon;} ?>\n\t\t\t\t<td><input type=\"text\" class=\"regular-text\" id=\"dbhost\" name=\"dbhost\" value=\"<?php echo($source->dbhost); ?>\" /></td>\n\t\t\t</tr>\n\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\"><label for=\"dbbasepfix\">vBulletin Table Prefix:</label></th>\n\t\t\t\t<?php if(in_array('dbbasepfix', $required)) {echo $icon;} else {echo $noicon;} ?>\n\t\t\t\t<td><input type=\"text\" class=\"regular-text\" id=\"dbbasepfix\" name=\"dbbasepfix\" value=\"<?php echo($source->dbbasepfix); ?>\" /></td>\n\t\t\t</tr>\n\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\"><label for=\"dbpassoption\">Password Options:</label></th>\n\t\t\t\t<?php if(in_array('dbpassoption', $required)) {echo $icon;} else {echo $noicon;} ?>\n\t\t\t\t<td>\n\n\t\t\t\t\t<input type=\"radio\" name=\"dbpassoption\" id=\"copy\" value=\"copy\" />\n\t\t\t\t\t<label for=\"copy\"> <b>Copy source passwords from user records</b></label><br />\n\n\t\t\t\t\t<input type=\"radio\" name=\"dbpassoption\" id=\"create\" value=\"create\" />\n\t\t\t\t\t<label for=\"create\"> <b>Let WordPress create random passwords</b></label><br />\n\n\t\t\t\t\t<input type=\"radio\" name=\"dbpassoption\" id=\"ulogin\" value=\"ulogin\" />\n\t\t\t\t\t<label for=\"ulogin\"> <b>Create passwords from login name</b></label><br />\n\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\"><label for=\"utf8encode\">UTF-8 encode results</label></th>\n\t\t\t\t<td>\n\n\t\t\t\t\t<input type=\"checkbox\" name=\"utf8encode\" id=\"utf8encode\" />\n\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t</table><br />\n\n\t\t<div style=\"clear: both\"></div>\n\n\t\t<input type=\"submit\" class=\"button-primary\" id=\"sbutton\" name=\"goimport\" value=\"Perform Import\" />\n\n\t</form>\n\t<br /><br />\n\t<p>Many thanks to Logan Gold at <a href='http://www.flexsim.com'>Flexsim Software Products, Inc.</a> for this vBulletin Import Script</p>\n\n\t</div>\n\t<?php\n}",
"private function action_databaseSettings()\n\t{\n\t\tglobal $txt, $databases, $incontext, $db_type, $db_connection, $modSettings, $db_server, $db_name, $db_user, $db_passwd;\n\n\t\t$incontext['sub_template'] = 'database_settings';\n\t\t$incontext['page_title'] = $txt['db_settings'];\n\t\t$incontext['continue'] = 1;\n\n\t\t// Set up the defaults.\n\t\t$incontext['db']['server'] = 'localhost';\n\t\t$incontext['db']['port'] = '';\n\t\t$incontext['db']['user'] = '';\n\t\t$incontext['db']['name'] = '';\n\t\t$incontext['db']['pass'] = '';\n\t\t$incontext['db']['type'] = '';\n\t\t$incontext['supported_databases'] = array();\n\n\t\t$foundOne = false;\n\t\tforeach ($databases as $key => $db)\n\t\t{\n\t\t\t// Override with the defaults for this DB if appropriate.\n\t\t\tif ($db['supported'])\n\t\t\t{\n\t\t\t\t$incontext['supported_databases'][$key] = $db;\n\n\t\t\t\tif (!$foundOne)\n\t\t\t\t{\n\t\t\t\t\tif (isset($db['default_host']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$default_host = ini_get($db['default_host']);\n\t\t\t\t\t\t$incontext['db']['server'] = !empty($default_host) ? $default_host : 'localhost';\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($db['default_user']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$incontext['db']['user'] = ini_get($db['default_user']);\n\t\t\t\t\t\t$incontext['db']['name'] = ini_get($db['default_user']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($db['default_password']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$incontext['db']['pass'] = ini_get($db['default_password']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($db['default_port']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$db_port = ini_get($db['default_port']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$incontext['db']['type'] = $key;\n\t\t\t\t\t$foundOne = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Override for repost.\n\t\tif (isset($_POST['db_user']))\n\t\t{\n\t\t\t$incontext['db']['user'] = $_POST['db_user'];\n\t\t\t$incontext['db']['name'] = $_POST['db_name'];\n\t\t\t$incontext['db']['server'] = $_POST['db_server'];\n\t\t\t$incontext['db']['port'] = !empty($_POST['db_port']) ? $_POST['db_port'] : '';\n\t\t\t$incontext['db']['prefix'] = $_POST['db_prefix'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$incontext['db']['prefix'] = 'elkarte_';\n\t\t}\n\n\t\t// Are we submitting?\n\t\tif (isset($_POST['db_type']))\n\t\t{\n\t\t\tif (isset($_POST['db_filename']))\n\t\t\t{\n\t\t\t\t// You better enter enter a database name for SQLite.\n\t\t\t\tif (trim($_POST['db_filename']) == '')\n\t\t\t\t{\n\t\t\t\t\t$incontext['error'] = $txt['error_db_filename'];\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Duplicate name in the same dir? Can't do that with SQLite. Weird things happen.\n\t\t\t\tif (file_exists($_POST['db_filename'] . (substr($_POST['db_filename'], -3) != '.db' ? '.db' : '')))\n\t\t\t\t{\n\t\t\t\t\t$incontext['error'] = $txt['error_db_filename_exists'];\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// What type are they trying?\n\t\t\t$db_type = preg_replace('~[^A-Za-z0-9]~', '', $_POST['db_type']);\n\t\t\t$db_prefix = $_POST['db_prefix'];\n\n\t\t\t// Validate the prefix.\n\t\t\t$valid_prefix = $databases[$db_type]['validate_prefix']($db_prefix);\n\t\t\tif ($valid_prefix !== true)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $valid_prefix;\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Take care of these variables...\n\t\t\t$vars = array(\n\t\t\t\t'db_type' => $db_type,\n\t\t\t\t'db_name' => $_POST['db_name'],\n\t\t\t\t'db_user' => $_POST['db_user'],\n\t\t\t\t'db_passwd' => $_POST['db_passwd'] ?? '',\n\t\t\t\t'db_server' => $_POST['db_server'],\n\t\t\t\t'db_port' => !empty($_POST['db_port']) ? $_POST['db_port'] : '',\n\t\t\t\t'db_prefix' => $db_prefix,\n\t\t\t\t// The cookiename is special; we want it to be the same if it ever needs to be reinstalled with the same info.\n\t\t\t\t'cookiename' => 'ElkArteCookie' . abs(crc32($_POST['db_name'] . preg_replace('~[^A-Za-z0-9_$]~', '', $_POST['db_prefix'])) % 1000),\n\t\t\t);\n\n\t\t\t// God I hope it saved!\n\t\t\tif (!updateSettingsFile($vars))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['settings_error'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Make sure it works.\n\t\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\n\t\t\tif (!defined('SOURCEDIR'))\n\t\t\t{\n\t\t\t\tdefine('SOURCEDIR', TMP_BOARDDIR . '/sources');\n\t\t\t}\n\n\t\t\trequire_once(EXTDIR . '/ClassLoader.php');\n\n\t\t\t$loader = new \\ElkArte\\ext\\Composer\\Autoload\\ClassLoader();\n\t\t\t$loader->setPsr4('ElkArte\\\\', SOURCEDIR . '/ElkArte');\n\t\t\t$loader->setPsr4('BBC\\\\', SOURCEDIR . '/ElkArte/BBC');\n\t\t\t$loader->register();\n\t\t\trequire_once(TMP_BOARDDIR . '/install/DatabaseCode.php');\n\n\t\t\t$type = strtolower($db_type);\n\t\t\t$type = $type === 'mysql' ? 'mysqli' : $type;\n\t\t\t$class = '\\\\ElkArte\\\\Database\\\\' . ucfirst($type) . '\\\\Connection';\n\n\t\t\t// Better find the database file!\n\t\t\tif (!class_exists($class))\n\t\t\t{\n\t\t\t\t$incontext['error'] = sprintf($txt['error_db_file'], $class . '\\\\Connection.php');\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Now include it for database functions!\n\t\t\tdefine('ELK', 1);\n\t\t\t$modSettings['disableQueryCheck'] = true;\n\n\t\t\trequire_once(SOURCEDIR . '/database/Database.subs.php');\n\n\t\t\t// Attempt a connection.\n\t\t\t$db = test_db_connection();\n\n\t\t\t// No dice? Let's try adding the prefix they specified, just in case they misread the instructions ;)\n\t\t\tif ($db === null || $db === false)\n\t\t\t{\n\t\t\t\t$db_user = $_POST['db_prefix'] . $db_user;\n\t\t\t\t$db = test_db_connection(true);\n\t\t\t\tif ($db !== null && $db !== false)\n\t\t\t\t{\n\t\t\t\t\t$db_user = $_POST['db_prefix'] . $db_user;\n\t\t\t\t\tupdateSettingsFile(array('db_user' => $db_user));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Still no connection? Big fat error message :P.\n\t\t\tif (empty($db))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_db_connect'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// @todo This global $db_connection is currently required bu the upgrade code,\n\t\t\t// of course it would be much better if gone and passed as argument\n\t\t\t// it was possible to remove it.\n\t\t\t$db_connection = $db->connection();\n\t\t\t// Do they meet the install requirements?\n\t\t\t// @todo Old client, new server?\n\t\t\tif (!db_version_check($db))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_db_too_low'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Let's try that database on for size... assuming we haven't already lost the opportunity.\n\t\t\tif ($db_name != '')\n\t\t\t{\n\t\t\t\t$db->skip_next_error();\n\t\t\t\t$db->query('', \"\n\t\t\t\t\tCREATE DATABASE IF NOT EXISTS `$db_name`\",\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'security_override' => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// Okay, let's try the prefix if it didn't work...\n\t\t\t\tif (!$db->select_db($db_name) && $db_name != '')\n\t\t\t\t{\n\t\t\t\t\t$db->skip_next_error();\n\t\t\t\t\t$db->query('', \"\n\t\t\t\t\t\tCREATE DATABASE IF NOT EXISTS `$_POST[db_prefix]$db_name`\",\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'security_override' => true,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\tif ($db->select_db($_POST['db_prefix'] . $db_name))\n\t\t\t\t\t{\n\t\t\t\t\t\t$db_name = $_POST['db_prefix'] . $db_name;\n\t\t\t\t\t\tupdateSettingsFile(array('db_name' => $db_name));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Okay, now let's try to connect...\n\t\t\t\tif (!$db->select_db($db_name))\n\t\t\t\t{\n\t\t\t\t\t$incontext['error'] = sprintf($txt['error_db_database'], $db_name);\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$db_connection = load_database();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function loadSettings() {}",
"protected function loadSettings() {}",
"protected function loadSettings() {}",
"abstract protected function loadSettings();",
"protected function _readDbConfig()\n {\n $this->_host = Config::DB_HOST;\n $this->_user = Config::DB_USER;\n $this->_password = Config::DB_PASS;\n $this->_dbName = Config::DB_NAME;\n }",
"public static function getDatabaseSettings()\n\t\t{\n\t\t\t$aSettings['db_prefix'] = 'wp_';\n\t\t\t$sConfigData = self::getConfigData();\n\n\t\t\tif(!empty($sConfigData))\n\t\t\t{\n\t\t\t\t$aSettings['db_host'] = parcelcheckout_getFileValue($sConfigData, '/define\\(\\'DB_HOST\\', \\'([^\\']+)\\'\\);/');\n\t\t\t\t$aSettings['db_user'] = parcelcheckout_getFileValue($sConfigData, '/define\\(\\'DB_USER\\', \\'([^\\']+)\\'\\);/');\n\t\t\t\t$aSettings['db_pass'] = parcelcheckout_getFileValue($sConfigData, '/define\\(\\'DB_PASSWORD\\', \\'([^\\']+)\\'\\);/');\n\t\t\t\t$aSettings['db_name'] = parcelcheckout_getFileValue($sConfigData, '/define\\(\\'DB_NAME\\', \\'([^\\']+)\\'\\);/');\n\t\t\t\t$aSettings['db_prefix'] = parcelcheckout_getFileValue($sConfigData, '/\\$table_prefix ? = \\'([^\\']+)\\';/');\n\t\t\t\t$aSettings['db_type'] = (version_compare(PHP_VERSION, '5.3', '>') ? 'mysqli' : 'mysql');\n\t\t\t}\n\n\t\t\treturn $aSettings;\n\t\t}",
"private function load_settings() {\n\t\t\n\t}",
"private function set_up_connection(){\n $string = file_get_contents('/../../settings.json', true);\n //Create json iterator\n $jsonIterator = new RecursiveIteratorIterator(new RecursiveArrayIterator(json_decode($string, TRUE)), RecursiveIteratorIterator::SELF_FIRST);\n //Read iterator for each key found\n foreach($jsonIterator as $key => $val ) {\n if(is_array($val)) {\n //to-do as we find new arrays\n $this->db = $key;\n }else{\n //to-do as we find final values\n if($key == \"name\"){\n $this->dbname = $val;\n }else if($key == \"user\"){\n $this->user = $val;\n }else if($key == \"pass\"){\n $this->pass = $val;\n }else{\n $this->server = $val;\n }\n }\n }\n }",
"public static function load_db_conf(){\n $db_config = include(CONFIGPATH.'db.conf.php');\n return $db_config;\n }",
"public function loadDBProperties()\n\t{\n\t\t$xml = simplexml_load_file(self::DB_PROPERTIES);\n\t\t$this->hostname = (string)$xml->hostname;\n\t\t$this->username = (string)$xml->username;\n\t\t$this->password = (string)$xml->password;\n\t\t$this->database = (string)$xml->database;\n\t}",
"public function setDatabaseConfig()\n {\n $this->_databaseConfig = Core_Model_Config_Json::getModulesDatabaseConfig();\n\n $this->_type = $this->_databaseConfig['type'];\n $this->_host = $this->_databaseConfig['host'];\n $this->_name = $this->_databaseConfig['name'];\n $this->_user = $this->_databaseConfig['user'];\n $this->_pass = $this->_databaseConfig['pass'];\n }",
"function get_settings()\n {\n #global $pdo, $db_settings;\n #$database = Database::getInstance();\n $result = Database::$content->query(\"SELECT name, value FROM \".Database::$db_settings['settings_table']);\n while($line = $result->fetch())\n {\n $settings[$line['name']] = $line['value'];\n }\n return $settings;\n }",
"function loadIniFiles()\n {\n \n $ff = HTML_FlexyFramework::get();\n $ff->generateDataobjectsCache(true);\n $this->dburl = parse_url($ff->database);\n \n \n $dbini = 'ini_'. basename($this->dburl['path']);\n \n \n $iniCache = isset( $ff->PDO_DataObject) ? $ff->PDO_DataObject['schema_location'] : $ff->DB_DataObject[$dbini];\n if (!file_exists($iniCache)) {\n return;\n }\n \n $this->schema = parse_ini_file($iniCache, true);\n $this->links = parse_ini_file(preg_replace('/\\.ini$/', '.links.ini', $iniCache), true);\n \n\n \n }",
"private static function getConf(){\n if(!self::$conf){\n self::$conf = require('db.conf.php');\n }\n\n return self::$conf;\n }",
"private function setup_db_variables() {\n\t\tglobal $wpdb;\n\t\t$this::$dbtable = $wpdb->prefix . self::DBTABLE;\n\t\t$this::$dbtable_contexts = $wpdb->prefix . self::DBTABLE_CONTEXTS;\n\n\t\t/**\n\t\t * Filter db table used for simple history events\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table\n\t\t */\n\t\t$this::$dbtable = apply_filters( 'simple_history/db_table', $this::$dbtable );\n\n\t\t/**\n\t\t * Filter table name for contexts.\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table_contexts\n\t\t */\n\t\t$this::$dbtable_contexts = apply_filters(\n\t\t\t'simple_history/logger_db_table_contexts',\n\t\t\t$this::$dbtable_contexts\n\t\t);\n\t}",
"function loadDBSettings($reportError = true){\r\n\t\t// the database variables as constants. As an added benefit\r\n\t\t// it adds the phpBMS root as an included path.\r\n\r\n\r\n\t\t//need to look for settings file... only go up a total of 10 directories\r\n\t\t$currdirectory = getcwd();\r\n\r\n\t\t//Prep the setting of the application path;\r\n\t\t$currentURL = explode(\"/\",$_SERVER[\"PHP_SELF\"]);\r\n\t\tarray_pop($currentURL);\r\n\r\n\t\t$count = 0;\r\n\t\t$path = \"\";\r\n\r\n\t\t//We need to find the applications root\r\n\t\twhile(!file_exists(\"phpbmsversion.php\") && $count < 9){\r\n\r\n\t\t\t$path.=\"../\";\r\n\t\t\t@ chdir(\"../\");\r\n\t\t\t$count++;\r\n\r\n\t\t}//end while\r\n\r\n\t\t//Now set the Web location (APP_PATH)\r\n\t\t$appPath = \"/\";\r\n\t\tfor($i = 0; $i < count($currentURL) - $count; $i++)\r\n\t\t\tif($currentURL[$i])\r\n\t\t\t\t$appPath .= $currentURL[$i].\"/\";\r\n\r\n\t\tdefine(\"APP_PATH\", $appPath);\r\n\r\n\t\t$settingsfile = @ fopen(\"settings.php\",\"r\");\r\n\r\n\t\tif($settingsfile){\r\n\r\n\t\t\t//loop through the settings file and load variables into the session\r\n\t\t\twhile( !feof($settingsfile)) {\r\n\r\n\t\t\t\t$line = NULL;\r\n\t\t\t\t$key = NULL;\r\n\t\t\t\t$value = NULL;\r\n\t\t\t\t$line = @ fscanf($settingsfile,\"%[^=]=%[^[]]\",$key,$value);\r\n\r\n\t\t\t\tif ($line){\r\n\r\n\t\t\t\t\t$key=trim($key);\r\n\t\t\t\t\t$value=trim($value);\r\n\r\n\t\t\t\t\tif($key!=\"\" and !strpos($key,\"]\")){\r\n\r\n\t\t\t\t\t\t$startpos=strpos($value,\"\\\"\");\r\n\t\t\t\t\t\t$endpos=strrpos($value,\"\\\"\");\r\n\r\n\t\t\t\t\t\tif($endpos!=false)\r\n\t\t\t\t\t\t\t$value=substr($value,$startpos+1,$endpos-$startpos-1);\r\n\r\n\t\t\t\t\t\tif(strpos($key,\"mysqli_\")===0)\r\n\t\t\t\t\t\t\tdefine(strtoupper($key),$value);\r\n\r\n\t\t\t\t\t}//endif key\r\n\r\n\t\t\t\t}//endif line\r\n\r\n\t\t\t}//endwhile\r\n\r\n\t\t\t@ fclose($settingsfile);\r\n\r\n\t\t\t//For legacy installations where pconnect is not set\r\n\t\t\tif(!defined(\"MYSQLI_PCONNECT\"))\r\n\t\t\t\tdefine(\"MYSQLI_CONNECT\",true);\r\n\r\n\t\t\t//this adds the phpbms root to the include path\r\n\t\t\tif ( !defined( \"PATH_SEPARATOR\" ) ) {\r\n\r\n\t\t\t\t//if we cannot determin the OS, we will assume its unix\r\n\t\t\t\tif(!isset($_ENV[\"OS\"]))\r\n\t\t\t\t\t$_ENV[\"OS\"] = \"unix\";\r\n\r\n\t\t\t\tif ( strpos( $_ENV[\"OS\"], \"Win\" ) !== false )\r\n\t\t\t\t\tdefine( \"PATH_SEPARATOR\", \";\" );\r\n\t\t\t\telse\r\n\t\t\t\t\tdefine( \"PATH_SEPARATOR\", \":\" );\r\n\r\n\t\t\t}//end if\r\n\r\n\t\t\t$pathToAdd = @ getcwd();\r\n\r\n\t\t\t//Now we include the root application path to php's include path\r\n\t\t\tif(ini_set(\"include_path\", ini_get(\"include_path\").PATH_SEPARATOR.$pathToAdd) === false && $reportError)\r\n\t\t\t\t$error = new appError(-310, \"Your implementation of PHP does not allow changing of the include path. You may need to modify your PHP settings to allow phpBMS to modify this php ini setting. If you are using a web hosting company, you may need to contact them to allow this.\", \"Cannot add to include path\", true, true, false);\r\n\r\n\r\n\t\t\t//return directory to current directory\r\n\t\t\t@ chdir ($currdirectory);\r\n\r\n\t\t\treturn $path;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tif($reportError)\r\n\t\t\t\t$error = new appError(-300,\"\",\"\",true,true,false);\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}//endif settingsfile\r\n\r\n\t}",
"private function _loadGlobalSettings(){\r\n\r\n $settings = ROOT.DS.'site'.DS.'content'.DS.'global_settings.json';\r\n\r\n if(file_exists($settings)){\r\n $this->globalSettings = json_decode(file_get_contents($settings));\r\n } else {\r\n $globalSettings = new stdClass();\r\n $globalSettings->website_name = '';\r\n $globalSettings->global_script = '';\r\n file_put_contents($settings, json_encode($globalSettings));\r\n }\r\n\r\n }",
"public function prepareCfg() {\n if($result = DB::get()->query(\"SELECT * FROM `config` WHERE `sid` = '\" . $this->sid . \"'\")) {\n $row = $result->fetch_assoc();\n $result->close();\n\n $file = PATH . '/serverdata/server' . $this->sid . '.cfg';\n if(!file_exists($file)) {\n touch($file);\n chmod($file, 0777);\n }\n file_put_contents($file, $row['cfg']);\n\n $file = PATH . '/serverdata/mapcycle' . $this->sid . '.txt';\n if(!file_exists($file)) {\n touch($file);\n chmod($file, 0777);\n }\n file_put_contents($file, $row['mapcycle']);\n }\n }",
"function _write_config_file($values){\n $db_server = $values['db_server'] ?: \"\";\n $db_name = $values['db_name'] ?: \"\";\n $db_user = $values['db_user'] ?: \"\";\n $db_password = $values['db_password'] ?: \"\";\n $mynautique_enabled = (isset($values['mynautique_enabled']) && $values['mynautique_enabled'] == TRUE) ? \"TRUE\" : \"FALSE\";\n $mynautique_user = isset($values['mynautique_user']) && $mynautique_enabled == \"TRUE\" ? $values['mynautique_user'] : \"\";\n $mynautique_password = isset($values['mynautique_password']) && $mynautique_enabled == \"TRUE\" ? $values['mynautique_password'] : \"\";\n\n // write configuration file (only after schema is applied)// build the configuration for the configuration file\n $config_string = '<?php'.\"\\n\";\n $config_string .= '// Database Configuration'.\"\\n\";\n $config_string .= '//==================================================='.\"\\n\";\n $config_string .= '// database server'.\"\\n\";\n $config_string .= '$config[\\'db_server\\'] = \"'. $db_server .'\";'.\"\\n\";\n $config_string .= '// database'.\"\\n\";\n $config_string .= '$config[\\'db_name\\'] = \"'. $db_name .'\";'.\"\\n\";\n $config_string .= '// database user'.\"\\n\";\n $config_string .= '$config[\\'db_user\\'] = \"'. $db_user .'\";'.\"\\n\";\n $config_string .= '// database user password'.\"\\n\";\n $config_string .= '$config[\\'db_password\\'] = \"'. $db_password .'\";'.\"\\n\";\n $config_string .= \"\\n\";\n\n if ( isset($values['mynautique_enabled'])) {\n $config_string .= '// MyNautique Configuration'.\"\\n\";\n $config_string .= '//==================================================='.\"\\n\";\n $config_string .= '// myNautique enabled'.\"\\n\";\n $config_string .= '$config[\\'mynautique_enabled\\'] = '.$mynautique_enabled .';'.\"\\n\";\n $config_string .= '// myNautique user'.\"\\n\";\n $config_string .= '$config[\\'mynautique_user\\'] = \"'. $mynautique_user .'\";'.\"\\n\";\n $config_string .= '// myNautique password'.\"\\n\";\n $config_string .= '$config[\\'mynautique_password\\'] = \"'. $mynautique_password .'\";'.\"\\n\";\n }\n\n $config_string .= '?>'.\"\\n\";\n\n $bytes_written = file_put_contents (\"../config/config.php\", $config_string);\n\n if($bytes_written == FALSE) {\n return $bytes_written;\n }\n return TRUE;\n }",
"function DB_manager (){\n //parse configuration file\n $ini_array = parse_ini_file($this->configuration_file_path);\n $db_host = $ini_array['db_host'];\n $db_name = $ini_array['db_name'];\n $db_user = $ini_array['db_user'];\n $db_password = $ini_array['db_password'];\n\n //make a connection\n $mysqli = new mysqli($db_host, $db_user , $db_password, $db_name);\n if (mysqli_connect_errno()) {\n printf(\"Connect failed: %s\\n\", mysqli_connect_error());\n exit();\n }\n\n $this->db = $mysqli;\n }",
"protected function importDatabaseData() {}",
"public static function load_db_config() {\n\t\tif (Config::instance()->db_config)\n\t\t\treturn Config::instance()->db_config;\n\n\t\t$db_config = parse_ini_file(HALFMOON_ROOT . \"/config/db.ini\", true);\n\n\t\t/* set some reasonable defaults */\n\t\t$ar_config = array();\n\t\tforeach ($db_config as $henv => $db) {\n\t\t\tif ($db[\"adapter\"] == \"sqlite\")\n\t\t\t\t$ar_config[$henv] = $db;\n\t\t\telse\n\t\t\t\t$ar_config[$henv] = array_merge(array(\n\t\t\t\t\t\"adapter\" => \"mysql\",\n\t\t\t\t\t\"username\" => \"username\",\n\t\t\t\t\t\"password\" => \"password\",\n\t\t\t\t\t\"hostname\" => \"localhost\",\n\t\t\t\t\t\"database\" => \"database\",\n\t\t\t\t\t\"socket\" => \"\",\n\t\t\t\t\t\"port\" => 3306,\n\t\t\t\t), $db);\n\t\t}\n\n\t\treturn Config::instance()->db_config = $ar_config;\n\t}",
"function DBConfiguraion()\n\t{\n\t\tglobal $dbhost,$dbmain,$dbuser,$dbpwd;//these variables comes from \"mainconfig.php\" which is in www folder\n\t\t//print\"$dbmain,$dbuser,$dbpwd\";\n\t\t//initialize the database_server\n\t\t$this->database_server = $dbhost;\n\t\t//initialize the database_password \n\t\t$this->database_password = $dbpwd;\n\t\t//initialize the database_user \n\t\t$this->database_user = $dbuser;\n\t\t//initialize the database_name \n\t\t$this->database_name = $dbmain;\n\t}",
"private static function readConfig()\n {\n $handler = self::getHandler();\n if (null == $handler->arrConfigGlobal && null == $handler->arrConfigLocal && null == $handler->arrConfigSecure) {\n include dirname(__FILE__) . '/../../config/default.php';\n\n $handler->arrConfigLocal = $APPCONFIG;\n\n $db = Base_Database::getConnection();\n try {\n // This is just for things like API keys, password salts etc.\n // If we have, at a later point, a function to export the database\n // en masse, then we can encrypt all the output from the secureconfig\n // table. It shouldn't overide the global or local config settings\n $sql = \"SELECT * FROM secureconfig\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigSecure = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n\n // This is just the regular global configuration settings.\n $sql = \"SELECT * FROM config\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigGlobal = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n foreach ($handler->arrConfigGlobal as $key => $value) {\n $handler->arrConfig[$key] = array('isLocal' => false, 'isOverriden' => false, 'value' => $value[0]);\n }\n \n // This is the configuration settings local to this individual machine.\n foreach ($handler->arrConfigLocal as $key => $value) {\n if (isset($handler->arrConfig[$key])) {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => true, 'value' => $value);\n } else {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => false, 'value' => $value);\n }\n }\n } catch(Exception $e) {\n error_log($e);\n die();\n }\n }\n }",
"private function loadConfig(){\n $DB = DB::pass();\n $conf = $DB->loadConfig();\n if ( count($conf) > 0 ){\n foreach($conf as $c){\n $this->config->set($c['cluster'] . \".\" . $c['name'],$c['value']);\n }\n } else {\n throw new SystemException(\"No database configuration\");\n }\n }",
"public function read() : void\n {\n $ilDB = $this->db;\n\n $query = \"SELECT * FROM crn_sts_mtr_settings\";\n $result = $ilDB->query($query);\n\n while ($row = $ilDB->fetchAssoc($result)) {\n $this->setting[$row[\"keyword\"]] = $row[\"value\"];\n }\n }",
"public function run()\n {\n DB::table(\"settings\")->truncate();\n\n DB::table(\"settings\")->insert( [\n\t\t'id'=>1,\n\t\t'key'=>'site.title',\n\t\t'display_name'=>'網站標題',\n\t\t'value'=>'永元宮',\n\t\t'details'=>'',\n\t\t'type'=>'text',\n\t\t'order'=>1,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>2,\n\t\t'key'=>'site.description',\n\t\t'display_name'=>'網站描述',\n\t\t'value'=>'永元宮網站描述',\n\t\t'details'=>'',\n\t\t'type'=>'text',\n\t\t'order'=>2,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>3,\n\t\t'key'=>'site.logo',\n\t\t'display_name'=>'網站 Logo',\n\t\t'value'=>'settings/March2019/6joE44NpBzGQni7RCvyb.png',\n\t\t'details'=>'',\n\t\t'type'=>'image',\n\t\t'order'=>3,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>4,\n\t\t'key'=>'site.google_analytics_tracking_id',\n\t\t'display_name'=>'Google Analytics Tracking ID',\n\t\t'value'=>NULL,\n\t\t'details'=>'',\n\t\t'type'=>'text',\n\t\t'order'=>14,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>5,\n\t\t'key'=>'admin.bg_image',\n\t\t'display_name'=>'後台背景圖像',\n\t\t'value'=>'',\n\t\t'details'=>'',\n\t\t'type'=>'image',\n\t\t'order'=>5,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>6,\n\t\t'key'=>'admin.title',\n\t\t'display_name'=>'Admin 標題',\n\t\t'value'=>'Voyager',\n\t\t'details'=>'',\n\t\t'type'=>'text',\n\t\t'order'=>1,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>7,\n\t\t'key'=>'admin.description',\n\t\t'display_name'=>'後台描述',\n\t\t'value'=>'歡迎使用 Voyager - 不可錯過的 Laravel 後台管理框架',\n\t\t'details'=>'',\n\t\t'type'=>'text',\n\t\t'order'=>2,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>8,\n\t\t'key'=>'admin.loader',\n\t\t'display_name'=>'Admin Loader',\n\t\t'value'=>'',\n\t\t'details'=>'',\n\t\t'type'=>'image',\n\t\t'order'=>3,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>9,\n\t\t'key'=>'admin.icon_image',\n\t\t'display_name'=>'後台圖標',\n\t\t'value'=>'settings/March2019/LJBjXMbC7Igt3RQwwI8K.png',\n\t\t'details'=>'',\n\t\t'type'=>'image',\n\t\t'order'=>4,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>10,\n\t\t'key'=>'admin.google_analytics_client_id',\n\t\t'display_name'=>'Google Analytics Client ID (於後台控制面板使用)',\n\t\t'value'=>NULL,\n\t\t'details'=>'',\n\t\t'type'=>'text',\n\t\t'order'=>1,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>11,\n\t\t'key'=>'admin.isSendNotify',\n\t\t'display_name'=>'當收到聯絡表單是否發送通知給管理員',\n\t\t'value'=>'false',\n\t\t'details'=>'{\"default\":\"true\", \"options\":{ \"true\":\"開啟\", \"false\":\"關閉\" }}',\n\t\t'type'=>'select_dropdown',\n\t\t'order'=>8,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>13,\n\t\t'key'=>'admin.isRealPath',\n\t\t'display_name'=>'下載連結是否採用真實的副檔名',\n\t\t'value'=>'true',\n\t\t'details'=>'{ \"default\":\"true\", \"options\":{ \"true\":\"開啟\", \"false\":\"關閉\" }}',\n\t\t'type'=>'select_dropdown',\n\t\t'order'=>7,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>14,\n\t\t'key'=>'admin.isShowBigPic',\n\t\t'display_name'=>'點圖片是否顯示大圖',\n\t\t'value'=>'true',\n\t\t'details'=>'{ \"default\":\"true\", \"options\":{ \"true\":\"開啟\", \"false\":\"關閉\" }}',\n\t\t'type'=>'select_dropdown',\n\t\t'order'=>6,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>15,\n\t\t'key'=>'admin.isUseComment',\n\t\t'display_name'=>'文章是否使用留言模組',\n\t\t'value'=>'false',\n\t\t'details'=>'{ \"default\":\"true\", \"options\":{ \"true\":\"開啟\", \"false\":\"關閉\" }}',\n\t\t'type'=>'select_dropdown',\n\t\t'order'=>9,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>16,\n\t\t'key'=>'admin.isUseShop',\n\t\t'display_name'=>'是否使用商店模組',\n\t\t'value'=>'false',\n\t\t'details'=>'{ \"default\":\"true\", \"options\":{ \"true\":\"開啟\", \"false\":\"關閉\" }}',\n\t\t'type'=>'select_dropdown',\n\t\t'order'=>10,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>18,\n\t\t'key'=>'admin.isVideoUpload',\n\t\t'display_name'=>'是否開放影片自動上傳功能',\n\t\t'value'=>'false',\n\t\t'details'=>'{ \"default\":\"true\", \"options\":{ \"true\":\"開啟\", \"false\":\"關閉\" }}',\n\t\t'type'=>'select_dropdown',\n\t\t'order'=>11,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>19,\n\t\t'key'=>'admin.articlesQty',\n\t\t'display_name'=>'文章列表頁一次呈現數量',\n\t\t'value'=>'16',\n\t\t'details'=>'{ \"default\":\"5\"}',\n\t\t'type'=>'text',\n\t\t'order'=>12,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>20,\n\t\t'key'=>'site.phone',\n\t\t'display_name'=>'電話',\n\t\t'value'=>'(04)2639-3625',\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>15,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>21,\n\t\t'key'=>'site.mobile',\n\t\t'display_name'=>'手機號碼',\n\t\t'value'=>NULL,\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>18,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>23,\n\t\t'key'=>'admin.admin_mail',\n\t\t'display_name'=>'管理員郵箱',\n\t\t'value'=>NULL,\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>16,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>24,\n\t\t'key'=>'site.lineAt',\n\t\t'display_name'=>'官方Line帳號',\n\t\t'value'=>NULL,\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>20,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>25,\n\t\t'key'=>'site.weChat',\n\t\t'display_name'=>'WeChat帳號',\n\t\t'value'=>NULL,\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>37,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>26,\n\t\t'key'=>'site.fb_id',\n\t\t'display_name'=>'FB ID',\n\t\t'value'=>NULL,\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>38,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>27,\n\t\t'key'=>'site.address',\n\t\t'display_name'=>'服務所在地址',\n\t\t'value'=>'435台中市台中市梧棲區中央路一段99-8號',\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>39,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>28,\n\t\t'key'=>'constant.services',\n\t\t'display_name'=>'聯絡單所提供服務選項',\n\t\t'value'=>'{ \"activity\":\"廟宇活動\" , \"service\":\"廟宇服務\" , \"others\":\"其他事項\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>21,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>29,\n\t\t'key'=>'constant.sources',\n\t\t'display_name'=>'流量來源選項',\n\t\t'value'=>'{ \"recommend\" : \"親友推薦\" , \"fb\" : \"Facebook介紹\" , \"google\" : \"Google查詢\" , \"post\" : \"海報看板\" , \"others\" : \"其他\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>22,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>30,\n\t\t'key'=>'constant.pages',\n\t\t'display_name'=>'網頁頁面',\n\t\t'value'=>'{ \"all\" : \"全部\", \"home\" : \"首頁\" , \"about\" : \"關於我們\" , \"contact\" : \"聯絡我們\", \"news\" : \"最新消息\", \"qna\" : \"常見問題\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>23,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>31,\n\t\t'key'=>'constant.element_modes',\n\t\t'display_name'=>'元素模式',\n\t\t'value'=>'{ \"txt\" : \"文字段落\" , \"iconTxt\" : \"Icon文字\" , \"imgText\" : \"圖文\", \"imgBtn\" : \"圖片按鈕\" , \"action\" : \"行動請求\" , \"richTxt\" : \"多媒體連結\" , \"slider\" : \"廣告牆\", \"qna\" : \"Q & A\" , \"iSwitch\" : \"資訊切換\" , \"price\" : \"價目\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>24,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>32,\n\t\t'key'=>'constant.lang',\n\t\t'display_name'=>'語系',\n\t\t'value'=>'{ \"zh_TW\" : \"中文\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>25,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>33,\n\t\t'key'=>'constant.titlePoses',\n\t\t'display_name'=>'Slider Title位置',\n\t\t'value'=>'{ \"botLeft\" : \"底部左側\" , \"botRight\" : \"底部右側\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>26,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>34,\n\t\t'key'=>'constant.media_types',\n\t\t'display_name'=>'媒體類型',\n\t\t'value'=>'{ \"image\" : \"大圖展示\", \"video\" : \"影片\", \"iframe\" : \"網頁\" , \"gallery-item\" :\"藝廊\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>27,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>35,\n\t\t'key'=>'constant.article_modes',\n\t\t'display_name'=>'文章模式',\n\t\t'value'=>'{ \"singleImg\" : \"單張圖片\", \"multiImgs\" : \"多張圖片\" , \"puzzle\" : \"拼貼圖片\" , \"film\" : \"影片\", \"sentense\" : \"短句\", \"quote\" : \"格言\" , \"link\":\"連結\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>28,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>36,\n\t\t'key'=>'constant.order_statuses',\n\t\t'display_name'=>'訂單狀態',\n\t\t'value'=>'{ \"create\" : \"訂單成立\", \"prepare\" : \"備貨中\" , \"finish\" : \"訂單完成\" , \"cancel\" : \"訂單取消\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>29,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>37,\n\t\t'key'=>'constant.animStyles',\n\t\t'display_name'=>'動畫類別',\n\t\t'value'=>'{ \"bounce\" : \"Bounce\", \"flash\" : \"Flash\", \"pulse\" : \"Pulse\", \"rubberBand\" : \"RubberBand\", \"shake\" : \"Shake\", \"swing\" : \"Swing\", \"tada\" : \"Tada\", \"wobble\" : \"Wobble\", \"bounceIn\" : \"Bounce In\", \"bounceInDown\" : \"Bounce In Down\", \"bounceInLeft\" : \"Bounce In Left\", \"bounceInRight\" : \"Bounce In Right\", \"bounceInUp\" : \"Bounce In Up\", \"bounceOut\" : \"Bounce Out\", \"bounceOutDown\" : \"Bounce Out Down\", \"bounceOutLeft\" : \"Bounce Out Left\", \"bounceOutRight\" : \"Bounce Out Right\", \"bounceOutUp\" : \"Bounce Out Up\", \"fadeIn\" : \"Fade In\", \"fadeInDown\" : \"Fade In Down\", \"fadeInDownBig\" : \"Fade In Down Big\", \"fadeInLeft\" : \"Fade In Left\", \"fadeInLeftBig\" : \"Fade In Left Big\", \"fadeInRight\" : \"Fade In Right\", \"fadeInRightBig\" : \"Fade In Right Big\", \"fadeInUp\" : \"Fade In Up\", \"fadeInUpBig\" : \"Fade In Up Big\", \"fadeOut\" : \"Fade Out\", \"fadeOutDown\" : \"Fade Out Down\", \"fadeOutDownBig\" : \"Fade Out Down Big\", \"fadeOutLeft\" : \"Fade Out Left\", \"fadeOutLeftBig\" : \"Fade Out Left Big\", \"fadeOutRight\" : \"Fade Out Right\", \"fadeOutRightBig\" : \"Fade Out Right Big\", \"fadeOutUp\" : \"Fade Out Up\", \"fadeOutUpBig\" : \"Fade Out Up Big\", \"flip\" : \"Flip\", \"flipInX\" : \"Flip In X\", \"flipInY\" : \"Flip In Y\", \"flipOutX\" : \"Flip Out X\", \"flipOutY\" : \"Flip Out Y\", \"lightSpeedIn\" : \"Light Speed In\", \"lightSpeedOut\" : \"Light Speed Out\", \"rotateIn\" : \"Rotate In\", \"rotateInDownLeft\" : \"Rotate In Down Left\", \"rotateInDownRight\" : \"Rotate In Down Right\", \"rotateInUpLeft\" : \"Rotate In Up Left\", \"rotateInUpRight\" : \"Rotate In Up Right\", \"rotateOut\" : \"Rotate Out\", \"rotateOutDownLeft\" : \"Rotate Out Down Left\", \"rotateOutDownRight\" : \"Rotate Out Down Right\", \"rotateOutUpLeft\" : \"Rotate Out Up Left\", \"rotateOutUpRight\" : \"Rotate Out Up Right\", \"hinge\" : \"Hinge\", \"rollIn\" : \"Roll In\", \"rollOut\" : \"Roll Out\", \"zoomIn\" : \"Zoom In\", \"zoomInDown\" : \"Zoom In Down\", \"zoomInLeft\" : \"Zoom In Left\", \"zoomInRight\" : \"Zoom In Right\", \"zoomInUp\" : \"Zoom In Up\", \"zoomOut\" : \"Zoom Out\", \"zoomOutDown\" : \"Zoom Out Down\", \"zoomOutLeft\" : \"Zoom Out Left\", \"zoomOutRight\" : \"Zoom Out Right\", \"zoomOutUp\" : \"Zoom Out Up\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>30,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>38,\n\t\t'key'=>'constant.serials_type',\n\t\t'display_name'=>'序號類型',\n\t\t'value'=>'{ \"multi\" : \"多次\", \"once\" : \"單次\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>31,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>43,\n\t\t'key'=>'constant.pay_sources',\n\t\t'display_name'=>'付款方式',\n\t\t'value'=>'{ \"line\" : \"Line Pay\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>34,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>44,\n\t\t'key'=>'constant.article_statuses',\n\t\t'display_name'=>'文章狀態',\n\t\t'value'=>'{ \"published\" : \"上架中\", \"draft\" : \"草稿\", \"pending\" : \"待審核\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>35,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>45,\n\t\t'key'=>'constant.contact_statuses',\n\t\t'display_name'=>'聯絡單狀態',\n\t\t'value'=>'{ \"unHandled\" : \"未處理\", \"handling\" : \"處理中\" , \"delay\" : \"延遲中\" , \"isHandled\" : \"已完成\", \"cancel\" : \"已取消\"}',\n\t\t'details'=>NULL,\n\t\t'type'=>'code_editor',\n\t\t'order'=>36,\n\t\t'group'=>'Constant'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>46,\n\t\t'key'=>'site.copyright',\n\t\t'display_name'=>'版權宣告',\n\t\t'value'=>'Copyrights © 梧棲 安良港 永元宮 all rights reserved.',\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>40,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>47,\n\t\t'key'=>'site.logo2',\n\t\t'display_name'=>'網站第2Logo',\n\t\t'value'=>'settings/March2019/M0dXCvUKJmAlG89vbTUy.png',\n\t\t'details'=>NULL,\n\t\t'type'=>'image',\n\t\t'order'=>13,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>48,\n\t\t'key'=>'site.contact_info',\n\t\t'display_name'=>'聯絡頁資訊',\n\t\t'value'=>'梧棲安良港永元宮供奉主神:\\r\\n\\r\\n\t\t.北極玄天上帝\\r\\n\t\t.三府千歲: 朱府千歲、李府千歲、池府千歲\\r\\n\t\t.太子元帥、武財神、福德正神\\r\\n\t\t.玄天上帝: 俗稱 上帝公,神威顯赫,帝德參天,護佑子民,福樂安康\\r\\n\\r\\n\t\t地址: 435台中市台中市梧棲區中央路一段99-8號\\r\\n\t\t電話: (04)2639-3625',\n\t\t'details'=>NULL,\n\t\t'type'=>'text_area',\n\t\t'order'=>41,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>49,\n\t\t'key'=>'site.service_mail',\n\t\t'display_name'=>'客服郵箱',\n\t\t'value'=>NULL,\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>19,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>50,\n\t\t'key'=>'site.article_default_pic',\n\t\t'display_name'=>'預設文章圖片',\n\t\t'value'=>'images/vision.jpg',\n\t\t'details'=>NULL,\n\t\t'type'=>'text',\n\t\t'order'=>44,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>51,\n\t\t'key'=>'admin.isShowAuthor',\n\t\t'display_name'=>'文章是否顯示作者區塊',\n\t\t'value'=>'false',\n\t\t'details'=>'{ \"default\":\"false\", \"options\":{ \"true\":\"開啟\", \"false\":\"關閉\" }}',\n\t\t'type'=>'select_dropdown',\n\t\t'order'=>42,\n\t\t'group'=>'Admin'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>52,\n\t\t'key'=>'site.logo@2x',\n\t\t'display_name'=>'網站 Retina Logo',\n\t\t'value'=>'',\n\t\t'details'=>NULL,\n\t\t'type'=>'image',\n\t\t'order'=>4,\n\t\t'group'=>'Site'\n\t\t] );\n\t\t\t\t\t\n\t\tDB::table(\"settings\")->insert( [\n\t\t'id'=>53,\n\t\t'key'=>'site.favicon',\n\t\t'display_name'=>'\b網站Favicon',\n\t\t'value'=>'',\n\t\t'details'=>NULL,\n\t\t'type'=>'image',\n\t\t'order'=>43,\n\t\t'group'=>'Site'\n\t\t] );\n }",
"function generateAllConfigItems() {\n\n\t\t$sFileContents = '';\n\n\t\tforeach ( $this->aItemName_TableName_Map AS $sConfigItemName => $sTableName ) {\n\n\t\t\t$aTableData = $this->db->get($sTableName)->result();\n\n\t\t\t$aFormats = array('id-name', 'id-title');\n\t\t\tforeach( $aFormats AS $sFormat) {\n\n\t\t\t\t$aData = $this->getDataInFormat($aTableData, $sFormat);\n\n\t\t\t\t$sFileContents .= $this->getStringtoAppend($aData, $sConfigItemName, $sFormat);\n\t\t\t}\n\t\t}\n\n\t\t// write to Config File\n\t\t$this->writeBackTofile($sFileContents);\n\t}",
"public function setDatabaseConfiguration()\n\t{\n\t\tglobal $wpdb;\n $this->app['config']->set([\n 'database.connections.mysql' => [\n \t\t\t'driver' => 'mysql',\n \t\t\t'host' => DB_HOST,\n \t\t\t'database' => DB_NAME,\n \t\t\t'username' => DB_USER,\n \t\t\t'password' => DB_PASSWORD,\n \t\t\t'charset' => $wpdb->charset,\n \t\t\t'collation' => $wpdb->collate,\n \t\t\t'prefix' => $wpdb->prefix,\n \t\t\t'timezone' => '+00:00',\n \t\t\t'strict' => false,\n \t\t]\n ]);\n\t}",
"private function configure() {\n\t\t$statement = $this -> database -> query(\"SELECT * FROM worlds\");\n\t\twhile ($worldData = $statement -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$this -> worlds[$worldData['world']] = new World($worldData);\n\t\t}\n\t\t$statement = $this -> database -> query(\"SELECT * FROM server.configs\");\n\t\twhile ($configData = $statement -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$this -> configs[$configData['key_']] = new Config($configData['key_'], $configData['value'], $configData['dataType']);\n\t\t}\n\t}",
"abstract protected function define_my_settings();",
"public function __construct(){\n\n global $webapp_location;\n\n if ( ! $webapp_location ) $webapp_location = getcwd();\n\n parent::__construct( array(\n\n // Set path\n 'file_path' => $webapp_location.'/app/config/database.json',\n\n // Set template\n 'template_file' => '/templates/JSON/database.json',\n\n // Auto create if doesn't exist\n 'auto_create'=>true,\n\n // Automatically load file\n 'auto_load'=>true\n\n ));\n\n // Iterate all data to find main conn\n foreach ( $this->data as $key => $connection )\n\n if ( isset( $connection['is_main']) && $connection['is_main'])\n\n self::$default_connection = $key;\n\n\n }",
"function grab_db_settings(){\n\t\n\t\treturn new pfagos_settings();\n\t}",
"abstract public function getSettings();",
"public function set_config_settings()\r\n\t{\t\r\n\t\t// Check the config table exists in the config file and is enabled.\r\n\t\tif ($this->get_enabled_status('config'))\r\n\t\t{\r\n\t\t\tif ($config_data = $this->get_database_config_data())\r\n\t\t\t{\r\n\t\t\t\t// Loop through all the returned defaults and convert the database column names to cart session names.\r\n\t\t\t\tforeach($this->flexi->cart_database['configuration']['columns'] as $column_name => $column_alias)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (isset($config_data[$column_alias]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$config_data[$column_name] = $config_data[$column_alias];\r\n\t\t\t\t\t\tunset($config_data[$column_alias]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Config file hard-coded settings.\r\n\t\t$config_defaults = $this->flexi->cart_defaults['configuration'];\r\n\r\n\t\t// Loop through the config hard-coded default settings and apply them to any config settings without a value from the database lookup.\r\n\t\tforeach($config_defaults as $setting_name => $setting_value)\r\n\t\t{\r\n\t\t\tif (! isset($config_data[$setting_name]))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$setting_name] = $config_defaults[$setting_name];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Group non boolean config value types together.\r\n\t\t$non_boolean_columns = array('order_number_prefix', 'order_number_suffix', 'weight_type', 'minimum_order', 'reward_point_multiplier', 'reward_voucher_multiplier', \r\n\t\t\t'reward_point_to_voucher_ratio', 'reward_point_days_pending', 'reward_point_days_valid', 'reward_voucher_days_valid', 'quantity_decimals', 'weight_decimals');\r\n\t\t\r\n\t\t// Ensure the data is stored in the correct format type.\r\n\t\tforeach($config_data as $column => $value)\r\n\t\t{\r\n\t\t\t// Ensure non boolean values are stored as their entered value.\r\n\t\t\tif (in_array($column, $non_boolean_columns))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (string)$config_data[$column];\r\n\t\t\t}\r\n\t\t\t// All others are saved as boolean.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (bool)$config_data[$column];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set configuration data to cart session settings.\r\n\t\t$this->flexi->cart_contents['settings']['configuration'] = $config_data;\r\n\r\n\t\t// Set an empty cart id and order number placeholder.\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['cart_data_id'] = FALSE;\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['order_number'] = FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}",
"private function initDatabase()\n {\n $defaults = [\n 'user' => 'root',\n 'password' => '',\n 'prefix' => '',\n 'options' => [\n \\PDO::ATTR_PERSISTENT => true,\n \\PDO::ATTR_ERRMODE => 2,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',\n \\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 1,\n \\PDO::ATTR_EMULATE_PREPARES => false\n ]\n ];\n\n if (empty($this->settings['db'])) {\n error_log('No DB data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n if (empty($this->settings['db']['default'])) {\n error_log('No DB \"default\" data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n foreach ($this->settings['db'] as $name => &$settings) {\n\n $prefix = 'db.' . $name;\n\n // Check for databasename\n if (empty($settings['dsn'])) {\n Throw new \\PDOException(sprintf('No DSN specified for \"%s\" db connection. Please add correct DSN for this connection in Settings.php', $name));\n }\n\n // Check for DB defaults and map values\n foreach ($defaults as $key => $default) {\n\n // Append default options to settings\n if ($key == 'options') {\n\n if (empty($settings['options'])) {\n $settings['options'] = [];\n }\n\n foreach ($defaults['options'] as $option => $value) {\n\n if (array_key_exists($option, $settings['options'])) {\n continue;\n }\n\n $settings[$key][$option] = $value;\n }\n }\n\n if (empty($settings[$key])) {\n $settings[$key] = $default;\n }\n }\n\n foreach ($settings as $key => $value) {\n $this->di->mapValue($prefix . '.conn.' . $key, $value);\n }\n\n $this->di->mapService($prefix . '.conn', '\\Core\\Data\\Connectors\\Db\\Connection', [\n $prefix . '.conn.dsn',\n $prefix . '.conn.user',\n $prefix . '.conn.password',\n $prefix . '.conn.options'\n ]);\n $this->di->mapFactory($prefix, '\\Core\\Data\\Connectors\\Db\\Db', [\n $prefix . '.conn',\n $settings['prefix']\n ]);\n }\n }",
"protected static function addModuleConfigurationsToDb()\n {\n static::_addMainConfigurationEntries();\n static::_addCredentialsConfigurationEntries();\n static::_addTransactionsConfigurationEntries();\n static::_addWpfConfigurationEntries();\n static::_addOrderConfigurationEntries();\n static::_addThreedsOptions();\n static::_addScaExemptionOptions();\n }",
"function MetaDatabases() {}",
"function getAllSettings()\n\t\t{\n\t\t\t\n\t\t\ttry{\n\n\t\t\t\t$query = $this->_db->prepare( \"SELECT * FROM settings\" );\n\n\t\t\t\t$query->execute();\n\n\t\t\t\t$data = $query->fetchAll();\n\t\t\t\t\n\t\t\t\tforeach( $data as $setting )\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t$settings[ $setting[ \"settings_key\" ] ] = $setting[ \"settings_value\" ];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $settings;\n\n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\t\t\t\n\t\t}",
"function __construct()\n {\n $this->link = mysql_connect($cfg['database_host'], $cfg['database_user'], $cfg['database_password']);\n if (!$this->link) \n {\n echo 'Settings class error: ' . mysql_error();\n return;\n }\n \n $sel_db = mysql_select_db($cfg['database_name']);\n \n if (!$sel_db) \n {\n echo 'Settings class error: ' . mysql_error();\n return;\n }\n \n $result = mysql_query(\"SELECT * FROM settings\");\n \n if(mysql_num_rows($result) > 0)\n {\n while($row = mysql_fetch_array($result))\n {\n $this->values[$row['key']] = $row['value'];\n }\n }\n }",
"private function dbRestorationInit()\n\t{\n\t\t$config =& JFactory::getConfig();\n\t\t$path = rtrim($config->getValue('tmp_path', ''),'/\\\\').'/sql';\n\t\t$sqlfile = 'joomla.sql';\n\t\t\n\t\t$totalSize = 0;\n\t\t$runSize = 0;\n\t\t$partsMap = array();\n\t\t$found = true;\n\t\t$index = 0;\n\t\t\n\t\twhile($found) {\n\t\t\tif($index == 0)\n\t\t\t{\n\t\t\t\t$basename = $sqlfile;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$basename = substr($sqlfile, 0, -4).'.s'.sprintf('%02u', $index);\n\t\t\t}\n\n\t\t\t$file = $path.DS.$basename;\n\t\t\tif(!file_exists($file)) {\n\t\t\t\t$found = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$filesize = @filesize($file) ;\n\t\t\t$totalSize += intval($filesize);\n\t\t\t$partsMap[] = $file;\n\t\t\t\n\t\t\t$index++;\n\t\t}\n\t\t\n\t\t$parts = count($partsMap);\n\t\t\n\t\t$dbInfo = (object)array(\n\t\t\t'totalSize'\t\t=> $totalSize,\n\t\t\t'runSize'\t\t=> $runSize,\n\t\t\t'parts'\t\t\t=> $parts,\n\t\t\t'partsMap'\t\t=> $partsMap,\n\t\t\t'curpart'\t\t=> 0,\n\t\t\t'foffset'\t\t=> 0,\n\t\t\t'file'\t\t\t=> null,\n\t\t\t'start'\t\t\t=> 0\n\t\t);\n\t\t\n\t\t$session = JFactory::getSession();\n\t\t$session->clear('restoration_setup', 'akeeba');\n\t\t$session->set('dbinfo', $dbInfo, 'akeeba');\n\t}",
"function loadFromDatabase(){\n global $DB;\n $resource = $DB->config->get();\n $list = array();\n while($row = $DB->fetchAssoc($resource))\n {\n if(!isset($this->sections[$row['section']])) $this->sections[$row['section']] = new ConfigSection($row['section']);\n $this->sections[$row['section']]->registerFromDatabase($row);\n }\n }",
"function Settings_API($load_settings=true)\n\t{\n\t\t$this->ConfigFile = SENDSTUDIO_INCLUDES_DIRECTORY . '/config.php';\n\t\t$this->WhiteLabelCache = IEM_InterspireStash::getInstance();\n\n\t\tif ($load_settings) {\n\t\t\t$db = $this->GetDb();\n\t\t\t$this->LoadSettings();\n\t\t}\n\t}",
"public function probe_db_access($file_base)\n {\n $db_name = '';\n $db_user = '';\n $db_passwd = '';\n $db_prefix = '';\n $db_server = '';\n if (!file_exists($file_base . '/Settings.php')) {\n warn_exit(do_lang_tempcode('BAD_IMPORT_PATH', escape_html('Settings.php')));\n }\n require($file_base . '/Settings.php');\n\n return array($db_name, $db_user, $db_passwd, $db_prefix, $db_server);\n }",
"private function write_config_data()\n\t{\n\t\t$captcha_url = '{base_url}images/captchas/';\n\n\t\tforeach (array('avatar_path', 'photo_path', 'signature_img_path', 'pm_path', 'captcha_path', 'theme_folder_path') as $path)\n\t\t{\n\t\t\t$prefix = ($path != 'theme_folder_path') ? $this->root_theme_path : '';\n\t\t\t$this->userdata[$path] = rtrim(realpath($prefix.$this->userdata[$path]), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\t\t\t$this->userdata[$path] = str_replace($this->base_path, '{base_path}', $this->userdata[$path]);\n\t\t}\n\n\t\t$config = array(\n\t\t\t'db_port' => $this->userdata['db_port'],\n\t\t\t'db_hostname' => $this->userdata['db_hostname'],\n\t\t\t'db_username' => $this->userdata['db_username'],\n\t\t\t'db_password' => $this->userdata['db_password'],\n\t\t\t'db_database' => $this->userdata['db_name'],\n\t\t\t'db_dbprefix' => $this->getDbPrefix(),\n\t\t\t'db_char_set' => $this->userdata['db_char_set'],\n\t\t\t'db_collat' => $this->userdata['db_collat'],\n\t\t\t'app_version' => $this->userdata['app_version'],\n\t\t\t'debug' => '1',\n\t\t\t'site_index' => $this->userdata['site_index'],\n\t\t\t'site_label' => $this->userdata['site_label'],\n\t\t\t'base_path' => $this->base_path,\n\t\t\t'base_url' => $this->userdata['site_url'],\n\t\t\t'cp_url' => str_replace($this->userdata['site_url'], '{base_url}', $this->userdata['cp_url']),\n\t\t\t'site_url' => '{base_url}',\n\t\t\t'theme_folder_url' => '{base_url}themes/',\n\t\t\t'webmaster_email' => $this->userdata['email_address'],\n\t\t\t'webmaster_name' => '',\n\t\t\t'channel_nomenclature' => 'channel',\n\t\t\t'max_caches' => '150',\n\t\t\t'cache_driver' => 'file',\n\t\t\t'captcha_url' => $captcha_url,\n\t\t\t'captcha_path' => $this->userdata['captcha_path'],\n\t\t\t'captcha_font' => 'y',\n\t\t\t'captcha_rand' => 'y',\n\t\t\t'captcha_require_members' => 'n',\n\t\t\t'require_captcha' => 'n',\n\t\t\t'enable_sql_caching' => 'n',\n\t\t\t'force_query_string' => 'n',\n\t\t\t'show_profiler' => 'n',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'cookie_domain' => '',\n\t\t\t'cookie_path' => '/',\n\t\t\t'cookie_prefix' => '',\n\t\t\t'website_session_type' => 'c',\n\t\t\t'cp_session_type' => 'c',\n\t\t\t'cookie_httponly' => 'y',\n\t\t\t'allow_username_change' => 'y',\n\t\t\t'allow_multi_logins' => 'y',\n\t\t\t'password_lockout' => 'y',\n\t\t\t'password_lockout_interval' => '1',\n\t\t\t'require_ip_for_login' => 'y',\n\t\t\t'require_ip_for_posting' => 'y',\n\t\t\t'require_secure_passwords' => 'n',\n\t\t\t'allow_dictionary_pw' => 'y',\n\t\t\t'name_of_dictionary_file' => '',\n\t\t\t'xss_clean_uploads' => 'y',\n\t\t\t'redirect_method' => $this->userdata['redirect_method'],\n\t\t\t'deft_lang' => $this->userdata['deft_lang'],\n\t\t\t'xml_lang' => 'en',\n\t\t\t'send_headers' => 'y',\n\t\t\t'gzip_output' => 'n',\n\t\t\t'is_system_on' => 'y',\n\t\t\t'allow_extensions' => 'y',\n\t\t\t'date_format' => '%n/%j/%Y',\n\t\t\t'time_format' => '12',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'server_offset' => '',\n\t\t\t'default_site_timezone' => date_default_timezone_get(),\n\t\t\t'mail_protocol' => 'mail',\n\t\t\t'email_newline' => '\\n', // single-quoted for portability\n\t\t\t'smtp_server' => '',\n\t\t\t'smtp_username' => '',\n\t\t\t'smtp_password' => '',\n\t\t\t'email_smtp_crypto' => 'ssl',\n\t\t\t'email_debug' => 'n',\n\t\t\t'email_charset' => 'utf-8',\n\t\t\t'email_batchmode' => 'n',\n\t\t\t'email_batch_size' => '',\n\t\t\t'mail_format' => 'plain',\n\t\t\t'word_wrap' => 'y',\n\t\t\t'email_console_timelock' => '5',\n\t\t\t'log_email_console_msgs' => 'y',\n\t\t\t'log_search_terms' => 'y',\n\t\t\t'un_min_len' => '4',\n\t\t\t'pw_min_len' => '5',\n\t\t\t'allow_member_registration' => 'n',\n\t\t\t'allow_member_localization' => 'y',\n\t\t\t'req_mbr_activation' => 'email',\n\t\t\t'new_member_notification' => 'n',\n\t\t\t'mbr_notification_emails' => '',\n\t\t\t'require_terms_of_service' => 'y',\n\t\t\t'default_member_group' => '5',\n\t\t\t'profile_trigger' => 'member',\n\t\t\t'member_theme' => 'default',\n\t\t\t'enable_avatars' => 'y',\n\t\t\t'allow_avatar_uploads' => 'n',\n\t\t\t'avatar_url' => '{base_url}'.$this->userdata['avatar_url'],\n\t\t\t'avatar_path' => $this->userdata['avatar_path'],\n\t\t\t'avatar_max_width' => '100',\n\t\t\t'avatar_max_height' => '100',\n\t\t\t'avatar_max_kb' => '50',\n\t\t\t'enable_photos' => 'n',\n\t\t\t'photo_url' => '{base_url}'.$this->userdata['photo_url'],\n\t\t\t'photo_path' => $this->userdata['photo_path'],\n\t\t\t'photo_max_width' => '100',\n\t\t\t'photo_max_height' => '100',\n\t\t\t'photo_max_kb' => '50',\n\t\t\t'allow_signatures' => 'y',\n\t\t\t'sig_maxlength' => '500',\n\t\t\t'sig_allow_img_hotlink' => 'n',\n\t\t\t'sig_allow_img_upload' => 'n',\n\t\t\t'sig_img_url' => '{base_url}'.$this->userdata['signature_img_url'],\n\t\t\t'sig_img_path' => $this->userdata['signature_img_path'],\n\t\t\t'sig_img_max_width' => '480',\n\t\t\t'sig_img_max_height' => '80',\n\t\t\t'sig_img_max_kb' => '30',\n\t\t\t'prv_msg_enabled' => 'y',\n\t\t\t'prv_msg_allow_attachments' => 'y',\n\t\t\t'prv_msg_upload_path' => $this->userdata['pm_path'],\n\t\t\t'prv_msg_max_attachments' => '3',\n\t\t\t'prv_msg_attach_maxsize' => '250',\n\t\t\t'prv_msg_attach_total' => '100',\n\t\t\t'prv_msg_html_format' => 'safe',\n\t\t\t'prv_msg_auto_links' => 'y',\n\t\t\t'prv_msg_max_chars' => '6000',\n\t\t\t'enable_template_routes' => 'y',\n\t\t\t'strict_urls' => 'y',\n\t\t\t'site_404' => '',\n\t\t\t'save_tmpl_revisions' => 'n',\n\t\t\t'max_tmpl_revisions' => '5',\n\t\t\t'save_tmpl_files' => 'y',\n\t\t\t'deny_duplicate_data' => 'y',\n\t\t\t'redirect_submitted_links' => 'n',\n\t\t\t'enable_censoring' => 'n',\n\t\t\t'censored_words' => '',\n\t\t\t'censor_replacement' => '',\n\t\t\t'banned_ips' => '',\n\t\t\t'banned_emails' => '',\n\t\t\t'banned_usernames' => '',\n\t\t\t'banned_screen_names' => '',\n\t\t\t'ban_action' => 'restrict',\n\t\t\t'ban_message' => 'This site is currently unavailable',\n\t\t\t'ban_destination' => 'http://www.yahoo.com/',\n\t\t\t'enable_emoticons' => 'y',\n\t\t\t'emoticon_url' => '{base_url}'.'images/smileys/',\n\t\t\t'recount_batch_total' => '1000',\n\t\t\t'image_resize_protocol' => 'gd2',\n\t\t\t'image_library_path' => '',\n\t\t\t'thumbnail_prefix' => 'thumb',\n\t\t\t'word_separator' => 'dash',\n\t\t\t'use_category_name' => 'n',\n\t\t\t'reserved_category_word' => 'category',\n\t\t\t'auto_convert_high_ascii' => 'n',\n\t\t\t'new_posts_clear_caches' => 'y',\n\t\t\t'auto_assign_cat_parents' => 'y',\n\t\t\t'new_version_check' => 'y',\n\t\t\t'enable_throttling' => 'n',\n\t\t\t'banish_masked_ips' => 'y',\n\t\t\t'max_page_loads' => '10',\n\t\t\t'time_interval' => '8',\n\t\t\t'lockout_time' => '30',\n\t\t\t'banishment_type' => 'message',\n\t\t\t'banishment_url' => '',\n\t\t\t'banishment_message' => 'You have exceeded the allowed page load frequency.',\n\t\t\t'enable_search_log' => 'y',\n\t\t\t'max_logged_searches' => '500',\n\t\t\t'memberlist_order_by' => \"member_id\",\n\t\t\t'memberlist_sort_order' => \"desc\",\n\t\t\t'memberlist_row_limit' => \"20\",\n\t\t\t'is_site_on' => 'y',\n\t\t\t'theme_folder_path' => $this->userdata['theme_folder_path'],\n\t\t);\n\n\t\t// Default Administration Prefs\n\t\t$admin_default = array(\n\t\t\t'site_index',\n\t\t\t'base_url',\n\t\t\t'base_path',\n\t\t\t'cp_url',\n\t\t\t'site_url',\n\t\t\t'theme_folder_url',\n\t\t\t'webmaster_email',\n\t\t\t'webmaster_name',\n\t\t\t'channel_nomenclature',\n\t\t\t'max_caches',\n\t\t\t'captcha_url',\n\t\t\t'captcha_path',\n\t\t\t'captcha_font',\n\t\t\t'captcha_rand',\n\t\t\t'captcha_require_members',\n\t\t\t'require_captcha',\n\t\t\t'enable_sql_caching',\n\t\t\t'force_query_string',\n\t\t\t'show_profiler',\n\t\t\t'include_seconds',\n\t\t\t'cookie_domain',\n\t\t\t'cookie_path',\n\t\t\t'website_session_type',\n\t\t\t'cp_session_type',\n\t\t\t'allow_username_change',\n\t\t\t'allow_multi_logins',\n\t\t\t'password_lockout',\n\t\t\t'password_lockout_interval',\n\t\t\t'require_ip_for_login',\n\t\t\t'require_ip_for_posting',\n\t\t\t'require_secure_passwords',\n\t\t\t'allow_dictionary_pw',\n\t\t\t'name_of_dictionary_file',\n\t\t\t'xss_clean_uploads',\n\t\t\t'redirect_method',\n\t\t\t'deft_lang',\n\t\t\t'xml_lang',\n\t\t\t'send_headers',\n\t\t\t'gzip_output',\n\t\t\t'date_format',\n\t\t\t'time_format',\n\t\t\t'include_seconds',\n\t\t\t'server_offset',\n\t\t\t'default_site_timezone',\n\t\t\t'mail_protocol',\n\t\t\t'email_newline',\n\t\t\t'smtp_server',\n\t\t\t'smtp_username',\n\t\t\t'smtp_password',\n\t\t\t'email_smtp_crypto',\n\t\t\t'email_debug',\n\t\t\t'email_charset',\n\t\t\t'email_batchmode',\n\t\t\t'email_batch_size',\n\t\t\t'mail_format',\n\t\t\t'word_wrap',\n\t\t\t'email_console_timelock',\n\t\t\t'log_email_console_msgs',\n\t\t\t'log_search_terms',\n\t\t\t'deny_duplicate_data',\n\t\t\t'redirect_submitted_links',\n\t\t\t'enable_censoring',\n\t\t\t'censored_words',\n\t\t\t'censor_replacement',\n\t\t\t'banned_ips',\n\t\t\t'banned_emails',\n\t\t\t'banned_usernames',\n\t\t\t'banned_screen_names',\n\t\t\t'ban_action',\n\t\t\t'ban_message',\n\t\t\t'ban_destination',\n\t\t\t'enable_emoticons',\n\t\t\t'emoticon_url',\n\t\t\t'recount_batch_total',\n\t\t\t'new_version_check',\n\t\t\t'enable_throttling',\n\t\t\t'banish_masked_ips',\n\t\t\t'max_page_loads',\n\t\t\t'time_interval',\n\t\t\t'lockout_time',\n\t\t\t'banishment_type',\n\t\t\t'banishment_url',\n\t\t\t'banishment_message',\n\t\t\t'enable_search_log',\n\t\t\t'max_logged_searches',\n\t\t\t'theme_folder_path',\n\t\t\t'is_site_on'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($admin_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_system_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Members Prefs\n\t\t$member_default = array(\n\t\t\t'un_min_len',\n\t\t\t'pw_min_len',\n\t\t\t'allow_member_registration',\n\t\t\t'allow_member_localization',\n\t\t\t'req_mbr_activation',\n\t\t\t'new_member_notification',\n\t\t\t'mbr_notification_emails',\n\t\t\t'require_terms_of_service',\n\t\t\t'default_member_group',\n\t\t\t'profile_trigger',\n\t\t\t'member_theme',\n\t\t\t'enable_avatars',\n\t\t\t'allow_avatar_uploads',\n\t\t\t'avatar_url',\n\t\t\t'avatar_path',\n\t\t\t'avatar_max_width',\n\t\t\t'avatar_max_height',\n\t\t\t'avatar_max_kb',\n\t\t\t'enable_photos',\n\t\t\t'photo_url',\n\t\t\t'photo_path',\n\t\t\t'photo_max_width',\n\t\t\t'photo_max_height',\n\t\t\t'photo_max_kb',\n\t\t\t'allow_signatures',\n\t\t\t'sig_maxlength',\n\t\t\t'sig_allow_img_hotlink',\n\t\t\t'sig_allow_img_upload',\n\t\t\t'sig_img_url',\n\t\t\t'sig_img_path',\n\t\t\t'sig_img_max_width',\n\t\t\t'sig_img_max_height',\n\t\t\t'sig_img_max_kb',\n\t\t\t'prv_msg_enabled',\n\t\t\t'prv_msg_allow_attachments',\n\t\t\t'prv_msg_upload_path',\n\t\t\t'prv_msg_max_attachments',\n\t\t\t'prv_msg_attach_maxsize',\n\t\t\t'prv_msg_attach_total',\n\t\t\t'prv_msg_html_format',\n\t\t\t'prv_msg_auto_links',\n\t\t\t'prv_msg_max_chars',\n\t\t\t'memberlist_order_by',\n\t\t\t'memberlist_sort_order',\n\t\t\t'memberlist_row_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($member_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_member_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Templates Prefs\n\t\t$template_default = array(\n\t\t\t'enable_template_routes',\n\t\t\t'strict_urls',\n\t\t\t'site_404',\n\t\t\t'save_tmpl_revisions',\n\t\t\t'max_tmpl_revisions',\n\t\t);\n\t\t$site_prefs = array();\n\n\t\tforeach($template_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_template_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Channels Prefs\n\t\t$channel_default = array(\n\t\t\t'image_resize_protocol',\n\t\t\t'image_library_path',\n\t\t\t'thumbnail_prefix',\n\t\t\t'word_separator',\n\t\t\t'use_category_name',\n\t\t\t'reserved_category_word',\n\t\t\t'auto_convert_high_ascii',\n\t\t\t'new_posts_clear_caches',\n\t\t\t'auto_assign_cat_parents',\n\t\t\t'enable_comments',\n\t\t\t'comment_word_censoring',\n\t\t\t'comment_moderation_override',\n\t\t\t'comment_edit_time_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($channel_default as $value)\n\t\t{\n\t\t\tif (isset($config[$value]))\n\t\t\t{\n\t\t\t\t$site_prefs[$value] = $config[$value];\n\t\t\t}\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_channel_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Remove Site Prefs from Config\n\t\tforeach(array_merge($admin_default, $member_default, $template_default, $channel_default) as $value)\n\t\t{\n\t\t\tunset($config[$value]);\n\t\t}\n\n\t\t// Write the config file data\n\t\t$this->write_config_from_template($config);\n\n\t\treturn TRUE;\n\t}",
"function configure_db() {\n //Old data is deleted before adding the new db structure\n $db = DB::getInstance();\n //$file = new File(CORE_INSTALLER_FILES_PATH.'/db/init.sql', 'r');\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/init.sql'))->error()) {\n return true;\n }\n return false;\n}",
"protected function setMainDictionaryPath() {}",
"public static function Zf_DatabaseSettings(){\n \n self::$zf_databaseSettings = array(\n \n 'zf_dbHost' => DATABASE_HOST,\n 'zf_dbUser' => DATABASE_USERNAME,\n 'zf_dbPassword' => DATABASE_PASSWORD,\n 'zf_dbType' => DATABASE_DRIVER,\n 'zf_dbName' => DATABASE_NAME,\n 'zf_dbCharacterset' => CHARACTER_SET,\n 'zf_dbConnection' => CONNECTION_TYPE,\n 'zf_dbDebug' => DATABASE_DEBUG\n \n );\n \n return self::$zf_databaseSettings;\n }",
"private static function _addMainConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Enable emerchantpay Checkout Module',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('STATUS') . \"',\n 'true',\n 'Do you want to process payments via emerchantpay''s Genesis Gateway?',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Title',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CHECKOUT_PAGE_TITLE'\n ) . \"',\n 'Pay safely with emerchantpay Checkout',\n 'This name will be displayed on the checkout page', '6', '4',\n 'emp_zfg_draw_input(null, ', now())\"\n );\n }",
"public function run()\n {\n\n Model::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('settings')->truncate();\n\n\n\n $setting = $this->findSetting('site.title');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.site.title'),\n 'value' => __('voyager::seeders.settings.site.title'),\n 'details' => '',\n 'type' => 'text',\n 'order' => 1,\n 'group' => 'Site',\n ])->save();\n }\n\n $setting = $this->findSetting('site.description');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.site.description'),\n 'value' => __('voyager::seeders.settings.site.description'),\n 'details' => '',\n 'type' => 'text',\n 'order' => 2,\n 'group' => 'Site',\n ])->save();\n }\n\n $setting = $this->findSetting('site.logo');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.site.logo'),\n 'value' => '',\n 'details' => '',\n 'type' => 'image',\n 'order' => 3,\n 'group' => 'Site',\n ])->save();\n }\n\n $setting = $this->findSetting('site.google_analytics_tracking_id');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.site.google_analytics_tracking_id'),\n 'value' => '',\n 'details' => '',\n 'type' => 'text',\n 'order' => 4,\n 'group' => 'Site',\n ])->save();\n }\n\n\n\n\n\n\n $setting = $this->findSetting('admin.bg_image');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.background_image'),\n 'value' => 'settings\\admin\\bg.png',\n 'details' => '',\n 'type' => 'image',\n 'order' => 5,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.title');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.title'),\n 'value' => 'Тестовое задание',\n 'details' => '',\n 'type' => 'text',\n 'order' => 1,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.description');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.description'),\n 'value' => \"Тестовое задание доступ к панели управления\",\n 'details' => '',\n 'type' => 'text',\n 'order' => 2,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.loader');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.loader'),\n 'value' => 'settings\\admin\\loader.png',\n 'details' => '',\n 'type' => 'image',\n 'order' => 3,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.icon_image');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.icon_image'),\n 'value' => 'settings\\admin\\logo.png',\n 'details' => '',\n 'type' => 'image',\n 'order' => 4,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.google_analytics_client_id');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.google_analytics_client_id'),\n 'value' => '',\n 'details' => '',\n 'type' => 'text',\n 'order' => 1,\n 'group' => 'Admin',\n ])->save();\n }\n }",
"function prepConfig() {\n\n global $db;\n global $lang;\n\n if($report = $db->query(\"CREATE DATABASE IF NOT EXISTS \".$lang[\"config_db_name\"].\"\")) {\n\n // Generate safety table\n if($report = $db->query(\"CREATE TABLE IF NOT EXISTS `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` ( `id` INT(6) NOT NULL AUTO_INCREMENT, `key` VARCHAR(100) NOT NULL, UNIQUE (`key`), `val` VARCHAR(100) NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;\")) {\n\n return \"Ready\";\n\n } else {\n\n return \"Failed to create table. Error: \".$db->error;\n\n }\n\n } else {\n\n return \"Failed to create database. Error: \".$db->error;\n\n }\n\n }",
"public function prepareConfigSchema()\n {\n // Store Chapters\n $fromchapter = ['labels' => [],'id' => []];\n foreach ($this->container->db->getFormats() as $f) {\n array_push($fromchapter['labels'], $f->getName());\n array_push($fromchapter['id'], $f->getId());\n }\n\n // Store Issues\n $fromissue = ['labels' => [],'id' => []];\n foreach ($this->container->db->getIssues() as $i) {\n array_push($fromissue['labels'], $i->getName());\n array_push($fromissue['id'], $i->getId());\n }\n\n // Store Books\n $frombook = ['labels' => [],'id' => []];\n foreach ($this->container->db->getBooks() as $b) {\n array_push($frombook['labels'], $b->getName());\n array_push($frombook['id'], $b->getId());\n }\n\n // Store Templates\n $fromtemplate = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatenames() as $t) {\n array_push($fromtemplate['labels'], $t->getName());\n array_push($fromtemplate['id'], $t->getId());\n }\n\n // Store Templates\n $fromfield = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatefields() as $t) {\n array_push($fromfield['labels'], $t->getFieldname());\n array_push($fromfield['id'], $t->getId());\n }\n\n // Store Historytypes\n\n foreach (['books', 'issues', 'chapters', 'cloud', 'other', 'self', 'contributional', 'structural', 'fixed'] as $_ht) {\n $historytypes['id'][] = $_ht;\n $historytypes['labels'][] = $this->container->translations['field_historytype_'.$_ht];\n }\n\n // Todo\n $thisfields = [\n 'labels' => ['fielda', 'fieldb','fieldc'],\n 'id' => [1,2,3]\n ];\n\n $lengthinfluence = [\n 'title' => $this->container->translations['field_config'.'lengthinfluence'],\n 'options' => [\n 'collapsed' => true\n ],\n 'type' => 'array',\n 'propertyOrder' => 100,\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'row'],\n 'headerTemplate' => '{{ self.fieldname }}',\n 'properties' => [\n 'factor' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'factor'],\n ],\n 'fieldname' => [\n 'type' => 'string',\n 'uniqueItems' => true,\n 'enum' => [],//$fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'title' => [],//$this->container->translations['field_config'.'lengthinfluence'.'labels'],\n ]\n ]\n ]\n ]\n ];\n\n $schema = [\n 'title' => 'Field Configuration',\n 'type' => 'object',\n 'properties' => [\n 'imagesize' => [\n 'title' => $this->container->translations['field_config'.'imagesize'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'imagesize'.'row'],\n 'properties' => [\n 'width' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'width'],\n ],\n 'height' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'height'],\n ]\n ]\n ]\n ],\n 'caption_variants' => [\n 'title' => $this->container->translations['field_config'.'imagecaptions'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 11,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'imagecaption'],\n ]\n ],\n 'history' => [\n 'title' => $this->container->translations['field_config'.'history'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'fullhistory' => [\n 'title' => $this->container->translations['field_config'.'fullhistory'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox',\n 'watch' => [\n 'hist' => 'history'\n ],\n 'hidden' => '!history'\n ],\n 'growing' => [\n 'title' => $this->container->translations['field_config'.'growing'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'maxlines' => [\n 'title' => $this->container->translations['field_config'.'maxlines'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'textlength' => [\n 'title' => $this->container->translations['field_config'.'textlength'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'lengthinfluence' => $lengthinfluence,\n 'rtfeditor' => [\n 'title' => $this->container->translations['field_config'.'rtfeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'markdowneditor' => [\n 'title' => $this->container->translations['field_config'.'markdowneditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'codeeditor' => [\n 'title' => $this->container->translations['field_config'.'codeeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'editorcolumns' => [\n 'title' => $this->container->translations['field_config'.'editorcolumns'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Line',\n 'properties' => [\n \"lines\" => [\n 'type' => 'integer',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'lines'],\n ],\n \"label\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'label'],\n ]\n ]\n ]\n ],\n 'arrayeditor' => [\n 'title' => $this->container->translations['field_config'.'arrayeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'columns' => [\n 'title' => $this->container->translations['field_config'.'columns'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'colnames' => [\n 'title' => $this->container->translations['field_config'.'colnames'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'format' => 'text',\n 'title' => $this->container->translations['field_config'.'colnames'.'labels'],\n ]\n ],\n 'latitude' => [\n 'title' => $this->container->translations['field_config'.'latitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'longitude' => [\n 'title' => $this->container->translations['field_config'.'longitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'dateformat' => [\n 'title' => $this->container->translations['field_config'.'dateformat'],\n 'type' => 'string',\n 'propertyOrder' => 2,\n 'uniqueItems' => true,\n 'enum' => [\n 'd/m/Y H:i:s', 'd/m/Y H:i', 'd/m/Y', 'm/Y', 'Y'\n ],\n 'options' => [\n 'enum_titles' => [\n 'dd/mm/yyyy hh:mm:ss', 'dd/mm/yyyy hh:mm', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'\n ]\n ]\n ],\n 'integer' => [\n 'title' => $this->container->translations['field_config'.'integer'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'resolve_foreign' => [\n 'title' => $this->container->translations['field_config'.'resolve_foreign'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'multiple' => [\n 'title' => $this->container->translations['field_config'.'multiple'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n //cloud\n 'threeDee' => [\n 'title' => $this->container->translations['field_config'.'threeDee'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'history_command' => [\n 'title' => $this->container->translations['field_config'.'history_command'],\n 'format' => 'select',\n 'propertyOrder' => -1,\n 'uniqueItems' => true,\n 'type' => 'string',\n 'enum' => $historytypes['id'],\n 'options' => [\n 'enum_titles' => $historytypes['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //legends\n 'legends' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'legends'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string'\n ]\n ],\n //fixed\n 'fixedvalues' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'fixedvalues'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'fixedvalues'.'row'],\n ]\n ],\n //issues, cloud, self, contributional\n 'restrict_to_open' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_open'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n // not implemented so far\n 'restrict_to_book' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_book'],\n 'type' => 'boolean',\n 'propertyOrder' => 2,\n 'format' => 'checkbox'\n ],\n //issues, chapters\n 'frombook' => [\n 'title' => $this->container->translations['field_config'.'frombook'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 1,\n 'uniqueItems' => true,\n 'enum' => $frombook['id'],\n 'options' => [\n 'enum_titles' => $frombook['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other, self, contributional\n 'restrict_to_issue' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_issue'],\n 'type' => 'boolean',\n 'propertyOrder' => 4,\n 'format' => 'checkbox'\n ],\n //cloud, other, self, contributional\n 'fromissue' => [\n 'title' => $this->container->translations['field_config'.'fromissue'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 3,\n 'uniqueItems' => true,\n 'enum' => $fromissue['id'],\n 'options' => [\n 'enum_titles' => $fromissue['labels'],\n 'grid_columns' => 12,\n ]\n ],\n\n //contributional,\n 'restrict_to_chapter' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_chapter'],\n 'type' => 'boolean',\n 'propertyOrder' => 6,\n 'format' => 'checkbox'\n ],\n //contributional\n 'fromchapter' => [\n 'title' => $this->container->translations['field_config'.'fromchapter'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 5,\n 'uniqueItems' => true,\n 'enum' => $fromchapter['id'],\n 'options' => [\n 'enum_titles' => $fromchapter['labels'],\n 'grid_columns' => 12,\n ]\n ],\n // not implemented so far\n 'restrict_to_template' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_template'],\n 'type' => 'boolean',\n 'propertyOrder' => 9,\n 'format' => 'checkbox'\n ],\n //contributional, structural\n 'fromtemplate' => [\n 'title' => $this->container->translations['field_config'.'fromtemplate'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 8,\n 'uniqueItems' => true,\n 'enum' => $fromtemplate['id'],\n 'options' => [\n 'enum_titles' => $fromtemplate['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other\n 'fromfield' => [\n 'title' => $this->container->translations['field_config'.'fromfield'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 10,\n 'uniqueItems' => true,\n 'enum' => $fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'grid_columns' => 12,\n ]\n ],\n ],\n ];\n return json_encode($schema);\n }",
"private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}",
"abstract public function get_settings();",
"public function configdatabase(){\n\t\t$alreadyInstalled = $this->isInstalled();\n\t\t\n\t\t\n\t\t$showform = false;\n\t\t$errorMessage = '';\n\t\tif ($alreadyInstalled == false){\n\t\t\t\n\t\t\t// get request variables\n\t\t\t$sql_host = $this->request->getParameter(\"sql_host\");\n\t\t\t$login = $this->request->getParameter(\"login\");\n\t\t\t$password = $this->request->getParameter(\"password\");\n\t\t\t$db_name = $this->request->getParameter(\"db_name\");\n\t\t\t\n\t\t\t// test the connection\n\t\t\t$installModel = new CoreInstall();\n\t\t\t$testVal = $installModel->testConnection($sql_host, $login, $password, $db_name);\n\t\t\t//echo 'test connection return val = ' . $testVal . '-----'; \n\t\t\tif ($testVal == 'success'){\n\t\t\t\t// edit the config file\n\t\t\t\t$returnVal = $installModel->writedbConfig($sql_host, $login, $password, $db_name);\n\t\t\t\tif ($returnVal){\n\t\t\t\t\t$showform = false;\n\t\t\t\t\t$errorMessage = '';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$showform = true;\n\t\t\t\t\t$errorMessage = 'Cannot write the congif file. Please make sure that the application have the right for writing in Config/prod.ini' ;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$showform = true;\n\t\t\t\t$errorMessage = $testVal;\n\t\t\t\t//echo '$errorMessage = ' . $errorMessage . '-----';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->generateView ( array (\n\t\t\t\t'alreadyInstalled' => $alreadyInstalled, 'showform' => $showform, 'errorMessage' => $errorMessage\n\t\t) );\n\t\t\n\t}",
"public function getConfigData()\n {\n return [\n 'alias' => $this->getAlias(),\n 'dbName' => $this->getName(),\n 'dbHost' => $this->getHost(),\n 'dbType' => $this->getType(),\n 'dbUser' => $this->getUserName(),\n 'dbPass' => $this->getPassword()\n ];\n }",
"public function load() {\n\t\t$statement = $this -> db -> query(\"SELECT * FROM \" . FORUM_DB . \".forum_settings\");\n\t\twhile($settingData = $statement -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$this -> settings[$settingData['key']] = new ForumSetting($settingData['key'], $settingData['value']);\n\t\t}\n\t}",
"function install_settings()\n\t{\n\t\t//-----------------------------------------\n\t\t// Get DB\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( INS_KERNEL_PATH . 'class_db_' . $this->install->saved_data['sql_driver'] . '.php' );\t\t\n\t\t\n\t\t$this->install->ipsclass->init_db_connection( $this->install->saved_data['db_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_user'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pass'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_host'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pre'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->ipsclass->vars['mysql_codepage'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['sql_driver'] );\t\n\t\t//-----------------------------------------\n\t\t// Install settings\n\t\t//-----------------------------------------\n\t\n\t\t$output[] = \"Добавление настроек...\";\n\t\t$xml = new class_xml();\n\t\t$xml->lite_parser = 1;\n\t\t\n\t\t$content = implode( \"\", file( INS_DOC_ROOT_PATH . 'resources/settings.xml' ) );\n\t\t$xml->xml_parse_document( $content );\n\n\t\t//-----------------------------------------\n\t\t// Known settings\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( substr( $this->install->saved_data['install_url'], -1 ) == '/' )\n\t\t{\n\t\t\t$this->install->saved_data['install_url'] = substr( $this->install->saved_data['install_url'], 0, -1 );\n\t\t}\n\t\t\n\t\t$_urls = parse_url( $this->install->saved_data['install_url'] );\n\t\t\n\t\t$known = array( 'email_in' => $this->install->saved_data['admin_email'],\n\t\t\t\t\t\t 'email_out' => $this->install->saved_data['admin_email'],\n\t\t\t\t\t\t 'base_dir' => $this->install->saved_data['install_dir'],\n\t\t\t\t\t\t 'upload_dir' => $this->install->saved_data['install_dir'] . '/uploads',\n\t\t\t\t\t\t 'upload_url' => $this->install->saved_data['install_url'] . '/uploads',\n\t\t\t\t\t\t 'search_sql_method' => $this->install->ipsclass->DB->sql_can_fulltext() ? 'ftext' : 'man',\n\t\t\t\t\t\t //'cookie_domain' => $_urls['host'] != 'localhost' ? '.' . preg_replace( \"#^(?:.+?\\.)?([a-z0-9\\-]{3,})\\.(([a-z]{2,4})(\\.([a-z]{2}))?|museum)$#is\", \"\\\\1.\\\\2\", $_urls['host'] ) : '',\n\t\t\t\t\t );\n\t\t\t\t\t\n\t\t//-----------------------------------------\n\t\t// Parse\n\t\t//-----------------------------------------\n\n\t\t$fields = array( 'conf_title' , 'conf_description', 'conf_group' , 'conf_type' , 'conf_key' , 'conf_default',\n\t\t\t\t\t\t 'conf_extra' , 'conf_evalphp' , 'conf_protected', 'conf_position', 'conf_start_group', 'conf_end_group',\n\t\t\t\t\t\t 'conf_help_key', 'conf_add_cache' , 'conf_title_keyword' );\n\n\t\t$setting_fields = array( 'conf_title_keyword', 'conf_title_title', 'conf_title_desc', 'conf_title_noshow', 'conf_title_module' );\n\n\t\t//-----------------------------------------\n\t\t// Fix up...\n\t\t//-----------------------------------------\n \n\t\tif ( ! is_array( $xml->xml_array['settingexport']['settinggroup']['setting'][0] ) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Ensure [0] is populated\n\t\t\t//-----------------------------------------\n\n\t\t\t$tmp = $xml->xml_array['settingexport']['settinggroup']['setting'];\n\n\t\t\tunset($xml->xml_array['settingexport']['settinggroup']['setting']);\n\n\t\t\t$xml->xml_array['settingexport']['settinggroup']['setting'][0] = $tmp;\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Loop through and sort out settings...\n\t\t//-----------------------------------------\n\n\t\tforeach( $xml->xml_array['settingexport']['settinggroup']['setting'] as $id => $entry )\n\t\t{\n\t\t\t$newrow = array();\n\n\t\t\t//-----------------------------------------\n\t\t\t// Is setting?\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( ! $entry['conf_is_title']['VALUE'] )\n\t\t\t{\n\t\t\t\tforeach( $fields as $f )\n\t\t\t\t{\n\t\t\t\t\t$newrow[$f] = $entry[ $f ]['VALUE'];\n\t\t\t\t}\n\n\t\t\t\t$new_settings[] = $newrow;\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Is title?\n\t\t\t//-----------------------------------------\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach( $setting_fields as $f )\n\t\t\t\t{\n\t\t\t\t\t$newrow[$f] = $entry[ $f ]['VALUE'];\n\t\t\t\t}\n\n\t\t\t\t$new_titles[] = $newrow;\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Sort out titles...\n\t\t//-----------------------------------------\n\n\t\tif ( is_array( $new_titles ) and count( $new_titles ) )\n\t\t{\n\t\t\tforeach( $new_titles as $idx => $data )\n\t\t\t{\n\t\t\t\tif ( $data['conf_title_title'] AND $data['conf_title_keyword'] )\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Get ID based on key\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$save = array( 'conf_title_title' => $data['conf_title_title'],\n\t\t\t\t\t\t\t\t 'conf_title_desc' => $data['conf_title_desc'],\n\t\t\t\t\t\t\t\t 'conf_title_keyword' => $data['conf_title_keyword'],\n\t\t\t\t\t\t\t\t 'conf_title_noshow' => $data['conf_title_noshow'],\n\t\t\t\t\t\t\t\t 'conf_title_module' => $data['conf_title_module'] );\n\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Insert first\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$this->install->ipsclass->DB->do_insert( 'conf_settings_titles', $save );\n\n\t\t\t\t\t$conf_id = $this->install->ipsclass->DB->get_insert_id();\n\t\t\t\t\t$save['conf_title_id'] = $conf_id;\n\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Update settings cache\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$setting_groups_by_key[ $save['conf_title_keyword'] ] = $save;\n\t\t\t\t\t$setting_groups[ $save['conf_title_id'] ] = $save;\n\n\t\t\t\t\t$need_update[] = $conf_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Sort out settings\n\t\t//-----------------------------------------\n\n\t\tif ( is_array( $new_settings ) and count( $new_settings ) )\n\t\t{\n\t\t\tforeach( $new_settings as $idx => $data )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Insert known\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\tif ( in_array( $data['conf_key'], array_keys( $known ) ) )\n\t\t\t\t{\n\t\t\t\t\t$data['conf_value'] = $known[ $data['conf_key'] ];\n\t\t\t\t\t#$data['conf_default'] = $known[ $data['conf_key'] ];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['conf_value'] = '';\n\t\t\t\t}\n\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Now assign to the correct ID based on\n\t\t\t\t// our title keyword...\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$data['conf_group'] = $setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id'];\n\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Remove from array\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\tunset( $data['conf_title_keyword'] );\n\n\t\t\t\t$this->install->ipsclass->DB->do_insert( 'conf_settings', $data );\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Update group counts...\n\t\t//-----------------------------------------\n\n\t\tif ( count( $need_update ) )\n\t\t{\n\t\t\tforeach( $need_update as $i => $idx )\n\t\t\t{\n\t\t\t\t$conf = $this->install->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as count', 'from' => 'conf_settings', 'where' => 'conf_group='.$idx ) );\n\n\t\t\t\t$count = intval($conf['count']);\n\n\t\t\t\t$this->install->ipsclass->DB->do_update( 'conf_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$idx );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->install->template->append( $this->install->template->install_page_refresh( $output ) );\n\t\t$this->install->template->next_action = '?p=install&sub=acpperms';\n\t\t$this->install->template->hide_next = 1;\n\t}",
"function DataAccessManager() {\r\n\t\t@session_start();\r\n\t\t//Assumes that if settings are not in current directory, they're one directory up.\r\n\t\tif( file_exists('./settings.php') ) {\r\n\t\t\t$file = fopen('./settings.php', 'rb');\r\n\t\t}\r\n\t\telse if( file_exists( '../settings.php') ) {\r\n\t\t\t$file = fopen('../settings.php', 'rb');\r\n\t\t}\r\n\t\t\r\n\t\tif($file){\r\n\t\t\tfor($i = 0; !feof($file); $i++){\r\n\t\t\t\t$input = fgets($file);\r\n\t\t\t\tif (strpos($input, ':') !== FALSE){\r\n\t\t\t\t\t$input = explode(':', $input);\r\n\t\t\t\t\t$$input[0] = trim($input[1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->success = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->dbname = $name;\r\n\t\tfclose($file);\r\n\t\t@$this->link = mysql_connect($host, $user, $pass);\r\n\t\tif(!$this->link){\r\n\t\t\techo \"<br>Could not connect to database. Please try again later.<br>\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tmysql_select_db($name);\r\n\t\t$this->success = true;\r\n\t}",
"private static function initDB(){\n //otvori subor casopis.conf\n $file=fopen(\"casopis.conf\", \"r\",true);\n if(!$file)\n die (\"Nemozem otvorit subor\");\n \n $temp=\"\";\n $id=\"\";\n \n $server=\"\";\n $login=\"\";\n $password=\"\";\n $database=\"\";\n \n //nacitanie konfiguracneho suboru\n \n while(!feof($file)){\n $temp= fgets($file);\n \n //odstranenie bielych znakov zo zaciatku a konca riadku\n $temp=trim($temp);\n //odignoruje prazdne riadky a riadky obsahujuce znak #\n if(strstr($temp,\"#\"))\n continue;\n if(!strcmp($temp, \"\"))\n continue; \n \n list($id,$temp)=explode(\": \", $temp);\n $id=trim($id);\n $temp=trim($temp);\n \n //nastavi premenne server,login, password a database podla hodnot konfiguracneho suboru\n if(!strcmp($id, \"server\")){\n $server=$temp;\n continue;\n }\n if(!strcmp($id,\"login\")){\n $login=$temp;\n continue;\n }\n if(!strcmp($id, \"psswd\")){\n $password=$temp;\n continue;\n }\n if(!strcmp($id,\"dbase\")){\n $database=$temp;\n continue;\n }\n \n }\n fclose($file);\n \n //vytvori instanciu triedy.\n static::$default_database=new CDatabaza($server, $login, $password, $database);\n if(!static::$default_database->connected)\n static::$default_database=null;\n else\n static::$default_database->connected=false;\n \n }",
"function read_sDBSQL() {\n\t\t// CONNECT TO SQL SERVER\n\t\tif (!$con = @mysql_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD)) {\n\t\t\t$message = 'MySQL-Error: No connect!';\n\t\t\tinclude('admin/fatal_error.php');\n\t\t\texit();\n\t\t}\n\t\t// SELECT DATABASE\n\t\tif (!$cDB = @mysql_select_db(DB_NAME, $con)) {\n\t\t\t$message = 'MySQL-Error: Database couldn\\'t be selected!';\n\t\t\tinclude('admin/fatal_error.php');\n\t\t\texit();\n\t\t}\n\t\t// GET SETTINGS\n\t\t$query = 'SELECT * FROM `mg2db_settings` WHERE 1';\n\t\tif ($result = mysql_query($query)) {\n\t\t\t$values = mysql_fetch_array($result,MYSQL_ASSOC);\n\t\t\tif (is_array($values)) {\n\t\t\t\tforeach($values as $key=>$setting) {\n\t\t\t\t\t$this->$key = $setting;\n\t\t\t\t}\n\t\t\t\tsettype($this->metasetting, 'integer');\n\t\t\t\tsettype($this->navtype, 'integer');\n\t\t\t\tsettype($this->showexif, 'integer');\n\t\t\t\tsettype($this->commentsets, 'integer');\n\t\t\t\tsettype($this->foldersetting, 'integer');\n\t\t\t\tsettype($this->layoutsetting, 'integer');\n\t\t\t\tsettype($this->thumbMaxWidth, 'integer');\n\t\t\t\tsettype($this->thumbMaxHeight, 'integer');\n\t\t\t\tsettype($this->imagecols, 'integer');\n\t\t\t\tsettype($this->imagerows, 'integer');\n\t\t\t\tsettype($this->inactivetime, 'integer');\n\t\t\t\tsettype($this->extendedset, 'integer');\n\t\t\t\tsettype($this->installdate, 'integer');\n\t\t\t}\n\t\t}\n\t}",
"private function createMainDatabaseRecords()\n {\n // get the .sql file\n $sql = (string) @file_get_contents( $this->plugin->getPath() . \"/Setup/install.sql\" );\n\n // insert it\n $this->db->exec( $sql );\n }",
"public function storeLanguagesVarsToDB(): void\n {\n foreach ($this->getDirsWithLanguages() as $lang => $dir) {\n $fs = new Filesystem();\n $files = $fs->files($dir);\n foreach ($files as $fileName) {\n $filePath = $dir . \"/\" . $fileName->getRelativePathname();\n $array = (file_exists($filePath)) ? require($filePath) : [];\n $this->saveLanguageValueToDB(basename($fileName->getRelativePathname(), \".php\"), $lang, [], $array);\n }\n }\n }",
"public function write_db_config() {\r\n $template = file_get_contents(MODULES . 'install/assets/config/database.php');\r\n\r\n $replace = array(\r\n '__HOSTNAME__' => $this->hostname,\r\n '__USERNAME__' => $this->username,\r\n '__PASSWORD__' => $this->password,\r\n '__DATABASE__' => $this->database,\r\n '__PORT__' => $this->port,\r\n '__DRIVER__' => $this->driver,\r\n '__PREFIX__' => $this->prefix,\r\n );\r\n\r\n $template = str_replace(array_keys($replace), $replace, $template);\r\n\r\n $handle = @fopen(APPPATH . 'config/database.php', 'w+');\r\n\r\n if ($handle !== FALSE) {\r\n $response = @fwrite($handle, $template);\r\n fclose($handle);\r\n\r\n if ($response) {\r\n return TRUE;\r\n }\r\n }\r\n\r\n throw new Exception('Failed to write to ' . APPPATH . 'config/database.php');\r\n }",
"public function __construct()\n\t{\n\n\t\tparent::__construct();\n\n\t\t/** \n\t\t * Using the fields from baseSettings, assign a new entry\n\t\t * to each variable.\n\t\t *\n\t\t * @param Each array has the new setting plus a description of each entry\n\t\t */ \n\n\t\t$this->newSettings = array(\n\t \t'webRoot'\t\t=> \tarray($this->webRoot,\t'Specify the folder your websites will reside'),\n\t \t'hostsFile'\t\t=> \tarray($this->hostsFile,\t'Specify your hosts file location'),\n\t \t'vhostsFile'\t=> \tarray($this->vhostsFile,\t'Specify your vhosts.conf location'),\n\t \t'rootHttpd'\t\t=> \tarray($this->rootHttpd,\t'Where do you put your websites?')\n\t \t);\n\n\t\tvar_dump($this->newSettings);\n\n\t \t/** \n\t\t * Get a list of the variables in the scope before including the file\n\t\t *\n\t\t * @var stores current variables\n\t\t */\n\n\t\t$this->oldVar = get_defined_vars();\n\n\t\t/** \n\t\t * Include the config file and get it's values\n\t\t *\n\t\t * @var stores variables of current config (before update)\n\t\t */\n\n\n\t\tif (is_file($this->filePath))\n\t\t{\n\t\t require_once($this->filePath);\n\t\t header(\"settingsSaved: 1\");\n\t\t} else {\n\t\t\theader(\"settingsSaved: Error: unable to load config\");\n\t\t}\n\t\t/** \n\t\t * Get a list of the variables in the scope after including the file\n\t\t *\n\t\t * @var stores variables of current config (after update)\n\t\t */\n\n\t\t$this->newVar = get_defined_vars();\n\n\t\t/** \n\t\t * Find the difference - after this, $fileSettings \n\t\t * contains only the variables declared in the file\n\t\t *\n\t\t * @var stores contains new variables.\n\t\t */\n\n\t\t$this->fileSettings = array_diff($this->newVar, $this->oldVar);\n\n\t\t/** \n\t\t * Update $fileSettings with any new values \n\t\t *\n\t\t * @var string stores new variables.\n\t\t */\n\n\t\t// \n\t\t$this->fileSettings = array_merge($this->fileSettings, $this->newSettings);\n\n\t}",
"function probe_db_access($file_base)\n\t{\n\t\t$dbname='';\n\t\t$dbuser='';\n\t\t$dbpasswd='';\n\t\t$table_prefix='';\n\t\tif (!file_exists($file_base.'/config.php'))\n\t\t\twarn_exit(do_lang_tempcode('BAD_IMPORT_PATH',escape_html('config.php')));\n\t\trequire($file_base.'/config.php');\n\t\t$INFO=array();\n\t\t$INFO['sql_database']=$dbname;\n\t\t$INFO['sql_user']=$dbuser;\n\t\t$INFO['sql_pass']=$dbpasswd;\n\t\t$INFO['sql_tbl_prefix']=$table_prefix;\n\n\t\treturn array($INFO['sql_database'],$INFO['sql_user'],$INFO['sql_pass'],$INFO['sql_tbl_prefix']);\n\t}",
"public function databaseConfig() {\n\t\t$dbs = new DATABASE_CONFIG();\n\t\t$list = array();\n\t\t$counter = 1;\n\n\t\t$this->out('Possible database configurations:');\n\n\t\tforeach ($dbs as $db => $config) {\n\t\t\t$this->out('[' . $counter . '] ' . $db);\n\t\t\t$list[$counter] = $db;\n\t\t\t$counter++;\n\t\t}\n\n\t\t$this->out();\n\n\t\t$answer = strtoupper($this->in('Which database should the tables be created in?', array_keys($list)));\n\n\t\tif (isset($list[$answer])) {\n\t\t\t$this->install['database'] = $list[$answer];\n\t\t\t$this->db = ConnectionManager::getDataSource($this->install['database']);\n\n\t\t} else {\n\t\t\treturn $this->databaseConfig();\n\t\t}\n\n\t\treturn true;\n\t}",
"public function saveConfVars()\n {\n if ($this->getEditObjectId() === 'findologic_module') {\n $this->_saveConfVars();\n } else {\n parent::saveConfVars();\n }\n }",
"protected function createDatabaseStructure() {}",
"private function _loadPageSettings(){\r\n\r\n $uri = $this->_getContentURI();\r\n $settings = ROOT.DS.'site'.DS.'content'.DS.$uri.DS.'settings.json';\r\n\r\n if(file_exists($settings)){\r\n $this->pageSettings = json_decode(file_get_contents($settings));\r\n } else {\r\n $page_dir = ROOT.DS.'site'.DS.'content';\r\n foreach(explode('/', $uri) as $dir){\r\n $page_dir .= DS.$dir;\r\n if(!file_exists($page_dir)){\r\n mkdir($page_dir);\r\n }\r\n }\r\n $pageSettings = new stdClass();\r\n $pageSettings->page_title = '';\r\n $pageSettings->page_script = '';\r\n file_put_contents($settings, json_encode($pageSettings));\r\n }\r\n\r\n }",
"public function getDatabaseConfig() : array{\n \treturn $this->getConfig()->getAll()[\"mysql\"];\n }",
"protected static function getSettingData()\r\n\t{\r\n\t\t$return = [];\r\n\t\tif(file_exists(__DIR__ . '/settings.json'))\r\n\t\t{\r\n\t\t\t$return = static::expandData(file_get_contents(__DIR__ . '/settings.json'));\r\n\t\t\tif(defined(\"C_REST_CLIENT_ID\") && !empty(C_REST_CLIENT_ID))\r\n\t\t\t{\r\n\t\t\t\t$return['C_REST_CLIENT_ID'] = C_REST_CLIENT_ID;\r\n\t\t\t}\r\n\t\t\tif(defined(\"C_REST_CLIENT_SECRET\") && !empty(C_REST_CLIENT_SECRET))\r\n\t\t\t{\r\n\t\t\t\t$return['C_REST_CLIENT_SECRET'] = C_REST_CLIENT_SECRET;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $return;\r\n\t}",
"protected function loadExtLocalconfDatabaseAndExtTables() {}",
"abstract protected static function get_db_file_path();",
"function ini_creater($dsname, $dbname, $dbtype, $username, $password, $host, $port, $description, $trace, $tracefile , $enable){\n\n $mysql_data = \n\"\n[$dsname]\nDescription = $description\nDriver = $dbtype\nDatabase = $dbname\nServer = $host\nUser = $username\nPassword = $password\nPort = $port\n\"; \n\n $psql_data = \n\"\n[$dsname]\nDescription = $description\nDriver = $dbtype\nTraceFile = $tracefile\nTrace = $trace\nDatabase = $dbname\nServername = $host\nUsername = $username\nPassword = $password\nPort = $port\n\"; \n\n $mssql_data = \n\"\n[$dsname]\nDescription = $description\nDriver = $dbtype\nServer = $host\nDatabase = $dbname\nPort = $port\nUsername = $username\nPassword = $password\nTraceFile = $tracefile\nTrace = $trace\nTDS_Version = 4.2\n\"; \n\n if ($dbtype == 'MySQL') $data = $mysql_data;\n else if ($dbtype == 'PostgreSQL') $data = $psql_data;\n else if ($dbtype == 'MSSQL') $data = $mssql_data;\n\n $fname = \"\".rand(5, 1577).\".ini\";\n $myFile = \"/etc/asterisk/$fname\";\n $fh = fopen($myFile, 'w') or die(\"can't open file\");\n fwrite($fh, $data);\n fclose($fh);\n return $myFile;\n}",
"public function getBasicSettingsValues()\n\t{\n\t\t$values = array();\n\n\t\t$values[\"webspace_dir\"] = getcwd().\"/data\";\n\t\t$values[\"data_dir\"] = $this->setup->ini->readVariable(\"clients\",\"datadir\");\n\t\t$values[\"convert_path\"] = $this->setup->ini->readVariable(\"tools\",\"convert\");\n\t\t$values[\"zip_path\"] = $this->setup->ini->readVariable(\"tools\",\"zip\");\n\t\t$values[\"unzip_path\"] = $this->setup->ini->readVariable(\"tools\",\"unzip\");\n\t\t$values[\"ghostscript_path\"] = $this->setup->ini->readVariable(\"tools\",\"ghostscript\");\n\t\t$values[\"java_path\"] = $this->setup->ini->readVariable(\"tools\",\"java\");\n\t\t$values[\"htmldoc_path\"] = $this->setup->ini->readVariable(\"tools\",\"htmldoc\");\n\t\t//$values[\"mkisofs_path\"] = $this->setup->ini->readVariable(\"tools\",\"mkisofs\");\n\t\t$values[\"ffmpeg_path\"] = $this->setup->ini->readVariable(\"tools\",\"ffmpeg\");\n\t\t$values[\"latex_url\"] = $this->setup->ini->readVariable(\"tools\",\"latex\");\n\t\t$values[\"fop_path\"] = $this->setup->ini->readVariable(\"tools\",\"fop\");\n\t\t$values[\"vscanner_type\"] = $this->setup->ini->readVariable(\"tools\", \"vscantype\");\n\t\t$values[\"scan_command\"] = $this->setup->ini->readVariable(\"tools\", \"scancommand\");\n\t\t$values[\"clean_command\"] = $this->setup->ini->readVariable(\"tools\", \"cleancommand\");\n\t\t$values[\"log_path\"] = $this->setup->ini->readVariable(\"log\",\"path\").\"/\".\n\t\t\t$this->setup->ini->readVariable(\"log\",\"file\");\n\t\t$values[\"chk_log_status\"] = !$this->setup->ini->readVariable(\"log\",\"enabled\");\n\t\t$values[\"time_zone\"] = $this->setup->ini->readVariable(\"server\", \"timezone\");\n\t\t\n\t\t// https settings\n\t\t$values[\"auto_https_detect_enabled\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_enabled\");\n\t\t$values[\"auto_https_detect_header_name\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_header_name\");\n\t\t$values[\"auto_https_detect_header_value\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_header_value\");\n\n\t\t$this->form->setValuesByArray($values);\n\t}",
"protected function defineSettings()\n\t{\n\t\treturn array(\n\t\t\t// set a custom plugin name for the control panel\n\t\t\t\"pluginName\" => array(AttributeType::String, 'default' => 'Asset Management'),\n\n\t\t\t\"sanitizeFilenames\" => array(AttributeType::Bool, 'default' => false), // will make sure that our file-names do not mess up urls\n\t\t\t\"addTimestampToFilename\" => array(AttributeType::Bool, 'default' => false), // adds a timestamp to each file\n\t\t\t\"preventFileReplacement\" => array(AttributeType::Bool, 'default' => false), // prevents replacement of files\n\n\t\t\t// the error message to show, if replacement of files is prevented\n\t\t\t\"replacementErrorMessage\" => array(AttributeType::String , 'default' => 'Replacement of files has been disabled by the administrator')\n\t\t);\n\t}",
"private function defaultSettings()\n {\n\t\t$default_config = array(\n 'Plugins.Keypic.SigninEnabled' => false,\n\t\t\t 'Plugins.Keypic.SignupEnabled' => true,\n\t\t\t 'Plugins.Keypic.PostEnabled' => true,\n\t\t\t 'Plugins.Keypic.CommentEnabled' => true,\n\t\t\t 'Plugins.Keypic.SigninWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.SignupWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.PostWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.CommentWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.SignupRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.SigninRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.PostRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.CommentRequestType' => 'getScript',\n\t\t );\n\t\t \n\t\tSaveToConfig($default_config);\n }",
"protected function define_settings() {\n\n // All the settings related to this activity will include this prefix\n $settingprefix = $this->info->modulename . '_' . $this->info->moduleid . '_';\n\n // All these are common settings to be shared by all activities\n\n // Define activity_include (to decide if the whole task must be really executed)\n // Dependent of:\n // - activities root setting\n // - section_included setting (if exists)\n $settingname = $settingprefix . 'included';\n $activity_included = new restore_activity_generic_setting($settingname, base_setting::IS_BOOLEAN, true);\n $activity_included->get_ui()->set_icon(new image_icon('icon', get_string('pluginname', $this->modulename),\n $this->modulename, array('class' => 'iconlarge icon-post')));\n $this->add_setting($activity_included);\n // Look for \"activities\" root setting\n $activities = $this->plan->get_setting('activities');\n $activities->add_dependency($activity_included);\n // Look for \"section_included\" section setting (if exists)\n $settingname = 'section_' . $this->info->sectionid . '_included';\n if ($this->plan->setting_exists($settingname)) {\n $section_included = $this->plan->get_setting($settingname);\n $section_included->add_dependency($activity_included);\n }\n\n // Define activity_userinfo. Dependent of:\n // - users root setting\n // - section_userinfo setting (if exists)\n // - activity_included setting.\n $settingname = $settingprefix . 'userinfo';\n $defaultvalue = false;\n if (isset($this->info->settings[$settingname]) && $this->info->settings[$settingname]) { // Only enabled when available\n $defaultvalue = true;\n }\n\n $activity_userinfo = new restore_activity_userinfo_setting($settingname, base_setting::IS_BOOLEAN, $defaultvalue);\n if (!$defaultvalue) {\n // This is a bit hacky, but if there is no user data to restore, then\n // we replace the standard check-box with a select menu with the\n // single choice 'No', and the select menu is clever enough that if\n // there is only one choice, it just displays a static string.\n //\n // It would probably be better design to have a special UI class\n // setting_ui_checkbox_or_no, rather than this hack, but I am not\n // going to do that today.\n $activity_userinfo->set_ui(new backup_setting_ui_select($activity_userinfo, '-',\n array(0 => get_string('no'))));\n } else {\n $activity_userinfo->get_ui()->set_label('-');\n }\n\n $this->add_setting($activity_userinfo);\n\n // Look for \"users\" root setting\n $users = $this->plan->get_setting('users');\n $users->add_dependency($activity_userinfo);\n\n // Look for \"section_userinfo\" section setting (if exists)\n $settingname = 'section_' . $this->info->sectionid . '_userinfo';\n if ($this->plan->setting_exists($settingname)) {\n $section_userinfo = $this->plan->get_setting($settingname);\n $section_userinfo->add_dependency($activity_userinfo);\n }\n\n // Look for \"activity_included\" setting.\n $activity_included->add_dependency($activity_userinfo);\n\n // End of common activity settings, let's add the particular ones.\n $this->define_my_settings();\n }",
"function load_settings(){\n $ret = array();\n $c = $this->_files->readfile($this->_settings_file);\n if( $c !== false ){\n $c = explode( \"\\n\", eol($c));\n foreach( $c as $line ){\n //ignore a lot of stuff - quick hack for now\n if(substr($line, 0, 1) != '#'\n && trim($line) != ''\n && substr($line, 0, 4) != 'LANG'\n && substr($line, 0, 1) != '#'\n && substr($line, 0, 11) != 'export LANG'\n && substr($line, 0, 4) != 'bold'\n && substr($line, 0, 6) != 'normal' ){\n $set = explode('=', $line);\n $ret[$set[0]] = trim($set[1], '\"\\''); //this should now be one setting per key with setting name as key\n }\n }\n\n if( count($ret) > 0 ){\n $_SESSION['settings.conf'] = $ret;\n return $_SESSION['settings.conf'];\n }\n }else{\n unset($_SESSION['settings.conf']);\n return false;\n }\n }",
"protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}",
"public function run()\n {\n \n\n \\DB::table('sys_settings')->delete();\n \n \\DB::table('sys_settings')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'setting_key' => 'departments',\n 'setting_value' => 'a:53:{s:2:\"PM\";s:15:\"PEJABAT MENTERI\";s:3:\"PKE\";s:23:\"PEJABAT KETUA EKSEKUTIF\";s:5:\"DASAR\";s:31:\"CAWANGAN DASAR DAN PENYELIDIKAN\";s:5:\"AUDIT\";s:16:\"UNIT AUDIT DALAM\";s:3:\"PUU\";s:18:\"UNIT UNDANG-UNDANG\";s:3:\"UKK\";s:28:\"CAWANGAN KOMUNIKASI KORPORAT\";s:14:\"PENGUATKUASAAN\";s:23:\"CAWANGAN PENGUATKUASAAN\";s:3:\"LOD\";s:21:\"Seksyen LOD Dan Saman\";s:8:\"SIASATAN\";s:16:\"Seksyen Siasatan\";s:11:\"CARIAN_KHAS\";s:19:\"Seksyen Carian Khas\";s:3:\"PNP\";s:37:\"CAWANGAN PENDAFTARAN DAN PENENTUSAHAN\";s:3:\"PBP\";s:33:\"PEJABAT PENGURUS BESAR PENGURUSAN\";s:10:\"PENGURUSAN\";s:27:\"BAHAGIAN KHIDMAT PENGURUSAN\";s:3:\"PSM\";s:34:\"CAWANGAN PENGURUSAN SUMBER MANUSIA\";s:9:\"INTEGRITI\";s:14:\"Unit Integriti\";s:5:\"ADMIN\";s:20:\"CAWANGAN PENTADBIRAN\";s:3:\"BPM\";s:28:\"BAHAGIAN PENGURUSAN MAKLUMAT\";s:5:\"INFRA\";s:38:\"CAWANGAN INFRASTRUKTUR DAN OPERASI ICT\";s:10:\"MULTIMEDIA\";s:28:\"CAWANGAN APLIKASI MULTIMEDIA\";s:8:\"APLIKASI\";s:39:\"Seksyen Penyelenggaraan Aplikasi Sistem\";s:11:\"DEVELOPMENT\";s:43:\"Seksyen Pembangunan Aplikasi dan Multimedia\";s:2:\"BW\";s:47:\"BAHAGIAN KEWANGAN KORPORAT, PELABURAN DAN AKAUN\";s:19:\"PENGURUSAN_KEWANGAN\";s:29:\"CAWANGAN PENGURUSAN KEWANGAN\";s:3:\"KEW\";s:16:\"Seksyen Kewangan\";s:9:\"PEROLEHAN\";s:17:\"Seksyen Perolehan\";s:9:\"PELABURAN\";s:28:\"CAWANGAN PELABURAN DAN AKAUN\";s:8:\"INSURANS\";s:28:\"Seksyen Bayaran dan Insurans\";s:8:\"TERIMAAN\";s:30:\"Seksyen Terimaan dan Pelaburan\";s:3:\"PBO\";s:30:\"PEJABAT PENGURUS BESAR OPERASI\";s:4:\"BPPL\";s:36:\"BAHAGIAN PENGURUSAN PINJAMAN LATIHAN\";s:10:\"ARAH_BAYAR\";s:15:\"Unit Arah Bayar\";s:10:\"PERJANJIAN\";s:15:\"Unit Perjanjian\";s:10:\"PEMBIAYAAN\";s:38:\"BAHAGIAN PENGURUSAN PEMBIAYAAN LATIHAN\";s:10:\"PERMOHONAN\";s:15:\"Unit Permohonan\";s:2:\"RD\";s:30:\"CAWANGAN REKOD DAN DOKUMENTASI\";s:2:\"FP\";s:34:\"Seksyen Fail Penyelenggaraan Rekod\";s:2:\"BB\";s:22:\"BAHAGIAN BAYARAN BALIK\";s:5:\"NOTIS\";s:27:\"CAWANGAN PUNGUTAN DAN NOTIS\";s:14:\"KAWALAN_KREDIT\";s:23:\"CAWANGAN KAWALAN KREDIT\";s:11:\"PENANGGUHAN\";s:19:\"Seksyen Penangguhan\";s:5:\"CCRIS\";s:26:\"Seksyen CCRIS Dan Insentif\";s:9:\"HAPUSKIRA\";s:35:\"Seksyen Penstrukturan Dan Hapuskira\";s:14:\"KUTIPAN_CARIAN\";s:32:\"CAWANGAN AGEN KUTIPAN DAN CARIAN\";s:7:\"KUTIPAN\";s:20:\"Seksyen Agen Kutipan\";s:6:\"CARIAN\";s:19:\"Seksyen Agen Carian\";s:5:\"UTCKL\";s:16:\"UTC Kuala Lumpur\";s:8:\"UTCPERAK\";s:9:\"UTC Perak\";s:9:\"UTCPAHANG\";s:10:\"UTC Pahang\";s:8:\"UTCJOHOR\";s:9:\"UTC Johor\";s:9:\"UTCMELAKA\";s:10:\"UTC Melaka\";s:8:\"UTCKEDAH\";s:9:\"UTC Kedah\";s:10:\"UTCSARAWAK\";s:11:\"UTC Sarawak\";s:8:\"UTCSABAH\";s:9:\"UTC Sabah\";}',\n 'created_at' => '2021-01-07 07:50:31',\n 'updated_at' => '2021-01-07 07:50:31',\n ),\n 1 => \n array (\n 'id' => 5,\n 'setting_key' => 'file-expire-warning',\n 'setting_value' => 'a:1:{i:0;s:1:\"3\";}',\n 'created_at' => '2020-10-15 09:38:02',\n 'updated_at' => '2020-10-15 09:38:02',\n ),\n 2 => \n array (\n 'id' => 6,\n 'setting_key' => 'bilik_fail',\n 'setting_value' => 'a:4:{i:0;s:30:\"CAWANGAN REKOD DAN DOKUMENTASI\";i:1;s:34:\"Seksyen Fail Penyelenggaraan Rekod\";i:2;s:18:\"UNIT UNDANG-UNDANG\";i:3;s:20:\"CAWANGAN PENTADBIRAN\";}',\n 'created_at' => '2020-12-30 05:44:01',\n 'updated_at' => '2020-12-30 05:44:01',\n ),\n 3 => \n array (\n 'id' => 7,\n 'setting_key' => 'rak',\n 'setting_value' => 'a:2:{i:0;s:0:\"\";i:1;i:1;}',\n 'created_at' => '2021-01-07 06:32:41',\n 'updated_at' => '2021-01-07 06:33:07',\n ),\n 4 => \n array (\n 'id' => 8,\n 'setting_key' => 'tingkat',\n 'setting_value' => 'a:5:{i:0;s:0:\"\";i:1;s:1:\"3\";i:2;s:1:\"1\";i:3;s:1:\"5\";i:4;s:1:\"2\";}',\n 'created_at' => '2021-01-07 00:33:10',\n 'updated_at' => '2021-01-07 00:33:10',\n ),\n 5 => \n array (\n 'id' => 9,\n 'setting_key' => 'seksyen',\n 'setting_value' => 'a:2:{i:0;s:0:\"\";i:1;i:1;}',\n 'created_at' => '2021-01-07 06:33:38',\n 'updated_at' => '2021-01-07 06:34:01',\n ),\n ));\n \n \n }",
"function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}",
"public function loadConfigs(): void\n {\n // main journal table name can be defined on the .env file to allow prefixes/schemas\n $this->internalTable = $_ENV['DB_JOURNAL_TABLE'] ?? $this->internalTable;\n\n // custom or default `created_at` column name\n $this->createdAtColumnName = $_ENV['DB_JOURNAL_CREATED_AT_COLUMN_NAME'] ?? $this->createdAtColumnName;\n\n // custom or default `updated_at` column name\n $this->updatedAtColumnName = $_ENV['DB_JOURNAL_UPDATED_AT_COLUMN_NAME'] ?? $this->updatedAtColumnName;\n\n if (empty($this->createdAtColumnName) || empty($this->updatedAtColumnName)) {\n throw new DbJournalConfigException(\"You cannot have an empty entry for DB_JOURNAL_CREATED_AT_COLUMN_NAME or DB_JOURNAL_UPDATED_AT_COLUMN_NAME on .env\");\n }\n\n // custom tables to journal\n if ($conf = $_ENV['DB_JOURNAL_TABLES_FILTER'] ?? null) {\n\n $this->tables = explode([',',', ',';','; ',PHP_EOL], $conf);\n\n if (empty($tables)) {\n throw new DbJournalConfigException(\"Invalid .env DB_JOURNAL_TABLES_FILTER configuration. Enter valid table names separated by comma `,`\");\n }\n\n }\n else {\n $this->tables = [];\n }\n }",
"function buddyexpressdesk_settings(){\n $settings = new stdClass;\n\t$GET = new BDESK_DB;\n $GET->statement('SELECT * FROM bdesk_site LIMIT 1');\n $GET->execute();\n\t$defaults = $GET->fetch();\n\tforeach ($defaults as $name => $value) {\n\t\tif (empty($paths->$name)) {\n\t\t\t$settings->$name = $value;\n\t\t}\n\t}\n\treturn $settings;\n}",
"protected function updateSettings()\n {\n $this->settings = array();\n $raw_settings = $this->db->fetchAll('SELECT name, value FROM settings');\n\n foreach ($raw_settings as $raw_setting) {\n $this->settings[$raw_setting['name']] = $raw_setting['value'];\n }\n }",
"private function _load_db()\n {\n $json_string = file_get_contents(\"dbtv.json\");\n $this->_db = json_decode($json_string, true);\n $this->_ep_list = $this->_flatten_episodes();\n }",
"private function _settings()\n\t{\n\t\tif(Utils::config('timestamps') or Utils::config('t'))\n\t\t\t$this->_timestamps = \"\\tpublic static \\$timestamps = true;\\n\\n\";\n\t}",
"function configurationRecord() {\n\t\t// open the global configuration file that contains the variables and their values\n\t\tif(!$file = @fopen($_SERVER['DOCUMENT_ROOT'].'/config/podserver_config.php', 'w')) {\n\t\t\t// if some error, tell it!\n\t\t\t$error = ERROR_CAN_NOT_OPEN_CONFIG_PODSERVER_PHP;\n\t\t\treturn $error;\n\t\t}\n\t\t// open the software configuration file that contains \"define\"s\n\t\tif(!$file_soft = @fopen($_SERVER['DOCUMENT_ROOT'].'/config.php', 'w')) {\n\t\t\t// if some error, tell it!\n\t\t\t$error = ERROR_CAN_NOT_OPEN_CONFIG_PODSERVER_PHP;\n\t\t\treturn $error;\n\t\t}\n\t\t// config file header\n\t\tfwrite($file, \"<?\\n// \".FILE_GENERATED_BY.\" PodServer Configuration\\n\");\n\t\tfwrite($file_soft, \"<?\\n// \".FILE_GENERATED_BY.\" PodServer Configuration\\n\");\n\t\t// write configuration variables into the \"config/config-podserver.php\" file\n\t\tforeach($_POST as $key=>$val) {\n\t\t\t// pass for some special entry (prefixed by 'f_')\n\t\t\tif(strstr($key,\"f_\")) continue;\n\t\t\t// consider DEF_ item as for this software installation configuration defines\n\t\t\telseif(strstr($key,\"DEF_\")) {\n\t\t\t\t$key = substr($key,4,strlen($key));\n\t\t\t\tfwrite($file_soft, \"define(\\\"$key\\\", \\\"$val\\\");\\n\");\n\t\t\t}\n\t\t\t// numeric or boolean values\n\t\t\telseif(is_numeric($val) || preg_match(\"/true|false/\",$val)) fwrite($file, \"\\$$key = $val;\\n\");\t\n\t\t\t// string values\n\t\t\telse fwrite($file, \"\\$$key = \\\"\".preg_replace(\"/[\\n|\\r|\\r\\n]+/\", \" \", trim($val)).\"\\\";\\n\");\n\n\t\t}\n\t\t\n\t\tfwrite($file_soft,\"define('PODSERVER_BAN','\".addslashes(\" ___ _ __ ____ ____ ___ _____ __ \\\\\\\\ || //\n| _ \\ (_) //\\\\\\\\ | ___|| _ \\| _ || _ \\ //\\\\\\\\ \\\\\\\\||//\n|| \\ \\| |// \\\\\\\\| |__ | (_)||| ||| (_) /// \\\\\\\\ ====()====\n|| | || |||__|||__ || ___/|| ||| / ||__|| //||\\\\\\\\\n||_/ /| ||| || __| || | ||_||| |\\ \\ || || // || \\\\\\\\\n|___/ |_||| |||____||_| |___||_| \\_\\|| || \").\"');\");\n\t\t\n\t\t// save uploaded files to the \"uploads\" directory\n\t\tforeach ($this->itemsConfiguration as $item){\n\t\t\tif ($item->type == 'file')\t{\n\t\t\t\tif ($_FILES[$item->name][\"error\"] > 0){\n\t\t\t\t\t$this->error = UPLOAD_FILE_ERROR;\t\n\t\t\t\t}else{\n\t\t\t\t\tmove_uploaded_file($_FILES[$item->name][\"tmp_name\"],$_SERVER['DOCUMENT_ROOT'].'/uploads/' . $item->name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// close tag PHP\n\t\tfwrite($file, \"?>\\n\");\n\t\tfwrite($file_soft, \"?>\\n\");\n\t\t// close the file\n\t\tfclose($file);\n\t\tfclose($file_soft);\n\t\treturn true;\n\t}",
"protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }",
"private function save_configuration_bundle() {\n\t\t$this->configuration_bundle = array();\n\t\t// Some items must always be saved + restored; others only on a migration\n\t\t// Remember, if modifying this, that a restoration can include restoring a destroyed site from a backup onto a fresh WP install on the same URL. So, it is not necessarily desirable to retain the current settings and drop the ones in the backup.\n\t\t$keys_to_save = array('updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_restore_in_progress');\n\n\t\tif ($this->old_siteurl != $this->our_siteurl || (defined('UPDRAFTPLUS_RESTORE_ALL_SETTINGS') && UPDRAFTPLUS_RESTORE_ALL_SETTINGS)) {\n\t\t\tglobal $updraftplus;\n\t\t\t$keys_to_save = array_merge($keys_to_save, $updraftplus->get_settings_keys());\n\t\t\t$keys_to_save[] = 'updraft_backup_history';\n\t\t}\n\n\t\tforeach ($keys_to_save as $key) {\n\t\t\t$this->configuration_bundle[$key] = UpdraftPlus_Options::get_updraft_option($key);\n\t\t}\n\t}",
"function _terminatur_settings_build_7($settings_file, &$databases) {\n // Open this way so we can append\n $fh = fopen($settings_file, 'a') or die(\"can't open file\");\n $output = '';\n\n // Generate the output\n $output .= \"\\n\";\n $output .= \"/** \\n\";\n $output .= \" * \" . TERMINATUR_VALIDATION_STRING . \" \\n\";\n $output .= \" * \\n\";\n $output .= \" * These local settings were generated by terminatur. \\n\";\n $output .= \" * You may see them if you use Kalastack, Kalabox, Proviso or other local dev tools. \\n\";\n $output .= \" * \\n\";\n $output .= \" */ \\n\";\n $output .= TERMINATUR_SETTINGS_CONDITIONAL . \" \\n\";\n $output .= \" // DB Array and some common conf \\n\";\n $output .= \" \\$databases['default']['default'] = array( \\n\";\n $output .= \" 'driver' => '\" . $databases['default']['default']['driver'] . \"',\\n\";\n $output .= \" 'database' => '\" . $databases['default']['default']['database'] . \"', \\n\";\n $output .= \" 'username' => '\" . $databases['default']['default']['username'] . \"',\\n\";\n $output .= \" 'password' => '\" . $databases['default']['default']['password'] . \"',\\n\";\n $output .= \" 'host' => '\" . $databases['default']['default']['host'] . \"',\\n\";\n $output .= \" 'port' => '\" . $databases['default']['default']['port'] . \"',\\n\";\n $output .= \" 'prefix' => '',\\n\";\n $output .= \" );\\n\";\n $output .= \"\\n\";\n $output .= \" // Set some common desirable local vars \\n\";\n $output .= \" \\$conf['file_temporary_path'] = '/tmp';\\n\";\n $output .= \" \\$conf['file_public_path'] = 'sites/default/files'; \\n\";\n $output .= \" \\$conf['file_private_path'] = 'sites/default/files/private'; \\n\";\n $output .= \" \\$conf['reroute_email_enable'] = 1; \\n\";\n $output .= \" \\$conf['cache'] = 0; \\n\";\n $output .= \" \\$conf['css_gzip_compression'] = FALSE; \\n\";\n $output .= \" \\$conf['js_gzip_compression'] = FALSE; \\n\";\n $output .= \"}\\n\";\n\n $settings = $output;\n fwrite($fh, $settings);\n fclose($fh);\n\n return $settings_file;\n}",
"public function database() {\n\t\t$this->_check();\n\t\t$d['title_for_layout'] = __(\"Database creation\");\n\t\t$this->set($d);\n\t}",
"public function storeFile()\n\t{\n\t\tif (!$this->blnIsModified)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$strFile = trim($this->strTop) . \"\\n\\n\";\n\t\t$strFile .= \"-- LESSON SEGMENT START --\\nCREATE TABLE `tl_cb_lessonsegment` (\\n\";\n\n\t\tforeach ($this->arrData as $k=>$v)\n\t\t{\n\t\t\t$strFile .= \" `$k` $v,\\n\";\n\t\t}\n\n\t\t$strFile .= \") ENGINE=MyISAM DEFAULT CHARSET=utf8;\\n-- LESSON SEGMENT STOP --\\n\\n\";\n\n\t\tif ($this->strBottom != '')\n\t\t{\n\t\t\t$strFile .= trim($this->strBottom) . \"\\n\\n\";\n\t\t}\n\n\t\t$objFile = new File('system/modules/course_builder/config/database.sql');\n\t\t$objFile->write($strFile);\n\t\t$objFile->close();\n\t}",
"public function run()\n\t{\n\t\tDB::table('settings')->truncate();\n\n\t\t$defaultDisplayOrder = 100;\n\t\t$timestamp = date('Y-m-d H:i:s');\n\n\t\t$settings = [\n\n\t\t\t/* General */\n\n\t\t\t[\n\t\t\t\t'name' => 'Website Name',\n\t\t\t\t'value' => 'Fractal',\n\t\t\t\t'type' => 'Text',\n\t\t\t\t'rules' => 'required',\n\t\t\t\t'display_order' => 1,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Webmaster Email',\n\t\t\t\t'value' => 'admin@website.com',\n\t\t\t\t'type' => 'Text',\n\t\t\t\t'rules' => 'required, email',\n\t\t\t\t'display_order' => 2,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'CMS Roles',\n\t\t\t\t'value' => 'admin, mod',\n\t\t\t\t'type' => 'List',\n\t\t\t\t'options' => '\\Regulus\\Identify\\Models\\Role::getSelectable()',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Auto Format Titles',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'rules' => '',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Items Listed Per Page',\n\t\t\t\t'value' => 20,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'options' => '5:300; +5',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Latest Content Items Listed',\n\t\t\t\t'value' => 5,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'options' => '5:20',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Content View Logging Type',\n\t\t\t\t'value' => 'All',\n\t\t\t\t'type' => 'Text',\n\t\t\t\t'options' => 'None, Unique, All',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Content Download Logging Type',\n\t\t\t\t'value' => 'All',\n\t\t\t\t'type' => 'Text',\n\t\t\t\t'options' => 'None, Unique, All',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Display Unique Content Views',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Display Unique Content Downloads',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\n\t\t\t/* Pages */\n\n\t\t\t[\n\t\t\t\t'name' => 'Default Content Area Type',\n\t\t\t\t'value' => 'Markdown',\n\t\t\t\t'type' => 'Text',\n\t\t\t\t'category' => 'Pages',\n\t\t\t\t'options' => 'HTML, Markdown',\n\t\t\t],\n\n\t\t\t/* Files */\n\n\t\t\t[\n\t\t\t\t'name' => 'Default Image Thumbnail Size',\n\t\t\t\t'value' => 200,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'category' => 'Files',\n\t\t\t\t'rules' => '',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Default Media Image Width',\n\t\t\t\t'value' => 1024,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'category' => 'Files',\n\t\t\t\t'rules' => '',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Default Media Image Height',\n\t\t\t\t'value' => 768,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'category' => 'Files',\n\t\t\t\t'rules' => '',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Image Resize Quality',\n\t\t\t\t'value' => 65,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'category' => 'Files',\n\t\t\t\t'options' => '1:100',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\n\t\t\t/* Users */\n\n\t\t\t[\n\t\t\t\t'name' => 'Minimum Password Length',\n\t\t\t\t'value' => 8,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'category' => 'Users',\n\t\t\t\t'options' => '6:24; +2',\n\t\t\t\t'rules' => 'required, numeric',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Require Unique Email Addresses',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'category' => 'Users',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Image Resize Quality',\n\t\t\t\t'value' => 65,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'category' => 'Files',\n\t\t\t\t'options' => '1:100',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\n\t\t\t/* Media */\n\n\t\t\t[\n\t\t\t\t'name' => 'Media Items Listed Per Page',\n\t\t\t\t'value' => 10,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'category' => 'Media',\n\t\t\t\t'options' => '4:300; +2',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Display Media Sets Menu',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'category' => 'Media',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Display Media Types Menu',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'category' => 'Media',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Enable Media Item Comments',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'category' => 'Media',\n\t\t\t\t'developer' => false,\n\t\t\t],\n\n\t\t\t/* Blogs */\n\n\t\t\t[\n\t\t\t\t'name' => 'Articles Listed Per Page',\n\t\t\t\t'value' => 10,\n\t\t\t\t'type' => 'Integer',\n\t\t\t\t'category' => 'Blogs',\n\t\t\t\t'options' => '4:300; +2',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Display Thumbnail Images on Article List',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'category' => 'Blogs',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Display Placeholder Thumbnail Images on Article List',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'category' => 'Blogs',\n\t\t\t\t'developer' => true,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Enable Article Comments',\n\t\t\t\t'value' => true,\n\t\t\t\t'type' => 'Boolean',\n\t\t\t\t'category' => 'Blogs',\n\t\t\t\t'developer' => false,\n\t\t\t],\n\t\t];\n\n\t\tforeach ($settings as $setting)\n\t\t{\n\t\t\tif (!isset($setting['display_order']))\n\t\t\t\t$setting['display_order'] = $defaultDisplayOrder;\n\n\t\t\t$setting['created_at'] = $timestamp;\n\t\t\t$setting['updated_at'] = $timestamp;\n\n\t\t\tDB::table('settings')->insert($setting);\n\t\t}\n\t}",
"public function dbPlaceholders()\n {\n return [\n 'download_name',\n 'download_github_name',\n 'download_url',\n 'download_size',\n 'download_file_name',\n 'download_count',\n 'opt_download_version',\n 'download_create',\n 'download_create_gmt',\n 'download_update',\n 'download_update_gmt',\n ];\n }"
]
| [
"0.6397749",
"0.6364254",
"0.6330942",
"0.6198822",
"0.6169225",
"0.6169225",
"0.6168901",
"0.6092105",
"0.6088968",
"0.6086766",
"0.6080668",
"0.60412514",
"0.6002147",
"0.5957316",
"0.59529287",
"0.59476835",
"0.59083587",
"0.5798933",
"0.57531786",
"0.5738799",
"0.5724993",
"0.5724633",
"0.57018846",
"0.5678912",
"0.56733114",
"0.5663321",
"0.5663169",
"0.56496865",
"0.56408817",
"0.5626333",
"0.56044585",
"0.55997986",
"0.5596899",
"0.5589257",
"0.5576109",
"0.55547076",
"0.55518425",
"0.554074",
"0.55343246",
"0.5533811",
"0.55311596",
"0.5511925",
"0.55100673",
"0.55014",
"0.54957956",
"0.54913896",
"0.5489846",
"0.5485571",
"0.54821056",
"0.5476726",
"0.5469443",
"0.5458115",
"0.54568195",
"0.5448362",
"0.54426146",
"0.5441912",
"0.5440994",
"0.5437642",
"0.54374725",
"0.5433987",
"0.5431497",
"0.54188037",
"0.5417988",
"0.5416842",
"0.54127306",
"0.54054564",
"0.54045177",
"0.54010904",
"0.5393713",
"0.5390192",
"0.53880674",
"0.5382567",
"0.53751343",
"0.5371765",
"0.5371558",
"0.5368347",
"0.5367715",
"0.53633827",
"0.5361848",
"0.53586483",
"0.53488153",
"0.534389",
"0.5325961",
"0.5323876",
"0.5319892",
"0.53160053",
"0.5307177",
"0.5300797",
"0.5298507",
"0.5290261",
"0.5283595",
"0.527312",
"0.5272658",
"0.5263178",
"0.5261486",
"0.5258996",
"0.52487767",
"0.5243861",
"0.52376235",
"0.52364236"
]
| 0.60466504 | 11 |
executes an SQL string and returns the result | function runQuery ($q) {
//setup the database connection
$dbSettings = getDBsettings();
$db = "mysql:host=" . $dbSettings['DBserver'] . ";dbname=" . $dbSettings['DBname'] . ";port=" . $dbSettings['DBport'];
$pdo = new PDO($db, $dbSettings['DBuser'], $dbSettings['DBpass']);
//prepare the SQL string
$stmt = $pdo->prepare($q);
//execute the SQL
$stmt->execute();
//close the conention
$pdo = null;
//return the result
return $stmt;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function execute($sql);",
"public function execute($sql);",
"abstract public function exec($sql);",
"abstract public function execute($sql);",
"public abstract function execute($sql);",
"public function query(string $sql);",
"function exec($sql);",
"public function query ($sqlString);",
"abstract protected function executeSql($sql);",
"public function execute(): Statement;",
"public function executeQuery($sql)\r\n\t{\r\n\t\t//return qocqal_query($sql);\r\n\t}",
"public static function query($sql);",
"public function _Execute($sql) {\n\t\ttry {\n\t\t\t$this->_error = NULL;\n\t\t\tif(!$this->_connection) { $this->_Connect(); }\n\t\t\t\n\t\t\tif (substr_count(strtoupper($sql), 'SELECT') > 0 || substr_count(strtoupper($sql), 'PRAGMA') > 0) {\n\t\t\t\t$statement = $this->_connection->prepare($sql);\n\t\t\t\tif($statement) {\n\t\t\t\t\t$statement->execute();\n\t\t\t\t\t$result = $statement->fetchAll();\n\t\t\t\t} else {\n\t\t\t\t\t$result = NULL;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!$this->_auto_commit && !$this->_begin) {\n\t\t\t\t\t$this->_connection->beginTransaction();\n\t\t\t\t\t$this->_begin = true;\n\t\t\t\t}\n\t\t\t\t$result = $this->_connection->exec($sql);\n\t\t\t}\n\t\t\tif ($result === FALSE) {\n\t\t\t\t$error = $this->_connection->errorInfo();\n\t\t\t\t$this->_RenderError($error[0].'-'.$error[1].' '.$error[2], 'XUXO_ERROR_CODE_004');\n\t\t\t}\n\t\t\t\n\t\t\t$this->_resource = ($result) ? $result : NULL;\n\t\t\treturn $result;\n\t\t} catch (Exception $e) {\n\t\t\t$this->_RenderError($e->getMessage(), 'XUXO_ERROR_CODE_004');\n\t\t}\n\t}",
"public function execute($sql, $params = array());",
"abstract public function query($sql);",
"public static function exec($sql)\n\t{\n\t\t$result = self::$link->query($sql);\n\t\t\n\t\tif(!$result)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function execSql(){\n\t\t$cant=func_num_args();\n\t\t$instSql=\"\";\n\t\t$instSql=$this->reemplazaParametro(func_get_args());\n//\t\techo \"<br>\".$instSql.\"<br>\";\n//\t\techo $this->tipodb.\"<br>\";\n//\t\t$this->registroLog($instSql,$_SESSION['PERMISO'][0],$_SESSION['PERMISO'][1]);\n\t\tswitch ($this->tipodb) {\n\t\t\tcase \"my\":\n\t\t\t\t$resultado=mysql_query($instSql,$this->conn);\n//echo mysql_errno().\"<br>\";\n\t\t\t\tbreak;\n\t\t\tcase \"pg\":\n\t\t\t\t$resultado=pg_query($this->conn,$instSql);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $resultado;\n\t}",
"public function fetchSqlString();",
"function fvls_db_ExecuteQuery($sql){\n\t\tglobal $FLVS_db_link;\n\t\tif( !$FLVS_db_link instanceof MySQLi )\n\t\t\treturn false;\n\n\t\tif ( !($response = $FLVS_db_link->query( $sql ) ) ){\n\t\t\tif( defined('FVLS_DEVELOPER_MODE') && FVLS_DEVELOPER_MODE )\n\t\t\t echo \"FV Link Shortener Error: mySQL Query Error - $FLVS_db_link->error | $sql\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $response;\n\t}",
"public function execute($sql){\n\t $query = DB::query(Database::SELECT, $sql);\n\t return $query->execute($this->database);\n\t}",
"function execute ($sql)\n {\n return pg_query($this->_conn, $sql);\n }",
"public function executeQuery($sql)\r\n\t{\r\n\t\t//return mysql_query($sql);\r\n\t}",
"public static function execute($sql) {\n if (static ::$show_sql) {\n echo $sql . \"\\n\\n\";\n }\n $query = NimbleRecord::execute($sql, true);\n return $query;\n }",
"public function execute($sql) {\n\t\tquery_db2($sql, true);\n\t}",
"function sql_execute($sql)\n{\n global $ctx;\n return $ctx['sqlconn']->query($sql);\n}",
"protected function execute(string $sql)\n {\n // Prepare a statement\n try {\n $stm = $this->PDO->prepare($sql);\n\n // Bind all parameters\n foreach ($this->Parameters as $index => $value) {\n if ($value == 'NULL') {\n // special rule for NULL values\n $stm->bindValue($index, null, PDO::PARAM_INT);\n } else {\n $stm->bindValue($index, $value, $this->getValueType($value));\n }\n\n // Replace parameter placeholder for internal cache\n $sql = str_replace(' ' . $index . ' ', ($value == 'NULL' ? ' NULL ' : ' \"' . $value . '\" '), $sql);\n }\n\n // reset parameter cache\n $this->Parameters = [];\n $this->ParameterIndex = 1;\n\n // Save query to cache\n $this->History[] = trim($sql);\n\n // execute statement\n if ($stm->execute()) {\n return $stm;\n } else {\n // save the error\n $this->LastError = $stm->errorInfo();\n\n // return false\n return false;\n }\n } catch (PDOException $e) {\n $this->log(new ConnectionException('Failed to execute query!', $e), Environment::E_LEVEL_ERROR);\n return false;\n }\n }",
"public function query($sql);",
"public function query($sql);",
"public function query($sql);",
"public function query($sql);",
"protected function execSql($sql){\n $this->query = mysql_query($sql) or die (\"Erro ao executar a Query $sql<br />\".mysql_error());\n return $this->query;\n }",
"public function execSQL ($sql) {\n $connect = new mysqli('localhost','root','1234','herpic');\n $result = $connect->query($sql);\n return $result;\n }",
"function executePlainSQL($cmdstr) { \n\t\t\t\tglobal $db_conn, $success;\n\t\t\t\t$statement = OCIParse($db_conn, $cmdstr); \n\n\t\t\t\tif (!$statement) {\n\t\t\t\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t\t\t\t$e = OCI_Error($db_conn); // For OCIParse errors pass the \n\t\t\t\t\t// connection handle\n\t\t\t\t\techo htmlentities($e['message']);\n\t\t\t\t\t$success = False;\n\t\t\t\t}\n\n\t\t\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\t\t\tif (!$r) {\n\t\t\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t\t\t$e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\t\t\techo htmlentities($e['message']);\n\t\t\t\t\t$success = False;\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t\treturn $statement;\n\t\t\t}",
"function executePlainSQL($cmdstr) {\n //echo \"<br>running \".$cmdstr.\"<br>\";\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr); //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n \n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn); // For OCIParse errors pass the\n // connection handle\n echo htmlentities($e['message']);\n $success = False;\n }\n \n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n echo htmlentities($e['message']);\n $success = False;\n } else {\n \n }\n return $statement;\n \n }",
"function executePlainSQL($cmdstr) {\n //echo \"<br>running \".$cmdstr.\"<br>\";\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr); //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n \n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn); // For OCIParse errors pass the\n // connection handle\n echo htmlentities($e['message']);\n $success = False;\n }\n \n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n echo htmlentities($e['message']);\n $success = False;\n } else {\n \n }\n return $statement;\n \n }",
"static public function execSQL($raw_sql) {\n if (self::$_static_handler == null) {\n self::$_static_handler = slDatabaseManager::getConnection();\n }\n $res = null;\n if (!is_array($raw_sql)) $raw_sql = array($raw_sql);\n foreach($raw_sql as $sql) {\n $res = self::$_static_handler->query($sql);\n }\n return $res;\n }",
"public function execQuery($sql){\n return mysql_query($sql);\n }",
"function ejecuta($strsql){\n\n $query = $this->db->query($strsql);\n return $query;\n\n }",
"public function exec ($sql) {\n $this->query = $this->conn->exec($sql);\n return $this->query;\n }",
"public function execute()\n {\n return $this->query($this->sSql);\n }",
"function executeQuery($query);",
"public function execute($sql) {\n $this->result = $this->conn->query($sql);\n return $this->result;\n }",
"function db_exe_query($str){ \n $result=$this->con->query($str);\n return $result;\n }",
"function executePlainSQL($cmdstr) { //takes a plain (no bound variables) SQL command and executes it\n\t//echo \"<br>running \".$cmdstr.\"<br>\";\n\tglobal $oraconn, $success;\n\t$statement = OCIParse($oraconn, $cmdstr); \n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($oraconn); // For OCIParse errors pass the \n\t\t// connection handle\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\t$r = OCIExecute($statement, OCI_DEFAULT);\n\tif (!$r) {\n\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t} else {\n\n\t}\n\treturn $statement;\n\n}",
"public function executeQuery($sql){\n return DB::executeQuery($this->db, $sql);\n }",
"public function Execute($sql) {\r\n return $this->_connection->query($sql);\r\n }",
"function sqlQuery($sql){\r\n\t\t$con->testmodeEcho($sql, 'SqlSentence');\r\n\t\treturn connDB()->query($sql);\r\n\t}",
"public function execute($sql){\n\t\treturn mysql_query($this->connection,$sql);\n\t}",
"abstract public function query($sql, $execute =FALSE);",
"public function executeQuery(string $sql) {\n try {\n $sql=$this->secureSQL($sql);\n $stmt = $this->conn->prepare($sql);\n $stmt->execute();\n $this->result=$stmt->fetchAll(PDO::FETCH_ASSOC);\n $this->rsetRowCount = count($this->result);\n } catch (PDOException $e) {\n $this->lastException = $e;\n }\n }",
"function SqlQuery($loc, $sql)\n{\n $conn = GetSqlConnection();\n $result = $conn->query($sql);\n if($result == false) { DieWithBadSql($loc, $sql); }\n return $result;\n}",
"function execSql($query) {\n if ($result = mysql_query($query, $this->linkDatabaseSrc)) {\n return $result;\n } else {\n return 0;\n }\n }",
"function executePlainSQL($cmdstr) {\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr);\n /**There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n */\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n \n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = oci_error($statement);\n echo htmlentities($e['message']);\n $success = False;\n } else {\n \n }\n return $statement;\n }",
"private function execute() {\n $query = $this->db->query($this->sql);\n return $query->result();\n }",
"function exec_sql_query($db, $sql, $params = array()) {\n try {\n $query = $db->prepare($sql);\n if ($query and $query->execute($params)) {\n return $query;\n }\n } catch (PDOException $exception) {\n handle_db_error($exception);\n }\n return NULL;\n}",
"function exec_sql_query($db, $sql, $params = array()) {\n try {\n $query = $db->prepare($sql);\n if ($query and $query->execute($params)) {\n return $query;\n }\n } catch (PDOException $exception) {\n handle_db_error($exception);\n }\n return NULL;\n}",
"public function execute(string $sql)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn $this->connID->query(\n\t\t\t\t$this->prepQuery($sql)\n\t\t\t);\n\t\t}\n\t\tcatch (\\PDOException $e)\n\t\t{\n\t\t\tthrow new DatabaseException(\n\t\t\t\t$this->connID->errorCode().\" \".\n\t\t\t\t\"Failed to execute query:\\n\" . $sql . \"\\nWith Error:\\n\".$e->getMessage(),\n\t\t\t\t(int)$e->getMessage(),\n\t\t\t\t$e\n\t\t\t);\n\t\t\t//log_message('error', 'Firebird Query : '.$e);\n\t\t\tif ($this->DBDebug) {\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function execQuery($sql)\n {\n return $this->dbConn->exec($sql);\n }",
"public function executeSQL($sql) {\r\n\t\t$result = mysql_query($sql, $this->connection);\r\n\t\treturn $result;\r\n\t}",
"public function Execute()\r\n {\r\n $this->PREPARE_STATEMENT($this->sql);\r\n return $this->EXECUTE_STATEMENT($this->statement);\r\n \r\n }",
"public function execute() { \n return $this -> stmt -> execute();\n }",
"function executePlainSQL($cmdstr) {\n //echo \"<br>running \".$cmdstr.\"<br>\";\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr); //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn); // For OCIParse errors pass the \n // connection handle\n echo htmlentities($e['message']);\n $success = False;\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n echo htmlentities($e['message']);\n $success = False;\n } else {\n\n }\n return $statement;\n }",
"function executePlainSQL($cmdstr) {\n\t//echo \"<br>running \".$cmdstr.\"<br>\";\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr); //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn); // For OCIParse errors pass the \n\t\t// connection handle\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\t$r = OCIExecute($statement, OCI_DEFAULT);\n\tif (!$r) {\n\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t} else {\n\n\t}\n\treturn $statement;\n}",
"function executePlainSQL($cmdstr) {\n //echo \"<br>running \".$cmdstr.\"<br>\";\n global $db_conn, $success;\n\n $statement = OCIParse($db_conn, $cmdstr); \n //There are a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn); // For OCIParse errors pass the connection handle\n echo htmlentities($e['message']);\n $success = False;\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n echo htmlentities($e['message']);\n $success = False;\n }\n\n\t\t\treturn $statement;\n\t\t}",
"public function execute()\n {\n $query = $this->__toString();\n if (!empty($this->params)) {\n $statement = $this->pdo->prepare($query);\n $statement->execute($this->params);\n return $statement;\n }\n return $this->pdo->query($query);\n }",
"function executePlainSQL($cmdstr) {\n //echo \"<br>running \".$cmdstr.\"<br>\";\n global $db_conn, $success;\n\n $statement = OCIParse($db_conn, $cmdstr);\n //There are a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn); // For OCIParse errors pass the connection handle\n echo htmlentities($e['message']);\n $success = False;\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n echo htmlentities($e['message']);\n $success = False;\n }\n\n return $statement;\n }",
"function executePlainSQL($cmdstr) {\n\t//echo \"<br>running \".$cmdstr.\"<br>\";\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr); //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn); // For OCIParse errors pass the\n\t\t// connection handle\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\t$r = OCIExecute($statement, OCI_DEFAULT);\n\tif (!$r) {\n\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t} else {\n\n\t}\n\treturn $statement;\n\n}",
"public function execute($sql) {\n\t\tif(SYS_USE_FIREPHP==1)\n\t\t\tPhpBURN_Message::output(\"[!Performing the query!]: $sql\");\n\t\treturn $this->getModel()->getConnection()->executeSQL($sql);\n\t\t//$this->resultSet = &$this->getModel()->getConnection()->executeSQL($sql);\n\t}",
"public function execute() {\n $exec = $this->db->prepare($this->sql);\n $exec->execute($this->placeHolder);\n $this->placeHolder = array(); //make placeHolder array empty SO that placeholder property is ready for another action.\n $return = '';\n $this->count = $exec->rowCount();\n switch ($this->type) {\n case self::TYPE_SELECT:\n $return = $exec->fetchAll(PDO::FETCH_OBJ);\n break;\n case self::TYPE_DELETE:\n $return = $this->count;\n break;\n case self::TYPE_UPDATE:\n break;\n case self::TYPE_ALTER:\n break;\n default :\n $return = '';\n break;\n }\n return $return;\n }",
"public function exec( $sql )\r\n\t{\r\n\t\t$qResult = $this->query( $sql );\r\n\t\tif( $qResult )\r\n\t\t\treturn $qResult->getQueryHandle();\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"function executePlainSQL($cmdstr) {\n\t//echo \"<br>running \".$cmdstr.\"<br>\";\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr); //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn); // For OCIParse errors pass the \n\t\t// connection handle\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\t$r = OCIExecute($statement, OCI_DEFAULT);\n\tif (!$r) {\n\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t} else {\n\n\t}\n\treturn $statement;\n\n}",
"public function executarQuery($sql)\n {\n return $this->con->query($sql);\n \n }",
"public function exec($sql) {\n $this->setChars();\n $this->result = $this->pdo->exec($sql);\n $substr = substr($sql, 0, 6);\n if ($this->result) {\n return $this->successful($substr);\n } else {\n $error = $this->pdo->errorInfo();\n $error['sql'] = $sql;\n $error['sub'] = $substr;\n $this->error = $error;\n return $this->fail($substr);\n }\n }",
"public function run() : int|string\n {\n return $this->database->exec($this->sql());\n }",
"abstract protected function doQuery( $sql );",
"public function executar($sql)\n {\n return $this->con->exec($sql);\n }",
"function executePlainSQL($cmdstr) {\r\n //echo \"<br>running \".$cmdstr.\"<br>\";\r\n global $db_conn, $success;\r\n\r\n $statement = OCIParse($db_conn, $cmdstr); \r\n //There are a set of comments at the end of the file that describe some of the OCI specific functions and how they work\r\n\r\n if (!$statement) {\r\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\r\n $e = OCI_Error($db_conn); // For OCIParse errors pass the connection handle\r\n echo htmlentities($e['message']);\r\n $success = False;\r\n }\r\n\r\n $r = OCIExecute($statement, OCI_DEFAULT);\r\n if (!$r) {\r\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\r\n $e = oci_error($statement); // For OCIExecute errors pass the statementhandle\r\n echo htmlentities($e['message']);\r\n $success = False;\r\n }\r\n\r\n\t\t\treturn $statement;\r\n\t\t}",
"function executePlainSQL($cmdstr) {\n\t//echo \"<br>running \".$cmdstr.\"<br>\";\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr); \n // There is a set of comments at the end of the file that \n // describes some of the OCI specific functions and how they work.\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse this command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn); \n // For OCIParse errors, pass the connection handle.\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\t$r = OCIExecute($statement, OCI_DEFAULT);\n\tif (!$r) {\n\t\techo \"<br>Cannot execute this command: \" . $cmdstr . \"<br>\";\n\t\t$e = oci_error($statement); \n // For OCIExecute errors, pass the statement handle.\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t} else {\n\n\t}\n\treturn $statement;\n\n}",
"public function sqlCmd($q, $params, $return) {\n $db = $this->openDb();\n // Prepare statement\n $stmt = $db->prepare($q);\n\n if($params) {\n // Execute statement\n $stmt->execute($params);\n } else {\n $stmt->execute();\n }\n // Decide whether to return the rows themselves, or just count the rows\n if ($return == \"rows\") {\n return $stmt->fetchAll(PDO::FETCH_NUM);\n }\n //elseif ($return == \"count\") {\n else {\n return $stmt->rowCount();\n }\n }",
"function execute($sql) {\n $result = mysql_query($sql, $this->getConnectionId());\n if ($result == false) {\n $this->raiseError($sql);\n } \n return $result;\n }",
"public function exec ($sql)\n {\n if (is_object($sql) && method_exists($sql, 'assemble'))\n\t\t{\n $sql = $sql->assemble();\n }\n\n\t\tif (is_object($sql) && method_exists($sql, 'getSqlString'))\n\t\t{\n\t\t\t$sql = $sql->getSqlString();\n\t\t}\n\n if (is_object($sql) && method_exists($sql, '__toString') && ! method_exists($sql, 'assemble'))\n\t\t{\n $sql = $sql->__toString();\n }\n\n try\n\t\t{\n $affected = $this->getConnection()->exec($sql);\n\n if ($affected === false)\n\t\t\t{\n $errorInfo = $this->getConnection()->errorInfo();\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n throw new EhrlichAndreas_Db_Exception($errorInfo[2]);\n }\n\n return $affected;\n }\n\t\tcatch (Exception $e)\n\t\t{\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n throw new EhrlichAndreas_Db_Exception($e->getMessage(), $e->getCode(), $e);\n }\n }",
"function _execute($sql) {\n\t\t$result = sqlite_query($this->connection, $sql);\n\n\t\tif (preg_match('/^(INSERT|UPDATE|DELETE)/', $sql)) {\n\t\t\t$this->resultSet($result);\n\t\t\tlist($this->_queryStats) = $this->fetchResult();\n\t\t}\n\t\treturn $result;\n\t}",
"public function executeQuery() \r\n\t{\r\n\t\t$Result = $this->objStatement->execute();\r\n\t\t\r\n\t\tif($Result)\r\n\t\t{\r\n\t\t\t$Result = new DatabaseStatement($this->objStatement);\r\n\t\t}\r\n\t\t\r\n\t\treturn $Result;\r\n\t}",
"public function exec_query($sql = null) {\n\t\t$this->setFoundRows();\n\t\tif($this->debug) {\n\t\t\ttry {\n\t\t\t\t// Execute query\n\t\t\t\t$this->query = (isset($sql) && !empty($sql)) ? $sql : $this->getFullQuery();\n\t\t\t\t$Rs = $this->Connection->Execute($this->query, $this->params);\n\t\t\t\t$Rs->last_query = $this->getSQL($this->query); // full query with parameter\n\t\t\t\t//$this->writeQueryInLog($Rs->last_query, debug_backtrace());\n\n\t\t\t\t// $this->query_debugger($Rs->last_query); // Debug queries\n\t\t\t\t\n\t\t\t\t$this->resetVariables(); // reset all variables\t\t\t\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$newex = new Exception($e->getMessage());\n\t\t\t\t//echo 'ex :: '.$this->getSQL($this->getFullQuery());exit;\n\t\t\t\t$this->displayException($newex);\n\t\t\t}\n\t\t} \n\t\telse {\n\t\t\t$this->query = (isset($sql) && !empty($sql)) ? $sql : $this->getFullQuery();\n\t\t\t$Rs = $this->Connection->Execute($this->query, $this->params);\n\t\t\t$Rs->last_query = $this->getSQL($this->query); // full query with parameter\n\t\t\t$this->resetVariables();\t\t\t\n\t\t}\n\t\t\n\t\t$this->query = trim($this->query);\n\t\tif(stripos($this->query, 'INSERT') === 0) {\n\t\t\treturn $this->Connection->getLastInsertedId();\n\t\t} \n\t\telseif(stripos($this->query, 'UPDATE') === 0) {\n\t\t\treturn $Rs;\n\t\t} \n\t\telse {\n\t\t\tif($Rs->RecordCount() == 0)\n\t\t\t\treturn false;\n return $Rs;\n\t\t}\n\t}",
"public function execute($sql)\n\t{\n\t\treturn $this->c->exec($sql);\n\t}",
"function db_raw_exec( $sql )\n{\n return Chev_PDO::instance()->raw_exec( $sql );\n}",
"public function execute($sql)\n {\n $this->result = $this->conn->query($sql);\n return $this->result;\n }",
"abstract public function execute($query);",
"public function executeStatement()\n {\n \n }",
"abstract public function Execute($query, $multiline = FALSE);",
"public function doQuery($sql, $params);",
"function execute($sql) {\r\n\t\tif (!is_string($sql)) {\r\n\t\t\ttrigger_error(\"Invalid parameter passed to db::query, expecting string\", E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif ($sql == '') {\r\n\t\t\ttrigger_error(\"Invalid parameter passed to db::query, string was empty\", E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$this->last_query = $sql;\r\n\r\n\r\n\t\t$time = micro_time();\r\n\r\n\t\t$this->result = mysql_query($sql, $this->link);\r\n\r\n\t\t$elapsed = (micro_time() - $time) * 1000;\r\n\r\n\t\tLogger::log('SQL', LOG_LEVEL_DEBUG, $sql.\"\\t\".$elapsed.' ms');\r\n\r\n\t\t// describe queries\r\n\t\tif (defined('EXPLAIN_QUERIES') && EXPLAIN_QUERIES) {\r\n\t\t\t$result = $this->explain($sql);\r\n\r\n\t\t\tif ($result) {\r\n\t\t\t\tLogger::log('SQL', LOG_LEVEL_DEBUG, print_r($result, true));\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif ($this->result == false) {\r\n\t\t\ttrigger_error(mysql_error($this->link).\"\\n\".$sql, E_USER_ERROR);\r\n\t\t}\r\n\r\n\t\treturn $this->result;\r\n\t}",
"function executePlainSQL($cmdstr) {\r\n\t//echo \"<br>running \".$cmdstr.\"<br>\";\r\n\tglobal $db_conn, $success;\r\n\t$statement = OCIParse($db_conn, $cmdstr); //There is a set of comments at the end of the file that describe some of the OCI specific functions and how they work\r\n\r\n\tif (!$statement) {\r\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\r\n\t\t$e = OCI_Error($db_conn); // For OCIParse errors pass the \r\n\t\t// connection handle\r\n\t\techo htmlentities($e['message']);\r\n\t\t$success = False;\r\n\t}\r\n\r\n\t$r = OCIExecute($statement, OCI_DEFAULT);\r\n\tif (!$r) {\r\n\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\r\n\t\t$e = oci_error($statement); \r\n\t\techo htmlentities($e['message']);\r\n\t\t$success = False;\r\n\t} else {\r\n\r\n\t}\r\n\treturn $statement;\r\n}",
"function executePlainSQL($cmdstr) {\n //echo \"<br>running \".$cmdstr.\"<br>\";\n global $db_conn, $success;\n // echo \"<br>begin to read the sql!!!!!!!!!!!!!!!!!!!!!!<br>\";\n\n $statement = OCIParse($db_conn, $cmdstr);\n //There are a set of comments at the end of the file that describe some of the OCI specific functions and how they work\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn); // For OCIParse errors pass the connection handle\n echo htmlentities($e['message']);\n $success = False;\n }\n\n// echo \"<br>begin to execute the sql!!!!!!!!!!!!!!!!!!!!!!<br>\";\n// echo \"<br> here's the sql: \" . $cmdstr .\"<br>\";\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n // echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = oci_error($statement); // For OCIExecute errors pass the statementhandle\n echo htmlentities($e['message']);\n $success = False;\n }\n// echo \"<br>after executing the sql!!!!!!!!!!!!!!!!!!!!!!<br>\";\n// echo \"<br> here's the result: \" . var_dump(oci_fetch_row($statement)) .\"<br>\";\n return $statement;\n }",
"public function rawExec(string $sql, array $params=[])\n {\n return $this->getConnection()->rawExec($sql, $params);\n }",
"public function exec( $sql )\r\n\t{\r\n\t\t$this->debugInfo($sql);\r\n\t\treturn db2_exec($this->conn, $sql);\r\n\t}",
"public function execute($sql, array $params = array())\n {\n $this->last_sql = $sql;\n $result = $this->driver->execute($sql, $params);\n $this->reset();\n return $result;\n }",
"public function execute()\n {\n \tif ( $this->cur_query != \"\" )\n \t{\n \t\t$res = $this->query( $this->cur_query );\n \t}\n \t\n \t$this->cur_query \t= \"\";\n \t$this->is_shutdown \t= false;\n\n \treturn $res;\n }",
"public static function Ejecutar_SQL($sql)\n {\n // Consulta de la meta\n $consulta = $sql;\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(); \n // Capturar primera fila del resultado\n /*$row = $comando->fetch(PDO::FETCH_ASSOC);\n return $row; */\n return 1;\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return $e->getMessage();\n }\n }",
"function kval_sqlite_exec($sql)\n{\n return kval_sqlite_queryexec(func_get_args())[0];\n}",
"public static function execute()\n {\n //bind params\n foreach ( self::$_BINDS as $k => $_b ):\n $type = \\PDO::PARAM_STR;\n if ( $_b['type'] ):\n $type = self::getDataType( $_b['type'] );\n endif;\n\n $length = NULL;\n if ( $_b['size'] ):\n $length = (int) $_b['size'];\n endif;\n $k++;\n self::$stmt->bindParam( $k, $_b['value'], $type, $length );\n endforeach;\n self::$_BINDS = array(); //reset\n return self::$stmt->execute();\n }"
]
| [
"0.7608795",
"0.7608795",
"0.76047444",
"0.74199504",
"0.7407146",
"0.73872614",
"0.73749006",
"0.716743",
"0.715689",
"0.70713776",
"0.6934413",
"0.6909634",
"0.6871968",
"0.6856949",
"0.68486273",
"0.6809109",
"0.68038064",
"0.6797305",
"0.67911977",
"0.6782598",
"0.6774647",
"0.6746924",
"0.6737499",
"0.6733566",
"0.67036015",
"0.6700261",
"0.6690451",
"0.6690451",
"0.6690451",
"0.6690451",
"0.6682089",
"0.66574013",
"0.6649796",
"0.6647079",
"0.6647079",
"0.6646643",
"0.66457576",
"0.66446704",
"0.66368574",
"0.66240335",
"0.66240305",
"0.6623481",
"0.6622367",
"0.6614808",
"0.66012746",
"0.65990704",
"0.65979546",
"0.6592609",
"0.65849555",
"0.65788144",
"0.6572095",
"0.656583",
"0.655761",
"0.6552685",
"0.65523946",
"0.65523946",
"0.6552071",
"0.6549503",
"0.6543935",
"0.6540891",
"0.6531384",
"0.65304613",
"0.65298",
"0.6526234",
"0.65251327",
"0.6517449",
"0.65057975",
"0.65001756",
"0.64942765",
"0.6493184",
"0.64924425",
"0.6487958",
"0.6486444",
"0.6480111",
"0.6479075",
"0.64681554",
"0.64659834",
"0.64654374",
"0.6457696",
"0.6457035",
"0.6455229",
"0.645294",
"0.64526457",
"0.6441034",
"0.6440924",
"0.6439843",
"0.6429168",
"0.64283663",
"0.64262027",
"0.64224243",
"0.6422052",
"0.6421715",
"0.64094174",
"0.63871163",
"0.6385937",
"0.63803524",
"0.6378678",
"0.6378015",
"0.63764805",
"0.6376064",
"0.6359513"
]
| 0.0 | -1 |
setup the database connection | function runQueryWithParams ($q, $p) {
$dbSettings = getDBsettings();
$db = "mysql:host=" . $dbSettings['DBserver'] . ";dbname=" . $dbSettings['DBname'] . ";port=" . $dbSettings['DBport'];
$pdo = new PDO($db, $dbSettings['DBuser'], $dbSettings['DBpass']);
//prepare the SQL string
$stmt = $pdo->prepare($q);
//execute the SQL
$stmt->execute(array($p));
//close the conention
$pdo = null;
//return the result
return $stmt;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _initDbConnection() {\n\t\tif (!empty($this->db)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Create a new connection\n\t\tif (empty($this->config['datasource'])) {\n\t\t\tdie(\"FeedAggregatorPdoStorage: no datasource configured\\n\");\n\t\t}\n\n\t\t// Initialise a new database connection and associated schema.\n\t\t$db = new PDO($this->config['datasource']); \n\t\t$this->_initDbSchema();\n\t\t\n\t\t// Check the database tables exist\n\t\t$this->_initDbTables($db);\n\n\t\t// Database successful, make it ready to use\n\t\t$this->db = $db;\n\t}",
"protected function setupDatabaseConnection()\n {\n $db = DBConnection::getInstance($this->config);\n\n $enc = property_exists($this->config, 'dbEncoding') ? $this->config->dbEncoding : 'utf8';\n $tz = property_exists($this->config, 'dbTimezone') ? $this->config->dbTimezone : '00:00';\n\n $db->query(\n sprintf('SET NAMES \"%s\"', $enc)\n );\n\n $db->query(\n sprintf('SET time_zone = \"%s\"', $tz)\n );\n }",
"private function _set_connection()\n {\n isset($this->_database_connection) ? $this->load->database($this->_database_connection) : $this->load->database();\n $this->_database = $this->db;\n }",
"protected function initDatabase() {\n\t\t$this->config\t\t= new Config();\n\t\tDatabase::$host\t\t= $this->config->host;\n\t\tDatabase::$username\t= $this->config->username;\n\t\tDatabase::$password\t= $this->config->password;\n\t\tDatabase::$dbname\t= $this->config->dbname;\n\t}",
"public function init()\n {\n $this->_db = Instance::ensure($this->_db, Connection::class);\n }",
"public function setConnection()\r\n {\r\n $this->con = $this->db->getConnection();\r\n }",
"public function connectToDB() {}",
"function _getConnection()\n {\n $this->_con = Pluf::db();\n }",
"public function connect_db() {\n }",
"private function setConnection() {\n if( $this->_connection ) { # prevent creation of additional connection\n $this->_connection;\n }\n $db_dsn = \"mysql:host=\".$this->db_host.\";port=\".$this->db_port.\";dbname=\".$this->db_name.\";charset=\".$this->db_char;\n $this->_connection = new PDO($db_dsn,$this->db_user,$this->db_pass,$this->db_opts);\n }",
"private function initDatabase() {\n \n \n \n }",
"private function connectDB()\n\t{\n\t\t$this->db = ECash::getMasterDb();\n\t\t\n\t//\t$this->dbconn = $this->db->getConnection();\n\t}",
"private static function initDatabase() {\n\t\t\tif (self::Config('use_db')) {\n\t\t\t\t$host = self::Config('mysql_host');\n\t\t\t\t$user = self::Config('mysql_user');\n\t\t\t\t$pass = self::Config('mysql_password');\n\t\t\t\t$name = self::Config('mysql_dbname');\n\t\t\t\tDBManager::init($host, $user, $pass, $name);\n\t\t\t}\n\t\t}",
"private function connectToDB()\n {\n $this->handler = new DBConnect();\n $this->handler = $this->handler->startConnection();\n }",
"public function initDBConnections(): void\n {\n $this->addConnectionsToConfig();\n $this->testConnections();\n }",
"function dbInit()\n {\n if ( $this->IsConnected == false )\n {\n $this->Database = eZDB::globalDatabase();\n $this->IsConnected = true;\n }\n }",
"private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}",
"public function connectDB() {}",
"function init() {\n if ( empty( $this->hostname ) ) {\n $this->hostname = $this->gCI->gPZ['db_config'][\"hostname\"];\n }\n if ( empty( $this->username ) ) {\n $this->username = $this->gCI->gPZ['db_config'][\"username\"];\n }\n if ( empty( $this->password ) ) {\n $this->password = $this->gCI->gPZ['db_config'][\"password\"];\n }\n if ( strstr( $this->hostname, \":\" ) ) {\n list( $this->hostname, $this->port ) = explode( \":\", $this->gCI->gPZ['db_config']['hostname'] );\n } else {\n $this->port = 0;\n }\n $this->database = ( empty( $this->database ) ? $this->gCI->gPZ['db_config'][\"database\"] : $this->database );\n $this->db_conn = new mysqli( $this->hostname, $this->username, $this->password, $this->database, $this->port );\n\n if ( mysqli_connect_errno() ) {\n\n $this->gCI->fatal_error( \"Database Connect failed: %s\\n\", mysqli_connect_error()) ;\n }\n }",
"public function init()\n {\n $this->logger->info('DBService : init');\n\n $this->connect();\n $this->createTable( $this->pdo );\n }",
"abstract protected function initDB();",
"private function initDatabase()\n {\n $defaults = [\n 'user' => 'root',\n 'password' => '',\n 'prefix' => '',\n 'options' => [\n \\PDO::ATTR_PERSISTENT => true,\n \\PDO::ATTR_ERRMODE => 2,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',\n \\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 1,\n \\PDO::ATTR_EMULATE_PREPARES => false\n ]\n ];\n\n if (empty($this->settings['db'])) {\n error_log('No DB data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n if (empty($this->settings['db']['default'])) {\n error_log('No DB \"default\" data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n foreach ($this->settings['db'] as $name => &$settings) {\n\n $prefix = 'db.' . $name;\n\n // Check for databasename\n if (empty($settings['dsn'])) {\n Throw new \\PDOException(sprintf('No DSN specified for \"%s\" db connection. Please add correct DSN for this connection in Settings.php', $name));\n }\n\n // Check for DB defaults and map values\n foreach ($defaults as $key => $default) {\n\n // Append default options to settings\n if ($key == 'options') {\n\n if (empty($settings['options'])) {\n $settings['options'] = [];\n }\n\n foreach ($defaults['options'] as $option => $value) {\n\n if (array_key_exists($option, $settings['options'])) {\n continue;\n }\n\n $settings[$key][$option] = $value;\n }\n }\n\n if (empty($settings[$key])) {\n $settings[$key] = $default;\n }\n }\n\n foreach ($settings as $key => $value) {\n $this->di->mapValue($prefix . '.conn.' . $key, $value);\n }\n\n $this->di->mapService($prefix . '.conn', '\\Core\\Data\\Connectors\\Db\\Connection', [\n $prefix . '.conn.dsn',\n $prefix . '.conn.user',\n $prefix . '.conn.password',\n $prefix . '.conn.options'\n ]);\n $this->di->mapFactory($prefix, '\\Core\\Data\\Connectors\\Db\\Db', [\n $prefix . '.conn',\n $settings['prefix']\n ]);\n }\n }",
"protected function createDatabaseConnection()\r\n\t{\r\n\t\t$this->dbConnectionPool = new \\Bitrix\\Main\\Db\\DbConnectionPool();\r\n\t}",
"protected static function setupDb()\n\t{\n\t\tif (is_object(self::$db)) {\n\t\t\treturn self::$db;\n\t\t}\n\n\t\t$config = Config::getInstance();\n\t\t$driver = $config->getDatabaseDriver();\n\t\t$host = $config->getDatabaseHostname();\n\t\t$user = $config->getDatabaseUsername();\n\t\t$pass = $config->getDatabasePassword();\n\t\t$dbname = $config->getDatabaseName();\n\t\t$file = $config->getDatabaseFile();\n\n\t\ttry {\n\t\t\tswitch ($driver) {\n\t\t\t\tcase 'sqlite':\n\t\t\t\t\tself::$db = new PDO('sqlite:'.$file);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tcase 'mysql':\n\t\t\t\t\tself::$db = new PDO($driver.':dbname='.$dbname.';host='.$host,\n\t\t\t\t\t $user, $pass,array(PDO::ATTR_PERSISTENT => true));\n\t\t\t}\n\t\t\tself::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t} catch (PDOException $e) {\n\t\t\tthrow new Exception(\"Kunde inte etablera anslutning till databasen. (\".\n\t\t\t $e->getMessage().')');\n\t\t}\n\t}",
"private function initDB(){\n $sql = \"\n CREATE SCHEMA IF NOT EXISTS `\".$this->_database.\"` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;\n USE `\".$this->_database.\"` ;\n \";\n try {\n $dbh = new PDO(\"mysql:host=$this->_host\", $this->_username, $this->_password,array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));\n $dbh->exec($sql)\n or die(print_r($dbh->errorInfo(), true));\n } catch (PDOException $e) {\n $err_data = array('stmt'=>'on init');\n Helper_Error::setError( Helper_Error::ERROR_TYPE_DB , $e->getMessage() , $err_data , $e->getCode() );\n die(\"DB init ERROR: \". $e->getMessage());\n }\n }",
"protected function _setupDb()\n {\n // First, delete the DB if it exists\n $this->_teardownDb();\n \n // Then, set up a clean new DB and return it\n list ($host, $port, $db) = $this->_getUrlParts();\n $db = trim($db, '/');\n \n return Sopha_Db::createDb($db, $host, $port);\n }",
"private function databaseConnection()\n {\n // Les connexions sont établies en créant des instances de la classe de base de PDO\n $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);\n $this->db = new PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS, $options);\n }",
"protected function _initDb()\n {\n $this->bootstrap('configs');\n \n // combine application.ini & config.ini database settings\n $options = $this->getOptions();\n $dbSettings = $options['resources']['db'];\n $dbParams = Zend_Registry::get('config.config')->db->toArray();\n $dbSettings['params'] = array_merge($dbSettings['params'], $dbParams);\n \n $db = Zend_Db::factory($dbSettings['adapter'], $dbSettings['params']);\n if(!empty($dbSettings['isDefaultTableAdapter'])\n && (bool)$dbSettings['isDefaultTableAdapter']\n ) {\n Zend_Db_Table::setDefaultAdapter($db);\n }\n }",
"function dbInit()\n {\n if ( $this->IsConnected == false )\n {\n $this->Database =& eZDB::globalDatabase();\n $this->IsConnected = true;\n }\n }",
"public function init_connection() {\n $this->connection = mysql_connect($this->host, $this->name, $this->password);\n if(!$this->connection) {\n die('Could not connect: ' . mysql_error());\n }\n mysql_select_db($this->databaseName, $this->connection);\n mysql_query(\"set names 'utf8'\");\n }",
"private function open_db() {\n\n\t\t//var_dump($this->connection); exit;\n\n\t\t\n\n\t}",
"static function init(){\n if (!self::$conn) {\n $KEYS = new Keys();\n $hostname = $KEYS->DATABASE_HOST;\n $dbname = $KEYS->DATABASE_NAME;\n $username = $KEYS->DATABASE_USERNAME;\n $password = $KEYS->DATABASE_PASSWORD;\n $db = $db = ($KEYS->DATABASE_TYPE == \"\")? \"mysql\": $KEYS->DATABASE_TYPE;\n $port = $port = ($KEYS->DATABASE_PORT == \"\")? \"\": \"port={$KEYS->DATABASE_PORT};\";\n \n self::$conn = null;\n \n try {\n self::$conn = new PDO(\"{$db}:host={$hostname};{$port}dbname={$dbname}\", $username, $password);\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch(PDOException $exception) {\n Response::send(null, 500, \"Connection error: \" . $exception->getMessage());\n }\n }\n }",
"protected function _initDb()\r\n { \r\n if ( $this->_db === null ) {\r\n $file = APPLICATION_PATH . '/configs/database.php';\r\n if(file_exists($file) && filesize($file) > 100) {\r\n $database = require_once($file);\r\n $this->_db = Zend_Db::factory($database['database']['adapter'], \r\n $database['database']['params']);\r\n Zend_Db_Table::setDefaultAdapter($this->_db);\r\n } else {\r\n //Go to install script url\r\n header('Location: /install');\r\n }\r\n }\r\n }",
"function db_connect(){\n\t\tif(SQ_DEBUG){\n\t\t\t$this->dbh = mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);\n\t\t}else{\n\t\t\t$this->dbh = @mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);\n\t\t}\n\t\t\n\t\tif (!$this->dbh){\n\t\t\t$error_message = sprintf(SQ_DB_CONN_ERROR_MESSAGE, $this->dbhost, $this->dbuser);\n\t\t\tthrow new SQ_Exception($error_message, SQ_DB_CONN_ERROR_CODE);\n\t\t}\n\t\t$this->ready = true;\n\t\t\n\t\ttry{\n\t\t\t$this->select($this->dbname, $this->dbh);\n\t\t}catch(SQ_Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t}",
"function setUp()\n\t{\n\t\tglobal $config;\n\t\tDb::init($config);\n\t\t$this->db = Db::get_instance();\n\t\t$this->sql = SqlObject::get_instance();\n\t}",
"protected static function setConnection(){\n static::$conn = connection\\DBconnect::makeInstance();\n }",
"public function setUp(): void\n {\n if ( isset($this->db) )\n {\n return;\n }\n\n (new DBConnect\\Load\\INI(self::DB_CREDENTIALS))->run();\n $this->db = DBConnect\\Connect\\Bank::get();\n\n $this->table = new DBTable\\PostgreSQL(self::TABLE_NAME);\n $this->table->runFieldLookup($this->db);\n }",
"public function setUp()\n\t{\n\t\t$this->connection = Db::connection(array(\n\t\t\t'driver' => 'mysql',\n\t\t\t'username' => 'root',\n\t\t\t'password' => isset($_SERVER['DB']) ? '' : 'root',\n\t\t\t'database' => 'test_database',\n\t\t));\n\t}",
"private function init_db()\n {\n /**\n * If we've set that we want to use the database, initialize it.\n * Or we may use our parent's\n *\n * Inicializa a base de dados se esse app estiver configurado pra usar a base\n * de dados. Ou usa do nosso parent\n */\n\n if (isset($this->parent->db)) {\n $this->db = $this->parent->db;\n } else {\n $this->load->db('mysql');\n }\n\n }",
"public function connect($db_properties);",
"public function __construct() {\n $this->_db = DB::connect();\n }",
"private function setupDatabase()\n {\n try {\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n\n } catch (PDOException $e) {\n\n if (false != strpos($e->getMessage(), 'Unknown database')) {\n $db = new PDO(sprintf('mysql:host=%s', $this->host), $this->userName, $this->password);\n $db->exec(\"CREATE DATABASE IF NOT EXISTS `$this->dbName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;\") or die(print_r($db->errorInfo(), true));\n\n } else {\n die('DB ERROR: ' . $e->getMessage());\n }\n\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n }\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n return $db;\n }",
"protected function setConnection () : void\n {\n $this->connection = new PDO(\"mysql:host=\" . $this->db_host, $this->db_user, $this->db_password , self::PDO_OPTIONS);\n }",
"function __construct() {\n $this->open_db_connection();\n }",
"private function init(){\n //initialize the connection\n try {\n $this->CONNECTION = new \\PDO(\"mysql:host=$this->ADDRESS;dbname=$this->DATABASE\", $this->USER, $this->PASSWORD);\n if($this->DEBUG)\n $this->CONNECTION->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n else\n $this->CONNECTION->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_SILENT);\n } catch(\\PDOException $e) {\n \\bmca\\exception\\Handler::fatalException('ERROR: ' . $e->getMessage());\n }\n\n $this->initialized = true;\n }",
"function db_setup()\n\t{\n\t\t$connection=mysql_pconnect(\"localhost\",\"xdf\",\"xdf379\");\n\t\tmysql_select_db(\"xdf\",$connection);\n\t\treturn $connection;\n\t}",
"public function __construct() {\n $dsn = \"mysql:host=\".Configuration::DATABASE_HOST.\";dbname=\".Configuration::DATABASE_NAME;\n self::connect($dsn, Configuration::DATABASE_USER, Configuration::DATABASE_PASSWORD);\n }",
"function connect_to_db(){\n\t\t//Fun Fact: @ suppresses errors of the expression it prepends\n\t\t\n\t\t//Connect to the database and select the database\t\t\t\n\t\ttry{\n\t\t\t$this->connection = new PDO(\"mysql:host=$DATABASE_HOST;dbname=DATABASE_NAME\", DATABASE_USER, DATABASE_PASS);\n\t\t\t$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t}catch(PDOException $err){\n\t\t\tdie('Could not connect to database' . $err->getMessage());\n\t\t}\t\t\n\t}",
"public static function init($db){\r\n self::$conn = $db;\r\n }",
"public function setupDatabase()\n\t{\n\n\t\t$installSql = $this->sourceDir . '/installation/sql/mysql/joomla.sql';\n\n\t\tif (0) //!file_exists($installSql))\n\t\t\tthrow new Exception(__METHOD__ . ' - Install SQL file not found in ' . $installSql, 1);\n\n\t\t$this->config->set('site_name', 'TEST ' . $this->config->get('target'));\n\t\t$this->config->set('db_name', $this->config->get('target'));\n\n\t\t$dbModel = new JacliModelDatabase($this->config);\n\n\t\t$this->out(sprintf('Creating database %s ...', $this->config->get('db_name')), false);\n\t\t$dbModel->createDB();\n\t\t$this->out('ok');\n\n\t\t$this->out('Populating database...', false);\n\t\t//$dbModel->populateDatabase($installSql);\n\t\t$this->out('ok');\n\n\t\t$this->out('Creating admin user...', false);\n\t\t$this->createAdminUser($dbModel);\n\t\t$this->out('ok');\n\n\t}",
"private function openConnection() {\n $this->db = new PDO(\"mysql:host=127.0.0.1;dbname=mvc\", \"gert\", \"becode\");\n }",
"private function connect()\n {\n if ($this->configuration->get('db.connector') == 'PDO') {\n $dsn = \"mysql:host=\" . $this->configuration->get('db.host') . \";dbname=\" . $this->configuration->get('db.name');\n $options = array();\n $this->db = new PDO(\n $dsn, $this->configuration->get('db.username'), $this->configuration->get('db.password'), $options\n );\n } elseif ($this->configuration->get('db.connector') == 'mysqli') {\n $this->db = mysqli_connect(\n $this->configuration->get('db.host'), $this->configuration->get('db.username'), $this->configuration->get('db.password'), $this->configuration->get('db.name')\n );\n }\n }",
"public function __construct()\n {\n $this->db = \\Config\\Database::connect();\n }",
"private function setConnection()\n {\n $cn = new \\MongoClient();\n if(env('DB_ENV','development')=='development')\n self::$database= $cn->selectDB(\"dbAbbaDev01\");\n else\n self::$database = $cn->selectDB(\"dbAbbaProd01\");\n }",
"public function __construct()\n {\n $this->db = ConnectionClass::conn();\n }",
"protected function _initDb() {\n\trequire_once 'Zend/Config/Ini.php';\n\trequire_once 'Agel/Db/Table.php';\n\n\t//TODO: Remove the dependency on db.config.php, and encryption.config.php\n\trequire realpath((APPLICATION_PATH . '/../../include/db.config.php'));\n\trequire realpath((APPLICATION_PATH . '/../../include/encryption.config.php'));\n if(isset($dsn['username'])) {\n define('PROMETHEUS_DB_CONFIGURED', 'yes');\n }\n\tdefine('PROMETHEUS_DB_USERNAME', $dsn ['username']);\n\tdefine('PROMETHEUS_DB_PASSWORD', $dsn ['password']);\n\tdefine('PROMETHEUS_DB_HOSTSPEC', $dsn ['hostspec']);\n\tdefine('PROMETHEUS_DB_SCHEMA', $dsn ['database']);\n\tdefine('PROMETHEUS_DB_CRYPT_KEY', $dsn ['crypt_passkey']);\n\tdefine('PROMETHEUS_SET_COMPANY_PRE', $db_values ['company_pre']);\n\tdefine('ORBSIX_CRYPT_KEY', $key);\n\n\tif (isset($dsn_slave)) {\n\t define('PROMETHEUS_SLAVE_DB_CONFIGURED', 'yes');\n\t define('PROMETHEUS_SLAVE_DB_USERNAME', $dsn_slave ['username']);\n\t define('PROMETHEUS_SLAVE_DB_PASSWORD', $dsn_slave ['password']);\n\t define('PROMETHEUS_SLAVE_DB_HOSTSPEC', $dsn_slave ['hostspec']);\n\t define('PROMETHEUS_SLAVE_DB_SCHEMA', $dsn_slave ['database']);\n\t define('PROMETHEUS_SLAVE_DB_CRYPT_KEY', $dsn_slave ['crypt_passkey']);\n\t define('PROMETHEUS_SLAVE_SET_COMPANY_PRE', $db_values_slave ['company_pre']);\n\t}\n\n\tAgel_Db_Table::setDbAdapter(new Zend_Config_Ini(APPLICATION_CONFIG_PATH . '/database.ini'));\n\n\treturn Agel_Db_Table::getDefaultAdapter();\n }",
"private function connecDb()\n {\n try{\n $dsn = \"{$this->db_type}:host={$this->db_host};port={$this->db_port};\";\n $dsn .= \"dbname={$this->db_name};charset={$this->db_charset}\";\n //echo \"$dsn, $this->db_user, $this->db_pass\";\n $this->pdo = new PDO($dsn,$this->db_user,$this->db_pass);\n }catch(PDOException $e){\n echo\"<h2>创建POD对象失败</h2>\";\n $this->ShowErrorMessage($e);\n die();\n }\n }",
"function __construct() {\n $this->open_db_connection();\n }",
"private function dbConnection() {\r\n //if (!is_resource($this->connessione))\r\n // $this->connessione = mysql_connect($this->db_server,$this->db_username,$this->db_pass) or die(\"Error connectin to the DBMS: \" . mysql_error());\r\n if (!is_resource($this->connessione)) {\r\n try {\r\n $this->connessione = new PDO($this->db_type . \":dbname=\" . $this->db_name . \";host=\" . $this->db_server, $this->db_username, $this->db_pass);\r\n //echo \"PDO connection object created\";\r\n $this->setupSQLStatement();\r\n } catch (PDOException $e) {\r\n echo $e->getMessage();\r\n die();\r\n }\r\n }\r\n }",
"private function setConnection()\n {\n //load db array from config file\n $params = require __DIR__ . \"/../config/db_pdo.php\";\n\n $db_dsn = $params['pdo_dsn'] . ':dbname=' . $params['name'] . ';host=' . $params['host']\n . ';charset=' . $params['charset'];\n $db_pdo = null;\n\n try {\n $db_pdo = new \\PDO($db_dsn, $params['user'], $params['password']);\n $db_pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n } catch (\\PDOException $e) {\n throw new \\Exception('Database connection failed.' . $e->getMessage());\n }\n\n $this->connection = $db_pdo;\n }",
"public function initialize()\n {\n $this->setConnectionService('db');\n\n }",
"protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }",
"private function connect() {\n $this->load->database();\n }",
"private function init()\n {\n // connessione al mysql server\n if (!$this->link = mysql_connect( $this->hostname\n , $this->user_name\n , $this->user_pswd))\n {\n $this->set_error( 'Could not connect to mysql' );\n return;\n }\n\n // seleziona il database\n if (!mysql_select_db($this->user_db, $this->link))\n {\n $this->set_error( 'Could not select database' );\n return;\n }\n }",
"function init_db_connection()\n\t{\n\t\t$_pre_load = $this->memory_debug_make_flag();\n\t\t\n\t\t$this->vars['sql_driver'] = ! $this->vars['sql_driver'] ? 'mysql' : strtolower($this->vars['sql_driver']);\n\t\t\n\t\tif ( ! class_exists( 'db_main' ) )\n\t\t{ \n\t\t\trequire_once( KERNEL_PATH.'class_db.php' );\n\t\t\trequire_once( KERNEL_PATH.'class_db_'.$this->vars['sql_driver'].\".php\" );\n\t\t}\n\t\t\n\t\t$classname = \"db_driver_\".$this->vars['sql_driver'];\n\t\t\n\t\t$this->DB = new $classname;\n\t\t\n\t\t$this->DB->obj['sql_database'] = $this->vars['sql_database'];\n\t\t$this->DB->obj['sql_user'] = $this->vars['sql_user'];\n\t\t$this->DB->obj['sql_pass'] = $this->vars['sql_pass'];\n\t\t$this->DB->obj['sql_host'] = $this->vars['sql_host'];\n\t\t$this->DB->obj['sql_tbl_prefix'] = $this->vars['sql_tbl_prefix'];\n\t\t$this->DB->obj['force_new_connection'] = isset($this->vars['sql_force_new_connection']) ? $this->vars['sql_force_new_connection'] : 0;\n\t\t$this->DB->obj['use_shutdown'] = USE_SHUTDOWN;\n\t\t# Error log\n\t\t$this->DB->obj['error_log'] = ROOT_PATH . 'cache/sql_error_log_'.date('m_d_y').'.cgi';\n\t\t$this->DB->obj['use_error_log'] = IN_DEV ? 0 : 1;\n\t\t# Debug log - Don't use this on a production board!\n\t\t$this->DB->obj['debug_log'] = ROOT_PATH . 'cache/sql_debug_log_'.date('m_d_y').'.cgi';\n\t\t$this->DB->obj['use_debug_log'] = 0;\n\t\t\n\t\t//-----------------------------------\n\t\t// Load query file\n\t\t//-----------------------------------\n\t\t\n\t\tif ( defined( 'IPB_LOAD_SQL' ) )\n\t\t{\n\t\t\t$this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_'. IPB_LOAD_SQL .'.php';\n\t\t}\n\t\telse if ( IPB_THIS_SCRIPT == 'admin' )\n\t\t{\n\t\t\t$this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_admin_queries.php';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_queries.php';\n\t\t}\n\t\t\t\n\t\t//-----------------------------------\n\t\t// Required vars?\n\t\t//-----------------------------------\n\t\t\n\t\tif ( is_array( $this->DB->connect_vars ) and count( $this->DB->connect_vars ) )\n\t\t{\n\t\t\tforeach( $this->DB->connect_vars as $k => $v )\n\t\t\t{\n\t\t\t\t$this->DB->connect_vars[ $k ] = isset($this->vars[ $k ]) ? $this->vars[ $k ] : '';\n\t\t\t}\n\t\t}\n\t\t\n\t\t//--------------------------------\n\t\t// Backwards compat\n\t\t//--------------------------------\n\t\t\n\t\tif ( !isset($this->DB->connect_vars['mysql_tbl_type']) OR !$this->DB->connect_vars['mysql_tbl_type'] )\n\t\t{\n\t\t\t$this->DB->connect_vars['mysql_tbl_type'] = 'myisam';\n\t\t}\n\t\t\n\t\t//--------------------------------\n\t\t// Make CONSTANT\n\t\t//--------------------------------\n\t\t\n\t\tdefine( 'SQL_PREFIX' , $this->DB->obj['sql_tbl_prefix'] );\n\t\tdefine( 'SQL_DRIVER' , $this->vars['sql_driver'] );\n\t\tdefine( 'IPS_MAIN_DB_CLASS_LOADED', TRUE );\n\t\t\n\t\t//--------------------------------\n\t\t// Get a DB connection\n\t\t//--------------------------------\n\t\t\n\t\t$this->DB->connect();\n\t\t\n\t\t//-----------------------------------------\n\t\t// IPS DB LOADED\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! defined( 'IPSCLASS_DB_LOADED' ) )\n\t\t{\n\t\t\tdefine( 'IPSCLASS_DB_LOADED', 1 );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Clean up\n\t\t//-----------------------------------------\n\t\t\n\t\tunset( $classname );\n\t\t\n\t\t$this->memory_debug_add( \"CORE: DB Connection Made\", $_pre_load );\n\t}",
"public function setUp()\n {\n parent::setUp();\n\n $this->database = \\oxDb::getDb();\n }",
"public function __construct()\n {\n $this -> connection = $this ->connecdatabase();\n }",
"private function connect(){\n\t\trequire (__DIR__ . '/../../config.php');\n\t\t$mysqlCFG =$database['mysql'];\n\t\t\n\t\tif(!self::$db){\n\t\t\t$connectionString = \"mysql:host=$mysqlCFG[host];dbname=$mysqlCFG[dbname]\";\n\t\t\ttry{\n\t\t\t\tself::$db = new \\PDO($connectionString, $mysqlCFG['user'], $mysqlCFG['password']);\n\t\t\t\tself::$db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t\t}catch(\\PDOException $e){\n\t\t\t\tdie(\"Ocurrio un error al conectar con la base de datos: $e->getMessage()\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"function initDb()\n {\n global $database_host, $database_name, $database_user,$database_pass;\n\n $global=Frd::getGlobal();\n\n $db_config=array(\n 'host'=>$database_host,\n 'username'=>$database_user,\n 'password'=>$database_pass,\n 'dbname'=>$database_name\n );\n\n $db = Zend_Db::factory('pdo_mysql',$db_config);\n $db->query('set names utf8');\n Zend_Db_Table::setDefaultAdapter($db);\n $global->db=$db;\n\n $registry = Zend_Registry::getInstance();\n $registry->set(\"db_default\",$global->db);\n }",
"private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getInstance()->get('db_host'))\n\t\t\t->setUser(Stack::getInstance()->get('db_user'))\n\t\t\t->setPassword(Stack::getInstance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getInstance()->get('db_table'))\n\t\t\t->connect();\n\t}",
"private function connectToDb()\n {\n //home connect\n $link =pg_connect(\"host=localhost dbname=user1 user=postgres\");\n if(!$link)\n {\n die('Connect Error');\n }\n $this->dbConnect = $link;\n }",
"private function openDatabaseConnection()\n {\n $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);\n $this->db = new PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS, $options);\n\n //UTF-8 encoding queries\n $this->db->exec(\"SET NAMES 'utf8'\");\n $this->db->exec(\"SET CHARACTER SET utf8\");\n $this->db->exec(\"SET COLLATION_CONNECTION='utf8_unicode_ci'\");\n }",
"protected function setUp () {\n $this->pdoConnection = new \\PDO('mysql:host='.$this->config['server'].';',\n $this->config['user'],\n $this->config['password']);\n $this->pdoConnection->exec('DROP SCHEMA IF EXISTS '.$this->config['name']);\n $this->pdoConnection->exec('CREATE SCHEMA '.$this->config['name']);\n $this->pdoConnection->exec('USE '.$this->config['name']);\n $this->pdoConnection->exec(file_get_contents(__DIR__.'\\ConnectionTestSchema.sql'));\n\n $this->mysqli = new mysqli($this->config['server'],\n $this->config['user'],\n $this->config['password'],\n $this->config['name']);\n\n $this->mysqliConnection = new MysqliConnection($this->mysqli);\n $this->run = true;\n }",
"private function __connection()\n {\n include 'src/Config/database.php';\n try {\n $dns = \"mysql:host={$databaseConfig['host']};dbname={$databaseConfig['database']}\";\n $this->__connection = new PDO(\n $dns,\n $databaseConfig['username'],\n $databaseConfig['password']\n );\n } catch (PDOException $e) {\n echo $e->getMessage();\n die;\n }\n }",
"public static function init() {\n\t\t\n\t\t// get various user info\n\t\t$defaultUser = Config::getOption(\"user\");\n\t\t$defaultPass = Config::getOption(\"pass\");\n\t\t$readwriteUser = Config::getOption(\"readwrite.user\");\n\t\t$readwritePass = Config::getOption(\"readwrite.pass\");\n\t\t\n\t\t// set-up the database connection info\n\t\t$name = Config::getOption(\"name\");\n\t\t$host = Config::getOption(\"host\");\n\t\t$user = (!$readwriteUser || empty($readwriteUser)) ? $defaultUser : $readwriteUser;\n\t\t$pass = (!$readwritePass || empty($readwritePass)) ? $defaultPass : $readwritePass;\n\t\t$port = Config::getOption(\"port\");\n\t\tPheasant::setup(\"mysql://\".$user.\":\".$pass.\"@\".$host.\":\".$port.\"/\".$name);\n\t\t\n\t}",
"public function __construct() {\n $db = new Connection();\n $this->conn = $db->connect();\n }",
"public function __construct()\n {\n $this->db = DataBase::dbConnect();\n }",
"protected function CeateDatabaseConnection()\r\n\t{\r\n\t\t// Create an instance of the database for use in the system\r\n\t\tif($this->InProduction($_SERVER['SERVER_NAME']))\r\n\t\t\t//$this->Database\t= new Database('gstour.db.4628821.hostedresource.com','gstour','Golf1215','gstour');\r\n\t\t\t$this->Database\t= new Database('97.74.149.114','gstour','Golf1215','gstour');\r\n\t\telse\r\n\t\t\t$this->Database\t= new Database('localhost','root','','test');\r\n\t}",
"function establish_connection() {\n\t \t\tself::$db = Registry()->db = SqlFactory::factory(Config()->DSN);\n\t \t\tself::$has_update_blob = method_exists(self::$db, 'UpdateBlob');\n\t\t\treturn self::$db;\n\t\t}",
"private function openDatabaseConnection()\n {\n\n // set the (optional) options of the PDO connection. in this case, we set the fetch mode to\n // \"objects\", which means all results will be objects, like this: $result->user_name !\n // For example, fetch mode FETCH_ASSOC would return results like this: $result[\"user_name] !\n // @see http://www.php.net/manual/en/pdostatement.fetch.php\n $options = array(\\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_OBJ, \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_WARNING);\n\n // generate a database connection, using the PDO connector\n // @see http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/\n $this->db = new \\PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=' . DB_CHARSET, DB_USER, DB_PASS, $options);\n }",
"private function initConnection() {\n\t\ttry {\n\t\t\t$this->m_Connection = new PDO(\"mysql:host=\".$this->m_DbHost.\";dbname=\".$this->m_DbName, $this->m_DbUserName, $this->m_DbPassword);\n\t\t\t$this->m_Connection-> exec(\"SET NAMES 'utf8';\");\n\t\t\t$this->m_Connection-> setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_FETCH_TABLE_NAMES, true);\n\t\t\t\n\t\t} catch(PDOException $e) {\n\t\t\t$this->m_Response->SetMsg(\"ERROR, Could not connect to DB: \".$e->getMessage());\n\t\t\t$this->m_Response->SetFlag(false);\n\t\t\t$this->m_Response->SetData($e);\n\t\t\texit();\n\t\t}\t\t\n\t}",
"public function __construct() {\t\tif(enable_database == true) {\n\t\t\t$this->db = database::instance();\n\t\t\t$this->db->connect();\n\t\t}\n\t}",
"protected function _initDb(){\n $config = $this->getOptions();\n\n $db = Zend_Db::factory($config['resources']['db']['adapter'], $config['resources']['db']['params']);\n\n //set default adapter\n Zend_Db_Table::setDefaultAdapter($db);\n\n //save Db in registry for later use\n Zend_Registry::set(\"db\", $db);\n \n Zend_Controller_Action_HelperBroker::addPath(\n \t\tAPPLICATION_PATH .'/helpers');\n\t\t\n }",
"private function connect()\n\t{\n\t\t$connectionData = $this->app->file->requireFile('config.php');\n\t\t\n\t\textract($connectionData);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tstatic::$connection = new PDO('mysql:host=' . $server . ';dbname=' . $dbname, $dbuser, $dbpass);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t\n\t\t\tstatic::$connection->exec('SET NAMES utf8');\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\t\t\t\t\n\t}",
"private final function _createDbStructure()\n {\n if ($conn = $this->_getConnection()) {\n $installer = new lib_Install('install');\n try {\n $installer->install();\n } catch (Exception $e) {\n app::log($e->getMessage(), app::LOG_LEVEL_ERROR);\n }\n }\n }",
"public function initDatabaseStructure( );",
"private function __connect() {\n $this->handle = mysql_connect($this->server, $this->user, $this->password) \n or die('<pre style=\"margin:auto;background:rgba(0,0,0,.1)\">'.mysql_error().'</pre>');\n mysql_select_db($this->dataBase, $this->handle) \n or die('<pre style=\"margin:auto;background:rgba(0,0,0,.1)\">'.mysql_error().'</pre>');\n @mysql_query(\"SET NAMES 'utf8'\");\n }",
"protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$oContext = &Context::getInstance();\n\n\t\t$db_info = include dirname(__FILE__) . '/../config/db.config.php';\n\n\t\t$db = new stdClass();\n\t\t$db->master_db = $db_info;\n\t\t$db->slave_db = array($db_info);\n\t\t$oContext->setDbInfo($db);\n\n\t\tDB::getParser(TRUE);\n\t}",
"public function getDbConnection()\n {\n $this->conn = Registry::get('db');\n }",
"private static function setupDB() {\n\t\t$tbl = self::$table;\n\t\t$dbw = wfGetDB( DB_MASTER );\n\t\twfDebugLog( __METHOD__, \"\\tCreating tables\\n\" );\n\t\t$dbw->query(\n\t\t\t\"CREATE TABLE IF NOT EXISTS $tbl ( pathway varchar(255), day varchar(50) )\", DB_MASTER\n\t\t);\n\t\twfDebugLog( __METHOD__, \"\\tDone!\\n\" );\n\t}",
"public function __construct()\n {\n $this->_dbInstance = Database::getInstance();\n $this->_dbHandle = $this->_dbInstance->getConnection();\n }",
"function __construct(){\r\n\t\t\t$this->open_db_connection();\r\n\t\t}",
"function dbInit()\n {\n require \"ezcontact/dbsettings.php\";\n mysql_pconnect( $SERVER, $USER, $PWD ) or die( \"Kunne ikke kople til database\" );\n mysql_select_db( $DATABASE ) or die( \"Kunne ikke velge database\" );\n }",
"function dbInit()\n {\n require \"ezcontact/dbsettings.php\";\n mysql_pconnect( $SERVER, $USER, $PWD ) or die( \"Kunne ikke kople til database\" );\n mysql_select_db( $DATABASE ) or die( \"Kunne ikke velge database\" );\n }",
"protected function openConn() {\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"function __construct(){\n $this->_db = (new DataBaseServices())->connect();\n }",
"public function connect()\n {\n $data = $this->app->file->requireFile('config.php');\n extract($data);\n try {\n static::$DB = new PDO('mysql:host=' . $server . ';dbname=' . $dbname , $dbuser , $dbpass);\n\n static::$DB->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE , PDO::FETCH_OBJ);\n static::$DB->setAttribute(PDO::ATTR_ERRMODE , PDO::ERRMODE_EXCEPTION);\n static::$DB->exec('SET NAMES utf8');\n\n }\n catch (PDOException $e){\n die($e->getMessage());\n }\n }",
"protected function prepareDatabase()\n {\n $this->stateSaver->setConnection($this->input->getOption('database'));\n\n if (!$this->stateSaver->repositoryExists()) {\n $options = ['--database' => $this->input->getOption('database')];\n $this->call('migrate:install', $options);\n }\n }",
"public function __construct() {\n $this->connection = $this->create_connection();\n }",
"private function setConnection(){\n try {\n $this->connection = new PDO('mysql:host='.self::HOST.';dbname='.self::NAME.';', self::USER, self::PASS);\n $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n die('ERROR: '.$e->getMessage());\n }\n }",
"private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }"
]
| [
"0.8070813",
"0.8008534",
"0.7654341",
"0.7584165",
"0.74911934",
"0.7480109",
"0.7464674",
"0.74444294",
"0.74349034",
"0.74018764",
"0.73893255",
"0.7387424",
"0.7377081",
"0.727448",
"0.7266259",
"0.7246231",
"0.7246106",
"0.7226335",
"0.72020227",
"0.7197753",
"0.7196059",
"0.7192648",
"0.7189879",
"0.71455747",
"0.7145173",
"0.7143321",
"0.7111591",
"0.71024734",
"0.7102144",
"0.709249",
"0.706552",
"0.7041445",
"0.70215887",
"0.7019348",
"0.70173097",
"0.70154864",
"0.7010054",
"0.7003857",
"0.7003424",
"0.6984162",
"0.6981732",
"0.6971138",
"0.6967751",
"0.69660866",
"0.69594306",
"0.6952757",
"0.6940807",
"0.69406056",
"0.6938418",
"0.69380915",
"0.6927987",
"0.6920497",
"0.6918714",
"0.69166267",
"0.6915625",
"0.6910814",
"0.6908938",
"0.6907748",
"0.690745",
"0.6896597",
"0.68914425",
"0.6889112",
"0.68877065",
"0.68772584",
"0.6861425",
"0.68547463",
"0.6849281",
"0.68479294",
"0.68443775",
"0.6843969",
"0.68429226",
"0.68422157",
"0.683793",
"0.6836757",
"0.6833313",
"0.6830882",
"0.68250287",
"0.68191636",
"0.6815344",
"0.6812137",
"0.68106335",
"0.681036",
"0.6806229",
"0.68016106",
"0.6795029",
"0.67944336",
"0.6793629",
"0.6780609",
"0.6764858",
"0.67603284",
"0.6759189",
"0.6754776",
"0.67547435",
"0.67547435",
"0.67523855",
"0.6747886",
"0.6747465",
"0.674507",
"0.673915",
"0.6736529",
"0.6735847"
]
| 0.0 | -1 |
test function to dump the SQL result | function DumpSql ($stmt) {
while ($row = $stmt->fetch()) {
print(var_dump($row));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testResultGetStatement()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(\"SELECT * FROM test WHERE status='ACTIVE'\", $result->getStatement());\n }",
"function dump_query($tablename, $filter=\"\") {\r\n //$this->query(sprintf(\"select * from %s\", $tablename));\r\n while ($this->next_record()) {\r\n\t $this->dump_record($tablename, $filter);\r\n\t};\r\n }",
"public function dump()\n {\n $this->composeQuery();\n $result = $this->connection->client()->search($this->queryBody);\n\n dd($result);\n }",
"public function test_executeQuery()\n\t{\n\t}",
"public function testDump()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n }');\n\n // fixed dump call using error_reporting to avoid\n // Cannot modify header information - headers already sent by (output started at\n // ./vendor/phpunit/phpunit/src/Util/Printer.php:110)\n // thanks to https://github.com/sebastianbergmann/phpunit/issues/720#issuecomment-364024753\n error_reporting(0);\n ob_start();\n $this->fixture->dump();\n $dumpContent = ob_get_clean();\n error_reporting(E_ALL);\n\n $expectedXML = <<<XML\n<?xml version=\"1.0\"?>\n<sparql xmlns=\"http://www.w3.org/2005/sparql-results#\">\n <head>\n <variable name=\"s\"/>\n <variable name=\"p\"/>\n <variable name=\"o\"/>\n <variable name=\"g\"/>\n </head>\n <results>\n <result>\n <binding name=\"s\">\n <uri>http://s</uri>\n </binding>\n <binding name=\"p\">\n <uri>http://p1</uri>\n </binding>\n <binding name=\"o\">\n <literal>baz</literal>\n </binding>\n <binding name=\"g\">\n <uri>http://example.com/</uri>\n </binding>\n </result>\n </results>\n</sparql>\n\nXML;\n $this->assertEquals($expectedXML, $dumpContent);\n }",
"public function __toString(){\n return $this->execute();\n }",
"function get_test_sql()\n{\n return do_test_get_test_sql(\n $_REQUEST['selection'], $_SESSION['testsql'], \n $_REQUEST['lang'], $_REQUEST['text']\n );\n}",
"function print_query($db) {\n\t\techo \"<pre>\";print_r($db->get_compiled_select());echo \"</pre>\";\n\t}",
"abstract function doDump();",
"function printResult($result) {\n\techo \"result from SQL:\";\n echo \"<table>\";\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\\n\";\n foreach ($row as $item) {\n echo \" <td>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \" \") . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n}",
"public static function dump($sql = NULL, $return = FALSE)\n\t{\n\t\tob_start();\n\t\tif ($sql instanceof DibiResult) {\n\t\t\t$sql->dump();\n\n\t\t} else {\n\t\t\tif ($sql === NULL) {\n\t\t\t\t$sql = self::$sql;\n\t\t\t}\n\n\t\t\tstatic $keywords1 = 'SELECT|(?:ON\\s+DUPLICATE\\s+KEY)?UPDATE|INSERT(?:\\s+INTO)?|REPLACE(?:\\s+INTO)?|DELETE|CALL|UNION|FROM|WHERE|HAVING|GROUP\\s+BY|ORDER\\s+BY|LIMIT|OFFSET|FETCH\\s+NEXT|SET|VALUES|LEFT\\s+JOIN|INNER\\s+JOIN|TRUNCATE|START\\s+TRANSACTION|BEGIN|COMMIT|ROLLBACK(?:\\s+TO\\s+SAVEPOINT)?|(?:RELEASE\\s+)?SAVEPOINT';\n\t\t\tstatic $keywords2 = 'ALL|DISTINCT|DISTINCTROW|IGNORE|AS|USING|ON|AND|OR|IN|IS|NOT|NULL|LIKE|RLIKE|REGEXP|TRUE|FALSE';\n\n\t\t\t// insert new lines\n\t\t\t$sql = \" $sql \";\n\t\t\t$sql = preg_replace(\"#(?<=[\\\\s,(])($keywords1)(?=[\\\\s,)])#i\", \"\\n\\$1\", $sql);\n\n\t\t\t// reduce spaces\n\t\t\t$sql = preg_replace('#[ \\t]{2,}#', ' ', $sql);\n\n\t\t\t$sql = wordwrap($sql, 100);\n\t\t\t$sql = preg_replace(\"#([ \\t]*\\r?\\n){2,}#\", \"\\n\", $sql);\n\n\t\t\t// syntax highlight\n\t\t\t$highlighter = \"#(/\\\\*.+?\\\\*/)|(\\\\*\\\\*.+?\\\\*\\\\*)|(?<=[\\\\s,(])($keywords1)(?=[\\\\s,)])|(?<=[\\\\s,(=])($keywords2)(?=[\\\\s,)=])#is\";\n\t\t\tif (PHP_SAPI === 'cli') {\n\t\t\t\tif (substr(getenv('TERM'), 0, 5) === 'xterm') {\n\t\t\t\t\t$sql = preg_replace_callback($highlighter, array('dibi', 'cliHighlightCallback'), $sql);\n\t\t\t\t}\n\t\t\t\techo trim($sql) . \"\\n\\n\";\n\n\t\t\t} else {\n\t\t\t\t$sql = htmlSpecialChars($sql);\n\t\t\t\t$sql = preg_replace_callback($highlighter, array('dibi', 'highlightCallback'), $sql);\n\t\t\t\techo '<pre class=\"dump\">', trim($sql), \"</pre>\\n\\n\";\n\t\t\t}\n\t\t}\n\n\t\tif ($return) {\n\t\t\treturn ob_get_clean();\n\t\t} else {\n\t\t\tob_end_flush();\n\t\t}\n\t}",
"protected function printSqlCheck() {}",
"abstract function getSQL();",
"function testSQL($sql){\n echo \"SQL: \" . $sql;\n}",
"function testSQL($sql){\n echo \"SQL: \" . $sql;\n}",
"public function testRunASqlQuery(){\r\n $sql = \"Select * from orders;\";\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(true,$success);\r\n }",
"private function _get_dbresult()\n {\n $result = \"\";\n return $result;\n }",
"function testDBSelect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select varable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}",
"function print_results() {\n global $dbh;\n print \"results:\\n\";\n $res = $dbh->query(\"SELECT * FROM phptest WHERE a = 72 ORDER BY b\");\n $i = 0;\n while ($row = $res->fetchRow(DB_FETCHMODE_ORDERED)) {\n print '|' . implode(\" - \", $row) . \"|\\n\";\n $i++;\n }\n if (!$i) {\n print \"The records were not found. Did they get inserted?\\n\";\n }\n}",
"public function dump();",
"public function dump();",
"public function getSQL();",
"public function __toString(){\n\t\t$output = '';\n\t\tforeach ($this->_queries as $query){\n\t\t\tif (isset($query['sql'])){\n\t\t\t\t$output .= $query['sql'] . PHP_EOL . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function toString()\n {\n return \"is equivalent to the SQL query \". \\PHPUnit_Util_Type::toString($this->sql);\n }",
"public function get_sql()\n {\n }",
"public function testGetQueryResult()\n {\n }",
"public function dump() {}",
"public function testRunASqlQuery2(){\r\n $sql = \"Select * from 123;\";//No table named 123\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(false,$success);\r\n }",
"function printResult($result) {\n echo \"<br>Retrieved data from table demoTable:<br>\";\n echo \"<table>\";\n echo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"ID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\"\n }\n\n echo \"</table>\";\n }",
"public function sql(): string;",
"public function data($sql) {\n if ($this->config[\"log\"]) {\n $this->sqllog[] = $sql;\n }\n\n $result = $this->getDB()->query($sql);\n if ($this->getDB()->errno)\n {\n echo ($this->getDB()->error . \" (\" . $this->getDB()->errno . \")\"); // TODO: throw new exception ?\n }\n\n return $result;\n }",
"public function fetchSqlString();",
"public static function database_query_returns() {\n return new external_value(PARAM_RAW, 'Moodle DB records');\n }",
"function vardump($mixed='')\n\t\t{\n\t\t\t// Start output buffering\n\t\t\tob_start();\n\n\t\t\techo \"<p><table><tr><td bgcolor=ffffff><blockquote><font color=000090>\";\n\t\t\techo \"<pre><font face=arial>\";\n\n\t\t\tif ( ! $this->vardump_called )\n\t\t\t{\n\t\t\t\techo \"<font color=800080><b>ezSQL</b> (v\".EZSQL_VERSION.\") <b>Variable Dump..</b></font>\\n\\n\";\n\t\t\t}\n\n\t\t\t$var_type = gettype ($mixed);\n\t\t\tprint_r(($mixed?$mixed:\"<font color=red>No Value / False</font>\"));\n\t\t\techo \"\\n\\n<b>Type:</b> \" . ucfirst($var_type) . \"\\n\";\n\t\t\techo \"<b>Last Query</b> [$this->num_queries]<b>:</b> \".($this->last_query?$this->last_query:\"NULL\").\"\\n\";\n\t\t\techo \"<b>Last Function Call:</b> \" . ($this->func_call?$this->func_call:\"None\").\"\\n\";\n\t\t\t\n\t\t\tif (count($this->all_func_calls)>1)\n\t\t\t{\n\t\t\t\techo \"<b>List of All Function Calls:</b><br>\"; \n\t\t\t\tforeach($this->all_func_calls as $func_string)\n\t\t\t\t\techo \" \" . $func_string .\"<br>\\n\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"<b>Last Rows Returned:</b> \".(count($this->last_result)>0 ? $this->last_result : '').\"\\n\";\n\t\t\techo \"</font></pre></font></blockquote></td></tr></table>\".$this->donation();\n\t\t\techo \"\\n<hr size=1 noshade color=dddddd>\";\n\n\t\t\t// Stop output buffering and capture debug HTML\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t// Only echo output if it is turned on\n\t\t\tif ( $this->debug_echo_is_on )\n\t\t\t{\n\t\t\t\techo $html;\n\t\t\t}\n\n\t\t\t$this->vardump_called = true;\t\t\t\n\t\t\treturn $html;\n\t\t}",
"function test_select_one($urabe, $body)\n{\n $sql = $body->sql_simple;\n $result = $urabe->select_one($sql);\n return $result;\n}",
"function test_select($urabe, $body)\n{\n $sql = $body->sql_select;\n $result = $urabe->select($sql);\n $result->message = \"Urabe test selection query with default parser\";\n return $result;\n}",
"public function test_get_row() {\n }",
"function exportQuery($db, $sql) {\r\n\tconnect();\r\n\tglobal $l, $errmsg;\r\n\t$sBuffer = \"\";\r\n\t$tableName = \"\";\r\n\t$columnNames = \"\";\r\n\t$columnTypes = \"\";\r\n\t$arrTypes;\r\n\t$sRowBuffer = \"\";\r\n\t$sSQLBuffer = \"\";\r\n\t$fieldValue = \"\";\r\n\t\r\n\t$r = mysql_db_query($db, $sql , $l);\r\n\t$errmsg = mysql_errno().\": \".mysql_error();\r\n\tif (mysql_error() != \"\") {\r\n\t\terrormsg(\"Database Error\", $errmsg);\r\n\t\t$r = 0;\r\n\t\treturn $r;\r\n\t}\r\n\t\r\n\twhile ($obj = mysql_fetch_field($r)) {\r\n\t \tif ($tableName == \"\") $tableName = $obj->table;\r\n\t \tif ($columnNames != \"\") { $columnNames = \"$columnNames,\"; }\r\n\t \tif ($columnTypes != \"\") { $columnTypes = \"$columnTypes,\"; }\r\n\t\t$columnNames = \"$columnNames$obj->name\"; \r\n\t\t$columnTypes .= $obj->type; \r\n\t} \r\n\t\r\n\t$columnTypes = strtoupper($columnTypes);\r\n\t$arrTypes = split(\",\",$columnTypes);\r\n\t// return $columnTypes . \"\\n\\n\" . join($arrTypes,\",\");\r\n\t\r\n\twhile ($row = mysql_fetch_row($r)) {\r\n\t \t$sRowBuffer = \"\";\r\n\t \t$sSQLBuffer = \"\";\r\n\t\tfor ($i=0; $i<mysql_num_fields($r); $i++) {\r\n\t\t\tswitch ($arrTypes[$i]) {\r\n\t\t\t\tcase \"TINYINT\":\r\n\t\t\t\tcase \"SMALLINT\":\r\n\t\t\t\tcase \"MEDIUMINT\":\r\n\t\t\t\tcase \"INT\":\r\n\t\t\t\tcase \"INTEGER\":\r\n\t\t\t\tcase \"BIGINT\":\r\n\t\t\t\tcase \"FLOAT(4)\":\r\n\t\t\t\tcase \"FLOAT(8)\":\r\n\t\t\t\tcase \"FLOAT\":\r\n\t\t\t\tcase \"DOUBLE\":\r\n\t\t\t\tcase \"DOUBLE PRECISION\":\r\n\t\t\t\tcase \"REAL\":\r\n\t\t\t\t\t$fieldValue = AddSlashes($row[$i]);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$fieldValue = \"'\" . AddSlashes($row[$i]) . \"'\";\r\n\t\t\t}\r\n\t\t\tif ($sRowBuffer != \"\") { $sRowBuffer = \"$sRowBuffer,\"; } \r\n\t\t\t$sRowBuffer = \"$sRowBuffer$fieldValue\"; \r\n\t\t}\r\n\t\t$sSQLBuffer = \"REPLACE INTO $tableName ($columnNames) VALUES ($sRowBuffer);\\n\";\r\n\t \t$sBuffer = \"$sBuffer$sSQLBuffer\";\r\n\t} \r\n\tmysql_free_result($r);\r\n\treturn $sBuffer;\r\n}",
"function printResult($result) {\n echo \"<br>Retrieved data from table demoTable:<br>\";\n echo \"<table>\";\n echo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"ID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n }\n\n echo \"</table>\";\n }",
"function toStringIncludingTriples() \r\n\t{\r\n\t \t$dump = $this->toString() . chr(13);\r\n\t \t$stateIt=new StatementIterator($this->find(null,null,null));\r\n\t\twhile($statement=$stateIt->next())\r\n\t\t{\r\n\t \t\t$dump .= $statement->toString() . chr(13);\r\n\t \t}\r\n\t \treturn $dump;\r\n\t}",
"function vardump($mixed='')\n\t\t{\n\n\t\t\t// Start outup buffering\n\t\t\tob_start();\n\n\t\t\techo \"<p><table><tr><td bgcolor=ffffff><blockquote><font color=000090>\";\n\t\t\techo \"<pre><font face=arial>\";\n\n\t\t\tif ( ! $this->vardump_called )\n\t\t\t{\n\t\t\t\techo \"<font color=800080><b>ezSQL</b> (v\".EZSQL_VERSION.\") <b>Variable Dump..</b></font>\\n\\n\";\n\t\t\t}\n\n\t\t\t$var_type = gettype ($mixed);\n\t\t\tprint_r(($mixed?$mixed:\"<font color=red>No Value / False</font>\"));\n\t\t\techo \"\\n\\n<b>Type:</b> \" . ucfirst($var_type) . \"\\n\";\n\t\t\techo \"<b>Last Query</b> [$this->num_queries]<b>:</b> \".($this->last_query?$this->last_query:\"NULL\").\"\\n\";\n\t\t\techo \"<b>Last Function Call:</b> \" . ($this->func_call?$this->func_call:\"None\").\"\\n\";\n\t\t\techo \"<b>Last Rows Returned:</b> \".count($this->last_result).\"\\n\";\n\t\t\techo \"</font></pre></font></blockquote></td></tr></table>\".$this->donation();\n\t\t\techo \"\\n<hr size=1 noshade color=dddddd>\";\n\n\t\t\t// Stop output buffering and capture debug HTML\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t// Only echo output if it is turned on\n\t\t\tif ( $this->debug_echo_is_on )\n\t\t\t{\n\t\t\t\techo $html;\n\t\t\t}\n\n\t\t\t$this->vardump_called = true;\n\n\t\t\treturn $html;\n\n\t\t}",
"function printResult($result) {\n\t//Note: DO NOT use this function for debugging. Once you fetch the array from a $result, you CANNOT try to fetch it again. \n\techo \"<br>Got data from table<br>\";\n\techo \"<table>\";\n\techo \"<tr><th>Uname</th><th>Pw</th></tr>\";\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n\t\t\n\t\techo \"<tr><td>\" . $row[\"UNAME\"] . \"</td><td>\" . $row[\"PW\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n\t}\n\techo \"</table>\";\n\techo \"<br></br>\"; \n\n}",
"public function getSqlLog(){\n\n $queryLog = DB::getQueryLog();\n\n var_dump($queryLog);\n }",
"function dblog($sql,$result,$notes=''){\n\t\tglobal $database_queries,$database_sql_queries,$database_query_count;\n\t\t$database_sql_queries[]=$sql;\n\t\tif(is_array($result[0])){\n\t\t\t$titles=array_keys($result[0]);\n\t\t\tinclude_once(STD_LOCATION.'include/std_tab.php');\n\t\t\t$t = new tab();\n\t\t\t$t->name='sql'.rand(0,99999);//$database_query_count\n\t\t\t\n\t\t\t$t->add_tab('Null',$notes);\n\t\t\t$t->add_tab('Query',\"<xmp>$sql</xmp>\");\n\t\t\t$t->add_tab('Trace',b2());\n\t\t\t$t->add_tab('Results',common::table(\n\t\t\t\t$result,\n\t\t\t\t$titles,\n\t\t\t\tarray(\n\t\t\t\t\t'title'=>'Query Results',\n\t\t\t\t\t'style'=>'db_result',\n\t\t\t\t\t'border'=>1)));\n\t\t\t$database_queries.=$t->out();\n\t\t}\n\t}",
"public function getSql();",
"public function getSql();",
"function test_select_items($urabe, $body)\n{\n $sql = $body->sql_simple;\n $result = $urabe->select_items($sql);\n return $result;\n}",
"public function testDumpInsert()\n {\n $table = new \\Phinx\\Db\\Table('table1', [], $this->adapter);\n $table->addColumn('string_col', 'string')\n ->addColumn('int_col', 'integer')\n ->save();\n\n $inputDefinition = new InputDefinition([new InputOption('dry-run')]);\n $this->adapter->setInput(new ArrayInput(['--dry-run' => true], $inputDefinition));\n\n $consoleOutput = new BufferedOutput();\n $this->adapter->setOutput($consoleOutput);\n\n $this->adapter->insert($table->getTable(), [\n 'string_col' => 'test data',\n ]);\n\n $this->adapter->insert($table->getTable(), [\n 'string_col' => null,\n ]);\n\n $this->adapter->insert($table->getTable(), [\n 'int_col' => 23,\n ]);\n\n $expectedOutput = <<<'OUTPUT'\nINSERT INTO `table1` (`string_col`) VALUES ('test data');\nINSERT INTO `table1` (`string_col`) VALUES (null);\nINSERT INTO `table1` (`int_col`) VALUES (23);\nOUTPUT;\n $actualOutput = $consoleOutput->fetch();\n $actualOutput = preg_replace(\"/\\r\\n|\\r/\", \"\\n\", $actualOutput); // normalize line endings for Windows\n $this->assertStringContainsString($expectedOutput, $actualOutput, 'Passing the --dry-run option doesn\\'t dump the insert to the output');\n\n $countQuery = $this->adapter->query('SELECT COUNT(*) FROM table1');\n $this->assertTrue($countQuery->execute());\n $res = $countQuery->fetchAll();\n $this->assertEquals(0, $res[0]['COUNT(*)']);\n }",
"public function testSingleResultQuery() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $query = 'select * from POTEST where UUID = \\'abcdefg\\'';\r\n $po = $this->getPersistenceAdapter()->executeSingleResultQuery($query, 'test_persistence_AbstractPersistenceAdapterTestPersistentObject');\r\n // Compare properties\r\n $this->assertEquals($uuid, $po->uuid, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($bool, $po->booleanValue, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($int, $po->intValue, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($string, $po->stringValue, 'String value from persistent object differs from the string value of the database.');\r\n }",
"public function ViewResults() {\n echo \"<pre>\" . print_r($this->rs, TRUE) . \"</pre>\";\n }",
"function testarQuery($res){\n\t\tif (!$res) {\n echo \"</br><strong>Erro na consulta MySQL: </strong></br>\" . mysql_error().\"</br>\";\n }\n\t}",
"function debugging() {\n\t\t$result = $this->connection->prepare(\"SELECT * FROM admins\");\n\t\t$result->execute();\n\t\treturn $result->fetchAll();\n\t}",
"private function test()\n {\n pr('hola');\n $json = $this->reporte_model->get_json();\n pr($json);\n //$resultado = $this->reporte_model->insert_data($json);\n pr('fin');\n pr($resultado);\n }",
"function logs_tbl()\n {\n // SELECT \n }",
"function dump_table($tablename, $filter=\"\") {\r\n $this->query(sprintf(\"select * from %s\", $tablename));\r\n while ($this->next_record()) {\r\n\t $this->dump_record($tablename, $filter);\r\n\t};\r\n }",
"function printResult($result)\n{\n echo \"<br>Result:<br>\";\n\n // table head\n $ncols = oci_num_fields($result);\n echo \"<table><tr>\";\n for ($i = 1; $i <= $ncols; $i++) {\n $column_name = oci_field_name($result, $i);\n echo \"<th>{$column_name}</th>\";\n }\n echo \"</tr>\";\n\n // table data\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\";\n for ($i = 0; $i < $ncols; $i++) {\n echo \"<td>{$row[$i]}</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}",
"function query(\\database $dbase){\n //\n //Get the sql string \n $sql=$this->to_str();\n //\n // Execute the $sql on columns to get the $result\n $dbase->query($sql);\n \n }",
"function DumpResultRows($ResultArray,$BackgroundColor,$Color,$Text,$Odd=false)\n{\n\tif (count($ResultArray)):?>\n<tr style='background-color:<?php exho ($BackgroundColor);?>;color:<?php exho ($Color)?>;font-weight:bold;'>\n<td colspan='4' >\n\t<?php exho (count($ResultArray)); \n\techo \" {$Text}\";\n\t?>\n\t\n</td>\n</tr>\n<?php \n\t\t$n=0;\n\t\tforeach ($ResultArray as $test)\n\t\t{\n\t\t\techo \"<tr>\";\n\t\t\techo \"<td width='50' align='center'>\\n\\t\\t\";\n\t\t\techo ++$n;\n\t\t\techo \"\\n</td>\";\n\t\t\t$t=$test->failedTest();\n\t\t\techo \"<td>\\n\\t\\t\";\n\t\t\techo get_class($t);\n\t\t\techo \" :: \";\n\t\t\techo $t->getName();\n\t\t\techo \"\\n</td>\";\n\t\t\techo \"<td>\\n\\t\\t\";\n\t\t\t$e=new Exception();\n \t\t\techo $test->getExceptionAsString();\n\t\t\techo \"</td>\";\n\t\t\techo \"<td>\\n\\t\\t\";\n\t\t\t$trace=($test->thrownException()->getTrace());\n\t\t\tif ($Odd)\n\t\t\t{\n\t\t\t\t$file=$trace[0]['file'];\n\t\t\t\t$line=$trace[0]['line'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (isset($trace[3]['file']))\n\t\t\t\t{\n\t\t\t\t\t$file=$trace[3]['file'];\n\t\t\t\t\t$line=$trace[3]['line'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$file=$line=null;\n\t\t\t}\n\t\t\tif ($file!==null)\n\t\t\t{\n\t\t\t\t$dir=substr($file, 0,strlen(jf::root()));\n\t\t\t\t$dir=substr($file,0,strpos($file,DIRECTORY_SEPARATOR,strlen($dir)+1));\n\t\t\t\t$dir=substr($file,0,strpos($file,DIRECTORY_SEPARATOR,strlen($dir)+1));\n\t\t\t\t$filename=substr($file,strlen($dir)+1);\n\t\t\t\techo $dir.\"/<strong>{$filename}</strong> :{$line}\";\n\t\t\t}\n\t\t\telse\n\t\t\t\techo \"File: Could not determine, probably because of fatal error.\";\n\t\t\t\n\t\t\techo \"\\n</td>\\n\";\n\t\t\techo \"</tr>\\n\";\n\t\t}\n\t\t?>\n\t<?php \n\tendif;\t\n}",
"function testDBSelectCorrect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select variable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}",
"function printResult($result) {\n\t\t\t\techo \"<div class='Pokeguide'>\n\t\t\t\techo \"<table>\";\n\n\t\t\t\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n\t\t\t\t\tfor ($i = 0; $i < 15; $i++){\n\t\t\t\t\t\techo \"<tr><td>\" . $row[$i] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\techo \"</table>\";\n\t\t\t\techo \"</div>\";\n\t\t\t}",
"public function dump($die = false);",
"function select_sqliLog($select_query,$expectedResult) {\n $connection = selectConnectionString();\n $queryresult = mysqli_query($connection, $select_query); \n $numRows = mysqli_affected_rows($connection);\n if (! $queryresult){\n echo('Database error: ' . mysqli_error($connection));\n exit;\n } \n if($numRows != $expectedResult){\n include(\"logs/logsMail.php\");\n }\n mysqli_close($connection);\n return $queryresult;\n }",
"public function testSelectStatementAddTable()\n {\n\n $query = new Query(\"SELECT id, description FROM `test` WHERE xy > 10\", 'mysql');\n $query->from(\"abc\", Query::APPEND);\n $this->assertEquals(\"SELECT id, description FROM `test` , `abc` WHERE xy > 10\", (string)$query);\n }",
"public function testResultgetConnection()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n $this->assertType('Q\\DB_Result', $result);\n \t$this->assertSame($this->conn, $result->getConnection());\n }",
"function sqlQuery($sql){\r\n\t\t$con->testmodeEcho($sql, 'SqlSentence');\r\n\t\treturn connDB()->query($sql);\r\n\t}",
"abstract protected function _getSQL(): String;",
"public function testNoResultQueryWithSingleResultStatement() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n $this->setExpectedException('Exception', 'No result statement returned a result.');\r\n $query = 'select * from POTEST where UUID = \\'abcdefg\\'';\r\n $this->getPersistenceAdapter()->executeNoResultQuery($query);\r\n }",
"function get_all_data_output( $con, $table, $offset ){\n\t\n\t\tif ( $table == 'events' )\n\t\t\t$res = select_all_events_output( $con, 0, $offset ); \n\t\telse if ( $table == 'checkins' )\n\t\t\t$res = select_all_checkins_output( $con, 0, $offset ); \n\t\t\n\t\treturn $res;\n\t\t/*\n\t\t$result = $res;\n\t\tfree_result($res);\n\t\treturn $result;\n\t\t*/\n\t}",
"public function testCanRetrieveUsingRawSql()\n {\n\n $aOrderContents = $this->db->newQuery()\n ->findRaw('select ordercontents.*, products.* from ordercontents inner join products on products.pid = ordercontents.pid where masterOrderId = ? order by uid asc',\n 'uid', array('1'))\n ->extractInto('Test_OrderContent')\n ->extractInto('Test_Product')\n ->go();\n\n $orderContent = $aOrderContents[0]['Test_OrderContent'];\n $product = $aOrderContents[0]['Test_Product'];\n $raw = $aOrderContents[0]['__raw'];\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '1',\n 'masterOrderId' => '1',\n 'pid' => '1',\n 'quantity' => '5',\n 'cost' => '8.99',\n 'productName' => 'Gentoo LAMP Server',\n 'productSummary' => 'A Linux/Apache/MySQL/PHP Stack for server environments',\n 'productUrl' => 'http://lamp.gentoo.org/server/',\n 'productCode' => 'AA001',\n 'productCost' => '15.99',\n 'isActive' => '1',\n ),\n $raw\n );\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '1',\n 'masterOrderId' => '1',\n 'pid' => '1',\n 'quantity' => '5',\n 'cost' => '8.99',\n ),\n $orderContent->getData()\n );\n\n $this->assertEquals\n (\n array\n (\n 'pid' => 1,\n 'productName' => 'Gentoo LAMP Server',\n 'productSummary' => 'A Linux/Apache/MySQL/PHP Stack for server environments',\n 'productUrl' => 'http://lamp.gentoo.org/server/',\n 'productCode' => 'AA001',\n 'productCost' => '15.99',\n 'isActive' => '1',\n ),\n $product->getData()\n );\n\n $orderContent = $aOrderContents[1]['Test_OrderContent'];\n $product = $aOrderContents[1]['Test_Product'];\n $raw = $aOrderContents[1]['__raw'];\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '2',\n 'masterOrderId' => '1',\n 'pid' => '4',\n 'quantity' => '20',\n 'cost' => '50.99',\n 'productName' => 'Gentoo/ALT',\n 'productSummary' => 'Gentoo package management on non-Linux kernels',\n 'productUrl' => 'http://alt.gentoo.org/',\n 'productCode' => 'AA004',\n 'productCost' => '3.99',\n 'isActive' => '1',\n ),\n $raw\n );\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '2',\n 'masterOrderId' => '1',\n 'pid' => '4',\n 'quantity' => '20',\n 'cost' => '50.99',\n ),\n $orderContent->getData()\n );\n\n $this->assertEquals\n (\n array\n (\n 'pid' => '4',\n 'productName' => 'Gentoo/ALT',\n 'productSummary' => 'Gentoo package management on non-Linux kernels',\n 'productUrl' => 'http://alt.gentoo.org/',\n 'productCode' => 'AA004',\n 'productCost' => '3.99',\n 'isActive' => '1',\n ),\n $product->getData()\n );\n }",
"function dumper($data=null, $is_sql = 0) { \n\t\t@ob_clean(); \n\t\t\n\t\t$ci =& get_instance();\n\t\t\n\t\techo \"<style>ul {\n\t\t\t\tlist-style-type: none;\n\t\t\t}\n\n\t\t\tul > li:before {\n\t\t\t\tcontent: \\\"-\\\"; /* en dash here */\n\t\t\t\tposition: absolute;\n\t\t\t\tmargin-left: -1.1em; \n\t\t\t}</style>\";\n\t\techo \"<pre><b style='font-size:18px'>Pegawai ini sudah Dinas Luar :</b></pre><pre style='margin-left:15px;'>\";\n\t\t\n\t\tif(!$is_sql) {\n\t\t\t\n\t\t\t$time = round(microtime(true)-$_SERVER['REQUEST_TIME'], 3);\n\t\t\t\n\t\t\t$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t\tdo $caller = array_shift($backtrace); while ($caller && !isset($caller['file']));\n\t\t\tif ($caller) {\n\t\t\t\techo \"File Trace : \".$caller['file'].':'.$caller['line'].\"\n\t\t\t\t\t\t\t <br /><span>Called By : <ul><li> Controller : \".\n\t\t\t\t\t\t\t\t$ci->router->fetch_class().\"</li><li> Function : \".\n\t\t\t\t\t\t\t\t$ci->router->fetch_method().\n\t\t\t\t\t\t\t \"</li><li> Runtime : \".\n\t\t\t\t\t\t\t\t$time.' Second(s)</li></ul></span><br />\n\t\t\t\t\t\t\t <div>$VAR1 = </div>'.\n\t\t\t\t\t\t\t \"<div style='margin-left:50px;'>\";\n\t\t\t\tif($data != null) {\n\t\t\t\t\tprint_r($data);\n\t\t\t\t} else {\n\t\t\t\t\techo \"Not Returning Variable Or Variable is Null\";\n\t\t\t\t\t\n\t\t\t\t\techo \"<br /><br />To Do : Make sure the variables has a value (if it is a function, make sure that the function has a 'return'))\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo \"</div>\";\n\t\t\t}\n\t\t\t \n\t\t} else {\n\t\t\techo mysql_error();\t\t\t\n\t\t}\n\t\techo \"</pre><pre></pre>\";\n\t\t$ci->db->trans_rollback();\n\t\texit; \n\t}",
"public function testMultipleResultQueryWithSingleResultStatement() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $query = 'select * from POTEST where UUID = \\'abcdefg\\'';\r\n $pos = $this->getPersistenceAdapter()->executeMultipleResultQuery($query);\r\n $this->assertEquals(1, count($pos), 'Wrong number of database records found.');\r\n }",
"function ds(callable $callback)\n {\n return SqlDumper::default($callback);\n }",
"public function testGetResult(): void\n {\n $fields = [];\n\n for ($x = 0; $x < 6; $x++) {\n $field = $this->createMock(DoctrineAbstractField::class);\n $field->expects(self::once())->method('buildQuery');\n\n $fields[] = $field;\n }\n\n $em = $this->getEntityManagerMock();\n $qb = $this->getQueryBuilderMock($em);\n $this->extendWithRootEntities($em, $qb);\n\n $driver = new DoctrineDriver([], $em, 'entity');\n $driver->getResult($fields, 0, 20);\n }",
"public function testResultSeekRows()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test\");\n }",
"public function testGetDataTableSingleResult() {\r\n\t\t// Create values via SQL\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testGetDataTable 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testGetDataTable 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testGetDataTable 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n\t\t// Get value data table of single row (second record)\r\n\t\t$datatable = $this->getPersistenceAdapter()->getDataTable('select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE from POTEST where UUID=\\'uuid1tRMR2\\'');\r\n\t\t// Compare contents\r\n\t\t$headers = $datatable->getHeaders();\r\n\t\t$this->assertEquals(4, count($headers), 'Wrong header names count');\r\n\t\t$this->assertEquals('UUID', $headers[0], 'Column 0 has wrong header name');\r\n\t\t$this->assertEquals('BOOLEAN_VALUE', $headers[1], 'Column 1 has wrong header name');\r\n\t\t$this->assertEquals('INT_VALUE', $headers[2], 'Column 2 has wrong header name');\r\n\t\t$this->assertEquals('STRING_VALUE', $headers[3], 'Column 3 has wrong header name');\r\n\t\t$datamatrix = $datatable->getDataMatrix();\r\n\t\t// Data matrix must contain only one row\r\n\t\t$this->assertEquals(1, count($datamatrix), 'Wrong row count');\r\n\t\t$this->assertEquals(4, count($datamatrix[0]), 'Wrong column count in row 0');\r\n\t\t// The query requested the second record\r\n\t\t$this->assertEquals(''.$records[1]['UUID'], $datamatrix[0][0], 'Cell content does not match in column 0');\r\n\t\t$this->assertEquals(''.($records[1]['bool']?1:0), $datamatrix[0][1], 'Cell content does not match in column 1');\r\n\t\t$this->assertEquals(''.$records[1]['int'], $datamatrix[0][2], 'Cell content does not match in column 2');\r\n\t\t$this->assertEquals(''.$records[1]['string'], $datamatrix[0][3], 'Cell content does not match in column 3');\r\n\t}",
"function showTestTable(&$dbh,$d)\n {\n $shown = 0;\n $dbh->QueryResult('SELECT ID,VAL FROM OCI8_CLASS_TEST_TABLE ORDER BY ID');\n while($data = $dbh->FetchResult())\n {\n printf(\"%5d. %s%s\",$data['ID'],$data['VAL'],$d['LF']);\n $shown++;\n }\n $dbh->FreeResult();\n if(!$shown)\n {\n printf(\"No data in table.%s\",$d['LF']);\n }\n }",
"public function testReturning() {\n\t\t$sql =\n\t\t\t\"INSERT INTO storagetest.user (username) VALUES\\n\".\n\t\t\t\"('bob'), ('fred')\\n\".\n\t\t\t\"RETURNING id, username\\n\";\n\t\t$rows = $this->getStorageHelper()->queryRows($sql);\n\t\t$this->assertEquals(2, count($rows));\n\t\tforeach( $rows as $row ) {\n\t\t\t$this->assertEquals( 2, count($row) );\n\t\t}\n\t}",
"function test_format_sql_place_holders($urabe, $body)\n{\n $sql = $body->sql_common;\n return $urabe->format_sql_place_holders($sql);\n}",
"public function testQueryParse()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status=?\", 'ACTIVE');\n\t\t$this->assertType('Q\\DB_Result', $result);\n\t\t\n\t\t$this->assertEquals('SELECT * FROM test WHERE status=\"ACTIVE\"', $result->getStatement());\n \t\n \t$this->assertEquals(array(1, 'one', 'first row', 'ACTIVE'), $result->fetchOrdered());\n \t$this->assertEquals(array(2, 'two', 'next row', 'ACTIVE'), $result->fetchOrdered());\n \t$this->assertNull($result->fetchOrdered());\n }",
"function printResult($result) {\n while (($row = oci_fetch_array($result)) != false) {\n echo \"<p class=\\\"wrapper\\\">\";\n echo $row[0];\n echo \"</p>\";\n }\n }",
"function get_data()\n\t{\n\t\t$query = $this->db->get(\"Testing\");\n\n\t\treturn $query;\n\t}",
"function fastResult($script)\n{\n\tdisconnectDB();\n\tshowResult($script);\n}",
"function display_sql(){\n #\n # Formating for sqlplus\n #\n u::p('set linesize 200');\n u::p('set pagesize 999');\n u::p('set feedback off');\n u::p('col s_time format a8');\n u::p('col active_sessions format a20');\n u::p('col on_cpu format 900');\n u::p('col user_io format 900');\n u::p('col system_io format 900');\n u::p('col other format 900');\n u::p('col sessions_in_lock format a15');\n u::p('col sql_id format a15');\n u::p('col sql_ids format a60');\n u::p('col sql_text format a90');\n u::p('col sid format 9999');\n u::p('col to_kill format a25');\n u::p('col username format a10');\n u::p('col program format a40');\n u::p('col sids_on_cpu format a40');\n u::p('col sids_user_io format a15');\n u::p('col sids_system_io format a15');\n u::p('col sids_blocked format a16');\n u::p('col others format a15'); \n u::p('----------------------');\n #\n # Dump out the sql we have run\n #\n foreach( $this->sql_details as $sql_detail ) u::p($sql_detail);\n }",
"public function testQueryFetchDefault() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n $this->assertInstanceOf(StatementInterface::class, $result);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }",
"public function dumpInfo()\r\n\t{\r\n\t\techo mysqli_info($this->link);\r\n\t}",
"function printResult($result) {\n\techo \"<br>Got data from table tab1:<br>\";\n\techo \"<table>\";\n\techo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n //echo \"<tr><td>\" . $row[\"NID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n \"<tr><td>\" . $row[\"Player_Name\"] . \"</tr><td>\" . $row[\"Team_Name\"] . \"</tr><td>\" . $row[\"PPG\"] . \n \"</tr><td>\" . $row[\"Assist\"] . \"</tr><td>\" . $row[\"Rebounds\"] . \"</tr><td>\" . $row[\"Steals\"] . \n \"</tr><td>\" . $row[\"Turnovers\"] . \"</td></tr>\";\n\t}\n\techo \"</table>\";\n}",
"public function testNoResultQuery() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Store new record with executeNoResultQuery()\r\n $query = 'insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')';\r\n $this->getPersistenceAdapter()->executeNoResultQuery($query);\r\n // Get record back from database\r\n $result = $this->executeQuery('select * from POTEST where UUID=\\''.$uuid.'\\'');\r\n // Records must be unique\r\n $this->assertEquals($uuid, $result[0]['UUID'], 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($bool, (bool)$result[0]['BOOLEAN_VALUE'], 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($int, intval($result[0]['INT_VALUE']), 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($string, $result[0]['STRING_VALUE'], 'String value from persistent object differs from the string value of the database.');\r\n }",
"public function printResult() {\n $this->result->path = $this->getType() . 's/' . $this->getName() . '#tmp';\n\n // text/plain is used to support IE\n header('Cache-Control: no-cache');\n header('Content-Type: text/plain; charset=utf-8');\n\n print $this->getResult();\n }",
"public function printquery(){\n\t\techo $this->query.\";\";\n\t}",
"function db_log_query($description, $sql, $params, $result = null) {\n\tif (! option('debug')) {\n\t\treturn;\n\t}\n\tif (! isset($GLOBALS['SQL_QUERIES'])) {\n\t\t$GLOBALS['SQL_QUERIES'] = array ();\n\t}\n\t$GLOBALS['SQL_QUERIES'][] = array (\n\t\t\"description\" => $description,\n\t\t\"query\" => $sql,\n\t\t// Ineffective and ugly way for a deep copy\n\t\t\"result\" => unserialize(serialize($result)),\n\t\t\"params\" => $params \n\t);\n}",
"public function getRawResult();",
"function print_table($query_result) {\n echo \"<table>\";\n echo \"<tr>\";\n for ($i = 0; $i < pg_num_fields($query_result); $i++) {\n $fieldname = pg_field_name($query_result, $i);\n echo \"<th>$fieldname</th>\";\n }\n echo \"</tr>\";\n\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n echo \"<td>$row[$i]</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }",
"function var_dump_ret($mixed = null) {\r\n\t ob_start();\r\n\t var_dump($mixed);\r\n\t $content = ob_get_contents();\r\n\t ob_end_clean();\r\n\t return $content;\r\n\t}",
"static function get_data($table) {\r\n $rekete = \"SELECT * FROM \" . $table . \" ORDER BY created DESC\";\r\n $result = Functions::commit_sql($rekete, \"\");\r\n if (Functions::is_void($result))\r\n return false;\r\n else\r\n return $result;\r\n }",
"public function test()\n {\n\n //获得大类步骤($step类型为obj数组)\n $step = BuildingCheckResultModel::where('FK_Equipment_Id', '=', 208)->where('level', '=', 1)->select();\n //小类步骤\n $little_step = array();\n for ($i = 0; $i < count($step); $i++) {\n $little_step[$i] = BuildingCheckResultModel::where('FK_Equipment_Id', '=', 208)->where('parentID', '=', $step[$i]->basic_equ_id)->where('level', '=', 2)->select();\n }\n\n dump($step);\n echo \"++++++++++++++++++++++++++++++++++++<br>\";\n\n dump($little_step);\n\n }",
"public function get_query_result()\n\t{\n\t\t$sql = \"select * from test_db\";\n\t\t$query = $this->db->query($sql);\n\n\t\t//Complete array result\n\t\t$result = $query->result_array();\n\n\t\t//result of first row\n\t\t$firsts_row = $query->first_row();\n\t}",
"function set_debug_item($stmt, $result) { }",
"function __toString(): string {\n return $this->getSQL(null);\n }",
"public function __toString() {\n\t\treturn $this->sql;\n\t}",
"public function testSingleResultQueryWithMultipleResultStatement() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n $this->setExpectedException('Exception', 'Single result statement returned more than one result.');\r\n $this->getPersistenceAdapter()->executeSingleResultQuery('select * from POTEST');\r\n }"
]
| [
"0.66107243",
"0.65047324",
"0.64747787",
"0.6457029",
"0.6344192",
"0.6284919",
"0.62800235",
"0.62549585",
"0.62513125",
"0.62335825",
"0.62279063",
"0.6222862",
"0.6168271",
"0.6162268",
"0.6162268",
"0.61015445",
"0.6049491",
"0.60336095",
"0.60190094",
"0.59950876",
"0.59950876",
"0.59938914",
"0.5939606",
"0.5938582",
"0.5936983",
"0.5932282",
"0.5915702",
"0.5885821",
"0.58402854",
"0.58233625",
"0.58214",
"0.5819792",
"0.58078754",
"0.58021605",
"0.5783772",
"0.57780945",
"0.57699335",
"0.57691664",
"0.5765735",
"0.576392",
"0.5763249",
"0.57629365",
"0.5753752",
"0.5742438",
"0.57309705",
"0.57309705",
"0.5728672",
"0.5722008",
"0.57219106",
"0.57197195",
"0.5710574",
"0.5708253",
"0.5704955",
"0.569709",
"0.5688699",
"0.56831104",
"0.56824696",
"0.5672992",
"0.5670493",
"0.5654613",
"0.5643013",
"0.56403506",
"0.5635779",
"0.56266266",
"0.5612329",
"0.56117594",
"0.5607804",
"0.56058156",
"0.5598387",
"0.55669594",
"0.5553176",
"0.55529046",
"0.5532492",
"0.5528733",
"0.5528518",
"0.55241257",
"0.55239385",
"0.5523914",
"0.55147517",
"0.55125225",
"0.5510493",
"0.5490751",
"0.5490179",
"0.54825866",
"0.54759645",
"0.54730827",
"0.5461579",
"0.5449669",
"0.5447965",
"0.5441945",
"0.54373336",
"0.54369074",
"0.54327726",
"0.54323",
"0.54286844",
"0.5423",
"0.5420542",
"0.54204375",
"0.5417204",
"0.54168254"
]
| 0.67678106 | 0 |
check if the cart exists in the current session, if not it creates a new cart, returns true if cart exists | function checkCart() {
if (! isset($_SESSION['cart'])) {
$_SESSION['cart'] = [];
return true;
} else {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function HasCart() {\n\tif ($this->IsNew()) {\n\t return FALSE;\n\t} else {\n\t return (!is_null($this->GetCartID()));\n\t}\n }",
"public function cartExists() {\n\t\t$cart = $this->find('first', array('conditions' => $this->cartConditions(), 'contain' => FALSE));\n\t\treturn !empty($cart);\n\t}",
"public static function loginAddCartSession()\n {\n if(session()->has('cart'))\n {\n $_instance = new CartController();\n $items = session()->get('cart');\n foreach($items as $item){\n $_instance->store(strval($item));\n }\n\n $carts = auth()->user()->carts()->get();\n foreach($carts as $cart){\n if(!in_array($cart['album_id'], $items)){\n session()->push('cart', $cart['album_id']);\n }\n }\n }\n return true;\n\n }",
"function check_product_in_the_cart($product){\n if (auth()->check()){\n $cart = Cart::where('user_id', auth()->user()->id)->where('product_id', $product->id)->first();\n }else{\n if(session()->has('carts')){\n $cart = key_exists($product->uuid, session('carts'));\n }else{\n $cart = false;\n }\n }\n\n if ($cart){\n return true;\n }else{\n return false;\n }\n}",
"public function createCart() {\n if (!is_array($this->cart)) {\n $this->cart = array();\n $this->updateSession();\n }\n }",
"public function check_cart_id()\n\t{\n\t\tif(isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID']) && $_SESSION['cart']->cartID != $_SESSION['cartID'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function actionAddToCart()\n {\n (LoginController::class)::checkLogin();\n $id = App::call()->request->getParams()['id'];\n $cart = (new Sessions())->get('cart');\n if ($id) {\n if (!$cart || !in_array($id, $cart)) {\n (new Sessions())->add('cart', $id);\n $message = 'Item is added!';\n } else {\n $message = 'Item is already in cart!';\n }\n }\n echo $message;\n }",
"public function isCartEmpty()\n {\n return empty($_SESSION['cart']) ? true : false;\n }",
"public function create()\n {\n $cart = session()->get('cart');\n }",
"public function insertCart() {\n\t\t$numRows = $this->db->insert();\n\t\tif($numRows===1) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"private function check_cart() {\n $users_id = $this->session->userdata('id');\n if ($users_id) {\n // User connected > DB\n $this->data['deals'] = $this->users_cart->getForUser($users_id);\n } else {\n // Guest > Session\n $deals = $this->session->userdata('cart');\n if ($deals) {\n $this->data['deals'] = $this->deals->getDeals(false, false, false, false, false, false, $deals);\n } else {\n $this->data['deals'] = array();\n }\n }\n }",
"public function hasActiveCart();",
"public function addprodus_session($product)\n {\n $getsess = $this->getsession();\n if(!$getsess) $cart = array();//Cart doesn't exista\n elseif($getsess) $cart = $getsess;//Cart exist, use it's Array\n\n $cart[$product[\"id\"]] = $product;//pass product to Cart\n\n $this->session->set_userdata('cart', $cart);\n if($this->checkCartItem($product[\"id\"])) return true;\n\n return false;\n }",
"protected function findInSession()\n {\n if($cart_id = $this->getCartSession()){\n\n // if a cart id is found in session:\n // - verify that it belongs to a cart\n // - verify that it is still open\n return entity('cart')->where([\n 'id' => $cart_id,\n 'status' => 'open'\n ])->first();\n\n }\n\n return false;\n }",
"function pre_confirmation_check() {\n global $cartID;\n global $cart;\n \n if (empty($cart->cartID)) {\n $cartID = $cart->cartID = $cart->generate_cart_id();\n }\n \n if (! tep_session_is_registered('cartID')) {\n tep_session_register('cartID');\n }\n }",
"function add_item_to_cart( $prodId = null ) {\n if ( null != $prodId && is_numeric( $prodId ) ) {\n\n // Probably should sql check database to see\n // if product exisits.\n\n if( $_SESSION[\"cart\"][$prodId] ) {\n $_SESSION[\"cart\"][$prodId]++;\n }\n else {\n $_SESSION[\"cart\"][$prodId] = 1;\n }\n }\n}",
"public function addToCart(Request $request){\n $dish_id = $request->id;\n\n $dish = Dish::find($dish_id);\n\n $product = [\n 'id' => $dish->id,\n 'title'=> $dish->title,\n 'photo' => $dish->photo,\n 'quantity'=> 1,\n 'price' => $dish->price,\n 'total' => $dish->price\n ];\n\n $items = session('cart.items');\n $existing = false;\n $grand_total = 0;\n\n if($items && count($items)> 0) {\n\n foreach($items as $index => $item) {\n if($item['id'] == $dish_id) {\n $items[$index]['quantity'] = $item['quantity'] + $product['quantity'];\n $items[$index]['total'] = $items[$index]['quantity'] * $dish->price;\n $existing = true;\n $grand_total += $items[$index]['total'];\n } else {\n $grand_total += $item['total'];\n }\n }\n\n } \n\n if(!$existing){\n session()->push('cart.items', $product);\n $grand_total += $product['total'];\n } else {\n session(['cart.items'=> $items]);\n }\n\n session(['cart.total' => $grand_total]);\n\n return session('cart');\n \n }",
"public function add(Request $request): bool\n {\n /** @var Product $product */\n $product = Product::findOrFail($request->get('product_id'));\n $quantity = ($request->get('quantity')) ?? 1;\n\n if(! $product->canBeAddedToCart()) {\n return false;\n }\n\n \\Cart::add([\n 'id' => $product->id,\n 'name' => $product->title,\n 'price' => $product->price,\n 'quantity' => $quantity,\n 'attributes' => array(),\n 'associatedModel' => $product\n ]);\n\n return true;\n }",
"public function addToCart(Request $request, $id){\n if(Auth::user()) {\n $shop = Product::find($request->product);\n if(!$shop) {\n abort(404);\n }\n \n $cart = session()->get('cart'); //verificam daca exista un cos in sesiune\n\n if(!$cart) {\n $cart = [\n $id => [\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ]\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n if(isset($cart[$id])) { // daca cart nu este gol at verificam daca produsul exista pt a incrementa cantitate\n $cart[$id]['quantity']++;\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n $cart[$id] = [ // daca item nu exista in cos at addaugam la cos cu quantity = 1\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n } else {\n return view('auth.login', ['url' => 'user']);\n }\n \n }",
"public function store(Request $request)\n {\n $duplicates = Cart::search(function ($cartItem, $rowId) use ($request){\n return $cartItem->id === $request->id;\n });\n\n if ($duplicates->isNotEmpty()) {\n return redirect()->route('frontEnd.cart.index')->with('success_message', 'Item is already in your Cart');\n # code...\n }\n Cart::add($request->id, $request->name, $request->quantity, $request->price, ['size' => $request->productSize , 'color' => $request->productColor] )\n ->associate('App\\Product');\n\n return redirect()->route('frontEnd.cart.index')->with('success_message', 'Item was added to your cart!');\n \n }",
"function empty_cart() {\n if(isset($_SESSION['cart'])) {\n\t\t\t## unset and recreate cart\n unset($_SESSION['cart']);\n\t\t\t$_SESSION['cart'] = array(); \n return TRUE;\n } else {\n return FALSE;\n\t\t }\n }",
"public function addToCart(Request $request ,$id){\n $product = Product::find($id);\n $cart = session()->get('cart_'.Auth::user()->id);\n // No Items In the Cart\n if(!$cart){\n $cart =[\n $id =>[\n 'id' => $product->id,\n 'name' =>$product->name,\n 'price' =>$product->price,\n 'image' =>$product->image,\n 'quantity' => 1\n ]\n ];\n $request->session('cart_'.Auth::user()->id)->put('cart_'.Auth::user()->id,$cart);\n return back()->with('success','Product Added Successfully'); \n }//end if\n // if Product already exists in Cart increase quantity by 1\n if(isset($cart[$id])){\n $cart[$id]['quantity']++;\n session()->put('cart_'.Auth::user()->id,$cart);\n //dd(session('cart'));\n return back()->with('success','Product Added Successfully');\n \n }//end if(isset($cart[$id])) \n \n //if Product is not exist in the Cart Add it To Cart\n $cart[$id] =[\n 'id' => $product->id,\n 'name' =>$product->name,\n 'price' =>$product->price,\n 'image' =>$product->image,\n 'quantity' =>1\n ];\n session()->put('cart_'.Auth::user()->id,$cart);\n // dd(session('cart'));\n return back()->with('success','Product Added Successfully'); \n }",
"function check_if_added_to_cart($item_id) {\n $user_id = $_SESSION['user_id']; //We'll get the user_id from the session\n $con= mysqli_connect(\"localhost\",\"root\",\"\",\"intern\",\"3309\") or die(mysqli_error($con));\n // connecting to the database\n // We will select all the entries from the user_items table where the item_id is equal to the item_id we passed to this function, user_id is equal to the user_id in the session and status is 'Added to cart'\n \n $query = \"SELECT * FROM users_items WHERE item_id='$item_id' AND user_id ='$user_id' and status='Added to cart'\";\n $result = mysqli_query($con, $query) or die(mysqli_error($con));\n \n// We'll check if the no.of rows in the result and no.of rows returned by the mysqli_num_rows($result) is true. If yes then it return 0 else it returns 0\n if (mysqli_num_rows($result) >= 1) {\n return 1;\n } else {\n return 0;\n }\n}",
"public function addToCart(Request $request){\n if($request->session()->has('user'))\n {\n //add item info inside cart table\n $cart = new Cart;\n $cart->user_id = auth()->user()->id;\n $cart->product_id = $request->product_id;\n $cart->save();\n return redirect('/products');\n }else{\n return redirect('/login');\n }\n }",
"public function addToCart(Request $request)\n {\n // Cart::destroy();\n // return $request->all();\n $duplicate = Cart::instance('shopping')->search(function ($cartItem, $rowId) use ($request) {\n return $cartItem->id === $request->id;\n });\n if ($duplicate->isNotEmpty()) {\n $rowId = Cart::instance('shopping')->content()->where('id', $request->id)->first()->rowId;\n // Cart::remove($rowId);\n $arr = array('msg' => 'Already in Cart', 'Status' => false, 'Cart_cout' => Cart::instance('shopping')->content());\n return response($arr, 200);\n } else {\n // Cart::add(['id' => '293ad', 'name' => 'Product 1', 'qty' => 1, 'price' => 9.99 );\n\n Cart::instance('shopping')->add($request->id, $request->name, $request->qty ?? 1, $request->amount , ['qtyValue' => $request->qtyValue])\n ->associate('\\App\\Product');;\n $arr = array('msg' => 'Added to cart', 'Status' => true, 'Cart_cout' => Cart::instance('shopping')->content());\n return response($arr, 200);\n }\n }",
"public function addToCart(Request $request)\n {\n $id = $request->id;\n $type = $request->type;\n $message = '';\n\n switch($type)\n {\n case 'file':\n $product = File::find($id);\n break;\n case 'episode':\n $product = Episode::find($id);\n break;\n case 'plan':\n $product = Plan::find($id);\n break;\n }\n\n\n if(!$product)\n {\n abort(404);\n }\n\n if(Auth::check())\n {\n $userId = Auth::id(); //extracting user ID\n $userCartExistance = Cart::HasCart($userId); //check if this user has any cart or not, this syntax returns true or false\n\n if($userCartExistance) // if logged in user has any cart then return cart object of this user\n {\n\n $userCart = Cart::userCart($userId); // returning cart object\n $cartId = $userCart->id; //returning cart's ID\n\n $productExistance = Cartable::CheckIfExists($cartId, $id, $type); //check if this product already exists in the cartables table or not\n\n if($productExistance) //if this product exists in the cart\n {\n $message = 'محصول موردنظر در سبد خرید شما موجود است.';\n }\n else\n {\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n\n }\n else //if logged in user has no cart then create one for her!\n {\n $userCart = new Cart();\n $userCart->user_id = $userId;\n $userCart->save();\n\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n }\n else // if user is not logged in then store cart information in session\n {\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new ShoppingCart($oldCart);\n $message = $cart->add($product, $type, $id);\n Session::put('cart', $cart);\n }\n // route('showProduct', $id)\n // return redirect()->back()->with('message', $message);\n\n return response()->json(['message' => $message]);\n }",
"public function issetCustomerSession()\n {\n if(! empty($this->session('customerCartData')))\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"function addtocart($pid, $id,$name){\n //echo $pid;\n if(is_array($_SESSION['cart'])){\n\n echo $this->product_exists($pid);\n if($this->product_exists($pid)) return;\n $max=count($_SESSION['cart']);\n $_SESSION['cart'][$max]['email']=$pid;\n $_SESSION['cart'][$max]['name']=$name;\n $_SESSION['cart'][$max]['id']=$id;\n }\n else{\n $_SESSION['cart']=array();\n $_SESSION['cart'][0]['email']=$pid;\n $_SESSION['cart'][0]['name']=$name;\n echo $_SESSION['cart'][0]['id']=$id;\n }\n return $_SESSION['cart'];\n}",
"public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }",
"public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}",
"function is_cart() {\n\t\treturn is_page( carton_get_page_id( 'cart' ) );\n\t}",
"public function doAddToCart(Request $request){\n $account = new AccountController($request);\n $cust_id = $account->checkCookie($request);\n\n \t$prod_id = decrypt($request->prod_id);\n\n \t$cart = DB::table('t_cart_detail')->where(['prod_id'=>$prod_id,'cust_id'=>$request->session()->get('cust_id')])->get();\n\n $response = [];\n \tif($cart->isEmpty()){\n\t \tDB::table('t_cart_detail')->insert(['prod_id'=>$prod_id,\n\t \t\t\t\t\t\t\t\t\t\t'cust_id'=>$request->session()->get('cust_id'),\n\t \t\t\t\t\t\t\t\t\t\t'qty'=>$request->qty,\n\t \t\t\t\t\t\t\t\t\t\t'addtime'=>date('Y-m-d H:i:s')]);\n\t \t$response['text'] = 'Berhasil ditambahkan ke Keranjang Belanja. <a href=\"'.url('transaction/cart').'\" class=\"btn btn-primary\">Lihat Keranjang Belanja</a>';\n\t \t$response['res'] = 'success';\n\t } else {\n\t \t$response['text'] = 'Produk ini sudah ada di Keranjang Belanja. <a href=\"'.url('transaction/cart').'\" class=\"btn btn-primary\">Lihat Keranjang Belanja</a>';\n\t \t$response['res'] = 'danger';\n\t }\n $response['count_cart'] = DB::table('t_cart_detail')->where('cust_id',$request->session()->get('cust_id'))\n ->count();\n\t return response()->json($response);\n }",
"public function store(Request $request)\n {\n $rules = CartProduct::rules($request);\n $request->validate($rules);\n $product = Products::findOrFail($request->product_id);\n // Check if user has already cart\n $cart = Cart::where('user_id', Auth()->id())\n ->first();\n if ($cart==null) {// User does not have cart\n $newCart = Cart::create([\n 'user_id' => Auth()->id(),\n 'total' => $product->product_price\n ]);\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $newCart->id;\n $CART = CartProduct::create($credentials);\n } else {//User already have cart\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $cart->id;\n // Test 1\n $SameProduct = CartProduct::where('user_id', Auth()->id())->where('product_id' , $product->id )->get();\n if ($SameProduct->count() >= 1 ) {\n return redirect()->route('my-cart.index')->withErrors('The Item Is Already Exist');\n } else {\n // Insert product into cart\n $CART = CartProduct::create($credentials);\n // update total price\n $this->updateTotal($cart);\n }\n }\n\n\n return redirect()->route('my-cart.index');\n }",
"function setProductInCartCount ($id, $amount) {\r\n //ensures that the cart exists within the session\r\n if (checkCart()) {\r\n //checks if the product is actually in the cart\r\n if (array_key_exists($id, $_SESSION['cart'])) {\r\n if ($amount > 0) {\r\n $_SESSION['cart'][$id]['amount'] = $amount;\r\n } else {\r\n //remove product\r\n unset($_SESSION['cart'][$id]);\r\n }\r\n } else {\r\n //if not add the product to the cart\r\n addToCart($id, $amount);\r\n }\r\n }\r\n}",
"public function isExistingShop(): bool\n {\n $shop = ShopProfileEntity::findOne([\n 'user_id' => Yii::$app->request->post()['shop_id']]);\n if (!$shop) {\n $this->addError('user_id',\n Yii::t('app', 'Магазин не найден'));\n return false;\n } else {\n return true;\n }\n }",
"public function addProduct(Cart $cartObj) :bool\n {\n $orderObj = new Order();\n $orderObj->createOrder();\n $query = $this->pdo->prepare(\"SELECT orders_products.id from orders_products\nINNER JOIN orders on orders_products.order_id = orders.id\nWHERE orders.user_id = :user_id AND orders.status='cart' AND orders_products.product_id=:product_id\");\n $query->execute(array('product_id'=>$cartObj->getProductId(),'user_id'=> $orderObj->getUserId()));\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n if (empty($row)) {\n $query = $this->pdo->prepare(\"\n INSERT INTO orders_products\n SELECT NULL,id,:product_id,:quantity FROM orders WHERE user_id = :user_id AND status ='cart'\");\n $query->execute(array\n (\n 'product_id' => $cartObj->getProductId(),\n 'user_id' => $orderObj->getUserId(),\n 'quantity'=>$cartObj->getQuantity()));\n $product = new Product();\n $product->decreaseQuantity($cartObj->getOrderId(), $cartObj->getQuantity());\n unset($query);\n } else {\n $query = $this->pdo->prepare(\"UPDATE orders_products \n SET quantity = quantity+:quantity WHERE product_id =:product_id;\");\n $query->execute(array\n (\n 'product_id'=>$cartObj->getProductId(),\n 'quantity'=>$cartObj->getQuantity()));\n $product = new Product();\n $product->decreaseQuantity($cartObj->getProductId(), $cartObj->getQuantity());\n unset($query);\n }\n return true;\n }",
"public function testCheckCart()\n {\n \n\n $customerSession = $this->getModelMock('customer/session', array('getQuote', 'start', 'renewSession', 'init'));\n $this->replaceByMock('model', 'customer/session', $customerSession);\n \n $itemsCollection = array();\n $product = new Varien_Object();\n $product->setId(1);\n $item = new Varien_Object();\n $item->setProduct($product);\n $item->setId(1);\n $itemsCollection[] = $item;\n $item = new Varien_Object();\n $product->setId(2);\n $item->setProduct($product);\n $item->setId(2);\n $itemsCollection[] = $item;\n $item = new Varien_Object();\n $product->setId(3);\n $item->setProduct($product);\n $item->setId(3);\n $itemsCollection[] = $item;\n $quoteMock = $this->getModelMock('sales/quote', array('getAllItems'));\n $quoteMock->expects($this->any())\n ->method('getAllItems')\n ->will($this->returnValue($itemsCollection));\n $this->replaceByMock('model', 'sales/quote', $quoteMock);\n $quote = Mage::getModel('sales/quote')->load(2);\n $checkoutSession = $this->getModelMock('checkout/session', array('getQuote', 'start', 'renewSession', 'init'));\n $checkoutSession->expects($this->any())\n ->method('getQuote')\n ->will($this->returnValue($quote));\n $this->replaceByMock('model', 'checkout/session', $checkoutSession);\n \n $this->assertEquals(21, Mage::helper('postident/data')->checkCart());\n }",
"public function AddToCart(Request $request)\n {\n // return $request->price;\n if ($request->session()->has(\"onlineClient\")) {\n $clientInfo = $request->session()->get(\"onlineClient\");\n $idd = $clientInfo->id;\n $cartOld = AddToCartModel::where('userId', $idd)->where('productId', $request->productId)->first();\n if ($cartOld == null) {\n $cartnew = new AddToCartModel;\n $cartnew->productId = $request->productId;\n $cartnew->userId = $idd;\n $cartnew->type = $request->productType;\n $cartnew->price = $request->price;\n $cartnew->save();\n } else {\n $cartOld->quantity += 1;\n $cartOld->save();\n }\n return \"success\";\n } elseif ($request->session()->has(\"uniqid\")) {\n $uniqid = $request->session()->get(\"uniqid\");\n $idd = $uniqid;\n $cartOld = AddToCartModel::where('sessionId', $idd)->where('productId', $request->productId)->first();\n if ($cartOld == null) {\n $cartnew = new AddToCartModel;\n $cartnew->productId = $request->productId;\n $cartnew->type = $request->productType;\n $cartnew->price = $request->price;\n $cartnew->sessionId = $idd;\n $cartnew->save();\n } else {\n $cartOld->quantity += 1;\n $cartOld->save();\n }\n return \"success\";\n } else {\n return \"error\";\n }\n }",
"public function addToCart($id)\n {\n $product = Product::find($id);\n if (!$product) {\n abort(404);\n }\n $cart = session()->get('cart');\n\n // if cart is empty then this the first product\n if (!$cart) {\n $cart = [\n $id => [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ]\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if cart not empty then check if this product exist then increment quantity\n if (isset($cart[$id])) {\n $cart[$id]['quantity']++;\n\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if item not exist in cart then add to cart with quantity = 1\n $cart[$id] = [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }",
"public function addToCart($id, $buy = null)\n {\n $product = Product::find($id);\n\n if(!$product) {\n abort(404);\n }\n\n $cart = session()->get('cart');\n\n if(!$cart) {\n $cart = [\n $id => [\n \"name\" => $product->name,\n \"quantity\" => 1,\n \"price\" => $product->price,\n \"image\" => $product->image_main,\n \"slug\" => $product->slug,\n \"subject\" => $product->subject,\n \"board\" => $product->board,\n \"class\" => $product->class,\n \"description\" => $product->description,\n ]\n ];\n session()->put('cart', $cart);\n if($buy = 'buy') {\n return redirect('/checkout');\n }\n return redirect()->back()->with('success', 'Product added to cart successfully!');\n }\n\n if(isset($cart[$id])) {\n $cart[$id]['quantity']++;\n session()->put('cart', $cart);\n if($buy = 'buy') {\n return redirect('/checkout');\n }\n return redirect()->back()->with('success','Product added to cart successfully!');\n }\n\n $cart[$id] = [\n \"name\" => $product->name,\n \"quantity\" => 1,\n \"price\" => $product->price,\n \"image\" => $product->image_main,\n \"slug\" => $product->slug,\n \"subject\" => $product->subject,\n \"board\" => $product->board,\n \"class\" => $product->class,\n \"description\" => $product->description,\n ];\n\n session()->put('cart', $cart);\n\n if($buy = 'buy') {\n return redirect('/checkout');\n }\n return redirect()->back()->with('success','Product added to cart successfully');\n }",
"public function addToCart($request)\n\t{\n // Validation \n $this->attributes = $request;\n $this->user_id = 1;\n\n if(!$this->validate()){\n return false;\n }\n\n // Validation: Check Product Exist in Product Table \n $productModel = Products::findOne($this->product_id);\n if(!$productModel){\n $this->addError(\"Failed to Add\",\"Given Product (\".$this->product_id.\") is not Available\");\n return false;\n }\n\n // Check Product Already Exist. If already exist then update other wise add\n $cartProduct = Cart::find()->where([\"product_id\"=>$this->product_id])->one();\n\n if($cartProduct){\n $cartProduct->quantity = $cartProduct->quantity + $this->quantity; \n $isSaved = $cartProduct->save();\n return $isSaved ? $cartProduct->id : false; \n }else{\n $isSaved = $this->save(); \n return $isSaved ? $this->id : false; \n }\n }",
"function product_exists($pid){\n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n\t$pid=intval($pid);\n\t$max=count($_SESSION[$cart]);\n\t$flag=0;\n\tfor($i=0;$i<$max;$i++){\n\t\tif($pid==$_SESSION[$cart][$i]['bookid']){\n\t\t\t$flag=1;\n\t\t\t// break;\n\t\t}\n\t}\n\treturn $flag;\n}",
"public function addToCart() : void\n {\n $this->VIEW = false;\n $this->Cart->addToCart($_SESSION['Auth']->id, $_POST);\n }",
"public function addItemToCart(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'cart_id' => 'required|string',\n 'product_id' => 'required|integer',\n 'product_attributes' => 'required|string',\n 'quantity' => 'required|integer'\n ]);\n\n if( $validator->fails() )\n {\n return response()->json([\n \"error\" => [\n 'status' => 400,\n 'code' => 'CART_01',\n 'messages'=> $validator->errors(),\n ]\n ], 400); \n }\n\n // Check if Product already Exists in the Cart\n $item = ShoppingCart::where('cart_id', $request->cart_id)\n ->where('product_id', $request->product_id)->first();\n\n if( $item )\n {\n $item->attributes = $request->product_attributes;\n $item->quantity = $request->quantity;\n\n if( $item->save() )\n {\n return response()->json([\n 'cart_id' => $request->cart_id,\n 'product_id'=> $request->product_id,\n 'attributes'=> $request->product_attributes,\n 'quantity' => $request->quantity,\n 'item_id' => $item->item_id,\n ], 201);\n }\n }\n else\n {\n $cart = new ShoppingCart;\n $cart->cart_id = $request->cart_id;\n $cart->product_id = $request->product_id;\n $cart->attributes = $request->product_attributes;\n $cart->quantity = $request->quantity;\n $cart->customer_id= auth()->user()->getKey();\n $cart->added_on = Carbon::now()->toDateTimeString();\n\n if( $cart->save() )\n {\n return response()->json([\n 'cart_id' => $request->cart_id,\n 'product_id'=> $request->product_id,\n 'attributes'=> $request->product_attributes,\n 'quantity' => $request->quantity,\n 'item_id' => $cart->item_id,\n ], 201);\n }\n }\n\n\n return response()->json([\n \"error\" => [\n 'status' => 400,\n 'code' => 'CART_02',\n 'message'=> 'Unable to add item to Cart',\n ]\n ], 400);\n }",
"public function store(Request $request){\n //dd($request);\n //$cart[$request->item_id] = $request->quantity;\n //ways to create an array\n //$cart = array(values);\n //$cart = [value1, value2, etc];\n //$cart[key/index] = value;\n //What happens when an item is added to cart, it will assign the quantity\n // to index number equal to the item_id.\n //Session::put(\"cart\", $cart); // adds a session variable called cart with the content from $cart\n //dd(Session::get(\"cart\"));\n // This is only halfway done, why? Because the Session::put overwrites the original content. Fina a way to prevent it from overwriting. (Ie. revamp the entire logic)\n \n // Check if there is already a cart\n //1a. If there is no cart, create a new one\n //1b. If there is already a cart, call the cart and update the content.\n //2b. Save the updated cart in the session.\n\n $cart = []; //empty cart\n if(Session::exists(\"cart\")){ // if there is a cart in our session, pull it.\n $cart = Session::get(\"cart\");\n }\n $cart[$request->item_id]= $request->quantity;// update the cart\n Session::put(\"cart\", $cart); \n //dd(Session::get(\"cart\"));\n Session::flash(\"message\", $request->quantity . \"items added to cart\");\n // dd(Session::get(\"cart\"));\n // push it back to the session cart\n \n //Syntax: put into $cart into a session variable called \"cart\".\n \n return redirect(\"/products\"); //return to the catalog page.\n }",
"private function addToCart () {\n }",
"private function addToCart () {\n }",
"public function store(Request $request)\n {\n $data = $request->all();\n $product = Product::find($data['id']);\n $session_id = substr(md5(microtime()),rand(0,5), 6);\n // dd($session_id);\n $carts = Session::get('carts'); // lay session cart\n if($carts == true){ //kiem tra ton tai cart chua, neu ton tai roi thi add pro vao\n $is_avaiable = 0; //kiem tra xem co pro do trong session chua, neu co thi update qty k thi tao session cart cho pro do\n foreach ($carts as $key => $cart) {\n if($cart['product_id'] == $product->id){\n\n $is_avaiable++;\n $carts[$key] = array( //cart[$key] la lay cart dang trong foreach\n 'session_id' => $session_id,\n 'product_id' => $product->id,\n 'product_name' => $product->tenvi,\n 'product_price' => $product->price,\n 'product_price_pro' => $product->price_pro,\n 'product_qty' => $data['cart_product_qty'] + $cart['product_qty'],\n 'product_photo' => $product->photo,\n );\n Session::put('carts',$carts);\n return 1;\n }\n }\n if($is_avaiable == 0){\n $carts[] = array(\n 'session_id' => $session_id,\n 'product_id' => $product->id,\n 'product_name' => $product->tenvi,\n 'product_price' => $product->price,\n 'product_price_pro' => $product->price_pro,\n 'product_qty' => $data['cart_product_qty'],\n 'product_photo' => $product->photo,\n );\n Session::put('carts',$carts);\n return 1;\n }\n }\n else{//neu chua ton tai thi tao cart session va add pro vao\n $carts[] = array(\n 'session_id' => $session_id,\n 'product_id' => $product->id,\n 'product_name' => $product->tenvi,\n 'product_price' => $product->price,\n 'product_price_pro' => $product->price_pro,\n 'product_qty' => $data['cart_product_qty'],\n 'product_photo' => $product->photo,\n );\n Session::put('carts',$carts);\n return 1;\n }\n\n }",
"function is_in_cart($conditions){\n\t\tunset($conditions['quantity']);\n\t\t// odpojim modely, ktere nepotrebuju\n\t\t$this->unbindModel(\n\t\t\tarray(\n\t\t\t\t'belongsTo' => array('Cart', 'Product')\n\t\t\t)\n\t\t);\n\n\t\t// vyhledam si produkt\n\t\t$data = $this->find($conditions);\n\n\t\t// pokud se mi podarilo nacist jej,\n\t\t// vratim jeho id, ktere se pouzije\n\t\t// pro upravu quantity\n\t\tif ( !empty($data) ){\n\t\t\treturn $data['CartsProduct']['id'];\n\t\t}\n\n\t\t// produkt neexistuje\n\t\treturn false;\n\t}",
"public function checkout()\n {\n if(session()->has('cart') && count(session()->get('cart')) == 0){\n return 'none';\n }\n\n\n //Joseph-190508 >>>\n //if(Cart::where('user_id', auth()->id())->delete()){\n //if(auth()->user()->carts()->delete()){\n if(true){ //tmp\n //Joseph-190508 <<< \n /* if(session()->has('cart'))\n {\n session(['cart' => []]);\n } */\n return 'true';\n }\n else{\n return 'false';\n }\n }",
"private function checkIfExistsProducts()\n {\n if (isset($_COOKIE['cart-data'])) {\n $productCookie = htmlspecialchars($_COOKIE['cart-data']);\n $products = trim($productCookie, '|');\n $products = explode('|', $products);\n foreach ($products as $product) {\n if (!Product::find($product)) {\n $productCookie = str_replace('|' . $product . '|', '|', $productCookie);\n }\n }\n setcookie('cart-data', $productCookie, time() + (86400 * 365), \"/\");\n }\n }",
"public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }",
"private function getSessionCart(Request $request) {\n $cartId = $request->session()->get('cart_id', function() {\n /*\n * if no cart found, create a new cart\n */\n return $this->createCart()->id;\n });\n /*\n * Search for cart on the database\n * If not found, replace by a new one\n */\n $objCart = Cart::find($cartId);\n if( $objCart == null ) {\n $objCart = $this->createCart();\n }\n /*\n * Check cart id\n */\n if( $objCart == null || $objCart->id == null ) {\n throw new Exception(\"Invalid Cart\");\n }\n $request->session()->put('cart_id', $objCart->id);\n return $objCart;\n }",
"public function store(Request $request)\n {\n $item=Cart::search(function ($cartItem, $rowId) use($request){\n return $cartItem->id === $request->id;\n });\n\n if ($item->isNotEmpty()) {\n return redirect()->route('cart.index')\n ->with('success_message','item already added in your cart!');\n }\n Cart::add($request->id,$request->title,$request->qty,$request->price)\n ->associate('App\\Models\\Product');\n\n return redirect()->route('cart.index')\n ->with('success_message','item was added!');\n }",
"public function addToCart()\n {\n\n $id = $_POST['id'];\n $quantity = intval($_POST['quantity']);\n\n $model = new ProductModel();\n $dice = $model->getProductByID($id);\n $diceToAdd = [\n 'product' => $dice,\n 'quantity' => $quantity\n ];\n\n // if cart is empty, initialize empty cart\n if (empty($_SESSION['shoppingCart'])) {\n $_SESSION['shoppingCart'] = [];\n }\n\n // item already in cart ? no\n $found = false;\n\n // if product is already in the cart, adding to quantity\n for ($i = 0; $i < count($_SESSION['shoppingCart']); $i++) {\n if ($_SESSION['shoppingCart'][$i]['product']['id'] == $id) {\n $_SESSION['shoppingCart'][$i]['quantity'] += $quantity;\n $_SESSION['totalInCart'] += $quantity;\n\n $found = true;\n }\n }\n\n //if not, adding product and quantity\n if ($found == false) {\n array_push($_SESSION['shoppingCart'], $diceToAdd);\n $_SESSION['totalInCart'] += $diceToAdd['quantity'];\n }\n\n header('Location: ./shop');\n exit;\n }",
"private function initiate_cart()\n\t{\n\t\tif (!($this->ci->session->has_userdata('cart_items'))) {\n\t\t\t$cart_items = array('cart_items' => array());\n\t\t\t$this->ci->session->set_userdata($cart_items);\n\t\t}\n\t}",
"public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}",
"public function agregarCarta($carta) {\n $this->cantcartas++;\n $this->cajita[$this->cantcartas] = $carta;\n return TRUE;\n }",
"public function store(Request $request)\n {\n \n $duplicata=Cart::search(function ($cartItem, $rowId) use($request) {\n return $cartItem->id == $request->pid;\n });\n if($duplicata->isNotEmpty()){\n return redirect()->back()->with('success','Sorry the item is already added');\n }\n $product=Product::find($request->pid);\n Cart::add($product->pid,$product->name,1,$product->price)\n ->associate('card/store');\n return redirect('/')->with('success','the product added to card succesfully');\n }",
"function add(&$d) {\r\n\t\t$cart \t\t\t\t= $_SESSION[\"cart\"];\r\n\t\t$quantity \t\t= $this->check_quantity($d[\"product_id\"],$d[\"quantity\"]);\r\n\t\t$updated \t\t\t= false;\r\n\t\t\r\n\t\t// Check for duplicate\r\n\t\tfor ($idx=0; $idx<sizeof($cart); $idx++) {\r\n\t\t\tif ($cart[$idx][\"product_id\"] == $d[\"product_id\"]){\r\n\t\t\t\t// update;\r\n\t\t\t\t$cart[$idx][\"quantity\"] = $quantity;\r\n\t\t\t\t$updated = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (!$updated) {\r\n\t\t // add\r\n\t\t $idx = sizeof($cart);\r\n\t\t\t$cart[$idx][\"quantity\"] \t= $quantity;\r\n\t\t\t$cart[$idx][\"product_id\"] = $d[\"product_id\"];\r\n\t\t\t$cart[$idx][\"label\"] \t\t\t= $d[\"label\"];\r\n\t\t\t$cart[$idx][\"company\"] \t\t= $d[\"company\"];\r\n\t\t\t$cart[$idx][\"region\"] \t\t= $d[\"region\"];\r\n\t\t}\r\n\t\t\r\n\t\t$_SESSION[\"cart\"][$idx] = $cart[$idx];\r\n\t\treturn True; \r\n\t}",
"public function addToCart()\n {\n $id = intval($_GET[\"id\"]);\n if ($id > 0) {\n if ($_SESSION['cart'] != \"\") {\n $cart = json_decode($_SESSION['cart'], true);\n $found = false;\n for ($i = 0; $i < count($cart); $i++)\n {\n if ($cart[$i][\"product\"] == $id)\n {\n $cart[$i][\"quantity\"] = $cart[$i][\"quantity\"] + 1;\n $found = true;\n break;\n }\n }\n if (!$found)\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n }\n $_SESSION['cart'] = json_encode($cart);\n }\n else\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n $_SESSION['cart'] = json_encode($cart);\n }\n }\n }",
"function addToCart() {\n\t\t$wine_name = $_SESSION['wine']['name'];\n\t\t//check if there is a registered user logged in\n\t\t// --> LET US NOT THINK ABOUT USERNAMES FOR NOW <--\n\t\t//if (!isset($_SESSION['user'])) {\n\t\t\t//generate a random username (string) for\n\t\t\t//unlogged user\n\t\t\t//$username = uniqid('',true);\n\t\t\t//$_SESSION['user']['username'] = $username;\n\t\t//}\n\n\t\t//get the cart\n\t\t$cart = $_SESSION['cart'];\n\t\t//get wine count\n\t\t$wine_qty = $_POST['wine_quantity'];\n\t\t// detect if the same item already exist in the cart\n\t\tif (isset($_SESSION['cart'][$wine_name])) {\n\t\t\t//just add the post quantity to the quantity in the cart\n\t\t\t$_SESSION['cart'][$wine_name] += $wine_qty;\n\t\t}\n\t\telse {\n\t\t\t//create an array of the selected item to be\n\t\t\t//added to the cart\n\t\t\t$_SESSION['cart'][$wine_name] = intval($wine_qty);\n\t\t\t//current date will also be used at view cart\n\t\t\t//\"purchase_date\" => date(\"Y-m-d h:i:sa\")\n\t\t}\n\t\t//redirect to homepage\n\t\theader('Location: index.php');\n\t}",
"public function add_to_cart(Request $request){\n $product = Product::find($request->input('product_id'));\n //On s'assure qu'il y'a bien un produit qui est retourne\n if($product){\n //On enregistre la session cart dans une variable\n $cart = $request->session()->get('cart');\n //On verifie si la cle du produit est deja dans les produits dans la session avant de l'ajouter\n if(!isset($cart['products'][$product->id])){\n //On prepare comment ajouter le produit dans les sessions. Chaque produit dans la sessoin set enregistre dans une cle cart. cette cle contient un\n $cart['products'][$product->id] = ['name' => $product->name, 'price' => $product->price, 'quantite' => 1, \"total\" => $product->price];\n //On ajoute la variable $cart dans les sessions\n $request->session()->put('cart',$cart);\n }\n }\n return response()->json(['success' => true,], 200);\n }",
"public function addToCart()\n {\n $product = Cart::firstOrNew([\n 'user_id' => $this->student->id,\n 'product_id' => $this->id,\n 'product_type' => Enrollment::class\n ]);\n\n $product->save();\n return $product->id;\n }",
"public function create()\n {\n $attributes = $this->attributes();\n $sql = \"INSERT INTO \" . self::$table_name . \" (\";\n $sql .= join(\",\", array_keys($attributes));\n $sql .= \")VALUES('\";\n $sql .= join(\"','\", array_values($attributes));\n $sql .= \"')\";\n \n $conn = new mysqli(DB_SERVER,DB_USER,null,DB_NAME);\n \n if($conn->query($sql))\n {\n $this->cart_id = mysqli_insert_id($conn);\n $attributes['cart_id'] = $this->cart_id;\n return true;\n }\n return false;\n }",
"public function store($album_id)\n {\n \n //\n if(auth()->check()) // logged user\n {\n $request = new Request([\n 'id' => $album_id,\n ]);\n $request->validate([\n 'id' => ['required', 'Integer','min:1']\n ]);\n \n Cart::firstOrCreate(\n ['user_id' => auth()->id(), 'album_id' => $album_id], \n ['number' => '1']\n );\n\n \n }\n \n // for both logged user and guest\n if(session()->has('cart'))\n {\n $items = session()->get('cart');\n if(!in_array($album_id, $items)){\n session()->push('cart', $album_id);\n }\n }\n else{\n session()->push('cart', $album_id);\n }\n \n return strval(count(session()->get('cart')));\n \n\n }",
"function isCartEmpty()\n{\n\t$isEmpty = false;\n\t\n\n\t$sql = \"SELECT *\n\t\t\tFROM Cart\";\n\t\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) == 0) {\n\t\t$isEmpty = true;\n\t}\t\n\t\n\treturn $isEmpty;\n}",
"public function isEnabledCart()\n {\n return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_CART);\n }",
"public function addToCart($id){\n $produk=Product::findOrFail($id);\n Auth::loginUsingId(1);\n $user = Auth::user()->id;\n $addToCart = Cart::create(['product_id'=>$produk->id,\n 'user_id'=>$user]);\n return 'Berhasil Memasukan data ke cart list';\n }",
"public function add(){\n\n $type = $this->input->post('t');\n $id = $this->input->post('i');\n\n if( empty($type) || empty($id) ){\n echo 'No direct access';\n }\n //Create New Cookie Information\n $store = array( $id );\n\n //Fetch cookie\n $basket = $this->input->cookie('basket');\n\n\n if(empty($basket)){\n //create initial cookie\n $cookie = array(\n 'name' => 'basket',\n 'value' => serialize( $store ),\n 'expire' => '86500',\n 'path' => '/'\n );\n\n $this->input->set_cookie( $cookie );\n\n\n }else{\n //update initial cookie\n\n $response = unserialize( $basket );\n\n if( in_array($id,$response) ){\n\n die('Item already in cart');\n\n }else{\n\n $store = array_merge( $response,$store );\n\n $cookie = array(\n 'name' => 'basket',\n 'value' => serialize( $store ),\n 'expire' => '86500',\n 'path' => '/'\n );\n\n $this->input->set_cookie( $cookie );\n\n }\n\n }\n\n echo 'success';\n\n }",
"function addToCart($id, $name, $supplier, $price, $amount) {\n foreach ($_SESSION['cart'] as $key => $prod) {\n if ($prod['id'] == $id) { // If item is already in cart add selected amount to cart\n $_SESSION['cart'][$key]['amount'] = $_SESSION['cart'][$key]['amount'] + $amount;\n return getCart();\n }\n }\n // If the cart doesn't have the selected item, add it to the cart\n array_push($_SESSION['cart'], [\"id\"=>$id, \"name\"=>$name, \"supplier\"=>$supplier, \"price\"=>$price, \"amount\"=>$amount]);\n return getCart();\n }",
"function VariationIsInCart() {\r\n\t\t$variations = $this->owner->Variations();\r\n\t\tif($variations) {\r\n\t\t\tforeach($variations as $variation) {\r\n\t\t\t\tif($variation->OrderItem() && $variation->OrderItem()->Quantity > 0) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"private function getAlreadyPurchasedProduct()\n {\n // If is Guest then hide the review form\n if (!$this->getCustomerId()) {\n return false;\n }\n try {\n $product = $this->getProductInfo();\n $orders = $this->getCustomerOrders();\n foreach ($orders as $order) {\n // Get all visible items in the order\n /** @var $items \\Magento\\Sales\\Api\\Data\\OrderItemInterface[] **/\n $items = $order->getAllVisibleItems();\n // Loop all items\n foreach ($items as $item) {\n // Check whether the current product exist in the order.\n if ($item->getProductId() == $product->getId()) {\n return true;\n }\n }\n }\n return false;\n } catch (\\Exception $e) {\n return false;\n }\n }",
"public function store(Request $request)\n {\n $dubl = Cart::search(function ($cartItem, $rowId) use ($request) {\n return $cartItem->id === $request->id;\n });\n if ($dubl->isNotEmpty()) {\n \n toastr()->warning('product is already in cart !');\n\n \n \n\n\n\n };\n\n \n\n ///////////////////////////////////////////////////\n\n $user = DB::table('orders')\n ->where('user_id', '=', Auth::user()->id)\n ->first();\n //////////////////////////////////////////////\n\n //////////////////////////////////\n $order_id = order::latest()->first()->id;\n\n /////////////////\n\n\n////////////////////////////////////\n\n\n /////////////////////////////////////////////////\n\n if (isset($user) ) {\n\n\n orderItem::create([\n 'order_id' =>$order_id,\n 'product_id' => $request->id,\n 'user_id' => Auth::user()->id,\n 'quantity' => 1,\n 'price' => $request->price,\n ]);\n\n\n\n\n } else{\n\n order::create([\n 'user_id' => (Auth::user()->id),\n 'status' => 1,\n\n ]);\n\n orderItem::create([\n 'order_id' => $order_id,\n 'product_id' => $request->id,\n 'user_id ' => Auth::user()->id,\n 'quantity' => 1,\n 'price' => $request->price,\n ]);\n }\n\n\n\n\n\n\n /////////////////////////////////////////\n\n Cart::add($request->id, $request->name, 1, $request->price)->associate('App\\product', 'App\\orderItem');\n toastr()->success('product added Successfully');\n\n\n return redirect()->back();\n \n }",
"public function addCart(){\r\n $inData = $this -> addValidation($_GET); \r\n if(isset($inData['error'])){\r\n $_SESSION['error'] = $inData['error']; \r\n header(\"location:\". URL);\r\n return;\r\n }\r\n if(isset($_SESSION['cart'])){\r\n foreach($inData as $element){\r\n if(key_exists($element['name'].$element['size'],$_SESSION['cart'])){\r\n $_SESSION['cart'][$element['name'].$element['size']]['quantity'] += $element['quantity'];\r\n }\r\n else\r\n $_SESSION['cart'][$element['name'].$element['size']] = $element;\r\n } \r\n }\r\n else{\r\n $_SESSION['cart'] = array();\r\n foreach($inData as $element){\r\n if(key_exists($element['name'].$element['size'],$_SESSION['cart'])){\r\n $_SESSION['cart'][$element['name'].$element['size']]['quantity'] += $element['quantity'];\r\n foreach($inData as $element)\r\n $_SESSION['cart'][$element['name']]= $element;\r\n }\r\n else\r\n $_SESSION['cart'][$element['name'].$element['size']] = $element;\r\n } \r\n }\r\n render('cart',$_SESSION['cart']);\r\n }",
"public function canItemsAddToCart()\n {\n foreach ($this->getItems() as $item) {\n if (!$item->isComposite() && $item->isSaleable() && !$item->getRequiredOptions()) {\n return true;\n }\n }\n return false;\n }",
"public function addToCart($shid,$prid,$brid,$type,$brimei,$totprice,$paidprice,$fualt,$warranty,$condition,$assec)\n\t{\n\t\tif(!empty($prid))\n\t\t{\n\t\t\tif(!isset($_SESSION['cartItem']))\n\t\t\t{\n\t\t\t\t$_SESSION['cartItem'] = [];\n\t\t\t}\n\t\t\tif(!isset($_SESSION['cartTotal']))\n\t\t\t{\n\t\t\t\t$_SESSION['cartTotal'] = [];\n\t\t\t}\n\t\t\tif(!isset($_SESSION['sampleCart']))\n\t\t\t{\n\t\t\t\t$_SESSION['sampleCart'] = [];\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_SESSION['cartTotal']) && isset($_SESSION['cartItem']))\n\t\t\t{\t\n\t\t\n\t\t\t\t// if (in_array($id, $_SESSION['sampleCart'][id]))\n\t\t\t\t // {\n\t\t\t\t // print_r($_SESSION['sampleCart']);\n\t\t\t\t\t // exit;\n\t\t\t\t // }else{\n\t\t\t\t\t // echo 'not found';\n\t\t\t\t\t // exit;\n\t\t\t\t // }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t if(in_array($prid, array_column($_SESSION['sampleCart'], 'prid'))) {\n\t\t\t\t \n\t\t\t\t\t$count=-1;\n\t\t\t\t\tforeach($_SESSION['sampleCart'] as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t\tif($row['prid']==$prid)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//$priceUpdate=$row['price']+$price;\n\t\t\t\t\t\t\t$quantityUpdate=$row['quantity']+$quantity;\n\t\t\t\t\t\t\t//$_SESSION['sampleCart'][$count]['price']=$price*$quantityUpdate;\n\t\t\t\t\t\t\t$_SESSION['sampleCart'][$count]['quantity']=$quantityUpdate;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn true;\n\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\telse\n\t\t\t\t{\n\t\t\t\t\t$cartItem=array_push($_SESSION['cartItem'],$prid);\n\t\t\t\t\t\n\t\t\t\t\t$price=$totprice-$paidprice;\n\t\t\t\t\t$cartTotal=array_push($_SESSION['cartTotal'],$price);\n\t\t\t\t\t$cartDetails=array('shid'=>$shid,'prid'=>$prid, 'brid'=>$brid, 'type'=>$type, 'brimei'=>$brimei, 'totprice'=>$totprice,'paidprice'=>$paidprice,'fualt'=>$fualt,'warranty'=>$warranty,'condition'=>$condition,'assec'=>$assec);\n\t\t\t\t\t\n\t\t\t\t\t$v=array_push($_SESSION['sampleCart'],$cartDetails);\n\t\t\t\t\n\t\t\n\t\t\t\treturn true;\n\t\t\t\t}\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\tvar_dump('error');\n\t\t\t\texit;\n\t\t\t}\n\t\t\n }\n\n\t}",
"function addCart(){\n global $conn;\n if(isset($_GET['add_cart'])){\n \n $ip_add = getUserIp();\n $p_id = $_GET['add_cart'];\n $product_qty = $_POST['product_qty'];\n $product_size = $_POST['product_size'];\n\n $check_product = \"SELECT * FROM cart WHERE ip_address = '$ip_add' AND cart_id = '$p_id'\";\n $run_check = mysqli_query($conn, $check_product) or die(\"check_product query failed\");\n\n if(mysqli_num_rows($run_check) > 0){\n echo \"<script> alert('This Product is already added in cart.')</script>\";\n echo \"<script>window.open('details.php?pro_id=$p_id', '_self')</script>\";\n }else{\n // Inserting\n $insert_query = \"INSERT INTO cart(cart_id, ip_address, qty, size)\n VALUES ('{$p_id}', '{$ip_add}', '{$product_qty}', '{$product_size}')\";\n \n $run_insert_query = mysqli_query($conn, $insert_query) or die(\"Cart insertion query failed.\");\n\n echo \"<script> window.open('details.php?pro_id=$p_id', '_self')</script>\";\n }\n\n }\n }",
"function VariationOrProductIsInCart() {\r\n\t\treturn ($this->owner->IsInCart() || $this->VariationIsInCart());\r\n\t}",
"protected function GetCartRecord_ifKnown() {\n\tif (!$this->IsCartCached()) {\t// Cart record not cached?\n\t if (!$this->IsNew()) {\t\t// Session record has been created?\n\t\t$this->SetCartRecord_fromCurrentID();\t// fetch/cache the Cart record\n\t }\n\t}\n\treturn $this->rcCart;\n }",
"public function store(Request $request)\n {\n $shopping_cart = $request->shopping_cart;\n\n $in_shopping_carts = InShoppingCart::where(\n 'shopping_cart_id',\n $shopping_cart->id\n )->get();\n\n $article = Article::find($request->article_id);\n\n $exists = false;\n\n foreach ($in_shopping_carts as $in_shopping_cart) {\n //We go through all these instances to check if the article_id of the current selected article matches the article_id of any of the instances already existing in the cart.\n if ($in_shopping_cart->article_id == $request->article_id) {\n //If it exists, we increase the quantity field of that instance to 1 and set $ exists to true\n $in_shopping_cart->update([\n 'quantity' => $in_shopping_cart->quantity + 1,\n ]);\n $exists = true;\n $article->update(['quantity' => $article->quantity - 1]); //We also reduce the stock of said item by 1 again.\n }\n }\n\n if ($exists == false) {\n //If in the end it does not exist we create a new instance with that article.\n $response = InShoppingCart::create([\n 'user_id' => null,\n 'shopping_cart_id' => $shopping_cart->id,\n 'article_id' => $request->article_id,\n 'quantity' => 1,\n ]);\n $article->update(['quantity' => $article->quantity - 1]);\n }\n return back();\n }",
"private function saveCart($request)\n {\n \t$request->session()->put('cart', $this->cart);\n }",
"public function addToCart($prod_id){\n\t\t$product = Product::find($prod_id);\n $this->cartConstruct();\n $this->add($product);\n Session::put('cart',$this);\n return redirect()->route('cart');\n\t}",
"public function actionAdd() {\n $id = Yii::$app->request->get('id');\n $qty = (int)Yii::$app->request->get('qty');\n $qty = !$qty ? 1 : $qty;\n\n $product = Product::findOne($id);\n if (empty($product)) return false;\n $session = $this->session;\n $cart = new Cart();\n $cart->addToCart($product, $qty);\n if (!Yii::$app->request->isAjax) { // works if js is off and ajax request did not occur\n return $this->redirect(Yii::$app->request->referrer);\n }\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'items_to_show'));\n }",
"public static function cart_process(){\r\n\r\n\t\t\t/*\r\n\t\t\t * Setup Requirements\r\n\t\t\t */\r\n\r\n\t\t\t// Protect and defend the cart string!\r\n\t\t\t\t$cartString = \"\";\r\n\t\t\t\t$action = $_GET[\"action\"];\r\n\t\t\t\t$actiontwo = $_GET[\"actiontwo\"];\r\n\r\n\r\n\t\t\t\tif ($action == \"cartAdd\" && !isset($_GET[\"actiontwo\"])) {\r\n\t\t\t\t\t// Add to Cart\r\n\t\t\t\t\t$response = self::cart_process_add();\r\n\r\n\t\t\t\t} elseif ($action == \"formEmpty\") {\r\n\t\t\t\t\t// Empty the Form\r\n\t\t\t\t\textract($_SESSION);\r\n\t\t\t\t\tforeach($_SESSION as $key=>$value) {\r\n\t\t\t\t\t\tif (substr($key, 0, 7) == \"Profile\") {\r\n\t\t\t\t\t\t\tunset($_SESSION[$key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} elseif ($action == \"cartEmpty\") {\r\n\r\n\t\t\t\t\t// Throw the baby out with the bathwater\r\n\t\t\t\t\tunset($_SESSION['cartArray']);\r\n\r\n\t\t\t\t} elseif ($action == \"cartAdd\" && $actiontwo =\"cartRemove\") {\r\n\t\t\t\t\t// Remove ID from Cart\r\n\t\t\t\t\t$id = $_GET[\"RemoveID\"];\r\n\t\t\t\t\t$response = self::cart_process_remove($id);\r\n\r\n\t\t\t\t} elseif ($action == \"searchSave\") {\r\n\t\t\t\t\t// Save the Search\r\n\t\t\t\t\tif (isset($_SESSION['cartArray'])) {\r\n\r\n\t\t\t\t\t\textract($_SESSION);\r\n\t\t\t\t\t\tforeach($_SESSION as $key=>$value) {\r\n\t\t\t\t\t\t\t// TODO: Why is this empty?\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$_SESSION['cartArray'] = $cartArray;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t}",
"public function addItemToCart($id)\n {\n $session=Yii::app()->session;\n $arr_session=array();\n $model=Item::model()->findbyPk($id);\n $my_product=$model->attributes;\n if(isset($session['cart']))\n {\n $arr_session=$session['cart'];\n if(array_key_exists($id,$session['cart']))\n {\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']++;\n $session['cart']=$arr_session;\n \n }else{\n $arr_session=$session['cart'];\n $arr_session[$id]=$my_product;\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }else{\n $session['cart']=array($id=>$my_product,);\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }",
"public function vpup_set_cart() \n {\n // Used to decide if we need to redirect to the cart. \n $should_redirect = false;\n\n // TODO: Refactor this to be dynamic. \n // Check our Product Quantity then add a cart item, if we have any items. \n if( $_GET[ 'vetCertQuantity' ] > 0 ) {\n WC()->cart->add_to_cart( 147, $_GET[ 'vetCertQuantity'] );\n $should_redirect = true;\n }\n\n // Check our Product Quantity then add a cart item, if we have any items. \n if( $_GET[ 'vetCertAvianQuantity' ] > 0 ) {\n WC()->cart->add_to_cart( 149, $_GET[ 'vetCertAvianQuantity'] );\n $should_redirect = true;\n }\n\n // Check our Product Quantity then add a cart item, if we have any items. \n if( $_GET[ 'groomerQuantity' ] > 0 ) {\n WC()->cart->add_to_cart( 150, $_GET[ 'groomerQuantity'] );\n $should_redirect = true;\n }\n\n // Check our Product Quantity then add a cart item, if we have any items. \n if( $_GET[ 'trainerQuantity' ] > 0 ) {\n WC()->cart->add_to_cart( 151, $_GET[ 'trainerQuantity'] );\n $should_redirect = true;\n }\n\n // Return our cart redirect value\n return $should_redirect;\n }",
"public function actionAddtocart($id,$price,$name, $quantity)\n {\n $session = Yii::$app->session;\n //$session->remove('cart');\n if($session->has('cart')) //if the session is there, we need to add to it\n {\n //t\n $item = [\n 'id' => $id,\n 'price' => $price,\n 'name' => $name,\n 'quantity' => $quantity\n\n ];\n $session['cart'] = array_merge($session['cart'],[$item]);\n\n\n }\n else //if the session is not there, we need to create it\n {\n\n $session['cart'] = array();\n $item = [\n 'id' => $id,\n 'price' => $price,\n 'name' => $name,\n 'quantity' => $quantity\n ];\n $session['cart'] = array_merge($session['cart'],[$item]);\n }\n //go to the users' cart page\n $this->redirect(['cart/index']);\n }",
"public function postAddItem(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $session_id = Session::get('session_id');\n if(empty($session_id)){\n $session_id = str_random(40);\n Session::put('session_id', $session_id);\n }\n\n // Kiểm tra item đã có trong giỏ hàng chưa\n $checkItem = Cart::where(['product_id'=>$request['product_id'], 'attribute_id'=>$request['attribute_id'], 'session_id'=>$session_id])->first();\n\n // Nếu item đã có trong giỏ hàng thì cộng số lượng\n // Nếu item chưa có trong giỏ hàng thì thêm vào cart\n if(!empty($checkItem)){\n $checkItem->quantity = $checkItem->quantity + $request['quantity'];\n $checkItem->save();\n }else{\n $cart = new Cart;\n $cart->product_id = $request['product_id'];\n $cart->attribute_id = $request['attribute_id'];\n $cart->quantity = $request['quantity'];\n $cart->session_id = $session_id;\n if($request['user_email']){\n $cart->user_email = '';\n }else{\n $cart->user_email = $request['user_email'];\n }\n $cart->save();\n }\n\n return redirect()->route('get.cart')->with('flash_message_success', 'Sản phẩm đã được thêm vào giỏ hàng!');\n }",
"public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&tab=buy&area=cart\" );\n\t}",
"function addToCart()\n{\n\t// make sure the product id is in get, redirect otherwise.\n\tif (isset($_GET['p']) && (int)$_GET['p'] > 0) {\n\t\t$productID = (int)$_GET['p'];\n\t} else {\n\t\theader('Location: ./storeIndex.php');\n\t}\n\t\n\t// check if the product is in the database.\n\t$sql = \"SELECT ItemID, Quantity\n\t FROM Items\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) != 1) {\n\t\t// the product doesn't exist\n\t\theader('Location: ./cart.php');\n\t} else {\n\t\t//Check stock\n\t\t$row = mysql_fetch_assoc($result);\n\t\t$currentStock = $row['Quantity'];\n\n\t\tif ($currentStock == 0) {\n\t\t\t// Out of stock item, show error.\n\t\t\tsetError('The product you requested is no longer in stock');\n\t\t\theader('Location: ./cart.php');\n\t\t\texit;\n\t\t}\n\n\t}\t\t\n\t\n\t//Check if items is already in cart, and if so, update quantity.\n\t$sql = \"SELECT ItemID\n\t FROM Cart\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) == 0) {\n\t\t// put the product in the cart \n\t\t$sql = \"INSERT INTO Cart (ItemID, Quantity)\n\t\t\t\tVALUES ($productID, 1)\";\n\t\t$result = query($sql);\n\t} else {\n\t\t// update product quantity in the cart\n\t\t$sql = \"UPDATE Cart\n\t\t SET Quantity = Quantity + 1\n\t\t\t\tWHERE ItemID = $productID\";\t\t\n\t\t\t\t\n\t\t$result = query($sql);\t\t\n\t}\t\n\t\t\n\theader('Location: ' . $_SESSION['shop_return_url']);\t\t\t\t\n}",
"function wordimpress_is_conditional_product_in_cart( $product_id ) {\n //Check to see if user has product in cart\n global $woocommerce;\n \n //flag no book in cart\n $book_in_cart = false;\n \n foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {\n $_product = $values['data'];\n \n if ( in_array($_product->id, $product_id) ) {\n //book is in cart!\n $book_in_cart = true;\n \n }\n }\n \n return $book_in_cart;\n \n}",
"public function deleteCart(){\n $cartItemModel = \\Ccc::objectManager('\\Model\\Item',false);\n\n foreach($this->getCartItems() as $item){\n $ids[] = $item->itemId;\n }\n \n if($cartItemModel->deleteData($ids)){\n return true;\n }\n\n return false;\n }",
"function save_cart()\n\t{\n\t\tunset($this->_tour_cart_contents['tour_cart_total']);\n\t\tunset($this->_tour_cart_contents['total_itineraries']);\n\t\t$delete_itineraries = $this->_tour_cart_contents['delete_itineraries'];\n\t\tunset($this->_tour_cart_contents['delete_itineraries']);\n\t\t$estimate = $this->_tour_cart_contents['estimate']; // echo \"<pre>\";print_r($estimate);echo \"</pre>\";exit;\n\t\tunset($this->_tour_cart_contents['estimate']);\n\n\t\t// Is our cart empty? If so we delete it from the session\n\t\tif (count($this->_tour_cart_contents) <= 0)\n\t\t{\n\t\t\t$this->CI->session->unset_userdata('tour_cart_contents');\n\n\t\t\t// Nothing more to do... coffee time!\n\t\t\treturn FALSE;\n\t\t}\n\t\t$total_itinerary = 0; \n\t\tforeach($this->_tour_cart_contents as $cart_itinerary){\n\t\t\t$total_itinerary++;\n\t\t\t\n\t\t}\n\t\t$this->_tour_cart_contents['total_itineraries'] = $total_itinerary;\n\t\t$this->_tour_cart_contents['delete_itineraries'] = $delete_itineraries;\n\t\t$this->_tour_cart_contents['estimate'] = $estimate;\n\t\t\n\t\t$this->CI->session->set_userdata(array('tour_cart_contents' => $this->_tour_cart_contents));\n\t\t//echo \"<pre>\";print_r($this->CI->session->userdata(\"tour_cart_contents\"));echo \"</pre>\";exit;\n\t\t\n\t\t// Woot!\n\t\treturn TRUE;\n\t}",
"protected function save_cart(){\n $this->cart_contents['total_items'] = $this->cart_contents['cart_total'] = 0;\n foreach ($this->cart_contents as $key => $val){\n if(!is_array($val) OR !isset($val['precio'], $val['qty'])){\n continue;\n }\n $this->cart_contents['cart_total'] += ($val['precio'] * $val['qty']);\n $this->cart_contents['total_items'] += $val['qty'];\n $this->cart_contents[$key]['subtotal'] = ($this->cart_contents[$key]['precio'] * $this->cart_contents[$key]['qty']);\n }\n \n // si el carrito está vacío, lo elimíno de la sesión\n if(count($this->cart_contents) <= 2){\n unset($_SESSION['cart_contents']);\n return FALSE;\n }else{\n $_SESSION['cart_contents'] = $this->cart_contents;\n return TRUE;\n }\n }",
"public function productExist()\n {\n if ($this->product) {\n $ret = true;\n } else {\n $ret = false;\n }\n \n return $ret;\n }",
"public function isProductNotAlreadyInTheCart($order_id,$product_id){\n $model = new OrderHasProducts;\n return $model->isProductNotAlreadyInTheCart($order_id,$product_id);\n }",
"public function addItem(Product $product): bool\n {\n $key = $this->findItemInSession($product);\n\n if (isset($_SESSION['cart'][$key])) {\n $newQuantity = $_SESSION['cart'][$key]['quantity'] + 1;\n\n $_SESSION['cart'][$key]['quantity'] = $newQuantity;\n $_SESSION['cart'][$key]['total'] = $newQuantity * $product->getPrice();\n } else {\n $_SESSION['cart'][] = [\n 'product' => $product,\n 'quantity' => self::ITEM_DEFAULT_QUANTITY,\n 'total' => self::ITEM_DEFAULT_QUANTITY * $product->getPrice()\n ];\n }\n\n return true;\n }",
"public function store(Request $request, $id)\n {\n $produk = produk::where('id', $id)->first();\n if($request->qty > $produk->stok)\n {\n return redirect('detail/'.$id)->with('status', 'The order exceeds the existing stock limit');\n }\n\n $subtotal = $produk->harga * $request->qty;\n $cek_cart = Cart::where('id_produk', Session::get('id_produk'))->first();\n if(empty($cek_cart)){\n\n $itemcart = Cart::create($request->all());\n $itemcart-> id_user = $request->id_user;\n $itemcart-> id_produk = $request->id_produk;\n $itemcart-> qty = $request->qty;\n $itemcart->save();\n } else {\n \n }\n\n\n\n return redirect('/cart')->with('status', 'Successfully create a new product!');\n\n }",
"function cart(){\n\tif(isset($_GET['add_cart'])){\n\t\tglobal $connection;\n\t\t$ip=getIp();\n\t\t$product_id\t= $_GET['add_cart'];\n\t\t\t $quantity = 0;\n\t\t$check_product = \"select * from cart where ip_address='$ip' AND product_id='$product_id'\";\n\t\t$run_check = mysqli_query($connection,$check_product);\n\t\t\n\t\tif(mysqli_num_rows($run_check)>0){\n\t\t\techo \"\";\n\t\t\t\n\t\t}else{\n\t\t\t$insert_product = \"insert into cart (product_id,ip_address,quantity) values ('$product_id','$ip','$quantity')\";\n\t\t\t$run_product = mysqli_query($connection,$insert_product);\n\t\t\techo\"<script>window.open('index.php','_self')</script>\";\n\t\t}\n\t}\n}"
]
| [
"0.7632741",
"0.7596943",
"0.7249046",
"0.710691",
"0.6954005",
"0.68899816",
"0.68698007",
"0.68309665",
"0.67851835",
"0.67838824",
"0.66885173",
"0.6680022",
"0.66737574",
"0.6547115",
"0.64128685",
"0.6405135",
"0.63981336",
"0.63979644",
"0.63974327",
"0.637237",
"0.6368241",
"0.6365806",
"0.6349697",
"0.6343959",
"0.63291156",
"0.63160783",
"0.6297624",
"0.6293938",
"0.62776774",
"0.6273606",
"0.6257256",
"0.624708",
"0.6239876",
"0.6212915",
"0.6208146",
"0.62025285",
"0.6189328",
"0.6187851",
"0.6182515",
"0.6171701",
"0.6158307",
"0.61500853",
"0.61414075",
"0.612715",
"0.6126615",
"0.6112718",
"0.6112718",
"0.61117095",
"0.6111159",
"0.6107311",
"0.6106263",
"0.6094242",
"0.60802764",
"0.60744804",
"0.60659146",
"0.6065102",
"0.60455054",
"0.6044805",
"0.6041777",
"0.60377276",
"0.6035496",
"0.6031997",
"0.6028511",
"0.60226536",
"0.60092723",
"0.60087454",
"0.60085034",
"0.5989676",
"0.59878606",
"0.5973595",
"0.59707075",
"0.59667903",
"0.596501",
"0.59498954",
"0.5932952",
"0.59172064",
"0.591127",
"0.5898647",
"0.5887792",
"0.58877337",
"0.58841693",
"0.5882625",
"0.58817935",
"0.5879223",
"0.5868425",
"0.58661556",
"0.5862805",
"0.5862649",
"0.58530045",
"0.5851374",
"0.5846995",
"0.5846568",
"0.5846276",
"0.58459795",
"0.584273",
"0.58406895",
"0.5840147",
"0.5828895",
"0.5826547",
"0.58257353"
]
| 0.74167097 | 2 |
checks if the given credentials are legit | function verifyUser ($username, $hash) {
//TO-DO
//if credentials match return true
//else return false
//dummy CODE
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _validateCredentials($credentials){\n if(empty($credentials->username) || empty($credentials->password)) return false;\n $admin = $this->_getPassword($credentials->username);\n if(empty($admin)) return false;\n $decodedPassword = $this->encryption->decrypt($admin->password);\n return $credentials->password == $decodedPassword;\n }",
"public static function checkCredentials()\n {\n if (null === self::username() || null === self::password()) {\n echo self::errorMessage();\n die(1);\n }\n\n return true;\n }",
"private function isCorrectCredentials ()\n {\n\n try {\n $this->httpClient->request (\"GET\", \"http://livescore-api.com/api-client/users/pair.json?key=\" . $this->apiKey . \"&secret=\" . $this->apiSecret);\n } catch (ClientException $e) {\n $response = json_decode ((string) $e->getResponse ()->getBody (), true);\n\n throw new WrongAPICredentialsException($response['error'], $e->getResponse ()->getStatusCode ());\n }\n }",
"public function validateCredentials(array $credentials)\n\t{\n\t\tif (empty($credentials['username']))\n\t\t\treturn false;\n\n\t\tif (empty($credentials['password']))\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"private static function has_credentials() {\r\n\t\t\t$credentials = self::get_credentials();\r\n\r\n\t\t\treturn is_array($credentials)\r\n\t\t\t\t\t&& isset($credentials['api-key'])\r\n\t\t\t\t\t&& isset($credentials['email'])\r\n\t\t\t\t\t&& isset($credentials['id'])\r\n\t\t\t\t\t&& !empty($credentials['api-key'])\r\n\t\t\t\t\t&& !empty($credentials['email'])\r\n\t\t\t\t\t&& !empty($credentials['id']);\r\n\t\t}",
"protected function validCredentials(){\n $valid_credentials = !empty($this->consumerKey);\n $valid_credentials = ($valid_credentials && !empty($this->consumerSecret));\n $valid_credentials = ($valid_credentials && $this->consumerKey === variable_get('ebs_consumer_key', '')); \n $valid_credentials = ($valid_credentials && $this->consumerSecret === variable_get('ebs_consumer_secret', ''));\n \n return $valid_credentials;\n }",
"private function checkCredentials(array $args = []): bool\n {\n if (empty($args['credentials'])) {\n throw new VisacheckException('You did not provide the Visacheck client credentials in the configuration.', $args);\n }\n $id = data_get($args, 'credentials.id', null);\n $secret = data_get($args, 'credentials.secret', null);\n if (empty($id)) {\n throw new VisacheckException('The client \"id\" key is absent in the credentials configuration.', $args);\n }\n if (empty($secret)) {\n throw new VisacheckException('The client \"secret\" key is absent in the credentials configuration.', $args);\n }\n return true;\n }",
"function valid_production_credentials($api_url, $api_username, $api_password) {\n\tif (!empty($api_url) \n\t\t\t&& !empty($api_username) \n\t\t\t&& !empty($api_password)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function validateApiCredentials() { \n if( $this->options['api_type'] == \"\" || $this->options['api_path'] == \"\" ) {\n $this->error_handler( 'Repository url not valid' );\n } elseif($this->options['username'] == \"\") {\n $this->error_handler( 'Username Required' );\n } else if($this->options['password'] == \"\") {\n $this->error_handler( 'Password Required' );\n }\n }",
"public function validateCredentials(Authenticatable $user, array $credentials): bool;",
"function is_validated($username = null, $password = null){\n return validate_cred($username, $password);\n}",
"public function supportsCredentials(array $credentials)\n {\n return array_keys($credentials) === array('login', 'password');\n }",
"public function checkCredentials(string $email, string $password):bool;",
"protected function _validateAccount() {\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_password)) return;\n\t\t$data = array(\n\t\t\t'username' => $this->_username,\n\t\t\t'password' => $this->_password\n\t\t);\n\t\tif($this->_md5Enabled) {\n\t\t\t$query = \"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = :username AND \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:password, :username)\";\n\t\t} else {\n\t\t\t$query = \"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = :username AND \"._CLMN_PASSWD_.\" = :password\";\n\t\t}\n\t\t\n\t\t$result = $this->db->queryFetchSingle($query, $data);\n\t\tif(!is_array($result)) return;\n\t\t\n\t\treturn true;\n\t}",
"public function validate(array $credentials = []);",
"public function checkCredentials( $username, $password ){\n $mysqli = $this->connect();\n\n //real_escape_string to prevent sql injection\n $username = $mysqli->real_escape_string( $username );\n $password = $mysqli->real_escape_string( $password );\n\n //hashing the 'password' value\n $password = hash( 'sha512', $password );\n\n $query = 'SELECT * FROM tbl_users \n\t\t\t\t\t WHERE email = \"'. $username .'\" \n\t\t\t\t\t\tAND password = \"'. $password .'\"';\n $result = $mysqli->query($query);\n\n //if I get a result it means the credentials are right.\n if( $result->num_rows === 1 ){\n $this->message = $result;\n $this->username = $username;\n $this->status = True;\n }else{\n $this->status = False;\n }\n }",
"static function isCredentialsValidErrorMessageForJob( $jobId ) {\n\n if (substr(php_uname(), 0, 7) != \"Windows\") {\n $logDirectory = get_option( 'hbo_log_directory' );\n if( empty($logDirectory )) {\n throw new ValidationException( \"log_directory not specified\" );\n }\n\n $command = \"grep -q 'Current credentials not valid' $logDirectory/job-$jobId.txt\";\n $returnval = 0;\n $output = array();\n exec( $command, $output, $returnval );\n if ( $returnval == 0 ) {\n return true;\n }\n\n $command = \"grep -q 'Incorrect password' $logDirectory/job-$jobId.txt\";\n exec( $command, $output, $returnval );\n if ( $returnval == 0 ) {\n return true;\n }\n }\n return false;\n }",
"private function compare_with_login()\n {\n }",
"public function validateCredentials(Authenticatable $user, array $credentials) {}",
"abstract protected function is_valid($username, $password);",
"function validateUserPass($username, $password) {\n\n return ($username == 'username' && $password == 'password');\n\n }",
"public function validateCredentials(UserContract $user, array $credentials)\n {\n return false;\n }",
"public function testInvalidCredentialsCantLogin()\n {\n $this->browse( function( Browser $browser ){\n $browser->visit( '/admin' );\n $browser->type( 'email', 'admin@example.com' );\n $browser->type( 'password', 'wrongpassword' );\n $browser->click( '.button.is-primary' );\n $browser->assertSee( 'Your username or password were incorrect' );\n });\n }",
"public function test_if_an_user_can_receive_valid_credentials() {\n $user = $this->createFakerUser($this->credentials);\n \n $this->postJson('/api/v1/auth/login', $this->credentials);\n \n $this->assertAuthenticatedAs($user);\n }",
"private function _checkAuth()\n { if(!(isset($_SERVER['HTTP_X_USERNAME']) and isset($_SERVER['HTTP_X_PASSWORD']))) {\n // Error: Unauthorized\n $this->_sendResponse(401);\n }\n $username = $_SERVER['HTTP_X_USERNAME'];\n $password = $_SERVER['HTTP_X_PASSWORD'];\n // Find the user\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\n if($user===null) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Name is invalid');\n } else if(!$user->validatePassword($password)) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Password is invalid');\n }\n }",
"public function checkAuthentication() {}",
"public function validateCredentials(Authenticatable $user, array $credentials);",
"protected function checkCredentials() {\n $client = \\Drupal::service('akamai.edgegridclient');\n if ($client->isAuthorized()) {\n drupal_set_message('Authenticated to Akamai.');\n }\n else {\n drupal_set_message('Akamai authentication failed.', 'error');\n }\n }",
"public function checkAuth() {\n\n /*\n * Dummy stuff - just to test the authentication loop\n */\n if ($_SERVER['PHP_AUTH_USER'] === $this->config['general']['admin']['user'] && $_SERVER['PHP_AUTH_PW'] === $this->config['general']['admin']['password']) {\n return true;\n }\n\n return false;\n }",
"private function _fail_auth_check($data_array)\r\n {\r\n $checker = true;\r\n \r\n $user = $this->_get_array_value($data_array,\"user\");\r\n $password = $this->_get_array_value($data_array,\"password\");\r\n \r\n if($user == \"root\" && $password == \"1234abcd*\")\r\n {\r\n $checker = false;\r\n }\r\n \r\n return $checker;\r\n }",
"public function checkCredentials($credentials, UserInterface $user)\n {\n // If there are no credentials to check, you can just return true\n //throw new \\Exception('TODO: check the credentials inside '.__FILE__);\n\n return true;\n }",
"public function validateCredentials(Authenticatable $user, array $credentials){\n\n }",
"public function checkUserCredentials($username, $password) {\n if (!empty($this->configParams['credentials'])){\n foreach ($this->configParams['credentials'] as $usernameRow=>$hashedPasswordRow){\n if ($usernameRow==$username){\n return sha1($password)==$hashedPasswordRow;\n }\n }\n }\n return false;\n }",
"function getCredentialsAreValid($username, $passwordHash) {\r\n global $db;\r\n\r\n // Query String\r\n $query = \"\r\n SELECT *\r\n FROM user\r\n WHERE user_name = :username\";\r\n\r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':username', $username);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n return ($result['password'] == $passwordHash);\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}",
"public function authenticating($credentials)\n\t{\n\t\t$user \t= $this->model->key($credentials['key'])->first();\n\n\t\tif(!$user)\n\t\t{\n\t\t\tthrow new Exception(\"Key tidak terdaftar!\", 1);\n\t\t}\n\n\t\tif(!Hash::check($credentials['secret'], $user->secret))\n\t\t{\n\t\t\tthrow new Exception(\"secret Tidak Cocok!\", 1);\n\t\t}\n\n\t\treturn true;\n\t}",
"public function attempt(Credentials $credentials): bool\n {\n }",
"public function checkCredentials($username, $password)\r\n {\r\n // could not be found in the database\r\n $userID = 0;\r\n $digest = 'choir';\r\n\r\n\t\tif ($username == 'viennapres') $userID = 1;\r\n \r\n return array ($userID, $username, $digest);\r\n }",
"function passwordExists() {\n //DOES NOT CHECK IF IT'S A VALID PASSWORD\n global $PHP_AUTH_PW;\n global $sessionId;\n global $serverScriptHelper;\n global $isMonterey;\n if ((!$isMonterey) && $serverScriptHelper->hasCCE()) {\n if ($sessionId) {\n return true;\n } else {\n return false;\n }\n } else {\n if ($PHP_AUTH_PW) {\n return true;\n } else {\n return false;\n }\n }\n}",
"protected function checkCredentials ($username,$password) {\n\t\t$sql = \"SELECT user_name,user_password FROM users\n\t\t\t\tWHERE user_name = ? AND user_password = MD5(?)\";\n\t\t$data = [$username,$password];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\t\n\t\t$statement = $this->setStatement($sql,$data);\n\t\t\tif ( $statement->rowCount() > 0 ) {\n\t\t\t\t$out = true;\n\t\t\t} else {\n\t\t\t\t$out = false;\n\t}\n\t\treturn $out;\n\t}",
"public function testCheckCredentials(){\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $result = $db->checkCredentials(\"owner@gmail.com\",\"owner\");\r\n $this->assertEquals(\"owner@gmail.com\",$result[\"emailId\"]);\r\n }",
"function getCredentialsAreValid($username, $password) {\r\n global $db;\r\n\r\n //phpAlert(\"building query string\");\r\n // Query String\r\n $query = \"SELECT * FROM system_user WHERE system_user_name = '$username';\";\r\n\r\n //phpAlert(\"query string is: \" . $query);\r\n \r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n //phpAlert(\"Account exists, verifying password\");\r\n // Validate using password_verify()\r\n return (password_verify($password, $result['system_user_password']));\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}",
"function check_auth() {\n global $conf;\n if ($_SERVER['PHP_AUTH_USER'] !== $conf['username'] && $_SERVER['PHP_AUTH_PW'] !== $conf['password']) {\n header('WWW-Authenticate: Basic realm=\"CMS\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'Could not authorise.';\n die();\n }\n}",
"public function validate(array $credentials = [])\n {\n return false;\n }",
"public function validate(array $credentials = [])\n {\n return false;\n }",
"public function testWrongDatabaseCredentials(): void {\n\t\t$ini_array = parse_ini_file(\"test.ini\");\n\t\t$user = $ini_array[\"incorrectdb\"][\"user\"];\n\t\t$password = $ini_array[\"incorrectdb\"][\"password\"];\n\t\t$host = $ini_array[\"incorrectdb\"][\"host\"];\n\n\t\t$output = `php src/user_upload.php -u $user -p$password -h$host 2>&1`;\n\n\t\t$this->assertEquals(\n\t\t\t\"Could not open connection to database: Access denied for user '$user'@'$host' (using password: YES)\\n\",\n\t\t\t$output\n\t\t);\n\t}",
"public function validateCredentials(Authenticatable $user, array $credentials)\n {\n }",
"public function checkCredentials($credentials, UserInterface $user): bool\n {\n // Credentials have already been checked in getUser method\n return true;\n }",
"public function validateCredentials(Authenticatable $user, array $credentials)\n {\n $plain = $credentials['password'];\n $authPassword = $user->getAuthPassword();\n return sha1('ld' .$authPassword['salt'] . sha1($authPassword['salt'] . sha1($plain))) == $authPassword['password'];\n }",
"function verify_credentials($user, $pwd) {\n global $db;\n\n // query for admin users first\n $query = \"SELECT * FROM admin\n WHERE admin_user = :user\n AND admin_password = :pwd\";\n\n $statement = $db->prepare($query);\n $statement->bindValue(':user', $user);\n $statement->bindValue(':pwd', $pwd);\n $statement->execute();\n\n $result = $statement->fetch();\n\n $retval = $statement->closeCursor();\n\n if (isset($result['admin_user'])) {\n if (isset($result['admin_name'])) setcookie('name', $result['admin_name'], time() + 3600);\n $_SESSION['admin'] = true;\n $_SESSION['id'] = $result['admin_id'];\n return $retval;\n }\n\n // if no admin found, query for players\n $query = \"SELECT * FROM player\n WHERE player_user = :user\n AND player_password = :pwd\";\n\n $statement = $db->prepare($query);\n $statement->bindValue(':user', $user);\n $statement->bindValue(':pwd', $pwd);\n $statement->execute();\n\n $result = $statement->fetch();\n\n $retval = $statement->closeCursor();\n\n if (isset($result['player_user']) > 0) {\n if (isset($result['player_name'])) setcookie('name', $result['player_name'], time() + 3600);\n $_SESSION['id'] = $result['player_id'];\n return $retval;\n } else {\n return false;\n }\n }",
"public function checkCredentials($username, $password)\n\t{\n\t\t$user = $this->getInfo($username);\n\t\tif ( $user['password'] == $this->encrypt($password) )\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}",
"function valid_credentials($user, $pass){\n\n $user = mysqli_real_escape_string($user, $_POST['username']);\n $pass = sha1($pass);\n\n $total = mysql_query(\"SELECT COUNT('user_id') FROM 'users' WHERE 'user_name' = '{$user}' AND 'user_password' = '{$pass}'\");\n\n return (mysql_result($total, 0) == '1') ? true : false;\n\n}",
"public function checkAuth();",
"public function checkAuth();",
"public static function attempt(array $credentials) : bool;",
"public function validateCredentials(\\Illuminate\\Auth\\UserInterface $user, array $credentials)\n\t{\n\t}",
"public function authenticate()\n\t{\n\t if($this->pop_authenticate($this->username, $this->password,\"192.168.121.26\"))\n {\n\t\t\t$this->errorCode=self::ERROR_NONE;\n }\n else\n {\n\t\t\t$this->errorCode=self::ERROR_PASSWORD_INVALID;\n }\n\t\treturn !$this->errorCode;\n\t}",
"public function checkCredentials($username, $password)\r\n {\r\n try {\r\n // get the result of the parent query for checking credentials\r\n $result = parent::checkCredentials($username, $password);\r\n\r\n\r\n\r\n // if the user is an admin then return true (success)\r\n if ($result->admin) {\r\n return true;\r\n }\r\n else {\r\n throw new Exception(\"User not an admin\");\r\n }\r\n }\r\n catch (Exception $e) {\r\n throw new Exception(\"Login failed.\");\r\n }\r\n }",
"function uservalidationbyadmin_check_auth_attempt($credentials) {\n\n\tif (!isset($credentials['username'])) {\n\t\treturn;\n\t}\n\n\t$username = $credentials['username'];\n\n\t// See if the user exists and isn't validated\n\t$access_status = access_get_show_hidden_status();\n\taccess_show_hidden_entities(TRUE);\n\n\t$user = get_user_by_username($username);\n\tif ($user && isset($user->validated) && !$user->validated) {\n\t\t// show an error and resend validation email\n\t\tuservalidationbyadmin_request_validation($user->guid);\n\t\taccess_show_hidden_entities($access_status);\n\t\tthrow new LoginException(elgg_echo('uservalidationbyadmin:login:fail'));\n\t}\n\n\taccess_show_hidden_entities($access_status);\n}",
"function validate_login($username, $password){\n if (empty($this->username) or empty($this->password)){\n // User has not set its credentials\n print 'Error user has not set user and password.';\n return False;\n }\n if (empty($username) or empty($password)){\n // Empty username or password\n print 'Cannot ser username or password as null.';\n return False;\n }\n if ($username == $this->username and $password == $this->password){\n print 'Username and password are correct.';\n return True;\n }\n }",
"public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }",
"public function validate(array $credentials = []){\n\n return true;\n }",
"protected function verify_credentials() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token']\t= $this->conf->TwitterOAuthToken;\r\n\t\t$this->tmhOAuth->config['user_secret']\t= $this->conf->TwitterOAuthSecret;\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'GET', $this->tmhOAuth->url('1.1/account/verify_credentials')\r\n\t\t);\r\n\r\n\t\t// print_r($this->tmhOAuth->response);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$resp = json_decode($this->tmhOAuth->response['response']);\r\n\t\t\t$this->addMsg(\r\n\t\t\t\t'<p>Authourised as ' . $resp->screen_name . '</p>' .\r\n\t\t\t\t'<p>The access level of this token is: ' . $this->tmhOAuth->response['headers']['x-access-level'] . '</p>'\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}",
"private function check_auth( $var ) {\n\t\t\t\n\t\t\tif( $var != null ) {\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function checkCredentials($identity, $credentials)\n {\n if ($this->salt != null) {\n $sql = \"SELECT di.id\n\t\t\t\t\tFROM dlayer_identity di\n\t\t\t\t\tWHERE di.identity = :identity\n\t\t\t\t\tAND di.credentials = :credentials\n\t\t\t\t\tAND logged_in = 0\n\t\t\t\t\tAND enabled = 1\n\t\t\t\t\tLIMIT 1\";\n $stmt = $this->_db->prepare($sql);\n $stmt->bindValue(':identity', $identity, PDO::PARAM_STR);\n $stmt->bindValue(':credentials',\n $this->hashedCredentials($credentials), PDO::PARAM_STR);\n $stmt->execute();\n\n $result = $stmt->fetch();\n\n if ($result != false) {\n $this->identity_id = $result['id'];\n\n return true;\n } else {\n return false;\n }\n } else {\n throw new Exception('Salt not set in authentication model');\n }\n }",
"function doLogin($username,$password)\n{\n // check password\n return true;\n //return false if not valid\n}",
"public function validate(array $credentials = [])\n {\n // disable validation of credentials\n return false;\n }",
"function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }",
"public function validateCredentials(UserInterface $user, array $credentials);",
"abstract public function credentials();",
"public function validate(array $credentials = []): bool\n {\n throw new \\RuntimeException('Cognito guard cannot be used for credential based authentication.');\n }",
"public function validateCredentials(Auth\\UserInterface $user, array $credentials) {\n $result = $user->getAuthIdentifier() == $credentials['email'] &&\n $user->getAuthPassword() == $credentials['password'];\n return $result;\n }",
"public function checkCredentials($credentials, UserInterface $user)\n {\n // no credential check is needed in this case\n\n // return true to cause authentication success\n return true;\n }",
"public function read_credentials(){\n $query='SELECT * FROM '.$this->table.' WHERE name=? and password=?';\n\n $stmt = $this->conn->prepare($query);\n\n \n $stmt->bindparam(1,$this->name);\n $stmt->bindparam(2,$this->password);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n\n if($stmt->execute()) {\n return true;\n }\n \n // Print error \n printf(\"Error: %s.\\n\", \"invalid user\");\n \n return false;\n \n \n }",
"function canDisplayCredentials()\n\t{\n\t\treturn env('SHOW_CREDENTIALS','false') == 'true';\n\t}",
"public function validate(array $credentials = [])\r\n {\r\n $user = $this->retrieveUserAndValidate($credentials);\r\n\r\n return ! empty($user);\r\n }",
"public function canManageCredentials()\n {\n return true;\n }",
"public function hasCredentials($store=null)\n {\n return ($this->hasAccountUser($store) && $this->hasAccountSignature($store));\n }",
"public function validateCredentials(Authenticatable $user, array $credentials)\n {\n return $user->getAuthPassword() == hash('sha256', 'very very salty', $credentials['password']);\n }",
"public function shouldAllowCredentials(): bool {\n return $this->configuration['allow_credentials'];\n }",
"public function validate(array $credentials = [])\n {\n return true;\n }",
"public function analisarCredito()\n {\n return false;\n }",
"public function validateUserPass($username, $password)\n {\n return 'username' == $username && 'password' == $password;\n }",
"public function validate(array $credentials = [])\n {\n\n }",
"private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function isCredentialsNonExpired(): bool\n {\n return true;\n }",
"function authenticate( $username, $password) {\n global $shib_UN;\n\n return $username == $shib_UN;\n }",
"public function checkCredentials($credentials, UserInterface $user)\n {\n if ((getenv('APP_ENV') != 'prod') && (getenv('APP_WIFI') != 'eduroam')) {\n return true;\n }\n\n return $this->passwordEncoder->isPasswordValid($user, $credentials['password']);\n }",
"public function checkCredentials($credentials, UserInterface $user)\n {\n // In case of an API token, no credential check is needed.\n\n // Return `true` to cause authentication success\n return true;\n }",
"private static function CheckCredentials($session, $name, $email, $password, $retpwd, &$msg)\n {\n if ($name == \"\") {\n $msg = \"Enter a username!\";\n } else if ($email == \"\") {\n $msg = \"Enter an email address!\";\n } else if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $msg = 'Enter a valid email address!';\n } else if ($password == \"\") {\n $msg = \"Enter a password!\";\n } else if (strlen($password) < 6) {\n $msg = \"Password must be at least 6 characters!\";\n } else {\n try {\n $query = $session->Query(\"SELECT username, email FROM user WHERE username=:name OR email=:email\");\n $query->execute(array(':name' => $name, ':email' => $email));\n $row = $query->fetch(PDO::FETCH_ASSOC);\n\n if ($row['username'] == $name) {\n $msg = \"Username already taken :(\";\n } else if ($row['email'] == $email) {\n $msg = \"Email already taken!\";\n } else if ($password <> $retpwd) {\n $msg = \"Passwords not coincident!\";\n } else {\n return true;\n }\n } catch (PDOException $e) {\n $msg = $e->getMessage();\n }\n }\n return false;\n }",
"function auth($username, $password) {\n\n if ($password == 'password') { \n return true;\n }\n return false;\n\n}",
"function TryLogin($username, $password){\n if(empty($username)){\n $this->message = self::MISSING_USERNAME;\n return false;\n }\n if(empty($password)){\n $this->message = self::MISSING_PASSWORD;\n return false;\n }\n \n if($username === $this->username && $password === $this->password){\n return true;\n }\n $this->message = self::WRONG_CREDENTIALS;\n return false;\n }",
"public function isCredentialsExpired()\n {\n return ! $this->isCredentialsNonExpired();\n }",
"protected function checkUser(array $credentials)\n {\n $user = User::whereEmail($credentials['email'])->first();\n\n return ! is_null($user) && Hash::check($credentials['password'], $user->password);\n }",
"function authenticate($username, $pwd) {\n global $mysqli;\n return userExists($username) && passwordMatch($username, $pwd);\n}",
"function checkAuth($type, $username, $password)\n {\n if (!$_MIDCOM->authentication->is_user())\n {\n if (!$_MIDCOM->authentication->login($username, $password))\n {\n return false;\n }\n }\n return true;\n }",
"public function checkCredentials($credentials, UserInterface $user)\n {\n // check credentials - e.g. make sure the password is valid\n // no credential check is needed in this case\n\n // return true to cause authentication success\n return true;\n }",
"function checkIfValidUserAndPasswordWithHttpBasicAuth()\n{\n $con = getMySqliConnection();\n\n $myusername = mysqli_real_escape_string($con,$_SERVER['PHP_AUTH_USER']);\n $mypassword = mysqli_real_escape_string($con,$_SERVER['PHP_AUTH_PW']);\n //encrypt password\n $mypassword = md5($mypassword);\n\n $sql = \"\";\n $sql .= \"SELECT * \";\n $sql .= \"FROM members \";\n $sql .= \"WHERE username = '$myusername' \";\n $sql .= \" AND PASSWORD = '$mypassword' \";\n $sql .= \" AND active = 1 \";\n\n $result = mysqli_query($con,$sql);\n\n if ($result != FALSE) {\n $count = mysqli_num_rows($result);\n }\n mysqli_close($con);\n // Mysql_num_row is counting table row\n\n\n // If result matched $myusername and $mypassword, table row must be 1 row\n\n if ($count == 1) {\n return true;\n }\n else\n {\n return false;\n }\n}",
"private function isNotCommon(): bool\n {\n $query = $this->databaseConnection->prepare(\"SELECT count(id) FROM blacklistedPasswords WHERE password = :passwordString\");\n $query->bindValue(':passwordString', $this->password);\n $query->execute();\n $count = $query->fetchColumn();\n if ($count == 0) {\n return true;\n }\n array_push($this->errorMessages, \"Not a valid password.\");\n return false;\n }",
"function valid_credentials($email, $password){\n\n\t$pass = sha1($password);\n\n\t$link = mysqli_connect(\"localhost\", \"root\", \"\", \"formstack1\");\n \n $sql = \"SELECT * from `users` where `email_address` = \n '{$email}' AND `pass_word` = '{$pass}' \";\n \n $result = mysqli_query($link, $sql);\n \n\treturn (mysqli_result($result, 0) == '1') ? true : false;\n\n}",
"function is_user_valid()\n{\n\tif(!isset($_SESSION['username'])\n\t|| !isset($_SESSION['password'])\n\t|| !isset($_SESSION['host'])\n\t|| !isset($_SESSION['ftp_port'])\n\t|| !isset($_SESSION['fingerprint'])\n\t|| !isset($_SESSION['current_dir'])\n\t|| $_SESSION['fingerprint'] !== sha1($_SERVER['HTTP_USER_AGENT']))\n\t\treturn false;\n\treturn true;\n}"
]
| [
"0.7838461",
"0.73759294",
"0.72429293",
"0.7035281",
"0.70285654",
"0.69604135",
"0.6892656",
"0.6691752",
"0.6676222",
"0.65723443",
"0.65432173",
"0.6542284",
"0.6502526",
"0.64719576",
"0.6446759",
"0.64154094",
"0.6411723",
"0.6403367",
"0.6383288",
"0.63473165",
"0.63162845",
"0.63140666",
"0.62617064",
"0.6260119",
"0.62567085",
"0.624934",
"0.62454104",
"0.62437636",
"0.6227481",
"0.6224768",
"0.6209187",
"0.6202482",
"0.62009245",
"0.6200753",
"0.61907583",
"0.6187104",
"0.6179692",
"0.61780286",
"0.61722267",
"0.61675376",
"0.61618584",
"0.61604154",
"0.61574537",
"0.61574537",
"0.6157213",
"0.615233",
"0.6150248",
"0.6128089",
"0.61272585",
"0.61265373",
"0.6115228",
"0.6114413",
"0.6114413",
"0.6106096",
"0.60909665",
"0.6089444",
"0.6081169",
"0.6060667",
"0.60574627",
"0.6052989",
"0.60512507",
"0.6046292",
"0.6042805",
"0.6042101",
"0.6033047",
"0.60286605",
"0.60276085",
"0.6023407",
"0.60060936",
"0.5991463",
"0.59880596",
"0.59871256",
"0.59855425",
"0.59776956",
"0.5973998",
"0.5971244",
"0.59651953",
"0.5964064",
"0.5958472",
"0.595382",
"0.5947198",
"0.594555",
"0.5936377",
"0.5935754",
"0.59348005",
"0.5923714",
"0.5920658",
"0.5918472",
"0.59112084",
"0.59074783",
"0.5895408",
"0.5894155",
"0.58911645",
"0.5889698",
"0.5885734",
"0.5876487",
"0.58724505",
"0.5862844",
"0.586246",
"0.58594936"
]
| 0.6529652 | 12 |
adds a new review to the database for a certain product | function submitReview ($rating, $text, $productID) {
//checks if the user is logged in
if (checkLogin()) {
if (userHasPurchashedProduct($productID) && ! userHasReviewedProduct($productID)) {
$id = getUserID();
//check if the ID didnt get an error
if (isset($id)) {
//create query
$sql = "INSERT INTO reviews
(Rating, Comment, ProductID, PersonID)
VALUES
($rating,'$text',$productID,$id)
";
//execute query
runQuery($sql);
//verify if placing review was succesful
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveProductReview()\n{\n\t$cf = new Fwcore();\n\t\n\t$data = array();\n\t$data['auth_token'] = $_POST['auth_token'];\n\t$data['product_id'] = $_POST['product_id'];\n\t$data['email'] = $_POST['email'];\n\t$data['rating'] = $_POST['rating'];\n\t$data['review_title'] = isset($_POST['review_title']) != '' ? $_POST['review_title'] : '';\n\t$data['review'] = isset($_POST['review']) != '' ? $_POST['review'] : '';\n\t$data['app_id'] = isset($_POST['app_id']) != '' ? $_POST['app_id'] : '';\n\t$data['rating_id'] = isset($_POST['rating_id']) != '' ? $_POST['rating_id'] : '';\n\t\n\t$cf->saveProductReview($data);\n}",
"public function store(Request $request)\n {\n $user = \\Auth::user();\n $product = Product::find($request->product_id);\n $review = new Review();\n $review->comment = $request->comment;\n $review->star = $request->star;\n $review->user()->associate($user);\n $review->product()->associate($product);\n $review->save();\n return redirect()->back();\n\n }",
"function addReviewAction()\n {\n $productId = (int) $this->getRequest()->getParam('product_id');\n $categoryId = (int) $this->getRequest()->getParam('category_id', false);\n \n if ($this->_getSession()->isLoggedIn()) {\n $this->_redirect('review/product/list', array('id' => $productId, 'category' => $categoryId));\n } else {\n $this->_getSession()->setBeforeAuthUrl(Mage::getUrl('review/product/list', \n array('id' => $productId, 'category' => $categoryId)));\n $this->_redirect('customer/account/login');\n }\n return;\n }",
"public function store(Request $request)\n {\n $this->validate(request(),[\n 'rating' => 'required',\n 'description' => 'required',\n ]);\n \n $rating = new ProductReview();\n $rating->product_id = $request->post('product_id');\n $rating->user_id = Auth::user()->id;\n $rating->rating = $request->post('rating');\n $rating->description = $request->post('description');\n $rating->save();\n \n return redirect('/products')->with('success', 'Produk berhasil di simpan');\n }",
"public function postAction(){\n $return_result = array(\n 'code'=> 0,\n 'model'=> null,\n );\n $params = $this->postJsonParams();\n $product_id = $params('product_id');\n\n if ($data = Mage::getSingleton('review/session')->getFormData(true)) {\n $rating = array();\n if (isset($data['ratings']) && is_array($data['ratings'])) {\n $rating = $data['ratings'];\n }\n } else {\n $data = $params;\n $rating = isset($params['ratings'])?$params['ratings']:array();\n }\n $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($product_id);\n if (($product) && !empty($data)) {\n $session = Mage::getSingleton('core/session');\n /* @var $session Mage_Core_Model_Session */\n $review = Mage::getModel('review/review')->setData($data);\n /* @var $review Mage_Review_Model_Review */\n $validate = $review->validate();\n if ($validate === true) {\n try {\n $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))\n ->setEntityPkValue($product->getId())\n ->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)\n ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n ->setStoreId(Mage::app()->getStore()->getId())\n ->setStores(array(Mage::app()->getStore()->getId()))\n ->save();\n foreach ($rating as $ratingId => $optionId) {\n Mage::getModel('rating/rating')\n ->setRatingId($ratingId)\n ->setReviewId($review->getId())\n ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n ->addOptionVote($optionId, $product->getId());\n }\n $review->aggregate();\n $return_result['message'] = 'Your review has been accepted for moderation.';\n }\n catch (Exception $e) {\n $return_result['code'] = 1;\n $return_result['error'] = 'Unable to post the review.';\n }\n }\n else {\n $session->setFormData($data);\n if (is_array($validate)) {\n foreach ($validate as $errorMessage) {\n $return_result['error'] = $errorMessage;\n }\n }\n else {\n $return_result['error'] = 'Unable to post the review.';\n }\n }\n }\n echo json_encode($return_result);\n }",
"public function addReview($review)\n {\n $this->reviews()->create($review);\n }",
"public function insertreview($txtProductId,$txtTitle,$txtComment,$txtRate){\n\t\t$object=array(\n\t\t\t'UserId' => $this->session->userdata('userid'),\n\t\t\t'ProductId' => $txtProductId,\n\t\t\t'Title' => $txtTitle,\n\t\t\t'ReviewComment' => $txtComment,\n\t\t\t'Rate' => $txtRate,\n\t\t\t'ReviewDate' => date('Y/m/d'),\n\t\t\t'ReviewTime' => date('H:i:s')\n\t\t);\n\t\t$this->db->insert('tbl_review', $object);\n\t\treturn true;\n\t}",
"public function insertProduct(Product $product);",
"public function store(Request $request)\n {\n $newReview = new Review();\n $data = $request->all();\n $data['product_id'] = (int)$data['product_id'];\n $data['rating'] = (int)$data['rating'];\n\n // validation\n $request->validate($this->ruleValidation());\n \n $newReview->fill($data);\n\n $created = $newReview->save();\n\n if($created) {\n $product = Product::where('id', $newReview->product_id)->first();\n return redirect()->route('products.show', $product->slug);\n }\n \n }",
"public function store(ReviewRequest $request, $productId)\n {\n $product = Product::findOrFail($productId);\n $ordered = $product->orders->where('user_id', \\Auth::id())->first();\n\n if(!$ordered) {\n \\abort(400, 'You haven\\'t order this product');\n }\n\n $review = new Review;\n $review->review = $request->review;\n $review->star = $request->star;\n $review->user_id = Auth::id();\n $review->product_id = $productId;\n $review->save();\n\n return response([\n 'data' => new ReviewResource($review)\n ], 201);\n }",
"public function store() {\n $film = $_POST['film_id'];\n $user = $_POST['user_id'];\n $review = $_POST['review_text'];\n $vote = $_POST['review_vote'];\n\n if (!$review == \"\") {\n\n DB::table('reviews')->insert(\n array(\n 'film_id' => $film,\n 'user_id' => $user,\n 'review_text' => $review,\n 'review_vote' => $vote\n )\n );\n }\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'rating' => 'required|numeric|max:5',\n 'review' => 'required|max:255',\n 'user' => 'exists:users,id',\n 'product' => 'exists:products,id'\n ]);\n\n $review = new Review();\n $review->rating = $request->rating;\n $review->review = $request->review;\n $review->user_id = $request->user;\n $review->product_id = $request->product;\n $review->likes = 0;\n $review->dislikes = 0;\n $review->save();\n return redirect(url(\"product/$review->product_id\"));\n }",
"public function store(Request $request)\n {\n $productId = (int)$request['product-id'];\n $user_id = (int)$request['user-id'];\n $ratingScore = (int)$request['rating-score'];\n $description = $request['rating-review'];\n\n // validated data \n if(!Product::find($productId)){ // product\n return back()->with('error', 'Product not found or invalid product!');\n }\n if(!User::find($user_id)){ // user\n return back()->with('error', 'User not found!');\n }\n if($ratingScore < 0 || $ratingScore > 5) { // rating score\n return back()->with('error', 'Invalid rating score!');\n }\n\n $review = new Review([\n 'user_id' => $user_id,\n 'product_id' => $productId,\n 'description' => $description,\n 'rating' => $ratingScore,\n ]);\n\n $review->save();\n return back()->with('success', 'Your review has been added!');\n }",
"public function store(ReviewRequest $request, Product $product)\n\t\t{\n\t\t\t$review = new Review($request -> all());\n\t\t\t$product -> reviews() -> save($review);\n\t\t\t\n\t\t\treturn response([\n\t\t\t\t\t'data' => new ReviewResource($review),\n\t\t\t], Response::HTTP_CREATED);\n\t\t}",
"public function store(Request $request)\n {\n $review = new Review;\n $review->name = $request->get(\"name\");\n $review->grade = $request->get(\"grade\");\n $review->comment = $request->get(\"comment\");\n $review->product_id = $request->get(\"product_id\");\n $review->type = $request->get(\"type\");\n $review->save();\n return redirect()->action('HomeController@index', ['id' => $review->product_id])->with('status', 'Comment saved!');\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'rating'=>'required',\n 'username'=>'required',\n 'title'=>'required',\n 'body'=>'required'\n ]);\n\n ProductReview::create($request->all());\n return redirect()->back()->with('success', 'Your review has been submitted.'); \n }",
"function addReview($db_connection)\n\t\t\t{\n\t\t\t\t$userid = getUserID($db_connection);\n\t\t\t\t$currentDate = date(\"Y-m-d\");\n\t\t\t\tif(userHasScored($db_connection,$_POST['movieid']))\n\t\t\t\t{\n\t\t\t\t\t$query = \"UPDATE score_and_reviews SET score_data = {$_POST['rating']}, review = '{$_POST['review']}', review_date = '$currentDate' WHERE userid = $userid\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$query = \"INSERT INTO score_and_reviews(userid, movieid, score_data, review_date, review) VALUES ($userid,{$_POST['movieid']},{$_POST['rating']},'$currentDate','{$_POST['review']}')\";\n\n\t\t\t\t}\n\t\t\t\t$result = mysqli_query($db_connection,$query);\n\t\t\t}",
"public function store(Request $request)\n {\n $review = new Review;\n $review->product_id = $request->input(\"product_id\");\n $review->comment = $request->input(\"comment\");\n $review->rating = $request->input(\"rating\");\n $review->save();\n return redirect()->action('ReviewsController@index')->with('status', 'Kommentaren är sparad!');\n }",
"public function put_review($data)\n\t{\n\t\t$review_count = $this->count_reviews([\n\t\t\t'restaurant_id'\t=>\t$data['restaurant_id'],\n\t\t\t'author_id'\t\t=>\t$data['author_id']\n\t\t]);\n\t\tif ($review_count < 1)\n\t\t{\n\t\t\tunset($data['javascript']);\n\t\t\t$this->db->insert('reviews', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filter_results([\n\t\t\t\t'restaurant_id'\t=>\t$data['restaurant_id'],\n\t\t\t\t'author_id'\t=>\t$data['author_id']\n\t\t\t]);\n\t\t\tunset($data['javascript']);\n\t\t\t$this->db->update('reviews', $data);\n\t\t}\n\t}",
"public function addReview($review) {\n $this->reviews[] = $review;\n }",
"public function add() {\n $mysqli = Database::getMYSQLI();\n \n $stmt = $mysqli->prepare(\"\n INSERT INTO reviews (persons_id, lessons_id, title, review, date_submitted, rating)\n VALUES (?,?,?,?,?,?)\");\n \n $stmt->bind_param('iisssi', $this->personsID, $this->lessonsID, $this->title, \n $this->review, $this->dateSubmitted, $this->rating);\n \n $stmt->execute();\n $stmt->close();\n $mysqli->close();\n }",
"private function addProduct($product) \r\n\t{\r\n\t\t$this->newProducts[] = $product;\r\n\t}",
"public function store(Request $request)\n {\n //\n $review = new Review();\n $review->user_id = $request->user_id;\n $review->product_id = $request->product_id;\n $review->email = $request->email;\n $review->rating = $request->rating + 1;\n $review->description = $request->description;\n $review->save();\n Session::flash('created_review', 'The review has been submitted!');\n return redirect()->back();\n }",
"function add_product($post_data) {\n $this->db->insert('products', $post_data);\n }",
"public function edit(ProductReview $productReview)\n {\n //\n }",
"public function edit(ProductReview $productReview)\n {\n //\n }",
"function addNewReview($reviewText, $invId, $clientId) {\n // Create a connection object using the phpmotors connection function\n $db = phpmotorsConnect();\n // The SQL statement\n $sql = 'INSERT INTO reviews (reviewText, invId, clientId)\n VALUES (:reviewText, :invId, :clientId)';\n // Create the prepared statement using the phpmotors connection\n $stmt = $db->prepare($sql);\n // The next nine lines replace the placeholders in the SQL\n // statement with the actual values in the variables\n // and tells the database the type of data it is\n $stmt->bindValue(':reviewText', $reviewText, PDO::PARAM_STR);\n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\n $stmt->bindValue(':clientId', $clientId, PDO::PARAM_INT);\n // Insert the data\n $stmt->execute();\n // Ask how many rows changed as a result of our insert\n $rowsChanged = $stmt->rowCount();\n // Close the database interaction\n $stmt->closeCursor();\n // Return the indication of success (rows changed)\n return $rowsChanged;\n }",
"public function store(User $pro)\n {\n $user_id = request()->user()->id;\n Review::create([\n 'customer_id'=> $user_id,\n 'professional_id'=> $pro->id,\n 'rating'=> request('rating'),\n 'comment'=> request('comment'), \n ]);\n\n // redirect to viewing professionals profiles\n }",
"function add_product($product){\n if($this->_check_product_in_db($product)){\n return False; // Product already in database\n }else{\n array_push($this->db, $product);\n return True;\n }\n }",
"public function addReview($title, $ID, $review, $rating){\n \t$stmt = $this->conn->prepare (\n\t\t\t\t\"INSERT INTO reviews(title, reviewerID, review, rating)\n\t\t\t\tVALUES(:title, :reviewerID, :review, :rating); \");\n\t\t$stmt->bindParam ( 'title', $title );\n\t\t$stmt->bindParam ( 'reviewerID', $ID );\n\t\t$stmt->bindParam ( 'review', $review );\n\t\t$stmt->bindParam ( 'rating', $rating );\n\t\t$stmt->execute ();\n }",
"public function update(Request $request, ProductReview $productReview)\n {\n //\n }",
"public function update(Request $request, ProductReview $productReview)\n {\n //\n }",
"public function run(Review $review): void\n {\n $review->insert($this->getDataReview());\n }",
"public function store(Request $request)\n {\n $review = new Review;\n $review->name = $request->get('name');\n $review->grade = $request->get('grade');\n $review->comment = $request->get('comment');\n $review->product_id = $request->get('id');\n\n if ($review->name == NULL or $review->grade == NULL or $review->comment == NULL\n or $review->product_id == NULL){\n\n return redirect()->back();\n }\n\n else {\n $review->save();\n return redirect()->back();\n }\n }",
"public function save_product_reviews( $post_id, $post ) {\n\t\tif ( 'post' !== $post->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$review_block = self::find_review_block( $post->post_content );\n\n\t\t$previous_product_ids = json_decode( get_post_meta( $post_id, self::META_REVIEWS, true ), true ) ?? [];\n\n\t\tif ( empty( $previous_product_ids ) && ! $review_block ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$primary_id = $review_block ? ( $review_block['attrs']['primaryProductId'] ?? null ) : null;\n\t\t$comparison_id = $review_block ? ( $review_block['attrs']['comparisonProductId'] ?? null ) : null;\n\n\t\t$product_ids_to_remove = array_filter(\n\t\t\t$previous_product_ids,\n\t\t\tfunction( $id ) use ( $primary_id, $comparison_id ) {\n\t\t\t\tif ( $id === $primary_id || $id === $comparison_id ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t);\n\n\t\t$this->remove_review_from_products( $post_id, $product_ids_to_remove );\n\n\t\tif ( ! $review_block ) {\n\t\t\tupdate_post_meta( $post_id, self::META_REVIEWS, wp_json_encode( [] ) );\n\t\t\treturn;\n\t\t}\n\n\t\t$review = $this->create_review_data(\n\t\t\t$post_id,\n\t\t\t$primary_id,\n\t\t\t$comparison_id,\n\t\t\t$review_block['attrs']['editorsChoice'],\n\t\t\t$review_block['attrs']['rating']\n\t\t);\n\n\t\t$new_product_ids = [];\n\n\t\tif ( $primary_id ) {\n\t\t\t$new_product_ids[] = $primary_id;\n\t\t}\n\n\t\tif ( $comparison_id ) {\n\t\t\t$new_product_ids[] = $comparison_id;\n\t\t}\n\n\t\t$this->update_product_review( $primary_id, $post_id, $review );\n\t\t$this->update_product_review( $comparison_id, $post_id, $review );\n\n\t\tupdate_post_meta( $post_id, self::META_REVIEWS, wp_json_encode( $new_product_ids ) );\n\t}",
"public function product_add_post()\n\t\t\t\t{\n\t\t\t\t\t$post = $this->input->post();\n\t\t\t\t\t$insert = $this->db->insert('product_table', $post);\n\t\t\t\t\tif($insert){\n\t\t\t\t\t\techo 'Insert Succesful';\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo 'Insert Error';\n\t\t\t\t\t}\n\t\t\t\t}",
"public function new_product()\n\t{\n\n\t\t//Inputs the new product into the store\n\t\t$products = array(\n\t\t\"product_name\" => $this->input->post('product_name'),\n\t\t\"price\" => $this->input->post('price'),\n\t\t\"description\" => $this->input->post('description'),\n\t\t\"created_at\" => \"NOW()\",\n\t\t\"updated_at\" => \"NOW()\");\n\n\t\t$this->db->insert('products', $products);\n\n\t\t// Go back to the shop\n\t\tredirect(base_url('shop'));\n\t}",
"public function add_review($user_id, $book_id, $rating, $date, $reviewText) {\r\n\r\n\r\n //add user_id and book_id when figure out how to get from username and title\r\n $sql = \"INSERT INTO reviews VALUES( NULL, $user_id, $book_id, $rating, CURRENT_DATE , '$reviewText')\";\r\n\r\n\r\n try {\r\n //run the query and add them to the review table in the usersystem database\r\n $query = $this->dbConnection->query($sql);\r\n\r\n if (!$query) {\r\n throw new DatabaseException();\r\n }\r\n\r\n return true;\r\n \r\n } catch (DatabaseException $e) {\r\n return $e->getDetails();\r\n } catch (Exception $e) {\r\n return $e->getMessage();\r\n }\r\n\r\n }",
"public function store(Request $request)\n {\n $review = new user_reviews();\n $review->user_id = Auth::id();\n $review->rating = $request->rating;\n $review->comment = $request->review;\n $review->product_id = $request->products_id;\n $review->save();\n return redirect()->route('home');\n }",
"public function store(ProductInsertFormRequest $request)\n {\n \n $id=Product::insertGetId([\n 'name'=>$request->product_name,\n 'cat_id'=>$request->cat_id,\n 'price'=>$request->price,\n 'package_id'=>$request->package_id,\n 'foc_id'=>$request->foc_id,\n 'description'=>$request->description, \n 'img'=>$request->photo,\n 'status'=>1,\n ]);\n \n Stock::create([\n 'product_id'=>$id,\n 'balance'=>0\n ]);\n return redirect('admin/product/create')->with('status','new product has been inserted.');\n }",
"public function createReview($int_id,$int_toyid,$int_userid, $str_username, $str_review, $int_rating) {\n $obj_store = $this->getStore();\n $obj_store->upsert($obj_store->createEntity([\n 'id' => $int_id,\n 'toyId' => $int_toyid,\n 'userid' => $int_userid,\n 'username' => $str_username,\n 'reviewText' => $str_review,\n 'rating' => $int_rating\n ]));\n\n \n }",
"public function addProduct($product)\n {\n \n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if(is_null($cart))\n {\n $this->product()->save($product);\n }\n else\n {\n\n $quantity = $cart->pivot->quantity;\n\n $quantity++;\n\n $cart->pivot->update(compact('quantity'));\n }\n\n }",
"public function store(Request $request)\n {\n\n \n if(Session::get('CLIENT_ID'))\n {\n\t // Validate form data\n\t $rules = array(\n\t 'rating' => 'required',\n\t 'review' => 'required',\n\t 'product_id' => 'required',\n\t );\n\n\t $validator = Validator::make ( Input::all(), $rules);\n\t if ($validator->fails()){\n\t return Response::json(['error'=> $validator->getMessageBag()->toarray()]);\n\t }\n\n\t // Get the client\n\t $client = Client::find(Session::get('CLIENT_ID'));\n\n\t // Create an instace of Productreview & assign form data then save to database\n\t $review = new Productreview();\n\t $review->review = $request->review;\n\t $review->rating = $request->rating;\n\t $review->product_id = $request->product_id;\n\t $review->client_id = $client->id;\n\n\t if ($review->save()) {\n\t\t //for review point\n\t \t\n\t $clientPoint = Clientpoint::where('client_id', $client->id)->first();\n if ($clientPoint) {\n\n \t$clientPoint->pro_review_ref_point += 1;\n\t\t $clientPoint->client_id = $client->id;\n\t\t $clientPoint->save();\n \n } else {\n\n\t $clientPoint = new Clientpoint;\n\t\t $clientPoint->pro_review_ref_point = 1;\n\t\t $clientPoint->client_id = $client->id;\n\t\t $clientPoint->save();\n } \n\n\n\t }\n\n\t // Return json response\n\t return response()->json(['success'=>'Thanks for your rating', 'review'=>$review]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Response::json(['error'=>['error'=> 'Sign in required <br> <a href=\"#login-popup\" data-toggle=\"modal\" style=\"color: yellow;\"><u>click here to sign in</u></a>']]);\n\t\t}\n\n }",
"public function review($review_id) {\n if(!$this->that->config->get('koraki_review'))\n return;\n\n if (isset($this->that->request->server['HTTPS']) && (($this->that->request->server['HTTPS'] == 'on') || ($this->that->request->server['HTTPS'] == '1'))) {\n $base = $this->that->config->get('config_ssl');\n } else {\n $base = $this->that->config->get('config_url');\n }\n\n if(empty($review_id)){\n return;\n }\n\n $this->that->load->model('catalog/review');\n\n $review = $this->that->model_catalog_review->getReview($review_id);\n\n if(isset($review) && !empty($review['rating']) && !empty($review['rating'] >= 3) && $review['status']==1){\n\n $this->that->load->model('catalog/product');\n $this->that->load->model('tool/image');\n\n $p = $this->that->model_catalog_product->getProduct($review['product_id']);\n $popup = $this->that->model_tool_image->resize($p['image'], 150, 150);\n\n $item = array(\n \"product_id\" => $p['product_id'],\n \"product_name\" => $p['name'],\n \"thumbnail\" => $popup\n );\n\n $variables = array(\n \"number\" => $review['rating'] .\"/5\",\n \"item\" => array(\n $item\n )\n );\n $product = \"<a href='\" . $base . \"?route=product/product&product_id=\" . $p['product_id'] . \"' target='_blank'>\" . html_entity_decode($p['name'], ENT_QUOTES, 'UTF-8') . \"</a>\";\n\n $post = array(\n \"variables\" => json_encode($variables),\n \"notificationText\" => $review['author'] . \" made a \". $review['rating'] .\"/5 star rating on \" . $product,\n \"thumbnailUrl\" => $popup,\n \"location\" => \"\"\n );\n\n $this->post($post);\n }\n }",
"function add_product($post_data)\n\t{\t\n\t\t$this->db->insert('products', $post_data); \n\t\t//echo $this->db->last_query();die;\n\t\t\n\n\t}",
"public function store(Request $request, Product $product)\n {\n //TODO GET USER\n\n //TODO GET SELLER\n\n //TODO INSERT NEW CART\n\n //TODO INSERT CART PRODUCTS AT NEW CART\n\n //TODO INSERT CART PRODUCTS AT OLD CART\n\n\n //TODO UPDATE CART PRODUCTS\n\n\n return back();\n }",
"public function addProduct()\n {\n if (!isset($_POST['newProd'])) {\n \n $this->reqView('AddProduct');\n\n } else {\n \n // instantiate admin model\n $this->initModel('NewProduct_model');\n \n // call addProduct method in model and check if the model successfuly added a new product to database\n if($this->modelObj->addProduct() || $_POST['newProdStatus'] == 'success')\n {\n\n // require the add product view\n $this->reqView('AddProduct');\n \n } else {\n\n echo 'Error, contact site administrator';\n }\n }\n \n // check if user selected the add variant option(pushed button)\n if(isset($_POST['addVariant']['status']) && $_POST['addVariant']['status'] == 'true')\n {\n //call model to handle new variant input\n $this->initModel('AddVariant_model');\n }\n }",
"public function add_review_rating(Request $request){\n $data = $request->all();\n\n return BookReview::create($data);\n }",
"public function run() {\n DB::table('reviews')->insert([\n [\n 'product_id' => 1,\n 'rating' => 4,\n 'comment' => \"Very nice game\",\n ],\n [\n 'product_id' => 2,\n 'rating' => 5,\n 'comment' => \"Very great game, much recommend!\",\n ],\n [\n 'product_id' => 3,\n 'rating' => 1,\n 'comment' => \"Very bad game\",\n ]\n ]);\n }",
"public function addProduct($userID,$categ, $subCateg, $name, $desc, $condition, $availablility) {\r\n$query = \"select * from product WHERE cat_label = \".$categ.\" AND sub_c_label =\". $subCateg. \" AND product_name=\".$name. \" AND description LIKE '%\". $desc.\"%'\";\r\n\r\n$res = $this->con->query($query);\r\n\r\n\r\nif ($res->num_rows > 0) {\r\n\t// get the product id and then redirect the user to the page so he/she can rate it\r\n\t$row = $res->fetch_assoc();\r\n\r\n\theader (\"Location: ../product.php?exist=true&product_id=\".$row['id']);\r\n\r\n} else {\r\n\r\n\t$query = \"INSERT INTO product (user_id, cat_label, sub_c_label, product_name, description,date) VALUES (\".$categ.\",\".$subCateg.\",\".$brand.\",'\". $desc. \"','\".$date.\"')\";\r\n\r\n\t$res = $this->con->query($query) or die(\"database error\" . $this->con->error);\r\n\t\t\r\n\t/* To insert the rating \r\n\t1- get the id of the product and user_id\r\n\t*/\r\n\t$productID = $this->con->insert_id;\r\n\t$query = \"INSERT INTO rate (product_id, user_id, rate ) VALUES (\".$productID.\",\".$userID.\",\". $rate.\")\";\r\n\t$res = $this->con->query($query) or die(\"database error\" . $this->con->error);\r\n\t\t\t\r\n\tif ($img==true) {\r\n\r\n\t\t\t$query = \"INSERT INTO image (product_id, image_id) VALUES (\".$productID.\",\".$productID.\")\";\r\n\t\t\t$res = $this->con->query($query) or die(\"database error\" . $this->con->error);\r\n\t\t}\r\n\t\t\r\n\treturn $productID;\t\r\n\t\t\r\n\t}\r\n}",
"public function createNewReview($user_id, $user_name, $review, $date){\n\t\t// exemple :abcabc - will be replaced with real value\n\t\t$sql = \"INSERT INTO reviews (`user_id`, `date`, `review`, `user_name`) VALUES (:user_id, :date, :review, :user_name)\";\n\n\t\t// with PDO prepare for sql statment executing\n\t\t$pdo_statement = $this->dbh->prepare($sql);\n\n\t\t// add values\n\t\t$pdo_statement->bindValue(':user_id', $user_id, \\PDO::PARAM_STR);\n\t\t$pdo_statement->bindValue(':review', $review, \\PDO::PARAM_STR);\t\n\t\t$pdo_statement->bindValue(':date', $date, \\PDO::PARAM_STR);\n\t\t$pdo_statement->bindValue(':user_name', $user_name, \\PDO::PARAM_STR);\n\t\t\n\t\t// sql execution\n\t\t$pdo_statement->execute();\n\t}",
"public function actionReview()\n\t{\n\t\t$review = new Review();\n\t\t$review->attributes = $_POST['Review'];\n\t\tif ($review->validate())\n\t\t{\n\t\t\t$noteId = $_POST['note_id'];\n\t\t\t$model = $this->loadModel($noteId);\n\n\t\t\t$model->addReview($review, Yii::app()->user->id);\n\n\t\t\techo $this->renderPartial('_review', array('data'=>$review), true);\n\t\t}\n\t}",
"function product_put()\n {\n $this->form_validation->set_data($this->put());\n\n if($this->form_validation->run('product_put') != false){\n\n $product = $this->put();\n\n $product_id = $this->api_model->insert_product($product);\n\n if(!$product_id)\n {\n $this->response(array('status' => 'failure', 'message' => 'An unexpected error occured while trying to create the product'), REST_CONTROLLER::HTTP_INTERNAL_SERVER_ERROR);\n }\n else\n {\n $this->response(array('status' => 'success', 'message' => 'created'));\n }\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => $this->form_validation->get_errors_as_array()), REST_Controller::HTTP_BAD_REQUEST);\n }\n }",
"public function saveProduct(Request $r){\n \t$name = $r->input('name');\n \t$shortDes = $r->input('short_des');\n \t$longDes = $r->input('long_des');\n \t$price = $r->input('price');\n \t$platform = $r->input('platform');\n \t$charas = $r->input('charas');\n \t$frontImage = $r->input('front_image');\n \t$p_url = $r->input('product_url');\n \t$p_owner = $r->input('product_owner');\n \t$p_creator = $r->input('product_creator');\n $type = $r->input('type');\n $youtube = $r->input('youtube_url');\n $image02 = $r->input('image_02');\n $image03 = $r->input('image_03');\n \t\n \t//Create the Associative array\n \t$product = new Product([\n \t\t'name'=> $name,\n \t\t'short_des' => $shortDes,\n \t\t'long_des' => $longDes,\n \t\t'price' => $price,\n \t\t'platform' => $platform,\n \t\t'characteristics' => $charas,\n \t\t'front_image' => $frontImage,\n \t\t'product_url' => $p_url,\n \t\t'product_owner' => $p_owner,\n \t\t'product_creator' => $p_creator,\n 'type' => $type,\n 'youtube_url' => $youtube\n \t]);\n\n \t//Add prodcut to DataBase\n \t$product->save();\n\n //If optional images are not null or not empty, then added to the 'images' table related each one with the product just created\n if($image02 != null || $image02 != ''){\n $img1 = new Images([\n 'url' => $image02,\n 'alt' => $name,\n 'description' => $shortDes\n ]);\n $product->images()->save($img1);\n }\n if($image03 != null || $image03 != ''){\n $img2 = new Images([\n 'url' => $image03,\n 'alt' => $name,\n 'description' => $shortDes\n ]);\n $product->images()->save($img2);\n }\n\n //Retreive all products\n $p = Product::orderBy('created_at', 'desc')->get();\n\n \treturn redirect()->route('portafolio', ['products' => $p]);\n\n }",
"public function insert_review(Request $request){\n //validate data\n $this->validate($request, [\n 'review_date' => 'required',\n 'reviewed_by' => 'required',\n 'attachment' => 'required'\n ]);\n\n $form_data = array(\n 'comment' => $request->comment,\n 'reviewed_by' => $request->reviewed_by,\n 'revision' => $request->revision,\n 'file_id' => $request->file_id,\n 'initial_approval_id' => $request->initial_approval_id,\n 'phase_id' => $request->phase_id,\n 'review_date' => $request->review_date,\n 'attachment' => $request->attachment,\n 'user_id' => Auth::user()->id\n //'doc_number' => $this->getNextDocRevNumber()\n );\n\n //Store data in document_control_reviews\n Review::create($form_data);\n\n //Select all date from files and store them in document_control_reviews\n //DB::statement('INSERT document_record_archives SELECT * FROM files');\n\n\n\n //Truncate files\n //DB::table('files')->truncate();\n\n //store status message\n Session::flash('success_msg', 'Revision is successfully done!');\n\n //redirect back to the main page\n return back();\n }",
"public function add($product) {\n $ajout = false;\n if ($this->products_id) {\n if (array_key_exists($product->id,$this->products_id)) {\n if ($product->quantity >= $this->products_id[\"$product->id\"]++){\n $this->products_id[\"$product->id\"]++;\n $ajout = true;\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id += [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id = [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n if($ajout){\n $this->total_product ++;\n if($this->discountisused){\n $this->total_price += ($product->price - $product->price * $this->discounts[$this->discountused]/100);\n $this->discountamount += $product->price*$this->discounts[$this->discountused]/100;\n }\n\n else\n $this->total_price += $product->price;\n }\n}",
"public function create(CreateReviewRequest $request);",
"public function store($productId)\n\t{\n\t\tProduct::findOrFail($productId)->suppliers()->sync(Input::all());\n\t}",
"public function store(ProductRequest $request)\n {\n// $data = $request->all();\n// foreach ($checkboxes as $checkbox) {\n// if(!isset($data[$checkbox]) {\n// $data[$checkbox] = 0;\n// }\n// }\n $data = $request->all();\n\n if(!isset($data['featured'])) {\n $data['featured'] = 0;\n }\n if(!isset($data['recommended'])) {\n $data['recommended'] = 0;\n }\n\n $tagsIDs = $this->getTagsIDs($data['tags']);\n unset($data['tags']);\n $this->product->fill($data);\n $this->product->save();\n $this->product->tags()->sync($tagsIDs);\n\n //\\Session::flash('product_added', 'Product has been successfully added in the database.');\n\n return redirect()->route('products');\n }",
"public function store(Request $request)\n {\n \n $request->user()->reviews()->create([\n 'lecturer' => $request->lecturer,\n 'class_name' => $request->class_name,\n 'rank' => $request->rank,\n 'presentation' => $request->presentation,\n 'test_review' => $request->test_review,\n 'class_review' => $request->class_review,\n 'user_id'=> $request->user()->id,\n ]);\n\n return redirect('/reviews');\n\n }",
"function add($product_id)\n\t{\n\t\t$product = $this->database->getProductbyId($product_id);\n\n\t\tif($product)\n\t\t{\n\t\t\t$this->_add_to_cart($product);\n\t\t}\n\t\t\n\t\t$this->_show_add_to_cart_comment($product['add_to_cart_comment']);\n\t\t\n\t\tredirect('cart');\n\t}",
"public function saveProdReviewAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId)\n\t\t{\n\t\t\t$prod_params=$this->_request->getParams();\n\t\t\t\n\t\t\t//echo \"<pre>\";print_r($_FILES);print_r($prod_params);exit;\n\n\t\t\t$quote_id=$prod_params['quote_id'];\n\n\t\t\tif(isset($prod_params['review_skip'])) $status='skipped';\n\t\t\telse if(isset($prod_params['review_challenge'])) $status='challenged';\n\t\t\telse if(isset($prod_params['review_save'])) $status='challenged';\n\t\t\telse if(isset($prod_params['review_validate'])) $status='validated';\n\n\t\t\tif($quote_id)\n\t\t\t{\t\n\t\t\t\t\n\t\t\t\t//get Quote version\n\t\t\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\t\t\t\t\t$version=$quote_obj->getQuoteVersion($quote_id);\n\n\t\t\t\t//Insert Quote log\n\t\t\t\t$log_params['quote_id']\t= $quote_id;\n\t\t\t\t$log_params['bo_user']\t= $this->adminLogin->userId;\t\t\t\t\t\n\t\t\t\t$log_params['version']\t= $version;\n\t\t\t\t$log_params['action']\t= 'prod_'.$status;\t\t\t\t\n\n\n\t\t\t\tif(isset($prod_params['review_skip'])|| isset($prod_params['review_challenge']))\n\t\t\t\t{\n\t\t\t\t\t\n\n\t\t\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\t\t\t\t\t$update_quote['prod_review']=$status;\n\t\t\t\t\t\n\t\t\t\t\t//echo \"<pre>\";print_r($update_quote);exit;\n\t\t\t\t\t$quote_obj->updateQuote($update_quote,$quote_id);\n\n\t\t\t\t\tif($status=='skipped')\n\t\t\t\t\t\t$this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2\");\n\t\t\t\t\telse if($status=='challenged')\n\t\t\t\t\t\t$this->_redirect(\"/quote/prod-quote-review?quote_id=\".$quote_id);\t\n\t\t\t\t}\n\t\t\t\telseif(isset($prod_params['review_save'])|| isset($prod_params['review_validate']))\n\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\tforeach($_POST as $key => $prod_missions)\n\t\t\t\t\t{\n\t\t\t\t\t if (strpos($key, 'pmission_cost_') === 0)\n\t\t\t\t\t {\n\t\t\t\t\t \t$mission_id=str_replace('pmission_cost_','',$key);\n\t\t\t\t\t \tforeach($prod_missions as $pkey=>$pcost)\n\t\t\t\t\t \t{\t\t\t\t\t\t \t\t\n\t\t\t\t\t \t\t$pcost=str_replace(\",\",\".\",$pcost);\n\t\t\t\t\t \t\t$staff=$prod_params['staff_'.$mission_id][$pkey];\n\t\t\t\t\t\t\t\t/*tempo changes*/\n\t\t\t\t\t\t\t\t\t//Mission level changes\n\t\t\t\t\t\t\t\t\t$mission_length=$prod_params['mission_length_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$mission_length_option=$prod_params['mission_length_option_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t//$volume=$prod_params['volume_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$volume_max=$prod_params['volume_max_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$delivery_volume_option=$prod_params['delivery_volume_option_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$tempo=$prod_params['tempo_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$tempo_length=$prod_params['tempo_length_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$tempo_length_option=$prod_params['tempo_length_option_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$staff_time=$prod_params['staff_time_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$staff_time_option=$prod_params['staff_time_option_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t//newduration volume\n\t\t\t\t\t\t\t\t\t$new_missiondur=$prod_params['new_missiondur_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t$new_tempolength=$prod_params['new_tempolength_'.$mission_id][0];\n\t\t\t\t\t\t\t\t\t//update quote mission table with above details\n\t\t\t\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\t\t$updateQuoteMission['mission_length']=$mission_length;\n\t\t\t\t\t\t\t\t\t$updateQuoteMission['mission_length_option']=$mission_length_option;\n\t\t\t\t\t\t\t\t\t//if($volume) $updateQuoteMission['volume']=$volume;\n\t\t\t\t\t\t\t\t\tif($volume_max) $updateQuoteMission['volume_max']=$volume_max;\n\t\t\t\t\t\t\t\t\tif($delivery_volume_option) $updateQuoteMission['delivery_volume_option']=$delivery_volume_option;\n\t\t\t\t\t\t\t\t\tif($tempo)$updateQuoteMission['tempo']=$tempo;\n\t\t\t\t\t\t\t\t\tif($tempo_length)$updateQuoteMission['tempo_length']=$tempo_length;\n\t\t\t\t\t\t\t\t\tif($tempo_length_option)$updateQuoteMission['tempo_length_option']=$tempo_length_option;\n\t\t\t\t\t\t\t\t\t//newduration volume\n\t\t\t\t\t\t\t\t\tif($new_missiondur && $new_tempolength)$updateQuoteMission['mission_length_new']=$new_missiondur.','.$new_tempolength;\n\t\t\t\t\t\t\t\t\t$updateQuoteMission['staff_time']=$staff_time;\n\t\t\t\t\t\t\t\t\t$updateQuoteMission['staff_time_option']=$staff_time_option;\n\t\t\t\t\t\t\t\t\t$quoteMissionObj->updateQuoteMission($updateQuoteMission,$mission_id);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($updateQuoteMission);exit;\n\t\t\t\t\t\t\t\t/*End*/\t\n\t\t\t\t\t\t\t\t$pdelivery_time=$mission_length;\n\t\t\t\t\t \t\t$pdelivery_option=$mission_length_option;\t\t\t\t\t\t\n\t\t\t\t\t \t\t$prod_comments=isodec($prod_params['prodcomments_'.$mission_id][$pkey]);\n\t\t\t\t\t \t\t$product=$prod_params['prod_product_'.$mission_id][$pkey];\n\n\t\t\t\t\t \t\t//new fields added\n\t\t\t\t\t \t\t$pdelivery_volume=$volume_max ? $volume_max : ($volume ? $volume : 0);\n\t\t\t\t\t \t\t$pdelivery_volume_option=$delivery_volume_option ? $delivery_volume_option : 'within' ;\n\t\t\t\t\t \t\t$pdelivery_volume_time=$tempo_length ? $tempo_length : $mission_length;\n\t\t\t\t\t \t\t$pdelivery_volume_time_option=$tempo_length_option ? $tempo_length_option : $mission_length_option;\n\n\t\t\t\t\t \t\t//if($pdelivery_time && $staff && $staff_time)\n\t\t\t\t\t \t\t//{\n\t\t\t\t\t \t\t\t$prod_mission_obj=new Ep_Quote_ProdMissions();\n\n\t\t\t\t\t \t\t\t$prod_mission_data['quote_mission_id']=$mission_id;\n\t\t\t\t\t \t\t\t$prod_mission_data['product']=$product;\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t \t\t\t$prod_mission_data['delivery_time']=$pdelivery_time;\n\t\t\t\t\t \t\t\t$prod_mission_data['delivery_option']=$pdelivery_option;\n\t\t\t\t\t \t\t\t$prod_mission_data['staff']=$staff;\n\t\t\t\t\t \t\t\t$prod_mission_data['staff_time']=$staff_time;\n\t\t\t\t\t \t\t\t$prod_mission_data['staff_time_option']=$staff_time_option;\n\t\t\t\t\t \t\t\t$prod_mission_data['cost']=$pcost;\n\t\t\t\t\t \t\t\t$prod_mission_data['currency']=$prod_params['currency'];\n\t\t\t\t\t \t\t\t$prod_mission_data['comments']=$prod_comments;\n\t\t\t\t\t \t\t\t$prod_mission_data['created_by']=$this->adminLogin->userId;\n\t\t\t\t\t \t\t\t$prod_mission_data['version']\t= $version;\n\n\t\t\t\t\t \t\t\t//new fields added\n\t\t\t\t\t \t\t\t$prod_mission_data['delivery_volume']\t= $pdelivery_volume;\n\t\t\t\t\t \t\t\t$prod_mission_data['delivery_volume_option']\t= $pdelivery_volume_option;\n\t\t\t\t\t \t\t\t$prod_mission_data['delivery_volume_time']\t= $pdelivery_volume_time;\n\t\t\t\t\t \t\t\t$prod_mission_data['delivery_volume_time_option']=$pdelivery_volume_time_option;\n\n\t\t\t\t\t \t\t\t//echo \"<pre>\";print_r($prod_mission_obj);\n\n\t\t\t\t\t \t\t\t$prod_mission_id=$prod_params['prod_mission_id_'.$mission_id][$pkey];\n\n\t\t\t\t\t \t\t\tif($prod_mission_id)\n\t\t\t\t\t \t\t\t{\n\t\t\t\t\t \t\t\t\t$prod_mission_data['updated_at']=date('Y-m-d H:i:s');\n\t\t\t\t\t \t\t\t\t$prod_mission_obj->updateProdMission($prod_mission_data,$prod_mission_id);\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse\n\t\t\t\t\t \t\t\t{\n\t\t\t\t\t \t\t\t\t$prod_mission_obj->insertProdMission($prod_mission_data);\t\n\t\t\t\t\t \t\t\t}\n\n\t\t\t\t\t \t\t\t//\n\t\t\t\t\t \t\t\t$package=$prod_params['package_'.$mission_id];\n\t\t\t\t\t\t \t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t \t\t$updateQuoteMission['package']=$package;\n\t\t\t\t\t\t \t\tif($package=='lead')\n\t\t\t\t\t\t \t\t\t \t$updateQuoteMission['margin_percentage']=60;\n\t\t\t\t\t\t \t\telseif($package=='link')\n\t\t\t\t\t\t \t\t\t \t$updateQuoteMission['margin_percentage']=30;\n\t\t\t\t\t\t \t\telseif($package=='team')\n\t\t\t\t\t\t \t\t\t \t$updateQuoteMission['margin_percentage']=50;\n\t\t\t\t\t\t \t\t\t \t\t \n\t\t\t\t\t\t \t\t$quoteMissionObj->updateQuoteMission($updateQuoteMission,$mission_id);\n\n\t\t\t\t\t \t\t\t\n\t\t\t\t\t \t\t\t\n\t\t\t\t\t \t\t//}\n\n\t\t\t\t\t \t}\t\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\t\t$quote_obj=new Ep_Quote_Quotes();\t\n\t\t\t\t\t\tif(isset($prod_params['review_validate']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$update_quote_prod['prod_review']=$status;\n\t\t\t\t\t\t\t$update_quote_prod[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\n\t\t\t\t\t\t\t$quote_obj->updateQuote($update_quote_prod,$quote_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($prod_params['prod_extra_info'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$update_quote_prod = array();\n\t\t\t\t\t\t\t$update_quote_prod['prod_extra_info']=$prod_params['prod_extra_info'];\n\t\t\t\t\t\t\tif($prod_params['prod_extra_info']=='yes')\n\t\t\t\t\t\t\t$update_quote_prod[\"prod_extra_comments\"] = $prod_params['prod_extra_comments'];\t\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$update_quote_prod[\"prod_extra_comments\"] = NULL;\n\t\t\t\t\t\t\t$quote_obj->updateQuote($update_quote_prod,$quote_id);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($status=='challenged')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$log_params['action']= 'prod_saved';\n\t\t\t\t\t\t\t$quiteActionId=4;\t\n\n\t\t\t\t\t\t\tif($prod_params['quote_updated_comments'])\n\t\t\t\t\t\t\t\t$log_params['comments']=$prod_params['quote_updated_comments'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\t\t\t\t$log_obj->insertLog($quiteActionId,$log_params);\n\n\t\t\t\t\t\t\t$this->_redirect(\"/quote/prod-quote-review?quote_id=\".$quote_id);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($status=='validated')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\t\t\t\t\t\t\tif($quoteDetails[0]['prod_timeline']>0)\n\t\t\t\t\t\t\t\t$prod_time_line=$quoteDetails[0]['prod_timeline'];\n\n\t\t\t\t\t\t\tif($prod_time_line>time())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$log_params['action']= 'prod_validated_ontime';\n\t\t\t\t\t\t\t\t$quiteActionId=5;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$delay_hours=dateDiffHours($prod_time_line,time());\n\n\t\t\t\t\t\t\t\t$log_params['action']= 'prod_validated_delay';\n\t\t\t\t\t\t\t\t$log_params['delay_hours']=$delay_hours;\n\t\t\t\t\t\t\t\t$quiteActionId=6;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($prod_params['quote_updated_comments'])\n\t\t\t\t\t\t\t\t$log_params['comments']=$prod_params['quote_updated_comments'];\n\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($log_params);exit;\n\n\t\t\t\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\t\t\t\t$log_obj->insertLog($quiteActionId,$log_params);\n\n\t\t\t\t\t\t\t//sending email to sales user\n\t\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t$receiver_id=$quoteDetails[0]['quote_by'];\n\t\t\t\t\t\t\t$mail_parameters['sales_user']=$quoteDetails[0]['quote_by'];\n\t\t\t\t\t\t\t$mail_parameters['bo_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t\t$mail_parameters['bo_user_type']='prod';\n\t\t\t\t\t\t\t$mail_parameters['quote_title']=$quoteDetails[0]['title'];\n\t\t\t\t\t\t\t$mail_parameters['followup_link']='/quote/quote-followup?quote_id='.$quoteDetails[0]['identifier'];\n\t\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,134,$mail_parameters);\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//sending intimation emails when quote edited\n\t\t\t\t $update_comments= $prod_params['quote_updated_comments'];\n\t\t\t\t if($update_comments)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$bo_user_type='prod';\t\t\t\t\n\t\t\t\t\t\t\t\t$this->sendIntimationEmail($quote_id,$bo_user_type,$update_comments,$newmissionAdded);\n\t\t\t\t\t\t\t\t//exit;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//head sales notify email in sales final stage\n\t\t\t\t\t\t\t$email_head_sale=array('139281941421499'=>'mfouris@edit-place.com'); // need add thaibault\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(count($email_head_sale)>0){\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tforeach($email_head_sale as $user=>$emails){\n\t\t\t\t\t\t\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t\t\t\t\t\t\t$headmail_parameters['bo_user']=$user;\n\t\t\t\t\t\t\t\t\t\t\t\t$headmail_parameters['sales_user']=$quoteDetails[0]['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t$headmail_parameters['turn_over']=$quoteDetails[0]['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t$headmail_parameters['client_name']=$quoteDetails[0]['company_name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$headmail_parameters['followup_link']='/quote/quote-followup?quote_id='.$quoteDetails[0]['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t$headmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t\t\t\t\t\t$headmail_obj->sendQuotePersonalEmail($receiver_id,205,$headmail_parameters);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2\");\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\t\t\n\t}",
"public function add_new() {\n $this->checkteam();\n\n if (!empty($this->data)) {\n\n $flag = 0;\n\n\n\n if ($this->data['Product']['productname'] == '') {\n $flag = 1;\n $this->set('fullname_error', 'Product Name cannot be empty!');\n }\n\n if (!$flag) {\n\n extract($this->data['Product']);\n\n $this->Product->create();\n $newproduct['Product']['name'] = $productname;\n $newproduct['Product']['description'] = $description;\n $newproduct['Product']['category_id'] = $categoris_list;\n $newproduct['Product']['auto_select'] = $auto_select;\n\n if ($this->Product->save($newproduct)) {\n $newproductid = $this->Product->getInsertID();\n\n if ((!empty($productimage)) && ($productimage[\"size\"] / 1024 > 2048)) {\n $flag = 1;\n $this->set('filename_error', 'Product picture cannot exceed 2Mb!');\n } else {\n\n if ((!empty($productimage[\"name\"])) && (!empty($productimage[\"tmp_name\"]))) {\n\n $ext = $this->file_extension($productimage[\"name\"]);\n $file_path = WWW_ROOT . \"img\" . DS . \"products\" . DS;\n $thumb_path = WWW_ROOT . \"img\" . DS . \"product_thumbs\" . DS;\n $file_name = substr(rand(), 1, 4) . str_replace(\" \", \"_\", $productimage[\"name\"]);\n move_uploaded_file($productimage[\"tmp_name\"], $file_path . $file_name);\n $this->gd_thumbnail($file_path . $file_name, $thumb_path . $file_name, $ext, false);\n\n $newimage['Image']['product_id'] = $newproductid;\n $newimage['Image']['name'] = $file_name;\n $newimage['Image']['position'] = 'main';\n\n $this->Image->create();\n $this->Image->save($newimage);\n }\n }\n\n $this->Session->setFlash(__('The Product has been added successfully!', true));\n $this->redirect(array('controller' => 'products', 'action' => '/'));\n } else {\n $this->Session->setFlash(__('Add New Product faild!', true));\n }\n }\n }\n $data_dd_select = $this->Category->generateTreeList(null, null, null, '___');\n $this->set('data_dd_select', $data_dd_select);\n }",
"static function addReview($bookingId, $hotelId, $rating, $comment)\n {\n $db = DB::getConnection();\n try {\n $st = $db->prepare('INSERT INTO projekt_reviews(id_booking, id_user, name_user, id_hotel, name_hotel, rating, comment) VALUES (:id_booking, :id_user, :name_user, :id_hotel, :name_hotel, :rating, :comment)');\n $st->execute(array('id_booking' => $bookingId, 'id_user' => $_SESSION['user']->getId(), 'name_user' => $_SESSION['user']->getName(), 'id_hotel' => $hotelId, 'name_hotel' => Hotel::find($hotelId)->getName(), 'rating' => $rating, 'comment' => $comment));\n } catch (PDOException $e) {\n exit(\"PDO error [insert projekt_users]: \" . $e->getMessage());\n }\n try {\n echo $rating;\n $st = $db->prepare('UPDATE projekt_hotels SET rating = (rating * number_of_comments + :rating)/(number_of_comments + 1), number_of_comments = number_of_comments + 1 WHERE id = :id_hotel');\n $st->execute(array('id_hotel' => $hotelId, 'rating' => $rating));\n } catch (PDOException $e) {\n exit(\"PDO error [UPDATE projekt_hotels]: \" . $e->getMessage());\n }\n }",
"public function show(ProductReview $productReview)\n {\n //\n }",
"public function show(ProductReview $productReview)\n {\n //\n }",
"public function storeProduct();",
"public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"function add_product($product){\n \t\tif($this->db->insert('products', $product)){\n \t\t\treturn true;\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}",
"public function store(ProductRequest $request)\n {\n $this->objProduct->create([\n 'produto'=>$request->produto,\n 'preco'=>$request->preco,\n 'id_user'=>$request->id_user\n ]);\n }",
"public function modAdd() {\n\n $film = Input::get('film');\n $user = Input::get('user');\n $review = Input::get('review');\n $vote = Input::get('vote');\n\t\t\n\t\t$check = DB::table('film_review')\n\t\t\t\t\t->where('fr_usr_id', $user)\n\t\t\t\t\t->where('fr_fl_id', $film)\n\t\t\t\t\t->first();\n\n\t\tif ($check) {\n\t\t\n\t\t} else {\n\t if (!$review == \"\") {\n\t\t\t\t// inserts the review\n\t\t\t\t$rev = new Review; // revie instance\n\t\t\t\t$rev->fr_fl_id = $film;\n\t\t\t\t$rev->fr_usr_id = $user;\n\t\t\t\t$rev->fr_review = $review;\n\t\t\t\t$rev->fr_vote = $vote;\n\t\t\t\t$rev->fr_date = \\time();\n\t\t\t\t$rev->save(); // saves review\n\t\t\t\t// insert a new user actions\n\t\t\t\t$act = new Activity; // notification instance\n\t\t\t\t$act->type_id = '2'; // activity type 2 for review\n\t\t\t\t$act->subject_id = $user; // id of the user\n\t\t\t\t$act->object_type = 'film'; // type of object \n\t\t\t\t$act->object_id = $film; // id of the object\n\t\t\t\t$act->action_date = \\time(); // time of the activity \n\t\t\t\t$act->save(); // saves activity \n\t\t\t}\t\t\n\t\t}\n\n // gets the review details from the given id\n $latest = DB::table('film_review')\n ->where('fr_usr_id', $user)\n ->orderBy('fr_id', 'desc')\n ->first();\n\n $user = user::find($user);\n\n return view('reviews.add', compact('latest', 'user'));\n }",
"public function create()\n {\n $products = Product::all();\n return view(\"reviews.reviewscreate\", [\n \"products\" => $products,\n ]);\n }",
"public function add() {\n $film = Input::get('film');\n $user = Input::get('user');\n $review = Input::get('review');\n $vote = Input::get('vote');\n $fbshare = Input::get('fbshare');\n\n $check = $this->reviewCheck($film);\n\n if ($check) {\n \n } else if (!$review == \"\") {\n // inserts the review\n $rev = new Review; // revie instance\n $rev->fr_fl_id = $film;\n $rev->fr_usr_id = Auth::user()->id;\n $rev->fr_review = $review;\n $rev->fr_vote = $vote;\n $rev->fr_date = \\time();\n $rev->save(); // saves review\n // insert a new user actions\n $act = new Activity; // notification instance\n $act->type_id = '2'; // activity type 2 for review\n $act->subject_id = Auth::user()->id; // id of the user\n $act->object_type = 'film'; // type of object\n $act->object_id = $film; // id of the object\n $act->action_date = \\time(); // time of the activity\n $act->save(); // saves activity\n //Deleting the rating action\n\n $delete = $this->deleteRatingAction($film);\n\n // Sending mails to all followers \n // Film id & review JSON\n $this->newReviewMail($film, $rev);\n\n //posts on fb if access token avaiable\n if($fbshare) {\n if (Auth::user()->fb_access_token) {\n $fb = new FacebookController();\n $execute = $fb->postFbReview($film, $review, $vote, Auth::user()->fb_uid, Auth::user()->fb_access_token, $fbshare);\n }\n }\n }\n\n\n // gets the review details from the given id\n $latest = DB::table('film_review')\n ->where('fr_usr_id', Auth::user()->id)\n ->orderBy('fr_id', 'desc')\n ->first();\n\n $user = User::find(Auth::user()->id);\n\n return view('reviews.add', compact('latest', 'user'));\n }",
"public function add_product() {\n\t\t$values=array(\"product_name\"=>$_POST['product_name'],\"description\"=>$_POST['description']);\n\t\tif($this->insert(\"products\",$values)) {\t\t\t\n\t\t\t$result=$this->runQuery('getAll','select max(id) as id from products');\n\t\t\techo json_encode($result);\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting product tbl';\n\t}",
"public function giveRestaurantReview($restaurant_id,$customer_id,$rating,$review){\n $query=$this->db->query(\"INSERT INTO reviews(restaurant_id,customer_id,rating,review,date_added) VALUES(\".$restaurant_id.\",\".$customer_id.\",\".$rating.\",'\".$review.\"',CURDATE())\");\n if($query){\n return array(\"status\"=>\"success\");\n }\n else{\n return array(\"status\"=>\"fail\",\"error\"=>\"Unable to Give Review.\");\n }\n }",
"public function add($product_id)\n {\n $product = Product::find($product_id);\n if(!$product)\n {\n abort(404);\n }\n Cart::associate('Product','App\\Models')->add($product_id, $product->name, 1, $product->price);\n return redirect()->route('cart.index');\n }",
"public function actionCreate()\n\t{ \n\t\t$this->render('review_create');\n\t}",
"function addReview($param, $sqlConnection)\r\n{\r\n $uid = intval($param['userID']);\r\n $aid = intval($param['albumID']);\r\n $sqlSuccess = get_sql_results($result, $sqlConnection,\r\n \"INSERT INTO Reviews (userID, albumID, review) \".\r\n \"VALUES ($uid,$aid,'{$param['review']}')\");\r\n return $sqlSuccess;\r\n}",
"public function create(Productquestion $productquestion)\n {\n //\n }",
"public function saveProductCategories(Product $product, ProductRequest $request): void;",
"public function create(Product $product)\n {\n \n }",
"public function create()\n {\n return view('admin.review.create',\n [\n 'products'=>Product::query()->get()\n\n ]);\n }",
"public function store(Request $request)\n {\n $rating = new Rating();\n if(!empty($request->product_rating)){\n $rating->user_id = $request->user_id;\n $rating->service_id = $request->service_id;\n $rating->stars_rated = $request->product_rating;\n $rating->save();\n return redirect()->route('dashboard');\n }\n else{\n return redirect()->route('dashboard');\n }\n\n }",
"public function insertProduct($data)\n {\n $this->db->insert('produits', $data);\n }",
"public function addReviewByStudent()\n {\n /* code goes here */\n }",
"public function store()\n {\n $this->product->name = $_POST['name'];\n $this->product->price = $_POST['price'];\n $this->product->description = $_POST['description'];\n $this->product->category_id = $_POST['category_id'];\n\n // create the product\n if($this->product->create()){\n echo \"<div class=\\\"alert alert-success alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">×</button>\";\n echo \"Product was created.\";\n echo \"</div>\";\n }\n\n // if unable to create the product, tell the user\n else{\n echo \"<div class=\\\"alert alert-danger alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">×</button>\";\n echo \"Unable to create product.\";\n echo \"</div>\";\n }\n }",
"public function addAction()\n {\n\n $this->view->headTitle()->prepend('Add Product');\n\n $this->_helper->viewRenderer->setRender('form');\n\n $request = $this->getRequest();\n\n $form = new Application_Form_Product();\n \n if ($request->isPost()) {\n if ($form->isValid($request->getPost())) {\n\n $this->loadModel('product');\n $this->modelProduct->insert($form->getValues());\n\n $this->view->success = true;\n $this->view->productName = $form->getValues()['name'];\n $this->view->actionPerformed = 'added';\n $form->reset();\n }\n }\n \n $this->view->form = $form;\n }",
"public function store(Product $product)\n { \n Cart::add($product->id, $product->name , 1, $product->price)\n ->associate('App\\Product');\n return redirect()->route('cart.index')->with('success_message', 'Item was added to your cart!');\n \n }",
"function add() {\n\t\tif (True) {\n\n\t\t\t// create an empty product.\n\t\t\t$o =& new ufo_product(0);\n\t\t\t$this->addedObject =& $o;\n\t\t\n\t\t\t// create an entry in the db.\n\t\t\t$o->initialize();\n\t\t\t$o->create();\n\t\t\t$o->edit();\n\n\t\t\t// add it to the product array.\n\t\t\t$this->product[] = $o;\n\t\t}\n\t}",
"public function creating(Product $product)\n {\n $product->user_id = auth()->id();\n }",
"public function newAction(Request $request)\n {\n\n $em = $this->getDoctrine()->getManager();\n\n $product = new Product();\n $form = $this->createForm('LilWorks\\StoreBundle\\Form\\ProductType', $product);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n\n foreach ($product->getPictures() as $pictureFromForm) {\n $pictureFromForm->setProduct($product);\n $em->persist($pictureFromForm);\n }\n\n\n\n if($product->getDocfiles() && count($product->getDocfiles() )>0){\n foreach ($product->getDocfiles() as $docfile) {\n $docfile->addProduct($product);\n $em->persist($docfile);\n }\n }\n\n if($product->getTags() && count($product->getTags() )>0){\n foreach ($product->getTags() as $tag) {\n $tag->addProduct($product);\n $em->persist($tag);\n }\n }\n\n $em->persist($product);\n $em->flush();\n\n return $this->redirectToRoute('product_show', array('product_id' => $product->getId()));\n }\n\n $this->get('store.setSeo')->setTitle('storebundle.title.new',array(),'storebundle.prefix.products');\n\n return $this->render('LilWorksStoreBundle:Product:new.html.twig', array(\n 'product' => $product,\n 'form' => $form->createView(),\n ));\n }",
"public function create($id)\n {\n $productone = Product::find($id);\n return view('products.create_review_form')->with('products', Product::all())->with('productone', $productone);\n }",
"public function store(Product $product, Request $request)\n {\n $this->validate($request, [\n 'lense_id' => 'required',\n 'addmore.*.mirror_id' => 'required',\n 'addmore.*.price' => 'required'\n ]);\n\n $prod_var = Productvariant::create([\n 'product_id' => $product->id,\n 'lense_id' => $request->lense_id,\n ]);\n\n foreach ($request->addmore as $key => $value) {\n Productmirrors::create([\n 'prod_var' => $prod_var->id,\n 'mirror_id' => $value['mirror_id'],\n 'price' => $value['price']\n ]);\n }\n\n return redirect(route('admin.productvariant.index', $product->id));\n }",
"public function store(Request $request)\n {\n $review = new review;\n \n $review->review = $request->review;\n $review->rating = $request->rating;\n $review->tempat_wisata_id =$request->tempat_wisata_id;\n $review->user_id= $request->user_id;\n\n if( $review->save()){\n return $this->responseOk(null, 200, 'Data has been created');\n }else{\n return $this->responseError('Data Failed to create', 400);\n }\n }",
"public function addOne($product){\n\t\t$this->db->insert('products', $product);\n\t\treturn $this->db->insert_id();\n\t}",
"public function store(Request $request, Productquestion $productquestion)\n {\n\n Answer::query()->create([\n 'productquestion_id' => $productquestion->id,\n 'user_id' => auth()->id(),\n 'title' => $request->get('title')\n ]);\n\n return redirect()->back();\n }",
"public function store(Request $request)\n {\n $reviewInfo = $request->validate (\n [\n 'name' => 'required|min:1',\n 'email' => 'required|unique:reviews|min:1',\n 'star' => 'required',\n 'message' => 'required|min:1'\n ]\n );\n // dd($reviewInfo);\n // $review = new Review();\n // $review->name = $reviewInfo['name'];\n // $review->email = $reviewInfo['email'];\n // $review->message = $reviewInfo['message'];\n // $review->star = $reviewInfo['star'];\n // $review->save();\n\n $newReview = Review::create($reviewInfo);\n\n $newReview->save();\n\n return redirect()->route('review.details', ['id'=>$newReview->id]);\n }",
"function db_add_review($art_id, $user_id, $stars, $message)\n{\n $mysqli = db_connect();\n $sql = \"INSERT INTO review (fk_article_id, fk_user_id, stars, message) VALUES (?,?,?,?)\";\n $con = $mysqli->prepare($sql);\n $con->bind_param(\"iiis\", $art_id, $user_id, $stars, $message);\n if ($con->execute() == TRUE) {\n return TRUE;\n } else {\n return FALSE;\n }\n}",
"public function addProduct($post)\r\n\t{\r\n\t\t\r\n\t\t$this->db->insert('tbl_product', $post);\r\n\t\t$this->result = $this->db->insert_id() ; \r\n\t\treturn $this->result ;\r\n\t}",
"public function actionAddToWishlist($product_id, $user_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('wishlist', $saveArr)->execute();\n exit;\n }"
]
| [
"0.72635424",
"0.7174329",
"0.70919883",
"0.69771445",
"0.6910325",
"0.6903998",
"0.6824345",
"0.6822347",
"0.6809157",
"0.6729745",
"0.6624736",
"0.6622081",
"0.66059095",
"0.65823764",
"0.6526579",
"0.6493911",
"0.64712554",
"0.64680827",
"0.6461103",
"0.64529514",
"0.6393388",
"0.6370557",
"0.6357002",
"0.6337957",
"0.6322399",
"0.6322399",
"0.63016284",
"0.62431824",
"0.62372774",
"0.62176067",
"0.62031925",
"0.62031925",
"0.6195173",
"0.61932313",
"0.6143354",
"0.6114897",
"0.6114645",
"0.6108363",
"0.61058825",
"0.60863954",
"0.607424",
"0.6072333",
"0.6071693",
"0.60706466",
"0.606905",
"0.6066454",
"0.60655147",
"0.6058232",
"0.6054864",
"0.6045929",
"0.60458785",
"0.6035327",
"0.6031376",
"0.6023141",
"0.6022017",
"0.60150546",
"0.6014007",
"0.5994323",
"0.5988601",
"0.59875536",
"0.59856343",
"0.59784",
"0.5971201",
"0.59649813",
"0.59610265",
"0.59610265",
"0.5959377",
"0.59485245",
"0.59432065",
"0.5942545",
"0.59403485",
"0.59398943",
"0.5935104",
"0.59350157",
"0.5929267",
"0.5927529",
"0.59222543",
"0.5921761",
"0.5912781",
"0.59097135",
"0.5905337",
"0.59047997",
"0.59046054",
"0.59020454",
"0.59012616",
"0.5896592",
"0.5890479",
"0.58884907",
"0.58816814",
"0.5881047",
"0.5876295",
"0.5862154",
"0.5860285",
"0.5859397",
"0.5857361",
"0.5833171",
"0.5824598",
"0.58225787",
"0.58192855",
"0.581735"
]
| 0.6992798 | 3 |
checks if a user has previously ordered a product | function userHasPurchashedProduct ($productID) {
//if user is logged in
if (checkLogin()) {
$userid = getUserID();
//get the times this user has purchased this product
$sql = "SELECT * FROM orders o join orderlines ol ON o.OrderID = ol.OrderID WHERE ol.StockItemID = $productID AND o.CustomerID = $userid";
//execute the query
$stmt = runQuery($sql);
//check if this user has purchased the product 1 or more times
if ($stmt->rowCount() > 0) {
//if so return true
return true;
}
}
//return false by default
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getAlreadyPurchasedProduct()\n {\n // If is Guest then hide the review form\n if (!$this->getCustomerId()) {\n return false;\n }\n try {\n $product = $this->getProductInfo();\n $orders = $this->getCustomerOrders();\n foreach ($orders as $order) {\n // Get all visible items in the order\n /** @var $items \\Magento\\Sales\\Api\\Data\\OrderItemInterface[] **/\n $items = $order->getAllVisibleItems();\n // Loop all items\n foreach ($items as $item) {\n // Check whether the current product exist in the order.\n if ($item->getProductId() == $product->getId()) {\n return true;\n }\n }\n }\n return false;\n } catch (\\Exception $e) {\n return false;\n }\n }",
"public function restore(User $user, Product $product)\n {\n return $user->client_id === $product->client_id;\n }",
"public static function hasUserPurchasedProduct( \\Users\\Models\\Users $user, \\Shop\\Models\\Products $product )\r\n\t{\r\n\t\t$model = (new \\Shop\\Models\\Orders)\r\n\t\t->setState('filter.user', $user->id)\r\n\t\t->setState('filter.product_id', $product->id)\r\n\t\t->setState('filter.status_excludes', \\Shop\\Constants\\OrderStatus::cancelled)\r\n\t\t->setState('filter.financial_status', array( \\Shop\\Constants\\OrderFinancialStatus::paid, \\Shop\\Constants\\OrderFinancialStatus::authorized, \\Shop\\Constants\\OrderFinancialStatus::pending ) );\r\n\r\n\t\tif ($model->getCount() > 0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}",
"function check_product_in_the_cart($product){\n if (auth()->check()){\n $cart = Cart::where('user_id', auth()->user()->id)->where('product_id', $product->id)->first();\n }else{\n if(session()->has('carts')){\n $cart = key_exists($product->uuid, session('carts'));\n }else{\n $cart = false;\n }\n }\n\n if ($cart){\n return true;\n }else{\n return false;\n }\n}",
"private function product() {\n if ($this->is_logged_in()){\n return true; //check if user had been logged in!!!\n }else{\n exit;\n }\n }",
"public function isProductNotAlreadyInTheCart($order_id,$product_id){\n $model = new OrderHasProducts;\n return $model->isProductNotAlreadyInTheCart($order_id,$product_id);\n }",
"public function isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted){\n \n $model = new OrderHasProducts;\n return $model->isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted);\n }",
"abstract function has_purchased_before();",
"function carton_customer_bought_product( $customer_email, $user_id, $product_id ) {\n\tglobal $wpdb;\n\n\t$emails = array();\n\n\tif ( $user_id ) {\n\t\t$user = get_user_by( 'id', $user_id );\n\t\t$emails[] = $user->user_email;\n\t}\n\n\tif ( is_email( $customer_email ) )\n\t\t$emails[] = $customer_email;\n\n\tif ( sizeof( $emails ) == 0 )\n\t\treturn false;\n\n\treturn $wpdb->get_var( $wpdb->prepare( \"\n\t\tSELECT COUNT( order_items.order_item_id )\n\t\tFROM {$wpdb->prefix}carton_order_items as order_items\n\t\tLEFT JOIN {$wpdb->prefix}carton_order_itemmeta AS itemmeta ON order_items.order_item_id = itemmeta.order_item_id\n\t\tLEFT JOIN {$wpdb->postmeta} AS postmeta ON order_items.order_id = postmeta.post_id\n\t\tLEFT JOIN {$wpdb->term_relationships} AS rel ON postmeta.post_id = rel.object_ID\n\t\tLEFT JOIN {$wpdb->term_taxonomy} AS tax USING( term_taxonomy_id )\n\t\tLEFT JOIN {$wpdb->terms} AS term USING( term_id )\n\t\tWHERE \tterm.slug IN ('\" . implode( \"','\", apply_filters( 'carton_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . \"')\n\t\tAND \ttax.taxonomy\t\t= 'shop_order_status'\n\t\tAND\t\t(\n\t\t\t\t\t(\n\t\t\t\t\t\titemmeta.meta_key = '_variation_id'\n\t\t\t\t\t\tAND itemmeta.meta_value = %s\n\t\t\t\t\t) OR (\n\t\t\t\t\t\titemmeta.meta_key = '_product_id'\n\t\t\t\t\t\tAND itemmeta.meta_value = %s\n\t\t\t\t\t)\n\t\t)\n\t\tAND \t(\n\t\t\t\t\t(\n\t\t\t\t\t\tpostmeta.meta_key = '_billing_email'\n\t\t\t\t\t\tAND postmeta.meta_value IN ( '\" . implode( \"','\", array_unique( $emails ) ) . \"' )\n\t\t\t\t\t) OR (\n\t\t\t\t\t\tpostmeta.meta_key = '_customer_user'\n\t\t\t\t\t\tAND postmeta.meta_value = %s AND postmeta.meta_value > 0\n\t\t\t\t\t)\n\t\t\t\t)\n\t\", $product_id, $product_id, $user_id ) );\n}",
"public function isProposition()\n {\n $u = $this->user()->first();\n\n return auth()->user()->id != $u->id;\n }",
"private function getExistProductRecount() {\n return false;\n }",
"public function user_has_access_to_product( $user_id, $product_id ) {\n\n if ( $user_id == get_current_user_id() && current_user_can( 'edit_users' ) )\n return true;\n\n $user_has_access = apply_filters( 'yith_wcmbs_user_has_access_to_product', false, $user_id, $product_id );\n if ( $user_has_access )\n return true;\n\n $product_plans = $this->product_is_in_plans( $product_id );\n\n $delay = get_post_meta( $product_id, '_yith_wcmbs_plan_delay', true );\n $member = YITH_WCMBS_Members()->get_member( $user_id );\n\n $user_plans = $member->get_membership_plans( array( 'return' => 'complete' ) );\n\n foreach ( $user_plans as $membership ) {\n $plan_ids = array_intersect( array_merge( array( $membership->plan_id ), $membership->get_linked_plans() ), $product_plans );\n if ( !empty( $plan_ids ) ) {\n\n $start_date = $membership->start_date + ( $membership->paused_days * 60 * 60 * 24 );\n if ( !empty( $delay ) ) {\n if ( !isset( $delay[ $membership->plan_id ] ) ) {\n $linked = $membership->get_linked_plans();\n $min_delay_time = 0;\n $first = true;\n foreach ( $linked as $plan_id ) {\n if ( isset( $delay[ $plan_id ] ) ) {\n if ( $first ) {\n $min_delay_time = $delay[ $plan_id ];\n $first = false;\n } else {\n if ( $delay[ $plan_id ] < $min_delay_time ) {\n $min_delay_time = $delay[ $plan_id ];\n }\n }\n }\n }\n\n if ( $min_delay_time > 0 ) {\n if ( strtotime( '+' . $min_delay_time . ' days midnight', $start_date ) <= strtotime( 'midnight' ) ) {\n return true;\n }\n } else {\n return true;\n }\n } else {\n if ( $delay[ $membership->plan_id ] < 1 || strtotime( '+' . $delay[ $membership->plan_id ] . ' days midnight', $start_date ) <= strtotime( 'midnight' ) ) {\n return true;\n }\n }\n } else {\n return true;\n }\n }\n }\n\n return false;\n // VECCHIO codice -------------------------------------------------\n $user_plans = $member->get_membership_plans( array( 'return' => 'id_date', 'include_linked' => true ) );\n\n if ( !empty( $user_plans ) ) {\n foreach ( $user_plans as $plan ) {\n if ( in_array( $plan[ 'id' ], $product_plans ) ) {\n if ( isset( $delay[ $plan[ 'id' ] ] ) ) {\n $delay_days = $delay[ $plan[ 'id' ] ];\n\n if ( strtotime( '+' . $delay_days . ' days midnight', $plan[ 'date' ] ) <= strtotime( 'midnight' ) )\n return true;\n } else {\n return true;\n }\n }\n }\n }\n\n return false;\n }",
"function harvest_in_order( $order ) {\n\n\t$items = $order->get_items(); \n\n\tforeach ( $items as $item_id => $item ) {\n\n\t\tif ( $item->get_product_id() === 37592 ) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\n\t}\n\t\n\treturn false;\n\n}",
"public function update(User $user, Product $product)\n {\n return $user->client_id === $product->client_id;\n }",
"public function addToShoppingCart($User_Name, $Product_ID){\r\n $check = $this->DB->prepare(\"SELECT * FROM shopping_cart WHERE (User_Name = '$User_Name') AND (Product_ID = $Product_ID);\");\r\n $check->execute ();\r\n $check = $check->fetchAll (PDO::FETCH_ASSOC);\r\n\r\n if(count($check) == 0){ //If the user has not added the item to the cart previously,\r\n $stmt = $this->DB->prepare('INSERT INTO shopping_cart values(NULL, :User_Name, :Product_ID, 1)');\r\n $stmt->bindParam( 'User_Name', $User_Name );\r\n $stmt->bindParam( 'Product_ID', $Product_ID );\r\n $stmt->execute();\r\n } else {\r\n $stmt = $this->DB->prepare (\"UPDATE shopping_cart SET Product_Count = Product_Count + 1 WHERE (User_Name = :User_Name) AND (Product_ID = :Product_ID)\");\r\n $stmt->bindParam( 'User_Name', $User_Name );\r\n $stmt->bindParam( 'Product_ID', $Product_ID );\r\n $stmt->execute ();\r\n }\r\n }",
"public function check_bid_already_placed($user_id, $product_id)\n\t{\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->where('product_id', $product_id);\n\t\t$this->db->limit(1);\n\t\t$query = $this->db->get('product_bids');\n\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->row();\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function restore(User $user, Product $product)\n {\n return $user->isManager() || $user->isAdmin();\n }",
"function markPurchased($opm_productid,$accountid) {\n \n \t$this->load->model('accounts_model');\n\n\t\tif (checkPerms('can_mark_purchased',true)) {\n\n\t\t\t\n\t\t\tif ($this->accounts_model->markProductPurchased($opm_productid,$accountid)) {\n\t\t\t\t\n\t\t\t\t// fetch account name for history entry\n\t\t\t\t\n\t\t\t\t$account = $this->accounts_model->fetchAccount($accountid);\n\t\t\t\t\n\t\t\t\t$message = $account->account . \" purchased this product (entered by \" . $this->userinfo->username . \")\";\n\t\t\t\t\n\t\t\t\t$this->opm->addHistoryItem($opm_productid,$message);\n\t\t\t\t\n\t\t\t\t$this->opm->displayAlert(\"Product marked Purchased by \" . $account->account . \".\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$this->opm->displayError(\"Error saving status\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\n }",
"protected function checkProductRequirements()\n {\n $activeProductIds = $expiredProductIds = array();\n if ($this->_user) {\n $activeProductIds = $this->_user->getActiveProductIds();\n $expiredProductIds = $this->_user->getExpiredProductIds();\n }\n $error = $this->getDi()->productTable->checkRequirements($this->getProducts(), $activeProductIds, $expiredProductIds);\n return $error ? $error : null;\n }",
"public function restore(User $user, Product $checkoutProduct)\n {\n if ($user->is_admin) {\n return true;\n }\n\n return false;\n }",
"public function canStoreOrder();",
"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 canSkipOrderReviewStep()\n {\n return !$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);\n }",
"private function checkIfExistsProducts()\n {\n if (isset($_COOKIE['cart-data'])) {\n $productCookie = htmlspecialchars($_COOKIE['cart-data']);\n $products = trim($productCookie, '|');\n $products = explode('|', $products);\n foreach ($products as $product) {\n if (!Product::find($product)) {\n $productCookie = str_replace('|' . $product . '|', '|', $productCookie);\n }\n }\n setcookie('cart-data', $productCookie, time() + (86400 * 365), \"/\");\n }\n }",
"public function isOrder();",
"function on_backorder() {\n\t\treturn ($this->_item_availability->available_to_promise <= $this->backorder_quantity);\n\t}",
"public function hasPushedProducts() {\n return sizeof($this->pushedProducts) > 0;\n }",
"function pre_confirmation_check() {\n global $cartID;\n global $cart;\n \n if (empty($cart->cartID)) {\n $cartID = $cart->cartID = $cart->generate_cart_id();\n }\n \n if (! tep_session_is_registered('cartID')) {\n tep_session_register('cartID');\n }\n }",
"public function delete(User $user, Product $product)\n {\n return $user->client_id === $product->client_id;\n }",
"public function isTheUpdateOfTheEscrowStatusOfATransactionASuccess($order_id,$product_id,$is_escrowed,$is_escrow_accepted){\n \n $model = new OrderHasProducts;\n return $model->isTheUpdateOfTheEscrowStatusOfATransactionASuccess($order_id,$product_id,$is_escrowed,$is_escrow_accepted);\n }",
"public function hasOrder() {\n return $this->_has(2);\n }",
"public function is_purchased( TPM_Product $product ) {\n\n\t\t//check old licenses\n\t\t$thrive_license = get_option( 'thrive_license', array() );\n\t\tif ( in_array( 'all', $thrive_license, false ) || in_array( $product->get_tag(), $thrive_license, false ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/** @var $license TPM_License */\n\t\tforeach ( $this->get_ttw_license_instances() as $id => $license ) {\n\t\t\tif ( $license->has_tag( $product->get_tag() ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"public function enterOrder() {\n\t\t\tif ($this->order->enterOrder()) {\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 track_product_view_always() {\n\n\t\t\tglobal $post;\n\n\t\t\tif ( empty( $_COOKIE['woocommerce_recently_viewed'] ) ) { // @codingStandardsIgnoreLine.\n\t\t\t\t$viewed_products = array();\n\t\t\t} else {\n\t\t\t\t$viewed_products = wp_parse_id_list( (array) explode( '|', wp_unslash( $_COOKIE['woocommerce_recently_viewed'] ) ) ); // @codingStandardsIgnoreLine.\n\t\t\t}\n\n\t\t\t// Unset if already in viewed products list.\n\t\t\t$keys = array_flip( $viewed_products );\n\n\t\t\tif ( isset( $keys[ $post->ID ] ) ) {\n\t\t\t\tunset( $viewed_products[ $keys[ $post->ID ] ] );\n\t\t\t}\n\n\t\t\t$viewed_products[] = $post->ID;\n\n\t\t\tif ( count( $viewed_products ) > 21 ) {\n\t\t\t\tarray_shift( $viewed_products );\n\t\t\t}\n\n\t\t\t// Store for session only.\n\t\t\twc_setcookie( 'woocommerce_recently_viewed', implode( '|', $viewed_products ) );\n\n\t\t}",
"public function IsUpgraded($UserID,$Product){\n $Args = Gdn::Dispatcher()->ControllerArguments();\n if($this->RoleCheck($Product) && !(GetValue(2,$Args)=='renew' && GetValue(1,$Args)=='subscription')){\n return array('status'=>'error','errormsg'=>T('You have already upgraded to this role, and it has yet to expire'));\n }else{\n return array('status'=>'pass');\n }\n }",
"public function hasOrder()\n {\n return $this->_has('_order');\n }",
"public function getIsAllProductsPreorder()\n {\n /** @var \\Magento\\ConfigurableProduct\\Model\\Product\\Type\\Configurable $typeInstance */\n $typeInstance = $this->getProduct()->getTypeInstance();\n $elementaryProducts = $typeInstance->getUsedProducts($this->getProduct());\n $isAllProductsPreorder = true;\n foreach ($elementaryProducts as $product) {\n if (!$this->helper->getIsProductPreorder($product)) {\n $isAllProductsPreorder = false;\n break;\n }\n }\n\n return $isAllProductsPreorder;\n }",
"public function hasActiveOrders()\n {\n }",
"function is_upsell_exists( $order ) {\n\n\t\t$flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );\n\n\t\tif ( $flow_id ) {\n\n\t\t\t$navigation = false;\n\n\t\t\t$step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );\n\n\t\t\t$next_step_id = wcf()->utils->get_next_step_id( $flow_id, $step_id );\n\n\t\t\tif ( $next_step_id && wcf()->utils->check_is_offer_page( $next_step_id ) ) {\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function markCartsAdditionalProducts(Order $draftOrder): bool;",
"public function markCartsProductsAsFirst(Order $draftOrder): bool;",
"function it_exchange_abandoned_carts_is_active_shopper() {\n\t// We do not start tracking until they log in\n\tif ( ! it_exchange_get_current_customer() )\n\t\treturn false;\n\n\t// We do not start tracking until they have an item in their cart\n\t$cart_products = it_exchange_get_cart_products();\n\tif ( count( $cart_products ) < 1 )\n\t\treturn false;\n\n\t// If user is logged in and has an item in their cart, this is an active shopper\n\treturn true;\n}",
"public function ensure_keys_are_actually_active () {\n $already_active = (array)$this->get_activated_products();\n $products = $this->get_detected_products();\n if ( 0 < count( $already_active ) ) {\n foreach ( $already_active as $k => $v ) {\n //** Only look through activated plugins */\n if( !array_key_exists( $k, $products ) ) {\n continue;\n }\n $deactivate = true;\n \n if ( !empty( $already_active[ $k ][2] ) ) {\n //** Get license and activation email */\n $data = base64_decode( $already_active[ $k ][2] );\n $data = explode( '::', $data );\n $license_key = isset( $data[0] ) ? trim( $data[0] ) : '';\n $activation_email = isset( $data[1] ) ? trim( $data[1] ) : '';\n\n //** Do request */\n $response = $this->api->status( array(\n 'product_id' \t=> $already_active[ $k ][0],\n 'instance' \t\t=> $already_active[ $k ][1],\n 'email' => trim($activation_email),\n 'licence_key' => trim($license_key),\n ), false, false );\n \n //** Do not deactivate if cannot reach UD */\n if ( $response === false ) {\n continue;\n }\n if( is_array( $response ) && !empty( $response[ 'status_check' ] ) && $response[ 'status_check' ] == 'active' ) {\n $deactivate = false;\n }\n }\n if( $deactivate ) {\n $this->deactivate_product( $k, true );\n }\n }\n }\n }",
"function _check_product_in_db($product){\n if (in_array($product, $this->db)){\n // echo 'Product already in the database.';\n return True;\n }\n // echo 'Product not in the database.';\n return False;\n }",
"function wordimpress_is_conditional_product_in_cart( $product_id ) {\n //Check to see if user has product in cart\n global $woocommerce;\n \n //flag no book in cart\n $book_in_cart = false;\n \n foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {\n $_product = $values['data'];\n \n if ( in_array($_product->id, $product_id) ) {\n //book is in cart!\n $book_in_cart = true;\n \n }\n }\n \n return $book_in_cart;\n \n}",
"public static function hasAddedProduct( $product_id, $user_id )\r\n {\r\n if (empty($user_id)) {\r\n return false;\r\n }\r\n \r\n return (new static)->collection()->count( array(\r\n 'items.product_id' => $product_id,\r\n 'user_id' => new \\MongoId( (string) $user_id )\r\n ) );\r\n }",
"function check_if_added_to_cart($item_id) {\n $user_id = $_SESSION['user_id']; //We'll get the user_id from the session\n $con= mysqli_connect(\"localhost\",\"root\",\"\",\"intern\",\"3309\") or die(mysqli_error($con));\n // connecting to the database\n // We will select all the entries from the user_items table where the item_id is equal to the item_id we passed to this function, user_id is equal to the user_id in the session and status is 'Added to cart'\n \n $query = \"SELECT * FROM users_items WHERE item_id='$item_id' AND user_id ='$user_id' and status='Added to cart'\";\n $result = mysqli_query($con, $query) or die(mysqli_error($con));\n \n// We'll check if the no.of rows in the result and no.of rows returned by the mysqli_num_rows($result) is true. If yes then it return 0 else it returns 0\n if (mysqli_num_rows($result) >= 1) {\n return 1;\n } else {\n return 0;\n }\n}",
"public function user_bought_product( $post_id = null, $user_id = null ) {\n\t\treturn true;\n\n\t}",
"private function _checkAvailableStock($productUid = \"\", $qty = 0, $oldQty = 0) {\n $product = Product::where('uid', $productUid)->first();\n if($product) {\n $availableStock = Product::getAvailableStock($product) + $oldQty;\n if(($availableStock - $qty) < 0) return false; \n }\n return true;\n }",
"public function show(User $user, Product $product)\n {\n return $user->client_id === $product->client_id;\n }",
"function is_renew_order_paid($original_order_id) {\n\t$sql = \"SELECT * from orders WHERE original_order_id='$original_order_id' AND status='renew_paid' \";\n\t$result = mysql_query ($sql) or die(mysql_error());\n\tif (mysql_num_rows($result)>0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}",
"public function hasShoporder(){\n return $this->_has(27);\n }",
"public function check_manual_order_for_pre_order_products( $order_id ) {\n\t\t// Make sure we are in the administration panel and we're saving an order\n\t\tif ( ! is_admin() || ! isset( $_POST['post_type'] ) || 'shop_order' != $_POST['post_type'] )\n\t\t\treturn;\n\n\t\t$order = new WC_Order( $order_id );\n\n\t\t// Check if the order hasn't been processed already\n\t\tif ( WC_Pre_Orders_Order::order_contains_pre_order( $order ) )\n\t\t\treturn;\n\n\t\t// Order has not been processed yet (or doesn't contain pre orders)\n\t\t$contains_pre_orders = false;\n\n\t\tforeach ( $order->get_items() as $item ) {\n\t\t\tif ( 'line_item' == $item['type'] ) {\n\t\t\t\t$product = get_product( $item['item_meta']['_product_id'][0] );\n\n\t\t\t\tif ( 'yes' == $product->wc_pre_orders_enabled ) {\n\t\t\t\t\t// Set correct flags for this order, making it a pre order\n\t\t\t\t\tupdate_post_meta( $order_id, '_wc_pre_orders_is_pre_order', 1 );\n\t\t\t\t\tupdate_post_meta( $order_id, '_wc_pre_orders_when_charged', $product->wc_pre_orders_when_to_charge );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function checkAndSaveOrder(){\n if(!getSession('USER')){\n if(!isset($_POST['USER']))\n return false;\n setSession('USER', array(\n 'name' => $_POST['USER']['name'],\n 'phone' => $_POST['USER']['phone'],\n 'email' => $_POST['USER']['email'],\n 'address' => $_POST['USER']['address'],\n )\n );\n }\n\n $orders = getSession('basket');\n\n foreach($orders as $order){\n saveOrder($order);\n /*if(!saveOrder($order));\n return false;*/\n }\n\n return true;\n}",
"public function hasOrdering()\n\t\t{\n\t\t\treturn count($this->order) > 0;\t\t\t\n\t\t}",
"public function setCooked(User $user, Order $order)\n {\n if ($user->isWaiter()) {\n return false;\n }\n\n return $user->id === $order->chef_id;\n }",
"public function forceDelete(User $user, Product $product)\n {\n return false;\n }",
"public function update(User $user, Product $checkoutProduct)\n {\n if ($user->is_admin) {\n return true;\n }\n\n return false;\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 hasProduct(){\n return $this->_has(1);\n }",
"public function destroy(User $user, Product $product)\n {\n return $user->id === $product->user_id;\n }",
"public static function is_eligible_to_bid( $user_id = null , $product_id = null ) {\n\n if( !$user_id ) return false;\n if( !$product_id ) return false;\n if( WAUC_Functions::is_user_forbidden( $user_id ) ) return false;\n\n if( strtotime( WAUC_Functions::get_auction_start_time( $product_id ) ) < time() && time() < strtotime( WAUC_Functions::get_auction_end_time( $product_id ) ) ) {\n return true;\n } ;\n\n return false;\n\n }",
"public function addItem(Product $product): bool\n {\n $key = $this->findItemInSession($product);\n\n if (isset($_SESSION['cart'][$key])) {\n $newQuantity = $_SESSION['cart'][$key]['quantity'] + 1;\n\n $_SESSION['cart'][$key]['quantity'] = $newQuantity;\n $_SESSION['cart'][$key]['total'] = $newQuantity * $product->getPrice();\n } else {\n $_SESSION['cart'][] = [\n 'product' => $product,\n 'quantity' => self::ITEM_DEFAULT_QUANTITY,\n 'total' => self::ITEM_DEFAULT_QUANTITY * $product->getPrice()\n ];\n }\n\n return true;\n }",
"public function update(User $user, OrderProduct $orderProduct)\n {\n return $user->isAdmin() || $user->is($orderProduct->coupon->user);\n }",
"public function forceDelete(User $user, Product $checkoutProduct)\n {\n if ($user->is_admin) {\n return true;\n }\n\n return false;\n }",
"public function RemoveFromCart($cart_id,$user_id,$product_id)\n\t{\n\t\t$user_id\t= $this->session->userdata('user_id');\n\t\t$this->db->select('order_id,user_id,product_id,quantity');\n\t\t$this->db->from('vefinder_order_temp');\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->where('product_id', base64_decode($product_id));\n\t\t$this->db->where('order_id', $cart_id);\n\t\t$this->db->where(\"status =1\");\n\t\t$query = \t$this->db->get();\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t\t$data=array('updated_date'\t\t\t=> date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'status'\t\t\t\t=>\t0\n\t\t\t\t\t\t\t);\n\t\t\t$this->db->where('user_id', $user_id);\n\t\t\t$this->db->where('order_id', $cart_id);\n\t\t\t$this->db->where('product_id', base64_decode($product_id));\n\t\t\t$this->db->update('vefinder_order_temp', $data);\t\t\t\n\t\t\tif($this->db->affected_Rows())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\t\n\t\t} \n }",
"public function doesProductsHaveDuplications()\n {\n $productIDs = array();\n foreach ($this->products as $product) {\n $productIDs[] = $product->product_id;\n }\n\n $uniqueProductIDs = array_unique($productIDs);\n return (count($productIDs) != count($uniqueProductIDs));\n }",
"public function ReviewRatedByActiveUser()\n {\n return array_key_exists('TPkgShopArticleReviewShopArticleReviewRated', $_SESSION) && array_key_exists($this->id, $_SESSION['TPkgShopArticleReviewShopArticleReviewRated']);\n }",
"public function authorize()\n {\n return Cart::load()->getTotalQuantity() > 1;\n }",
"function is_purchased($song){\n if (in_array($song, $this->purchased_songs)){\n return True;\n }\n return False;\n }",
"public function checkProductsAvailability()\n {\n if ($this->hasProducts()) {\n $basketProducts = $this->getBasketProductsJoinProduct();\n \n foreach ($basketProducts as $basketProduct) {\n $product = $basketProduct->getProduct();\n $optionIds = null;\n if($basketProduct->getOptionsList() != '')\n $optionIds = explode(',',$basketProduct->getOptionsList());\n if (!$product->getIsActive() || $product->getIsDeleted()) {\n $this->unavailabilityProducts['deleted'] = $product->getId();\n $basketProduct->delete();\n }\n else if($product->getProductQuantity($optionIds) < $basketProduct->getQuantity()) {\n if(!$product->getAllowOutOfStock())\n $this->unavailabilityProducts['insufficiently'] = $product->getId();\n }\n }\n }\n \n if (!empty($this->unavailabilityProducts)) {\n return false;\n }\n else {\n return true;\n }\n }",
"public function restore(User $user, Order $order)\n {\n return $user->hasPermission('order.restore');\n }",
"public static function checkForNearProducts() {\n $cartDeliveryPostcodeSessionKey = \\Config::get('appConstants.user_delivery_postcode_session_key');\n $landingPagePostcodeSessionKey = \\Config::get('appConstants.user_landing_postcode_session_key');\n $landingPostcode = session()->get($landingPagePostcodeSessionKey, '');\n $cartPostcode = session()->get($cartDeliveryPostcodeSessionKey, '');\n if (!empty($landingPostcode)\n || !empty($cartPostcode)\n ) {\n return true;\n }\n return false;\n }",
"public static function checkRating($user_id,$product_id,$order_id)\n {\n\n $get=DB::table('product_rating')->where('product_id','=', $product_id)->where('order_id','=', $order_id)->where('user_id','=', $user_id)->get();\n\t$value = $get->count(); \n return $value;\n\t\n }",
"function check()\r\n\t{\r\n\t\tif (empty($this->product_id))\r\n\t\t{\r\n\t\t\t$this->setError( JText::_('COM_CITRUSCART_PRODUCT_ASSOCIATION_REQUIRED') );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$offset = JFactory::getConfig()->getValue( 'config.offset' );\r\n\t\tif( isset( $this->publishing_date ) )\r\n\t\t{\r\n\t\t\t$this->publishing_date = date( 'Y-m-d H:i:s', strtotime( CitruscartHelperBase::getOffsetDate( $this->publishing_date, -$offset ) ) );\r\n\t\t}\r\n\r\n\r\n\t\t$nullDate = $this->_db->getNullDate();\r\n\t\tCitruscart::load( 'CitruscartHelperBase', 'helpers._base' );\r\n\r\n\t\tif (empty($this->created_date) || $this->created_date == $nullDate)\r\n\t\t{\r\n\t\t\t$date = JFactory::getDate();\r\n\t\t\t$this->created_date = $date->toSql();\r\n\t\t}\r\n\r\n\t\t$date = JFactory::getDate();\r\n\t\t$this->modified_date = $date->toSql();\r\n\t\t$act = strtotime( Date( 'Y-m-d', strtotime( $this->publishing_date ) ) );\r\n\t\t\t\t\t\r\n\t\t$db = $this->_db;\r\n\t\tif( empty( $this->product_issue_id ) ) // add at the end\r\n\t\t{\r\n\t\t\t$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`='.$this->product_id.' ORDER BY `publishing_date` DESC LIMIT 1';\r\n\t\t\t$db->setQuery( $q );\r\n\t\t\t$next = $db->loadResult();\r\n\t\t\tif( $next === null )\r\n\t\t\t\treturn true;\r\n\t\t\t$next = strtotime( $next );\r\n\t\t\tif( $act <= $next )\r\n\t\t\t{\r\n\t\t\t\t$this->setError( JText::_('COM_CITRUSCART_PUBLISHING_DATE_IS_NOT_PRESERVING_ISSUE_ORDER').' - '.$this->publishing_date );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_issue_id`='.$this->product_issue_id;\r\n\t\t\t$db->setQuery( $q );\r\n\t\t\t$original = $db->loadResult();\r\n\t\t\tif( $act == strtotime( Date( 'Y-m-d', strtotime( $original ) ) ) )\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`='.$this->product_id.' AND `publishing_date` < \\''.$original.'\\' ORDER BY `publishing_date` DESC LIMIT 1';\r\n\t\t\t$db->setQuery( $q );\r\n\t\t\t$prev = $db->loadResult();\r\n\t\t\t$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`='.$this->product_id.' AND `publishing_date` > \\''.$original.'\\' ORDER BY `publishing_date` ASC LIMIT 1';\r\n\t\t\t$db->setQuery( $q );\r\n\t\t\t$next = $db->loadResult();\r\n\t\t\t\r\n\t\t\tif( $prev === null )\r\n\t\t\t\t$prev = 0;\r\n\t\t\telse\r\n\t\t\t\t$prev = strtotime( $prev );\r\n\t\t\tif( $next )\r\n\t\t\t\t$next = strtotime( $next );\r\n\t\r\n\t\t\tif( ( $prev >= $act ) || ( $next && $next <= $act ) )\r\n\t\t\t{\r\n\t\t\t\t$this->setError( JText::_('COM_CITRUSCART_PUBLISHING_DATE_IS_NOT_PRESERVING_ISSUE_ORDER').' - '.$this->publishing_date );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function hasProduct()\n {\n return $this->Product !== null;\n }",
"public function completeProductOrder($order_product_id)\n\t{\n\t\t$query1=$this->db->query(\"SELECT pyr.confirm_id as payer_confirm_id FROM `payer` pyr where pyr.order_product_id=\".$order_product_id);\n\t\t$result1=$query1->result_array();\n\t\t$query2=$this->db->query(\"SELECT pye.confirm_id as payee_confirm_id FROM `payee` pye where pye.order_product_id=\".$order_product_id);\n\t\t$result2=$query2->result_array();\n\t\tif(isset($result1[0]) && isset($result2[0]))\n\t\t$this->db->query(\"UPDATE `order_product` SET order_product_status_id =6 where order_product_id = \".$order_product_id);\n\t\telse\n\t\t$this->db->query(\"UPDATE `order_product` SET order_product_status_id =5 where order_product_id = \".$order_product_id);\n\t\t$this->sendcompleteProductOrderMail($order_product_id);\n\t\t\n\t}",
"function product_exists($pid){\n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n\t$pid=intval($pid);\n\t$max=count($_SESSION[$cart]);\n\t$flag=0;\n\tfor($i=0;$i<$max;$i++){\n\t\tif($pid==$_SESSION[$cart][$i]['bookid']){\n\t\t\t$flag=1;\n\t\t\t// break;\n\t\t}\n\t}\n\treturn $flag;\n}",
"public function update(User $user, Product $product)\n {\n return $user->isManager() || $user->isAdmin();\n }",
"public function canUpOrder()\n {\n $orderAble = $this->getOrderAble();\n\n $node = $orderAble->getOrderQuery()\n ->andWhere([\n '<', $orderAble->getOrderFieldName(), $orderAble->getOrderValue()\n ])\n ->one();\n\n if ($node) return true;\n return false;\n }",
"public function isAllowOrder() {\n $qtyAllow = false;\n \n // check qty\n if ($this->quantity >= $this->minimum_quantity) {\n $qtyAllow = true;\n }\n else {\n if ($this->when_out_of_stock == 1) {\n $qtyAllow = true;\n }\n }\n \n // check all\n if (($qtyAllow) & ($this->active) & ($this->available_for_order)) {\n return true;\n }\n \n return false;\n }",
"function hasOrder($user_id, $order_id)\n {\n $order = $this->order($order_id)\n ->where('uzivatele_id', $user_id)\n ->fetch();\n\n return $order !== false;\n }",
"public function forceDelete(User $user, Product $product)\n {\n return $user->isAdmin();\n }",
"public function productExist()\n {\n if ($this->product) {\n $ret = true;\n } else {\n $ret = false;\n }\n \n return $ret;\n }",
"protected function isValidOrder()\n {\n return true;\n }",
"public function unique_order(){\n\t\t\t\n\t\t\t$where = array(\n\t\t\t\t'reference' => $this->input->post('reference'),\n\t\t\t\t'order_description' => $this->input->post('order_description'),\n\t\t\t\t'total_price' => $this->input->post('total_price'),\n\t\t\t\t'num_of_items' => $this->input->post('num_of_items'),\n\t\t\t\t'customer_email' => $this->input->post('customer_email'),\n\t\t\t);\n\t\t\t\n\t\t\tif (!$this->Orders->is_unique($where))\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('unique_order', 'You already have this order on record!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}",
"function is_wished($product_id)\n {\n if ($this->session->userdata('user_login') == 'yes') {\n $user = $this->session->userdata('user_id');\n //$wished = array('0');\n if ($this->get_field('user', $user, 'wishlist') !== '') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array(\n '0'\n );\n }\n if (in_array($product_id, $wished)) {\n return 'yes';\n } else {\n return 'no';\n }\n } else {\n return 'no';\n }\n }",
"function not_active_productos()\n {\n $query = $this->db->get_where('productos', array('eliminado' => 'SI'));\n if($query->num_rows()>0) {\n return $query;\n } else {\n return FALSE;\n }\n }",
"public function addProduct(Cart $cartObj) :bool\n {\n $orderObj = new Order();\n $orderObj->createOrder();\n $query = $this->pdo->prepare(\"SELECT orders_products.id from orders_products\nINNER JOIN orders on orders_products.order_id = orders.id\nWHERE orders.user_id = :user_id AND orders.status='cart' AND orders_products.product_id=:product_id\");\n $query->execute(array('product_id'=>$cartObj->getProductId(),'user_id'=> $orderObj->getUserId()));\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n if (empty($row)) {\n $query = $this->pdo->prepare(\"\n INSERT INTO orders_products\n SELECT NULL,id,:product_id,:quantity FROM orders WHERE user_id = :user_id AND status ='cart'\");\n $query->execute(array\n (\n 'product_id' => $cartObj->getProductId(),\n 'user_id' => $orderObj->getUserId(),\n 'quantity'=>$cartObj->getQuantity()));\n $product = new Product();\n $product->decreaseQuantity($cartObj->getOrderId(), $cartObj->getQuantity());\n unset($query);\n } else {\n $query = $this->pdo->prepare(\"UPDATE orders_products \n SET quantity = quantity+:quantity WHERE product_id =:product_id;\");\n $query->execute(array\n (\n 'product_id'=>$cartObj->getProductId(),\n 'quantity'=>$cartObj->getQuantity()));\n $product = new Product();\n $product->decreaseQuantity($cartObj->getProductId(), $cartObj->getQuantity());\n unset($query);\n }\n return true;\n }",
"public function testuserHasProduct() {\n $user = 1;\n R::exec('UPDATE collection set products = \"{\"\"1\"\": 1}\" WHERE id = :id', [':id' => $user]);\n $this->assertEquals(true, userHasProduct($user, 1));\n $this->assertEquals(false, userHasProduct($user, 2));\n }",
"public function checkCartSameProductIfExists() {\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $product_id = func_get_arg(1);\n $hotel_id = func_get_arg(2);\n $quantity = func_get_arg(2);\n\n try {\n $select = $this->select()\n ->where('user_id = ?', $user_id)\n ->where('hotel_id = ?', $hotel_id)\n ->where('product_id = ?', $product_id)\n ->where('quantity = ?', $quantity);\n\n $result = $this->getAdapter()->fetchRow($select);\n\n if ($result) {\n return $result;\n } else {\n return null;\n }\n } catch (Exception $ex) {\n throw new Exception(\"argument not passed: \" . $ex);\n }\n } else {\n throw new Exception(\"argument not passed\");\n }\n }",
"function is_compared($product_id)\n {\n if($this->session->userdata('compare') == ''){\n $this->session->set_userdata('compare','[]');\n }\n $compared = json_decode($this->session->userdata('compare'),true);\n foreach ($compared as $row) {\n if($row == $product_id){\n return 'yes';\n }\n }\n return 'no';\n }",
"public function hasOrders()\n {\n return $this->orders->count();\n }",
"public static function OrderProcessHasBeenMarkedAsCompleted()\n {\n return array_key_exists(self::SESSION_KEY_NAME_ORDER_SUCCESS, $_SESSION) && true == $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS];\n }",
"function wac_only_current_vendor_view($product_id){\n\tif(wac_is_vendor()){\n\t\t$cUID = get_current_user_id();\n\t\t$vendor_data = get_wcmp_product_vendors($product_id);\n\t\tif($vendor_data->id == $cUID){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"function checkCart() {\r\n if (! isset($_SESSION['cart'])) {\r\n $_SESSION['cart'] = [];\r\n return true;\r\n } else {\r\n return true;\r\n }\r\n}",
"private function checkCartStatus()\n {\n if ($this->quote->getIsActive()=='0') {\n $this->getMagentoOrderId();\n throw new \\Exception(self::CMOS_ALREADY_PROCESSED);\n }\n }"
]
| [
"0.6671044",
"0.64117277",
"0.6349126",
"0.6205934",
"0.61859435",
"0.6113933",
"0.60961294",
"0.6062236",
"0.6015579",
"0.5931031",
"0.5931029",
"0.5912061",
"0.5905408",
"0.582924",
"0.58058995",
"0.579021",
"0.57873297",
"0.57645214",
"0.5746303",
"0.5716863",
"0.57120633",
"0.57071644",
"0.57069147",
"0.5700595",
"0.5690109",
"0.5690001",
"0.56815463",
"0.567872",
"0.56607205",
"0.5647704",
"0.56463856",
"0.5634616",
"0.56255233",
"0.56098634",
"0.56072843",
"0.5605907",
"0.5605545",
"0.5594246",
"0.55763745",
"0.55681455",
"0.5568094",
"0.555191",
"0.5545878",
"0.55410486",
"0.55407655",
"0.5533614",
"0.5518972",
"0.55032605",
"0.54984117",
"0.5488964",
"0.5471977",
"0.54674786",
"0.54542434",
"0.5453368",
"0.5450312",
"0.5442337",
"0.54421914",
"0.5436375",
"0.54339457",
"0.54339457",
"0.54339457",
"0.54339457",
"0.54339457",
"0.54328996",
"0.54316396",
"0.54284114",
"0.5425546",
"0.5416846",
"0.5413392",
"0.5404103",
"0.53999573",
"0.5390962",
"0.53874755",
"0.53841597",
"0.537973",
"0.53750724",
"0.53730947",
"0.53679717",
"0.5359425",
"0.53300315",
"0.53248453",
"0.5315571",
"0.53117937",
"0.53078336",
"0.5300702",
"0.5299848",
"0.5299537",
"0.5294831",
"0.5285437",
"0.52836645",
"0.5280567",
"0.5277737",
"0.52760077",
"0.5273906",
"0.52670395",
"0.526532",
"0.5265063",
"0.52503943",
"0.5249312",
"0.5241577"
]
| 0.6868049 | 0 |
checks if the user is logged in | function checkLogin () {
//check is session has user
if (isset($_SESSION['user'])) {
//check if the credentials match
if (verifyUser($_SESSION['user']['name'], $_SESSION['user']['hash'])) {
return true;
}
}
//returns false by default
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isUserLoggedIn() {}",
"protected function isUserLoggedIn() {}",
"public function loggedIn()\n {\n if($this->di->session->get('user'))\n {\n return true;\n }\n return false;\n }",
"public function isLoggedIn()\n {\n if(Session::get('user_id') != '') {\n $this->user_id=Session::get('user_id');\n $this->role_id=Session::get('role_id');\n return true;\n }else {\n return false;\n }\n }",
"public function is_logged_in() {\n\n\t}",
"public function isLoggedIn()\n {\n return isset($_SESSION['user']);\n }",
"public function logged_in()\n {\n if (isset($_SESSION['user_data'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function loggedIn()\n {\n if(isset($_SESSION['user']) && !empty($_SESSION['user'])) {\n return true;\n }\n\n return false;\n }",
"private function isLoggedIn()\n {\n return isset($_SESSION['user']); \n }",
"public function is_user_logged_in(){\n\t\treturn $this->session->userdata('current_user_id') != FALSE;\n\t}",
"public function isUserLoggedIn() {\r\n\t\treturn ($this->coreAuthenticationFactory->isUserLoggedIn ());\r\n\t}",
"public function isLoggedIn()\n {\n return $this->session->has('user');\n }",
"public function loggedIn(){\r\n if (isset($_SESSION['user_session']))\r\n return true;\r\n else\r\n return false;\r\n }",
"function is_logged_in()\n {\n //check session\n //return logged in user_id or false\n }",
"public function isUserLoggedIn()\n {\n return $this->user_is_logged_in;\n }",
"public function is_loggedin()\n {\n if (isset($_SESSION['user_session'])) {\n return true;\n }\n }",
"function is_logged_in() \n {\n return (empty($this->userID) || $this->userID == \"\") ? false : true;\n }",
"function is_logged_in()\n\t{\n\t\treturn require_login();\n\t}",
"public function is_loggedin(){\n if(isset($_SESSION['user_session'])){\n return true;\n }\n return false;\n }",
"public function loggedIn()\n {\n if ($this->userId) {\n return true;\n } else {\n return false;\n }\n }",
"public static function isLoggedIn(){\n if(!self::exists('is_logged_in')&& self::get('is_logged_in')!==true){\n \n header('location:' . URL . 'user/login.php');\n exit;\n }\n }",
"private function checkUserLoggedIn(): bool\n {\n $user = JFactory::getUser();\n if ($user->id > 0) {\n return true;\n } else {\n return false;\n }\n }",
"private function if_user_logged_in()\n {\n\n session_start();\n\n if(!empty($_SESSION)){\n\n if(isset($_SESSION[\"user_id\"]) && isset($_SESSION[\"user_type\"])){\n \n return true;\n\n }else{\n\n return false;\n }\n\n }else{\n\n return false;\n }\n }",
"public function isLoggedIn()\n {\n return true;\n }",
"public static function isLoggedIn()\n {\n return (bool)Users::getCurrentUser();\n }",
"public function isUserLoggedIn() \n {\n if (!isset($_SESSION['user_id']) || !isset($_SESSION['is_logged_in'])) {\n return false;\n } else {\n return true;\n }\n }",
"protected function _logged_in()\n\t{\n\t\t$authentic = Auth::instance();\n\t\t\n\t\tif ($authentic->logged_in())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\n\t\t}\n\t}",
"public function isLoggedIn(){\n // Apakah user_session sudah ada di session\n if(isset($_SESSION['user_session']))\n {\n return true;\n }\n }",
"public function isLoggedIn();",
"public function isLoggedIn();",
"public function is_logged_in()\n\t{\n\t\treturn ($this->session->userdata('iduser') != FALSE);\n\t}",
"protected function isLoggedIn()\n\t{\n\t\treturn is_user_logged_in();\n\t}",
"public function isLoggedIn()\n {\n return ($this->userInfo->userid ? true : false);\n }",
"function isLoggedIn(){\r\n APP::import('Component','Auth');\r\n $auth = new AuthComponent;\r\n $auth ->Session = $this->Session;\r\n $user = $auth->user();\r\n return !empty($user);\r\n \r\n }",
"public function check_login(){\n\t\t\tif( isset( $_SESSION['user_id'] ) ) {\n\t\t\t\t$this->user_id = $_SESSION['user_id'];\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset( $this->user_id );\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}",
"function logged_in(){\n\t\tif((isset($_SESSION['user_id']) || isset($_SESSION['username'])) && (!empty($_SESSION['user_id']) || !empty($_SESSION['username']))){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function is_logged_in()\n\t{\n\t\tif(isset($_SESSION['userSession']))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}",
"function wv_is_user_loggedin() {\n $output = 0;\n if (is_user_logged_in()) {\n $output = 1;\n } else {\n $output = 0;\n }\n return $output;\n }",
"private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }",
"public function userIsLoggedIn() {\n return auth()->check() ;\n }",
"public function is_logged_in()\n {\n if (isset($_SESSION['user_session'])) {\n return true;\n }\n }",
"public function logged_in()\n\t{\n\t\t$status = FALSE;\n\n\t\t// Get the user from the session\n\t\t$user = $this->_session->get($this->_config['session_key']);\n\n\t\tif ( ! is_object($user))\n\t\t{\n\t\t\t// Attempt auto login\n\t\t\tif ($this->auto_login())\n\t\t\t{\n\t\t\t\t// Success, get the user back out of the session\n\t\t\t\t$user = $this->_session->get($this->_config['session_key']);\n\t\t\t}\n\t\t}\n\n\t\t// check from DB if set in config\n\t\tif ($this->_config['strong_check'])\n\t\t{\n\t\t\t$user = $this->_get_object($user, TRUE);\n\t\t}\n\n\t\tif (is_object($user)\n\t\t\tAND is_subclass_of($user, 'Model_MangoRauth_User')\n\t\t\tAND $user->loaded()\n\t\t\tAND $user->is_active\n\t\t)\n\t\t{\n\t\t\t// Everything is okay so far\n\t\t\t$status = TRUE;\n\t\t}\n\n\t\treturn $status;\n\t}",
"static function isLoggedIn() {\n $user = self::currentUser();\n return isset($user) && $user != null;\n }",
"public static function is_user_logged_in() {\r\n if (isset($_SESSION['user_id'])) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }",
"static function checkForLogIn()\n {\n if (isset($_SESSION['username'])) {\n return true;\n }\n\n return false;\n }",
"public function isUserLoggedIn()\n {\n if (isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] == 1) {\n return true;\n }\n // default return\n return false;\n }",
"private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }",
"public function isUserLoggedIn()\n {\n return (isset($this->session->sUserId) && !empty($this->session->sUserId));\n }",
"function isLoggedIn()\n\t{\n\t\tif ( $this->_isAuthorized() ){\t\n\t\t\treturn true;\n\t\t} else return false;\n\t\n\t}",
"public function is_logged_in()\n {\n return isset($this->user);\n }",
"protected function is_logged_in( )\n\t{\n\t\t$this->user = $this->php_session->get('user');\n\t\tif( is_null($this->user))\n\t\t\treturn False;\n\t\tif( ! $this->is_timed_out() )\n\t\t\treturn False;\n\t\t$this->user['last_active'] = time();\n\t\t$this->php_session->set('user' , $this->user );\n\n\t\t//apply user permissions globally\n\t\t//@see user_helper\n\t\tapply_global_perms( $this->user );\n\n\n\t\t\n\t\treturn True;\n\t}",
"function isUserLoggedIn()\r\n\t{\r\n\t\t\tglobal $con;\r\n\t\t\t$return = false;\r\n\t\t\tif (isset($_SESSION['USER_ID']) && ($_SESSION['USER_ID'] > 0) && ($_SESSION['USER_ID'] != ''))\r\n\t\t\t{\r\n\t\t\t\t$id = $_SESSION['USER_ID'];\r\n\t\t\t\tif ($this->chkValidUser($id))\r\n\t\t\t\t{\r\n\t\t\t\t\t$return = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t}",
"public static function loggedIn(): bool\n {\n // Check if user is in the session\n return isset($_SESSION['user']);\n }",
"private static function is_logged_in () {\n\t\t# Check for the existence of the cookie\n\t\tif (isset($_COOKIE[\"user_id\"])) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t}",
"public function is_logged_in()\n {\n // Check if user session has been set\n if (isset($_SESSION['session'])) {\n return true;\n }\n }",
"public function isloggedin()\n {\n return Session::userIsLoggedIn();\n }",
"public function isLoggedIn()\n {\n // check session for user id\n if(isset($_SESSION['user']['id'])) {\n // return true;\n return $_SESSION['user']['id'];\n }\n else {\n return false;\n }\n }",
"public function loggedIn()\n {\n return $this->user() != null;\n }",
"public function isUserLoggedIn()\n {\n return $this->container->get('security.authorization_checker')\n ->isGranted('IS_AUTHENTICATED_FULLY');\n }",
"public function isUserLoggedIn() {\n\n $this->restartSession();\n\n if ($this->checkLogin() == false) {\n return false;\n } else {\n return true;\n }\n }",
"public function isLoggedIn()\n {\n $userId = $this->session->offsetGet('sUserId');\n\n return !empty($userId);\n }",
"public function isLoggedIn()\n {\n $userId = $this->session->offsetGet('sUserId');\n\n return !empty($userId);\n }",
"function loggedIn() {\n\t\treturn isset($_SESSION['username']);\n\t}",
"function logged_in() {\n\t\treturn isset($_SESSION['USERID']);\n \n\t}",
"private function check_login()\n {\n if (self::exists('user_id')) {\n $this->user_id = self::get('user_id');\n $this->logged_in = true;\n } else {\n unset($this->user_id);\n $this->logged_in = false;\n }\n }",
"public function loggedIn()\n {\n $CI = &get_instance();\n if ($CI->session->has_userdata('user_id')) {\n return true;\n } else {\n return false;\n }\n }",
"public static function check()\n {\n if (!empty($_SESSION['LOGGED_IN_USER'])){\n return true;\n } else{\n return false;\n }\n }",
"public function isUserLoggedIn()\n {\n return $this->_customerSession->isLoggedIn();\n }",
"public static function is_logged_in()\n {\n if (isset($_SESSION['id']) and isset($_SESSION['username']) and isset($_SESSION['role_name'])){\n return true;\n }else{\n return false;\n }\n }",
"public function is_logged_in(){\r\n\t\t\treturn $this->logged_in;\r\n\t\t}",
"public static function isUserLoggedIn(): bool\n {\n if (isset($_SESSION['user_id'])) return true;\n return false;\n }",
"public function logged_in() {\n return !empty($this->session->userdata('user_id'));\n }",
"public function isLoggedIn() {\n $auth_cookie = Cookie::get(\"auth_cookie\"); //get hash from browser\n //check if cookie is valid\n if ($auth_cookie != '' && $this->cookieIsValid($auth_cookie)) {\n return true;\n } else {\n return false;\n }\n }",
"function IsLoggedIn() {\t\tif( Member::currentUserID() ) {\r\n\t\t return true;\r\n\t\t}\r\n }",
"function isLoggedIn() {\n\treturn isset($_SESSION['user_id']);\n}",
"public function checkLoggedIn()\n\t\t{\n\t\t\t\n\t\t\ttry {\n\t\t\t \n\t\t\t\t$query = $this->_db->prepare( \"SELECT username FROM login WHERE username=:username\" );\n \n \n\t\t\t\t$query->bindParam( \":username\", $_SESSION[ 'username' ], PDO::PARAM_STR );\n\n\t\t\t\t$query->execute();\n\t\t\t\n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\n\t\t\t$row = $query->fetch();\n\t\t\t\n \n\t\t\t$loggedInUser = $row[ 'username' ];\n \n //if the user is not logged in\n\t\t\tif( !isset( $loggedInUser ) )\n\t\t\t{\n //head to the log in page\n\t\t\t\theader( 'Location: login.php' );\n\n\t\t\t}\n\t\t\t\n\t\t}",
"public function isLoggedIn()\n {\n $loggedIn = $this->di->get(\"session\")->has(\"user\");\n if (!$loggedIn) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n return false;\n }\n return true;\n }",
"function isLoggedIn() {\n\treturn isset($_SESSION['user']);\n}",
"public function isLoggedIn()\n {\n if (isset($_SESSION['username'], $_SESSION['email'])) {\n return true;\n } else {\n $url=URL::getURI('login/required');\n header(\"location:$url\");\n }\n }",
"public function isLoggedIn() {\n $cookie = $this->login();\n return $cookie != NULL;\n }",
"public function isLoggedIn()\n\t{\n\t\tif( isset($_SESSION['username']) )\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}",
"function isLoggedIn() {\n\t\tif (isset($_SESSION[\"UID\"]) && !empty($_SESSION[\"UID\"])) {\n\t\t\t// logged in\n\t\t\treturn TRUE ;\n\t\t} else {\n\t\t\t// not logged in\n\t\t\treturn FALSE ;\n\t\t}\n\t}",
"public function isLoggedIn() {\n\t\treturn (bool) $this->getLoggedInUser();\n\t}",
"public static function isLoggedIn()\n {\n self::startSession();\n return isset($_SESSION['user']);\n }",
"public function user_is_logged_in()\n \t{\n\n \t\tif(!$this->session->userdata('is_logged_in'))\n \t\t{\n \t\t\treturn FALSE;\n \t\t}\n \t\telse\n \t\t{\n \t\t\treturn TRUE;\n \t\t}\n\n \t}",
"abstract protected function isUserLoggedIn() ;",
"public function isLoggedIn()\r\n {\r\n if ($this->session->has('AUTH_NAME') AND $this->session->has('AUTH_EMAIL') AND $this->session->has('AUTH_CREATED') AND $this->session->has('AUTH_UPDATED')) {\r\n return true;\r\n }\r\n return false;\r\n }",
"function isLoggedIn() {\n\t\t\tif(!$this->params['requested']) $this->cakeError('error404');\n\t\t\treturn $this->User->isLoggedIn();\n\t\t}",
"public function loggedIn ()\r\n {\r\n\r\n if (isset($_SESSION['userID'])) {\r\n return true;\r\n } else {\r\n header('Location: login');\r\n exit;\r\n }\r\n }",
"function isUserLogged() {\r\n return isset($_SESSION['user']);\r\n }",
"function isLoggedIn(){\n return $this->auth->isLoggedIn();\n }",
"protected function loggedIn() {\n return isset($_SESSION) && array_key_exists(self::user, $_SESSION);\n }",
"public static function check_log_in ()\n {\n session_start();\n\n if (!$_SESSION['user_data']) {\n header('Location: ./../index.php');\n exit;\n }\n }",
"public function isLoggedIn()\n {\n return $this->loggedIn;\n }",
"public function check_login()\n\t{\n\t\tif(isset($_SESSION[\"user_id\"]))\n\t\t{\n\t\t $this->_user_id = $_SESSION[\"user_id\"];\n\t\t\t$this->_client = $_SESSION[\"client\"];\n\t\t\t$this->_loged_in = true;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\t\t\tunset($this->_user_id);\n\t\t}\n\t}",
"public static function isLoggedIn(){\r\n\t\treturn isset($_SESSION[\"id\"]);\r\n\t}",
"public function logged_in()\n\t{\n\t\treturn $this->_me != NULL;\n\t}",
"private function check_is_user_login()\n\t{\n\t\tif($this->session->userdata('logged_in') != FALSE)\n\t\t{\n\t\t\tredirect('home');\n\t\t}\n\t}",
"public function isLoggedIn() {\n\t\treturn $this->loggedIn;\n\t}",
"public function is_user_logged_in()\n {\n $result = (boolean)self::getUser();\n return $result;\n }",
"public function isLoggedIn()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Resources) !== false && $admin->getActive() == 1) {\n $testLogin = true;\n } else {\n $this->_f3->reroute('/Login');\n }\n $this->_f3->set('login', $testLogin);\n $this->_f3->set('admin', $admin);\n }"
]
| [
"0.86395186",
"0.86395186",
"0.8439799",
"0.8364399",
"0.8339515",
"0.83147",
"0.83084136",
"0.8291526",
"0.82671154",
"0.82463044",
"0.82422817",
"0.8226667",
"0.8223865",
"0.821581",
"0.8211307",
"0.8208306",
"0.8205401",
"0.82031095",
"0.820233",
"0.82005244",
"0.8184794",
"0.8184304",
"0.8176261",
"0.8173413",
"0.8168383",
"0.81678265",
"0.81660444",
"0.81576663",
"0.81326693",
"0.81326693",
"0.81260395",
"0.8121061",
"0.8118442",
"0.8118068",
"0.81160074",
"0.8115672",
"0.8107629",
"0.810729",
"0.8104826",
"0.81032497",
"0.80912995",
"0.80851364",
"0.808231",
"0.80754757",
"0.8075318",
"0.8069551",
"0.80667007",
"0.8065353",
"0.8062996",
"0.8054903",
"0.8050394",
"0.80499464",
"0.80476356",
"0.8046312",
"0.8040745",
"0.8033603",
"0.80276877",
"0.801729",
"0.8009077",
"0.7988922",
"0.7983941",
"0.7983941",
"0.7983732",
"0.79789704",
"0.79728526",
"0.79691696",
"0.7969058",
"0.7968048",
"0.79669416",
"0.79652756",
"0.7965275",
"0.7963621",
"0.7959647",
"0.7958908",
"0.7950168",
"0.79446614",
"0.793842",
"0.79383194",
"0.7935141",
"0.7934008",
"0.7929906",
"0.7920805",
"0.7919486",
"0.79193926",
"0.7918754",
"0.79154193",
"0.79002804",
"0.78971916",
"0.7892009",
"0.7889922",
"0.78894764",
"0.7889223",
"0.7889047",
"0.78864896",
"0.7875487",
"0.7872325",
"0.78713536",
"0.7871043",
"0.7864548",
"0.78576756",
"0.7852325"
]
| 0.0 | -1 |
returns the ID of the user thats currently logged in returns null if something went wrong | function getPersonID () {
if (checkLogin()) {
$stmt = runQuery("SELECT PersonID FROM people WHERE LogonName = " . $_SESSION['user']['name']);
if ($stmt->rowCount() > 0) {
$row = $stmt->fetch();
//return the ID
return $row['PersonID'];
}
}
//returns null by default
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUserId()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $userId = $CI->session->userdata('user_id');\n return $userId;\n }\n }",
"public function getUserId() {\n\t\tif ($this->logged()) {\n\t\t\treturn $_SESSION['auth']['id'];\n\t\t}\n\t\treturn false;\n\t}",
"public static function getLoggedInUserId(): ?int\n {\n // Check whether user is logged in\n if (!self::loggedIn()) {\n return null;\n }\n // If loggedIn return ID\n return self::getUser()->id;\n }",
"public function get_user_id();",
"static public function getUserId(){\n if (!isset($_SESSION['id']) || empty($_SESSION['id']) ){\n return false;\n } else {\n return $_SESSION['id'];\n }\n }",
"public function getUserId() {\n if (isset($_SESSION) && isset($_SESSION[self::SESSION_FIELD_USER_ID])) {\n return $_SESSION[self::SESSION_FIELD_USER_ID];\n } else {\n return null;\n }\n }",
"public function getCurrentUserId()\n\t{\n\t\treturn array_key_exists('user_id', $this->session->data) ? $this->session->data['user_id'] : 0;\n\t}",
"public function get_id_user()\n {\n return (isset($this->_id_user)) ? $this->_id_user : null;\n }",
"public static function getCurrentUserId(){\n $user_data = parent::getSession('curent_user');\n $_get_id_user = isset($_GET['id_user']) ? $_GET['id_user'] : null;\n $_post_id_user = isset($_POST['id_user']) ? $_POST['id_user'] : null;\n return\n self::is_SuperUserSession()\n ? ($_post_id_user ? $_post_id_user : ( $_get_id_user ? $_get_id_user : $user_data['id_user'] ))\n : parent::getSession('id_user');\n }",
"function getLoggedInId()\n{\n\tif(isLoggedIn()) {\n\t\treturn auth()->user()->id;\n\t}\n\treturn null;\n}",
"public function get_logged_in_user_id()\n\t\t{\n\t\t\treturn $this->session->userdata('usr_id');\n\t\t}",
"public function getUserId()\r\n\t{\r\n\t\t$user = parent::getUser();\r\n\t\tif(!($user instanceof User))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $user->getId();\r\n\t}",
"private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }",
"public function loggedInUserId()\n\t{\n\t\treturn auth()->id();\n\t}",
"public static function getUserId() {\n if(self::$_identity) {\n return self::$_identity->userid;\n }\n return null;\n }",
"public function getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }",
"public function getCurrentUserId();",
"public function getUserId() {\n\t\t$currentUser = $this->getLoggedUser();\n\t\tif ($currentUser) {\n\t\t\treturn $currentUser->getId();\n\t\t}\n\t}",
"public function get_user_id()\n {\n return self::getUser();\n }",
"public function getUserId() {\n return $this->user === null ? null : $this->user->id;\n }",
"public function getUserId() {\n\t\t\tif ($this->getUser() !== null) {\n\t\t\t\treturn $this->getUser()->getId();\n\t\t\t}\n\t\t\treturn null;\n\t\t}",
"public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }",
"public function getUserId() {\n\t\treturn $this->Session->read('UserAuth.User.id');\n\t}",
"function user_id() {\n isset($this->_user_id) || $this->_load_from_session();\n return $this->_user_id;\n }",
"public static function GetCurrentUserId() {\n try {\n $token = Helper::GetCookies('token');\n $now = new \\DateTime(date('Y-m-d H:i:s'));\n if(!isset($token) || $token == '' || $token == null) {\n return 0;\n }\n else {\n $userDB = DB::table('users')\n ->where('token', $token)\n ->where('timeout', '>=', $now)\n ->where('deleted_at', null)\n ->select('id')\n ->get()->toArray();\n if (isset($userDB) && !empty($userDB)) {\n return $userDB[0]->id;\n }\n }\n return 0;\n }\n catch(Exception $e) {\n throw $e;\n }\n }",
"function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }",
"public function getLoggedUserId()\n {\n if (isset($this->user_data['id_user'])) {\n return intval($this->user_data['id_user']);\n } else {\n return false;\n }\n }",
"private function getLoggedInUserId() {\n if ( !isset($_SESSION['idUtente']) ) {\n throw new EmmaDashboardServiceSessionException(\"Not a logged in user.\");\n }\n return $_SESSION['idUtente'];\n }",
"public function getUserid()\n {\n if ($this->_userid === false) {\n $this->_userid = Userlogin::find()->where(['id' => Yii::$app->user->identity->id])->one();\n }\n return $this->_userid;\n }",
"function loggedInUserId() {\n\n\tif (isLoggedIn()) {\n\t\t$username = $_SESSION['username'];\n\t\t$result = queryDb(\"SELECT * FROM users WHERE username = '{$username}'\");\n\t\tconfirm($result);\n\t\t$user = mysqli_fetch_array($result);\n\t\treturn mysqli_num_rows($result) > 0 ? $user['user_id'] : false;\n\t}\n\n\treturn false;\n}",
"function get_current_user_id()\n {\n }",
"public static function getUserId(): ?string\n {\n if (Self::checkIsLogged()) {\n if (!isset($auth)) {\n $auth = new Auth(DbManager::openDB(), null, null, false);\n }\n return $auth->getUserId();\n } else {\n return null;\n }\n\n }",
"protected static function getCurrentUserId()\n {\n return null;\n }",
"function getUserId(){\n if(empty($_COOKIE['heyo'])) return false;\n \n $userIdResult = $this->sql->prepare('SELECT userId FROM user_logins WHERE cookie = ? AND loggedIn = TRUE AND dateLogged > ? LIMIT 1')->bindString($_COOKIE['heyo'])->bindString($this->loginMaxAge)->execute()->getResult();\n \n if(!$userIdResult->num_rows) return false;\n \n return $userIdResult->fetch_assoc()['userId'];\n }",
"function getUserId()\n {\n if($this->isLogin())\n { \n return $this->ci->session->userdata('userId');\n }\n else\n {\n return false;\n } \n }",
"public static function getCurrentUser(){\r\n\t\treturn self::isLoggedIn() == true ? User::getUserById($_SESSION[\"id\"]) : null;\r\n\t}",
"public function getUserID () {\n return $this->id;\n }",
"public function getUserId()\n {\n $value = $this->get(self::user_id);\n return $value === null ? (integer)$value : $value;\n }",
"static public function get_user_id()\n\t{\n\t\tif (isset($_SESSION[self::$cookie_name_prefix .self::USER_ID]))\n\t\t\treturn $_SESSION[self::$cookie_name_prefix .self::USER_ID];\n\t\telse\n\t\t\treturn null;\n\t}",
"public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}",
"public function getUserId()\n {\n if (sfContext::hasInstance())\n {\n if ($userId = sfContext::getInstance()->getUser()->getAttribute('user_id'))\n {\n return $userId;\n }\n }\n return 1;\n }",
"public static function getLoggedUserId()\r\n {\r\n return self::getVariable(\"login\", \"user-id\");\r\n }",
"public function getIduser()\n {\n return $this->iduser;\n }",
"public function user_id()\n\t{\n\t\tif ($this->logged_in())\n\t\t{\n\t\t\treturn $this->_facebook->getUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->login_url();\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"function current_user_id()\n{\n $user = \\Yii::$app->user;\n $user_id = $user->getId();\n return is_numeric($user_id) ? $user_id : 0;\n}",
"public function user_id()\n {\n if($this->logged_in())\n {\n $this->uid = $this->fb->getUser();\n\n return $this->uid;\n } \n else \n {\n return FALSE;\n }\n }",
"function getMyID()\n{\n $ci =& get_instance();\n $user = $ci->ion_auth->user()->row();\n if(isset($user->id)) {\n return $user->id;\n }else{\n \treturn null;\n }\n}",
"public function getIdUser()\n {\n return $this->id_user;\n }",
"public function getIdUser()\n {\n return $this->id_user;\n }",
"public function getIdUser()\n {\n return $this->id_user;\n }",
"public function getIdUser() \n\t{\n\t\treturn $this->idUser;\n\t}",
"public static function getUserId() {\n $returnValue = 0;\n if (isset($_SESSION[\"userid\"])) {\n $returnValue = $_SESSION[\"userid\"];\n }\n return $returnValue;\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 getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function getId_user()\n {\n return $this->id_user;\n }",
"public function getId_user()\n {\n return $this->id_user;\n }",
"public function getId_user()\n {\n return $this->id_user;\n }",
"public function getId_user()\n {\n return $this->id_user;\n }",
"public function getIdUser()\n {\n return $this->idUser;\n }",
"public function getIdUser()\n {\n return $this->idUser;\n }",
"public function getUserID() {\n\t\treturn $this->_user_id;\n\t}",
"protected function getUserId()\n {\n return object_get($this->getUser(), 'profile_id', $this->getDefaultProfileId() );\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->user_id;\n }",
"public function getId_user()\n {\n return $this->_id_user;\n }",
"public function getId_user()\n {\n return $this->_id_user;\n }",
"public function getUserId()\n {\n return (int) $this->_getVar('user_id');\n }",
"Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}",
"public function getUserId() {\n\t\treturn $this->user_id;\n\t}",
"public function getUserId()\n {\n return $this->id;\n }",
"private function getLoggedInUser()\n {\n if (null !== $token = $this->securityContext->getToken()) {\n return $token->getUser();\n }\n\n return null;\n }",
"public static function get_current_user_id() {\n\n if( is_user_logged_in() ) {\n return get_current_user_id();\n }\n\n return false;\n }",
"public function get_user_id() {\n\t\treturn $this->user_id;\n\t}",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();"
]
| [
"0.8263893",
"0.81541145",
"0.8145819",
"0.81417316",
"0.81185555",
"0.80466735",
"0.80322444",
"0.80133724",
"0.8012577",
"0.8008255",
"0.80016834",
"0.79807526",
"0.79715383",
"0.79690707",
"0.79651433",
"0.7948211",
"0.79187244",
"0.79127806",
"0.791074",
"0.79080254",
"0.7882327",
"0.78816617",
"0.78682137",
"0.780854",
"0.78029835",
"0.7801808",
"0.7791017",
"0.77864385",
"0.7773119",
"0.77698565",
"0.77599645",
"0.7759643",
"0.7753864",
"0.77323073",
"0.77295667",
"0.7720486",
"0.77185696",
"0.7705865",
"0.77053785",
"0.769854",
"0.76977503",
"0.7691064",
"0.76469207",
"0.76410925",
"0.7640553",
"0.76392245",
"0.7639079",
"0.7635131",
"0.7635131",
"0.7635131",
"0.7633536",
"0.76332533",
"0.76322585",
"0.76322585",
"0.76322585",
"0.76321983",
"0.76234907",
"0.76234907",
"0.76234907",
"0.76234907",
"0.76203936",
"0.76203936",
"0.76175755",
"0.76103944",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7609391",
"0.7608696",
"0.7608696",
"0.75985646",
"0.7597587",
"0.7590188",
"0.75869966",
"0.7582763",
"0.75771034",
"0.75741506",
"0.75685513",
"0.75685513",
"0.75685513",
"0.75685513",
"0.75685513",
"0.75685513",
"0.75685513"
]
| 0.0 | -1 |
returns the account ID, returns null if something went wrong | function getAccountID () {
//checks if the user is logged in
if (checkLogin()) {
//gets the ID
$ID = getPersonID();
//setup sql query
$sql = "SELECT AccountID FROM accounts WHERE PersonID = $ID";
//runs the query
$stmt = runQuery($sql);
//checks if we found atleast 1 account
if ($stmt->rowCount() > 0) {
$row = $stmt->fetch();
//returns the ID
return $row['AccountID'];
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAccountID();",
"public function getAccountID()\n {\n return $this->accountID;\n }",
"public function getAccountID()\n {\n return $this->accountID;\n }",
"public function getAccountId(): ?string\n {\n return $this->_account_id;\n }",
"public function GetAccountID () \r\n\t{\r\n\t\treturn ($AccountID);\r\n\t}",
"public function getAccountId(): ?string {\n return $this->accountId;\n }",
"public function getAccountReference()\n {\n if (isset($this->data['object']) && 'account' === $this->data['object']) {\n return $this->data['id'];\n }\n\n return null;\n }",
"public function getAccountId(){\n\t\t$sResult = null;\n\t\tif (!empty($this->aLinks) && isset($this->aLinks[0])){\n\t\t\t/**\n\t\t\t * @var BeezupOMLink\n\t\t\t */\n\t\t\t$oLink = $this->aLinks[0];\n\t\t\t$aAtoms = explode('/', $oLink->getHref());\n\t\t\tif (isset($aAtoms[6]) && $aAtoms[4] == $this->getMarketPlaceTechnicalCode() && $aAtoms[6]== $this->getBeezupOrderUUID() && is_numeric($aAtoms[5])){\n\t\t\t\treturn $aAtoms[5];\n\t\t\t}\n\n\t\t}\n\t\treturn null;\n\t}",
"public function getAccountID()\n {\n return $this->getKey('AccountID');\n }",
"public function getAccountId()\n {\n return $this->account_id;\n }",
"public function getAccountId()\n {\n return $this->account_id;\n }",
"public function getAccountId(){\n $value = \\Auth::user()->account_id;\n return $value;\n }",
"public function GetAccountID() : int\n\t{\n\t\treturn gmp_intval( $this->Get( 0, '4294967295' ) ); // 4294967295 = 0xFFFFFFFF\n\t}",
"public function getId()\n {\n return $this->getProperty('account_id', 'int');\n }",
"public function getAccount_id()\n {\n return $this->fv_account_id;\n }",
"function getAccountId($account_name)\n\t{\n\t\t global $log;\n $log->info(\"in getAccountId \".$account_name);\n\t\tglobal $adb;\n\t\tif($account_name != '')\n\t\t{\n\t\t\t$sql = \"select accountid from ec_account where accountname='\".$account_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$accountid = $adb->query_result($result,0,\"accountid\");\n\t\t}\n\t\treturn $accountid;\n\t}",
"public function getAccount(): ?string\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return isset($this->account) ? $this->account : null;\n }",
"function getAccountId($acctid = '') {\n if ($acctid) $this->acctid= $acctid;\n\n if (!$acctid) {\n $data = $this->_callResource('/a/');\n $this->acctid = $data['accounts'][0]['accountId']; \n } \n\n return $this->acctid;\n }",
"public function getAccount(): ?Account\n\t{\n\t\treturn $this->client()->getAccount($this->accountId);\n\t}",
"public function getAccountId()\n {\n return $this->accountId;\n }",
"public function getAccountId()\n {\n return $this->accountId;\n }",
"public function accountId(): string\n {\n return $this->accountId;\n }",
"public function accountId(): string\n {\n return $this->accountId;\n }",
"public function getId()\n {\n $session = new Zend_Session_Namespace('Unodor_Account');\n return $session->idaccount;\n }",
"public function getAccountId()\n {\n return $this->id;\n }",
"public function getAccount()\n {\n return isset($this->Account) ? $this->Account : null;\n }",
"public function getAccountId()\n {\n try {\n $storeId = $this->storeManager->getStore()->getId();\n $apiKey = $this->config->getApiKey($storeId);\n if (empty($apiKey)) {\n return '';\n }\n $parts = explode('-', $apiKey);\n return $parts[0];\n } catch (NoSuchEntityException $e) {\n return '';\n }\n }",
"public function getAccountNumber(): ?string\n {\n return $this->accountNumber;\n }",
"public function getAccountId()\n {\n return $this->getParameter('accountId');\n }",
"public function getUserAccountPublicId();",
"public function getAccountNumber()\n {\n return $this->helper->accountNumber();\n }",
"public function getAccountingID() {\n if ($this->getParameter('accounting_id')) {\n return $this->getParameter('accounting_id');\n }\n return null;\n }",
"public function getAccountNumber()\n {\n return $this->account_number;\n }",
"public function getAccountNumber()\n {\n return $this->account_number;\n }",
"public function getAccountNumber()\r\n\t{\r\n\t\tif ($this->accountNumber)\r\n\t\t\treturn $this->accountNumber;\r\n\t\t\r\n\t\t$aid = UserFilesGetCatAccount($this->dbh, $this->folderId);\r\n\r\n\t\tif (!$aid)\r\n\t\t{\r\n\t\t\t$asys = new AntSystem();\r\n\t\t\t$ainfo = $asys->getAccountInfoByDb($this->dbh->dbname);\r\n\t\t\t$aid = $ainfo['id'];\r\n\t\t}\r\n\r\n\t\tif ($aid)\r\n\t\t\t$this->accountNumber = $aid;\r\n\t\t\r\n\t\treturn $aid;\r\n\t}",
"function get_account() {\n\t\t// $pos = $this->add_request( __FUNCTION__ );\n\t\t$pos = $this->add_request( 'getaccount' );\n\t\t$this->send_request();\n\t\t$r = $this->response_part( $pos );\n\t\tif ( isset( $r->account ) && !is_null( $r->account->email ) )\n\t\t\treturn $r->account;\n\t\treturn false;\n\t}",
"function emetteur_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_emetteur\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }",
"public function getAccountUid()\n {\n return $this->getProperty('paymentAccountUid');\n }",
"public function getAccountCode();",
"public function getAccountCode();",
"public function getAccount($account_id)\n\t{\n\t\t$arr = DB::select('SELECT * FROM accounts WHERE account_id = ?', [$account_id]); \n\n\t\tif ($arr[0]) {\n\t\t\treturn $arr[0];\n\t\t} else {\n\t\t\treturn ['status' => 'error', 'error' => 'Ups!!! No accounts.'];\n\t\t}\n\t}",
"public function getAccountNo()\n {\n return $this->account_no;\n }",
"public function getExternalAccount(): ?string\n {\n return $this->externalAccount;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public static function getAccount ($id = null) {\n if (!$id) { \n $id = session::getUserId();\n }\n $db = new db();\n $row = $db->selectOne('account', 'id', $id);\n return $row;\n }",
"public function getAccount() {\n return $this->account;\n }",
"public function getLoggedInUserAccount() {\n\t\tLoggerRegistry::debug('CustomerModule::getLoggedInUserAccount()');\n\t\t$account = null;\n\t\t$email = $this->getEngine()->getUserManager()->getLoggedInUserEmail();\n\t\tif (!is_null($email)) {\n\t\t\t$account = $this->getRepository('Account')->findOneBy(array( 'email' => 'ben@leftclick.com.au' ));\n\t\t\tif (is_null($account)) {\n\t\t\t\t$account = new Account();\n\t\t\t\t$account->setEmail($email);\n\t\t\t\t$this->getEngine()->doctrine()->getEntityManager()->persist($account);\n\t\t\t}\n\t\t}\n\t\treturn $account;\n\t}",
"public static function account_id($accountName, $uName) {\n\t\t\treturn self::valid($account = self::account_named($accountName, $uName)) ? $account->accountId : $account;\n\t\t}",
"public function getAccountNo()\n {\n return $this->accountNo;\n }",
"public function getOwnerId($idaccount)\n {\n $idowner = $this->_dbTable->getRow(array('idaccount' => $idaccount, 'owner' => 1), array('iduser'));\n Zend_Debug::dump($idowner);\n return $idowner;\n }",
"public function getAccountName(): ?string {\n return $this->accountName;\n }",
"public static function account($accountId) {\n //Return the information for $accountId\n return self::get('accounts/' . $accountId);\n }",
"public function getAccountToken(): ?string\n {\n return $this->accountToken;\n }",
"function beneficiaire_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_beneficiaire\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }",
"public function id()\n {\n if ($this->user()) {\n return $this->user()->getAuthIdentifier();\n }\n return null;\n }",
"public function getAccount();",
"public function getAccount(): ?stdClass\n {\n return $this->account;\n }",
"public function getAccountKey()\n {\n return $this->accountKey;\n }",
"private function getUserId()\n {\n $company = $this->getCompany();\n\n if (!isset($company['user']['id'])) {\n throw new BiglionException('User \"id\" not defined', 1);\n }\n\n return $company['user']['id'];\n }",
"public function socialAccountId($socialAccountId)\r\n\t{\r\n\t\t$data = Mage::getModel('ezloginlite/ezloginliteaccounts')->getCollection()\r\n\t\t\t\t->AddFieldToFilter('account_name', $socialAccountId)\r\n\t\t\t\t->getData();\r\n\t\t\r\n\t\t$ezLoginAccountId = $data[0]['account_id'];\r\n\t\r\n\t\treturn $ezLoginAccountId;\r\n\t}",
"public function resolveaccount()\n {\n //\n $thePaystack = new Paystack();\n return $thePaystack->resolveAccountNumber();\n }",
"function get_account_id($account_name){\n $arResult = sendCurl('get_account_id', [$account_name]);\n return $arResult;\n}",
"public static function current_id():int|null\n {\n try {\n return Auth::user()->activeProfile->id ?? null;\n } catch (\\Throwable $e) {\n report($e);\n }\n return null;\n }",
"public function getAccount(int $accountNumber): Account\n {\n foreach ($this->_accounts as $account) {\n if ($accountNumber == $account->getAccountNumber()) {\n return $account;\n }\n }\n return null;\n }",
"public static function get ($id) {\n // Retrieve account resources.\n $account = Json::get('account', $id);\n\n // If account resource is not avaiable, internal server error.\n if ($account == 1)\n return 1;\n if ($account == 2)\n return 2;\n\n // Account found.\n return $account;\n }",
"public function account() {\n $connection = new HTTPConnector($this);\n $url = $this->credential->getRequestUrl(BitcasaConstants::METHOD_USER . BitcasaConstants::METHOD_PROFILE);\n if (!BitcasaUtils::isSuccess($connection->get($url))) {\n return null;\n }\n\n $response = $connection->getResponse(true);\n\n $accountInfo = Account::getInstance($response);\n return $accountInfo;\n }",
"public function getAccountIDForEmail( $aEmailAddr=null )\n\t{\n\t\tif( ! isset($aEmailAddr) ) return null ;\n\t\t\n\t\t$theSql = SqlBuilder::withModel($this->model)\n\t\t\t->startWith( 'SELECT account_id, auth_id FROM ' )\n\t\t\t->add( $this->model->tnAuth )\n\t\t\t->startWhereClause()\n\t\t\t->mustAddParam( 'email', $aEmailAddr )\n\t\t\t->add( ' AND verified_ts IS NOT NULL' )\n\t\t\t->endWhereClause()\n\t\t\t// Get only the newest account.\n\t\t\t->applyOrderByList(array(\n\t\t\t\t\t'created_ts' => SqlBuilder::ORDER_BY_DESCENDING,\n\t\t\t))\n\t\t\t->add('LIMIT 1')\n\t\t\t;\n\t\t$theAuthRecord = $theSql->getTheRow();\n\t\tif ( !empty($theAuthRecord) ) {\n\t\t\t$this->myEmailAddr = $aEmailAddr;\n\t\t\t$this->myAccountID = $theAuthRecord['account_id'];\n\t\t\t$this->myAuthID = $theAuthRecord['auth_id'];\n\t\t\treturn $this->myAccountID;\n\t\t}\n\t}",
"protected function getAccount(): AccountInterface\n {\n if ($this->hasAccount()) {\n return $this->account;\n }\n\n throw new MissingAccount();\n }",
"private function fetchAccountID($accountNumber)\n {\n $accounts = $this->getJson(\"/accounts\");\n if (isset($accounts['accounts']))\n {\n syslog(LOG_DEBUG, \"Monzo: Looking for account ID\");\n // Loop through all accounts and find the ID of configured bank account number.\n foreach ($accounts['accounts'] as $account)\n {\n if (array_key_exists(\"account_number\", $account) && $account['account_number'] == $this->accountNumber)\n {\n return $account['id'];\n }\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: No accounts found\");\n return false;\n }\n }",
"private function getResourceAccount()\n\t{\n\t\tif (!$this->account) {\n\t\t\t$payload = [\n\t\t\t\t'onlyReturnExisting' => true,\n\t\t\t];\n\n\t\t\t$this->requestResource('POST', ResourcesDirectory::NEW_ACCOUNT, $payload);\n\t\t\t$this->account = $this->getHttpClient()->getLastLocation();\n\t\t}\n\n\t\treturn $this->account;\n\t}",
"public function GetId() {\n\t\t\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['id'];\n\t}",
"public function setupAccountIfNeeded($accountId)\r\n\t\t{\r\n\t\t\tif(isset($accountId))\r\n\t\t\t{\r\n\t\t\t\tif($accountId <= 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Generate a new account\r\n\t\t\t\t\t$this->Create();\r\n\t\t\t\t\t$data = array(\r\n\t\t\t\t\t\t'Account' => array(\r\n\t\t\t\t\t\t\t'payment_ref' => $this->generateUniquePaymentRef(),\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tif( $this->save($data, array('fieldList' => array('account_id', 'payment_ref'))) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// New account is ok\r\n\t\t\t\t\t\t$accountId = $this->getID();\r\n\t\t\t\t\t\treturn $accountId;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// New account creation failed\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Attempt to find an account with this id\r\n\t\t\t\t\tif( $this->find('first', array('conditions' => array('account_id' => $accountId))) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// All good\r\n\t\t\t\t\t\treturn $accountId;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t}",
"public function getIcAccountId()\n {\n return $this->ic2ps->getIcAccountId();\n }",
"public static function resolveId()\n {\n return Auth::check() ? Auth::user()->getAuthIdentifier() : null;\n }",
"public static function getCurrentAccount() {\n $billing_account = FALSE;\n $uid = \\Drupal::currentUser()->id();\n if ($uid > 0) {\n $billing_account = self::getUserAccount($uid);\n }\n return $billing_account;\n }",
"public static function resolveId()\n\t{\n\t\treturn auth()->guard('api')->check() ? auth()->guard('api')->user()->getAuthIdentifier() : null;\n\t}",
"function getMyID()\n{\n $ci =& get_instance();\n $user = $ci->ion_auth->user()->row();\n if(isset($user->id)) {\n return $user->id;\n }else{\n \treturn null;\n }\n}",
"public static function getUserIdFromAccountId($AccountID)\n {\n v::int()->positive()->assert($AccountID);\n $db = \\RANDF\\Database::getInstance('pei');\n\n $sql = \"\n SELECT\n `UserID`\n FROM\n `User`\n WHERE\n `AccountID` = \" . $db->quote($AccountID);\n $rows = $db->query($sql);\n\n if ($rows->rowCount() == 1) {\n $row = $rows->fetch(PDO::FETCH_ASSOC);\n\n return $row['UserID'];\n } else {\n return false;\n }\n }",
"public static function getAccountById($account_id){\n $stmt = Dbh::connect() ->PREPARE(\"SELECT * FROM accounts WHERE account_id=?\");\n $stmt->execute([$account_id]);\n $account = array();\n if($stmt->rowCount()){\n while ($row = $stmt->fetch()){\n $account = array(\"id\"=>$row['account_id'], \"email\"=>$row['email'], \"firstName\"=>$row['first_name'], \"lastName\"=>$row['last_name'],\n \"type\"=>$row['account_type'],\"password\"=>$row['password'],\"subscription\"=>$row['subscription']);\n }\n return $account;\n } else {\n\t\t\treturn false;\n\t\t}\n }",
"public static function resolveId()\n {\n return auth()->check() ? auth()->user()->getAuthIdentifier() : null;\n }",
"public function getUserId() {\n $response = $this->execute(array('method' => 'flickr.auth.checkToken'), 60);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['auth']['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 }",
"function getPersonID () {\r\n if (checkLogin()) {\r\n $stmt = runQuery(\"SELECT PersonID FROM people WHERE LogonName = \" . $_SESSION['user']['name']);\r\n if ($stmt->rowCount() > 0) {\r\n $row = $stmt->fetch();\r\n //return the ID\r\n return $row['PersonID'];\r\n }\r\n }\r\n //returns null by default\r\n return null;\r\n}",
"public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }",
"public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }",
"public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }",
"protected function getUserId(): int|string|null\n {\n if (!isset($this->userId)) {\n $this->userId = Auth::guard(config('nova.guard'))->id() ?? null;\n }\n\n return $this->userId;\n }",
"public function getLoyaltyAccountId(): string\n {\n return $this->loyaltyAccountId;\n }",
"function getAccount($userID = null) {\n\t\treturn $this->getInstance('Account', $userID);\n\t}",
"protected function QueryForID_() {\n $table = Database::GetAccountTypeTableName($this->accountType);\n $queryStr = \"SELECT id FROM {$table} WHERE username='{$this->username}';\";\n\n $result = $this->db->sql->query($queryStr);\n\n if ($result && $result->num_rows > 0) {\n $this->id = $result->fetch_assoc()[\"id\"];\n $result->free();\n }\n }",
"public static function getAccount(string $type, int $id = 0) {\n $account = self::query($type, $id);\n if (!$account) {\n $account = self::createAccount($type, $id);\n }\n return $account;\n }",
"private function GetAccountDetails()\n\t{\n\t\t$customer_id = $this->getCustomerId();\n\t\tif(!$customer_id)\n\t\t{\n\t\t\tlogAdd(LOG_SEVERITY_ERROR, 'Se intento editar un WebUsuario con id \"'.$this->getData('ID').'\" invalido');\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = sprintf(\"select * from [|PREFIX|]customers where customerid='%d'\", $GLOBALS['ISC_CLASS_DB']->Quote($customer_id));\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t$row = $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\n\t\tif ($row !== false) {\n\t\t\treturn $row;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function getAccountIdFromToken($token)\n {\n $decrypted = self::decryptToken($token);\n\n // list($tokenExpires, $AccountID, $sessionStarted) =\n $decrypted = explode('|', $decrypted);\n if (count($decrypted) === 3) {\n return $decrypted[1];\n } else {\n return false;\n }\n }",
"public static function getParameterKeyAccountId()\n {\n return config('consts.ParameterAccountId');\n }",
"public function getAccount()\n {\n return $this->container->get('user')->getAccount();\n }"
]
| [
"0.8514778",
"0.8049692",
"0.8049692",
"0.80385184",
"0.79249525",
"0.7712214",
"0.76037264",
"0.7579579",
"0.75115335",
"0.74934083",
"0.74934083",
"0.74344516",
"0.74037766",
"0.7359005",
"0.73302644",
"0.7298921",
"0.71770495",
"0.70956665",
"0.70711666",
"0.7056128",
"0.70268273",
"0.70268273",
"0.70184547",
"0.70184547",
"0.70084983",
"0.69605196",
"0.69515425",
"0.693674",
"0.6924261",
"0.69134593",
"0.6817133",
"0.67284364",
"0.6676832",
"0.66759455",
"0.66759455",
"0.66192937",
"0.6612727",
"0.6610271",
"0.6596499",
"0.6564585",
"0.6564585",
"0.65403575",
"0.6528051",
"0.65238047",
"0.6496829",
"0.6496829",
"0.6496829",
"0.6496829",
"0.6496829",
"0.6496829",
"0.64958644",
"0.6465982",
"0.64607286",
"0.64541197",
"0.6449267",
"0.6425625",
"0.6420528",
"0.6393004",
"0.6389452",
"0.6347997",
"0.6332767",
"0.63258386",
"0.6303697",
"0.62961423",
"0.62813145",
"0.6261398",
"0.6251208",
"0.62442183",
"0.62322277",
"0.62313336",
"0.6206972",
"0.6197975",
"0.6154733",
"0.61384314",
"0.61320317",
"0.6127087",
"0.61183417",
"0.6116802",
"0.6114385",
"0.6106091",
"0.6099302",
"0.60898703",
"0.6088855",
"0.60870427",
"0.60831255",
"0.6076695",
"0.607187",
"0.60641474",
"0.6056274",
"0.6056274",
"0.6056274",
"0.6054852",
"0.6050201",
"0.60273254",
"0.6023556",
"0.60194325",
"0.60160094",
"0.6015444",
"0.6006069",
"0.60057026"
]
| 0.7728484 | 5 |
sets the current user | function setUser ($user, $hash) {
$_SESSION['user'] = [
'name' => $user,
'hash' => $hash
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function set_current_user()\n\t{\n\t\tif (class_exists('Auth'))\n\t\t{\n\t\t\t// Load our current logged in user for convenience\n\t\t\tif ($this->auth->is_logged_in())\n\t\t\t{\n\t\t\t\t$this->current_user = clone $this->auth->user();\n\n\t\t\t\t$this->current_user->user_img = gravatar_link($this->current_user->email, 22, $this->current_user->email, \"{$this->current_user->email} Profile\");\n\n\t\t\t\t// if the user has a language setting then use it\n\t\t\t\tif (isset($this->current_user->language))\n\t\t\t\t{\n\t\t\t\t\t$this->config->set_item('language', $this->current_user->language);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Make the current user available in the views\n\t\t\tif (!class_exists('Template'))\n\t\t\t{\n\t\t\t\t$this->load->library('Template');\n\t\t\t}\n\t\t\tTemplate::set('current_user', $this->current_user);\n\t\t}\n\t}",
"public function setCurrentUser($user){\n $this->user = $user;\n }",
"public function setUser()\n\t{\n\t\t$user = User::getInstance();\n\t\t\n\t\tif ( $this->session->get( 'user_id' ) ) {\n\t\t\t$user->set( 'id', $this->session->get( 'user_id' ) );\n\t\t\t$user->read();\n\t\t}\n\t}",
"public function setCurrentUser($user){\n $_SESSION['user'] = $user;\n }",
"function set_current_user($id, $name = '')\n {\n }",
"public function setCurrentUser($name);",
"public function setCurrentUserId($currentUserId){\n $this->currentUserId = $currentUserId;\n }",
"function set_user($user)\n\t{\n\t\t$this->user=$user;\n\t}",
"public function setLoggedUser(){\n\t\tif(isset($_SESSION['ccUser']) && !empty($_SESSION['ccUser'])){\n\t\t\t$id = $_SESSION['ccUser'];\n\n\t\t\t$sql = $this->db->prepare(\"SELECT * FROM users WHERE id = :id\");\n\t\t\t$sql->bindValue(':id', $id);\n\t\t\t$sql->execute();\n\n\t\t\tif($sql->rowCount() > 0){\n\t\t\t\t$this->userInfo = $sql->fetch();\n\t\t\t\t$this->permissions = new Permissions();\n\t\t\t\t$this->permissions->setGroup($this->userInfo['id_group']);\n\t\t\t}\n\t\t}\n\t}",
"public function setLoggedUser(){\n\t\tif(isset($_SESSION['ccUser']) && !empty($_SESSION['ccUser'])){\n\t\t\t$id = $_SESSION['ccUser'];\n\n\t\t\t$sql = $this->db->prepare(\"SELECT * FROM users WHERE id = :id\");\n\t\t\t$sql->bindValue(':id', $id);\n\t\t\t$sql->execute();\n\n\t\t\tif($sql->rowCount() > 0){\n\t\t\t\t$this->userInfo = $sql->fetch();\n\t\t\t\t$this->permissions = new Permissions();\n\t\t\t\t$this->permissions->setGroup($this->userInfo['id_group']);\n\t\t\t}\n\t\t}\n\t}",
"function wp_set_current_user($id, $name = '')\n {\n }",
"public function set_current_user($userdata)\n\t{\n\t\t$this->CI->session->set_userdata('userid', $userdata['id']);\n\t\t$this->current_user = $userdata;\n\t}",
"public function set_user($user) {\n $this->user = $user;\n }",
"private function __setAuthUser()\n {\n $authUser = $this->request->session()->read('Auth');\n\n $accountType = 'FREE';\n if (!empty($authUser)) {\n $accountType = $authUser['User']['account_type'];\n }\n\n $this->set(compact('authUser', 'accountType'));\n }",
"public function setUser($user)\n {\n $this->user = Auth::user();\n }",
"function setUser( $user )\r\n {\r\n if ( is_a( $user, \"eZUser\" ) )\r\n {\r\n $userID = $user->id();\r\n\r\n $this->UserID = $userID;\r\n }\r\n }",
"public function set()\n\t{\n\t\t$this->created_at = date(TIMESTAMP_FORMAT);\n $user = new SessionUser();\n\t\t$this->created_by = $user->getID();\t\t\n\t}",
"private function __setUser() {\n // Create the (helper) user object from the authenticated subject if present\n $subject = \\Native5\\Identity\\SecurityUtils::getSubject();\n if ($subject->isAuthenticated()) {\n $this->user = \\Akzo\\User\\Service::getInstance()->getUser(\n $subject->getPrincipal()['username'],\n $subject\n );\n }\n }",
"function set_user($user)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER, $user);\r\n }",
"function set_user($user)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER, $user);\r\n }",
"static function setCurrentUser($CurrentUser) {\n Ak::_staticVar('CurrentUser', $CurrentUser);\n }",
"public function set_current_user_id($id)\n {\n $this->current_user_id = $id;\n }",
"public function getCurrentUser(){\n $currentUser = $_SESSION['userdata'];\n\n // Sets the user object\n $this->setUser($currentUser->control);\n\n }",
"function setUser($usr) \n {\n\t\t\t$this->user = ((empty($usr)) ? \"root\" : $usr);\n\t\t}",
"private function _setDefaultUser()\n {\n $user = User::getDefaultUser();\n Globals::setUser($user);\n Zend_Auth::getInstance()->clearIdentity();\n }",
"public function setUser($user){\n\t\t$this->user = $user;\n\t}",
"public function getCurrentUser()\n {\n $userId = Security::getUserId();\n if (!empty($userId)) {\n $this->uid = $userId;\n }\n }",
"public function setUser( $user )\r\n {\r\n $this->_user = $user;\r\n }",
"public function setUser($user) {\r\n\t\t$this->user = $user;\r\n\t}",
"public function setUser($user)\n {\n $this->_user = $user;\n }",
"public function setUser($user) {\n\n $this->user = $user;\n }",
"private function setLoggedinUser($userId)\n {\n echo \"setting logged user\";\n $user = new User($userId, $this->db);\n $_SESSION['auth'] = $user->getUserObject();\n header(\"Refresh:0\");\n }",
"protected function setupAdminUser()\n {\n $GLOBALS['current_user'] = \\BeanFactory::getBean('Users')->getSystemUser();\n }",
"public function setUser($value)\n {\n if ($value !== null) {\n $this->_user = $value;\n } else {\n $this->_user = Zend_Gdata_Photos::DEFAULT_USER;\n }\n }",
"public function setUser($user)\n {\n $this->_user = $user;\n }",
"public function setUser($user = null) {\n if (empty($user)) {\n $this->user = $this->Auth->user();\n } else {\n $this->user = $user;\n }\n }",
"function setUser($user) {\n $this->userObject = $user;\n }",
"public function setUser($userId) {\n\t\t\t $_SESSION['userId'] = $userId;\n\t\t}",
"public static function setUser($user){\n $_SESSION[\"user\"] = $user;\n }",
"public function setCurrentUser(Apt_Model_User $_user)\n {\n $this->_currentUser = $_user;\n return $this;\n }",
"function setLoggedUser(pclib\\AuthUser $user)\n{\n\t$this->loggedUser = $user;\n\t$this->setSessionUser($user);\n}",
"public function setUserId() {\n $this->user_id = $user_id;\n }",
"public function setUser($user = null)\n {\n $this->user = $user;\n }",
"function SetUser(&$user)\n\t{\n\t\t$this->userId = $user->userId;\n\t}",
"public function setUser($info)\n {\n self::set('_user', $info);\n }",
"public function setUser($p_mVal) { $this->m_mUser = $p_mVal; }",
"public function setCurrentUser($user, $kind, $active){\n $_SESSION[\"name\"] = $user;\n $_SESSION[\"kind\"] = $kind;\n $_SESSION[\"active\"] = $active;\n }",
"public function setUser( User $user ) {\n\t\t$this->user = $user;\n\t}",
"public function setUser($aUser){\n $this->user = $aUser;\n }",
"private function _setGlobalsUser($userId)\n {\n $userTable = new User();\n $user = $userTable->find($userId)->current();\n Globals::setUser($user);\n }",
"public function setUser($user = null) {\n\t\t$this->_user = $user;\n\t\tif( ! empty($this->_user->screenname) ) {\n\t\t\t$this->getElement('name')->setValue($this->_user->screenname)->setAttribs(array('readonly' => 'readonly', 'class' => 'text text-med disabled'));\n\t\t}\n\t}",
"public function setUser($user) {\n\t\t$this->user = mb_strtolower($user);\n\t}",
"private function _setIdentity(){\n $this->_setUserData($this->getClassUser()->getIdentity());\n }",
"public function set_user($user)\n {\n if (is_object($user)) {\n $this->user = $user;\n\n // overwrite config with user preferences\n $this->config->set_user_prefs((array)$this->user->get_prefs());\n }\n\n $_SESSION['language'] = $this->user->language = $this->language_prop($this->config->get('language', $_SESSION['language']));\n\n // set localization\n setlocale(LC_ALL, $_SESSION['language'] . '.utf8', 'en_US.utf8');\n\n // workaround for http://bugs.php.net/bug.php?id=18556\n if (in_array($_SESSION['language'], array('tr_TR', 'ku', 'az_AZ')))\n setlocale(LC_CTYPE, 'en_US' . '.utf8');\n }",
"function setCurrentUserAsSender(){\n if( !SessionUser::isLoggedIn() ) return false;\n $this->From = SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN;\n $this->FromName = SessionUser::getProperty(\"firstname\").\" \".SessionUser::getProperty(\"lastname\").\" (\".SessionUser::getProperty(\"username\").\")\";\n }",
"protected function set_current_users_as_authenticated() {\n\t\tglobal $wpdb;\n\n\t\t// get all pending user IDs\n\t\t$user_ids = $this->get_users( 'pending', array( 'fields' => 'ID' ) );\n\n\t\t// set up the initial query\n\t\t$query = \"\n\t\t\tINSERT INTO {$wpdb->usermeta}\n\t\t\t\t(user_id, meta_key, meta_value)\n\t\t\tVALUES\n\t\t\";\n\n\t\t$query .= \" \";\n\n\t\t// set up our values array containing the inserted data\n\t\t$values = array();\n\n\t\tforeach ( $user_ids as $user_id ) {\n\t\t\t$values[] = \"({$user_id}, 'authentication', '1')\";\n\t\t}\n\n\t\t// add the values to our query\n\t\t$query .= implode( ', ', $values );\n\n\t\t// clear some memory while we're at it\n\t\t$user_ids = null;\n\t\t$values = null;\n\t\tunset( $user_ids, $values );\n\n\t\t// do the query!\n\t\t$wpdb->query( $query );\n\t}",
"public function setUser($user) {\r\n $this->user = $user;\r\n $user->setOurTeamMember($this);\r\n }",
"public function setIduser($value)\n {\n $this->iduser = $value;\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"function setRequestUser($value)\n {\n $this->_props['RequestUser'] = $value;\n }",
"static function setupUser()\n {\n global $sugar_config;\n require_once 'modules/Users/User.php';\n $_SESSION['unique_key'] = $sugar_config['unique_key'];\n $user_id = $GLOBALS['db']->getOne(\"SELECT id FROM users WHERE user_name='{$GLOBALS['bob_config']['global']['admin_user_name']}' AND is_admin=1\");\n if(empty($user_id)) {\n throw new Exception(\"Can't find user \".$GLOBALS['bob_config']['global']['admin_user_name'], 1);\n }\n $_SESSION['authenticated_user_id'] = $user_id;\n $GLOBALS['current_user'] = new User();\n $GLOBALS['current_user'] = $GLOBALS['current_user']->retrieve($user_id); \n }",
"public function setLastActionUser(){\n\t\t// nilai authtimeout user\n\t\tYii::$app->user->authTimeout;\n\n\t\t$user = User::findOne(Yii::$app->user->id);\n\t\t$user->last_action = date('Y-m-d H:i:s');\n\t\t$user->update();\n\t}",
"function set_authenticated( $user ) {\n\t\n\t$_SESSION['GHOME'] = \"yes\";\n\t$_SESSION['GHOME_CUSER'] = $user;\n}",
"public function openUser()\n {\n $this->isUser = true;\n }",
"public function _setAttribute($user) {\n $this->user_id = $user->id;\n $this->auth_key = \\Yii::$app->security->generateRandomString(); \n $this->status = self::STATUS_LOGIN;\n }",
"public function set_user_data($user_data)\n {\n Session::_start();\n Session::_set($user_data->id, \"user\", \"id\");\n Session::_set($user_data->name, \"user\", \"name\");\n Session::_set($user_data->email, \"user\", \"email\");\n }",
"protected function setUserModel()\n {\n if ($model = $this->getUserModel()) {\n Models::setUsersModel($model);\n }\n }",
"public function setWorkflowSlotUser() {\n $this->workflowSlotUser = WorkflowSlotUserTable::instance()->getUserBySlotId($this->nextStation->workflow_slot_id);#\n }",
"public function setUser(User $user) {\n if(is_null($this->user)) {\n $this->user = $user;\n }\n }",
"public static function setCurrentUser($return, $params = null){\n\t\t$UserObject = self::$UserService->setCurrentUser();\n\t\tCoreRender::setData('user', $UserObject);\n return $return;\n\t}",
"public function setUser(Authenticatable $user)\n {\n $this->user = $user;\n }",
"public function setAsCurrentUser($signalLoader = true, $resetSessionId = true)\n {\n // Get the current variables\n $oldStore = $this->_getVariableStore();\n\n // When $oldStore is a \\Zend_Session_Namespace, then this user is already the current user.\n if (! $this->isCurrentUser()) {\n $this->userLoader->unsetCurrentUser();\n\n if ($resetSessionId) {\n \\Zend_Session::regenerateId();\n }\n\n $this->_vars = $this->session;\n\n foreach ($oldStore as $name => $value) {\n $this->_vars->__set($name, $value);\n }\n\n if ($signalLoader) {\n $this->userLoader->setCurrentUser($this);\n }\n }\n\n $this->getCurrentOrganization()->setAsCurrentOrganization();\n\n return $this;\n }",
"protected function setupUser()\n {\n $user = \\App\\Models\\User::first();\n\n if (empty($user)) {\n $this->user = \\App\\Models\\User::factory()->create();\n } else {\n $this->user = $user;\n }\n\n $this->actingAs($this->user);\n }",
"private function setUserToBeImpersonated($userId)\r\n\t{\r\n\t\tif (!empty($userId)) {\r\n\t\t\tif (version_compare($this->laravel->version(), '5.2.0', '<')) {\r\n\t\t\t\t$userModel = config('auth.model');\r\n\t\t\t\t$user = $userModel::find($userId);\r\n\t\t\t\t$this->laravel['auth']->setUser($user);\r\n\t\t\t} else {\r\n\t\t\t\tif (!config('openapischemas.auth_provider')) {\r\n\t\t\t\t\t$this->error('You need to specify a \"auth_provider\" value in your openapischemas.php configuration file first.');\r\n\t\t\t\t\texit();\r\n\t\t\t\t}\r\n\t\t\t\t$provider = config('openapischemas.auth_provider');\r\n\t\t\t\t$userModel = config(\"auth.providers.$provider.model\");\r\n\t\t\t\tif (!config('auth.providers.' . $provider . '.model')) {\r\n\t\t\t\t\t$this->error('No model in your config/auth.php matching auth provider \"' . $provider . '\" from your openapischemas.php configuration file.');\r\n\t\t\t\t\texit();\r\n\t\t\t\t}\r\n\t\t\t\t$user = $userModel::find($userId);\r\n\t\t\t\t$auth_guard = config('openapischemas.auth_guard');\r\n\t\t\t\t$this->laravel['auth']->guard($auth_guard)->setUser($user);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function assign_user()\n\t{\n\t\tglobal $current_user;\n\t\t$ass_user = $this->column_fields[\"assigned_user_id\"];\t\t\n\t\tif( $ass_user != $current_user->id)\n\t\t{\n\t\t\t$result = $this->db->query(\"select id from ec_users where user_name = '\".$ass_user.\"' or last_name = '\".$ass_user.\"'\");\n\t\t\tif($this->db->num_rows($result) != 1)\n\t\t\t{\n\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t$row = $this->db->fetchByAssoc($result, -1, false);\n\t\t\t\tif (isset($row['id']) && $row['id'] != -1)\n \t {\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $row['id'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function saveToSession()\n {\n $_SESSION[PMF_SESSION_CURRENT_USER] = $this->getUserId();\n }",
"public static function setUser($user){\n \\Illuminate\\Auth\\Guard::setUser($user);\n }"
]
| [
"0.7985906",
"0.7841632",
"0.7697215",
"0.76384276",
"0.7406456",
"0.74041814",
"0.730794",
"0.72976184",
"0.7282597",
"0.7282597",
"0.7266005",
"0.7264962",
"0.7254778",
"0.7198185",
"0.7097074",
"0.7092334",
"0.7079187",
"0.7049856",
"0.7038389",
"0.7038389",
"0.7038266",
"0.7010388",
"0.7003139",
"0.700034",
"0.6966899",
"0.6953898",
"0.69498557",
"0.6942311",
"0.6919638",
"0.69182456",
"0.6913305",
"0.69052047",
"0.6861687",
"0.6855272",
"0.6802622",
"0.6779317",
"0.6772891",
"0.6772098",
"0.6757276",
"0.6719802",
"0.67137235",
"0.6650975",
"0.662542",
"0.6612056",
"0.65812767",
"0.6577236",
"0.6577086",
"0.6568377",
"0.6554393",
"0.6553915",
"0.65465367",
"0.64937943",
"0.6457123",
"0.6448652",
"0.643533",
"0.6412641",
"0.6405116",
"0.6396411",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6392616",
"0.6384619",
"0.63583106",
"0.63240814",
"0.63220376",
"0.63158566",
"0.6286358",
"0.62834877",
"0.6276102",
"0.62676597",
"0.62543046",
"0.62382543",
"0.6237334",
"0.6237314",
"0.6234702",
"0.6217655",
"0.6206702",
"0.62036026",
"0.6202868"
]
| 0.0 | -1 |
removes a product from the cart | function removeFromCart ($productID, $amount) {
if (checkCart()) {
if (array_key_exists($productID, $_SESSION['cart'])) {
if ($amount >= $_SESSION['cart'][$productID]['amount'] || $amount == 'all') {
//remove item completely
unset($_SESSION['cart'][$productID]);
} else {
//remove item partially
$_SESSION['cart'][$productID]['amount'] = $_SESSION['cart'][$productID]['amount'] - $amount;
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$this->cart->remove_product($item);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"function removeProduct(Product $product){\n \t$this->myCart->remove($product);\n }",
"public function removeproductAction() {\n $id = $this->getRequest()->getParam('id');\n $poProductId = $this->getRequest()->getParam('poproductid');\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo_product')->load($poProductId);\n $product = Mage::getResourceModel('catalog/product_collection')\n ->addFieldToFilter('entity_id', $model->getProductId())\n ->setPageSize(1)->setCurPage(1)\n ->getFirstItem();\n try {\n $model->delete();\n Mage::getSingleton('vendors/session')->addSuccess(\n $this->helper()->__('Product %s has been removed.', '<i>' . $product->getSku() . '</i>')\n );\n $this->_redirect('*/*/view', array('id' => $id));\n } catch (Exception $e) {\n Mage::getSingleton('vendors/session')->addError($this->helper()->__('There is error while removing product.'));\n Mage::getSingleton('vendors/session')->addError($e->getMessage());\n $this->_redirect('*/*/view', array('id' => $id));\n }\n }",
"public function removeProduct(Product $product): CurrentCart;",
"public static function cart_remove_product()\n {\n if (!isset($_REQUEST['cart-item-key'])) {\n WordPress_Rewrite_API_Request::missing_params();\n }\n\n //@TODO Check item_key exist in Cart or Use $_REQUEST['product_id'] as item_key\n\n // Remove\n WooCommerce_Cart::remove_item_cart(sanitize_text_field($_REQUEST['cart-item-key']));\n\n // Result\n wp_send_json_success(self::_return_cart_list(), 200);\n }",
"public function removeAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isRemoveItemAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n try {\n $this->getOnepage()->getQuote()\n ->removeItem($quoteItem->getId());\n \n $this->_recalculateTotals();\n $result['success'] = true;\n /**\n * When cart is ampty - redirect to empty cart page\n */\n if(!$this->getOnepage()->getQuote()->getItemsCount()){\n $result['redirect'] = Mage::helper('checkout/cart')->getCartUrl();\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during removing product from order');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }",
"public function removeProduct($product)\n {\n\n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if (! is_null($cart))\n\n $cart->pivot->delete();\n }",
"public function removeFromCart() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'] = array_splice($_SESSION['cart'], $count, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}",
"public function removeProduct(Product $product, $quantity);",
"public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}",
"public function removeAction() {\r\n $response = Mage::getModel('ajaxcartpro/ajaxresponse');\r\n $id = $this->getRequest()->getParam('id');\r\n Mage::getSingleton('checkout/cart')->removeItem($id)->save();\r\n $response->setCart(Mage::helper('ajaxcartpro')->rendercartpageUpdate());\r\n $response->setSidebar(Mage::helper('ajaxcartpro')->cartItemssidebar());\r\n $response->setLinks(Mage::helper('ajaxcartpro')->topLinkTitle());\r\n $response->send();\r\n }",
"function delete($product)\n {\n if (array_key_exists($product->id, $this->items)) {\n $storeProductDelete = $this->items[$product->id];\n //giam tien\n $this->totalPrice -= $storeProductDelete['price'];\n //giam so luong\n $this->totalQuantity -= $storeProductDelete['quantity'];\n // xoa phan tu o vi tri $product->id\n unset($this->items[$product->id]);\n }\n }",
"public function removeProduct()\n {\n $product_code = filter_var($_GET[\"remove_code\"], FILTER_SANITIZE_STRING);\n\n if(isset($_SESSION[\"products\"][$product_code]))\t{\n unset($_SESSION[\"products\"][$product_code]);\n }\n\n $total_product = count($_SESSION[\"products\"]);\n die(json_encode(array('products'=>$total_product)));\n }",
"public function remove_from_cart() {\n WC_Gokeep_JS::get_instance()->remove_from_cart();\n }",
"public function product_delete()\n\t\t\t\t{\n\t\t\t\t}",
"public function ajaxRemoveProduct()\n\t{\n\n\t\t$modelUserCart = $this->getModel('usercart');\n\t\t$userId = $this->_getUserId();\n\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$produktID = $jinput->get('produktID');\n\t\t$quantity = $jinput->get('quantity');\n\t\t$produktEigenschaft = $jinput->get('produktEigenschaft');\n\n\t\tif (!JSession::checkToken('get'))\n\t\t{\n\n\t\t\techo new JResponseJson(null, JText::_('JINVALID_TOKEN'), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$modelUserCart->removeProductFromCard($userId, $quantity, $produktID,$produktEigenschaft);\n\t\t\tparent::display();\n\t\t}\n\t}",
"public function remove(Request $request): void\n {\n \\Cart::remove($request->get('product_id'));\n }",
"function delete_product_item($id){\n $this->delete($id);\n }",
"public function removeProduct(Product $product){\n $product->allergieëns()->detach();\n $product->delete();\n return redirect()->back();\n }",
"public function remove($product_id)\n {\n\n\n $id = $this->wlm->get_id_wishlist($product_id, $this->session->userdata('id'));\n\n $this->wlm->delete($id);\n redirect(\"retailer/products/detail_product/\" . $product_id);\n }",
"public function removeProduct($id){\r\n $stmt = $this->DB->prepare ( \"DELETE FROM products WHERE Product_ID = '$id';\");\r\n $stmt->execute ();\r\n }",
"public function removeitem(Request $request) {\n Cart::remove([\n 'id' => $request->id,\n ]);\n return back()->with('success',\"Producto eliminado con éxito de su carrito.\");\n }",
"public function remove($cartId);",
"function uc_order_edit_products_remove($form, &$form_state) {\n $form_state['refresh_products'] = TRUE;\n\n $order_product_id = intval($form_state['triggering_element']['#return_value']);\n\n if (module_exists('uc_stock')) {\n // Replace stock immediately.\n $product = uc_order_product_load($order_product_id);\n uc_stock_adjust($product->model, $product->qty);\n }\n\n uc_order_product_delete($order_product_id);\n\n $order = $form_state['build_info']['args'][0];\n $matches = array();\n preg_match('/products\\[(\\d+)\\]/', $form_state['triggering_element']['#name'], $matches);\n $key = $matches[1];\n\n unset($order->products[$key]);\n $order->products = array_values($order->products);\n}",
"public function remove_from_cart($qty=0, $oid=0, $proid=0) {\n\t\tif($qty) {\n\t\t\t$query = \"UPDATE pivot_order-products SET quantity = ? WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($qty,$oid,$prodid);\n\t\t\n\t\t} else {\n\t\t\t$query = \"DELETE FROM pivot_order-products WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($oid,$prodid);\n\n\t\t}\n\t\treturn $this->db->query($query,$values);\n\t}",
"private function deleteProduct()\n {\n echo PHP_EOL;\n \n try\n {\n $productToDelete = $this->productDao->getByEan(self::PRODUCT_TURKEY_EAN);\n $resultOfDelete = $this->productDao->delete($productToDelete); \n\n echo 'Product with id: ' . $productToDelete->id . ' was deleted ' .\n (($resultOfDelete) ? '' : 'un') .\n 'successfuly!' . PHP_EOL; \n }\n catch (Exception $e)\n {\n echo $e->getMessage();\n }\n }",
"public function removeFromCart() : void\n {\n $this->VIEW = false;\n $this->Cart->removeFromCart($_SESSION['Auth']->id, $_POST);\n }",
"function deleteFromCart()\n{\n\t$productID = (int)$_GET['p']; //Get product id to be removed.\n\t\t\n\t$sql = \"DELETE FROM Cart WHERE ItemID = $productID\";\n\n\t$result = query($sql);\n\t\n\theader('Location: ./cart.php');\t\n}",
"public function remove_item($data)\n {\n $required = array(\n 'id' => 'Cart item id not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n $cart = $this->getService()->getSessionCart();\n\n return $this->getService()->removeProduct($cart, $data['id'], true);\n }",
"public static function delete_product($id)\n {\n echo $id;\n $cart = session()->get('cart');\n if(isset($cart[$id])) {\n unset($cart[$id]);\n session()->put('cart', $cart);\n }\n session()->flash('success', 'Product removed successfully');\n\n return redirect()->back();\n\n }",
"function remove_product($pid){\n\t// scart-products_addorder.php?action=checkout -- id=\"submit_delitem\" \n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n $returnpid = 0; // default 0 failed\n\t$pid=intval($pid);\n\t$max=count($_SESSION[$cart]);\n\tfor($i=0;$i<$max;$i++){\n\t\tif($pid==$_SESSION[$cart][$i]['bookid']){\n\t\t\tunset($_SESSION[$cart][$i]);\n $returnpid = $pid; // success > 0\n\t\t\tbreak;\n\t\t}\n\t}\n\t$_SESSION[$cart]=array_values($_SESSION[$cart]);\n return $returnpid; // default 0 failed, success > 0\n}",
"public function delete()\n {\n // get request\n $request = $this->getRequest()->request;\n // get product ID from request\n $product_id = $request['a'];\n // get product ids from session\n $compareProducts = $this->View()->getSession('compare', $compareProducts)?$this->View()->getSession('compare', $compareProducts):array();\n\n if (in_array($product_id, $compareProducts)) {\n // unseting product from compare session\n $key = array_search($product_id, $compareProducts);\n unset($compareProducts[$key]);\n }\n\n $this->View()->setSession('compare', $compareProducts);\n\n if ($request['XHR']) {\n die(json_encode([\n 'success' => true,\n 'message' => $this->View()->translating('compare_item_deleted'),\n 'count' => count($compareProducts),\n ]));\n }\n\n Router::redirect('compare');\n }",
"public function removeItem(Cart $cart, CartItem $item);",
"public function deleteProduct(Product $product);",
"public function delete() {\n if (!$this->customer->isLogged()) {\n die();\n }\n $product_id = $this->request->post['product_id'];\n $this->load->model('catalog/product');\n\n $this->model_catalog_product->deleteProduct($product_id);\n\n echo \"ok\";\n exit();\n\n }",
"public function removeCart(Request $request)\n {\n $cart = new Cart($request);\n $item = Product::find($request->get('product_id'));\n if(!empty($item)) {\n $data = $cart->deleteItem($item,1,$request);\n return response()->json([\"message\" => __(\"Product remove from cart\"),\"data\" => $data]);\n }\n return response()->setStatusCode(404)->json([\"message\" => \"Product not found\"]);\n\n }",
"public function delete()\n\t{\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$cartElement = $post['cart_index'];\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t$model->delete($cartElement);\n\t\t$this->_carthelper->cartFinalCalculation();\n\t\t$this->_carthelper->carttodb();\n\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t$this->setRedirect($link);\n\t}",
"public function removeItem($id){\n $cart = Session::get('cart');\n unset($cart->items[$id]);\n $itemTotal = $this->items[$id]['price'] * $this->items[$id]['qty'];\n $cart->totalPrice -= $itemTotal;\n $cart->totalQty -= $this->items[$id]['qty'];\n if($cart->totalQty <= 0){\n Session::flush();\n } else {\n Session::put('cart', $cart);\n }\n }",
"public function remove_from_basket_post() {\n\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $retailer_id = (int) $this->post('retailer_id') ? (int)$this->post('retailer_id') : 0;\n $store_id = (int) $this->post('store_id') ? (int) $this->post('store_id') : 0;\n\n $result = $this -> basketmodel -> remove_from_basket($product_id, $user_id);\n \n //$basket_count = $this -> basketmodel -> get_basket_count($user_id);\n $basket_count = $this -> basketmodel -> get_user_basket_count($user_id,$retailer_id,$store_id);\n\n if ($result) {\n $retArr['status'] = SUCCESS;\n $retArr['basket_count'] = $basket_count;\n $retArr['message'] = \"Product removed successfully from basket\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else {\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Failed to remove product from basket\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n }",
"public function remove(ProductInterface $product);",
"function remove_from_cart ($external_cart_id, $product_id) {\n $db = getDb();\n $cart_id = fetch_cart_id($external_cart_id);\n\n $statement = $db->prepare(\"\n DELETE FROM\n cart_content\n WHERE (\n cart_id = :cart_id AND\n product_id = :product_id\n )\n \");\n $executed = $statement->execute([\n \"cart_id\" => $cart_id,\n \"product_id\" => $product_id,\n ]);\n if (!$executed) {\n throw new Exception(\"An unexpected error occurred; could not remove from cart\");\n }\n}",
"public function removeItemFromCart( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->select('quantity')->from(TABLES::$ORDER_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif(count($result) > 0) {\r\n\t\t\t\tif ($result[0]['quantity'] <=1 ) {\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->delete(TABLES::$ORDER_CART);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$quantity = $result[0]['quantity'];\r\n\t\t\t\t\t$qty = array();\r\n\t\t\t\t\t$qty['quantity'] = $quantity - 1;\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public function removeProduct_get() {\n extract($_GET);\n $result = $this->feeds_model->removeProduct($prod_id);\n return $this->response($result);\n }",
"public function delete_product_purchase()\n\t{\n\t\tif(empty($this->request->data['id_cliente']) || empty($this->request->data['produto_id']))\n\t\t{\n\t\t\t$this->Return = false;\n\t\t\t$this->Message = 'Informar produto e codigo do cliente';\n\t\t\t$this->EncodeReturn();\t\n\t\t}\n\n\t\t$CartSession = json_decode(base64_decode($this->request->data['carrinho']), 1);\n\n\t\t$i = 0;\t\t\t\t\n\t\tforeach ($CartSession['item'] as $item) \n\t\t{\n\t\t\tif($item['Produto']['id'] == $this->request->data['produto_id'] && $i == $this->request->data['indice'])\n\t\t\t{\n\t\t\t\tunset($CartSession['item'][$i]);\t\t\t\t\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\t\t\n\n\t\tsort($CartSession['item']);\t\n\n\t\t##realiza soma de valores\n\t\t$this->CountPurchase($CartSession);\t\n\t\t$this->EncodeReturn();\t\n\t}",
"public function action_removeCartItem()\n {\n $cartItemId = $this->request->post('cartItemId');\n\n if(!is_null($cartItemId))\n {\n try\n {\n $modelCartItem = new Model_CartItemInfo();\n $modelCartItem->removeItem($cartItemId);\n\n $this->redirect('cart/index');\n }\n catch (Exception $e)\n {\n $this->request->status = 400;\n $this->request->response = View::factory('errors/400');\n }\n }\n else\n {\n $this->request->status = 406;\n $this->request->response = View::factory('errors/406');\n }\n }",
"public function actionRemoveProductFromWishlist()\n {\n // set wishlistId variable from params\n $wishlistId = craft()->request->getRequiredParam('wishlistId');\n $productId = craft()->request->getRequiredParam('productId');\n $redirectUrl = craft()->request->getRequiredParam('redirect');\n\n // Create a new wishlist with above title\n craft()->wishlist->removeProductFromWishlist($wishlistId, $productId);\n\n // Set Flash message\n craft()->userSession->setFlash('removeProductFromWishlistSuccess', 'Product has been removed from wishlist!');\n\n // Redirect to plugin index page\n $this->redirect($redirectUrl);\n }",
"public function delete_product() {\n\t\t$values=array(\"rstatus\"=>\"C\");\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$where =array(\"id\"=>$_POST['product_id']);\n\t\tif($this->update(\"products\",$values,$where)) {\t\t\t\n\t\t\techo '{\"masterItemsList\":{\"updateFlag\":\"void\",\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while deleting';\n\t}",
"public function deleteCartProduct($id = null)\n {\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n DB::table('cart')->where(['id'=>$id])->delete();\n return redirect('/cart')->with('update_message','Product has been deleted from cart');\n }",
"public function RemoveFromCart($cart_id,$user_id,$product_id)\n\t{\n\t\t$user_id\t= $this->session->userdata('user_id');\n\t\t$this->db->select('order_id,user_id,product_id,quantity');\n\t\t$this->db->from('vefinder_order_temp');\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->where('product_id', base64_decode($product_id));\n\t\t$this->db->where('order_id', $cart_id);\n\t\t$this->db->where(\"status =1\");\n\t\t$query = \t$this->db->get();\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t\t$data=array('updated_date'\t\t\t=> date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'status'\t\t\t\t=>\t0\n\t\t\t\t\t\t\t);\n\t\t\t$this->db->where('user_id', $user_id);\n\t\t\t$this->db->where('order_id', $cart_id);\n\t\t\t$this->db->where('product_id', base64_decode($product_id));\n\t\t\t$this->db->update('vefinder_order_temp', $data);\t\t\t\n\t\t\tif($this->db->affected_Rows())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\t\n\t\t} \n }",
"public function remove (Product $product) {\n $basket = session()->get(\"basket\"); // On récupère le panier en session\n unset($basket[$product->id]); // On supprime le produit du tableau $basket\n session()->put(\"basket\", $basket); // On enregistre le panier\n}",
"public function removeProduct(Request $request)\n {\n $cart = $this->cartRepository->getCart();\n\n $query = $this->cartRepository->removeProduct($request->product_id, $cart->id);\n\n if ($request->ajax()) {\n\n if ($query)\n return 'true';\n\n return 'false';\n }\n\n return redirect()->back();\n }",
"public function destroy(Cart $cart,Product $product)\n {\n\n //TO DO GET CART_PRODUCTS DATA HERE AND DELETE IT\n\n\n //TO DO DELETE CART DATA HERE\n\n return back();\n }",
"public function deleteFromCart($prod_id){\n $this->cartConstruct();\n $this->removeItem($prod_id);\n if(count($this->items)>0)\n {\n Session::put('cart',$this);\n }\n else\n {\n Session::forget('cart',$this);\n }\n return redirect()->back();\n\t}",
"function delItem($product_id)\r\n\t{\r\n\t\t$product_id = (int)$product_id;\r\n\t\tunset($_SESSION['Product'][$product_id]);\r\n\t\tunset($_SESSION['ProductVar'][$product_id]);\r\n\t\tunset($_SESSION['BasketSumm']);\r\n\t\tunset($_SESSION['ShipperId']);\r\n\t\tunset($_SESSION['GewichtSumm']);\r\n\t\tunset($_SESSION['PaymentId']);\r\n\t\theader(\"Location:\" . $_SERVER['HTTP_REFERER']);\r\n\t\texit;\r\n\t}",
"public function destroy(Product $product) //Eliminar\n {\n //\n }",
"public function removeProduct($productId) {\n\n $query = $this->db->prepare(\"SELECT COUNT(*) FROM `products` WHERE `product_id` = ? AND `product_removed` = ?\");\n\n $query->bindValue(1, $productId);\n $query->bindValue(2, 0);\n\n try {\n\n $query->execute();\n $rows = $query->fetchColumn();\n\n if($rows == 1) {\n\n $query_2 = $this->db->prepare(\"UPDATE `products` SET `product_removed` = ? WHERE `product_id` = ?\");\n\n $query_2->bindValue(1, 1);\n $query_2->bindValue(2, $productId);\n\n $query_2->execute();\n return true;\n\n } else {\n return false;\n }\n\n } catch(PDOException $e) {\n die($e->getMessage());\n }\n }",
"public function destroy(Product $product)\n {\n return Cart::deleteFromSession($product);\n }",
"public function removeItem(string $sku): Cart;",
"public function removeCart($id){\n\n CartItem::destroy($id);\n return redirect('/product_carts')->withSuccessRemoveCartMessage('Product cart has been removed!');\n //->withSuccessRemoveCartMessage('Product cart has been removed!');\n }",
"public function removeFromCart(Varien_Event_Observer $observer)\n { \n try\n { \n $helper = Mage::helper('increasingly_analytics');\n\n if ($helper->isEnabled())\n {\n $item = $observer->getQuoteItem();\n $product = $item->getProduct();\n\n $data = array(\n 'product_id' => $product->getId()\n );\n\n if(Mage::getSingleton('customer/session')->isLoggedIn()) {\n $data['is_logged_in'] = true;\n }\n else {\n $data['is_logged_in'] = false;\n }\n $helper->deleteBundleOnProductDeleteFromCart($product->getId());\n $helper->addEvent('track', 'remove_from_cart', $data);\n }\n \n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n } \n }",
"public function remove_from_cart( $cart_key ) {\n\t\tif ( ! isset( WC()->cart->cart_contents[ $cart_key ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$item = WC()->cart->cart_contents[ $cart_key ];\n\n\t\t$product_id = $item['product_id'];\n\t\t$variation = '';\n\t\t$product = null;\n\n\t\tif ( ! empty( $item['variation_id'] ) ) {\n\t\t\t$product = wc_get_product( $item['variation_id'] );\n\t\t\tif ( method_exists( $product, 'get_name' ) ) {\n\t\t\t\t$variation = $product->get_name();\n\t\t\t} else {\n\t\t\t\t$variation = $product->post->post_title;\n\t\t\t}\n\t\t} else {\n\t\t\t$product = wc_get_product( $product_id );\n\t\t}\n\n\t\t$categories = (array) get_the_terms( $product_id, 'product_cat' );\n\t\t$category_names = wp_list_pluck( $categories, 'name' );\n\t\t$first_category = reset( $category_names );\n\n\t\t$atts = array(\n\t\t\t't' => 'event', \t\t\t\t\t\t// Type of hit\n\t\t\t'ec' => 'Products', \t\t\t\t\t\t// Event Category\n\t\t\t'ea' => 'Remove From Cart', \t\t\t\t // Event Action\n\t\t\t'el' => htmlentities( get_the_title( $product_id ), ENT_QUOTES, 'UTF-8' ), // Event Label (product title)\n\t\t\t'ev' => (int) $item['quantity'], \t\t\t\t// Event Value (quantity)\n\t\t\t'pa' => 'remove', \t\t\t\t\t\t\t// Product Action\n\t\t\t'pal' => '', \t\t\t\t\t\t\t// Product Action List\n\t\t\t'pr1id' => $product_id, \t\t\t\t\t\t// Product ID\n\t\t\t'pr1nm' => get_the_title( $product_id ), \t\t\t// Product Name\n\t\t\t'pr1ca' => $first_category, \t\t\t\t\t\t// Product Category\n\t\t\t'pr1va' => $variation, \t\t\t\t\t\t\t// Product Variation Title\n\t\t\t'pr1pr' => $product->get_price(), \t\t\t// Product Price\n\t\t\t'pr1qt' => $item['quantity'], \t\t\t\t// Product Quantity\n\t\t);\n\n\t\tif ( monsterinsights_get_option( 'userid', false ) && is_user_logged_in() ) {\n\t\t\t$atts['uid'] = get_current_user_id(); // UserID tracking\n\t\t}\n\n\t\tmonsterinsights_mp_track_event_call( $atts );\n\t}",
"public function remove($id = null)\n {\n\n // cari product berdasarkan id\n $product = $this->product->getProduct($id);\n // cek data product\n if ($product != null) { // jika product tidak kosong\n // hapus keranjang belanja berdasarkan id\n $this->cart->remove($id);\n // success flashdata\n session()->setFlashdata('success', \"Berhasil menghapus product dari keranjang belanja\");\n } else { // product tidak ditemukan\n // error flashdata\n session()->setFlashdata('error', \"Tidak dapat menemukan data product\");\n }\n return redirect()->to('/cart');\n }",
"public function destroy(Product $product)\n {\n if ($this->RelationalCart->detach($product))\n return $this->returnSuccessMessage('Removed Successfully .');\n else\n return $this->returnErrorMessage('Something Error Or Already Deleted .');\n }",
"public function removeItemFromOrder($productId) {\n $product = Doctrine_Query::create()\n ->delete('Orderdetail od')\n ->where('od.Product = ?', $productId)\n ->andWhere('od.Order = ?', $this->getOrderId())\n ->execute();\n }",
"public function destroy(Request $request)\n {\n $cartDetail = CartDetail::find($request->cart_detail_id);\n if ($cartDetail->cart_id == auth()->user()->cart->id) \n $cartDetail->delete();\n\n\n /* if ($cartDetail) {\n\n $op = $cartDetail->product->quantity + $cartDetail->quantity;\n\n \n\n \n\n $cartDetail->where('quantity','>','0')\n ->update(['quantity'=>$op]);\n }*/\n \n $notification = 'El producto se ha eliminado del carrito de compras correctamente.';\n return back()->with(compact('notification'));\n \n \n }",
"public function RemoveItem($product_id)\n\t{\n\t\t$user_id\t= $this->session->userdata('user_id');\n\t\t$this->db->select('order_id,user_id,product_id,quantity');\n\t\t$this->db->from('vefinder_order_temp');\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->where('product_id', $product_id);\n\t\t$this->db->where(\"status =1\");\n\t\t$query = \t$this->db->get();\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t\t$data=array('updated_date'\t\t\t=> date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'status'\t\t\t\t=>\t0\n\t\t\t\t\t\t\t);\n\t\t\t$this->db->where('user_id', $user_id);\n\t\t\t$this->db->where('product_id', $product_id);\n\t\t\t$this->db->update('vefinder_order_temp', $data);\t\t\t\n\t\t\tif($this->db->affected_Rows())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\t\n\t\t} \n }",
"function remove()\n {\n $gameId = $this->registry->params[0];\n\n if (isset($gameId, $_SESSION['cart'])) {\n Util::deleteElement($gameId, $_SESSION['cart']);\n }\n\n $count = 0;\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n $count++;\n if ($_SESSION['cart'][$index][0] == $gameId) {\n unset($_SESSION['cart'][$index]);\n }\n }\n if($count == 0){\n unset($_SESSION['cart']);\n }\n\n header(\"Location: /cart\");\n }",
"public function deleting(Cart $cart)\n {\n //\n }",
"function deleteProduct()\r\n{\r\n\tif (isset($_GET['productId']) && (int)$_GET['productId'] > 0) {\r\n\t\t$productId = (int)$_GET['productId'];\r\n\t} else {\r\n\t\theader('Location: index.php');\r\n\t}\r\n\t\r\n\t// remove any references to this product from\r\n\t// tbl_order_item and tbl_cart\r\n\t/*\r\n\t$sql = \"DELETE FROM tbl_order_item\r\n\t WHERE pd_id = $productId\";\r\n\t\r\n\tdbQuery($sql);\r\n\t\t\t\r\n\t$sql = \"DELETE FROM tbl_cart\r\n\t WHERE pd_id = $productId\";\t\r\n\t\r\n\tdbQuery($sql);\r\n\t*/\r\n\t\r\n\t// get the image name and thumbnail\r\n\t$sql = \"SELECT pd_image, pd_thumbnail\r\n\t FROM tbl_product\r\n\t\t\tWHERE pd_id = $productId\";\r\n\t\t\t\r\n\t$result = dbQuery($sql);\r\n\t$row = dbFetchAssoc($result);\r\n\t\r\n\t// remove the product image and thumbnail\r\n\tif ($row['pd_image']) {\r\n\t\tunlink(SRV_ROOT . 'images/product/' . $row['pd_image']);\r\n\t\tunlink(SRV_ROOT . 'images/product/' . $row['pd_thumbnail']);\r\n\t}\r\n\t\r\n\t// remove the product from database;\r\n\t$sql = \"DELETE FROM tbl_product \r\n\t WHERE pd_id = $productId\";\r\n\tdbQuery($sql);\r\n\t\r\n\theader('Location: index.php?catId=' . $_GET['catId']);\r\n}",
"public function delete_cart_post(){\n $rowid = $this->input->post('row_id');\n $r = $this->cart->remove($rowid);\n $result = array();\n if ($r) {\n\n $result['result'] = '1';\n $result['data'] = $this->cart->contents();\n $result['totals_rows'] = $this->cart->total_items();\n $result['pagination'] = false;\n }\n else\n {\n $result['result'] = '2';\n $result['message'] = 'Error al agregar al carrito';\n }\n\n $this->response($result,201);\n }",
"function remove_product($voucher_id, $prod_id=NULL)\n\t{\n\t\t$where = array('voucher_id'=>$voucher_id);\n\t\t\n\t\tif(!is_null($prod_id))\n\t\t{\n\t\t\t$where['product_id'] = $prod_id;\n\t\t}\n\t\t\t\n\t\t$this->db->where($where);\n\t\t$this->db->delete('vouchers_products');\n\t}",
"public function destroyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.destroy', $this->instance);\n }",
"private function deleteIdFromProductsCart($cart, $productId)\n {\n unset($cart['products'][array_search($productId, $cart['products'])]);\n return $cart;\n }",
"public function deleteCart($id)\n {\n $cart = session()->get('cart');\n $quantita_bloccata = $cart[$id]['quantita'];\n $idProduct = $cart[$id]['id'];\n $products = Product::with('sector')->find($idProduct);\n \n $products->sector->quantita_bloccata = $products->sector->quantita_bloccata - $quantita_bloccata;\n $quantitaTemp = $products->sector->quantita_bloccata;\n if ( $quantitaTemp >=0 ) {\n $products->push();\n \n }\n\n unset($cart[$id]);\n session()->put('cart', $cart);\n if (count($cart)==0) {\n session()->forget('cart');\n\n }\n\n return redirect()->back();\n \n }",
"public function remove(\\Webshop\\Products\\Product $product)\n {\n $this->redis->delete('prd', $product->getId());\n }",
"public function deleteCart() {\n if (Request::ajax()) {\n //return \"ajax\";\n $product_id = Input::get('id');\n Cart::remove($product_id);\n return true;\n } else {\n \n }\n }",
"public function removeItem($index) {\n $this->sessionCart->removeItem($index);\n }",
"public function removeOneAction()\n\t{\n\t\t//vérification du statut d'admin\n\t\t$customersManager = new CustomersManager();\n\t\t$customer = $customersManager -> getLoginInfo();\n\t\tif (empty($customer) OR $customer['email'] != ADMIN_EMAIL)\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'customers/account');\n\t\t\texit();\n\t\t}\n\n\t\t//sécurisation CSRF\n\t\tif(!array_key_exists('CSRFToken', $customer) OR !array_key_exists('CSRFToken', $_GET) OR $_GET['CSRFToken'] !== $customer['CSRFToken'])\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'customers/account');\n exit();\n\t\t}\n\n\t\t//vérification des données reçues\n\t\tif (!isset($_GET) OR !isset($_GET['id']))\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'customers/account');\n\t\t\texit();\n\t\t}\n\n\t\t//suppression du produit dans la BDD\n\t\t$id = $_GET['id'];\n\t\t$productsManager = new ProductsManager();\n\t\t$productRemoved = $productsManager -> removeOne($id);\n\t\tif ($productRemoved)\n\t\t{\n\t\t\t$_SESSION['alertMessages']['success'][] = 'Le produit a bien été supprimé.';\n\t\t\theader('Location: manageForm');\n\t\t\texit();\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$_SESSION['alertMessages']['error'][] = 'La suppression du produit a échoué.';\n\t\t\theader('Location: manageForm');\n\t\t\texit();\n\t\t}\n\t}",
"function deleteProduct()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\t\n\t\t$sql='delete from products_table where product_id ='.$id;\n\t\t\n\t\t$obj=new Bin_Query();\n\t\t\n\t\tif($obj->updateQuery($sql))\n\t\t{\t\n\t\t\treturn '<div class=\"success_msgbox\">Product Deleted Successfully</div>';\t\n\t\t}\t\n\t}",
"public function removeFromShoppingCart($id){\r\n $stmt = $this->DB->prepare(\"DELETE FROM shopping_cart WHERE Cart_ID = $id;\");\r\n $stmt->execute();\r\n }",
"public function delete_from_cart(Request $data) {\n \t$product_info = array(\n \t\t\"product_id\" => $data->product_id,\n \t\t\"num_items\" => $data->num_items,\n \t\t\"selectors\" => $data->selectors\n \t);\n\n \t// Create cart helper class and delete\n \t$cart_helper = new CartHelper();\n \t$cart_helper->delete_from_cart($product_info);\n\n \t// Return to cart\n \treturn redirect()->back();\n }",
"function remove_savedproduct($saved_id){\t\n\t\t\n\t\t$this -> db -> where('saved_id', $saved_id);\n\t\t\n\t\t$this -> db -> delete('tbl_saved_product');\n\t\t\n\t\treturn true;\t\t\n\t}",
"public function removeFromSession($product)\n {\n $session = $this->session;\n\n if ($session->has('cart')) {\n $products = $session->get('cart');\n $addToSession = array_filter($products, function ($cartProduct) use ($product) {\n return $product !== $cartProduct;\n });\n $session->remove('cart');\n $session->set('cart', $addToSession);\n }\n }",
"public function destroy(Product $cart)\n {\n $cartContent = session( 'cart', collect());\n $cartContent = $cartContent->where('id', '!=', $cart->id);\n\n session(['cart' => $cartContent]);\n\n return redirect()->back();\n }",
"function removeProductById($pid)\n{\n require('pdo.php');\n $sql = \"DELETE FROM `product` WHERE `product`.`product_id` = :id\";\n\n try {\n $stmt = $pdo->prepare($sql);\n $res = $stmt->execute(array(\n ':id' => $pid\n ));\n return $res;\n } catch (PDOException $e) {\n return false;\n }\n\n}",
"public function removeProduct(int $id): void\n {\n if ($id)\n {\n $userData = $this->getSession()->getCurrentUserData();\n $userData->getCart()->removeProduct('product_' . $id);\n\n echo json_encode([\n 'totalSum' => $userData->getCart()->getTotalSum(),\n ]);\n }\n }",
"public function destroy($id)\n {\n\n $cart = Cart::where('user_id', Auth()->id())\n ->first();\n\n $deleteProduct = CartProduct::findOrFail($id);\n $deleteProduct->delete();\n\n $CartProducts = CartProduct::where('user_id', Auth()->id())\n ->where('cart_id', $cart->id)\n ->get();\n\n if ($CartProducts->count() >= 1) {\n $this->updateTotal($cart);\n return redirect()->route('my-cart.index');\n } else {\n $cart->delete();\n return redirect()->route('my-cart.index');\n }\n // End of delete\n }",
"public function delete_item_list($product_id){\n\t\t\tunset($_SESSION['terminal_list'][$product_id]);\n\t\t\treturn 'sucess';\n\t}",
"public function refuseProductAction($id){\r\n \r\n $em=$this->getDoctrine()->getManager();\r\n $product=$em->getRepository('HologramBundle:Product')->find($id);\r\n $em->remove($product);\r\n $em->flush();\r\n \r\n return $this->redirectToRoute('esprit_hologram');\r\n }",
"public function actionDeleteProduct()\n\t{\n\t\t$model = OrderProduct::model()->findByPk($_POST['product_id']);\n\t\tif($model)\n\t\t\t$model->delete();\n\t}",
"public function delete(Product $product)\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t//\tEliminando el producto del carro.\n\t\tunset($cart[$product->id]);\n\t\t\\Session::put('cart', $cart);\n\n\t\treturn redirect()->route('cart-show');\n\t}",
"public function removeDonation($cartId);",
"public function removeItem($product_key)\n {\n $items = $this->getItems();\n unset($items[$product_key]);\n $this->setItems($items);\n }",
"public function delete()\n {\n $this->isAuthenticated();\n $this->authToken->isRequestLimitExceeded();\n $this->authToken->logRequest(1);\n\n //get the id from the user\n $data = $_POST;\n //set the id\n $this->product->id = array_values($data)[0];\n\n if ($this->product->delete()) {\n // set response code - 200 ok\n http_response_code(200);\n echo json_encode(array(\"message\" => \"Product was deleted.\"));\n }\n\n // if unable to update the product\n else {\n\n // set response code - 503 service unavailable\n http_response_code(503);\n echo json_encode(array(\"message\" => \"Unable to delete.\"));\n }\n }",
"public function destroy(product $product)\n {\n //\n }",
"public function destroy(product $product)\n {\n //\n }",
"public function remove()\n {\n return $this->session->remove('cart');\n }",
"function deleteCart() {\n\t\t$queryString = \"DELETE FROM cart;\";\n\n\t\tif ($stmt = $this->connection->prepare($queryString)) {\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\theader(\"Location: http://serenity.ist.rit.edu/~qsb2538/341/project1/cart.php\");\n\t\t}\n\t}",
"function deleteCart() {\n\t\tunset($_SESSION['cart']);\t\t\n\t}",
"public function killOne(Request $request) {\n\n if (!$request->user()) {\n return redirect()->route('login');\n }\n \n $product = $request->get('product');\n\n $newQuantity = $this->cart->items[$product]['quantity'];\n $this->cart->totalQty = $this->cart->totalQty - $newQuantity;\n\n unset($this->cart->items[$product]); \n session()->put('cart', $this->cart);\n\n return redirect()->route('cart');\n }",
"public function remove_product($p_id)\n {\n $this->db->where('p_id', $p_id);\n\n if ($this->db->delete('product_table')) {\n return true;\n } else {\n return false;\n }\n }"
]
| [
"0.85423523",
"0.8427454",
"0.79401606",
"0.7892007",
"0.7716652",
"0.76411074",
"0.76357317",
"0.74923486",
"0.74878323",
"0.73870647",
"0.7356689",
"0.73487484",
"0.73096603",
"0.7306681",
"0.7304947",
"0.7303176",
"0.7217402",
"0.7210284",
"0.71997267",
"0.7161024",
"0.715643",
"0.71306413",
"0.7127086",
"0.71252525",
"0.7069411",
"0.70582944",
"0.70563954",
"0.70368236",
"0.7036633",
"0.7023667",
"0.69782484",
"0.6964187",
"0.69527954",
"0.69289804",
"0.6920182",
"0.69109213",
"0.6891285",
"0.6889242",
"0.68838274",
"0.68816304",
"0.68565464",
"0.68504965",
"0.6829979",
"0.6828596",
"0.68237245",
"0.6801634",
"0.680045",
"0.6799657",
"0.6798245",
"0.6795507",
"0.6787481",
"0.6786655",
"0.6778506",
"0.6760019",
"0.6739027",
"0.67223954",
"0.67167157",
"0.6712856",
"0.67090845",
"0.67044055",
"0.6693068",
"0.6689179",
"0.66819835",
"0.668042",
"0.6668272",
"0.66593015",
"0.66392815",
"0.6637715",
"0.6631504",
"0.6624373",
"0.6617779",
"0.6616283",
"0.6615719",
"0.66130066",
"0.6609865",
"0.66093254",
"0.66033435",
"0.65997607",
"0.6599078",
"0.6595416",
"0.6581841",
"0.65800613",
"0.6573655",
"0.65713346",
"0.6558223",
"0.6551798",
"0.6538909",
"0.65378207",
"0.6536981",
"0.65360993",
"0.6534707",
"0.6525771",
"0.65235996",
"0.65233845",
"0.65225327",
"0.65225327",
"0.6518695",
"0.6513447",
"0.6511307",
"0.6510893",
"0.65010214"
]
| 0.0 | -1 |
returns a statement object with all products currently in the cart | function fetchProductsFromCart () {
if (checkCart()) {
$sql = "SELECT * FROM stockitems WHERE StockItemID IN (" . arrayToSQLString(array_keys($_SESSION['cart'])) . ")";
return runQuery($sql);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getActiveCartProducts();",
"public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}",
"public function get_cart_products()\n {\n $user_id = $_SESSION['user_id'];\n\n $query = \"SELECT p.*\n \t FROM \" . $this->db_table_prefix . \"cart c\n JOIN \" . $this->db_table_prefix . \"products p\n ON p.id = c.product_id WHERE c.user_id ='\".$user_id.\"'\";\n // echo $query; exit; \n $result = $this->commonDatabaseAction($query);\n \n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n return $this->resultArray($result);\n }\n else\n {\n return null;\n }\n }",
"function getAllProducts(){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT id, name, description, price, stock, img_src \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock`>0\");\n\t\t$sth \t->execute();\n\t\t\n\t\treturn \t$sth;\n\t}",
"function fetch_all_products ($in_stock) {\n $db = getDb();\n if ($in_stock) {\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n WHERE\n inventory_count > 0\n \");\n } else {\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n \");\n }\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_OBJ);\n return $result;\n}",
"public function cart()\n {\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n $items = array();\n foreach ($this->_session->offsetGet('products') as $key => $value)\n {\n $items[$key] = array(\n 'id' \t\t=> \t$value['id'],\n 'qty' \t\t=> \t$value['qty'],\n 'price' \t=> \t$value['price'],\n 'name' \t\t=> \t$value['name'],\n 'sub_total'\t=> \t$this->_formatNumber($value['price'] * $value['qty']),\n \t'options' \t=> \t$value['options'],\n 'date' \t\t=> \t$value['date'],\n 'vat' => $value['vat']\n );\n }\n return $items;\n }\n }",
"public function getFullCart()\n {\n $completeCart = [];\n\n if ($this->get())\n {\n foreach ($this->get() as $id => $quantity)\n {\n $product = $this->em->getRepository(Product::class)->findOneById($id);\n\n if (!$product)\n {\n $this->delete($id);\n continue;\n }\n\n $completeCart[] = [\n 'product' => $product,\n 'quantity' => $quantity,\n ];\n }\n }\n\n return $completeCart;\n }",
"public function getCurrentFullCart(){\n\n $product_ids = array();\n $cart = Mage::getModel('checkout/cart')->getQuote();\n foreach ($cart->getAllItems() as $item) {\n\n array_push($product_ids, $item->getProduct()->getId());\n }\n return $product_ids;\n }",
"public function all_products()\n\t{\n\t\t$this->db->where('product_status = 1');\n\t\t$query = $this->db->get('product');\n\t\t\n\t\treturn $query;\n\t}",
"function getCart(){\n \treturn $this->myCart->getList();\n }",
"public function getCurrentCart(){\n\n $product_ids = array();\n $cart = Mage::getModel('checkout/cart')->getQuote();\n foreach ($cart->getAllVisibleItems() as $item) {\n\n array_push($product_ids, $item->getProduct()->getId());\n }\n return $product_ids;\n }",
"function getCartProductsByCartIds() {\n\n if (func_num_args() > 0) {\n $carts = func_get_arg(0);\n $result = array();\n if ($carts) {\n foreach ($carts as $value) {\n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(array('cr' => 'addtocart'))\n ->joinLeft(array('pr' => 'products'), 'pr.product_id=cr.product_id')\n ->where('cr.id=?', $value)\n ->where('pr.prod_status=?', 1);\n $result[] = $this->getAdapter()->fetchRow($select);\n }\n if ($result) {\n return $result;\n } else {\n return null;\n }\n }\n } else {\n return null;\n }\n }",
"public function getAllList(){\n $collection = new Db\\Collection($this->getProductTable());\n return $collection->load();\n }",
"function getCart() {\n\t\t$cartData = array();\n\t\t\tif($stmt = $this->connection->prepare(\"select * FROM cart;\")) {\n\t\t\t\t$stmt -> execute();\n\n\t\t\t\t$stmt->store_result();\n\t\t\t\t$stmt->bind_result($id, $itemName, $itemDesc, $numberOf, $price);\n\n\t\t\t\tif($stmt ->num_rows >0){\n\t\t\t\t\twhile($stmt->fetch() ){\n\t\t\t\t\t\t$cartData[] = array(\n\t\t\t\t\t\t\t'id' =>$id,\n\t\t\t\t\t\t\t'productName' => $itemName,\n\t\t\t\t\t\t\t'productDescription' => $itemDesc,\n\t\t\t\t\t\t\t'numberOf' => $numberOf,\n\t\t\t\t\t\t\t'price' => $price\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn $cartData;\n\t}",
"public function getAllproducts() {\r\n\r\n\t\t$res = $this->db->get('items');\r\n\r\n\t\treturn $res->result();\r\n\t}",
"public function cartOrders()\n {\n $cart = $this->sessionGet('cart');\n //$cart = Az::$app->cores->session->get('cart');\n\n //vdd($cart);\n $productItems = [];\n\n if ($cart) {\n foreach ($cart as $item) {\n $productItem = $this->productItemByCatalogId($item['catalog_id']);\n if ($productItem === null)\n continue;\n $productItem->cart_amount = $item['amount'];\n $productItems[] = $productItem;\n }\n }\n return $productItems;\n }",
"function getProductBasics() {\n $db = acmeConnect();\n $sql = 'SELECT invName, invId FROM inventory ORDER BY invName ASC';\n $stmt = $db->prepare($sql);\n $stmt->execute();\n $products = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $products;\n }",
"public function getCheckoutProducts()\r\n\t{\r\n\t\t$products = array();\r\n\t\t\r\n\t\tforeach (Mage::getSingleton('checkout/session')->getQuote()->getAllVisibleItems() as $item)\r\n\t\t{\r\n\t\t\t$args = $this->getDefaultProductIdentifiers($item);\r\n\t\t\t\r\n\t\t\t$variant = array();\r\n\t\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Handle configurable products\r\n\t\t\t */\r\n\t\t\tif ($item->getProduct()->isConfigurable())\r\n\t\t\t{\r\n\t\t\t\t$parent = Mage::getModel('catalog/product')->load\r\n\t\t\t\t(\r\n\t\t\t\t\t$item->getProductId()\r\n\t\t\t\t);\r\n\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t * Swap configurable data\r\n\t\t\t\t * \r\n\t\t\t\t * @var stdClass\r\n\t\t\t\t */\r\n\t\t\t\t$args = $this->getConfigurableProductIdentifiers($args, $parent);\r\n\t\t\t\t\r\n\t\t\t\tif ($item instanceof Mage_Sales_Model_Quote_Item)\r\n\t\t\t\t{\r\n\t\t\t\t\t$request = new Varien_Object(unserialize($item->getOptionByCode('info_buyRequest')->getValue()));\r\n\t\t\t\t}\r\n\t\t\t\telse if ($item instanceof Mage_Sales_Model_Order_Item)\r\n\t\t\t\t{\r\n\t\t\t\t\t$request = new Varien_Object($item->getProductOptions());\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t$options = $request->getData();\r\n\t\t\t\r\n\t\t\t\tif (isset($options['super_attribute']) && is_array($options['super_attribute']))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ($options['super_attribute'] as $id => $option)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($id);\r\n\t\t\t\r\n\t\t\t\t\t\tif ($attribute->usesSource())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$variant[] = join(':', array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t$this->jsQuoteEscape($attribute->getFrontendLabel()),\r\n\t\t\t\t\t\t\t\t$this->jsQuoteEscape($attribute->getSource()->getOptionText($option))\r\n\t\t\t\t\t\t\t));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Handle products with custom options\r\n\t\t\t */\r\n\t\t\tif (1 === (int) $item->getProduct()->getHasOptions())\r\n\t\t\t{\r\n\t\t\t\tif ($item instanceof Mage_Sales_Model_Quote_Item)\r\n\t\t\t\t{\r\n\t\t\t\t\t$request = new Varien_Object(unserialize($item->getOptionByCode('info_buyRequest')->getValue()));\r\n\t\t\t\t}\r\n\t\t\t\telse if ($item instanceof Mage_Sales_Model_Order_Item)\r\n\t\t\t\t{\r\n\t\t\t\t\t$request = new Varien_Object($item->getProductOptions());\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\tif ((int) $request->getProduct() > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$parent = Mage::getModel('catalog/product')->load\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t$request->getProduct()\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif ($this->useConfigurableParent())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$args->id \t= $parent->getSku();\t\t\t\t\t\r\n\t\t\t\t\t\t$args->name = $parent->getName();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * Get field to use for variants\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @var string\r\n\t\t\t\t\t*/\r\n\t\t\t\t\t$field = Mage::helper('ec')->getOptionUseField();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tforeach ($parent->getProductOptionsCollection() as $option)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$data = $parent->getOptionById($option['option_id']);\r\n\t\t\t\r\n\t\t\t\t\t\tswitch($data->getType())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcase 'drop_down':\r\n\t\t\t\t\t\t\t\tforeach ($data->getValues() as $value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$options[] = array\r\n\t\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t\t'id' \t=> $value->getOptionTypeId(),\r\n\t\t\t\t\t\t\t\t\t\t'value' => $value->getData($field),\r\n\t\t\t\t\t\t\t\t\t\t'title' => $data->getTitle()\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'field':\r\n\t\t\t\t\t\t\t\t$options[] = array\r\n\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'value' => (string) $data->getData($field)\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif ($request->getOptions() && is_array($request->getOptions()))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tforeach ($options as $option)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($request->getOptions() as $current)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (is_array($option) && isset($option['id']) && (int) $current === (int) $option['id'])\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$variant[] = join(':',array\r\n\t\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t\t$this->jsQuoteEscape($option['title']),\r\n\t\t\t\t\t\t\t\t\t\t$this->jsQuoteEscape($option['value'])\r\n\t\t\t\t\t\t\t\t\t));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$category = $this->getCategory\r\n\t\t\t(\r\n\t\t\t\tMage::helper('ec/session')->getTrace()->get($item->getProduct())\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data = (object) array\r\n\t\t\t(\r\n\t\t\t\t'id' \t\t=> $this->jsQuoteEscape($args->id),\r\n\t\t\t\t'name' \t\t=> $this->jsQuoteEscape($args->name),\r\n\t\t\t\t'category' \t=> $this->jsQuoteEscape($category),\r\n\t\t\t\t'brand' \t=> $this->jsQuoteEscape($this->getBrandBySku($args->id)),\r\n\t\t\t\t'price' \t=> Mage::helper('ec/price')->getPrice($item->getProduct()),\r\n\t\t\t\t'quantity' \t=> $item->getQty(),\r\n\t\t\t\t'variant' \t=> join('-', $variant),\r\n\t\t\t\t'coupon'\t=> ''\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$products[] = $data;\r\n\t\t}\r\n\t\t\r\n\t\treturn $products;\r\n\t}",
"public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }",
"public function GetAllProducts(){\t\n\t \n\t try{\n\t\t $conn = DBConnection::GetConnection();\t\n\t\t $myquery= \"SELECT product_id,product_name,unit_price,image_name,description,category,quantity_in_stock FROM product\";\n\t\t $result= $conn->query($myquery);\n\t\t $products=array();\n\t\t foreach($result as $item)\n\t\t {\n\t\t\t $p1= new Product();\n\t\t\t $p1->productCode =$item[\"product_id\"];\n\t\t\t $p1->productName =$item[\"product_name\"];\n\t\t\t $p1->price =$item[\"unit_price\"];\n\t\t\t $p1->imageName=$item[\"image_name\"];\t\t\t \n\t\t\t $p1->description =$item[\"description\"];\n\t\t\t $p1->cate=$item[\"category\"];\n\t\t\t $p1->qty=$item[\"quantity_in_stock\"];\n\t\t\t array_push($products,$p1);\t\t\t \t\t\t \n\t\t }\n\t\t $conn =null;//To close the connection \n\t\t return $products;\n\t }catch(PDOException $e){\n\t\t echo 'Fail to connect';\n\t\t echo $e->getMessage();\n\t }\t\n\t\t \n }",
"public function getAll()\n {\n return $this->products;\n }",
"public function getProducts()\n {\n return $this->basket->products()->get();\n }",
"public function getActiveCart();",
"public function getQuoteProductsData()\n {\n $quote= Mage::getSingleton('checkout/session')->getQuote();\n $data = array();\n if ($quote) {\n foreach ($quote->getAllVisibleItems() as $item) {\n $productData = array();\n $productData['productId'] = $this->escapeSingleQuotes($item->getSku());\n $productData['name'] = $this->escapeSingleQuotes($item->getName());\n $productData['price'] = Mage::helper('affirm/util')->formatCents(\n $item->getPrice()\n );\n $productData['currency'] = $this->getCurrentCurrencyCode();\n $productData['quantity'] = $item->getQty();\n $data[] = $productData;\n }\n }\n return $data;\n\n }",
"public function getAllProducts(){\r\n\t\treturn $this->query(\"SELECT * FROM beer\");\r\n\t}",
"public function getAllProducts()\n {\n return $this->productRepository->all();\n }",
"public function fetchQuoteProducts()\n\t{\n\n\t\t$this->getDB()->query('SELECT * FROM product_orders WHERE quote_id = '.$this->getId());\n\t\t$res = $this->getDB()->results('arr');\n\t\tforeach($res as $quotedProd)\n\t\t{\n\t\t\t$product = new Product($quotedProd['product_id']);\n\t\t\t$product->setProductCost($quotedProd['product_cost']);\n\t\t\t$product->setProductQuantity($quotedProd['product_qty']);\n\t\t\t$product->setProductType($quotedProd['product_type']);\n\n\t\t\tarray_push($this->products, $product);\n\t\t}\n\t}",
"public function getCartProductsByLoggedIds() {\n\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n try {\n $select = $this->select()\n ->from(array('act' => 'addtocart'), array('act.id', 'act.product_id', 'act.user_id', 'act.hotel_id', 'act.quantity', 'act.cost', 'act.hotel_id'))\n ->setIntegrityCheck(FALSE)\n ->joinLeft(array('p' => 'products'), 'act.product_id=p.product_id', array('p.name', 'p.imagelink', 'p.cost AS product_cost'))\n ->joinLeft(array('hd' => 'hotel_details'), 'act.hotel_id=hd.id')\n ->where('act.user_id = ?', $user_id)\n ->where('hd.hotel_status = ?', 1)\n ->where('p.prod_status = ?', 1);\n\n $result = $this->getAdapter()->fetchAll($select);\n\n if ($result) {\n return $result;\n } else {\n return null;\n }\n } catch (Exception $ex) {\n throw new Exception(\"argument not passed: \" . $ex);\n }\n } else {\n throw new Exception(\"argument not passed\");\n }\n }",
"public function getProducts()\n {\n if (isset($this->userSelectedProducts)) {\n return $this->userSelectedProducts;\n }\n\n $cartItems = $this->session->get('cart');\n\n $cartProductIds = $this->getProductIds();\n\n $dbProducts = $this->product->getProductsByProductIds($cartProductIds);\n\n /** @var array $userSelectedProducts Contains the merge of products/cart items */\n $userSelectedProducts = [];\n\n $grandTotal = 0.00;\n\n foreach ($cartItems as $cartItem) {\n\n foreach ($dbProducts as $dbProduct) {\n\n if ($dbProduct->product_id == $cartItem['product_id']) {\n\n $dbProduct->quantity = $cartItem['quantity'];\n\n $dbProduct->total_price = $dbProduct->price * $cartItem['quantity'];\n $grandTotal += $dbProduct->total_price;\n\n $userSelectedProducts[] = $dbProduct;\n }\n }\n }\n\n $this->grandTotal = $grandTotal;\n $this->userSelectedProducts = $userSelectedProducts;\n\n if (empty($userSelectedProducts)) {\n throw new \\Exception('Please add some things to your cart!');\n }\n\n return $userSelectedProducts;\n }",
"public function getCart();",
"public function getProductsFromShopingCart(){\n global $book;\n\n if( isset( $_SESSION['shopingCart'] )){\n\n $testArray = [];\n \n foreach( $_SESSION['shopingCart'] as $key => $quantity ){\n \n \n $keyArray = explode(\"_\", $key);\n \n $bookId = $keyArray[1]; \n \n \n \n $getBook = $book->getBookById( $bookId );\n $getBook->quantity = $quantity;\n \n array_push( $testArray,$getBook ); \n }\n \n $_SESSION['shopingCartProducts'] = $testArray;\n\n return $_SESSION['shopingCartProducts'];\n }\n }",
"function fetch_cart ($external_cart_id) {\n $db = getDb();\n $cart_id = fetch_cart_id($external_cart_id);\n\n $statement = $db->prepare(\"\n SELECT\n c.quantity,\n p.title,\n p.price,\n p.inventory_count,\n p.product_id\n FROM\n cart_content c\n INNER JOIN\n product p\n ON\n c.product_id = p.product_id\n WHERE\n cart_id = :cart_id\n \");\n $statement->execute([\"cart_id\" => $cart_id]);\n $products = $statement->fetchAll(PDO::FETCH_OBJ);\n\n $total = 0;\n foreach ($products as $product) {\n $total += $product->price * $product->quantity;\n }\n return (object)[\n \"total\" => $total,\n \"products\" => $products,\n \"external_cart_id\" => $external_cart_id,\n ];\n}",
"public static function getProducts()\n {\n if (isset($_SESSION['cart'])) {\n $productId = $_SESSION['cart'];\n } else {\n $productId = false;\n }\n \n \n return $productId;\n }",
"public function getProducts()\n {\n return $this->products;\n }",
"public function getProducts()\n {\n return $this->products;\n }",
"public function getProducts()\n {\n return $this->products;\n }",
"public function getProducts()\n {\n return $this->products;\n }",
"public function getProducts()\n {\n return $this->products;\n }",
"public function _getItems(Cart $cart)\n {\n $items = $cart->getQuote()->getAllVisibleItems();\n try {\n $data = [];\n $configurableSkus = [];\n foreach ($items as $item) {\n $product = $item->getProduct();\n $_item = [];\n $_item['vars'] = [];\n if ($item->getProduct()->getTypeId() == 'configurable') {\n $_item['isConfiguration'] = 1;\n $parentIds[] = $item->getParentItemId();\n $options = $this->cpModel->getOrderOptions($product);\n $_item['id'] = $options['simple_sku'];\n $_item['title'] = $options['simple_name'];\n $_item['vars'] = $this->_getVars($options);\n $configurableSkus[] = $options['simple_sku'];\n } elseif (!in_array($item->getSku(), $configurableSkus) && $item->getProductType() != 'bundle') {\n $_item['id'] = $item->getSku();\n $_item['title'] = $item->getName();\n } else {\n $_item['id'] = null;\n }\n if ($_item['id']) {\n $_item['qty'] = (int)$item->getQty();\n $_item['url'] = $item->getProduct()->getProductUrl();\n $_item['image'] = $this->productHelper->getSmallImageUrl($product);\n $current_price = null;\n $reg_price = $product->getPrice();\n $special_price = $product->getSpecialPrice();\n $special_from = $product->getSpecialFromDate();\n $special_to = $product->getSpecialToDate();\n if ($special_price &&\n ($special_from === null || (strtotime($special_from) < strtotime('Today'))) &&\n ($special_to === null || (strtotime($special_to) > strtotime('Today')))) {\n $current_price = $special_price;\n } else {\n $current_price = $reg_price;\n }\n $_item['price'] = $current_price * 100;\n if ($tags = $this->_getTags($product)) {\n $_item['tags'] = $tags;\n }\n $data[] = $_item;\n }\n }\n\n return $data;\n } catch (\\Exception $e) {\n $this->clientManager->getClient()->logger($e);\n\n return false;\n }\n }",
"public function getAllProducts(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM products\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}",
"public function getProducts() \n {\n return $this->_products;\n }",
"public function getActiveProducts() {\n $stmt = $this->db->prepare(\"select * from product where is_active = 1 order by id desc;\");\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"function getProducts()\n {\n $db = $this->getPearDb();\n\n // The query is big, but it does use indexes. Anyway, the involved\n // tables almost never change, so we utilize MySQL's query cache\n $sql = \"(\n # User permissions\n SELECT DISTINCT pe_u.parameterValue AS productId\n FROM user u\n JOIN permission pe_u\n ON pe_u.doerId = u.id\n AND pe_u.allowed = '1'\n AND pe_u.actionId = 6 # 6 = use_product\n WHERE u.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Customer permissions\n SELECT DISTINCT pe_c.parameterValue AS productId\n FROM permission pe_c\n WHERE pe_c.doerId = \" . $this->id . \"\n AND pe_c.allowed = '1'\n AND pe_c.actionId = 6 # 6 = use_product\n\n ) UNION (\n\n SELECT productId\n FROM site s\n WHERE s.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Kollage is always on\n SELECT 1\n\n )\";\n $productIds = $db->getCol($sql);\n $productIds = array_filter(array_unique($productIds), 'intval');\n\n $product = new Vip_Product;\n $product->columnIn('id', $productIds);\n // Customer-specific products are only enabled for that customer.\n $product->addWhereSql('customerId IN (0, ' . $this->id . ')');\n $product->setOrderBySql('sortOrder,title');\n $products = $product->findAll();\n foreach ($products as $product) {\n $product->setCustomer($this);\n }\n\n return $products;\n }",
"public static function getAllSellPro()\n {\n return DB::table(static::$table)\n ->select('sell_product.*')\n ->where('is_deleted', ACTIVE)\n ->where('display', 0)\n ->where('display_top', 1)\n ->paginate(LIMIT_ITEM_PAGE); \n }",
"function getProducts() {\n\t\t$saleData = array();\n\t\tif($stmt = $this->connection->prepare(\"select * from products;\")) {\n\t\t\t$stmt -> execute();\n\n\t\t\t$stmt->store_result();\n\t\t\t$stmt->bind_result($id, $itemName, $itemImage, $itemDesc, $salePrice, $regularPrice, $numberLeft);\n\n\t\t\tif($stmt ->num_rows >0){\n\t\t\t\twhile($stmt->fetch() ){\n\t\t\t\t\t$saleData[] = array(\n\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t'itemName' => $itemName,\n\t\t\t\t\t\t'itemImage' => $itemImage,\n\t\t\t\t\t\t'itemDesc' => $itemDesc,\n\t\t\t\t\t\t'salePrice' => $salePrice,\n\t\t\t\t\t\t'regularPrice' => $regularPrice,\n\t\t\t\t\t\t'numberLeft' => $numberLeft\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $saleData;\n\t}",
"public function get_all_productes() \r\n\t{\r\n\t\t$res=mysql_query(\"select * from products\") or die(mysql_error());\r\n\t\treturn $res;\r\n\t}",
"public function getItems()\n {\n $cartItems = [];\n\n foreach ($_SESSION['cart'] as $id => $data) {\n $cartItem = $this->productList->getProduct($id);\n $cartItem->count = $data['count'];\n\n $cartItems[$id] = $cartItem;\n }\n\n return $cartItems;\n }",
"public function getAllProducts()\n {\n\n $query = $this->db->get_where('products', array('pro_status' => 1));\n return $query->result();\n }",
"private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }",
"public function getProducts()\n {\n return $this->_products;\n }",
"protected function getAllProducts()\r\n {\r\n \r\n // Enter the query into the Data Access Layer\r\n $sql = \"SELECT * from tbl_products\";\r\n \r\n // Make a connection anjd run the query on the SQL statement\r\n $results = $this->connect->query($sql);\r\n \r\n // Get the number of rows that were returned\r\n $numRows = $results->num_rows;\r\n \r\n // Return results only of the number of rows is greater than zero\r\n if ($numRows > 0) {\r\n // Pass the results of the query to the next class\r\n return $results;\r\n } else {\r\n echo \"Could not find products\";\r\n }\r\n }",
"public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}",
"public function getCartData()\n {\n $data = array();\n $session= Mage::getSingleton('checkout/session');\n $items = $session->getQuote()->getAllVisibleItems();\n if($items) {\n foreach ($items as $item) {\n $productData = array();\n $productData['productId'] = $this->escapeSingleQuotes($item->getSku());\n $productData['name'] = $this->escapeSingleQuotes($item->getName());\n $productData['price'] = Mage::helper('affirm/util')->formatCents(\n $item->getPrice()\n );\n $productData['currency'] = $this->getCurrentCurrencyCode();\n $productData['quantity'] = $item->getQty();\n $data[] = $productData;\n }\n }\n return $data;\n }",
"public function getCartItems()\n {\n return $this->hasMany(CartItem::className(), ['product_id' => 'id']);\n }",
"public function get()\n\t{\n\t\tif(count($this->cart) > 0)\n\t\t{\n\t\t\t$products = \\Model_Products::build();\n\t\t\tforeach($this->cart as $key => $item)\n\t\t\t{\n\t\t\t\t$products->or_where('ProductID', $key);\n\t\t\t}\n\n\t\t\t$return = $products->execute();\n\n\t\t\treturn $return;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function getAll() {\n $SQL = 'Select * from product inner JOIN product_category on product.product_category_id = product_category.product_category_id;';\n $prep = DataBase::getInstance()->prepare($SQL);\n $prep -> execute();\n return $prep->fetchAll(PDO::FETCH_OBJ);\n }",
"function show_cart_product($pro){\r\n\t\t\treturn $this->select(\"*\",\"items\",\"pro_id in($pro) order by pro_id desc\");\r\n\t\t}",
"function get_static_products() {\r\n return $this->DBObject->readCursor(\"product_actions.get_static_products\", null);\r\n }",
"public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }",
"public function getProductList()\n {\n $output = $this->product->getProuductList();\n return $output;\n }",
"public static function fetchAll() {\n $db = new PDO(DB_SERVER, DB_USER, DB_PW);\n // 2. Prepare the query\n $sql = 'SELECT * FROM product_deployed';\n $statement = $db->prepare($sql);\n // 3. Run the query\n $success = $statement->execute();\n // 4. Handle the results\n $arr = [];\n while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n $theProductDeployed = new ProductDeployed($row);\n array_push($arr, $theProductDeployed);\n }\n\n return $arr;\n }",
"public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}",
"public function getCartProducts() :array\n {\n $products = [];\n $query = $this->pdo->prepare(\"SELECT products.id,products.name,products.price,orders_products.quantity,products.image,products.price*orders_products.quantity as summ from products\nINNER JOIN orders_products on products.id=orders_products.product_id\nINNER JOIN orders on orders.id = orders_products.order_id\nWHERE orders.user_id = :id AND orders.status='cart'\");\n $query->execute(array('id'=>$_SESSION['user_id']));\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n foreach ($row as $key => $value) {\n $this->amount+=$row[$key]['price']*$row[$key]['quantity'];\n }\n Cart::setSum($this->amount);\n foreach ($row as $r) {\n array_push($products, $this->mapArrayToProduct($r));\n }\n return $products;\n }",
"public function getProduct(): array\r\n {\r\n $pro = [];\r\n $result = $this->DataB->query('SELECT * FROM product');\r\n\r\n while ($row = $result->fetch_assoc()) {\r\n $pro[] = $row;\r\n }\r\n\r\n return $pro;\r\n }",
"public function selectAll()\n {\n $query = $this->db->get('product');\n return $query;\n }",
"public function getProducts(): array\r\n {\r\n try {\r\n $statement = $this->db->prepare(\"select * from products\");\r\n $statement->execute();\r\n return $this->products = $statement->fetchAll(\\PDO::FETCH_ASSOC);\r\n } catch (\\PDOException $e) {\r\n throw new \\Mpopa\\ExpException(\"Can't get products: \" . $e->getMessage());\r\n }\r\n }",
"public function getCartProduct(){\n $sId = session_id();\n $squery = \"SELECT * FROM tbl_cart WHERE sId='$sId'\";\n $result = $this->db->select($squery);\n if ($result) {\n return $result;\n }else {\n return false;\n }\n }",
"function query() {\n $q = new EntityFieldQuery();\n $q->entityCondition('entity_type', 'commerce_product');\n $q->fieldCondition($this->options['flag_field'], 'value', 1);\n $results = $q->execute();\n\n $product_ids = array();\n foreach (reset($results) as $product) {\n $product_ids[] = (int)$product->product_id;\n }\n // Get the allowed products from the current user.\n $user_product_ids = array();\n $user = user_load($GLOBALS['user']->uid);\n if ($user->uid > 0) {\n // Fetch the ids from the current user.\n $products = field_get_items('user', $user, $this->options['user_authorized_products_field']);\n foreach ($products as $product) {\n $user_product_ids[] = (int)$product['target_id'];\n }\n }\n $exclude_ids = array_diff($product_ids, $user_product_ids);\n if (count($exclude_ids) > 0) {\n $this->query->add_where(2, $this->options['node_products_table'] . '.' . $this->options['node_products_column'], $exclude_ids, 'NOT IN');\n }\n }",
"public function getItemsArray() {\r\n $stmt = $this->DB->prepare ( \"SELECT * FROM products\");\r\n $stmt->execute ();\r\n return $stmt->fetchAll (PDO::FETCH_ASSOC);\r\n }",
"public function getProducts() {\n\n $dbData = new DBData();\n $array_products = [];\n foreach ($this->items as $item) {\n $array_products[] = $dbData->getProductDetails($item['id']);\n }\n return $array_products;\n }",
"public function getProductList()\n {\n return $this->_call('catalog_product.list', '');\n }",
"public function getProductEntries()\n\t{\n\t\treturn $this->productEntries;\n\t}",
"public function productRetrieveAll(){\n\t\t$productId\t\t\t=\tself::getUserId();\n\t\t$productTable\t\t=\tself::getUserTable();\n\t\t$joinTable\t\t\t=\tself::getJoinTable();\n\t\t$productArray\t\t=\tself::getUserArray(); //multi dimension array output\t\t\n\t\t$dbFieldArray\t\t=\tarray();\n\t\tforeach($productArray as $prodIndex => $prodVal){\n\t\t\t$dbFieldArray[]\t=\t$productArray[$prodIndex][0]; //Get db fields only from multi dimension array\n\t\t}\t\t\n\t\t$productCond\t\t=\tself::getUserCond();\t\t\n\t\t$retArray\t\t\t=\tself::retrieveEntry($productTable, $dbFieldArray, $joinTable,$productCond);\n\t\t$returnValue \t\t= \tarray();\t\t\t \t \n\t\tforeach ($retArray as $retIndex => $retValue) {\n $$retIndex \t\t= \t$retValue;\n $mainArr \t\t=\texplode('|', $$retIndex);\t\t\t\n\t\t\t$returnValue[] \t= \t$mainArr;\t\t\t\t\t\t \n }\n\t\treturn $returnValue;\n\t}",
"public function getCartProduct()\n {\t\t\n\t\t$cart_arr = array();\t\t\n\t\t$status_code = '';\n\t\t$message = '';\n\t\t$arrNew = array();\n\t\t$cart_id = $this->config['cart_id'];\n\t\tif(!empty($cart_id)){\n\t\tforeach($cart_id as $id) {\n\t\t\t$cart_Products = $this->ShopifyClient->call('GET','/admin/products/'.$id.'.json');\n\t\t\t\n\t\t\t$cart_arr[] = $cart_Products;\n\t\t}\t\n\t\t\n\t\t}\n\t\t$arra = array();\n\t\tif(!empty($cart_arr))\n\t\t{\n\t\t\tforeach($cart_arr as $product){\n\t\t\t\n\t\t\t\tif(!empty($product['product']))\n\t\t\t\t{\n\t\t\t\t\t$keyArr = array('id','title','image',array('variants'=>array('id','price','compare_at_price')));\n\t\t\t\t\t$shopifyKeyArr = array('id','title','image',array('variants'=>array(0 =>array('id','price','compare_at_price'))));\t\t\t\t\n\t\t\t\tforeach($product as $key=>$val) {\n\t\t\t\t\t$arrNew[] = $this->createProductArray($val,$shopifyKeyArr,$keyArr);\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$arra['data'] = $arrNew;\n\t\t\t\t$status_code = 200;\n\t\t\t\t$message = 'success';\n\t\t\t\t}else\n\t\t\t\t{\t\n\t\t\t\t\t$status_code = 404;\n\t\t\t\t\t$message = 'Product not found';\n\t\t\t\t\t$arra['data'] = array();\n\t\t\t\t\t$arra['data_count'] = 0;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t$cart_Products = $this->getJsonDataFormat($arra,$status_code,$message);\n\t\treturn $cart_Products;\n }",
"function retrieveAll ()\n {\n\n $q = Doctrine_Query::create ()\n ->from ( 'MtnPriceListComponent mplc' )\n ->innerJoin ( 'mplc.MtnComponent mc' )\n ->innerJoin ( 'mplc.MtnPriceList mpl' );\n\n\n return $q->execute ();\n }",
"public function get() {\n $result = array();\n $this->initShoppingCartGetReslut($result);\n $result['is_virtual'] = $this->cart->isVirtualCart();\n $result['cart_items'] = $this->getProducts();\n $result['price_infos'] = $this->getPriceInfo();\n $result['cart_items_count'] = $this->cart->nbProducts();\n $result['payment_methods'] = $this->getPaymentMethods();\n\n return $result;\n }",
"public function getProductSelections();",
"function Cart() {\n\t\t$order = self::get_current_order();\n\t\t$order->Items();\n\t\t$order->Total;\n\n\t\t//HTTP::set_cache_age(0);\n\t\treturn $order;\n\t}",
"function get_temp_products() {\r\n return $this->DBObject->readCursor(\"product_actions.get_temp_products\", null);\r\n }",
"function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }",
"public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }",
"public static function listAll(){//le todos os dados da tabela\n\n\t\t$sql = new Sql();\n\n\t\treturn $sql->select(\n\t\t\t\"SELECT * FROM tb_products ORDER BY desproduct\" \n\t\t\t);\n\t}",
"function getAllFeatureProducts(){\n $sql = self::$connection->prepare(\"SELECT * FROM products WHERE feature = 1\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }",
"public function getSelectedProducts()\n {\n if (!empty($this->object->products)) {\n $productsIds = explode('|', $this->object->products);\n $sql = 'SELECT p.`id_product`, p.`reference`, pl.`name`\n\t\t\t\tFROM `' . _DB_PREFIX_ . 'product` p\n\t\t\t\t' . Shop::addSqlAssociation('product', 'p') . '\n\t\t\t\tLEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl \n\t\t\t\t ON (p.`id_product` = pl.`id_product` ' . Shop::addSqlRestrictionOnLang('pl') . ')\n\t\t\t\tWHERE pl.`id_lang` = ' . (int)$this->context->language->id . '\n\t\t\t\tAND p.`id_product` IN (' . implode(',', $productsIds) . ')\n\t\t\t\tORDER BY FIELD(p.`id_product`, '.implode(',', $productsIds).')';\n\n return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);\n }\n\n return array();\n }",
"public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }",
"public function getProdutos() {\n if ($this->con->isConnected()) { \n $sql = \"SELECT id, name FROM products\";\n $stmt = $this->con->prepare($sql);\n if ($stmt) {\n if ($stmt->execute()) {\n $stmt->bind_result($id, $name);\n $stmt->store_result();\n $produtos = [];\n while($stmt->fetch()) {\n $produtos[] = new Product($id, $name);\n }\n $stmt->close();\n return $produtos;\n }\n }\n }\n return [];\n }",
"public function getActualActionProducts()\n {\n $actionGroupIds = $this->getActionGroupIds();\n $actionCategoriesIds = $this->getActionCategoryIds();\n $actionProductIds = $this->getActionProductIds();\n\n $query = Product::find()\n ->andWhere(['{{%sales_products}}.enabled' => true])\n ->orderBy(['{{%sales_products}}.title' => SORT_ASC]);\n\n if ($this->has_products) {\n // $query->andWhere(['{{%sales_products}}.is_show_in_catalog' => true]);\n } else {\n $dummyCategory = Category::findOne(['name' => Category::DUMMY_PLAN_CATEGORY_NAME]);\n $actionCategoriesIds[] = $dummyCategory->id;\n }\n\n if ($actionGroupIds) {\n $query->andWhere(['IN', 'group_id', $actionGroupIds]);\n }\n\n if ($actionCategoriesIds) {\n $query->andWhere(['IN', 'category_id', $actionCategoriesIds]);\n }\n\n if ($actionProductIds) {\n $query->andWhere(['IN', 'id', $actionProductIds]);\n }\n\n return $query;\n }",
"private function _generateProductsData(){\n \n $products = $this->context->cart->getProducts();\n $pagseguro_items = array();\n \n $cont = 1;\n \n foreach ($products as $product) {\n \n $pagSeguro_item = new PagSeguroItem();\n $pagSeguro_item->setId($cont++);\n $pagSeguro_item->setDescription(Tools::truncate($product['name'], 255));\n $pagSeguro_item->setQuantity($product['quantity']);\n $pagSeguro_item->setAmount($product['price_wt']);\n $pagSeguro_item->setWeight($product['weight'] * 1000); // defines weight in gramas\n \n if ($product['additional_shipping_cost'] > 0)\n $pagSeguro_item->setShippingCost($product['additional_shipping_cost']);\n \n array_push($pagseguro_items, $pagSeguro_item);\n }\n \n return $pagseguro_items;\n }",
"public function getAllOwnProducts() {\n\n $query = $this->db->prepare(\"SELECT * FROM `products` WHERE `vendor_id` = 28 AND `product_removed` = 0\");\n\n try {\n\n $query->execute();\n\n $result = $query->fetchAll();\n return $result;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }",
"public function getAllShoppingItems()\n {\n $query = $this->db->prepare('SELECT `id`, `name`, `bought`, `deleted` FROM `shopping_items`;');\n $query->execute();\n $results = $query->fetchAll();\n return $results;\n }",
"public function getAllProducts() {\n\n $query = $this->db->prepare(\"SELECT * FROM `products` WHERE `product_removed` = 0\");\n\n try {\n\n $query->execute();\n\n $result = $query->fetchAll();\n return $result;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }",
"function details () {\n// Empty\n if (count($_SESSION['cart'])==0) {\n return false;\n }\n\n // Get cart\n $sql = \"SELECT * FROM `products` WHERE `product_id` IN (\";\n $sql .= str_repeat('?,', count($_SESSION['cart']) - 1) . '?';\n $sql .= \")\";\n return $this->fetch($sql, array_keys($_SESSION['cart']), \"product_id\");\n }",
"public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }",
"public function getProduct();",
"function get_products_for_damage() {\r\n return $this->DBObject->readCursor(\"product_actions.get_products_for_damage\", null);\r\n }",
"function productList() {\n\t$categoryIds = array_merge ( [ \n\t\t\t$this->id \n\t], $this->subcategoryIds () );\n\tprint_r ( $categoryIds );\n\t// Find all products that match the retrieved category IDs\n\treturn Product::whereIn ( 'cate_id', $categoryIds )->get ();\n}",
"public function allItemsApi() {\n return Products::with('queue')->get()->toJson();\n }",
"public function getProductCollection()\n {\n $this->_basketProducts = $this->_getCartProductIds();\n $products = $this->_complementaryEngine->sendQuery($this->_basketProducts);\n\n if ($products['rules']) {\n return $this->_getPredictedProducts($products['rules']);\n }\n\n return false;\n }",
"public function getProductsByCart ($cart) {\n\t\t\n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n \n\t\ttry {\n \n\t\t\t$cart_array = json_decode($cart);\n //var_dump($cart_array);\n $list = \"\";\n $cart = array();\n foreach ($cart_array as $key=>$value) {\n if ($list == \"\") {\n $list = \"$key\"; \n } else {\n $list .= \",$key\";\n }\n $cart[$key] = $value;\n }\n \n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n\t\t\tFROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND ea_product.id IN ($list)\n\t\t\tORDER BY avg_price\";\n //print(\"$query\");\n\t\t\tforeach($this->dbo->query($query) as $row) {\n\t\t\t\t$id = stripslashes($row[0]);\n\t\t\t\t$upc = strval(stripslashes($row[1]));\n\t\t\t\t$brand = $this->convertFancyQuotes(stripslashes($row[2]));\n\t\t\t\t$product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n\t\t\t\t$product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n\t\t\t\t$avg_price = stripslashes($row[5]);\n\t\t\t\t$category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n \n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n $product[\"quantity\"] = \"$cart[$id]\"; \n //\n \n $product[\"image_path\"] = $this->getImagePath($upc);\n \n $products[] = $product;\n\t\t\t}\n\t \n\t\t} catch (PDOException $e) {\n\t\t\t$this->errorCode = 1;\n\t\t\t$errorCode = -1;\n\t\t\t$errorMessage = \"PDOException for getProductsByCategory.\";\n\t\t}\t\n \n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $category_name;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\t\t\n\t\t\n \n \n $data = json_encode($data);\n \n\t\treturn $data;\n\t}",
"function afficherProduits(){\n\t\t$sql=\"SElECT * From product\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}"
]
| [
"0.72498643",
"0.66304797",
"0.66202843",
"0.65812314",
"0.6568663",
"0.65243846",
"0.65185755",
"0.643884",
"0.63863313",
"0.62951434",
"0.6259149",
"0.62419873",
"0.62400407",
"0.62339854",
"0.618851",
"0.618539",
"0.61730844",
"0.6154733",
"0.61542565",
"0.6132879",
"0.6114418",
"0.6112845",
"0.6111258",
"0.6107489",
"0.6105183",
"0.60973734",
"0.6094325",
"0.6089005",
"0.6068812",
"0.6064338",
"0.6059205",
"0.6020517",
"0.6019247",
"0.6008874",
"0.60068446",
"0.60068446",
"0.60068446",
"0.60068446",
"0.60056746",
"0.60016435",
"0.59889144",
"0.59841746",
"0.5972941",
"0.59724325",
"0.5971697",
"0.5969314",
"0.59690267",
"0.5968161",
"0.59560925",
"0.59479946",
"0.5945895",
"0.59412354",
"0.5910582",
"0.5895945",
"0.58849365",
"0.58819705",
"0.58765286",
"0.5874132",
"0.5869067",
"0.5861607",
"0.5861235",
"0.5858744",
"0.58584434",
"0.58545214",
"0.5854401",
"0.5852623",
"0.5850472",
"0.58398134",
"0.5830824",
"0.58285016",
"0.58212644",
"0.5803991",
"0.57923657",
"0.5786333",
"0.5785281",
"0.57845217",
"0.5781306",
"0.5769593",
"0.57647",
"0.5763947",
"0.57619923",
"0.57619643",
"0.5760323",
"0.5757422",
"0.5744437",
"0.5738944",
"0.57343674",
"0.57314354",
"0.5702753",
"0.56985605",
"0.56898904",
"0.5689027",
"0.56878835",
"0.56865275",
"0.5681013",
"0.5679781",
"0.5678381",
"0.5669392",
"0.56591034",
"0.5655651"
]
| 0.6585937 | 3 |
sets the amount of items in the cart of a certain item | function setProductInCartCount ($id, $amount) {
//ensures that the cart exists within the session
if (checkCart()) {
//checks if the product is actually in the cart
if (array_key_exists($id, $_SESSION['cart'])) {
if ($amount > 0) {
$_SESSION['cart'][$id]['amount'] = $amount;
} else {
//remove product
unset($_SESSION['cart'][$id]);
}
} else {
//if not add the product to the cart
addToCart($id, $amount);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateNumberOfItems()\n {\n $gameId = intval($_POST['gameId']);\n $amount = intval($_POST['amount']);\n if($amount == 0){\n $amount = 1;\n }\n\n $game = new \\Webshop\\Model\\Game();\n $game = $game->getOne(\"id\", $gameId);\n if (!empty($gameFromDb)) {\n $_SESSION['addToCartError'] = \"Kon de game niet updaten\";\n header(\"Location: /cart\");\n }\n $supply = $game->supply;\n\n // Throw error if the requested amount is higher then the supply\n if ($supply < $amount) {\n $_SESSION['addToCartError'] = \"We hebben maar \" . $supply. \" games in voorraad van \". $game->title;\n $amount = $supply;\n }\n\n\n // Set the new amount in the correct game\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n if ($_SESSION['cart'][$index][0] == $gameId) {\n $_SESSION['cart'][$index][1] = $amount;\n }\n }\n header(\"Location: /cart\");\n }",
"public function updateQuantity() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'][$count]['quantity'] = $this->quantity;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}",
"function set_qty_item( $params ) {\n\t\textract( $params );\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, stock WRITE\" );\n\n\t\t// Changing the current qty means putting back first the previous qty to stock then removing the new one\n\t\t$aqty = $this->db->query( \"SELECT qty, sku FROM cart_items WHERE id='\".$id.\"'\" )->row_array();\n\t\t$this->db->query( \"UPDATE stock SET qty=qty+{$aqty['qty']}-\".$qty.\" WHERE sku='{$aqty['sku']}'\" );\n\n\t\t$res = $this->db->query( \"UPDATE cart_items SET qty='\".$qty.\"' WHERE id='\".$id.\"' AND user='\".$user_no.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\t\treturn $res;\n\t}",
"public function update_quantity()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$quantity = $this->input->post('quantity');\n\t\t$this->cart->update_quantity($item->product, $item->variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"public function testUpdateQuantity()\n {\n $cart = new Cart(['foo']);\n $this->assertEquals(['foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 6);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'foobar']);\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['bar', 'foo', 'foo', 'foo', 'foo', 'foobar'], $cart->getItems());\n }",
"function updateItemQuantity($index, $amount)\n {\n $_SESSION['cart'][$index]['quantity'] += $amount;\n $_SESSION['cart'][$index]['total'] += $_SESSION['cart'][$index]['price'] * $amount;\n if ($_SESSION['cart'][$index]['quantity'] == 0) {\n unset($_SESSION['cart'][$index]);\n $_SESSION['cart'] = array_values($_SESSION['cart']);\n }\n }",
"public function updateCartQuantity()\n {\n if(isset($_GET[\"quantity\"]) && $_GET[\"quantity\"] > 0) {\n $_SESSION[\"products\"][$_GET[\"update_quantity\"]][\"product_qty\"] = $_GET[\"quantity\"];\n }\n\n $total_product = count($_SESSION[\"products\"]);\n die(json_encode(['products' => $total_product]));\n }",
"function updateItemQty(){\n $update = 0;\n // Get cart item info\n $rowid = $this->input->get('rowid');\n $qty = $this->input->get('qty');\n\n // Update item in the cart\n if(!empty($rowid) && !empty($qty)){\n $data = array(\n 'rowid' => $rowid,\n 'qty' => $qty\n );\n $update = $this->cart->update($data);\n }\n\n // Return response\n echo $update?'ok':'err';\n }",
"function set_quantity( $cart_item_key, $quantity = 1 ) {\n\t\t\tif ($quantity==0 || $quantity<0) :\n\t\t\t\tunset($this->cart_contents[$cart_item_key]);\n\t\t\telse :\n\t\t\t\t$this->cart_contents[$cart_item_key]['quantity'] = $quantity;\n\t\t\tendif;\n\t\n\t\t\t$this->set_session();\n\t\t}",
"public function updateQuantity()\n {\n $this->load('itemAddressFiles');\n $quantity = 0;\n foreach ($this->itemAddressFiles as $addressFileLink) {\n $quantity += $addressFileLink->count;\n }\n $quantity += $this->mail_to_me;\n $this->quantity = $quantity;\n $this->save();\n $this->_calculateTotal();\n }",
"public function updateItemQuantity( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->where($params);\r\n\t\t\t$qty = array('quantity'=>$map['quantity']);\r\n\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t}",
"function updateCart($ucart) {\n\t\tfor ($i=0; $i < count($ucart['item']); $i++) {\n\t\t\t$item = $ucart['item'][$i];\n\t\t\t$newQty = $ucart['quantity'][$i];\n\t\t\t//set the new quantity\n\t\t\t$_SESSION['cart'][$item] = $newQty;\n\t\t}\n\t}",
"function set_num_items($num){\n $this -> num_of_items = $num;\n }",
"public function testItemQtyUpdate()\n {\n $item = $this->addItem();\n $itemHash = $item->getHash();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n\n $this->assertEquals(7, $item->qty);\n $this->assertEquals($itemHash, $item->getHash());\n\n $options = [\n 'a' => 2,\n 'b' => 1\n ];\n\n $item = $this->addItem(1, 1, false, $options);\n $this->addItem(1, 1, false, array_reverse($options));\n\n $this->assertEquals(2, $item->qty);\n }",
"public function updateCart()\n {\n $this->total = CartFcd::subtotal();\n $this->content = CartFcd::content();\n }",
"public function testUpdateItem()\n {\n $item = $this->addItem();\n\n $this->laracart->updateItem($item->getHash(), 'qty', 4);\n\n $this->assertEquals(4, $item->qty);\n }",
"function totalItems() {\n if(isset($_GET['add_cart'])) {\n\n global $con;\n\n $ip = getIp();\n\n $run_items = mysqli_query($con, \"SELECT * FROM cart WHERE ip_add='$ip'\");\n\n $count_items = mysqli_num_rows($run_items);\n\n } else {\n global $con;\n\n $ip = getIp();\n\n $run_items = mysqli_query($con, \"SELECT * FROM cart WHERE ip_add='$ip'\") or die(mysqli_error($con));\n\n $count_items = mysqli_num_rows($run_items);\n\n while($get_items = mysqli_fetch_array($run_items)) {\n\n $pro_qty = $get_items['qty'];\n if($pro_qty > 1) {\n $count_items = $count_items + $pro_qty - 1;\n }\n }\n }\n\n echo $count_items;\n\n }",
"public function changeQtyAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isChangeItemQtyAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n $quoteItem->setQty(\n $this->getRequest()->getPost('qty')\n );\n\n try {\n if ($quoteItem->getHasError() === true) {\n $result['error'] = $quoteItem->getMessage(true);\n } else {\n $this->_recalculateTotals();\n $result['success'] = true;\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during changing product qty');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }",
"private function setTotalFromData()\n {\n if ($this->dataHasTotal()) {\n $this->collection->items[$this->cart_hash]->total = $this->data['total'];\n $this->collection->increaseTotal($this->data['total']);\n }\n }",
"public function increaseItem($rowId){\n // kemudian ambil semua isi product\n // ambil session login id\n // cek eloquent id\n $idProduct = substr($rowId, 4, 5);\n $product = ProductModel::find($idProduct);\n $cart = \\Cart::session(Auth()->id())->getContent();\n $checkItem = $cart->whereIn('id', $rowId);\n \n // kita cek apakah value quantity yang ingin kita tambah sama dengan quantity product yang tersedia\n if($product->qty == $checkItem[$rowId]->quantity){\n session()->flash('error', 'Kuantiti terbatas');\n }\n else{\n \\Cart::session(Auth()->id())->update($rowId, [\n 'quantity' => [\n 'relative' => true,\n 'value' => 1\n ]\n ]);\n }\n\n }",
"public function modify() {\n\t\t$cart = D('ShoppingCart');\n\t\t// call a method in shopping cart model\n\t\t// decide by return value to give different hint\n\t\tif ($cart->modifyCount($this->_session('uid'), $_POST['good_id'], $_POST['good_count'], $_POST['add'])) {\n\t\t\t$this->success('Modification succeeded!');\n\t\t} else {\n\t\t\t$this->error('Modification failed!');\n\t\t}\n\t}",
"public function getCartItemsCount ($cart_id);",
"function quantity_count($cookie_type){\r\nglobal $items_in_cart;\r\n\tif ($_SESSION[$cookie_type]){\r\n\t\t$items_in_cart+=1;\r\n\t}\r\n\telseif(!$items_in_cart){\r\n\t\t$items_in_cart=0;\r\n\t}\r\n}",
"static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }",
"public function incrementCartItem()\n {\n cart()->incrementQuantityAt(request('id'));\n\n\n return redirect()->route('cart');;\n }",
"public function updateQuantity(int $quantity)\n {\n $newQuantity = $quantity - $this->quantity();\n $item = $this->items->first();\n $item->quantity = $item->quantity + $newQuantity;\n $item->save();\n }",
"public function setQty($qty);",
"public function update($items = array())\n {\n if ($this->_checkCartUpdate($items) === TRUE)\n {\n\t\t\t$this->_session['products'][$items['token']]['qty'] = $items['qty'];\n $this->trigger(CartEvent::EVENT_UPDATE_QUANTITY_POST, $items['token'], $this->_session['products'][$items['token']], $this);\n }\n }",
"public function editCartQuant($username, $sku, $amount){\n $cartQuery = mysqli_fetch_array($this->connection->query(\"SELECT cart FROM users WHERE username = '$username'\"));\n $cart = $cartQuery['cart'];\n $currentInventoryQuant = mysqli_fetch_array($this->connection->query(\"SELECT quantity FROM items WHERE sku = '$sku'\"));\n\n //Update overall inventory\n $updatedInventory = $cart[$sku-1] - $amount;\n $updatedInventory = $currentInventoryQuant[0] + $updatedInventory;\n $query = \"UPDATE items SET quantity = '$updatedInventory' WHERE sku = '$sku'\";\n $this->connection->query($query);\n\n //Send an updated query using the new cartQuery array\n $cart[$sku-1] = $amount;\n $query = \"UPDATE users SET cart = '$cart' WHERE username = '$username'\";\n $this->connection->query($query);\n return true;\n }",
"function total_items($cart){\n\t\t$items = 0;\n\t\tif(is_array($cart)){\n\t\t\tforeach($cart as $isbn => $qty){\n\t\t\t\t$items += $qty;\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}",
"public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }",
"public function addItemToCart($account_id, $item_id, $quantity = false);",
"function items() {\n\t\n if(isset($_GET['add_cart'])){\n\t\n\t global $db;\n\t \n\t $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); /* Counting how many items user has added to cart*/\n\t }\t\n\t\n\telse \n\t{\n\t global $db;\n\t \n $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); \t \n\t\t\n\t\t\n\t}\n\n\t echo $count_items;\n\t}",
"function total_items($cart){\n $items = 0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $items += $qty;\n }\n }\n return $items;\n }",
"public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculatePriceTotal();\n }",
"public function changeQuantityItemToCart(Request $request)\n {\n return $this->repository->changeQuantityItemToCart($request);\n }",
"public function update($id, $newQty){\n $cart = Session::get('cart');\n // calculations of add/reduce\n $lessQty = $this->items[$id]['qty'] -= $newQty;\n $moreQty = $newQty -= $cart->items[$id]['qty'];\n $lessTotal = $this->items[$id]['price'] * $lessQty;\n $moreTotal = $this->items[$id]['price'] * $moreQty;\n // if == 0, destroy\n if($newQty == 0) {\n $cart->totalQty -= $lessQty;\n $cart->totalPrice -= $lessTotal;\n unset($cart->items[$id]);\n Session::put('cart', $cart);\n } else { // else reduce values\n if($cart->items[$id]['qty'] > $newQty) {\n $cart->totalQty -= $lessQty;\n $cart->totalPrice -= $lessTotal;\n $cart->items[$id]['qty'] -= $lessQty;\n Session::put('cart', $cart);\n } else { // or add values\n $cart->totalQty += $moreQty;\n $cart->totalPrice += $moreTotal;\n $cart->items[$id]['qty'] += $moreQty;\n Session::put('cart', $cart);\n }\n }\n if($cart->totalQty <= 0){\n Session::forget('cart');\n }\n }",
"public function setQty($prod_id, $newQty)\n {\n // if the item already exists\n if (array_key_exists($prod_id, $this->items)) {\n $this->items[$prod_id] = $newQty;\n } else {\n $this->items = $this->items + array($prod_id => $newQty);\n }\n\n if ($this->items[$prod_id] <= 0) {\n unset($this->items[$prod_id]);\n }\n $this->calcTotal();\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 }",
"public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculate();\n }",
"public function testGetItemsCount()\n {\n $cart = new Cart([0, 1, 2, 3]);\n $this->assertEquals(4, $cart->getItemsCount());\n }",
"public function testWithTwoItemsValuedAt10ShouldHaveATotalOf20()\n {\n $item1 = $this->makeStubShoppingCartItemWithPrice(10);\n $item2 = $this->makeStubShoppingCartItemWithPrice(10);\n $this->cart->addItem($item1);\n $this->cart->addItem($item2);\n\n $this->assertEquals(20, $this->cart->total());\n }",
"public function setProductItemCounts($val)\n {\n $this->_propDict[\"productItemCounts\"] = $val;\n return $this;\n }",
"public static function update_item($key, $quantity) {\n $quantity = (int) $quantity;\n if (isset($_SESSION['bookCart'][$key])) {\n if ($quantity <= 0) {\n unset($_SESSION['bookCart'][$key]);\n } else {\n $_SESSION['bookCart'][$key]['qty'] = $quantity;\n $total = $_SESSION['bookCart'][$key]['cost'] *\n $_SESSION['bookCart'][$key]['qty'];\n $_SESSION['bookCart'][$key]['total'] = $total;\n }\n }\n }",
"public function update_cart_product_quantity($product_id, $cart_item_id, $quantity)\n {\n $cart = $this->session_cart_items;\n if (!empty($cart)) {\n foreach ($cart as $item) {\n if ($item->cart_item_id == $cart_item_id) {\n $item->quantity = $quantity;\n }\n }\n }\n $this->session->set_userdata('mds_shopping_cart', $cart);\n }",
"function total_items(){\n \n \tglobal $con; \n\t$ip = getIp(); \n\t$count_items=0;\n\tif(isloggedin()){\n\t $c_id=$_SESSION['cid'];\n\t \n\t $get_items = \"select * from cart where customer_id='$c_id'\";\n\t\t$run_items = mysqli_query($con, $get_items); \n\t\twhile($items=mysqli_fetch_array($run_items)){\n\t\t $item_qty=$items['qty'];\n\t\t \n\t\t $count_items += $item_qty;\n\t\t \n\t\t}\n\t\t\n\t}\n\telse{\n\t\t$get_items = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n\t\t$run_items = mysqli_query($con, $get_items); \n\t\twhile($items=mysqli_fetch_array($run_items)){\n\t\t $item_qty=$items['qty'];\n\t\t \n\t\t $count_items += $item_qty;\n\t\t \n\t\t}\n\t\t \n\t}\n \n\techo $count_items.\" \";\n\t}",
"public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }",
"public function updateSellIn(): void\n {\n $this->getItem()->sell_in--;\n }",
"public function setToCart()\n\t{\n\t\t$this->cart->set($this->request->getInteger('record'), $this->request->getInteger('amount', 1), [\n\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t]);\n\t\t$this->saveCart();\n\t}",
"public function testSetGetQuantity()\n {\n $this->item->setQuantity(2);\n $this->assertEquals($this->item->getQuantity(), 2);\n }",
"public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}",
"public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }",
"public function setTotalItems($items)\n {\n $this->totalItems = (int)$items;\n return $this;\n }",
"public function setBuffFromItems()\n {\n\n if (isset($_SESSION[\"inventory\"]) && sizeof($_SESSION[\"inventory\"]) > 0) {\n\n $atk_total_items = 0;\n $health_total_items = 0;\n $mana_total_items = 0;\n\n foreach ($_SESSION['inventory'] as $item) {\n if ($item->getStatAtk()) {\n $atk_total_items += $item->getStatAtk();\n }\n if ($item->getStatHealth()) {\n $health_total_items += $item->getStatHealth();\n }\n if ($item->getStatMana()) {\n $mana_total_items += $item->getStatMana();\n }\n }\n\n $_SESSION[\"character\"]->setAtk($_SESSION[\"character\"]->getBaseAtk() + $atk_total_items);\n $_SESSION[\"character\"]->setHp($_SESSION[\"character\"]->getBaseHp() + $health_total_items);\n $_SESSION[\"character\"]->setMana($_SESSION[\"character\"]->getBaseMana() + $mana_total_items);\n\n $_SESSION[\"character\"]->setBuffActivated(true);\n }\n }",
"function cart_count(){\n\t\tif(isset($_SESSION['cart'])){\n\t\t\t$cart = $_SESSION['cart'];\n\t\t\t$item_count = 0;\n\t\t\tforeach($cart as $item_id => $item_quantity){\n\t\t\t\t$item_count += $item_quantity;\n\t\t\t}\n\t\t\treturn $item_count;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function changeQuantityAction()\r\n {\r\n if ($this->Request()->getParam('sArticle') && $this->Request()->getParam('sQuantity')) {\r\n $this->View()->sBasketInfo = $this->basket->sUpdateArticle($this->Request()->getParam('sArticle'), $this->Request()->getParam('sQuantity'));\r\n }\r\n $this->forward($this->Request()->getParam('sTargetAction', 'index'));\r\n }",
"function total_items(){\n\t\tif(isset($_GET['add_cart'])){\n\t\t\tglobal $connection;\n\t\t\t$ip=getIp();\n\t\t\t$get_items=\"select * from cart where ip_address='$ip'\";\n\t\t\t$run_items=mysqli_query($connection,$get_items);\n\t\t\t$count_items=mysqli_num_rows($run_items); \n\t\t}else{\n\t\t\tglobal $connection;\n\t\t\t\t$ip=getIp();\n\t\t\t$get_items=\"select * from cart where ip_address='$ip'\";\n\t\t\t$run_items=mysqli_query($connection, $get_items);\n\t\t\t$count_items=mysqli_num_rows($run_items); \n\t\t\t}\n\t\t\techo $count_items;\n\t\t}",
"public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }",
"public function update_qty_item($itemqty, $arrayDelete){\n\t\t\tforeach ($_SESSION['terminal_list'][$arrayDelete] as $key => $value) {\n\t\t\t\t$_SESSION['terminal_list'][$arrayDelete][$key]->quantity = $itemqty;\n\t\t\t}\n\t\t\treturn 'sucess';\t\n\t}",
"public function setTotalItemCount($totalItemCount);",
"function validate_update_cart_item(){\n\t\t$total = count($this->cart->contents());\n\t\t \n\t\t// Retrieve the posted information\n\t\t$item = $this->input->post('rowid');\n\t\t$qty = $this->input->post('qty');\n\t \n\t\t// Cycle true all items and update them\n\t\tfor($i=0;$i < $total;$i++)\n\t\t{\n\t\t\t// Create an array with the products rowid's and quantities. \n\t\t\t$data = array(\n\t\t\t 'rowid' => $item[$i],\n\t\t\t 'qty' => $qty[$i]\n\t\t\t);\n\t\t\t \n\t\t\t// Update the cart with the new information\n\t\t\t$this->cart->update($data);\n\t\t}\n\t \n\t}",
"public function update(Request $request, $id) {\n $new_quantity = $request->post('quantity-input');\n\n // find requested cart item of logged user in DB and update it\n if(Auth::check()){\n $cartItem = CartItem::find($id);\n\n $this->authorize('update', $cartItem);\n\n $cartItem->update(['amount'=>$new_quantity]);\n }\n\n // find requested cart item of guest in session and update it\n else {\n $cartItems = session()->get('cartItems');\n session()->forget('cartItems');\n\n foreach ($cartItems as $key => &$item) {\n\n if ($key == $id) {\n $cartItems[$key]['amount'] = $new_quantity;\n break;\n }\n }\n\n session()->put('cartItems',$cartItems);\n }\n\n return redirect('/cart');\n }",
"public static function totalItem(){\n if(Auth::check()){\n $cart = cart::Where('user_id', Auth::id() )\n ->Where('order_id',NULL)\n ->get();\n }\n else{\n $cart = cart::Where('ip_address', request()->ip() )\n ->Where('order_id',NULL)\n ->get();\n }\n $totalItem=0;\n foreach ($cart as $value) {\n $totalItem += $value->product_quantity;\n }\n return $totalItem;\n\n}",
"private function update_total_of_cart() {\n\t\t// Get products\n\t\t$products = $this->get_current_products();\n\n\t\t// Loop through and add subtotals\n\t\t$total = 0;\n\t\tforeach ($products as $product) {\n\t\t\t$total += $product[\"subtotal\"];\n\t\t}\n\n\t\t// Check if promo code attached and delete if total drops below minimum amount\n\t\tif ($this->does_cart_already_have_promo_code() == true) {\n\t\t\t// Yes, it does, check to see if still above minimum amount\n\t\t\t$promo_code = $this->promo_code;\n\t\t\tif ($promo_code->code_type == 2) {\n\t\t\t\tif ($total < $promo_code->minimum_amount) {\n\t\t\t\t\t$this->remove_promo_code();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update and save\n\t\t$this->cart_total = $total;\n\t\t$this->save();\n\t}",
"public function astra_addon_add_offcanvas_quantity_fields( $html, $cart_item, $cart_item_key ) {\n\n\t\t\t$_product = apply_filters(\n\t\t\t\t'woocommerce_cart_item_product',\n\t\t\t\t$cart_item['data'],\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\t\t\t$product_price = apply_filters(\n\t\t\t\t'woocommerce_cart_item_price',\n\t\t\t\tWC()->cart->get_product_price( $cart_item['data'] ),\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\t$product_subtotal = apply_filters(\n\t\t\t\t'woocommerce_cart_item_subtotal',\n\t\t\t\tWC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ),\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\tif ( $_product->is_sold_individually() ) {\n\t\t\t\t$product_quantity = sprintf( '1 <input type=\"hidden\" name=\"cart[%s][qty]\" value=\"1\" />', $cart_item_key );\n\t\t\t} else {\n\t\t\t\t$product_quantity = trim(\n\t\t\t\t\twoocommerce_quantity_input(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'input_name' => \"cart[{$cart_item_key}][qty]\",\n\t\t\t\t\t\t\t'input_value' => $cart_item['quantity'],\n\t\t\t\t\t\t\t'max_value' => $_product->get_max_purchase_quantity(),\n\t\t\t\t\t\t\t'min_value' => '0',\n\t\t\t\t\t\t\t'product_name' => $_product->get_name(),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$_product,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $product_quantity . '<div class=\"ast-mini-cart-price-wrap\">' . $product_subtotal . '</div>';\n\t\t}",
"public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&tab=buy&area=cart\" );\n\t}",
"public function setTotalItems(int $totalItems): self;",
"function add_to_cart($id,$qty){\r\n\r\n $row = $this->Web_model->get_by_id($id);\r\n $kategori = $this->Web_model->get_by_idkat($row->id_kategori);\r\n if ($row) {\r\n $datas= array(\r\n 'id' => $row->id_menu,\r\n 'name' => $row->nama_menu,\r\n 'price' => $row->harga,\r\n 'qty' => $qty, \r\n 'id_kategori' => $row->id_kategori,\r\n 'gambar' => $row->foto_menu,\r\n 'nama_kategori' => $kategori->nama_kategori,\r\n );\r\n $this->cart->product_name_rules = '[:print:]';\r\n $this->cart->insert($datas);\r\n echo(count($this->cart->contents()));\r\n }\r\n }",
"function setAmount($product, $instock)\n{\n\tinclude 'setup.php';\n\n\t$stocks = getStocks();\n\tif($stocks == -1)\n\t\treturn -1;\n\n\tif(isset($stocks[$product]))\n\t\t$stocks[$product][instock] = intval($instock);\n\telse\n\t\t$stocks[$product] = array(instock => intval($instock), sold => 0);\n\n\t$handle = fopen($STOCKFILE, \"w\");\n\tif($handle == FALSE)\n\t{\n\t\treturn -1;\n\t}\n\telse\n\t{\n\t\tflock($handle, 2);\t// get exclusive lock\n\t\tif(fwrite($handle, serialize($stocks), strlen(serialize($stocks))) == FALSE)\n\t\t\t$retval = -1;\n\t\telse\n\t\t\t$retval = 0;\n\n\t\tflock($handle, 3);\t// release lock after write\n\t\tfclose($handle);\n\t\treturn $retval;\n\t}\n}",
"function add_item_to_cart( $prodId = null ) {\n if ( null != $prodId && is_numeric( $prodId ) ) {\n\n // Probably should sql check database to see\n // if product exisits.\n\n if( $_SESSION[\"cart\"][$prodId] ) {\n $_SESSION[\"cart\"][$prodId]++;\n }\n else {\n $_SESSION[\"cart\"][$prodId] = 1;\n }\n }\n}",
"public function setQuantity(int $quantity)\n {\n $this->quantity = $quantity;\n }",
"function setItem_price($price){\n $this->item_price = $price;\n }",
"public function updateCart(Request $request)\n {\n $session_id = Session::getId(); \n\n $shopping_cart = shopping_cart::where('session_id', $session_id)->first();\n\n //$shopping_cart = shopping_cart::where('session_id', '!=', $session_id)->where('item_id','=',$request->item_id)->where('time', '>', time() -600)->first();\n //if (product->quantity - $shopping_cart > $request->quantity)\n \n $product = Item::find($request->cart_id);\n\n //check if stock is available\n if ( ($product->quantity + $shopping_cart->quantity) >= $request->quantity) {\n\n $product->quantity += $shopping_cart->quantity;\n $product->quantity -= $request->quantity;\n\n $product->save(); \n\n //update item quantity in shopping cart\n $shopping_cart->quantity = $request->quantity;\n $shopping_cart->save(); \n \n }\n else{\n return redirect()->route('products.shoppingCart')->with('error', 'Amount entered exceeds availble stock');\n }\n\n //update cart model\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new Cart($oldCart);\n // $product = Item::find($request->cart_id);\n $cart->update($product, $product->id);\n\n // $request->session()->put('cart', $cart);\n\n if (count($cart->items) > 0) {\n Session::put('cart', $cart);\n } else {\n Session::forget('cart');\n }\n\n\n // $items['item']['qty'] = $request->quantity;\n\n // $oldCart = Session::has('cart') ? Session::get('cart') : null;\n // Session::put('quantity', $request->quantity);\n // $request->session()->put('cart', $cart);\n\n // $request->session()->put('cart', $cart);\n\n return redirect()->route('products.shoppingCart')->with('message', 'Quantity updated!');\n }",
"public function addItemToCart( $item ){\n $this->cartItems[] = $item;\n Cart::updateTotalPrice();\n }",
"public function addItem(string $sku, int $qty): Cart;",
"public function add($fruit) {\r\n \r\n // We get the number of $fruit in the basket\r\n // +1 to qty\r\n // Update value in basket\r\n\r\n $qty = $this->get($fruit);\r\n $this->itemQtyArr[$fruit] = $qty + 1;\r\n }",
"function totalItems(){\n\tif (isset($_GET['addCart'])) {\n\t\tglobal $conn;\n\t\t$ipAddr=getIp();\n\n\t\t$getItems=\"SELECT * FROM cart WHERE ipAddr='$ipAddr'\";\n\t\t$runGetItems=mysqli_query($conn, $getItems);\n\n\t\t$countItems=mysqli_num_rows($runGetItems);\n\t}else{\n\n\t\tglobal $conn;\n\t\t$ipAddr=getIp();\n\n\t\t$getItems=\"SELECT * FROM cart WHERE ipAddr='$ipAddr'\";\n\t\t$runGetItems=mysqli_query($conn, $getItems);\n\n\t\t$countItems=mysqli_num_rows($runGetItems);\n\t}\n\n\techo $countItems;\n}",
"public function updateQuantity(Request $request)\n {\n $cart = $request->session()->get('pos.cart', collect([]));\n $cart = $cart->map(function ($object, $key) use ($request) {\n if($key == $request->key){\n $product = \\App\\Product::find($object['id']);\n $product_stock = $product->stocks->where('id', $object['stock_id'])->first();\n\n if($product_stock->qty >= $request->quantity){\n $object['quantity'] = $request->quantity;\n }else{\n return array('success' => 0, 'message' => translate(\"This product doesn't have more stock.\"), 'view' => view('pos.cart')->render());\n }\n }\n return $object;\n });\n $request->session()->put('pos.cart', $cart);\n\n return array('success' => 1, 'message' => '', 'view' => view('pos.cart')->render());\n }",
"public function calculateQtyToShip();",
"public function setQuantity($val)\n {\n $val = $val < 1 ? 1 : $val;\n $this->setField('Quantity', $val);\n }",
"function items(){\n\tif(isset($_GET['add_cart'])){\n\t\t\n\t\tglobal $db;\n\t\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\t$get_items = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_items = mysqli_query($db,$get_items);\n\t\t\n\t\t$count_items = mysqli_num_rows($run_items);\n\t\t\n\t}\n\telse {\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$ip_add = getRealIpAddr();\n\t\t\n\t\t$get_items = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_items = mysqli_query($db,$get_items);\n\t\t\n\t\t$count_items = mysqli_num_rows($run_items);\n\t\t\t\t}\n\t\n\techo $count_items;\n\t\n}",
"public function readdItems($input) {\n $orderItems = \\App\\OrderItem::where('order_id', $input['order_id'])->get();\n foreach ($orderItems as $orderItem) {\n \\App\\Product::where('id', $orderItem->product_id)->increment('qty', $orderItem->qty);\n }\n }",
"public function setItemQuantity($productId, $quantity) {\n Doctrine_Query::create()\n ->update('Orderdetail od')\n ->where('od.Product = ?', $productId)\n ->andWhere('od.Order = ?', $this->getOrderId())\n ->set('quantity', $quantity)\n ->execute();\n }",
"public function cartAction()\n {\n if (!$this->_validateFormKey()) {\n return $this->_redirect('*/*');\n }\n $itemId = (int) $this->getRequest()->getParam('item');\n\n /* @var $item Mage_Wishlist_Model_Item */\n $item = Mage::getModel('wishlist/item')->load($itemId);\n if (!$item->getId()) {\n return $this->_redirect('*/*');\n }\n $wishlist = $this->_getWishlist($item->getWishlistId());\n if (!$wishlist) {\n return $this->_redirect('*/*');\n }\n\n // Set qty\n $qty = $this->getRequest()->getParam('qty');\n if (is_array($qty)) {\n if (isset($qty[$itemId])) {\n $qty = $qty[$itemId];\n } else {\n $qty = 1;\n }\n }\n $qty = $this->_processLocalizedQty($qty);\n if ($qty) {\n $item->setQty($qty);\n }\n\n /* @var $session Mage_Wishlist_Model_Session */\n $session = Mage::getSingleton('wishlist/session');\n $cart = Mage::getSingleton('checkout/cart');\n\n $redirectUrl = Mage::getUrl('*/*');\n\n try {\n $options = Mage::getModel('wishlist/item_option')->getCollection()\n ->addItemFilter(array($itemId));\n $item->setOptions($options->getOptionsByItem($itemId));\n \n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null;\n if($itemBuyRequest['super_attribute']) {\n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n $itemBuyRequest->setData('product', $childProduct->getId());\n } \n\n $buyRequest = Mage::helper('catalog/product')->addParamsToBuyRequest(\n $this->getRequest()->getParams(),\n array('current_config' => $itemBuyRequest)\n );\n \n // Overwrite stored product with loaded simple configurable because it holds stock info\n if($childProduct) {\n $buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n }\n $item->mergeBuyRequest($buyRequest);\n \n if ($item->addToCart($cart, true)) {\n $cart->save()->getQuote()->collectTotals();\n }\n\n $wishlist->save();\n Mage::helper('wishlist')->calculate();\n\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n }\n Mage::helper('wishlist')->calculate();\n\n $product = Mage::getModel('catalog/product')\n ->setStoreId(Mage::app()->getStore()->getId())\n ->load($item->getProductId());\n $productName = Mage::helper('core')->escapeHtml($product->getName());\n $message = $this->__('%s was added to your shopping cart.', $productName);\n Mage::getSingleton('catalog/session')->addSuccess($message);\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $session->addError($this->__('This product(s) is currently out of stock'));\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n Mage::getSingleton('catalog/session')->addNotice($e->getMessage());\n $redirectUrl = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));\n } else {\n Mage::getSingleton('catalog/session')->addNotice($e->getMessage());\n $redirectUrl = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $session->addException($e, $this->__('Cannot add item to shopping cart'));\n }\n\n Mage::helper('wishlist')->calculate();\n\n return $this->_redirectUrl($redirectUrl);\n }",
"public function setQuantity($value)\n\t{\n\t\t$this->searchFilters[$this->ref_quantity] = $value;\n\t}",
"function items(){\n if(isset($_GET['add_cart'])){\n global $db;\n $ip_add=getRealIpAddr();\n $get_items = \"SELECT * FROM cart where ip_add='$ip_add'\";\n $run_items = mysqli_query($db, $get_items);\n $count_items = mysqli_num_rows($run_items);\n }else{\n global $db;\n $ip_add=getRealIpAddr();\n $get_items = \"SELECT * FROM cart where ip_add='$ip_add'\";\n $run_items = mysqli_query($db, $get_items);\n $count_items = mysqli_num_rows($run_items);\n }\n echo $count_items;\n }",
"private function add($product){\n $cart = ['qty'=>0,'price' => 0, 'product' => $product];\n if($this->items){\n if(array_key_exists($product->prod_id, $this->items)){\n $cart = $this->items[$product->prod_id];\n }\n }\n $cart['qty']++;\n $cart['price'] += $product->price;\n $this->items[$product->prod_id] = $cart;\n $this->totalQty++;\n $this->totalPrice += $product->price;\n }",
"private function addProductCount($product_id, $quantity)\n {\n $this->cart[$product_id]['quantity'] += $quantity;\n }",
"public function setCart()\n {\n $this->cart = $this->session->get('cart');\n }",
"public function save()\n {\n $this->_user->setAttribute(\n 'cart_items',\n $this->_items,\n timpanyCart::SESSION_NS\n );\n }",
"function updateCart($id, $format, $finition, $cadre, $prix) {\n $indexToUpdate = null;\n\n foreach (panier() as $index => $cart) {\n if ($id === $cart['id'] && \n $format === $cart['format'] && \n $finition === $cart['finition'] && \n $cadre === $cart['cadre']) {\n $indexToUpdate = $index;\n }\n }\n\n $_SESSION['cart'][$indexToUpdate]['quantity']++;\n $cart['prix'] = $prix * $_SESSION['cart'][$indexToUpdate]['quantity'];\n}",
"public function calculateItemQuantity($data){\n\t\textract($data);\n\t\tif ($mode == 'order' || $mode == 'pull') {\n\t\t\t$sell_qty = $this->Item->OrderItem->field('sell_quantity', array('id' => $rowId));\n\t\t\treturn $this->itemRecord['Item']['quantity'] + ($pullQty * $sell_qty);\n\t\t} elseif ($mode == 'replenishment') {\n\t\t\t// we need the quantity per unit for this replenishment item\n\t\t\t$po_qty = $this->Item->ReplenishmentItem->field('po_quantity', array('id' => $rowId));\n\t\t\treturn $this->itemRecord['Item']['quantity'] + ($pullQty * $po_qty);\n\t\t}\n }",
"public function deletecartitem() {\n $userId = $_POST['userId'];\n $itemId = $_POST['itemId'];\n $shopId = $_POST['shopId'];\n $size = $_POST['size'];\n if (isset($_POST['qnty'])) {\n $qnty = $_POST['qnty'];\n } else {\n $qnty = 0;\n }\n $cartId = TableRegistry::get('Carts');\n // DELETE & UPDATE ITEM & QUANTITY IN CART\n $query = $cartId->query();\n if ($qnty == 0) {\n $query->delete()\n ->where(['user_id' => $userId])\n ->where(['payment_status' => 'progress'])\n ->where(['id' => $itemId])\n ->execute();\n } else {\n $query->update()\n ->set(['quantity' => $qnty])\n ->where(['user_id' => $userId])\n ->where(['id' => $itemId])\n ->execute();\n }\n\n $itemCount = TableRegistry::get('Carts')->find('all')->where(['user_id' => $userId])->where(['payment_status' => 'progress'])->count();\n if ($itemCount == 0) {\n $this->Flash->success('Your Shopping Cart is Empty');\n echo '0';\n die;\n } else {\n return $this->updatecart();\n }\n }",
"public static function countItems()\n {\n $count = 0;\n if (isset($_SESSION['cart'])) {\n $count = count($_SESSION['cart']);\n }\n \n return $count;\n }",
"public function setQuantity(int $quantity): void\n {\n $this->_quantity = $quantity;\n }",
"public function getItemsCount(): int\r\n {\r\n return $this->user->wishlistItems()->count();\r\n }",
"private function addToCart () {\n }",
"private function addToCart () {\n }",
"function cart(){\n\n\tif(isset($_GET['add_cart'])){\n\n\t\tglobal $con; \n\t\t\n\t\t$ip = getIp();\n\t\t//t($ip);\n\t\t$pro_id = $_GET['add_cart'];\n $pro_stock=sqlsel1('products','product_id',$pro_id,'stock');\n //$pro_qty=sqlsel1('cart','p_id',$pro_id,'qty');\n //t($pro_stock);\n if(isloggedin()){\n $c_id=$_SESSION['cid'];\n\t\t\t$check_pro = \"select * from cart where customer_id='$c_id' AND p_id='$pro_id'\";\n\t\t}\n else{\n $check_pro = \"select * from cart where ip_add='$ip' AND customer_id='0' AND p_id='$pro_id'\";\n\t\t}\n \n\t\t$run_check = mysqli_query($con, $check_pro); \n\t\twhile($items=mysqli_fetch_array($run_check)){\n\t\t $pro_qty=$items['qty'];\n\t\t}\n\t\tif(mysqli_num_rows($run_check)!=0){\n\t\t\t\n\t\t\t\t\n\t\t if(isset($_GET['add_cart_count'])){\n\t\t $count=$_GET['add_cart_count'];\n\t\t \n\t\t\t}\n\t\t else{\n\t\t $count=1;\n\t\t }\n\t\t\t//$new_count=$pro_qty+$count;\n\t\t\tif($count>$pro_stock){\n\t\t\t print_text('Μή αρκετό απόθεμα!','error');\n\t\t\t exit();\n\t\t\t}\n\t\t\telse if($count<-1){\n\t\t\t exit();\n\t\t\t}\n\t\t\t\n\t\t\tif(isloggedin()){\n\t\t\t //$c_id=$_SESSION['cid'];\n\t\t\t \n\t\t\t $update_pro =\"update cart set qty=qty+$count where customer_id='$c_id' AND p_id='$pro_id' \";\n\t\t\t mysqli_query($con,$update_pro);\n\t\t\t}\n\t \telse{\n\t\t\t $update_pro =\"update cart set qty=qty+$count where ip_add='$ip' AND customer_id='0' AND p_id='$pro_id' \";\n\t\t\t mysqli_query($con,$update_pro);\n\t\t\t}\n\t \n\t $update_stock=\"update products set stock=stock-$count where product_id='$pro_id' \";\n\t\t mysqli_query($con,$update_stock);\n\t\t \n\t\t\techo \"<script>window.open('cart.php','_self')</script>\";\n\t\t}\n\t\t\t\n\t\t\t//echo \"<script>alert('$a $b $c')</script>\";\n\t\t\n \telse {\n \t if($pro_stock<=0){\n print_text('Μη αρκετό απόθεμα!','error');\n exit();\n }\n \n \t\tif(isloggedin()){\n \t\t $c_id=$_SESSION['cid'];\n \t\t $insert_pro = \"insert into cart (p_id,ip_add,qty,customer_id) values ('$pro_id','$ip','1','$c_id')\";\n \t\t $run_pro = mysqli_query($con, $insert_pro); \n \t\t \n \t\t}\n \t\telse{\n \t\t $insert_pro = \"insert into cart (p_id,ip_add,qty,customer_id) values ('$pro_id','$ip','1','0')\";\n \t\t $run_pro = mysqli_query($con, $insert_pro); \n \t\t \n \t\t}\n \t\t\n\t $update_stock=\"update products set stock=stock-1 where product_id='$pro_id' \";\n\t\t mysqli_query($con,$update_stock);\n\t\t \n \t\techo \"<script>window.open('eshop.php','_self')</script>\";\n \t}\n \n \n \n \t\n\t}\t\n \n}",
"function getNumberItem()\n{\n\t$numberItems = \\Cart::instance('shopping')->count(false);\n\n return $numberItems;\n}"
]
| [
"0.7250111",
"0.72245836",
"0.70059425",
"0.6911772",
"0.6814616",
"0.67770255",
"0.67756325",
"0.6686962",
"0.66780424",
"0.66359127",
"0.6538912",
"0.64733493",
"0.64509594",
"0.6439358",
"0.6286117",
"0.6267922",
"0.6262054",
"0.6252766",
"0.6227776",
"0.62267226",
"0.6221253",
"0.61847365",
"0.6172095",
"0.61564505",
"0.6152356",
"0.61405784",
"0.61313784",
"0.6129989",
"0.61247104",
"0.6105265",
"0.60994136",
"0.6098473",
"0.6089344",
"0.60852355",
"0.60600865",
"0.6055865",
"0.6029221",
"0.6015163",
"0.60106117",
"0.5984326",
"0.5971932",
"0.5971549",
"0.59678304",
"0.59648675",
"0.5943473",
"0.59357506",
"0.59102315",
"0.5909658",
"0.5908132",
"0.59047884",
"0.59040546",
"0.590368",
"0.5895283",
"0.5894416",
"0.5894152",
"0.5893256",
"0.5892379",
"0.5881619",
"0.5874852",
"0.58747315",
"0.5871139",
"0.58711076",
"0.58647454",
"0.586332",
"0.58467215",
"0.58426154",
"0.5836167",
"0.58350104",
"0.58109665",
"0.58035344",
"0.57987875",
"0.5793915",
"0.57776064",
"0.5772991",
"0.5772842",
"0.57618266",
"0.5755148",
"0.57498235",
"0.5748157",
"0.5743922",
"0.5741213",
"0.5737811",
"0.5734911",
"0.573106",
"0.5712722",
"0.5711464",
"0.5696175",
"0.56895393",
"0.5677601",
"0.5676263",
"0.5671969",
"0.5667411",
"0.56600106",
"0.5659191",
"0.56557107",
"0.564985",
"0.56489307",
"0.56489307",
"0.5636861",
"0.5632931"
]
| 0.6540984 | 10 |
returns products based on name and categories (categories being a stockgroupID array) | function findProducts ($text, $category, $limit) {
$sql = "SELECT * FROM stockitems";
//checks if the item is in the requested categories
if (isset($category) && $category != 'all') {
$category = (int)$category;
$sql = $sql . " WHERE StockItemID IN (SELECT StockItemID FROM stockitemstockgroups WHERE StockGroupID = $category )";
if (isset($text) && $text != '') {
//adds the text search if needed
$sql = $sql . "AND StockItemName LIKE '%$text%'";
}
} else {
//adds the text search if needed
if (isset($text) && $text != '' ) {
$sql = $sql . " WHERE StockItemName LIKE '%$text%'";
}
}
if (isset($limit)) {
$sql = $sql . " LIMIT $limit";
}
return runQuery($sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getProductByCategory(){\n $return = array(); \n $pids = array();\n \n $products = Mage::getResourceModel ( 'catalog/product_collection' );\n \n foreach ($products->getItems() as $key => $_product){\n $arr_categoryids[$key] = $_product->getCategoryIds();\n \n if($this->_config['catsid']){ \n if(stristr($this->_config['catsid'], ',') === FALSE) {\n $arr_catsid[$key] = array(0 => $this->_config['catsid']);\n }else{\n $arr_catsid[$key] = explode(\",\", $this->_config['catsid']);\n }\n \n $return[$key] = $this->inArray($arr_catsid[$key], $arr_categoryids[$key]);\n }\n }\n \n foreach ($return as $k => $v){ \n if($v==1) $pids[] = $k;\n } \n \n return $pids; \n }",
"function getItemsByCategory($name)\n {\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $items = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $escaped = $db->quote(\"%zzz\".$name.\"zzz%\");\n $results = $db->query(\"SELECT itemrevision_id FROM metadatavalue WHERE value LIKE $escaped AND metadata_id='\".$metadataDao->getKey().\"'\")\n ->fetchAll();\n \n foreach($results as $result)\n {\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"'\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $revision = MidasLoader::loadModel(\"ItemRevision\")->load($result['itemrevision_id']);\n if($revision)\n {\n $items[] = $revision->getItem()->getKey();\n }\n } \n }\n return $items;\n }",
"function getProductCategories () {\r\n $sql = \"SELECT * FROM stockgroups\";\r\n return runQuery($sql);\r\n}",
"function getProductByCategorySearch($category_id, $keyword){\r\n\t\t$unix_product = array();\r\n\t\t//$has_printed = false;\r\n\t\t$total_product_1 = 0;\r\n\t\t$total_product_2 = 0;\r\n\t\t$keyword=strtolower($keyword);\r\n\t\t\r\n\t\tif($category_id!=0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category WHERE parent_id=\".$category_id);\t\r\n\t\t}\r\n\t\telseif($category_id==0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category\");\t\r\n\t\t}\r\n\t\twhile($rc=mysql_fetch_array($q_category)){\r\n\t\t\t$cat_id = $rc['category_id'];\r\n\t\t\t//if($category_id!=0){\r\n\t\t\t$q_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$cat_id.\" AND lower(D.name) LIKE '%$keyword%'\");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$total_product_1 = mysql_num_rows($q_product_id);\t\t\t\t\t\t\t\t\t\r\n\t\t\twhile($rp=mysql_fetch_array($q_product_id)){\r\n\t\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t\t$product = new product($product_id);\r\n\t\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\t\techo '<div class=\"item\">';\r\n\t\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().'_'.$total_product_1.'</div>';\r\n\t\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\t\techo '</div>';\r\n\t\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\t\techo '</a>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\t}\r\n\t\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Search Child Category\r\n\t\t$q_child_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$category_id.\" AND lower(D.name) LIKE '%$keyword%'\");\r\n\t\t$total_product_2 = mysql_num_rows($q_child_product_id);\r\n\t\twhile($rp=mysql_fetch_array($q_child_product_id)){\r\n\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t$product = new product($product_id);\r\n\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\techo '<div class=\"item\">';\r\n\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().$total_product_2.'</div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\techo '</a>';\r\n\t\t\techo '</div>';\r\n\t\t\t}\r\n\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t}\r\n\t\t//Info if Search No Result \r\n\t\t/*\r\n\t\tif($total_product_1==0 && $total_product_2==0){\r\n\t\t\techo '<div class=\"no_item\" style=\"height:200px;padding: 10px 10px 10px 20px; color: #CCC; font-size: 20px;\">';\r\n\t\t\t\techo 'No Result! RUn'.$total_product_1.'_'.$total_product_2;\r\n\t\t\t\t//echo ':)'.$rLanguage->text(\"Logout\");\t\r\n\t\t\techo '</div>';\r\n\t\t}\r\n\t\t*/\r\n\t}",
"public function getProductsByCategory($id){ \n $products = Product::where('category_id',$id)->get(); \n return $products;\n }",
"public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }",
"function getProductsByCategory()\n\t{\n\t\tglobal $con;\n\t\tif (isset($_GET['cat'])){\n\t\t\t$cat_id = $_GET['cat'];\n\t\t\t$get_products = \"select * from products where prod_cat='$cat_id'\";\n\t\t\t$run_products = mysqli_query($con, $get_products);\n\t\t\t$count = mysqli_num_rows($run_products);\n\t\t\t\n\t\t\tif ($count == 0)\n\t\t\t\techo \"<h2>No Products in this category</h2>\";\n\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\techo \"\n\t\t\t\t<div class='single_product'>\n\t\t\t\t\t<h3>$prod_title</h3>\n\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t}\n\t}",
"function productList() {\n\t$categoryIds = array_merge ( [ \n\t\t\t$this->id \n\t], $this->subcategoryIds () );\n\tprint_r ( $categoryIds );\n\t// Find all products that match the retrieved category IDs\n\treturn Product::whereIn ( 'cate_id', $categoryIds )->get ();\n}",
"public function product_get_by_category($data)\n {\n $queryColumn = \"DESCRIBE \" . $this->db_table_prefix . \"products\";\n $resultColumn = $this->commonDatabaseAction($queryColumn);\n $resultColumn = $this->resultArray($resultColumn);\n $columns = php_array_column($resultColumn, 'Field');\n \n $query = \"SELECT p.*, c.name as catName\n \t FROM \" . $this->db_table_prefix . \"products p\n JOIN \" . $this->db_table_prefix . \"categories c\n ON p.cat_id = c.id \";\n \n if (!empty($data))\n {\n $query .= 'WHERE 1';\n foreach ($data as $key => $value)\n {\n $pos = strpos($key, '.');\n $columnArray = ($pos) ? explode('.', $key) : ''; \n $columnName = (!empty($columnArray)) ? $columnArray[1] : $key ;\n \n if (in_array($columnName, $columns))\n {\n $query .= ' AND ' . $key . ' = ' . $value;\n }\n }\n }\n $query .= \" ORDER BY p.id DESC\";\n\n $result = $this->commonDatabaseAction($query);\n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n return $this->resultArray($result);\n }\n else\n {\n return null;\n }\n }",
"public function getProductByCategoryName($name){\n $stock_status = product_stock_status::all();\n $maincat = category::all();\n $subcat = sub_category::all();\n\n\n $data=[];\n if($name==\"all\"){\n $data=product::orderBy('date', 'DESC')->paginate(10);\n }\n else{\n $cid=category::where(\"name\",$name)->first([\"cid\"]);\n if($cid){\n $data=product::where('cid',$cid->cid)->orderBy('date', 'DESC')->paginate(10);\n }\n }\n\n return view('admin/product/product', ['product' => $data, 'stock_status' => $stock_status, 'main' => $maincat, 'sub' => $subcat,'current'=>$name]);\n }",
"public function getProducts($category) {\n $sql = \"SELECT * FROM products INNER JOIN categories on products.product_CategoryID = categories.category_ID WHERE category_Name = '\".$category.\"'\";\n //Commit the query\n $result = $this->connection->query($sql);\n //Parse result to JSON list\n $answer = '{\"products\": [';\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $answer = $answer . '{\"ID\":\"' . $row[\"product_ID\"] . '\",' .\n '\"Name\": \"' . $row[\"product_Name\"] . '\",' .\n '\"Category\": \"' . $row[\"category_Name\"] . '\",' .\n '\"Price\": \"' . $row[\"product_Price\"] . '\",' .\n '\"Brand\": \"' . $row[\"product_Brand\"] . '\",' .\n '\"Description\": \"' . $row[\"product_Description\"] . '\",' .\n '\"ImagePath\": \"' . $row[\"product_ImagePath\"] .'\"},' ;\n }\n //Trim the last comma\n $answer=rtrim($answer,\", \");\n //Finish parsing\n $answer=$answer . \"]}\";\n //Return the list as a string\n return $answer;\n } else {\n echo \"0 results\";\n }\n }",
"public function getProductsByCategory ($category_id) {\n\t\t\n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n \n\t\ttry {\n \n\t\t\t/*\n $query = \"SELECT ea_product.id, ea_product.upc, ea_product.brand, ea_product.product_name, ea_product.product_description, ea_product.avg_price, ea_image.file\n\t\t\tFROM ea_product LEFT JOIN ea_image\n ON ea_product.upc = ea_image.upc\n WHERE ea_product.category_id = '$category_id'\n\t\t\tORDER BY ea_product.avg_price\";\n */\n \n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n\t\t\tFROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND category_id = '$category_id'\n\t\t\tORDER BY avg_price\";\n //print(\"$query\");\n\t\t\tforeach($this->dbo->query($query) as $row) {\n\t\t\t\t$id = stripslashes($row[0]);\n\t\t\t\t$upc = strval(stripslashes($row[1]));\n\t\t\t\t$brand = $this->convertFancyQuotes(stripslashes($row[2]));\n\t\t\t\t$product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n\t\t\t\t$product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n\t\t\t\t$avg_price = stripslashes($row[5]);\n\t\t\t\t$category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n \n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n \n $product[\"image_path\"] = $this->getImagePath($upc);\n \n $products[] = $product;\n\t\t\t}\n\t\n\t\t} catch (PDOException $e) {\n\t\t\t$this->errorCode = 1;\n\t\t\t$errorCode = -1;\n\t\t\t$errorMessage = \"PDOException for getProductsByCategory.\";\n\t\t}\t\n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $category_name;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\n $data = json_encode($data);\n \n\t\treturn $data;\n\t}",
"function getProducts($name, $categoryID, $salePriceMin, $salePriceMax, $basePriceMin, $basePriceMax)\n{\n global $conn;\n \n $sql = \"SELECT * FROM product WHERE 1=1 \";\n \n if (!empty($name))\n {\n $sql .= \" AND Name LIKE :productName\";\n $namedParameters[\":productName\"] = \"%\" . $name . \"%\";\n }\n \n if (!empty($categoryID))\n {\n $sql .= \" AND CategoryId = :categoryId\";\n $namedParameters[\":categoryId\"] = $categoryID;\n }\n \n if (!empty($salePriceMin) AND !empty($salePriceMax))\n {\n $sql .= \" AND SalePrice >= :salePriceMin AND SalePrice <= :salePriceMax \";\n $namedParameters[\":salePriceMin\"] = $salePriceMin;\n $namedParameters[\":salePriceMax\"] = $salePriceMax;\n }\n \n if (!empty($basePriceMin) AND !empty($basePriceMax))\n {\n $sql .= \" AND BasePrice >= :basePriceMin AND BasePrice <= :basePriceMax\";\n $namedParameters[\":basePriceMin\"] = $basePriceMin;\n $namedParameters[\":basePriceMax\"] = $basePriceMax;\n }\n \n $sql .= \" ORDER BY Name\";\n \n $stmt = $conn->prepare($sql);\n $stmt->execute($namedParameters);\n $records = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return $records;\n}",
"function getProductsByCategory($categoryId){ \n $db = acmeConnect(); \n $sql = 'SELECT * FROM inventory WHERE categoryId = :categoryId'; \n $stmt = $db->prepare($sql); \n $stmt->bindValue(':categoryId', $categoryId, PDO::PARAM_INT); \n $stmt->execute(); \n $products = $stmt->fetchAll(PDO::FETCH_ASSOC); \n $stmt->closeCursor(); \n return $products; \n }",
"function productByCategory($id)\n {\n \t\n }",
"function getProductsbyCategory($CatId){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT id, name, description, price, stock, img_src \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock`>0 AND `category_id`=?\");\n\t\t$sth \t-> execute(array($CatId));\n\t\t\n\t\treturn \t$sth;\n\t}",
"function listProductsByCategory($category) {\r\n\t\t$query = \"SELECT * FROM \".TBL_PRODUCTS.\" WHERE category = :category AND available = '1' AND stock > 0\";\r\n\t\t$stmt = $this->connection->prepare($query);\r\n\t\t$stmt->execute(array(':category' => $category));\r\n\t\t$dbarray = $stmt->fetchAll();\r\n\t\t$count = $stmt->rowCount();\r\n\t\tif(!$dbarray || $count < 1){\r\n\t\t\treturn false; // failure\r\n\t\t} else {\r\n\t\t\treturn $dbarray; // success\r\n\t\t}\r\n\t}",
"public function getProductsByCategoryId($id){\r\n\t\treturn $this->query(\"SELECT * FROM beer WHERE FK_categoryID = '$id'\");\r\n\t}",
"public function prod_list_by_category() {\n $url_cate = get_raw_app_uri();\n if (!empty($url_cate)) {\n $Product = new Product();\n $info = $Product->getProductByCategory($url_cate);\n $data['content'] = 'list_product'; \n $data['product'] = $info['product'];\n $data['paging'] = $info['paging'];\n $data['selected'] = $url_cate;\n \n //seo\n \n $Category = new ProductCategory();\n $list_cate = $Category->getCategoryByLink($url_cate);\n if ($list_cate->countRows() > 0){\n $list_cate->fetchNext();\n $data['title_page'] = $list_cate->get_prod_cate_name();\n $data['description'] = $list_cate->get_prod_cate_meta_description();\n $data['keywords'] = $list_cate->get_prod_cate_keywords();\n }else{\n $data['title_page'] = '';\n $data['description'] = '';\n $data['keywords'] = '';\n }\n \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n $data['array_menus'] = $array_menus;\n \n $this->load->view('temp', $data);\n } else {\n redirect(Variable::getDefaultPageString());\n }\n }",
"function get_ProductsBy_CatID($data) {\r\n $params[0] = array(\"name\" => \":category_id\", \"value\" => &$data['category_id']);\r\n $params[1] = array(\"name\" => \":prodType\", \"value\" => &$data['prodType']);\r\n return $this->DBObject->readCursor(\"product_actions.get_ProductsBy_CatID(:category_id,:prodType)\", $params);\r\n }",
"public function getSearchData()\n\t{\n\t\t$search_data \t\t=\tjson_decode($this->request->getContent(),true);\n\t\t$search_term\t\t=\t$search_data['search_term'];\n\t\t$area_id\t\t\t=\t$search_data['area_id'];\n\t\t$city_id\t\t\t=\t$search_data['city_id'];\n\t\t$page_number\t\t=\t$search_data['page_number'];\n\t\t\n\t\t$products = $this->_productCollectionFactory->create()->addAttributeToSelect(\n\t\t\t'*'\n\t\t)->addFieldToFilter(\n\t\t\t'name',\n\t\t\t['like' => '%'.$search_term.'%']\n\t\t)-> addAttributeToFilter('visibility', array('in' => array(4) )\n\t\t)-> addAttributeToFilter('status', array('in' => array(1) ))\n\t\t->addCategoryIds()->setPageSize(10)\n ->setCurPage($page_number);\n\t\t\n\t\t\n\t\t$products->getSelect()\n\t\t\t\t->join(array(\"marketplace_product\" => 'marketplace_product'),\"`marketplace_product`.`mageproduct_id` = `e`.`entity_id`\",array(\"seller_id\" => \"seller_id\"))\n\t\t\t\t->join(array(\"marketplace_userdata\" => 'marketplace_userdata'),\"`marketplace_userdata`.`seller_id` = `marketplace_product`.`seller_id` AND (FIND_IN_SET('\".$area_id.\"', `area_id`)) AND (FIND_IN_SET('\".$city_id.\"', `region_id`)) \",array(\"shop_url\", \"logo_pic\")); \n\t\t\n\t\t\n\t\t$all_response \t=\tarray();\n\t\t$all_response['data'] \t=\tarray();\n\t\t$categories \t=\tarray();\n\t\t$seller_data \t=\tarray();\n\t\t$priceHelper \t= \t$this->_objectManager->create('Magento\\Framework\\Pricing\\Helper\\Data'); // Instance of Pricing Helper\n\t\t$StockState \t= \t$this->_objectManager->get('\\Magento\\CatalogInventory\\Api\\StockStateInterface');\n\t\t$store \t\t\t\t= \t$this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore();\n\t\tforeach($products as $product_data){\n\t\t\tif(!isset($all_response['data'][$product_data->getSellerId()])){\t\t\t\n\t\t\t\t$all_response['data'][$product_data->getSellerId()]['seller']\t=\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name'=> ucfirst($product_data->getShopUrl()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'shop_url'=> ($product_data->getShopUrl()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'logo'=> $product_data->getLogoPic(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\t\t\t\t\t\n\t\t\t}\n\t\t\t$categories\t\t\t=\t$product_data->getCategoryIds();\n\t\t\t$formattedPrice \t= \t$priceHelper->currency($product_data->getPrice(), true, false);\n\t\t\t\n\t\t\t$product_quantity\t=\t$StockState->getStockQty($product_data->getId(), $product_data->getStore()->getWebsiteId());\n\t\t\t$collectioncat \t\t= \t$this->_categoryCollectionFactory->create();\n\t\t\t$collectioncat->addAttributeToSelect(array('name'), 'inner');\n\t\t\t$collectioncat->addAttributeToFilter('entity_id', array('in' => $categories));\n\t\t\t$collectioncat->addAttributeToFilter('level', array('gt' => 1));\n\t\t\t$collectioncat->addIsActiveFilter();\n\t\t\t$productImageUrl \t= \t$store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product/';\n\t\t\t\n\t\t\t$shortdescription\t=\t$product_data->getShortDescription();\n\t\t\tif($shortdescription==null){\n\t\t\t\t$shortdescription\t=\t\"\";\n\t\t\t}\n\t\t\tif($product_data->getTypeId()!=\"simple\"){\n\t\t\t\t$price\t\t\t=\t0;\n\t\t\t\t$product_price\t=\t0;\n\t\t\t\t$product_special_price\t=\t0;\n\t\t\t\t$_children = $product_data->getTypeInstance()->getUsedProducts($product_data);\n\t\t\t\tforeach ($_children as $child){\n\t\t\t\t\t$productPrice = $child->getPrice();\n\t\t\t\t\t$price = $price ? min($price, $productPrice) : $productPrice;\n\t\t\t\t}\n\t\t\t\t$special_price\t=\t$product_data->getFinalPrice(); \n\t\t\t\tif($price <= $product_data->getFinalPrice()){\n\t\t\t\t\t$special_price\t=\tnull; \n\t\t\t\t}\n\t\t\t\t$formattedPrice\t\t\t=\t$price; \n\t\t\t\t$product_price\t\t\t=\t$product_data->getProductPrice();\n\t\t\t\t$product_special_price\t=\t$product_data->getProductSpecialPrice();\n\t\t\t}else{\n\t\t\t\t$formattedPrice\t\t\t=\t$product_data->getPrice(); \n\t\t\t\t$special_price\t\t\t=\t$product_data->getFinalPrice(); \n\t\t\t\t$product_price\t\t\t=\t0;\n\t\t\t\t$product_special_price\t=\t0;\n\t\t\t}\n\t\t\tif($formattedPrice == $special_price ){\n\t\t\t\t$special_price\t\t\t=\tnull; \n\t\t\t}\n\t\t\t$formattedPrice\t\t\t\t=\tnumber_format($formattedPrice, 2);\n\t\t\tif($special_price !=null){\n\t\t\t\t$special_price\t\t\t\t=\tnumber_format($special_price, 2);\n\t\t\t}\n\t\t\t$all_response['data'][$product_data->getSellerId()]['products'][]\t=\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'id'=>$product_data->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t'name'=>$product_data->getName(),\n\t\t\t\t\t\t\t\t\t\t\t\t'sku'=>$product_data->getSku(),\n\t\t\t\t\t\t\t\t\t\t\t\t'short_description'=>$shortdescription,\n\t\t\t\t\t\t\t\t\t\t\t\t'price'=>$formattedPrice,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_price'=>$product_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_special_price'=>$product_special_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'special_price'=>$special_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'image'=>ltrim($product_data->getImage(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'small_image'=>ltrim($product_data->getSmallImage(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'thumbnail'=>ltrim($product_data->getThumbnail(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'quantity'=>$product_quantity,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_data'=>$product_data->getData(),\n\t\t\t\t\t\t\t\t\t\t\t\t'productImageUrl'=>$productImageUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t'categories'=>$collectioncat->getData(),\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$all_response['data'][$product_data->getSellerId()]['categories']\t=\t$collectioncat->getData();\n\t\t}\n\t\t\n\t\t\n\t\t$search_data \t=\t[['page_number'=>$page_number,'total_count'=>$products->getSize()]];\n\t\tif(!empty($all_response['data'])){\n\t\t\tforeach($all_response['data'] as $serller_id=>$seller_data){\n\t\t\t\t$customer_data \t\t\t\t\t= \t$this->_objectManager->create('Magento\\Customer\\Model\\Customer')->load($serller_id);\n\t\t\t\t$seller_data['seller']['name']\t=\ttrim($customer_data->getData('firstname').\" \".$customer_data->getData('lastname'));\n\t\t\t\t$search_data[]\t=\t[\n\t\t\t\t\t\t\t\t\t\t'seller_data'=>$seller_data['seller'],\n\t\t\t\t\t\t\t\t\t\t'products'=>$seller_data['products'],\n\t\t\t\t\t\t\t\t\t\t'categories'=>$seller_data['categories']\n\t\t\t\t\t\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $search_data;\n\t}",
"function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }",
"protected function export_categoryless_products()\n {\n $table = $this->getTableName(\"catalog_product_entity\");\n $categoryProductsTable = $this->getTableName(\"catalog_category_product\");\n $catalogProductWebsite = $this->getTableName(\"catalog_product_website\");\n $rootCategoryId = $this->_fStore->getRootCategoryId();\n $sql = \"SELECT DISTINCT(entity_id), type_id, sku FROM {$table}\n LEFT JOIN (`{$categoryProductsTable}`) ON ({$table}.`entity_id` = `{$categoryProductsTable}`.`product_id`)\n LEFT JOIN (`{$catalogProductWebsite}`) ON ({$table}.`entity_id` = `{$catalogProductWebsite}`.`product_id`)\n WHERE (`{$categoryProductsTable}`.`product_id` IS NULL OR `{$categoryProductsTable}`.`category_id` NOT IN ({$this->_getCategoriesForStore()}))\n AND {$table}.entity_type_id = {$this->_product_entity_type_id}\n AND `{$catalogProductWebsite}`.`website_id` = \" . $this->getWebsiteId($this->_fStore_id); \n \n return $this->export_products($sql, 'categoryless_products');\n }",
"public function getCategoryProductWithFilter($categoryId , $filters = []) {\n\n $prefix = config('database.connections.mysql.prefix');\n\n $sql = \"Select p.id\n FROM {$prefix}products as p \n INNER JOIN {$prefix}category_product as cp on p.id = cp.product_id \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"INNER JOIN {$prefix}product_property_integer_values as ppiv ON p.id = ppiv.product_id \";\n }\n\n }\n }\n\n if('attribute' == $type) {\n\n\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n $sql .= \"INNER JOIN {$prefix}product_attribute_integer_values as paiv ON p.id = paiv.product_id \";\n }\n }\n }\n\n $sql .= \"WHERE cp.category_id = ? \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"AND ppiv.property_id = {$property->id} AND ppiv.value={$value}\";\n }\n\n }\n }\n }\n\n foreach ($filters as $type => $filterArray) {\n if('attribute' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n\n $sql .= \"AND paiv.attribute_id = {$attribute->id} AND paiv.value={$value}\";\n\n\n }\n }\n }\n\n $products = DB::select($sql, [$categoryId]);\n\n $collect = Collection::make([]);\n\n foreach ($products as $productArray) {\n\n $product = $this->findProductById($productArray->id);\n\n if($product->type == \"VARIABLE_PRODUCT\") {\n $collect->push(($product->getVariableMainProduct()));\n } else {\n $collect->push($this->findProductById($productArray->id));\n }\n }\n\n return $collect;\n\n /**\n * FROM avored_products as p\n *\n *\n *\n *\n * where ppiv.property_id = 1 AND\n */\n\n }",
"protected function getProducts()\r\n {\r\n $category = new Category((int)Configuration::get('FIELD_FEATUREDPSL_CAT'), (int)Context::getContext()->language->id);\r\n\r\n $searchProvider = new CategoryProductSearchProvider(\r\n $this->context->getTranslator(),\r\n $category\r\n );\r\n\r\n $context = new ProductSearchContext($this->context);\r\n\r\n $query = new ProductSearchQuery();\r\n\r\n $nProducts = (int)Configuration::get('FIELD_FEATUREDPSL_NBR');\r\n if ($nProducts < 0) {\r\n $nProducts = 12;\r\n }\r\n\r\n $query\r\n ->setResultsPerPage($nProducts)\r\n ->setPage(1)\r\n ;\r\n $query->setSortOrder(new SortOrder('product', 'position', 'asc'));\r\n $result = $searchProvider->runQuery(\r\n $context,\r\n $query\r\n );\r\n\r\n $assembler = new ProductAssembler($this->context);\r\n\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n\r\n $products_for_template = [];\r\n\t\t$products_features=$result->getProducts();\r\n\t\tif(is_array($products_features)){\r\n\t\t\tforeach ($products_features as $rawProduct) {\r\n\t\t\t\t$products_for_template[] = $presenter->present(\r\n\t\t\t\t\t$presentationSettings,\r\n\t\t\t\t\t$assembler->assembleProduct($rawProduct),\r\n\t\t\t\t\t$this->context->language\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n return $products_for_template;\r\n }",
"public function getProductsWithName($name){\r\n\t\t$newQuery = \"SELECT * from products \".\r\n\t\t\t\t\" WHERE name LIKE '%\".$name.\"%'\";\r\n\t\t\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($newQuery);\r\n\t}",
"public function getProductsByCategory(String $category){\n\t\t// get the products\n\t\t$products = $this->getProducts();\n\n\t\t$categoryProducts = [];\n\n\t\t// exctract the products that belong to the category\n\t\tforeach ($products as $key => $product) {\n\t\t\tif($product['name_category'] == $category){\n\t\t\t\tarray_push($categoryProducts, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $categoryProducts;\n\t}",
"function getProductListWithFilter($results6, $category_id)\n{\n if (!empty($category_id)) {\n foreach ($results6 as $key => $value) {\n echo '<div id = \"product\"><a href =\"index.php?action=product&id=' . $value['product_id'] . '\">' . $value['name'] . ' ' .\n $value['model'] . '<br><img src=' . $value['picture'] . '><br><br>' . $value['price'] . '</a><br><br></div>';\n }\n }\n}",
"function getProductsBySubCategori($id) {\r\n \r\n $db = new SQL_Conect_PDO(); \r\n $sql = \"SELECT * FROM `products` WHERE `Id_sub_categories` = :Id \"\r\n . \"ORDER BY `Name` ASC \";\r\n \r\n $ArrPars['Id'] = $id; \r\n\r\n $db->SetQuery($sql, $ArrPars); \r\n $res = $db->GetQueryAll_Class(\"Product\");\r\n \r\n return $res;\r\n }",
"private static function __getProductsListingData() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_Vqmod;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n // optional Product List Filter\n $output = '';\n $result = array();\n\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $filterlist_sql = \"select distinct c.categories_id as id, cd.categories_name as name from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c, \" . TABLE_CATEGORIES . \" c, \" . TABLE_CATEGORIES_DESCRIPTION . \" cd, \" . TABLE_TEMPLATES_BOXES . \" tb, \" . TABLE_PRODUCT_ATTRIBUTES . \" pa where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '\" . (int)$lC_Language->getID() . \"' and tb.code = 'manufacturers' and tb.id = pa.id and pa.products_id = p.products_id and pa.value = '\" . (int)$_GET['manufacturers'] . \"' order by cd.categories_name\";\n } else {\n $filterlist_sql = \"select distinct m.manufacturers_id as id, m.manufacturers_name as name from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c, \" . TABLE_MANUFACTURERS . \" m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '\" . (int)$current_category_id . \"' order by m.manufacturers_name\";\n }\n $Qfilterlist = $lC_Database->query($filterlist_sql);\n $Qfilterlist->execute();\n if ($Qfilterlist->numberOfRows() > 1) {\n $output .= '<p><form name=\"filter\" action=\"' . lc_href_link(FILENAME_DEFAULT) . '\" method=\"get\">' . $lC_Language->get('filter_show') . ' ';\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $output .= lc_draw_hidden_field('manufacturers', $_GET['manufacturers']);\n $options = array(array('id' => '', 'text' => $lC_Language->get('filter_all_categories')));\n } else {\n $output .= lc_draw_hidden_field('cPath', $cPath);\n $options = array(array('id' => '', 'text' => $lC_Language->get('filter_all_manufacturers')));\n }\n if (isset($_GET['sort'])) {\n $output .= lc_draw_hidden_field('sort', $_GET['sort']);\n }\n while ($Qfilterlist->next()) {\n $options[] = array('id' => $Qfilterlist->valueInt('id'), 'text' => $Qfilterlist->value('name'));\n }\n $output .= lc_draw_pull_down_menu('filter', $options, (isset($_GET['filter']) ? $_GET['filter'] : null), 'onchange=\"this.form.submit()\"');\n $output .= lc_draw_hidden_session_id_field() . '</form></p>' . \"\\n\";\n }\n\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $lC_Products->setManufacturer($_GET['manufacturers']);\n }\n $Qlisting = $lC_Products->execute(); \n \n $result['mfgFilter'] = $output;\n $result['Qlisting'] = $Qlisting;\n \n return $result;\n }",
"public function testGetProductsListByCategory()\n\t{\n\t\t/**\n\t\t * @var shopModel $shopModel\n\t\t */\n\t\t$shopModel = getModel('shop');\n\n\t\t$product_repository = $shopModel->getProductRepository();\n\n\t\t$args = new stdClass();\n\t\t$args->module_srl = 104;\n\t\t$args->category_srls = array(self::CATEGORY_TSHIRTS);\n\t\t$output = $product_repository->getProductList($args);\n\n\t\t$products = $output->products;\n\t\t$this->assertEquals(1, count($products));\n\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$this->assertNull($product->parent_product_srl);\n\n\t\t\t$this->assertTrue($product->isConfigurable());\n\t\t\t$this->assertTrue(is_a($product, 'ConfigurableProduct'));\n\n\t\t\t$this->assertEquals(6, count($product->associated_products));\n\n\t\t\tforeach($product->associated_products as $associated_product)\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($associated_product, 'SimpleProduct'));\n\t\t\t}\n\t\t}\n\n\t}",
"function get_products() {\n\t\tApp::Import('model', 'Product');\n\t\t$this->Product = &new Product;\n\n\t\t$products = $this->Product->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t\"Product.short_description != ''\",\n\t\t\t\t'Availability.cart_allowed' => true,\n\t\t\t\t'Product.active' => true\n\t\t\t),\n\t\t\t'contain' => array(\n\t\t\t\t'TaxClass' => array(\n\t\t\t\t\t'fields' => array('id', 'value')\n\t\t\t\t),\n\t\t\t\t'Image' => array(\n\t\t\t\t\t'conditions' => array('Image.is_main' => '1'),\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'Manufacturer' => array(\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'CategoriesProduct' => array(\n\t\t\t\t\t'Category' => array(\n\t\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'Availability' => array(\n\t\t\t\t\t'fields' => array('id', 'cart_allowed')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'fields' => array(\n\t\t\t\t'Product.id',\n\t\t\t\t'Product.name',\n\t\t\t\t'Product.short_description',\n\t\t\t\t'Product.url',\n\t\t\t\t'Product.retail_price_with_dph',\n\t\t\t\t'Product.ean',\n\t\t\t\t'Product.zbozi_name',\n\t\t\t\t'Product.heureka_name',\n\t\t\t\t'Product.discount_common',\n\t\t\t\t'Product.zbozi_cpc',\n\t\t\t\t'Product.heureka_cpc'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$products = array_filter($products, array('ExportsController', 'empty_category'));\n\t\t\n\t\tforeach ($products as $i => $product) {\n\t\t\t$products[$i]['Product']['retail_price_with_dph'] = $this->Product->assign_discount_price($products[$i]);\n\t\t\t$products[$i]['Product']['name'] = str_replace('×', 'x', $products[$i]['Product']['name']);\n\t\t\t$products[$i]['Product']['short_description'] = str_replace('×', 'x', $products[$i]['Product']['short_description']);\n\t\t}\n\n\t\treturn $products;\n\t}",
"public function getProductsByCategory($category){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ProductoDAO -> getProductsByCategory($category));\n $resList = array();\n while($res = $this -> Conexion -> extraer()){\n array_push($resList, new Producto($res[0], $res[1], $res[2], \"\", $res[3]));\n }\n $this -> Conexion -> cerrar();\n return $resList;\n }",
"public function categories(Request $request)\n {\n $idsCategories = [];\n if (isset($request['categories'])) {\n foreach ($request['categories'] as $idCategory) {\n if ((int) $idCategory != 0) {\n $idsCategories[] = (int) $idCategory;\n }\n }\n }\n $marketId = '0';\n if (isset($request['marketid'])) {\n $marketId = $request['marketid'];\n }\n $promo = '0';\n if (isset($request['promo'])) {\n $promo = $request['promo'];\n }\n try {\n if (count($idsCategories) != 0) {\n $request['categories'] = ['0'];\n }\n $this->productRepository->pushCriteria(new RequestCriteria($request));\n $this->productRepository->pushCriteria(new LimitOffsetCriteria($request));\n $this->productRepository->pushCriteria(new ProductsOfFieldsCriteria($request));\n $this->productRepository->pushCriteria(new ProductsOfCategoriesCriteria($request));\n\n $products = $this->productRepository->all();\n } catch (RepositoryException $e) {\n return $this->sendError($e->getMessage());\n }\n\n // return $this->sendResponse($products->toArray(), 'Products retrieved successfully');\n $productsFinal = [];\n\n $productsArray = $products->toArray();\n if (!isset($request['no_filter'])) {\n if ($promo) {\n return $this->sendResponse($productsArray, 'Promos enviados');\n } else {\n\n if (count($idsCategories) > 0) {\n $idMarket = $marketId;\n $valueActiveCategory = DB::table('categoriesproducts')->where('market_id', '=', $idMarket)->whereIn('category_id', $idsCategories)->pluck('active', 'category_id');\n $idsProducts = DB::table('products')->where('market_id', '=', $idMarket)->get(['featured', 'id'])->toArray();\n $algo = [];\n foreach ($idsProducts as $idP) {\n if ($idP->featured) {\n $algo[] = $idP->id;\n }\n }\n $datosProductosRaw = DB::table('product_categories')->whereIn('category_id', $idsCategories)->whereIn('product_id', $algo)->where('active', '1')->get();\n $idsProducts = [];\n foreach ($datosProductosRaw as $idPR) {\n if ($idPR->active) {\n $idsProducts[] = $idPR->product_id;\n }\n }\n $productsFilter = $this->productRepository->whereIn('id', $idsProducts)->get();\n $productsFinal = $productsFilter;\n } else if (count($productsArray) != 0) {\n\n $idMarket = $productsArray[0]['market_id'];\n $valueActiveCategory = DB::table('categoriesproducts')->where('market_id', '=', $idMarket)->pluck('active', 'category_id');\n $idsCategory = [];\n foreach ($valueActiveCategory as $categoryID => $id) {\n $idsCategory[] = $categoryID;\n }\n $productsTmp = [];\n foreach ($productsArray as $product) {\n $valueActiveProduct = DB::table('product_categories')->whereIn('category_id', $idsCategory)->where('product_id', '=', $product['id'])->pluck('active');\n foreach ($valueActiveProduct as $value) {\n if ($value) {\n $productsTmp[] = $product;\n }\n }\n }\n\n $productsFinal = $productsTmp;\n }\n }\n } else {\n $productsFinal = $productsArray;\n }\n\n return $this->sendResponse($productsFinal, 'Productos filtrados enviados');\n }",
"public function getproductcategories($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t/* $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\",\"seller_id\"=>\"2\"));\n\t\t$result4[]='';\n\t\t $objectManagerr = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $categoryFactory = $objectManagerr->create('Magento\\Catalog\\Model\\ResourceModel\\Category\\CollectionFactory');\n\n $categories = $categoryFactory->create() \n ->addAttributeToSelect('*'); \n\t\t//print_r($categories->getData()); \n\t\t foreach($categories as $data)\n\t\t{ \n\t\t\n\t\t$result4[]['name']=$data->getName(); \n\t\t\t\t $result4[]['id']=$data->getId();\n\t\t\t \n\t\t}\t\t\n\t\t \n\t\t$result[]=array('getproductcategories'=>$result4); */ \n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t$sql3 = \"Select * FROM (Select * FROM marketplace_product a ,catalog_category_product b where a.seller_id=2 and b.product_id=a.mageproduct_id group by b.category_id) s ,catalog_category_entity c where c.entity_id=s.category_id\";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t$result4='';\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\tif($data['parent_id']==2)\n\t\t\t{\n\t\t\t\t$categoryId = $data['entity_id'];\n\t\t\t$_objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t$object_manager = $_objectManager->create('Magento\\Catalog\\Model\\Category')\n\t\t\t->load($categoryId);\n\t\t\t\n\t\t\t$subcats =$object_manager->getChildren();\n\t\t\t$subcategories = array();\n\t\t\t//print_r($subcats);\n\t\t\t foreach(explode(',',$subcats) as $subCatid){\n\t\t\t\t// $objectManagerr = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n // $categoryFactory = $objectManagerr->create('Magento\\Catalog\\Model\\ResourceModel\\Category\\CollectionFactory');\n $_subCategory = $_objectManager->create('Magento\\Catalog\\Model\\Category')->load($subCatid);\n\t\t\t\t\t\t if($_subCategory->getIsActive()) {\n\t\t\t\t\t$subcategories[] = array('id'=>$_subCategory->getId(),'name'=>$_subCategory->getName(),'image_url'=>$_subCategory->getImageUrl()); \n\t\t\t\t}\n\t\t\t}\n\t\t\t//print_r($subcategories);\n\t\t\t\n\t\t\t\t$result4[]=array('category_id'=>$data['entity_id'],'category_name'=>$object_manager->getName(),'sub_category'=>$subcategories); \n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'getproductcategories'=>$result4);\n\t\t \n\t\t\n\t\treturn $result; \n\t\t\n }\n\t }",
"public function getProducts() {\r\n $collection = Mage::helper('CrmTicket/Product')->getProducts();\r\n $products = array();\r\n foreach ($collection as $item) {\r\n $products[$item->getId()] = $item->getname();\r\n }\r\n return $products;\r\n }",
"public function get_products() {\n $product_ids = array();\n\n\t\tforeach ( $this->get_conditions() as $condition ) {\n\t\t\tif ( isset( $condition['product_ids'] ) && is_array( $condition['product_ids'] ) ) {\n\t\t\t\t$product_ids = array_merge( $product_ids, $condition['product_ids'] );\n\t\t\t}\n\t\t}\n\n\t\t$products = array();\n\t\tforeach ( $product_ids as $product_id ) {\n\t\t\t$product = wc_get_product( $product_id );\n\t\t\tif ( $product ) {\n\t\t\t\t$products[$product_id] = wp_kses_post( $product->get_formatted_name() );\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n }",
"public function getMatchProducts($name){\n\n\t\t$results = $this->db->query(\"SELECT DISTINCT pd.product_id,pd.name,cp2p.customer_id FROM \".DB_PREFIX.\"product_description pd LEFT JOIN \".DB_PREFIX.\"customerpartner_to_product cp2p ON (cp2p.product_id = pd.product_id) LEFT JOIN \".DB_PREFIX.\"customerpartner_to_customer cp2c ON (cp2c.customer_id = cp2c.customer_id) WHERE LOWER(pd.name) LIKE '%\".$this->db->escape(utf8_strtolower($name)).\"%' AND cp2p.customer_id = '\".(int)$this->customer->getId().\"' AND pd.language_id = '\".$this->config->get('config_language_id').\"'\")->rows;\n\n\t\treturn $results;\n\t}",
"public function productsBasedOnCategory($category_id){\n $now=Carbon::now();\n $date=$now->toDateString();\n $products=Product::where([['status',1],['sell_by_date','>',$date],['category_id',$category_id]])->get();\n\n /*to be populated in dashboard*/\n $categories=Category::all();\n\n $category=Category::find($category_id);\n return view('products.filter.byCategory',compact('products','categories','category'));\n }",
"function products_by_category($category_ids = array(), $lang = 'en_us')\n\t{\n\t\t$lang = str_replace('_', '-', $lang);\n\t\t\n\t\t$content = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t\t<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n\t\t <soap:Header>\n\t\t <ServiceAuthHeader xmlns=\"http://tempuri.org/\">\n\t\t <UserName>' . $this->username . '</UserName>\n\t\t\t <Password>' . $this->password . '</Password>\n\t\t </ServiceAuthHeader>\n\t\t </soap:Header>\n\t\t <soap:Body>\n\t\t <products_by_category xmlns=\"http://tempuri.org/\">\n\t\t <category_ids>';\n\t\t \n\t\t if (!empty($category_ids)) {\n\t\t \tforeach ($category_ids as $id) $content .= '<anyType xsi:type=\"xsd:int\">'.$id.'</anyType>';\n\t\t \t }\n\n\t\t$content .= '</category_ids>\n\t\t\t<lang>'.$lang.'</lang>\n\t\t </products_by_category>\n\t\t </soap:Body>\n\t\t</soap:Envelope>';\n\t\t\n\t\t$headers = array( \n\t\t\t'POST /redactedapiservice.asmx HTTP/1.1',\n\t\t\t'Host: 000.00.000.185',\n\t\t\t'Content-Type: text/xml; charset=utf-8',\n\t\t\t'Content-Length: ' . strlen($content),\n\t\t\t'SOAPAction: \"http://tempuri.org/products_by_category\"',\n\t\t);\n\t\t\n\t\treturn $this->_init_curl($content, $this->url, $headers);\n\t\n\t}",
"public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}",
"function get_product_by_filter($category_id,$brand_id){\n $this->db->select(\"tp.name as product_name,\n pp.prod_id,\n pp.prod_price_id,\n pp.sold_as,\n pp.attributes_value,\n pp.price,\n pp.tax_rate\")\n ->from('tbl_products as tp')\n ->join('tbl_product_price as pp','pp.prod_id=tp.prod_id','left')\n ->join('tbl_product_attributes as tpa','tpa.attributes_id=pp.attributes_id','left')\n ->where(array(\"tp.category_id\"=>$category_id,\"tp.is_deleted\"=>\"0\",\"tp.brand_id\"=>$brand_id));\n return $this->db->get()->result();\n }",
"function particularproductlist($id)\n\t{\n\t\t$getParproduct=\"SELECT * from product_category where ptdcatgry_id = $id\";\n\t\t$product_data=$this->get_results( $getParproduct );\n\t\treturn $product_data;\n\t}",
"function getKidsGirlCategoryProducts($cat_id,$limit,$start)\n\t\t\t\t{\n\t\t\t\t$otherconditions='';\n\t\t\t\tif(!isset($_SESSION['orderby'])) $_SESSION['orderby']='product_id';\n\t\t\t\tif(isset($_SESSION['filter'])) $otherconditions=$_SESSION['filter'];\t\t\t\t\n\t\t\t\t$sql=\"SELECT product. * , product_people.people_cat_id,brand.brand_name, color.color_name, product_type.type_name FROM product\n\n\t\t\t\tINNER JOIN product_type ON product.product_type_id = product_type.product_type_id\n\t\t\t\tINNER JOIN product_color ON product.product_id = product_color.product_id \n\t\t\t\tINNER JOIN color ON product_color.color_id = color.color_id\n\t\t\t\tINNER JOIN brand ON product.brand_id = brand.brand_id\n\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\tWHERE product_people.people_cat_id = '4'\n\t\t\t\tAND product.product_type_id= \".$cat_id.\" \".$otherconditions.\" ORDER BY \".$_SESSION['orderby'].\" DESC LIMIT \".$start.\",\".$limit;\n\t\t\t\t$result = $this->db->query($sql);\n\t\t\t\tif($result->num_rows()>0){\n\t\t\t\t$_SESSION['product_count']=$result->num_rows();\n\t\t\t\treturn $result->result();\n\t\t\t\t}else{\n\t\t\t\treturn 'empty';\n\t\t\t\t}\n\t\t\t\t}",
"private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }",
"public function getCategory($name);",
"function getProductByCategoryPath($path){\r\n\t\t$q_product_id=getResultSet(\"SELECT product_id FROM \".DB_PREFIX.\"product_to_category WHERE category_id=\".$path);\r\n\t\twhile($rp=mysql_fetch_array($q_product_id)){\r\n\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t$product = new product($product_id);\r\n\t\t\t\r\n\t\t\techo '<div class=\"item\">';\r\n\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().'</div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\techo '</a>';\r\n\t\t\techo '</div>';\r\n\t\t}\t\t\r\n\t}",
"public function get_product_categories($store_id = \"\",$search=\"\")\n\t{\n\t\t$conditions = \"purchase_count < user_limit_quantity and category.category_status = 1 and store_status = 1 and shop_id = $store_id\";\n\t\tif($search){\n\t\t\t$conditions .= \" and (deal_title like '%\".mysql_real_escape_string($search).\"%'\";\n\t\t\t$conditions .= \" or deal_description like '%\".mysql_real_escape_string($search).\"%')\";\n\t\t}\n\t\tif(CITY_SETTING){ \n\t\t\t$conditions .= \" and stores.city_id = $this->city_id \";\n\t\t}\n\t\t$query = \"select deal_id, deal_key, url_title, deal_title, deal_description, deal_value,category_url from product join stores on stores.store_id=product.shop_id join category on category.category_id=product.category_id where $conditions and product.deal_status = 1 \".$this->club_condition.\" group by product.deal_id order by product.deal_id DESC\"; \n\t\t$result = $this->db->query($query);\n\t \n\t return $result;\n\t}",
"public function getByCategory($category)\n {\n $products = $this->db->query('SELECT DISTINCT p.*' . $this->joinSql . ' WHERE c.name = ?;', $category->name, '\\LRC\\Webshop\\Product');\n foreach ($products as $product) {\n $product->categoryIds = $this->getCategories($product, true);\n }\n return $products;\n }",
"public function search_product(){\n\t\t$CI =& get_instance();\n\t\t$this->auth->check_admin_auth();\n\t\t$CI->load->model('Orders');\n\t\t$product_name = $this->input->post('product_name');\n\t\t$category_id = $this->input->post('category_id');\n\t\t$product_search = $this->Orders->product_search($product_name,$category_id);\n if ($product_search) {\n foreach ($product_search as $product) {\n echo \"<div class=\\\"col-xs-6 col-sm-4 col-md-2 col-p-3\\\">\";\n echo \"<div class=\\\"panel panel-bd product-panel select_product\\\">\";\n echo \"<div class=\\\"panel-body\\\">\";\n echo \"<img src=\\\"$product->image_thumb\\\" class=\\\"img-responsive\\\" alt=\\\"\\\">\";\n echo \"<input type=\\\"hidden\\\" name=\\\"select_product_id\\\" class=\\\"select_product_id\\\" value='\".$product->product_id.\"'>\";\n echo \"</div>\";\n echo \"<div class=\\\"panel-footer\\\">$product->product_model - $product->product_name</div>\";\n echo \"</div>\";\n echo \"</div>\";\n \t}\n }else{\n \techo \"420\";\n }\n\t}",
"public function get_category_products($cat_id){\n\t\t$data = array();\n\t\tif ($stmt = $this->Database->prepare(\"SELECT product_id, product_name, product_body, product_price, total_product, product_image, product_type FROM \" . $this->db_table . \" WHERE cat_id = ?\")) {\n\t\t\t$stmt->bind_param(\"i\", $cat_id);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\t$stmt->bind_result($product_id, $product_name, $product_body, $product_price, $total_product, $product_image, $product_type);\n\t\t\t//$stmt->fetch_array();\n\n\t\t\twhile ($stmt->fetch())\n\t\t\t{\n\t\t\t\t$data[] = array(\n\t\t\t\t\t'product_id' => $product_id,\n\t\t\t\t\t'product_name' => $product_name,\n\t\t\t\t\t'product_body' => $product_body,\n\t\t\t\t\t'product_price' => $product_price,\n\t\t\t\t\t'total_product' => $total_product,\n\t\t\t\t\t'product_image' => $product_image,\n\t\t\t\t\t'product_type' => $product_type\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$stmt->close();\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function get($id = NULL){\n\t\t$data = array();\n\n\t\tif(is_array($id)){\n\t\t\t// get product based on array of ids\n\t\t\t$items = '';\n\t\t\tforeach ($id as $item) {\n\t\t\t\tif ($items != '') {\n\t\t\t\t\t$items .= ',';\n\t\t\t\t}\n\t\t\t\t$items .= $item;\n\t\t\t}\n\t\t\tif ($result = $this->Database->query(\"SELECT product_id, product_name, product_body, product_price, total_product, product_image, product_type FROM $this->db_table WHERE product_id IN ($items) ORDER BY product_name\")) \n\t\t\t{\n\t\t\t\tif ($result->num_rows > 0) {\n\t\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t\t{\n\t\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t\t'product_id' => $row['product_id'],\n\t\t\t\t\t\t\t'product_name' => $row['product_name'],\n\t\t\t\t\t\t\t'product_body' => $row['product_body'],\n\t\t\t\t\t\t\t'product_price' => $row['product_price'],\n\t\t\t\t\t\t\t'total_product' => $row['total_product'],\n\t\t\t\t\t\t\t'product_image' => $row['product_image'],\n\t\t\t\t\t\t\t'product_type' => $row['product_type']\n\t\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\t\telse if($id != NULL){\n\t\t\t\tif ($stmt = $this->Database->prepare(\"SELECT \n\t\t\t\t\t$this->db_table.product_id, \n\t\t\t\t\t$this->db_table.cat_id, \n\t\t\t\t\t$this->db_table.product_name,\n\t\t\t\t\t$this->db_table.product_body, \n\t\t\t\t\t$this->db_table.product_price, \n\t\t\t\t\t$this->db_table.total_product, \n\t\t\t\t\t$this->db_table.product_image, \n\t\t\t\t\t$this->db_table.product_type,\n\t\t\t\t\tcategories.cat_name AS cat_name\n\t\t\t\t\tFROM $this->db_table, categories\n\t\t\t\t\tWHERE $this->db_table.product_id = ? AND $this->db_table.cat_id = categories.cat_id\"))\n\t\t\t{\n\t\t\t\t$stmt->bind_param(\"i\", $id);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$stmt->store_result();\n\t\t\t\t$stmt->bind_result($product_id, $cat_id, $product_name, $product_body, $product_price, $total_product, $product_image, $product_type, $cat_name);\n\t\t\t\t$stmt->fetch();\n\n\t\t\t\tif ($stmt->num_rows > 0) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'product_id' => $product_id,\n\t\t\t\t\t\t\t'cat_id' => $cat_id,\n\t\t\t\t\t\t\t'product_name' => $product_name,\n\t\t\t\t\t\t\t'product_body' => $product_body,\n\t\t\t\t\t\t\t'product_price' => $product_price,\n\t\t\t\t\t\t\t'total_product' => $total_product,\n\t\t\t\t\t\t\t'product_image' => $product_image,\n\t\t\t\t\t\t\t'product_type' => $product_type,\n\t\t\t\t\t\t\t'cat_name' => $cat_name\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$stmt->close();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t//get all poroducts\n\t\t\tif($result=$this->Database->query(\"SELECT * FROM \" . $this->db_table .\" ORDER BY product_name\"))\n\t\t\t{\n\t\t\t\tif($result->num_rows > 0){\n\n\t\t\t\t\twhile ($row = $result->fetch_array()) {\n\t\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t\t'product_id' => $row['product_id'],\n\t\t\t\t\t\t\t'cat_id' => $row['cat_id'],\n\t\t\t\t\t\t\t'product_name' => $row['product_name'],\n\t\t\t\t\t\t\t'product_body' => $row['product_body'],\n\t\t\t\t\t\t\t'product_price' => $row['product_price'],\n\t\t\t\t\t\t\t'total_product' => $row['total_product'],\n\t\t\t\t\t\t\t'product_image' => $row['product_image'],\n\t\t\t\t\t\t\t'product_type' => $row['product_type']\n\n\t\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\t\treturn $data;\n\t}",
"public function productList($slug, $type, $category_id)\n {\n $brand = [];\n $products = Product::where('status', 1)->where('deleted_at', NULL);\n if ($type == 1) {\n $cate_name = TopCategory::find($category_id);\n $label = $cate_name->top_cate_name;\n $brand = Brand::where('top_category_id', $category_id)->where('status', 1)->get();\n $products->where('top_category_id', $category_id);\n } elseif ($type == 2) {\n $cate_name = SubCategory::with('topCategory')->find($category_id);\n $label = $cate_name->TopCategory->top_cate_name;\n $brand = Brand::where('sub_category_id', $category_id)->where('status', 1)->get();\n $products->where('sub_category_id', $category_id);\n } else {\n $cate_name = ThirdLevelCategory::with(['topCategory', 'subCategory'])->find($category_id);\n $label = $cate_name->TopCategory->top_cate_name;\n $brand = Brand::where('sub_category_id', $cate_name->top_category_id)->where('status', 1)->get();\n $products->where('third_level_sub_category_id', $category_id);\n }\n $min_price = $products->min('price');\n $max_price = $products->max('price');\n $products = $products->orderBy('id', 'desc')->paginate(18);\n $top_category = DB::table('top_category')\n ->where('status', 1)\n ->get();\n\n $categories = [];\n foreach ($top_category as $key => $item) {\n\n $sub_categories = DB::table('sub_category')\n ->where('top_category_id', $item->id)\n ->where('status', 1)\n ->orderBy('id', 'ASC')\n ->get();\n\n if (!empty($sub_categories) && count($sub_categories) > 0) {\n\n foreach ($sub_categories as $keys => $items) {\n\n $last_categories = DB::table('third_level_sub_category')\n ->where('sub_category_id', $items->id)\n ->where('status', 1)\n ->orderBy('id', 'ASC')\n ->get();\n\n $items->last_category = $last_categories;\n }\n }\n\n $categories[] = [\n 'top_category_id' => $item->id,\n 'top_cate_name' => $item->top_cate_name,\n 'sub_categories' => $sub_categories\n ];\n }\n $price_range = [\n 'min' => $min_price,\n 'max' => $max_price\n ];\n return view('web.product.product-list', compact('products', 'label', 'categories', 'brand', 'category_id', 'type', 'price_range'));\n }",
"public function getProductsBySearch ($search) {\n \n $words = explode(' ', $search);\n $regex = implode('|', $words);\n \n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n if (!empty($search)) {\n \n try {\n\n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n FROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND ( product_name REGEXP '{$regex}'\n OR brand REGEXP '{$regex}'\n OR upc REGEXP '{$regex}'\n OR ea_category.name REGEXP '{$regex}' )\n ORDER BY avg_price\";\n //print(\"$query\");\n foreach($this->dbo->query($query) as $row) {\n $id = stripslashes($row[0]);\n $upc = strval(stripslashes($row[1]));\n $brand = $this->convertFancyQuotes(stripslashes($row[2]));\n $product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n $product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n $avg_price = stripslashes($row[5]);\n $category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n\n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n\n $product[\"image_path\"] = $this->getImagePath($upc);\n\n $products[] = $product;\n }\n\n } catch (PDOException $e) {\n $this->errorCode = 1;\n $errorCode = -1;\n $errorMessage = \"PDOException for getProductsBySearch.\";\n }\t\n \n } else {\n $errorCode = 1;\n\t\t\t$errorMessage = \"No Search value provided.\";\n }\n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $search;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\n $data = json_encode($data);\n \n\t\treturn $data;\n \n }",
"public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}",
"public function getProducts (){\n\t\t$cache = Zend_Registry::get('cache');\n\t\t// see if product - list is already in cache\n\t\tif(!$productArray = $cache->load('productsByManufacturerId'.$this->id)) {\n\t\t\t$productTable = Website_Model_CbFactory::factory('Website_Model_MysqlTable', 'product');\n\t\t\t$products = $productTable->fetchAll('manufacturer='.$this->id);\n\t\t\tforeach($products as $product){\n\t\t\t\t$productArray[] = Website_Model_CbFactory::factory('Website_Model_Product',$product->id);\n\t\t\t}\n\t\t\t$cache->save($productArray,'productsByManufacturerId'.$this->id,array('model'));\n\t\t}\n\t\treturn $productArray;\n\t}",
"public function GetProductsByCategory($category_id) {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\n WHERE categoryID = :category_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':category_id' => $category_id,\n ]);\n }",
"public function productByCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsByCategory($category);\n $this->view->render('Riding Gear', $vars);\n }",
"function printProductCategories () {\r\n $stmt = getProductCategories();\r\n print(\"<div class='p-2 productgroup'> <a href='#' value='all' onclick=searchCategory('all') class='px-3'>All</a></div>\");\r\n while ($row = $stmt->fetch()) {\r\n print(\"<div class='p-2 productgroup'> <a href='#' value='\" . $row['StockGroupID'] . \"' onclick=searchCategory(\" . $row['StockGroupID'] . \") class='px-3'>\" . $row['StockGroupName'] . \"</a></div>\");\r\n }\r\n}",
"function get_product_category_filters($data) {\n $category_id = $data['category_id'];\n // Return category filters object\n return (object) [\n 'attributes' => get_product_category_attribute_terms($category_id),\n 'subcategories' => get_product_category_subcategories($category_id),\n 'price' => get_product_category_price_min_max($category_id)\n ];\n}",
"public function getAssignedProducts($categoryId);",
"public function getbooksbycategory($categoryid){\n\t\tif($categoryid!=1){\n\t\t\t$this->db->where('Category_Id', $categoryid);\n\t\t}\n\t\telse{\n\t\t\t$this->db->group_by('Product_Id');\n\t\t}\n\t\t$this->db->select('Product_Id,ProductName,ProductAuther,ProductRetailPrice,ProductSellingPrice,ProductDiscount,ProductLanguage,ProductBinding,ProductThumbImage,CategoryName');\n\t\t$this->db->from('tbl_product_category');\n\t\t$this->db->join('tbl_products', 'tbl_product_category.Product_Id = tbl_products.ProductId', 'inner');\n\t\t$this->db->join('tbl_category', 'tbl_product_category.Category_Id = tbl_category.CategoryId', 'inner');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}",
"function getProducts(){\n\tif(!isset($_GET['categories'])){\n\t\tif(!isset($_GET['brands'])){\n\tglobal $connection;\n\t//selecting 6 products at random and displaying\n\t$get_products=\"select * from products order by RAND() LIMIT 0,6\";\n\t$run_products=mysqli_query($connection,$get_products);\n\twhile($row_products=mysqli_fetch_array($run_products)){\n\t\t$product_id\t=$row_products['product_id'];\n\t\t$product_category=$row_products['product_category'];\n\t\t$product_brand=$row_products['product_brand'];\n\t\t$product_title=$row_products['product_title'];\n\t\t$product_price=$row_products['product_price'];\n\t\t$product_image=$row_products['product_image'];\n\t\t\n\techo \"\n\t<div id='single_product'>\n\t<h3>$product_title</h3>\n\t<img src='admin/product_images/$product_image' width='180' height='180'/>\n\t<p><b>LKR. $product_price</b></p>\n\t<a href='details.php?product_id=$product_id' style='float:left;' class='button'>Details</a>\n\t\n\t<a href='index.php?add_cart=$product_id' style='float:right;' class='button'>Add to Cart</a>\n\t</div>\n\t\";\n\t\t\n\t\t \n\t}\n}\n}\n}",
"public static function findByName($name)\n {\n // realiza la busqueda de todos los identificadores de productos que \n // tengan un nombre similar al dado (via SQL LIKE)\n $ids = \\database\\DAOFactory::getDAO(\"product\")->query(\n \"SELECT idProducto FROM PRODUCTO WHERE nombre LIKE ?\",\n \"%\" . $name . \"%\");\n if (!$ids || !is_array($ids)) return array();\n\n // genera un array de objetos Product creandolos con los \n // identificadores anteriores y llamando a fill() para recuperar todos \n // sus datos\n $found = array();\n foreach ($ids as $id) {\n $product = new Product($id[\"idProducto\"]);\n if (!$product->fill()) break;\n $found[ ] = $product;\n }\n\n return $found;\n }",
"public function getproducts($method,$category,$string=false,$limit=false,$page=false,$sorting=false,$sortvalue=false,$token=false) \n\t{\n\t\n\t\t$min \t= 0;\n\t\t$max \t= 0;\n\t\t$pages = 0;\n\t\t\n\t\t$postsearch \t= false;\n\t\t$searchresults \t= [];\n\t\t$pricebars \t\t= [];\n\t\n\t\tisset($string) ? $this->textstring = $string : $this->textstring = false;\n\t\tisset($category) ? $this->category = $this->revSeo($category) : $this->category = false;\n\t\tisset($this->pageid) ? $this->page_id = (int)$this->pageid : $this->page_id = 1;\t\n\t\tisset($this->cat) ? $this->product_cat = $this->revSeo($this->cat) : $this->product_cat = $this->category;\n\t\tisset($this->subcat) ? $this->product_subcat = $this->revSeo($this->subcat) : $this->product_subcat = false;\t\n\t\t\n\t\tif(isset($_SESSION['token'])) {\n\t\t\t$token = $_SESSION['token'];\n\t\t} else {\n\t\t\t$token = $cryptography->getToken();\n\t\t\t$_SESSION['token'] = $token;\n\t\t}\n\t\n\t\t$hostaddr = $this->getbase();\n\t\t\n\t\t// Loading the shop configuration.\n\t\t$shopconf = $this->json->load_json(self::INVENTORY_PATH . self::SHOPCONF);\n\t\t$configuration = [];\n\t\t\n\t\tif($shopconf !== null) {\n\t\t\tforeach($shopconf as $conf) {\t\n\t\t\t\tarray_push($configuration,$conf);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Logic for pagination on products.\n\t\tif($limit == false) {\n\t\t\t$siteconf \t= $this->json->load_json(self::INVENTORY_PATH . self::SITECONF);\n\t\t\t$result \t= $this->getasetting($siteconf,'site.maxproducts.visible.in.cat');\n\t\t\t$limit \t\t= (int) $result;\n\t\t\t$limit_products = $limit;\n\t\t\t} else {\n\t\t\t$limit_products = $limit;\n\t\t}\n\t\t\n\t\tif($page != false) {\n\t\t\t$page_products = $page;\n\t\t\t} else {\n\t\t\t$page_products = 1;\n\t\t}\n\t\t\n\t\t$productlist = $this->json->decode();\t\n\n\t\t$activelist = [];\n\n\t\tfor($i = 0; $i < count($productlist); $i++) {\t\n\t\t\tif($productlist[$i]['product.status'] == 1) {\n\t\t\t\tarray_push($activelist,$productlist[$i]);\n\t\t\t}\n\t\t}\n\n\t\t$productlist = array_reverse($activelist);\n\n\t\t// rows function\n\t\t\n\t\tif($method == 'rows') {\n\t\t\t\n\t\t\t$products = array();\n\t\t\t\n\t\t\tfor($i = 0; $i < count($productlist); $i++) {\t\n\t\t\t\n\t\t\t\t$ts = $productlist;\n\t\t\t\t\n\t\t\t\t\t$key = [];\n\t\t\t\t\tarray_push($key,($i+1));\n\t\t\t\t\tarray_push($key,$this->sanitizer->maxstring($this->sanitizer->cleaninput($productlist[$i]['product.id']),10,false));\n\t\t\t\t\tarray_push($key,$this->sanitizer->maxstring($this->sanitizer->cleaninput($productlist[$i]['product.title']),10,false));\n\t\t\t\t\tarray_push($key,$this->sanitizer->maxstring($this->sanitizer->cleaninput($productlist[$i]['product.description']),30,true));\n\t\t\t\t\tarray_push($key,$this->sanitizer->cleaninput($productlist[$i]['product.category']));\n\t\t\t\t\tarray_push($key,$this->getsitecurrency(self::INVENTORY_PATH . self::SITECONF,self::INVENTORY_PATH . self::CURRENCIES).' '.$this->sanitizer->cleaninput($productlist[$i]['product.price']));\n\t\t\t\t\tarray_push($key,$this->sanitizer->cleaninput($productlist[$i]['product.stock']));\n\t\t\t\t\tarray_push($products,$key);\n\t\t\t}\n\t\t\t\n\t\t\treturn $products;\n\t\t}\n\n\t\t// refine function.\n\t\t\n\t\tif($method == 'refine') {\n\t\t\t\n\t\t\tif(!isset($this->refinekey)) {\n\t\t\t\t$query = 'tag';\n\t\t\t\t} else {\n\t\t\t\t$query = $this->refinekey;\n\t\t\t}\n\t\t\t\n\t\t\tfor($k = $min; $k < count($productlist); $k++) {\t\n\t\t\t\n\t\t\t\t$c = $productlist[$k];\n\t\t\t\t\t\n\t\t\t\t\t$var1 = $this->sanitizer->cleaninput($c['variant.title1']); \n\t\t\t\t\t$var2 = $this->sanitizer->cleaninput($c['variant.title2']);\n\t\t\t\t\t$var3 = $this->sanitizer->cleaninput($c['variant.title3']);\n\t\t\t\t\t$find = $this->sanitizer->sanitize($query,'search');\n\t\t\t\t\tif(is_array($find)) {\n\t\t\t\t\t\t$find \t= implode(',',$find);\n\t\t\t\t\t}\n\t\t\t\t\tif(strlen($find) >=3) { \n\t\t\t\t\t\tif(stristr($var1,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif(stristr($var2,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif(stristr($var3,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {}\t\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$productlist = $searchresults;\n\t\t\t$method = 'list';\n\t\t\t$postsearch = true;\n\t\t}\n\t\t\n\t\t// end refine\n\t\t\n\t\t// search function.\n\t\t\n\t\tif($method == 'search') {\n\t\t\t\n\t\t\tif(!isset($this->searchkey)) {\n\t\t\t\t$query = 'tag';\n\t\t\t\t} else {\n\t\t\t\t$query = $this->searchkey;\n\t\t\t}\n\t\t\t\n\t\t\tfor($k = $min; $k < count($productlist); $k++) {\t\n\t\t\t\n\t\t\t\t$c = $productlist[$k];\n\t\t\t\t\t\n\t\t\t\t\t$title = $this->sanitizer->cleaninput($c['product.title']); \n\t\t\t\t\t$desc = $this->sanitizer->cleaninput($c['product.description']);\n\t\t\t\t\t$tags = $this->sanitizer->cleaninput($c['product.tags']);\n\t\t\t\t\t$find = $this->sanitizer->sanitize($query,'search');\n\t\t\t\n\t\t\t\t\tif(strlen($find) >=3) { \n\t\t\t\t\t\tif(stristr($title,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif(stristr($desc,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif(stristr($tags,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {}\t\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$productlist = $searchresults;\n\t\t\t$method = 'list';\n\t\t\t$postsearch = true;\n\t\t}\n\t\t\n\t\t// end search\n\t\t\n\t\t// pricebar\n\t\tif($method == 'pricebar') {\n\t\t\t\n\t\t\tif(!isset($this->maxprice)) {\n\t\t\t\t$maxprice = self::MAXINT;\n\t\t\t\t} else {\n\t\t\t\t$maxprice = (int)$this->maxprice;\n\t\t\t}\n\t\t\t\n\t\t\tif(!isset($this->minprice)) {\n\t\t\t\t$minprice = 1;\n\t\t\t\t} else {\n\t\t\t\t$minprice = $this->sanitizer->sanitize((int)$this->minprice,'num');\n\t\t\t}\n\t\t\t\n\t\t\tfor($k = $min; $k < count($productlist); $k++) {\t\n\t\t\t\n\t\t\t\t$c = $productlist[$k];\n\t\t\t\t$productprice = $this->sanitizer->cleaninput($c['product.price']); \n\t\n\t\t\t\tif($c['product.price'] != \"\") {\n\t\t\t\t\tif(($productprice >= $minprice) && ($productprice <= $maxprice)) {\n\t\t\t\t\t\tif(!in_array($c,$pricebars)) {\n\t\t\t\t\t\t\tarray_push($pricebars,$c);\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t} \t\n\t\t\t}\n\t\t\t\n\t\t\t$productlist = $pricebars;\n\t\t\t$method = 'list';\t\n\t\t\t$postsearch = true;\n\t\t}\n\t\t// end pricebar\n\t\t\n\t\tif($productlist !== null) {\n\t\t\t$amount_products = count($productlist);\n\t\t\t} else {\n\t\t\t$amount_products = 0;\n\t\t}\n\n\t\tif($amount_products < 1) {\n\t\t\t\techo 'There are not enough products to view.';\n\t\t}\n\t\t\t\n\t\t// build pagination for product page.\n\t\tif($amount_products >= 1) {\n\n\t\t\t$pagination = true;\n\t\t\t\n\t\t\tif(isset($this->page)) {\n\t\t\t\t$page_products = (int)$this->page;\n\t\t\t\t} else {\n\t\t\t\t$page_products = 1;\n\t\t\t}\n\t\t \n\t\t\tif($amount_products < 1) {\n\t\t\t\techo 'There are not enough products to view.';\n\t\t\t\t// exit;\n\t\t\t}\n\n\t\t\tif($limit_products >= 500) {\n\t\t\t\techo 'There are too many products to view. Please edit the appropiate max product value setting in site.json.';\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif($limit_products <= 1) {\n\t\t\t\t$limit_products = 10;\n\t\t\t}\n\n\t\t\tif($page_products < 1) {\n\t\t\t\t$page_products = 1;\n\t\t\t}\n\t\t\t\n\t\t\t// todo: fix bug on limit ~ amount\n\t\t\tif($limit_products > $amount_products) {\n\t\t\t\t$limit_products = $amount_products;\n\t\t\t}\n\t\t\t\n\t\t\t$pages = round($amount_products / $limit_products);\n\t\t\t\n\t\t\tif($page_products == 1) {\n\t\t\t\t$min = 0;\n\t\t\t\t$max = $limit_products;\n\t\t\t}\n\t\t\t\n\t\t\tif($page_products > 1) {\n\t\t\t\t$min = (($page_products -1) * $limit_products);\n\t\t\t\t$max = ($page_products * $limit_products);\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($max > $amount_products) {\n\t\t\t\t$min = ($amount_products - $limit_products); \n\t\t\t\t$max = $amount_products; \n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$pagination = false;\n\t\t}\n\t\t\n\t\t// top paginate links\n\t\t$string_pag = '<div id=\"ts-paginate\">';\n\t\t$string_pag .= '<div id=\"ts-paginate-left\">';\n\t\t$string_pag .= 'Showing product ';\n\t\t\n\t\tif($min == 0) {\n\t\t\t$string_pag .= $min+1;\n\t\t\t} else {\n\t\t\t$string_pag .= $min;\n\t\t}\n\t\n\t\t$string_pag .= ' to ';\n\t\t$string_pag .= $max;\n\t\t$string_pag .= '</div>';\n\t\t$string_pag .= '<div id=\"ts-paginate-right\">';\n\t\t$string_pag .= 'Page '.$page_products.' of '.$pages; \n\t\t\n\t\tif($page != $pages) {\n\t\t $string_pag .= ' <span id=\"ts-paginate-arrow\"><a href=\"'.($page_products+1).'/\">→</a></span>';\n\t\t} \n\t\t\n\t\t$string_pag .= '</div>';\n\t\t$string_pag .= '</div>';\n\t\t\n\t\t// carousel selection.\n\t\tif($configuration[0]['products.carousel'] == 1 && $this->category == 'index') {\n\t\t\t$carousel = true;\n\t\t}\n\n\t\t$this->textstring .= \"<div id=\\\"ts-product\\\">\";\n\t\t\n\t\tif($productlist !== null) {\n\t\t\t\n\t\t\t$ts \t = array();\n\t\t\t$shoplist = $productlist;\n\t\t\n\t\t\tif($pagination == false) {\n\t\t\t\t$min = 0;\n\t\t\t\t$max = count($productlist);\n\t\t\t} \n\t\t\t\n\t\t\tfor($k = $min; $k < count($productlist); $k++) {\t\n\t\t\t\n\t\t\t\t$c = $productlist[$k];\n\t\t\t\t\n\t\t\t\tif(($c['product.featured'] == '1') && ($c['product.featured.location'] == $this->product_cat)) {\n\t\t\t\t\t$this->textstring .= '<div class=\"ts-product-image-div-featured\">';\n\t\t\t\t\t$this->textstring .= '<h3>'.$this->sanitizer->cleaninput($c['product.title']).'</h3>'; \n\t\t\t\t\t$this->textstring .= '<div>'.$this->sanitizer->cleaninput($c['product.description']).'</div>'; \n\t\t\t\t\t$this->textstring .= '<a href=\"'.$this->sanitizer->cleaninput($c['product.url']).'\"><img src=\"'.$hostaddr.'/'.$this->sanitizer->cleaninput($c['product.featured.image']).'\" class=\"ts-product-image\"/></a></div>';\n\t\t\t\t}\n\t\t\t\t\tif($this->product_subcat != false) {\n\t\t\t\t\t\t// category and subcategory\n\n\t\t\t\t\t\tif($this->revSeo($c['product.category.sub']) == $this->revSeo($this->product_subcat) && ($this->revSeo($c['product.category']) == $this->revSeo($this->product_cat)) && ($c['product.status'] == '1')) {\n\t\t\t\t\t\t\t\tarray_push($ts,$c);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} elseif($this->product_cat != false) {\n\t\t\t\t\t\t// only category\n\t\t\t\t\t\tif($this->revSeo($c['product.category']) == $this->revSeo($this->product_cat)) {\n\t\t\t\t\t\t\t\tarray_push($ts,$c);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// no cat nor subcat, might be search.\n\t\t\t\t\t\tif($postsearch != false) {\n\t\t\t\t\t\t\tarray_push($ts,$c);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t$this->sanitizer->cleaninput($c['product.title']);\n\t\t\t\tif($postsearch != false) {\n\t\t\t\t\t\tarray_push($ts,$c);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// flip array order, as most products are added sequentially...\n\t\t\t$ts = array_reverse($ts);\t\n\t\t\t\n\t\t\t// sorting of products.\n\t\t\tif($sorting == true) {\n\t\t\t\t// sort array\n\t\t\t\tif(isset($sortvalue)) {\n\n\t\t\t\t\t$pieces = explode(':',$sortvalue,2);\n\t\t\t\t\t\n\t\t\t\t\tif(isset($pieces)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch(strtolower(trim($pieces[0]))) {\n\t\t\t\t\t\t\tcase 'price':\n\t\t\t\t\t\t\t$sort = array_column($ts, 'product.price');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'title':\n\t\t\t\t\t\t\t$sort = array_column($ts, 'product.title');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($sort)) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tswitch(strtolower(trim($pieces[1]))) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase 'ascending':\n\t\t\t\t\t\t\t\tarray_multisort($sort, SORT_ASC, $ts);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'descending':\n\t\t\t\t\t\t\t\tcase 'decending':\n\t\t\t\t\t\t\t\tarray_multisort($sort, SORT_DESC, $ts);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} else {}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// pagination count correction.\n\t\t\t$ts_pag = count($ts);\n\n\t\t\tif($ts_pag > $limit) {\n\t\t\t\t$this->textstring .= $string_pag;\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($k <= 0) {\n\t\t\t\treturn '<div id=\"ts-products-noproducts\">There are no products in this category.</div>';\n\t\t\t}\n\t\t\t\n\t\t\tif($method == 'array') {\n\t\t\t\treturn $ts;\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif($pagination == false) {\n\t\t\t\t$i = count($ts);\n\t\t\t\t} else {\n\t\t\t\t$i = $max;\n\t\t\t}\n\n\t\t\tif($i >= 0) { \n\t\t\t\n\t\t\t\twhile($i >= 0) {\n\t\t\t\t\t\n\t\t\t\t\tif(isset($ts[$i]['product.stock'])) {\n\t\t\t\t\t\t$stock = (int) $ts[$i]['product.stock'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$stock = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($stock <= 5) {\n\t\t\t\t\t\t$status = 'ts-product-status-red'; // low stock\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t$status = 'ts-product-status-green';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(isset($ts[$i]['product.image']) != \"\") {\n\t\t\t\t\t\t$productimage = '<div class=\"ts-product-image-div\"><img src=\"'.$hostaddr.$this->sanitizer->cleaninput($ts[$i]['product.image']).'\" class=\"ts-product-image\"/></div>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t$productimage = '<div class=\"ts-product-image-icon\">🛒</div>';\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tswitch($method) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'list':\n\n\t\t\t\t\t\tif(isset($ts[$i]['product.description'])) {\n\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-product-list\\\">\";\n\t\t\t\t\t\t\t$this->textstring .= $productimage;\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-list-product-link\\\"><a href=\\\"\".$this->getbase().\"category/\".$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.category'])).\"/item/\".$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.category'])).'/'.$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.title'])).'/'.$this->sanitizer->cleaninput($ts[$i]['product.id']).\"/\".(int)$this->page_id.\"/\\\">\".$this->sanitizer->maxstring($this->sanitizer->cleaninput($ts[$i]['product.title']),10,false).\"</a> </div>\";\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-list-product-desc\\\">\".$this->sanitizer->maxstring($this->sanitizer->cleaninput($ts[$i]['product.description']),30,true).\"</div>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// $this->textstring .= \"<div class=\\\"ts-list-product-cat\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.category']).\"</div>\";\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-list-product-price\\\">\".$this->getsitecurrency(self::INVENTORY_PATH . self::SITECONF,self::INVENTORY_PATH . self::CURRENCIES).' '.$this->sanitizer->cleaninput($ts[$i]['product.price']).\"</div>\";\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-list-product-status\\\">left in stock.<div class=\\\"\".$status.\"\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.stock']).\"</div></div>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(isset($configuration[0]['products.quick.cart']) == 'yes') {\n\t\t\t\t\t\t\t\t$this->textstring .= \"<div><input type='number' name='qty' size='1' value='1' min='1' max='9999' id='ts-group-cart-qty-\".($i+1).'-'.(int)$ts[$i]['product.id'].\"'><input type='button' onclick='OpenShop.addtocart(\\\"\".(int)$ts[$i]['product.id'].\"\\\",\\\"ts-group-cart-qty-\".($i+1).'-'.(int)$ts[$i]['product.id'].\"\\\",\\\"\".$token.\"\\\",\\\"\".$hostaddr.\"\\\");' class='ts-list-cart-button' name='add_cart' value='\".$this->sanitizer->cleaninput($configuration[0]['products.cart.button']).\"' /></div>\";\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->textstring .= \"<div class='ts-list-view-link'><a href=\\\"product/\".$this->sanitizer->cleaninput($ts[$i]['product.id']).\"/\\\">view</a></div>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->textstring .= \"</div>\";\n\t\t\t\t\t\t} \n\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'group':\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-product-group\\\">\";\n\t\t\t\t\t\t$this->textstring .= $productimage;\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-group-product-link\\\"><a href=\\\"item/\".$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.category'])).'/'.$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.title'])).'/'.$this->sanitizer->cleaninput($ts[$i]['product.id']).\"/\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.title']).\"</a> </div>\";\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-group-product-desc\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.description']).\"</div>\";\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-group-product-price\\\">\".$this->getsitecurrency(self::INVENTORY_PATH . self::SITECONF,self::INVENTORY_PATH . self::CURRENCIES).' '.$this->sanitizer->cleaninput($ts[$i]['product.price']).\"</div>\";\n\t\t\t\t\t\t// $this->textstring .= \"<div class=\\\"ts-group-product-cat\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.category']).\"</div>\";\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-group-product-status\\\">left in stock.<div class=\\\"\".$status.\"\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.stock']).\"</div></div>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($configuration[0]['products.quick.cart']) == 'yes') {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->textstring .= \"<div><input type='number' name='qty' size='1' min='1' max='9999' value='1' id='ts-group-cart-qty-\".($i+1).'-'.(int)$ts[$i]['product.id'].\"'><input type='button' onclick='OpenShop.addtocart(\\\"\".(int)$ts[$i]['product.id'].\"\\\",\\\"ts-group-cart-qty-\".($i+1).'-'.(int)$ts[$i]['product.id'].\"\\\",\\\"\".$token.\"\\\",\\\"\".$host.\"\\\");' class='ts-group-cart-button' name='add_cart' value='\".$this->sanitizer->cleaninput($configuration[0]['products.cart.button']).\"' /></div>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->textstring .= \"<div class='ts-group-view-link'><a href=\\\"product/\".$this->sanitizer->cleaninput($ts[$i]['product.id']).\"/\\\">view</a></div>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->textstring .= \"</div>\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t$i--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t}\n\n\t\t$this->textstring .= \"</div>\";\t\t\n\t\t\n\t\treturn array($k,$this->textstring);\n\t}",
"public function autocompletesearch($sellerid,$name)\n\t {\n\t\t \n\t\t $result4='';\n\t\t\t\t if($name!='')\n\t\t\t\t {\n\t\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $products = $objectManager->create('Magento\\Catalog\\Model\\ProductFactory')\n\t\t\t\t ->create()\n\t\t\t\t\t\t\t\t\t ->getCollection()\n\t\t\t\t\t\t\t\t\t//->addFieldToFilter('store_id', 1)\n ->addFieldToFilter('name', array(\"like\"=>'%'.$name.'%') );\t\t\t\t\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t //echo \"<pr>\";var_dump($products->getData()); \n\t\t\t\t if(!empty($products->getData())):\n\t\t\t\t foreach($products as $product)\n\t\t\t\t {\n $productId =$product->getId();\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t\t\t\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t\t\t\t\t$connection = $resource->getConnection();\n\t\t\t\t\t\t $quote_sql = \"Select * FROM marketplace_product where mageproduct_id=$productId and seller_id=$sellerid \";\n\t\t\t\t\t\t$result_result = $connection->fetchAll($quote_sql);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($result_result))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n //echo\"<pre>\";print_r($currentproduct->getData());\n\t\t\t\t\t\t$cats = $currentproduct->getCategoryIds();\n\t\t\t\t\t\t$c=0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$categoryname='';\n\t\t\t\t\t\t$categoryId='';\n\t\t\t\t\t\t foreach ($cats as $categoryIds) {\n\t\t\t\t\t\t\tif($categoryIds!=2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($c<1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t//$currentcategory = $objectManager->create('Magento\\Catalog\\Model\\category')->load($categoryIds);\n\t\t\t\t\t\t //$sami=$categoryIds;\n\t\t\t\t\t\t\t //$currentcategory = $objectManager->create('Magento\\Catalog\\Model\\category')->load($sami);\n\t\t\t\t\t\t\t// $categoryname=$currentcategory->getName();\n\t\t\t\t\t\t\t//$categoryId = 3;\n\t\t\t\t\t\t\t$categoryId =$categoryIds;\n\t\t\t\t\t\t\t$_objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t\t\t\t$object_manager = $_objectManager->create('Magento\\Catalog\\Model\\Category')\n\t\t\t\t\t\t\t->load($categoryId);\n\t\t\t\t\t\t\t//print_r($object_manager->getData());\n\t\t\t\t\t\t\t$categoryname=$object_manager->getName();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$c++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t$producturl=$currentproduct->getProductUrl();\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t//$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"categoryName\"=>$currentcategory->getName());\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"categoryName\"=>$categoryname,\"categoryid\"=>$categoryId,\"urltag\"=>$name);\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t }\n\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'product'=>$result4);\n\t\t return $result; \n else:\n \t\t\t\t \n\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'product'=>'No result found!');\n\t\t return $result; \n\t\t\t\t \n\t\t\t\t endif;\n \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t \n\t\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t\t\t\t return $result; \n\t\t\t\t }\n\t\t\t\t \n\t }",
"function getProductsByCat($catId) {\r\n $catId = intval($catId);\r\n $sql = \"SELECT * FROM products WHERE category_id = '{$catId}'\";\r\n\r\n include '../config/db.php';\r\n\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}",
"public function getProducts($conditionsQuery=\"1\"){\n $products=Db::query(\"SELECT * FROM \".PRODUCT_TABLE_NAME.\" WHERE id IN ( SELECT product_id FROM \".CATEGORY_PRODUCT_TABLE_NAME.\" WHERE category_id='$this->categoryId') AND $conditionsQuery\");\n\n if($products=$products->fetchAll(PDO::FETCH_NAMED)){\n return $products;\n }else{\n return false;\n }\n }",
"public function getByProduct($category_ID, $name)\n {\n return DB::table('product_models')\n ->where('product_category_ID',$category_ID)\n ->where('name',$name)\n ->first();\n }",
"public function getProducts()\n {\n $products = [\n [\"name\" => \"Sledgehammer\", \"price\" => 125.75],\n [\"name\" => \"Axe\", \"price\" => 190.50],\n [\"name\" => \"Bandsaw\", \"price\" => 562.131],\n [\"name\" => \"Chisel\", \"price\" => 12.9],\n [\"name\" => \"Hacksaw\", \"price\" => 18.45],\n ];\n return $products;\n }",
"public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }",
"function getItems()\n\t{\n\t\t$query = ' SELECT ' .\n\t\t\t$this->db->nameQuote('k2.alias') . ',' .\n\t\t\t$this->db->nameQuote('k2.title') . ',' .\n\t\t\t$this->db->nameQuote('k2.introtext') . ',' .\n\t\t\t$this->db->nameQuote('k2.plugins') . ',' .\n\t\t\t$this->db->nameQuote('loc.locations') . ',' .\n\n\t\t\t// Get all additional categories\n\t\t\t' ( SELECT ' .\n\t\t\t' GROUP_CONCAT(' . $this->db->nameQuote('cats.catid') . ')' .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' WHERE ' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') .\n\t\t\t') AS ' . $this->db->nameQuote('categoryIDs') . ',' .\n\n\t\t\t// Get first additional categories name\n\t\t\t' ( SELECT ' .\n\t\t\t$this->db->nameQuote('cat.alias') .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_categories') . ' AS ' . $this->db->nameQuote('cat') .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' ON (' . $this->db->nameQuote('cat.id') . ' = ' . $this->db->nameQuote('cats.catid') . ')' .\n\t\t\t' WHERE ' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') .\n\t\t\t' AND ' . $this->db->nameQuote('cat.id') . ' NOT IN (' . implode(',', $this->params->get('regionCategories')) . ')' .\n\t\t\t' AND ' . $this->db->nameQuote('parent') . ' = ' . $this->db->quote($this->params->get('primaryCategory')) .\n\t\t\t' LIMIT 1 ' .\n\t\t\t') AS ' . $this->db->nameQuote('category') .\n\n\t\t\t// Join K2 items, K2 locations and additional categories tables by item ID\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_items') . ' AS ' . $this->db->nameQuote('k2') .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_items_locations') . ' AS ' . $this->db->nameQuote('loc') .\n\t\t\t' ON (' . $this->db->nameQuote('loc.itemId') . ' = ' . $this->db->nameQuote('k2.id') . ')' .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' ON (' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') . ')' .\n\n\t\t\t// Limit results to items that only have the correct additional categories\n\t\t\t' WHERE ' . $this->db->nameQuote('cats.catid') . ' IN (' . implode(',', JRequest::getVar('categories')) . ')' .\n\n\t\t\t// Published items only\n\t\t\t' AND ' . $this->db->nameQuote('published') . ' = ' . $this->db->quote('1') .\n\t\t\t' AND ' . $this->db->nameQuote('k2.trash') . ' = ' . $this->db->quote('0');\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->setUniversalFields($this->db->loadObjectList());\n\t}",
"public function category_products($id)\n {\n $data=$this->ProductProviderRepository->search(request())->whereHas('product', function($q) use ($id) {\n $q->where('category_id','=', $id);\n\n })\n ->where('available','=',1)\n ->with('product','provider')\n ->selectRaw('product_id as product_id ,min(price) as min_price')->groupBy('product_id');\n $products=$this->PaginationService->pagination($data);\n $products->appends(request()->all());\n return view('category-products')\n ->with('products',$products);\n\n }",
"public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }",
"public function getCategory()\n\t\t{\n\t\t\t$sql = \"SELECT id_category,name_cate FROM tbl_category_products\";\n\t\t\t$pre = $this->pdo->prepare($sql);\n\t\t\t$pre->execute();\n\n\t\t\treturn $pre->fetchAll(PDO::FETCH_ASSOC);\n\t\t}",
"public function addProduct($category_id, $current_date, $attr_name) {\n\n $addedProducts = array();\n \n //product collection\n $productCollection = Mage::getResourceModel('reports/product_collection')\n ->addAttributeToSelect('id')\n ->addAttributeToSelect('name');\n $productCollection->addAttributeToFilter($attr_name, array('date' => true, 'from' => $current_date));\n $productCollection->load();\n\n $currentStoreID = Mage::app()->getStore()->getId();\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n\n foreach ($productCollection as $product) {\n $categoryIds = $product->getCategoryIds();\n if (!in_array($category_id, $categoryIds)) {\n $categoryIds[] = $category_id;\n $product->setCategoryIds($categoryIds);\n $product->save();\n \n $addedProducts[$product->getId()] = $product->getName();\n }\n }\n Mage::app()->setCurrentStore($currentStoreID);\n\n return $addedProducts;\n }",
"public function populate_stocks($products) {\n\n foreach($products as &$p) {\n $this->db->select('s.id, s.name, st.stock');\n $this->db->from('stores AS s');\n $this->db->join('stocks AS st', 's.id = st.store_id', 'left');\n $this->db->where('st.products_id', $p->id);\n $p->stocks = $this->db->get()->result();\n }\n\n return $products;\n }",
"public function stocksGroupByID($dados)\n {\n\n $main = [];\n foreach ($dados as $dado) {\n $aux = [];\n $qty = 0; // acúmulo de stock de cada produto \n foreach ($dados as $copy) {\n if ($dado->product_id == $copy->product_id) {\n /* Adicionar todos os fornecedores pertencente ao mesmo produto (Mesmo ID)*/\n array_push($aux, $copy->collaborator);\n $qty += $copy->qty;\n }\n }\n\n $product = [\n 'id' => $dado->id,\n 'collaborator_id' => $dado->collaborator_id,\n 'collaborator' => $dado->collaborator,\n 'product_id' => $dado->product_id,\n 'product' => $dado->product,\n 'category' => $dado->category,\n 'qty' => $qty,\n 'collaborators' => $aux, // Adicionar todas as fotos salvas \n ];\n array_push($main, $product);\n }\n\n $products = array();\n\n if (count($main) == 0) {\n return $products;\n }\n\n\n $function = new Product();\n do {\n $first_element = $main[$function->get_first_occurence($main)];\n\n foreach ($main as $key => $dado) {\n if ($first_element != null) {\n if ($first_element['product_id'] == $dado['product_id']) {\n unset($main[$key]);\n }\n }\n }\n Array_push($products, $first_element);\n } while (count($main) > 0);\n\n return $products;\n }",
"function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }",
"public function getProducts()\n {\n return $this->hasMany(Product::className(), ['category_id' => 'id']);\n }",
"function getallproducts1($warehouseid){\n \n\n $products = $this->db->query(\"SELECT a.*, \n b.id AS productid, \n b.`name` AS productname, \n b.`main_image` AS productimage, \n b.`price` AS product_price, \n b.`tax` AS product_tax, \n b.`description` AS product_description, \n b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, \n c.`image` AS cat_image, \n c.`category_id` AS category_id,\n d.`category_id` AS subcategory_id,\n d.`name` AS subcat_name, \n d.`image` AS subcat_image,\n d.`parent_id` AS parent_id,\n d.`shared_category` AS shared_category \n FROM warehouse_products a \n LEFT JOIN products b ON a.product=b.`id` \n LEFT JOIN category c ON b.`category_id` = c.`category_id` \n LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` \n WHERE a.`warehouse` = \".$warehouseid.\" \n ORDER BY c.`name`, d.`name`\")->result();\n \n $sharedproducts=array();\n foreach($products as $product){\n if($product->shared_category !=null)\n array_push($sharedproducts, $product);\n }\n \n \n if(sizeof($products)>0){\n \n $this->db->query(\"TRUNCATE TABLE `tb_filteredproducts`\");\n \n foreach($products as $row) {\n $categoryimage=$row->cat_image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$row->id.\"',\n `warehouse` = '\".$row->warehouse.\"',\n `product` = '\".$row->product.\"',\n `quantity` = '\".$row->quantity.\"',\n `min_capacity` = '\".$row->min_capacity.\"',\n `max_capacity` = '\".$row->max_capacity.\"',\n `avail_qty` = '\".$row->avail_qty.\"',\n `created_at` = '\".$row->created_at.\"',\n `updated_at` = '\".$row->updated_at.\"',\n `productid` = '\".$row->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$row->productname).\"',\n `productimage` = '\".$row->productimage.\"',\n `product_price` = '\".$row->product_price.\"',\n `product_tax` = '\".$row->product_tax.\"',\n `product_description` = '\".$row->product_description.\"',\n `productuniqueid_forimages` = '\".$row->productuniqueid_forimages.\"',\n `cat_name` = '\".$row->cat_name.\"',\n `cat_image` = '\".$row->cat_image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$row->category_id.\"',\n `subcat_name` = '\".$row->subcat_name.\"',\n `subcategory_id` = '\".$row->subcategory_id.\"',\n `subcat_image` = '\".$row->subcat_image.\"',\n `parent_id` = '\".$row->parent_id.\"',\n `shared_category` = '\".$row->shared_category.\"';\";\n \n $this->db->query($query);\n \n }\n \n foreach($sharedproducts as $shared_product){ // for one shared product\n $sharedcategory_array= array();\n $sharedcategory_array=explode(\",\",$shared_product->shared_category);\n // print_r($shared_product);\n foreach($sharedcategory_array as $oneshared_category){\n if($oneshared_category !=$shared_product->category_id){ // if the shared category id item is not same with table id(current setted category id)\n // echo $oneshared_category;\n \n $selected_category_objectarray_from_categorytable = $this->db->where('category_id', $oneshared_category)->get('category')->result();\n \n if(sizeof($selected_category_objectarray_from_categorytable)>0){ // if the shared category is not deleted from category table\n $selected_category_object_from_categorytable=$selected_category_objectarray_from_categorytable[0];\n \n $categoryimage=$selected_category_object_from_categorytable->image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$shared_product->id.\"',\n `warehouse` = '\".$shared_product->warehouse.\"',\n `product` = '\".$shared_product->product.\"',\n `quantity` = '\".$shared_product->quantity.\"',\n `min_capacity` = '\".$shared_product->min_capacity.\"',\n `max_capacity` = '\".$shared_product->max_capacity.\"',\n `avail_qty` = '\".$shared_product->avail_qty.\"',\n `created_at` = '\".$shared_product->created_at.\"',\n `updated_at` = '\".$shared_product->updated_at.\"',\n `productid` = '\".$shared_product->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$shared_product->productname).\"',\n `productimage` = '\".$shared_product->productimage.\"',\n `product_price` = '\".$shared_product->product_price.\"',\n `product_tax` = '\".$shared_product->product_tax.\"',\n `product_description` = '\".$shared_product->product_description.\"',\n `productuniqueid_forimages` = '\".$shared_product->productuniqueid_forimages.\"',\n `cat_name` = '\".$selected_category_object_from_categorytable->name.\"',\n `cat_image` = '\".$selected_category_object_from_categorytable->image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$selected_category_object_from_categorytable->category_id.\"',\n `subcat_name` = '\".$shared_product->subcat_name.\"',\n `subcategory_id` = '\".$shared_product->subcategory_id.\"',\n `subcat_image` = '\".$shared_product->subcat_image.\"',\n `parent_id` = '\".$shared_product->parent_id.\"',\n `shared_category` = '\".$shared_product->shared_category.\"';\";\n \n $this->db->query($query);\n \n \n }\n }\n }\n } \n \n } \n \n \n $result = $this->db->query(\"SELECT * FROM `tb_filteredproducts` ORDER BY cat_name, subcat_name\")->result();\n return $result;\n }",
"public function products()\n {\n return $this->morphedByMany(Product::class, 'categorables');\n }",
"protected function getData()\n {\n\n $file_prod_path = $_SERVER['DOCUMENT_ROOT'] . '/web/products.xml';\n $file_cat_path = $_SERVER['DOCUMENT_ROOT'] . '/web/categories.xml';\n\n if(!file_exists($file_cat_path)){\n return \"File \" . $file_cat_path . \" not found\";\n }\n $xml_cat = json_decode(json_encode(simplexml_load_string(file_get_contents($file_cat_path))),true)['item'];\n\n if(!file_exists($file_prod_path)){\n return \"File\" . $file_prod_path . \"not found\";\n }\n $xml_prod = json_decode(json_encode(simplexml_load_string(file_get_contents($file_prod_path))),true)['item'];\n $result = $xml_prod;\n foreach($xml_prod as $key => $value){\n $result[$key]['name'] = $xml_cat[array_search($value['categoryId'], array_column($xml_cat, 'id'))]['name'];\n }\n\n\n if ($this->_filtered) {\n $result = array_filter($result, function ($value) {\n $conditions = [true];\n if (!empty($this->id)) {\n $conditions[] = strpos($value['id'], $this->id) !== false;\n }\n if (!empty($this->price)) {\n $conditions[] = strpos($value['price'], $this->price) !== false;\n }\n if (!empty($this->hidden)) {\n $conditions[] = strpos($value['hidden'], $this->hidden) !== false;\n }\n if (!empty($this->name)) {\n $conditions[] = strpos($value['name'], $this->name) !== false;\n }\n return array_product($conditions);\n });\n }\n\n return $result;\n }",
"function get_sale_product_list($type, $category_id)\n\t{\n\t\tif ($type == 'category')\n\t\t\t$products = $this->db->get_where('product', array(\n\t\t\t\t'category_id' => $category_id\n\t\t\t))->result_array();\n\t\tif ($type == 'sub_category')\n\t\t\t$products = $this->db->get_where('product', array(\n\t\t\t\t'sub_category_id' => $category_id\n\t\t\t))->result_array();\n\t\tforeach ($products as $row) {\n\t\t\techo '<p onclick=\"add_product(' . $row['product_id'] . ')\" style=\"cursor: pointer;\">\n\t\t\t\t\t<span class=\"fa-stack fa-2x text-success\">\n\t\t\t\t\t\t<i class=\"fa fa-circle-o fa-stack-2x\"></i>\n\t\t\t\t\t\t<i class=\"fa fa-plus fa-stack-1x\"></i>\n\t\t\t\t\t</span>' . $row['name'] . '' . ' '. '(' . $row['stock_quantity'] . ')\n\t\t\t\t</p>';\n\t\t}\n\t}",
"public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }",
"function get_category_productdata($conditions_array=array(),$rows_per_page=10,$start=0)\n\t{\n\t\t$rows=array();\n\t\t$this->db->from('red_support_category as rsc');\n\t\t$this->db->join('red_support_product as rsp','rsc.id=rsp.category_id');\n\t\t$this->db->where($conditions_array);\n\t\t$result=$this->db->get();\n\t\tforeach($result->result_array() as $row)\n\t\t{\n\t\t\t$rows[]=$row;\n\t\t}\n\t\treturn $rows;\n\t\n\t}",
"public static function loadProductsByCatId($p_catId)\n {\n $ret = array();\n\n $sql = \"select * from products where CatID = $p_catId\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n //$catId = $row[\"CatID\"];\n $catId = $p_catId;\n $classify = $row[\"Classify\"];\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n array_push($ret, $p);\n }\n\n return $ret;\n }",
"public function getCategories() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE parent is null ORDER BY name ASC\");\n $stmt->setFetchMode(\\PDO::FETCH_CLASS, '\\App\\Model\\Category\\ProductCategoryModel');\n $stmt->execute();\n return $stmt->fetchAll();\n }",
"function getProducts()\n\t{\n\t\tglobal $con;\n\t\tif (!isset($_GET['cat'])){\n\t\t\tif (!isset($_GET['brand'])) {\n\t\t\t\t$get_products = \"select * from products order by RAND() LIMIT 0, 6\";\n\t\t\t\t$run_products = mysqli_query($con, $get_products);\n\n\t\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\t\techo \"\n\t\t\t\t\t<div class='single_product'>\n\t\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t\t<div class='item_det'>\n\t\t\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function filter($_search, $_category, $_sort){\n\t\tinclude('mysql_r_db_connect.php');\n\t\t\n\t\t//Create dynamically OREDER BY\n\t\tswitch ($_sort){\n\t\t\tcase 1:\n\t\t\t\t$_sort = 'ORDER BY fldIdProduct DESC';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$_sort = 'ORDER BY fldPrice ASC';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$_sort = 'ORDER BY fldPrice DESC';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$_search = '%' . $_search . '%';\n\t\t\n\t\t//Check if such product exists \n\t\t$sql = \"SELECT COUNT(fldIdProduct) FROM tblProducts WHERE fldProduct LIKE '$_search'\";\n\t\t$quantity = $handle -> prepare($sql);\n\t\t$quantity->execute();\n\t\t$row = $quantity->fetchColumn();\n\t\t\n\t\tif ($row != 0){\n\t\t\t\n\t\t\t//Check if to search in specific category or in all\n\t\t\t$sql = \"SELECT COUNT(fldIdCategory) FROM tblCategorys WHERE fldCategoryShort LIKE '$_category'\";\n\t\t\t$quantity = $handle -> prepare($sql);\n\t\t\t$quantity->execute();\n\t\t\t$row = $quantity->fetchColumn();\n\t\t\t\n\t\t\tif ($row == 0){\n\t\t\t\n\t\t\t\t//SQL query to show the wanted Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldPrice, fldImage FROM tblProducts WHERE fldProduct LIKE '$_search' AND fldEnabled <> false $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\techo '\n\t\t\t\t\t\t<!-- Begin of product content-->\n\t\t\t\t\t\t<div class=\"col m6\">\n\t\t\t\t\t\t\t<!-- Beginn of product-->\n\t\t\t\t\t\t\t<div class=\"card\">\n\t\t\t\t\t\t\t\t<div class=\"card-image\">\n\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\">\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<a class=\"btn-floating halfway-fab waves-effect waves-light red modal-trigger\" href=\"#' . $row->fldIdProduct . '\"><i class=\"material-icons\">add</i></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"card-content center\">\n\t\t\t\t\t\t\t\t\t<p>' . $row->fldProduct . '</p>\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldPrice . ' CHF</h4>\n\t\t\t\t\t\t\t\t\t<br/>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//SQL query to get FK of Tag\n\t\t\t\t\t\t\t\t\t$sql_fk_tag = \"SELECT fldFkTag FROM tblProductsToTags WHERE fldFkProduct LIKE '$row->fldIdProduct'\";\n\t\t\t\t\t\t\t\t\t$stmt_fk_tag = $handle->query($sql_fk_tag);\n\t\t\t\t\t\t\t\t\twhile($row_fk_tag = $stmt_fk_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//SQL query to get Tag\n\t\t\t\t\t\t\t\t\t\t$sql_tag = \"SELECT fldTag FROM tblTags WHERE fldIdTag LIKE '$row_fk_tag->fldFkTag'\";\n\t\t\t\t\t\t\t\t\t\t$stmt_tag = $handle->query($sql_tag);\n\t\t\t\t\t\t\t\t\t\twhile($row_tag = $stmt_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"chip\"><a href=\"filter.php?search='.$row_tag->fldTag.'&category=All&sort=1&start_search=Suchen\">' . $row_tag->fldTag . '</a></div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of product-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of product content-->\n\t\t\t\t\t';\n\t\t\t\t}\t\n\t\t\t\techo '\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t';\n\t\t\t\t\n\t\t\t//SQL query to create modal for shown Products\n\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldDescription, fldPrice, fldImage, fldFkSoldBy FROM tblProducts WHERE fldProduct LIKE '$_search' AND fldEnabled <> false $_sort\";\n\t\t\t$stmt = $handle->query($sql);\n\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t//SQL query to get seller\n\t\t\t\t$sql_seller = \"SELECT fldUsername FROM tblUsers WHERE fldIdUser LIKE '$row->fldFkSoldBy'\";\n\t\t\t\t$stmt_seller = $handle->query($sql_seller);\n\t\t\t\twhile($row_seller = $stmt_seller->fetchObject()){\n\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\techo '\n\t\t\t\t\t\t<div id=\"' . $row->fldIdProduct . '\" class=\"modal\">\n\t\t\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t\t\t\t<h4>' . $row->fldProduct . '</h4>\n\t\t\t\t\t\t\t\t<div class=\"clearfix float-my-children\">\n\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\" class=\"imagepadding\">\n\t\t\t\t\t\t\t\t\t<!-- Modal details container-->\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<p class=\"DescTitle\">Produkt Beschreibung:</p>\n\t\t\t\t\t\t\t\t\t\t<p class=\"Description\">' . $row->fldDescription . '</p>\n\t\t\t\t\t\t\t\t\t\t<p class=\"DescPrice\">\n\t\t\t\t\t\t\t\t\t\tPreis: ' . $row->fldPrice . ' CHF\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<!-- Buy informations button/link-->\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"buy.php?product=' . $row->fldIdProduct . '\" class=\"waves-effect waves-light btn\">Jetzt Kaufen</a>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescVerkaufer\">Verkaufer: <a href=\"userprof.php?user=' . $row->fldFkSoldBy . '\">' . $row_seller->fldUsername . '</a></p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- End of buy informations-->\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- End of details container-->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<!-- Modal bottom button-->\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t\t\t<a class=\"modal-action modal-close waves-effect waves-teal lighten-2 btn-flat\">Schliessen</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of bottom button-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of modal-->\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//Search for entries in specific category\n\t\t\t\t$sql_cat = \"SELECT fldIdCategory FROM tblCategorys WHERE fldCategoryShort LIKE '$_category'\";\n\t\t\t\t$stmt_cat = $handle->query($sql_cat);\n\t\t\t\t$row_cat = $stmt_cat->fetchObject();\n\t\t\t\t\n\t\t\t\t//SQL query to show wanted Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldPrice, fldImage FROM tblProducts WHERE fldProduct LIKE '$_search' AND fldFkCategory LIKE '$row_cat->fldIdCategory' AND fldEnabled <> false $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\techo '\n\t\t\t\t\t\t<!-- Begin of product content-->\n\t\t\t\t\t\t<div class=\"col m6\">\n\t\t\t\t\t\t\t<!-- Beginn of product-->\n\t\t\t\t\t\t\t<div class=\"card\">\n\t\t\t\t\t\t\t\t<div class=\"card-image\">\n\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\">\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<a class=\"btn-floating halfway-fab waves-effect waves-light red modal-trigger\" href=\"#' . $row->fldIdProduct . '\"><i class=\"material-icons\">add</i></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"card-content center\">\n\t\t\t\t\t\t\t\t\t<p>' . $row->fldProduct . '</p>\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldPrice . ' CHF</h4>\n\t\t\t\t\t\t\t\t\t<br/>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//SQL query to get FK of Tag\n\t\t\t\t\t\t\t\t\t$sql_fk_tag = \"SELECT fldFkTag FROM tblProductsToTags WHERE fldFkProduct LIKE '$row->fldIdProduct'\";\n\t\t\t\t\t\t\t\t\t$stmt_fk_tag = $handle->query($sql_fk_tag);\n\t\t\t\t\t\t\t\t\twhile($row_fk_tag = $stmt_fk_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//SQL query to get Tag\n\t\t\t\t\t\t\t\t\t\t$sql_tag = \"SELECT fldTag FROM tblTags WHERE fldIdTag LIKE '$row_fk_tag->fldFkTag'\";\n\t\t\t\t\t\t\t\t\t\t$stmt_tag = $handle->query($sql_tag);\n\t\t\t\t\t\t\t\t\t\twhile($row_tag = $stmt_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"chip\"><a href=\"filter.php?search='.$row_tag->fldTag.'&category=All&sort=1&start_search=Suchen\">' . $row_tag->fldTag . '</a></div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of product-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of product content-->\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo '\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t';\t\n\t\t\t\t//SQL query to create modal for shown Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldDescription, fldPrice, fldImage, fldFkSoldBy FROM tblProducts WHERE fldProduct LIKE '$_search' $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//SQL query to get seller\n\t\t\t\t\t$sql_seller = \"SELECT fldUsername FROM tblUsers WHERE fldIdUser LIKE '$row->fldFkSoldBy'\";\n\t\t\t\t\t$stmt_seller = $handle->query($sql_seller);\n\t\t\t\t\twhile($row_seller = $stmt_seller->fetchObject()){\n\t\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\t\techo '\n\t\t\t\t\t\t\t<div id=\"' . $row->fldIdProduct . '\" class=\"modal\">\n\t\t\t\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldProduct . '</h4>\n\t\t\t\t\t\t\t\t\t<div class=\"clearfix float-my-children\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\" class=\"imagepadding\">\n\t\t\t\t\t\t\t\t\t\t<!-- Modal details container-->\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescTitle\">Produkt Beschreibung:</p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"Description\">' . $row->fldDescription . '</p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescPrice\">\n\t\t\t\t\t\t\t\t\t\t\tPreis: ' . $row->fldPrice . ' CHF\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<!-- Buy informations button/link-->\n\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"buy.php?product=' . $row->fldIdProduct . '\" class=\"waves-effect waves-light btn\">Jetzt Kaufen</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescVerkaufer\">Verkaufer: <a href=\"userprof.php?user=' . $row->fldFkSoldBy . '\">' . $row_seller->fldUsername . '</a></p>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<!-- End of buy informations-->\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- End of details container-->\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- Modal bottom button-->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t\t\t\t<a class=\"modal-action modal-close waves-effect waves-teal lighten-2 btn-flat\">Schliessen</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<!-- End of bottom button-->\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of modal-->\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\t\telse{\n\t\t\t//Search for tags with the same words like the user input\n\t\t\t$sql = \"SELECT COUNT(fldIdTag) FROM tblTags WHERE fldTag LIKE '$_search'\";\n\t\t\t$quantity = $handle -> prepare($sql);\n\t\t\t$quantity->execute();\n\t\t\t$row = $quantity->fetchColumn();\n\t\t\t\n\t\t\tif ($row != 0){\n\t\t\t\t//Get ID of Tag\n\t\t\t\t$sql_tag = \"SELECT fldIdTag FROM tblTags WHERE fldTag LIKE '$_search'\";\n\t\t\t\t$stmt_tag = $handle->query($sql_tag);\n\t\t\t\t$row_tag = $stmt_tag->fetchObject();\t\n\t\t\t\t\n\t\t\t\t//Get FK of Tag from in between table\n\t\t\t\t$sql_pro = \"SELECT fldFkProduct FROM tblProductsToTags WHERE fldFkTag LIKE '$row_tag->fldIdTag'\";\n\t\t\t\t$stmt_pro = $handle->query($sql_pro);\n\t\t\t\t$row_pro = $stmt_pro->fetchObject();\n\t\t\t\t\n\t\t\t\t//SQL query to show the wanted Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldPrice, fldImage FROM tblProducts WHERE fldIdProduct LIKE '$row_pro->fldFkProduct' $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\techo '\n\t\t\t\t\t\t<!-- Begin of product content-->\n\t\t\t\t\t\t<div class=\"col m6\">\n\t\t\t\t\t\t\t<!-- Beginn of product-->\n\t\t\t\t\t\t\t<div class=\"card\">\n\t\t\t\t\t\t\t\t<div class=\"card-image\">\n\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\">\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<a class=\"btn-floating halfway-fab waves-effect waves-light red modal-trigger\" href=\"#' . $row->fldIdProduct . '\"><i class=\"material-icons\">add</i></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"card-content center\">\n\t\t\t\t\t\t\t\t\t<p>' . $row->fldProduct . '</p>\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldPrice . ' CHF</h4>\n\t\t\t\t\t\t\t\t\t<br/>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//SQL query to get FK of Tag\n\t\t\t\t\t\t\t\t\t$sql_fk_tag = \"SELECT fldFkTag FROM tblProductsToTags WHERE fldFkProduct LIKE '$row->fldIdProduct'\";\n\t\t\t\t\t\t\t\t\t$stmt_fk_tag = $handle->query($sql_fk_tag);\n\t\t\t\t\t\t\t\t\twhile($row_fk_tag = $stmt_fk_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//SQL query to get Tag\n\t\t\t\t\t\t\t\t\t\t$sql_tag = \"SELECT fldTag FROM tblTags WHERE fldIdTag LIKE '$row_fk_tag->fldFkTag'\";\n\t\t\t\t\t\t\t\t\t\t$stmt_tag = $handle->query($sql_tag);\n\t\t\t\t\t\t\t\t\t\twhile($row_tag = $stmt_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"chip\"><a href=\"filter.php?search='.$row_tag->fldTag.'&category=All&sort=1&start_search=Suchen\">' . $row_tag->fldTag . '</a></div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of product-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of product content-->\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//SQL query to create modal for shown Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldDescription, fldPrice, fldImage, fldFkSoldBy FROM tblProducts WHERE fldIdProduct LIKE '$row_pro->fldFkProduct' $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//SQL query to get seller\n\t\t\t\t\t$sql_seller = \"SELECT fldUsername FROM tblUsers WHERE fldIdUser LIKE '$row->fldFkSoldBy'\";\n\t\t\t\t\t$stmt_seller = $handle->query($sql_seller);\n\t\t\t\t\twhile($row_seller = $stmt_seller->fetchObject()){\n\t\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\t\techo '\n\t\t\t\t\t\t\t<div id=\"' . $row->fldIdProduct . '\" class=\"modal\">\n\t\t\t\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldProduct . '</h4>\n\t\t\t\t\t\t\t\t\t<div class=\"clearfix float-my-children\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\" class=\"imagepadding\">\n\t\t\t\t\t\t\t\t\t\t<!-- Modal details container-->\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescTitle\">Produkt Beschreibung:</p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"Description\">' . $row->fldDescription . '</p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescPrice\">\n\t\t\t\t\t\t\t\t\t\t\tPreis: ' . $row->fldPrice . ' CHF\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<!-- Buy informations button/link-->\n\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"buy.php?product=' . $row->fldIdProduct . '\" class=\"waves-effect waves-light btn\">Jetzt Kaufen</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescVerkaufer\">Verkaufer: <a href=\"userprof.php?user=' . $row->fldFkSoldBy . '\">' . $row_seller->fldUsername . '</a></p>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<!-- End of buy informations-->\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- End of details container-->\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- Modal bottom button-->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t\t\t\t<a class=\"modal-action modal-close waves-effect waves-teal lighten-2 btn-flat\">Schliessen</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<!-- End of bottom button-->\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of modal-->\n\t\t\t\t\t\t';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo '</div></div>';\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\techo 'Es tut uns leid, aber es konnten keine Produkte mit diesen Suchkriterien gefunden werden</div></div>';\n\t\t\t}\n\t\t}\n\t}",
"public function GetAllProducts(){\t\n\t \n\t try{\n\t\t $conn = DBConnection::GetConnection();\t\n\t\t $myquery= \"SELECT product_id,product_name,unit_price,image_name,description,category,quantity_in_stock FROM product\";\n\t\t $result= $conn->query($myquery);\n\t\t $products=array();\n\t\t foreach($result as $item)\n\t\t {\n\t\t\t $p1= new Product();\n\t\t\t $p1->productCode =$item[\"product_id\"];\n\t\t\t $p1->productName =$item[\"product_name\"];\n\t\t\t $p1->price =$item[\"unit_price\"];\n\t\t\t $p1->imageName=$item[\"image_name\"];\t\t\t \n\t\t\t $p1->description =$item[\"description\"];\n\t\t\t $p1->cate=$item[\"category\"];\n\t\t\t $p1->qty=$item[\"quantity_in_stock\"];\n\t\t\t array_push($products,$p1);\t\t\t \t\t\t \n\t\t }\n\t\t $conn =null;//To close the connection \n\t\t return $products;\n\t }catch(PDOException $e){\n\t\t echo 'Fail to connect';\n\t\t echo $e->getMessage();\n\t }\t\n\t\t \n }",
"public function getALL()\n {\n // Sentencia SQL\n $sql = \"SELECT categorias.nombre AS 'NombreDeLaCategoria', productos.* FROM productos INNER JOIN categorias ON categorias.id = productos.categoria_id ORDER BY stock ASC\";\n $productos = $this->conexion->query($sql);\n\n // Retorno el resultado a \"productosControlles.php\" al metodo \"gestion()\"\n return $productos;\n }",
"private function getCategoryNames()\n {\n $categoryData = array();\n $this->_connection = $this->_resourceConnection->getConnection();\n $table = $this->_connection->getTableName('catalog_category_entity_varchar');\n $query = \"\n SELECT *\n FROM `{$table}`\n WHERE attribute_id = '{$this->nameAttributeId}'\n \";\n\n $result = $this->_connection->fetchAll($query);\n\n if (count($result) > 0) {\n foreach ($result as $category) {\n if (isset($category['entity_id'])) {\n $categoryData[$category['entity_id']][$category['store_id']] = $category['value'];\n } else {\n $categoryData[$category['row_id']][$category['store_id']] = $category['value'];\n }\n }\n }\n\n return $categoryData;\n }",
"private function getCategoryProductsListContent($productIds)\n {\n $blocksArray = array('\\'COD\\'', '\\'EMI\\'', '\\'Video\\'', '\\'ProductHighlightFeatures\\'');\n $productIds = explode(',', $productIds);\n $features_by_categories = array();\n\n $query = 'SELECT DISTINCT cf.category_id, c.name FROM ' . _DB_PREFIX_ . '_fc_categories_features cf\n\t\tLEFT JOIN ' . _DB_PREFIX_ . '_fc_categories c ON (c.category_id = cf.category_id)\n\t\tWHERE cf.feature_id IN\n\t\t(SELECT id_feature FROM ' . _DB_PREFIX_ . 'feature_product WHERE 0';\n foreach ($productIds as $product_id) {\n if ($product_id != '')\n $query .= ' OR id_product=' . $product_id;\n }\n $query .= ') and c.name in (' . implode(',', $blocksArray) . ') ORDER BY c.priority';\n $product_feature_categories = Db::getInstance()->ExecuteS($query);\n foreach ($product_feature_categories as $pfc) {\n $feature_ids = array();\n $raw_features = Db::getInstance()->ExecuteS('SELECT cf.feature_id FROM ' . _DB_PREFIX_ . '_fc_categories_features cf LEFT JOIN ' . _DB_PREFIX_ . 'feature f ON(f.id_feature = cf.feature_id) WHERE cf.category_id=' . $pfc['category_id'] . ' ORDER BY f.position');\n foreach ($raw_features as $fid) {\n $feature_ids[] = $fid['feature_id'];\n $distributed_features[] = $fid['feature_id'];\n }\n $features_by_categories[$pfc['name']] = $feature_ids;\n }\n\n $helper = new Helper();\n\n $productsWithStatus = array();\n foreach ($productIds as $id) {\n foreach ($features_by_categories as $key => $value) {\n $itemVal = $helper->getFeatureVal($id, $value[0]);\n if ($helper->checkItemStateEnable($itemVal)) {\n $productsWithStatus[$id][$key]['status'] = 'Yes';\n $productsWithStatus[$id][$key]['description'] = $helper->getFeatureVal($id, $value[1]);\n } else {\n $productsWithStatus[$id][$key] = 'No';\n }\n\n }\n $productsWithStatus[$id]['rating'] = $this->getProductRatingForProduct(0, 0);\n }\n\n $ratingArray = $this->getProductRatingAndReviews($productIds);\n foreach ($ratingArray as $ratingRow) {\n $productsWithStatus[$ratingRow['id_product']]['rating'] = $this->getProductRatingForProduct($ratingRow['grade'], $ratingRow['total']);\n }\n\n echo json_encode($productsWithStatus);\n exit;\n\n }",
"public function product_list()\n\t{\n\t\t$query=$this->db->select('\n\t\t\t\t\ta.product_id,a.product_name,a.price,a.image_thumb,a.variants,a.product_model,\n\t\t\t\t\tc.category_name,c.category_id\n\t\t\t\t')\n\n\t\t\t\t->from('product_information a')\n\t\t\t\t->join('product_category c','c.category_id = a.category_id','left')\n\t\t\t\t->group_by('a.product_id')\n\t\t\t\t->order_by('a.product_name','asc')\n\t\t\t\t->get();\n\n\t\tif ($query->num_rows() > 0) {\n\t\t \treturn $query->result();\t\n\t\t}\n\t\treturn false;\n\t}",
"public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }",
"function getproduct($catid,$tag){\t\n\t\t$sql = 'SELECT `a`.`id`,`a`.`name`,`a`.`tag` FROM `'.DB_TABLE_PREFIX.'product` as `a` INNER JOIN `'.DB_TABLE_PREFIX.'catproductproduct` as `b` ON `a`.`id`=`b`.`productid` WHERE `b`.`catproductid`='.$catid;\t\t\n\t\tif($tag!=NULL){\n\t\t\t$sql.=' AND `a`.`tag` LIKE \"%'.$tag.'%\"';\t\t\t\n\t\t}\n\t\t_trace($sql);\n\t\treturn mysql_query($sql);\t\t\n\t}",
"public function getProductCollectionFromCategoryBottom() {\n $categoryId = $this->getCurrentcat();\n $not_in_array_left = $this->getProductCollectionFromFourRow();\n $not_in_array_right = $this->getProductCollectionFromThreeRow();\n $not_in_array_parent = $this->getProductId();\n $custom_array = array(2202,2354,2161);\n $not_in_array = array_merge($not_in_array_left, $not_in_array_right,$not_in_array_parent,$custom_array);\n $category = $this->categoryFactory->create()->load($categoryId);\n\t $collection = $category->getProductCollection()->addAttributeToSelect('*')\n\t ->addAttributeToFilter('type_id', array('eq' => 'grouped'))\n ->addAttributeToFilter('status',\\Magento\\Catalog\\Model\\Product\\Attribute\\Source\\Status::STATUS_ENABLED)->setPageSize(20)\n ->addAttributeToFilter('entity_id', array('nin' => $not_in_array));\n return $collection;\n \n \t}",
"function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\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 {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\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\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}",
"protected function _getProductList($filterId, $catId){\n $products = Product::when(count($filterId['categories']) > 0, function ($query) use ($filterId) {\n $subcats = ProductCategory::whereIn('parent_id', $filterId['categories'])->pluck('id')->toArray();\n $subcatsLast = ProductCategory::whereIn('parent_id', $subcats)->pluck('id')->toArray();\n $cats = array_merge($subcats, $filterId['categories'], $subcatsLast);\n return $query->whereIn('category_id', array_filter($cats));\n })\n ->when(count($filterId['categories']) == 0, function ($query) use ($catId) {\n $subcats = ProductCategory::where('parent_id', $catId)->pluck('id')->toArray();\n $subcatsLast = ProductCategory::whereIn('parent_id', $subcats)->pluck('id')->toArray();\n $cats = array_merge($subcats, $subcatsLast, [$catId]);\n return $query->whereIn('category_id', array_filter($cats));\n })\n ->when(count($filterId['price']) > 0, function ($query) use ($filterId) {\n return $query->where('actual_price_lei', '>=', $filterId['price']['from'])->where('actual_price_lei', '<=', $filterId['price']['to']);\n })\n ->when(count($filterId['limit']) > 0, function ($query) use ($filterId) {\n return $query->limit($filterId['limit']);\n })\n ->get();\n\n return $products;\n }"
]
| [
"0.7047488",
"0.6883571",
"0.6830387",
"0.67263037",
"0.6629556",
"0.6627547",
"0.65939057",
"0.6591993",
"0.6579677",
"0.65424323",
"0.6495643",
"0.6424791",
"0.64035183",
"0.63655186",
"0.6350539",
"0.63497674",
"0.63055074",
"0.6300835",
"0.629449",
"0.6177622",
"0.6177299",
"0.6163822",
"0.6145315",
"0.6144439",
"0.61234945",
"0.61144143",
"0.60682607",
"0.60677004",
"0.606165",
"0.60460985",
"0.60323673",
"0.6028693",
"0.6020464",
"0.60160697",
"0.6015586",
"0.6010833",
"0.5992604",
"0.59904647",
"0.5981876",
"0.59782434",
"0.5962263",
"0.59590125",
"0.59313893",
"0.5917706",
"0.5906397",
"0.5894185",
"0.5881137",
"0.587921",
"0.58553845",
"0.5849361",
"0.58470875",
"0.58457524",
"0.5842108",
"0.58323365",
"0.58311427",
"0.58308524",
"0.5830163",
"0.5828763",
"0.5825245",
"0.5819787",
"0.5817307",
"0.5815888",
"0.58118254",
"0.5811242",
"0.5803503",
"0.5802826",
"0.5793175",
"0.5779652",
"0.5770975",
"0.57706946",
"0.5762267",
"0.5758939",
"0.57522345",
"0.5751",
"0.5749148",
"0.57432586",
"0.57429254",
"0.57354116",
"0.5734402",
"0.57275075",
"0.57115",
"0.57081294",
"0.57003206",
"0.5700309",
"0.56905884",
"0.5685392",
"0.5682424",
"0.567974",
"0.56787485",
"0.5675626",
"0.56697404",
"0.5668049",
"0.5660438",
"0.56596243",
"0.56569976",
"0.5654739",
"0.5646148",
"0.5643841",
"0.5642711",
"0.5642074"
]
| 0.6718329 | 4 |
turns a single dimension array into a string with a comma between each element | function arrayToSQLString ($arr) {
$sql = "";
foreach ($arr as $key => $value) {
$sql = $sql . $value . ',';
}
$sql = rtrim($sql,',');
return $sql;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function array_tostring($array){\n\t$string = '';\n\tforeach($array as $value){\n\t\tif ($string != ''){\n\t\t\t$string .= ',';\n\t\t}\n\t\t$string .= $value;\n\t}\n\treturn $string;\n}",
"function convertArrayIntoString($array) {\n foreach ($array as $value)\n $string .= \"'$value,'\";\n $string = trim($string, ',');\n return $string;\n}",
"function arrayToString($array) {\n\t\t$array_temp = array();\n\t\tfor($x=0;$x<sizeof($array);$x++) {\n\t\t\t$array_temp[$x] = \"'\".$array[$x].\"'\";\n\t\t}\n\t\t$string = \"(\".implode(\",\", $array_temp).\")\";\n\t\treturn $string;\n\t}",
"function arraytostring($array){\r\n\t$text = \"array(\";\r\n\t$x = 0;\r\n\t$count = count($array);\r\n\tforeach ($array as $key => $value) {\r\n\t\t$x++;\r\n\t\tif (is_array($value)) {\r\n\t\t\t$text .= $key.\"=>\".arraytostring($value);\r\n\t\t\tif ($count != $x) $text .= \",\";\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$text .= \"\\\"$key\\\"=>\\\"$value\\\"\";\r\n\t\tif ($count != $x) $text .= \",\";\r\n\t}\r\n\t$text .= \")\";\r\n\treturn $text;\r\n}",
"function arrayToString($array)\n\t{\n\t\t$string = \"\";\n\t\tforeach($array as $row)\n\t\t{\n\t\t\tif(gettype($row) == \"array\")\n\t\t\t{\n\t\t\t\t$string .= arrayToString($row);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$string .= $row.\" \";\n\t\t\t}\n\t\t}\n\t\treturn $string;\n\t}",
"public function arraytostring($array,$delimitatore=','){\n\t\treturn implode($delimitatore,$array);\n\t}",
"protected function implodeArray($arr) {\n $retStr = '';\n foreach($arr as $key => $value) {\n $retStr .= $key . ': ' . $value . ', ';\n }\n rtrim($retStr, ', ');\n return $retStr;\n }",
"function array_to_string($array)\n{\n $str = '';\n if($array)\n foreach($array as $word) {\n $str .= $seporator . addslashes($word);\n $seporator = ',';\n }\n return $str;\n}",
"public static function arrayToCsv(array $data): string {\n return count($data) > 0 ? implode(',', $data) : '';\n }",
"function printArray($array){\n // will accept arrays of values or arrays of arrays\n\n $c = \"\"; // for the comma :)\n $o = \"\"; // the output\n\n foreach($array as $item){\n if (is_array($item)){\n $o .= $c . printArray($item);\n }\n else{\n $o .= $c . $item;\n }\n $c = ',';\n }\n \n $o = \"[\" . $o . \"]\";\n\n return $o;\n}",
"function array_to_string($array){\n $joined_string=\"\";\n for($count=0;$count<count($array);$count++){\n \n if($count!=count($array)-1){\n $joined_string.= $array[$count].'|';\n }\n else{\n $joined_string.=$array[$count];\n }\n }\n return $joined_string;\n }",
"Function ArrayToString($array){\n\t\t$array=array_values($array);\n\t\t$String=null;\n\t\t\n\t\tfor($x=0;$x<sizeof($array);$x++){\t\t\t\n\t\t\tif(Strlen($array[$x])>0){\n\t\t\t\tif(Strlen($String)>0){\n\t\t\t\t\t$String=$String.','.$array[$x];\n\t\t\t\t}else{\n\t\t\t\t $String=$array[$x];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t return $String;\n\t}",
"private function arrayToString($array){\n\t\t$i = 0;\n\t\t$string = '';\n\t\tforeach ($array as $value) {\n\t\t\tif ($i > 0) $string .= ', ';\n\t\t\tif (preg_match('#', $value)){\n\t\t\t\t$string .= str_replace('#', '', $value);\n\t\t\t}else{\n\t\t\t\t$string .= \"'\".$value.\"'\";\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn $string;\n\t}",
"function array2csv(array $array) {\n\t$lines = array();\n\tforeach ( $array as $val ) {\n\t\t$lines[] = is_array($val) ? array2csv($val) : '\"' . str_replace('\"', '\"\"', $val) . '\"';\n\t}\n\treturn implode(\",\", $lines);\n}",
"public static function __arrayToString(array $arr)\n\t{\n\t\t$str = '';\n\n\t\tforeach($arr as $k => $v)\n\t\t{\n\t\t\t$str .= $k . ':';\n\n\t\t\tif(is_string($v))\n\t\t\t{\n\t\t\t\t$str .= $v . ', ';\n\t\t\t}\n\t\t\telse if(is_array($v))\n\t\t\t{\n\t\t\t\t$str .= '[' . self::__arrayToString($v) . '], ';\n\t\t\t}\n\t\t}\n\n\t\t$str = rtrim($str, ', ');\n\n\t\treturn $str;\n\t}",
"protected function formatArray(array $values){\n $r = ''; foreach($values as $val) $r.= (empty($r)?'':',').$val;\n return $r;\n }",
"protected function array_to_string($array) \n\t{\n\t\t$str = '';\n\t\tforeach ($array as $item) {\n\t\t\t$str .= $item . '\\n';\n\t\t}\n\n\t\treturn $str;\n\t}",
"function arg_array_to_str($arg_array){\r\n \r\n $arg_str = '';\r\n \r\n foreach($arg_array as $arg)\r\n {\r\n $arg_str .= \"$arg,\";\r\n }\r\n \r\n \r\n \r\n return substr($arg_str,0,-1); //eg 'x,y,z' -- substr() cuts off the trailing comma\r\n }",
"private function ArrayToString ($array)\n {\n $str = null;\n if (is_array($array))\n foreach ($array as $valore) {\n if(is_string($valore))\n $str = $str.\"-\".$valore;\n else{$str=$str.\"\\n\".$valore->__toString();}\n }\n else\n $str = $array;\n return $str;\n }",
"public static function stringifyArray(array $array);",
"private function arrayToString($array)\r\n {\r\n return var_export($array, true);\r\n }",
"public static function arrayToString($s)\n {\n return implode(', ', $s);\n }",
"public function array_to_string($array)\n {\n $string = \"\";\n for ($i=0; $i < count($array); $i++) {\n if ($i < count($array) - 1) {\n $string .= '\"'.$array[$i].'\",';\n } else {\n $string .= '\"'.$array[$i].'\"';\n }\n }\n\n return $string;\n }",
"function array_implode($glue, $separator, $array) {\r\n if (!is_array($array))\r\n return $array;\r\n $string = array();\r\n foreach ($array as $key => $val) {\r\n if (is_array($val))\r\n $val = implode(',', $val);\r\n $string[] = \"{$key}{$glue}{$val}\";\r\n }\r\n return implode($separator, $string);\r\n}",
"function ArrayToString ($array,$new_array=array()) {\n\t$num = count($array);\n\tfor ($i=0; $i<=$num; $i++){\n\t\tif (isset($array[$i]['name']) && $array[$i]['name'] != '') //multi-array\n\t\t\tarray_push($new_array, $array[$i]['name']);\n\t\telse if ($array['youtube'][0]['source'] != '' && !in_array($array['youtube'][0]['source'], $new_array)) //trailer\n\t\t\tarray_push($new_array, $array['youtube'][0]['source']);\n\t}\n\treturn implode(',', $new_array);\n}",
"function implodeArray($array, $glue = ' = ') {\n $return = $array;\n if (is_array($array)) {\n $return = '';\n foreach ($array as $key => $value) {\n if ($return != '') {\n $return .= PHP_EOL;\n }\n $return .= $key . $glue . $value;\n }\n }\n return $return;\n}",
"function changeArrayToString($data) {\n\t\t$str = '';\n\t\tforeach($data as $value)\n\t\t{\n\t\t\tif(empty($str))\n\t\t\t\t$str = '\"'.trim(strip_tags($value)).'\"';\n\t\t\telse\n\t\t\t\t$str .=' ,\"'.trim(strip_tags($value)).'\"';\n\t\t}\n\t\treturn $str;\n\t}",
"private function formatArrayValues(array $data): string\n {\n return implode(\n ', ',\n array_map(\n function ($value) {\n return '\"'.$value.'\"';\n },\n $data\n )\n );\n }",
"function arr_to_csv_line($arr) {\n\t\t// todo: fix handlng of object classes\n $line = array();\n if(!$arr) return;\n\t\tforeach ($arr as $v) {\n\t\t\t\t# _debugLog($v);\n\t\t\t\t$line[] = ( is_array($v) or is_object($v) ) ? 'array(' . arr_to_csv_line($v) . ')' : '\"' . str_replace('\"', '\"\"', $v) . '\"';\n\t\t}\n\t\treturn implode(\",\", $line);\n}",
"public static function arrayToString(array $arr) : string\n\t{\n\t\treturn implode('', array_map('strval', $arr));\n\t}",
"function array_to_string(array $array): string\n {\n return '[' . implode(', ', array_map(function ($v): string {\n if (is_array($v) || is_bool($v) || !is_stringable($v)) {\n throw new LogicException('Cannot convert array to string, some values are not stringable');\n }\n\n return '\\'' . $v . '\\'';\n }, $array)) . ']';\n }",
"private function array_to_string($arr)\n {\n $line = [];\n foreach ($arr as $v) {\n $line[] = is_array($v) ? self::array_to_string($v) : $this->sanitize($v);\n }\n return implode($line);\n }",
"public function toString(array $data): string;",
"function d2d_implode($array) {\n if (!is_array($array)) {\n return FALSE;\n }\n $escaped_array = array();\n foreach ($array as $key => $value) {\n // escape separators and escape-character in $key\n $key = d2d_replace(array('\\\\', ',', '='), array('\\\\\\\\', '\\\\,', '\\\\='), $key);\n if ($key === FALSE) { // replacement failed\n return FALSE;\n }\n // encode $value\n $value = d2d_value_encode($value);\n // escape separators and escape-character in $value\n $value = d2d_replace(array('\\\\', ',', '='), array('\\\\\\\\', '\\\\,', '\\\\='), $value);\n if ($value === FALSE) { // replacement failed\n return FALSE;\n }\n $escaped_array[] = \"{$key}={$value}\";\n }\n return implode(',', $escaped_array);\n}",
"function arrayToString($p) {\n $p2 = __t($p)->map(function($arr){return implode($arr);});\n return $p2();\n }",
"public function toString()\n {\n return (string)$this->splice(',')->toString();\n }",
"function compress_array($array) {\n if (!is_array($array)) {\n return quote($array);\n }\n $strings=array();\n foreach ($array as $ind => $val) {\n $strings[]=quote($ind).\"=>\".\n (is_array($val)?compress_array($val):quote($val));\n }\n return \"array(\".implode(\",\",$strings).\")\";\n}",
"function arrayIntoString_sql(array $arr)\n {\n $str = \"\";\n foreach ($arr as $k => $v) {\n $str .= (count($arr) - 1 != $k)\n ? \"'\". $v . \"', \"\n : \"'\". $v . \"'\";\n }\n return $str;\n }",
"function array_to_string($array, $splitter = ', ', $lastSplitter = ' and ', $prefix = '', $suffix = '')\n {\n $string = implode($splitter, $array);\n $string = str_replace($splitter . last($array), $lastSplitter . last($array), $string);\n\n return $prefix . $string . $suffix;\n }",
"private function arrayAssocToString($array){\n\t\t$i = 0;\n\t\t$string = '';\n\t\tforeach ($array as $key => $value) {\n\t\t\tif ($i > 0) $string .= ', ';\n\t\t\tif (preg_match('#', $value)){\n\t\t\t\t$string .= str_replace('#', '', $value);\n\t\t\t}else{\n\t\t\t\t$string .= $key .\"='\".$value.\"'\";\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn $string;\n\t}",
"public function format_array_to_text($array){\n return implode(\"\\n\", $array);\n }",
"public function makeString($array)\r\n {\r\n $outval = '';\r\n foreach ($array as $key => $value) {\r\n if(is_array($value)) {\r\n $outval .= !is_numeric($key) ? \"$key\" : false;\r\n $outval .= $this->makestring($value);\r\n } else {\r\n $outval .= (string) $key .\": \".$value .\"\\n\";\r\n }\r\n }\r\n\r\n return $outval;\r\n }",
"private function implodeWithPrepare($arr) {\r\n\t\t$result='';\r\n\t\t\r\n\t\t$first=true;\r\n\t\tforeach($arr as $tr) {\r\n\t\t\t//separate with commas\r\n\t\t\tif(!$first)\r\n\t\t\t\t$result.=\",\";\r\n\t\t\telse \r\n\t\t\t\t$first=false;\r\n\t\t\r\n\t\t\t//every entry in single quotes\r\n\t\t\t$result.=\"'\";\r\n\t\t\t$result.=$this->prepare($tr);\r\n\t\t\t$result.=\"'\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}",
"public static function arrayToString(array $arr)\n {\n $pieces = [];\n\n foreach ($arr as $email => $name) {\n $pieces[] = $name ? sprintf('%s <%s>', trim($name), trim($email)) : trim($email);\n }\n\n return implode(', ', $pieces);\n }",
"public function collapse_array($value)\n\t{\n\t\tif (count($value)==0)\n\t\t\treturn null;\n\t\t\t\n\t\t$result='';\n\t\tforeach($value as $val)\n\t\t\tif ($val==null)\n\t\t\t\t$result.='NULL,';\n\t\t\telse\n\t\t\t\t$result.=\"$val,\";\n\t\t\n\t\treturn 'ARRAY['.trim($result,',').']';\n\t}",
"protected function errorArrayToString($array) \n\t{\n\t\t$str = '';\n\t\tforeach ($array as $item) {\n\t\t\t$str .= $item . '\\n';\n\t\t}\n\n\t\treturn $str;\n\t}",
"function makestring($array)\r\n {\r\n $outval = '';\r\n if (is_array($array)) {\r\n foreach($array as $key=>$value)\r\n {\r\n if(is_array($value))\r\n {\r\n $outval = makestring($value);\r\n }\r\n else\r\n {\r\n $outval = $value;\r\n }\r\n }\r\n}\r\n \r\n return $outval;\r\n }",
"function transform_request_data($arr) {\n foreach ($arr as $key => $val) {\n if (is_array($val)) {\n $arr[$key] = implode(',', $val);\n }\n }\n return $arr;\n}",
"function _e_($value) {\n if (is_array($value)) {\n $value = sprintf('[%s]', implode(', ', $value));\n }\n echo \"$value\\n\";\n}",
"function content_array_to_string($array){\n $joined_string=\"\";\n for($count=0;$count<count($array);$count++){\n \n if($count!=count($array)-1){\n $joined_string.= $array[$count].'/';\n }\n else{\n $joined_string.=$array[$count];\n }\n }\n return $joined_string;\n }",
"private function array(array $value): string\n {\n if ($this->callable && is_callable($value)) {\n $class = ! is_string($value[0])\n ? $this->classname($value[0])\n : $value[0];\n\n $method = $value[1];\n\n return sprintf('function %s::%s()', $class, $method);\n }\n\n $slice = array_slice($value, 0, $this->arrlim, true);\n\n $elems = $this->isAssociative($slice)\n ? array_map([$this, 'arrayPair'], array_keys($slice), $slice)\n : array_map([$this, 'arrayValue'], $slice);\n\n return vsprintf('[%s%s]', [\n implode(', ', $elems),\n count($value) > $this->arrlim ? ', ...' : '',\n ]);\n }",
"function convertArrayObjectToString($array = [], $field = 'name', $implode = ',') {\n $convert = [];\n foreach ($array as $item) {\n array_push($convert, $item->{$field});\n }\n return implode($implode, $convert);\n}",
"function arrayToString($arrayData, $separator)\n{\n\tif (!is_array($arrayData)) {\n\t\treturn false;\n\t}\n\n\t$arrayDataString = '';\n\tforeach ($arrayData as $value) {\n\t\t$arrayDataString .= $value.$separator;\n\t}\n\n\t//remove the trailing separator\n\t$arrayDataString = substr($arrayDataString, 0, (strlen(trim($arrayDataString)))-1);\n\n\treturn $arrayDataString;\n}",
"public function arrayArrayComas($array,$nombrePos)\n\t{\n\t\tforeach ($array as $ar)\n\t\t{\t\t\n\t\t\t$datos[] = $ar[$nombrePos];\n\t\t}\n\t\treturn implode(\",\",$datos);\n\t}",
"public static function convert_multi_array($array) {\n return implode(\"&\",array_map(function($a) {return implode(\"~\",$a);},$array));\n }",
"function printLine($array){\r\n\t$qual = \"\\\"\";\r\n\t$len = count($array, 0)-1;\r\n\tforeach($array as $key => $val){\r\n\t\tif ($val != \"\") echo \"{$qual}\" . str_replace('\"', \"'\", $val) . \"{$qual}\";\r\n\t\telse echo \"{$qual}unknown{$qual}\";\r\n\t\t\r\n\t\tif ($len > $key) echo \",\";\r\n\t}\r\n\techo \"\\n\";\r\n}",
"function array_multi_implode($standard_glue, $last_nodes_glue, $array) {\n\n\t$length = count($array);\n\n\tif ( $length > 1 ) {\n\n\t\t$array[$length - 2] = $array[$length - 2] . $last_nodes_glue . $array[$length - 1];\n\n\t\tunset($array[$length - 1]);\n\n\t}\n\n\treturn implode($standard_glue, $array);\n\n}",
"function stringify_array ($array_obj, $value_separator)\n{\n\tif(is_array($array_obj))\n\t{\n\t\tforeach($array_obj as $val)\n\t\t{\n\t\t\tif(is_array($val))\n\t\t\t{\n\t\t\t\t$value_separator .= stringify_array($val, $value_separator);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value_separator .= $val. \"|\";\n\t\t\t}\n \t\n\t\t}\n\t\treturn $value_separator;\n\t}\n\telse\n\t{\n\t\treturn $value_separator = \"ERROR : $array_obj is not an array\";\n\t}\n}",
"function implode_danish_list(array $input)\n {\n $output = \"\";\n for ($i = 0; $i < count($input); $i++) {\n if ($i == count($input) - 1) {\n $output .= \" og \";\n } else if ($i > 0) {\n $output .= \", \";\n }\n $output .= $input[$i];\n }\n return $output;\n }",
"public function array2str($value): string\n {\n if (\\is_string($value)) {\n return $value;\n }\n\n $new_array = [];\n\n foreach ($value as $item) {\n $item = str_replace('%', '%25', $item);\n $item = str_replace(',', '%2C', $item);\n $new_array[] = $item;\n }\n\n return implode(',', $new_array);\n }",
"private function arraySet($array){\n \n for($i=0;$i<count($array);$i++){\n if ($i+1 == count($array)){\n $newArray .= \"'\".$array[$i].\"'\";\n }\n else{\n $newArray .= \"'\".$array[$i].\"'\".\",\";\n }\n }\n\n return $newArray;\n }",
"public function __toString()\n\t{\n\t\tif(is_array($this->dimensions)) {\n\t\t\treturn implode(' ',$this->dimensions);\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}",
"public static function implode( $array ) {\n\t\t\t$r = '';\n\t\t\tforeach ( $array as $key => $value ) {\n\t\t\t\t$r .= sprintf( '%s: %s ', $key, $value );\n\t\t\t}\n\n\t\t\treturn trim( $r );\n\t\t}",
"function createQuery($arr) {\n $printArray = \"\";\n for ($i = 0; $i < sizeof($arr); $i++) {\n if ($i == sizeof($arr) - 1) $printArray = $printArray .'\\'' . $arr[$i] . '\\'';\n else $printArray = $printArray . '\\'' . $arr[$i] . '\\'' . \", \";\n } \n return $printArray;\n}",
"public function convertMeToString($glue,$arr){\n return implode($glue , $arr);\n}",
"private function arraySet_noq($array){\n \n for($i=0;$i<count($array);$i++){\n if ($i+1 == count($array)){\n $newArray .= $array[$i];\n }\n else{\n $newArray .= $array[$i].\",\";\n }\n }\n\n return $newArray;\n }",
"function array2string($array, $default = false){\n\tif(!is_array($array))\n\t\treturn $default; \n\t$str = ''; \n\t$len = count($array);\n\t\n\t$j = $len; \n\tif($len >= 1 || ($len == 0 && $default == false)){\n\t\tforeach($array as $obj){\n\t\t\tif(is_object($obj))\n\t\t\t\t$class = get_class($obj);\n\t\t\telse \n\t\t\t\t$class = '';\n\t\t\t$isTable = false; \n\t\t\tif($class)\n\t\t\t\t$isTable = is_subclass_of($obj, 'Table');\n\t\t\t\n\t\t\t$j--; \n\t\t\t\n\t\t\tif($j > 0)\n\t\t\t\t$str = $str . ($isTable ? $obj->link() : $obj) . ($len > 2 ? ', ' : ' ');\n\t\t\telse\n\t\t\t\t$str = $str . ($len > 1 ? 'and ' : '') . ($isTable ? $obj->link() : $obj);\n\t\t\t\n\t\t}\n\t}else{\n\t\t$str = $default; \n\t}\n\t\n\treturn $str; \n }",
"public function _convertArrayToString(array $arr)\n {\n $str = '[';\n foreach ($arr as $k => $v) {\n $str .= $k.'=>';\n if (is_string($v)) {\n $str .= '\"'.$v.'\"';\n } else {\n $str .= $this->_convertTypeToString($v, true);\n }\n }\n $str .= ']';\n return $str;\n }",
"function stringifyArray ($p_aData, $p_iLvl = 0) {\r\n\t\t\t$sData = '';\r\n\t\t\t$bFirst = true;\r\n\t\t\tif (is_array($p_aData)) {\r\n\t\t\t\t$sData .= str_repeat('\t', $p_iLvl) . ' => Array (';\r\n\t\t\t\tforeach($p_aData as $k => $v) {\r\n\t\t\t\t\tif ($bFirst) {\r\n\t\t\t\t\t\t$sData = \"\\n\";\r\n\t\t\t\t\t\t$bFirst = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$sData .= \",\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (is_array($v)) {\r\n\t\t\t\t\t\t$sData .= str_repeat('\t', $p_iLvl) . $k . ' => Array ('\r\n\t\t\t\t\t\t\t . __stringifyArray($v, $p_iLvl + 1) . \"\\n\"\r\n\t\t\t\t\t\t\t . str_repeat('\t', $p_iLvl) . ')';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$sData .= str_repeat('\t', $p_iLvl) . $k . ' => ' . $v;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$sData .= str_repeat('\t', $p_iLvl) . ')';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$sData .= $p_aData;\r\n\t\t\t}\r\n\t\t\treturn $sData;\r\n\t\t}",
"function __str_array(array $_) {\n $__[0] = implode(\", \", $_);\n\n shuffle($_);\n\n# - ARRAY CONVERT STRING HASHTAG \n $__[1] = implode(' ,#', $_);\n\n return $__;\n}",
"public function arraymultitostring($array,$delimitatore1='=',$delimitatore2=','){\n\t\t$stringa='';\n\t\t$i=0;\n\t\tforeach($array as $a=>$c){\n\t\t\t$stringa.=$a.$delimitatore1.$c;\n\t\t\t$i++;\n\t\t\tif($i!=count($array)){\n\t\t\t\t$stringa.=$delimitatore2;\n\t\t\t}\n\t\t}\n\t\treturn $stringa;\n\t}",
"function display($arr)\r\n {\r\n $str = implode($arr);\r\n echo $str.'<br />';\r\n\r\n }",
"function myImplode($glue,$array){\n\tif(count($array) > 1){\n\t\t$s = \"\";\n\t\tfor($i = 0; $i < (count($array) - 2) ; $i++)\n\t\t\t$s .= $array[$i].$glue;\n\t\t$s .= $array[$i];\n\n\t\treturn $s;\n\t}else{\n\t\treturn $array[0];\n\t}\n}",
"function array_collapse($array)\n {\n return Arr::collapse($array);\n }",
"function array2csv(array &$array)\n{\n if (count($array) == 0) {\n return null;\n }\n ob_start();\n $df = fopen(\"php://output\", 'w');\n fputcsv($df, array_keys(reset($array)));\n foreach ($array as $row) {\n fputcsv($df, $row);\n }\n fclose($df);\n return ob_get_clean();\n}",
"function compactToString($x) {\n $xout='';\n if( is_array($x) )\n foreach($x as $xx) $xout.= compactToString($xx);\n else $xout=$x;\n return $xout;\n}",
"private function arrayToString($jobs = array()) \n {\n $string = implode(\"\\r\\n\", $jobs);\n return $string;\n }",
"public function toString()\n {\n return Str(json_encode($this->array));\n }",
"function guifi_export_arraytojs($array){\n $output = '';\n foreach ($array as $key => $value){\n if ($output != ''){\n $output .= ',';\n }\n if (is_array($value)){\n $output .= $key.\":\";\n $output .= guifi_export_arraytojs($value);\n }else{\n if (is_numeric($value)){\n $output .= $key.\":\".$value;\n }else{\n $output .= $key.\":'\".$value.\"'\";\n }\n }\n }\n $output ='{'.$output.'}';\n return $output;\n}",
"public static function array_implode( $glue, $separator, $array ) {\n\t\t\tif ( ! is_array( $array ) ) return $array;\n\t\t\t$string = array();\n\t\t\tforeach ( $array as $key => $val ) {\n\t\t\t\t\tif ( is_array( $val ) )\n\t\t\t\t\t\t\t$val = implode( ',', $val );\n\t\t\t\t\t$string[] = \"{$key}{$glue}{$val}\";\n\n\t\t\t}\t\t \n\t\t\treturn implode( $separator, $string );\n\t}",
"public static function toString(array $array, $inner_glue = '=', $outer_glue = ' ', $keepOuterKey = false)\n {\n \t$output = array();\n \n \tforeach ($array as $key => $item)\n \t{\n \t\tif (is_array($item))\n \t\t{\n \t\t\tif ($keepOuterKey)\n \t\t\t{\n \t\t\t\t$output[] = $key;\n \t\t\t}\n \n \t\t\t// This is value is an array, go and do it again!\n \t\t\t$output[] = self::toString($item, $inner_glue, $outer_glue, $keepOuterKey);\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$output[] = $key . $inner_glue . '\"' . $item . '\"';\n \t\t}\n \t}\n \n \treturn implode($outer_glue, $output);\n }",
"function array_collapse($array)\n {\n return Arr::collapse($array);\n }",
"private static function array_to_string($jobs = array())\n\t{\n\t\t$string = implode(\"\\r\\n\", $jobs);\n\t\treturn $string;\n\t}",
"public function __toString(): string\n {\n return implode(',', $this->items);\n }",
"public static function arrayToString(array $data)\n {\n $tmp = new \\SplTempFileObject;\n foreach ($data as $row) {\n $tmp->fputcsv($row, static::$delimiter);\n if (static::$lineEnding !== \"\\n\") {\n $tmp->fseek(-1, \\SEEK_CUR);\n $tmp->fwrite(static::$lineEnding);\n }\n }\n $length = $tmp->ftell();\n $tmp->fseek(0);\n\n return $tmp->fread($length);\n }",
"public function __toString()\n {\n return implode(', ', [\n $this->x,\n $this->y,\n $this->z\n ]);\n }",
"public function __toString()\n {\n return (string)$this->slice(',')->toString();\n }",
"public function toString() {\r\n return implode($this->result);\r\n }",
"function mf_implode_array_chuncks($input_array){\n\t\treturn implode('&', $input_array);\n\t}",
"function addComma($arr) \r\n{\r\n foreach ($arr as $key => $value) {\r\n if ($key == 0){\r\n echo $value;\r\n }\r\n else\r\n echo ',' . $value;\r\n }\r\n}",
"function getListFromArray($array){\n\t\t$arraystring = \"\";\n\t\tforeach($array as $value) {\n\t\t\t$arraystring .= \",\".$value;\n\t\t}\n\t\t\n\t\t$arraystring = substr($arraystring,1);\n\t\treturn $arraystring;\n\t}",
"static public function implode ( &$pdoparams, $arr )\n\t{\n\t\t$tmp = array(); \n\t\tforeach ($arr as $val)\n\t\t{ \n\t\t\t$key = ':implode' . self::$escapecounter++; \n\t\t\t$pdoparams[$key] = $val; \n\t\t\t$tmp[] = $key; \n\t\t} \n\t\treturn implode (',', $tmp); \n\t}",
"function implodeBoard($board) {\n $boardouter=array();\n $boardindex=array(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\");\n\n foreach($boardindex as $i) {\n $boardouter[]=implode('.',$board[$i]);\n }\n\n return implode(',',$boardouter);\n }",
"private function arrayValue($val): string\n {\n return ! is_array($val)\n ? (string) new Printable($val, $this->callable, $this->strlim)\n : '[...]';\n }",
"function array_to_csv($array, $header_row = true, $col_sep = \",\", $row_sep = \"\\n\", $qut = '\"')\n{\n\tif (!is_array($array) or !is_array($array[0])) return false;\n\t$output = '';\n\t//Header row.\n\tif ($header_row)\n\t{\n\t\tforeach ($array[0] as $key => $val)\n\t\t{\n\t\t\t//Escaping quotes.\n\t\t\t$key = str_replace($qut, \"$qut$qut\", $key);\n\t\t\t$output .= \"$col_sep$qut$key$qut\";\n\t\t}\n\t\t$output = substr($output, 1).\"\\n\";\n\t}\n\t//Data rows.\n\tforeach ($array as $key => $val)\n\t{\n\t\t$tmp = '';\n\t\tforeach ($val as $cell_key => $cell_val)\n\t\t{\n\t\t\t//Escaping quotes.\n\t\t\t$cell_val = str_replace($qut, \"$qut$qut\", $cell_val);\n\t\t\t$tmp .= \"$col_sep$qut$cell_val$qut\";\n\t\t}\n\t\t$output .= substr($tmp, 1).$row_sep;\n\t}\n\t\n // return $output;\n // Added trim, remove trailing \\n \n\treturn rtrim($output, $row_sep);\n}",
"public function __toString()\n\t{\n\t\t$output = '';\n\n\t\tforeach (array_keys($this->data) as $key) {\n\t\t\tif (is_array($this->data[$key])) {\n\t\t\t\t$output .= implode(PHP_EOL, $this->data[$key]) . PHP_EOL;\n\t\t\t} else {\n\t\t\t\t$output .= $this->data[$key] . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}",
"private function formatArrayToString(array $map): string\n\t{\n\t\t$resultString = '';\n\t\tforeach ($map as $key => $value) {\n\t\t\ttry {\n\t\t\t\t$resultString .= \" [$key] => \";\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t$resultString .= $this->formatArrayToString($value);\n\t\t\t\t} else {\n\t\t\t\t\t$resultString .= strip_tags($value, '<b><i><pre>');\n\t\t\t\t}\n\t\t\t} catch (Throwable $exception) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn $resultString;\n\t}",
"function array2csv(array &$array)\n{\n if (count($array) == 0) {\n return null;\n }\n ob_start();\n $df = fopen(\"QCexport.csv\", 'w');\n fputcsv($df, array_keys(reset($array)));\n foreach ($array as $row) {\n fputcsv($df, $row);\n }\n fclose($df);\n return ob_get_clean(); \n}",
"function ar_to_string($ar, $tab = 1) {\n\n\t\t$str = \"\";\n\t\t$tabs = \"\";\n\n\t\tfor ($x = 0; $x < $tab; $x++)\n\t\t\t$tabs .= \"\\t\";\n\n\t\tforeach ($ar as $key => $val) {\n\t\t\tif (is_array($ar[$key]))\n\t\t\t\t$str .= ar_to_string($ar, ($tab + 1));\n\t\t\telse\n\t\t\t\t$str = \"{$tabs}{$key}\\t=>\\t{$val}\\n\";\n\t\t}\n\n\t\treturn $str;\n\t}",
"static function implode($separator,$array){\n\t\tArrays::remove($array);\n\t\treturn implode($separator,$array);\n\t}"
]
| [
"0.8034357",
"0.76929253",
"0.75374234",
"0.7444304",
"0.7434927",
"0.7401658",
"0.7369539",
"0.7339462",
"0.7328064",
"0.73184884",
"0.72688854",
"0.71883607",
"0.7184429",
"0.7147853",
"0.7134233",
"0.713023",
"0.710383",
"0.7066729",
"0.7042661",
"0.6998973",
"0.6963454",
"0.69491154",
"0.6888168",
"0.68762",
"0.6792578",
"0.67904824",
"0.67882764",
"0.6777934",
"0.6721071",
"0.66949797",
"0.6689368",
"0.668241",
"0.6668966",
"0.6666279",
"0.66184205",
"0.65631324",
"0.65288424",
"0.6494969",
"0.6491005",
"0.6475333",
"0.64462936",
"0.64422685",
"0.6437802",
"0.6428139",
"0.6417888",
"0.6398541",
"0.6389933",
"0.638213",
"0.6379619",
"0.633586",
"0.6328411",
"0.63022715",
"0.6295613",
"0.62769973",
"0.62670064",
"0.6264043",
"0.62468624",
"0.6224939",
"0.6206633",
"0.61708766",
"0.6168425",
"0.6165912",
"0.6159669",
"0.6155705",
"0.6150763",
"0.61438787",
"0.61378586",
"0.6136718",
"0.61190164",
"0.6094321",
"0.6074674",
"0.6068308",
"0.60679",
"0.6039335",
"0.60361254",
"0.6032546",
"0.6025746",
"0.6013948",
"0.6012338",
"0.60106593",
"0.60068935",
"0.59938526",
"0.5991156",
"0.5950444",
"0.5925042",
"0.59215534",
"0.59212536",
"0.58964133",
"0.58936167",
"0.5890238",
"0.588769",
"0.5886783",
"0.58737195",
"0.586218",
"0.58586264",
"0.5856905",
"0.58561003",
"0.5852032",
"0.58519846",
"0.5815515"
]
| 0.6811544 | 24 |
prints the cart in HTML | function printCart () {
//gets all products from the cart
$products = fetchProductsFromCartAsArray();
if (count($products) > 0) {
for ($i=0; $i < count($products) ; $i++) {
print("<div class='row p-3 ml-2 cartItem'>
<!-- Afbeelding product -->
<div class='col-2'>
<img class='img-fluid rounded img-thumbnail' src='https://sc02.alicdn.com/kf/HTB1wYdzPFXXXXaXapXXq6xXFXXX2/USB-Flash-Drive-8-GB-Memory-Stick.jpg_350x350.jpg' />
</div>
<!-- Naam product -->
<div class='col-4'>
<span class='badge-pill badge-primary mr-2'>" . $products[$i]['amount'] . "</span><b><a clas='cart-title' href='product.php?id=" . $products[$i]['StockItemID'] . "'>" . $products[$i]['StockItemName'] . "</a></b>
</div>
<!-- Naam product -->
<div class='col-3'>
<p>€ " . $products[$i]['RecommendedRetailPrice'] * $products[$i]['amount'] . "</p>
</div>
<!-- Verwijder knoppen -->
<div class='col-3'>
<form class='' action='winkelwagen.php' method='post'>
<input type='number' name='ID' value='" . $products[$i]['StockItemID'] . "' hidden>
<input type='number' name='amount' value=" . (string)$products[$i]['amount'] . " hidden>
<button type='submit' class='btn btn-danger' name='RemoveItem'><i class='fas fa-trash'></i> Remove all</button>
</form>
<form class='' action='winkelwagen.php' method='post'>
<input type='number' name='ID' value='" . $products[$i]['StockItemID'] . "' hidden>
<input type='number' name='amount' value=1 hidden>
<button type='submit' class='btn btn-danger' name='RemoveItem'><i class='fas fa-trash'></i> Remove one</button>
</form>
</div>
</div>");
}
} else {
print("<div class='alert alert-danger mx-auto my-5' role='alert'>
<strong>Oh snap!</strong> Your cart is empty. <i class='far fa-frown'></i>
</div>");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function printCart()\n {\n if ( !(isEmpty() ) )\n {\n foreach( $this->cartItems as $item )\n {\n echo $item->getModelNumber();\n echo \"\\r\" ;\n }\n }\n else\n {\n echo \"Cart is empty in Cart.php\";\n }\n }",
"public function getCartHTML() {\n\t\t$productLines = $this->cart->getProductLines();\n\t\t$sum = $this->cart->getSumSEK();\n\t\t$html = \"<ul>\";\n\n\t\t\n\n\t\tforeach ($productLines as $productLine) {\n\t\t\t$product = $productLine->getProduct();\n\t\t\t$name = $product->getName();\n\t\t\t$costSEK = $product->getCostSEK();\n\t\t\t$amount = $productLine->getAmount();\n\t\t\t$totalSEK = $productLine->getTotalSEK();\n\n\t\t\t\n\t\t\t$linkHTML = $this->productListView->getBuyProductLink($product, \"+\");\n\t\t\t$removeLink = $this->productListView->getRemoveProductLink($product, \"-\");\n\t\t\t$buttons = \"[$linkHTML][$removeLink]\";\n\t\t\t\n\t\t\t$html .= \"<li>$name $amount x $costSEK = $totalSEK SEK $buttons</li>\";\n\n\t\t}\n\t\t$html .= \"</ul>\";\n\t\t\n\n\t\tif (isset($_SESSION[self::$messageHolder])) {\n\t\t\tif ($_SESSION[self::$messageHolder] == self::$addProductSucceded) {\n\t\t\t\t$html .= \"Grattis till ditt köp, kommer göra dig gott!</br>\";\t\n\t\t\t} else {\n\t\t\t\t$html .= \"Du tog bort en produkt! </br>\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tunset($_SESSION[self::$messageHolder]);\n\t\t}\n\n\n\t\tif ($this->cart->containsItems()) {\n\t\t\t$checkout = $this->navigationView->getCheckoutLink();\n\t\t\t\n\t\t} else {\n\t\t\t$checkout = \"Inga produkter i varukorgen\";\n\t\t}\n\t\treturn \"<h2>Cart</h2> $html Summa : $sum kr $checkout\";\n\t}",
"public function showCart()\n\t{\n\t\t $session_name = \"c_product\";\n\n\t\t// if (!isset($_SESSION[\"$session_name\"]) || !in_array($p, $_SESSION[\"$session_name\"]))\n\t\t// {\n\t\t// \t$_SESSION[\"$session_name\"][] = $p;\t\t\n\t\t// }\n\t\t$total = 0;\n\t\tforeach ($_SESSION[\"$session_name\"] as $id)\n\t\t{\n\t\t\t$total += $this->showProductInCart($id);\n\t\t}\n\t\t$total = number_format($total);\n\t\t$totalprice = <<<DELIMITER\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-3\">\n\t\t\t\t\t<h4> TOTAL PRICE: </h4>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-6\" style=\"text-align:right\">\n\t\t\t\t\t<h3 style= \"color:red\">{$total}₫</h3>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr>\n\t\tDELIMITER;\n\t\techo $totalprice;\n\t}",
"function printCart(){\n\t\tprint_r($this->articulos);\n\t}",
"public function show(){\n $data=$this->cart->contents();\n echo \"<pre>\";\n print_r($data);\n echo \"</pre>\";\n\t}",
"public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }",
"function show_cart(){\n \t$output = '';\n \t$no = 0;\n \tforeach ($this->cart->contents() as $items) {\n \t\t$no++;\n \t\t$output .='\n \t\t<tr>\n \t\t<td>'.$items['name'].'</td>\n \t\t<td>'.number_format($items['price']).'</td>\n \t\t<td>'.$items['qty'].'</td>\n \t\t<td>'.number_format($items['subtotal']).'</td>\n \t\t<td><button type=\"button\" id=\"'.$items['rowid'].'\" class=\"hapus_cart btn btn-danger btn-xs\">Batal</button></td>\n \t\t</tr>\n \t\t';\n \t}\n \t$output .= '\n \t<tr>\n \t<th colspan=\"3\">Total</th>\n \t<th colspan=\"2\">'.'Rp '.number_format($this->cart->total()).'</th>\n \t</tr>\n \t';\n \treturn $output;\n }",
"public function renderCart() {\n return trim(self::getInstance()->renderCart());\n }",
"public function getCartHtml()\n\t{\n\t\t$cart = $this->cart->contents();\n\t\t$cart['cnt_items'] = count($cart['products']);\n\t\t\n\t\t$user = $this->data['user'];\n\t\t\n\t\t$total = 0;\n\t\t\n\t\t$html = '';\n\t\tif ( ! count($cart['products'])){\n\t\t\t$html .= '\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-3\"></div>\n\t\t\t\t<div class=\"col-3 center\">\n\t\t\t\t\t<h2 class=\"center\">Ваша корзина пуста.</h2>\n\t\t\t\t\t<a class=\"btn btn-white\" href=\"/\">← продолжить покупки</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-3\"></div>\n\t\t\t</div>';\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$html .= '\n\t\t\t<ul class=\"cart-list\" data-cart=\"items\">';\n\t\t\tforeach (array_reverse($cart['products']) as $k=>$i){\n\t\t\t\t$html .= '\n\t\t\t\t<li data-cart-item=\"\">\n\t\t\t\t\t<div class=\"ci-box\">\n\t\t\t\t\t\t<div class=\"pp-block-image\">\n\t\t\t\t\t\t\t<a href=\"'. htmlspecialchars($i['_url']) .'\">\n\t\t\t\t\t\t\t\t<img src=\"'.htmlspecialchars($i['image']) .'\" alt=\"'.htmlspecialchars($i['name']).'\">\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"pp-block-price\">\n\t\t\t\t\t\t\t<div class=\"gd gd-name\"><a class=\"c-pink\" href=\"'. htmlspecialchars($i['_url']) .'\">'. $i['name'] .'</a></div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"gd gd-manufacturer\">Производитель: '. (isset($i['manufacturer']) ? $i['manufacturer'] : '—') .'</div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($i['prices']){\n\t\t\t\t\t\t\t$cnt_opt = isset($i['prices']['cnt_opt']) ? $i['prices']['cnt_opt'] : '';\n\t\t\t\t\t\t\t$cnt_roz = isset($i['prices']['cnt_roz']) ? $i['prices']['cnt_roz'] : '';\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t<div class=\"gd gd-size\">Размер: '. $i['prices']['name'] .' ('. $i['prices']['prefix'] .')</div>\n\t\t\t\t\t\t\t<div class=\"gd gd-packing\">Упаковка: '. ($i['options']['type'] ? 'опт - '.($cnt_opt) : 'розница - '.($cnt_roz)) .' шт.</div>';\t\t\n\t\t\t\t\t\t\tunset($cnt_opt);\n\t\t\t\t\t\t\tunset($cnt_roz);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t<div class=\"gd gd-price\">\n\t\t\t\t\t\t\t\tЦена:';\n\t\t\t\t\t\t\t\tif ($i['discount']*1){\n\t\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t\t<span class=\"gd-new-price\">'. number_format(($i['price']-($i['price']*$i['discount']/100)), 2, ',', \"'\") .' грн.</span>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t\t<span class=\"gd-new-price\">'. number_format($i['price'], 2, ',', \"'\") .' грн.</span>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"gd gd-qty\">Количество: <b>×</b> '. $i['qty'] .'</div>\n\n\t\t\t\t\t\t\t<div class=\"gd gd-subtotal\">\n\t\t\t\t\t\t\t\tСумма: ';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t# скидка User\n\t\t\t\t\t\t\t\t$discount = isset($user->discount) ? $user->discount*1 : 0;\n\t\t\t\t\t\t\t\t# если нет цена + размер\n\t\t\t\t\t\t\t\tif ( ! $i['prices']){\n\t\t\t\t\t\t\t\t\t# если USER скидка больше чем скидка на товар\n\t\t\t\t\t\t\t\t\tif ($discount > $i['discount']*1){\n\t\t\t\t\t\t\t\t\t\t$summa = $i['qty'] * $i['price'];\n\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$summa = $i['qty'] * ($i['price'] - round($i['price'] * $i['discount']/ 100, 2));\n\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t# если USER скидка больше чем скидка на товар\n\t\t\t\t\t\t\t\t\tif ($discount > $i['discount']){\n\t\t\t\t\t\t\t\t\t\tif ($i['options']['type'] == 0){\n\t\t\t\t\t\t\t\t\t\t\t$roz = isset($i['prices']['roz']) ? $i['prices']['roz'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$summa = round($i['qty'] * $roz, 2);\n\t\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t\t\tunset($roz);\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$opt = isset($i['prices']['opt']) ? $i['prices']['opt'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$summa = round($i['qty'] * $opt, 2);\n\t\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t\t\tunset($opt);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tif ($i['options']['type'] == 0){\n\t\t\t\t\t\t\t\t\t\t\t$roz = isset($i['prices']['roz']) ? $i['prices']['roz'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$summa = $i['qty'] * ($roz - round($roz * $i['discount']/ 100, 2));\n\t\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t\t\tunset($roz);\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$opt = isset($i['prices']['opt']) ? $i['prices']['opt'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$summa = $i['qty'] * ($opt - round($opt * $i['discount']/ 100, 2));\n\t\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t\t\tunset($opt);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"gd-counted\">\n\t\t\t\t\t\t\t\t<div class=\"quant\">\n\t\t\t\t\t\t\t\t\t<button data-quantity-button=\"minus\" class=\"quant-button minus\"><span>−</span></button>\n\t\t\t\t\t\t\t\t\t<input class=\"quant-box\" type=\"text\" name=\"quantity['. $k .']\" value=\"'. $i['qty'] .'\" data-quantity=\"box\" autocomplete=\"off\">\n\t\t\t\t\t\t\t\t\t<button data-quantity-button=\"plus\" class=\"quant-button plus\"><span>+</span></button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"gd-counted\" data-btn=\"update\" style=\"display:none;\">\n\t\t\t\t\t\t\t\t<button class=\"btn btn-pink\" type=\"submit\">Пересчитать</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t<a class=\"gd gd-delete uppercase\" data-cart-delete=\"'. $k .'\" href=\"/cart?del='. $k .'\">Удалить</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>';\n\t\t\t\t\n\t\t\t\t$total += $summa; \n\t\t\t}\n\t\t\t\t$html .= '\n\t\t\t\t<li>\n\t\t\t\t\t<div class=\"gd-total\">\n\t\t\t\t\t\t<div class=\"gd-label\">\n\t\t\t\t\t\t\t<div class=\"gd-label-name\">Всего:</div>\n\t\t\t\t\t\t\t<div class=\"gd-label-box\" data-cart=\"subtotal\">'. number_format($total, 2, ',', \"'\") .' грн.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"gd-label\">\n\t\t\t\t\t\t\t<div class=\"gd-label-name\">Ваша скидка:</div>\n\t\t\t\t\t\t\t<div class=\"gd-label-box\" data-cart=\"discount\">'. $discount .' %</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"gd-label\">\n\t\t\t\t\t\t\t<div class=\"gd-label-name\">Итого:</div>\n\t\t\t\t\t\t\t<div class=\"gd-label-box\" data-cart=\"total\">';\n\t\t\t\t\t\t\tif ($discount){\n\t\t\t\t\t\t\t\t$total = 0;\n\t\t\t\t\t\t\t\tforeach ($cart['products'] as $k){\n\t\t\t\t\t\t\t\t\t# какая скидка больше\n\t\t\t\t\t\t\t\t\t$_discount = $discount > $k['discount']*1 ? $discount : $k['discount']*1;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t# если нет цена + размер\n\t\t\t\t\t\t\t\t\tif ( ! $k['prices']){ \n\t\t\t\t\t\t\t\t\t\t$total += $k['qty'] * ($k['price'] - round($k['price'] * $_discount/ 100, 2));\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tif ($k['options']['type'] == 0){\n\t\t\t\t\t\t\t\t\t\t\t$roz = isset($k['prices']['roz']) ? $k['prices']['roz'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$total += round($k['qty'] * ($roz - $roz * $_discount / 100), 2);\n\t\t\t\t\t\t\t\t\t\t\tunset($roz);\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$opt = isset($k['prices']['opt']) ? $k['prices']['opt'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$total += round($k['qty'] * ($opt - $opt * $_discount / 100), 2);\n\t\t\t\t\t\t\t\t\t\t\tunset($opt);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$html .= number_format($total, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$html .= number_format($total, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>';\t\n\t\t}\n\t\t\n\t\t# убираем пробелы (сжимаем)\n\t\t$cart['html'] = preg_replace('/\\s+/', ' ', $html);\n\t\t\n\t\t$cart['cart_total'] = number_format($total, 2, ',', \"'\");\n\t\t\n\t\t# Для корзины в подвале\n\t\t$bott = '';\n\t\tif ( ! count($cart['products'])){\n\t\t\t$bott .= '\n\t\t\t<div class=\"cbt-content\">\n\t\t\t\t<div class=\"cbt-empty\">Ваша корзина пуста</div>\n\t\t\t</div>';\n\t\t}else{\n\t\t\t$bott .= '\n\t\t\t<div class=\"cbt-content\">\n\t\t\t\t<div class=\"cbt-content-left\">\n\t\t\t\t\t<div class=\"owl-carousel\" data-cart-bt=\"owlCarusel\">';\n\t\t\t\t\tforeach (array_reverse($cart['products']) as $k=>$v){\n\t\t\t\t\t\t$bott .= '<div class=\"item\">\n\t\t\t\t\t\t\t<div class=\"cbt-item\">\n\t\t\t\t\t\t\t\t<div class=\"cbt-item-right\">\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-name\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"'.htmlspecialchars($v['_url']).'\">'.$v['name'].'</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-manufacturer\">Производитель: '.(isset($v['manufacturer']) ? $v['manufacturer'] : '—').'</div>';\n\t\t\t\t\t\t\t\t\tif ($v['prices']){\n\t\t\t\t\t\t\t\t\t$cnt_roz = isset($v['prices']['cnt_roz']) ? $v['prices']['cnt_roz'] : '';\n\t\t\t\t\t\t\t\t\t$cnt_opt = isset($v['prices']['cnt_opt']) ? $v['prices']['cnt_opt'] : '';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-size\">Размер: '.$v['prices']['name'].' ('.$v['prices']['prefix'].')</div>\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-packing\">Упаковка: '. ($v['options']['type'] ? 'опт - '.($cnt_opt) : 'розница - '.($cnt_roz)) .' шт.</div>';\n\t\t\t\t\t\t\t\t\tunset($cnt_roz);\n\t\t\t\t\t\t\t\t\tunset($cnt_opt);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-price\">Цена:';\n\t\t\t\t\t\t\t\t\tif ($v['discount']*1){\n\t\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t\t<span class=\"gd-old-price\">'.number_format($v['price'], 2, ',', \"'\").' грн.</span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"gd-new-price\">'.number_format(($v['price']-($v['price']*$v['discount']/100)), 2, ',', \"'\").' грн.</span>';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t\t<span class=\"gd-new-price\">'.number_format($v['price'], 2, ',', \"'\").' грн.</span>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-qty\">Количество: <b>×</b> '.$v['qty'].'</div>\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-subtotal\">Сумма: '.number_format($v['subtotal'], 2, ',', \"'\").' грн.</div>\n\n\t\t\t\t\t\t\t\t\t<a class=\"gd gd-edit\" href=\"'. htmlspecialchars($v['_url']) . ($v['prices'] ? ('#size='.$v['options']['size'].';packing='.$v['options']['type']) : '').'\">Редактировать</a>\n\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t<a class=\"gd gd-delete\" href=\"/cart?del='.$k.'>\" data-cart-delete=\"'.$k.'\">Удалить</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"cbt-item-left\">\n\t\t\t\t\t\t\t\t\t<img src=\"'.htmlspecialchars($v['image']).'\" alt=\"'.htmlspecialchars($v['name']).'\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>';\n\t\t\t\t\t}\n\t\t\t$bott .= '\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cbt-content-right\">\n\t\t\t\t\t<a class=\"btn btn-pink\" href=\"/cart\">Оформить</a>\n\t\t\t\t</div>\n\t\t\t</div>';\n\t\t}\n\t\t# убираем пробелы (сжимаем)\n\t\t$cart['html_bottom'] = preg_replace('/\\s+/', ' ', $bott);\n\t\t\n\t\t\n\t\tunset($cart['products']);\n\t\t\n\t\treturn $cart;\n\t}",
"public function showCart($cart) {\n $this->logInfo('carro: ' . str_replace('\"', \"'\", json_encode($cart)));\n }",
"function display_cart()\n\t\t{\n\t\t\tglobal $connect;\n\t\t\tglobal $currency;\n\t\t\tif(isset($_SESSION['cart']))\n\t\t\t{\n\t\t\t\tif(isset($_POST['place-order-btn']))\n\t\t\t\t{\n\t\t\t\t\tinsert_order();\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$cart = $_SESSION['cart'];\n\t\t\t\t$html = '';\n\t\t\t\t$html.='\n\t\t\t\t<div class=\"cv-order-detail spacer-top-less spacer-bottom\">\n\t\t\t <div class=\"container\">\n\t\t\t <div class=\"cv-heading\">\n\t\t\t <h1>product details</h1>\n\t\t\t <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>\n\t\t\t </div>\n\t\t\t <div class=\"row\">\n\t\t\t <div class=\"col-md-12\">\n\t\t\t <div class=\"cv-last-order\">\n\t\t\t <table>\n\t\t\t <thead>\n\t\t\t <tr>\n\t\t\t <th>Product name</th>\n\t\t\t <th>unit price</th>\n\t\t\t <th>Quantity</th>\n\t\t\t <th>Total</th>\n\t\t\t </tr>\n\t\t\t </thead>\n\t\t\t <tbody>\n\t\t\t\t';\n\n\t\t\t\tforeach ($cart as $key => $value) {\n\t\t\t\t\t// Fetch cart details\n\t\t\t\t\t$cart_table_qry = \"select * from product where product_id=$value[product_id] and status=1\";\n $cart_table_qry_result = mysqli_query($connect,$cart_table_qry); \n $cart_table_arr = mysqli_fetch_assoc($cart_table_qry_result); \n\n\n\t\t\t\t\t$html.='<tr>\n\t <td>'.$cart_table_arr['product_name'].'</td>\n\t <td>'.$currency.$cart_table_arr['product_price'].'</td>\n\t <td>'.$value['quantity'].'</td>\n\t <td>'.$currency.$value['quantity'] * $cart_table_arr['product_price'].'</td>\n\t </tr>';\n\t\t\t\t}\n\t\t\t\t\t$html.='<tr>\n <td colspan=\"2\" class=\"cv-d-none\"></td>\n <td><b>Grand Total</b></td>\n <td class=\"cv-price\">'.$currency.$_SESSION['grand_total'].'</td>\n </tr>\n\t\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t\t</table>\n \t\t\t</div>\n\t\t <div class=\"cv-cart-btn\">\n\t\t <form method=\"post\" action='.$_SERVER['PHP_SELF'].'>\n\t\t <input href=\"javascript:void(0)\" class=\"cv-btn place-order-btn\" type=\"submit\" value=\"place order\" name=\"place-order-btn\">\n\t\t </form>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t <p class=\"font-weight-bold\">Only COD(Cash on delivery) payment mehod is available.</p>\n\t\t </div>\n\t\t </div>';\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html ='';\n\t\t\t}\n\t\t\techo $html;\n\t\t}",
"public function display()\n\t\t{\n\t\t\techo \"<table border=\\\"1\\\">\";\n\t\t\techo \"<tr><th>Artikel</th><th>Menge</th><th>Optionen</th></tr>\";\n\t\t\tforeach ($this->items as $art=>$qty)\n\t\t\t\techo \"<tr>\n\t\t\t\t\t\t<td>$art</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<form name='qtyForm' action='cart.php' method='get'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='artChangeQty' value='$art'/>\n\t\t\t\t\t\t\t\t<input name='artQty' value='$qty'/>\n\t\t\t\t\t\t\t\t<input name='positive' type='submit' value='1' />\n\t\t\t\t\t\t\t\t<input name='negative' type='submit' value='-1' />\n\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t<input type='submit' value='Ändern' />\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<form name='removeForm' action='cart.php' method='get'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='artRemoveAll' value='$art'/>\n\t\t\t\t\t\t\t\t<input type='submit' value='Remove' />\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t </tr>\";\n\t\t\techo \"</table>\";\n\t\t}",
"public function viewCart(){\r\n $data =(isset($_SESSION['cart']))? $_SESSION['cart']:array('cart' => 'empty');\r\n render('cart',$data);\r\n }",
"public static function writeShoppingCart() {\n\tif (isset($_SESSION['cart']))\n\t{\n\t$cart = $_SESSION['cart'];\n\t}\n\t\n\tif (!isset($cart) || $cart=='') {\n\t\treturn '<p>You have no items in your shopping cart</p>';\n\t} \n\t\telse \n\t{\n\t\t// Parse the cart session variable\n\t\t$items = explode(',',$cart);\n\t\t$s = (count($items) > 1) ? 's':'';\n\t\treturn '<p>You have <a href=\"index.php?content_page=php-shopping/cart&action=display\">'.count($items).' item'.$s.' in your shopping cart</a></p>';\n\t\t}\n }",
"function display($htmlContent){\r\n\t\t$cart = $_SESSION[\"cart\"];\r\n\t\tif(sizeof($cart)==0){\r\n return false;\r\n\t\t}else{\r\n\t\t\tfor ($i=0;$i<sizeof($cart);$i++) {\r\n\t\t\t\tprintf($htmlContent, $cart[$i][\"product_id\"], $cart[$i][\"label\"], $cart[$i][\"quantity\"]);\r\n\t\t\t}\r\n \treturn true;\r\n\t\t}\r\n\t}",
"public function view_cart()\n {\n $this->layout = 'cart';\n $cart = $this->Session->read('cart'); //doc session va gui session len tren view\n $payment = $this->Session->read('payment');\n $this->set(compact('cart','payment')); //gửi nhiều biến cùng 1 lúc lên view\n $this->set('title_for_layout', 'Giỏ hàng - ChickenRainShop');\n\n }",
"public function cartAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Giỏ hàng';\r\n\t\t$this->_view->motoInCart = $this->_model->listItem($this->_arrParam, ['task' => 'motos_in_cart']);\r\n\t\t$this->_view->render($this->_arrParam['controller'] . '/cart');\r\n\t}",
"public function showCartButton() {\n\t\t\n\t\techo $this->getCartButton();\n\t}",
"function displayCart($cart){\n\tif(count($cart) > 0)//Cart isn't empty\n\t{\t\n\t\t$totalPrice = 0;\n\t\tforeach ($cart as $item)\n\t\t{\n\t\t\t$totalPrice += $item['productQuantity']*$item['productPrice'];//quantity*price for each item in the cart to get total price\n\n\t\t\t/* Table to out data */\n\t\t\techo '<table class=\"table table-striped table-hover table-responsive\">';\n\t\t\techo\t'<tr style=\"border-bottom:none;\">';\n\t\t\techo\t\t'<td colspan=\"4\" class=\"col-sm-3 col-md-3 col-lg-3 align-left\">'.$item['productTitle'].'</td>';\n\t\t\techo\t'</tr>';\n\t\t\techo\t'<tr>';\n\t\t\techo\t\t'<td>x'.$item['productQuantity'].'</td>';\n\t\t\techo\t\t'<td>€'.$item['productPrice'].'</td>';\n\t\t\t\n\t\t\techo \t\t'<td>';\n\t\t\techo\t\t\t'<form id=\"cart-action\" method=\"post\">';\n\t\t\techo \t\t'<input type=\"hidden\" name=\"vendorId\" value=\"'.$item['vendorId'].'\">';\n\t\t\techo\t\t\t\t'<input type=\"hidden\" name=\"productId\" value=\"'.$item['productId'].'\">';\n\t\t\techo \t'<input type=\"hidden\" name=\"action\" value=\"add\">';\n\t\t\techo \t'<input type=\"hidden\" name=\"productTitle\" value=\"'.base64_decode($item['productTitle']).'\">';\n\t\t\techo \t'<input type=\"hidden\" name=\"productPrice\" value=\"'.$item['productPrice'].'\">';\n\t\t\techo \t\t'<button type=\"submit\"><a><span class=\"glyphicon glyphicon-plus-sign\"></span></a></button>';\n\t\t\techo \t\t\t'</form>';\n\t\t\techo \t\t'</td>';\n\t\t\t\n\t\t\techo\t\t'<td>';\n\t\t\techo \t\t\t'<form id=\"cart-action\" method=\"POST\">';\n\t\t\techo \t\t\t\t'<input type=\"hidden\" name=\"action\" value=\"remove\">';\n\t\t\techo \t\t\t\t\"<input type='hidden' name='productId' value=\".$item['productId'].\">\";\n\t\t\techo \t\t\t\t'<button type=\"submit\"><a><span class=\"glyphicon glyphicon-remove-circle\"></span></a></button>';\n\t\t\techo \t\t\t'</form>';\n\t\t\techo\t\t'</td>';\n\t\t\techo\t'</tr>';\n\t\t\techo '</table>';\n\t\t}\n\t\t\techo '<div class=\"cart-total-price\">';\n\t\t\t\techo '<p><strong>Total: €'.$totalPrice.'</strong></p>';\n\t\t\techo '</div>';\n\t\t\techo '<script type=\"text/javascript\">location.reload()</script>';//Temporary Page Reload for checkout order options to change\n\t\t}else{//Print not items selected\n\t\t\techo '<p>No Items Selected</p>';\n\t\t\t}\n}",
"function drawCart(){\n\t\t//start form and table tags\n\t\techo '<form name=\"cart\" action=\"\" method=\"POST\">';\n\t\techo '<h1>Cart</h1>';\n\t\techo '<table>';\n\t\techo '<tr><th>Name</th><th>Price</th><th>Quantity</th><th>Total</th><th>Remove</th></tr>';\n \t\n\t\t//hold the cumulative total price\n\t\t$totalPrice = 0;\n\t\t\n\t\t//display each item in the cart in a new table row \n\t\tforeach($_SESSION['cart']->items as $cartItem){\t\n\t\t\t\n\t\t\t//generate the total price for this item, and add it to the total price\n\t\t\t$itemTotalPrice = $cartItem['price'] * $cartItem['quantity'];\n\t\t\t$totalPrice += $itemTotalPrice;\n\t\t\t\n\t\t\t//item information\n\t\t\techo '<tr>';\n\t\t\techo \t'<td>' . $cartItem['name'] . '</td>';\n\t\t\techo \t'<td>' . number_format($cartItem['price'],2) . '</td>';\n\t\t\techo \t'<td>' . $cartItem['quantity'] . '</td>';\n\t\t\techo \t'<td>' . number_format($itemTotalPrice,2) . '</td>';\n\t\t\techo \t'<td>' . '<button type=\"submit\" name=\"removeItem\" value=\"'.$cartItem['name'].'\" >Remove Item</button>' . '</td>';\n\t\t\techo '</tr>';\n\t\t\t\n\t\t}\n\t\t//draw overall Total\n\t\techo '<tr>';\n\t\techo \t'<th>Overall Total</th><td></td><td></td>';\n\t\techo \t'<td>' . number_format($totalPrice,2) . '</td>';\n\t\techo '</tr>';\n\t\t\n\t\t//close the table and form tags\n\t\techo '</table><br>';\n\t\techo '</form>';\n\t\t\n\t}",
"public function Render() {\n\t$nQtyOrd = $this->Qty();\n\tif ($nQtyOrd > 0) {\n\t $htLineQty = $nQtyOrd;\n\n\t $mnyPrice = $this->Price();\t\t// item price\n\t $mnyPerItm = $this->SH_perItem();\t\t// per-item shipping\n\t $mnyPerPkg = $this->SH_perPackage();\t// per-pkg minimum shipping\n\t $mnyPriceQty = $mnyPrice * $nQtyOrd;\t// line total sale\n\t $mnyPerItmQty = $mnyPerItm * $nQtyOrd;\t// line total per-item shipping\n\t $mnyLineTotal = $mnyPriceQty + $mnyPerItmQty;\t// line total overall (does not include per-pkg minimum)\n\n\t $strCatNum\t\t= $this->CatNum();\n\t $strPrice\t\t= cCartLine_form::FormatMoney($mnyPrice);\n\t $strPerItm\t\t= cCartLine_form::FormatMoney($mnyPerItm);\n\t $strPriceQty\t= cCartLine_form::FormatMoney($mnyPriceQty);\n\t $strPerItmQty\t= cCartLine_form::FormatMoney($mnyPerItmQty);\n\t $strLineTotal\t= cCartLine_form::FormatMoney($mnyLineTotal);\n\t $strShipPkg\t\t= cCartLine_form::FormatMoney($mnyPerPkg);\n\n\t $htDesc = $this->Descrip();\n\n\t $htDelBtn = '';\n\t $sClass = __CLASS__;\n\t $out = <<<__END__\n<tr phpclass=\"$sClass\">\n<td>$htDelBtn$strCatNum</td>\n<td>$htDesc</td>\n<td class=cart-price align=right>$strPrice</td>\n<td class=shipping align=right>$strPerItm</td>\n<td class=qty align=right>$htLineQty</td>\n<td class=cart-price align=right>$strPriceQty</td>\n<td class=shipping align=right>$strPerItmQty</td>\n<td class=total align=right>$strLineTotal</td>\n<td class=shipping align=right>$strShipPkg</td>\n</tr>\n__END__;\n\t return $out;\n\t}\n }",
"public function getCartContentAsHtml($hidetotal=0){\r\n $content='<ul id=\"cartcontent\">'; $total=0; $count = 0;\r\n $cpt=1;\r\n if(!empty($this->items)){foreach($this->items as $item){\r\n $amount = $item['quantity']*$item['price'];\r\n $content.='<li class=\"cartitem\">'.$item['quantity'].' x \"'.$item['name'].'\" at '.$this->cursymbol.''.$item['price'];\r\n if($item['shipping']>0)$content.= ' + '.$this->cursymbol.''.$item['shipping'].' shipping ';\r\n $content.=' for '.$this->cursymbol.''.$amount;\r\n $content.='</li>';\r\n $total+=$amount;\r\n $count+=$item['quantity'];\r\n $cpt++;\r\n }}\t\r\n if($hidetotal!=1){ $content.='<li class=\"carttotal\">Total: '.$count.' Items for '.$this->cursymbol.''.$total.'</li>'; }\r\n $content.='</ul>';\r\n return $content;\r\n }",
"function list_cart_items()\n{\n\tforeach (WC()->cart->get_cart() as $cart_item) {\n\t\t$item_name = $cart_item['data']->get_title();\n\t\t$quantity = $cart_item['quantity'];\n\t\t$price = $cart_item['data']->get_price();\n\n\t\techo '\n\t\t<li class=\"list-group-item d-flex justify-content-between align-items-center\">\n\t\t\t<div>\n\t\t\t\t' . $item_name . '<span class=\"font-weight-bold\"> x ' . $quantity . '</span>\n\t\t\t</div>\n\t\t\t<span class=\"h5\">' . $price . '</span>\n\t\t</li>';\n\t};\n}",
"function displayCart(){\r\n\r\n\t\r\n\r\n\t$totalPrice = 0;\r\n\t$imageUrl = \" \";\r\n\tforeach ($_SESSION[\"cart\"] as $item ) {\r\n\t$totalPrice += $item->getPrice();\r\n\t$imageUrl =\t \"../\".$item->getImageUrl();\r\n\r\n\t$itemId = $item->getItemId()\r\n?>\r\n\t <div class=\"cart-header\">\r\n\t\t\t\t\r\n\t\t\t\t \t<a href = \"?action=removeItem&itemId=<?php echo $item->getItemId().\"&price=\".$item->getPrice(); ?>\">\r\n\t\t\t\t\t\t<div class=\"close1\"></div>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t \r\n\t\t\t\t <div class=\"cart-sec\">\r\n\t\t\t\t\t\t<div class=\"cart-item cyc\">\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t<?php echo'<img src=\"'.$imageUrl.'\" alt=\"\"/>' ?>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t <div class=\"cart-item-info\">\r\n\t\t\t\t\t\t\t<h3><?php echo $item->getItemName() ?>\r\n\t\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t \t<?php \r\n\t\t\t\t\t\t\t\t\t \t echo \"Item Id: \";\r\n\t\t\t\t\t\t\t\t\t \t\techo $itemId; \r\n\t\t\t\t\t\t\t\t\t \t?>\r\n\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t</h3>\r\n\t\t\t\t\t\t\t <h4><span>Price. R </span><?php echo $item->getPrice() ?></h4>\r\n\t\t\t\t\t\t\t <p class=\"qty\">Qty ::</p>\r\n\t\t\t\t\t\t\t <input min=\"1\" type=\"number\" id=\"quantity\" name=\"quantity\" value=\"1\" class=\"form-control input-small\">\r\n\t\t\t\t\t </div>\r\n\t\t\t\t\t <div class=\"clearfix\"></div>\r\n\t\t\t\t\t\t<div class=\"delivery\">\r\n\t\t\t\t\t\t\t <p>Service Charges:: Rs.50.00</p>\r\n\t\t\t\t\t\t\t <span>Delivered in 2-3 bussiness days</span>\r\n\t\t\t\t\t\t\t <div class=\"clearfix\"></div>\r\n\t\t\t\t </div>\t\t\t\t\t\t\r\n\t\t\t\t </div>\r\n</div>\r\n<?php\r\n\t}\r\n}",
"public function show()\n {\n return view('fontend.pages.cart.carts');\n }",
"function printCartMenu(){\n\t\t?>\n\t\t<div class=\"\" style=\"width: 500px; padding: 10px\">\n\t\t<?php\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$cantidad = $book['cantidad'];\n\t\t\t?>\n\t\t\t<li>\n \t\t<div >\n\t <a href='producto?id=<?php echo $bookid ?>' style='text-decoration: none'>\n\t \t<span class='badge pull-left'><?php echo $cantidad ?></span> <?php echo $book['titulo'] ?>\n\t </a> \n\t <button onclick=\"\n\t \t<?php\n\t \t\t//Javascript activado con el click, pide que se remueva el libro, al finalizar recarga el navbar.\n\t \t\techo (\n\t \t\t\t\"\n\t \t\t\tvar btn = $('#cartButton');\n\t \t\t\tbtn.button('loading');\n\t \t\t\t$.post('ajax.php', {type:'sc',action:'REMOVE', bookid:'\".$bookid.\"'}).done(\n\t\t\t\t\t\t\t\t\tfunction(data){\n\t\t\t\t\t\t\t\t\t\t$.post('navigation.php').done(\n\t\t\t\t\t\t\t\t\t\t\tfunction(navbar){\n\t\t\t\t\t\t\t\t\t\t\t\t$('#navigationBar').replaceWith(navbar);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\"\n\t\t\t\t\t\t\t);\n\t \t?>\n\t \" class=\"pull-right\" >\n\t \t<span class='glyphicon glyphicon-trash'></span>\n\t </button>\n </div>\n \t</li><br />\n \t<?php\n\t\t}\n\t\t?>\n\t\t\t<p>Total: $<?php echo $this->priceCart() ?>\n\t\t\t<button onclick=\"\n \t<?php\n \t\techo (\n \t\t\t\"\n \t\t\tvar btn = $('#cartButton');\n \t\t\tbtn.button('loading');\n \t\t\t$.post('ajax.php', {type:'sc',action:'EMPTY'}).done(\n\t\t\t\t\t\t\tfunction(data){\n\t\t\t\t\t\t\t\t$.post('navigation.php').done(\n\t\t\t\t\t\t\t\t\tfunction(navbar){\n\t\t\t\t\t\t\t\t\t\t$('#navigationBar').replaceWith(navbar);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\"\n\t\t\t\t\t);\n \t?>\n\t \" class=\"pull-right\" >\n\t \t<span class='glyphicon glyphicon-trash'> Vaciar</span>\n </button>\n \n\t\t\t<button class=\"pull-right\" onclick=\"document.location='buy.php'\">\n\t\t\t\t<span class='glyphicon glyphicon-shopping-cart'> Comprar</span>\n\t\t\t</button>\n </p>\n\t\t</div>\n\t\t<?php\n\t}",
"public function view_cart(){\n\t\t//Devuelve el carrrtio\n\t\t$data['title'] = 'Detalle de la Compra';\n\t\t$data['active'] = 2; //punto 2 del sidebar\n\t\t//Obtener carrito\n\t\t$userid = $_SESSION['logged_in']['userid'];\n\t\t$data['carrito'] = $this->cila_model->get_carrito($userid);\n\t\t$this->loadview('shop-cart',$data);\n\n\t}",
"public function showCart()\n {\n $carts=Cart::content();\n foreach ($carts as $cart) {\n $products = Products::findOrFail($cart->id);\n $quantityInStock = $products->quantityInStock - $cart->qty;\n DB::table('products')\n ->where('id','=', $cart->id)\n ->update(['quantityInStock' => $quantityInStock]);\n }\n $total=Cart::total();\n return view('users.pages.cart', compact('carts', 'total'));\n }",
"public function cartView()\n {\n $cartItems = Cart::content();// получаем весь массив айдишников товаров текущего экземпляра корзины\n\n return view('basket', ['items' => $cartItems]);\n }",
"public function renderBuy(){\n $lst = $this->hlp->sess(\"listing\");\n $this->template->finalPriceBTC = $lst->finalPriceBTC;\n $this->template->finalPriceCZK = $lst->finalPriceCZK;\n }",
"function lb_show_view_cart_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'view-cart',\n\t\t)\n\t);\n}",
"public function index()\n\t{\n# \\Cart::destroy();return;\n $contents = \\Cart::content()->paginate(5);\n// foreach ($contents as $row) {\n//// echo 'You have ' . $row->qty . ' items of ' . $row->product->name . ' with description: \"' . $row->product->description . '\" in your cart.';\n// }\n\n $total = number_format(\\Cart::total(), 2);\n $this->view('shopcart.index', compact('contents', 'total'));\n\n\t}",
"function show_cart(){\n\t\t$output = '';\n\t\t$no = 0;\n\t\tforeach ($this->cart->contents() as $items) {\n\t\t\t$no++;\n\t\t\t$output .='\n\t\t\t\t<tr>\n\t\t\t\t\t<td>'.$items['name'].'</td>\n\t\t\t\t\t<td>'.number_format($items['price']).'</td>\n\t\t\t\t\t<td>'.$items['qty'].'</td>\n\t\t\t\t\t<td>'.number_format($items['subtotal']).'</td>\n\t\t\t\t\t<td><button type=\"button\" id=\"'.$items['rowid'].'\" class=\"hapus_cart btn btn-danger btn-xs\">Batal</button></td>\n\t\t\t\t</tr>\n\t\t\t';\n\t\t}\n\t\t$output .= '\n\t\t\t<tr>\n\t\t\t\t<th colspan=\"3\">Total</th>\n\t\t\t\t<th colspan=\"2\">'.'Rp '.number_format($this->cart->total()).'</th>\n\t\t\t</tr>\n\t\t';\n\t// \tforeach ($this->cart->contents() as $item) {\n\t// \t$output .='\n\t// \t\t<tr>\n\t// \t\t<form action=\"'.base_url('pemesanan').'\" method=\"post\" >\n\t// \t\t<td><input type=\"hidden\" name=\"id_menu\" value=\"'.$item['id'].'\"</td>\n\t// \t\t<td><input type=\"hidden\" name=\"total_harga\" value=\"'.$item['subtotal'].'\"</td>\n\t// \t\t<td><input type=\"hidden\" name=\"jml_beli\" value=\"'.$item['qty'].'\"</td>\n\t// \t\t<td><input type=\"submit\" class=\"btn\" value=\"Bayar\"></td>\n\t// \t\t</form>\n\t// \t\t</tr>\n\t// \t';\n\t// }\n\t\treturn $output;\n\t}",
"public function actionIndex(){\n\n $session = Yii::$app->session;\n\n $items = $session['cart'];\n\n return $this->render('index',[\n 'items' => $items,\n ]);\n\n }",
"public static function cart_show(){\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\tif (isset($_SESSION['cartArray']) && !empty($_SESSION['cartArray'])) {\r\n\r\n\t\t\t\t$cartArray = $_SESSION['cartArray'];\r\n\t\t\t\t\t$cartString = implode(\",\", array_unique($cartArray));\r\n\t\t\t\t\t$cartString = RBAgency_Common::clean_string($cartString);\r\n\r\n\t\t\t\t// Show Cart\r\n\t\t\t\t$query = \"SELECT profile.*,media.* FROM \". table_agency_profile .\" profile, \". table_agency_profile_media .\" media WHERE profile.ProfileID = media.ProfileID AND media.ProfileMediaType = \\\"Image\\\" AND media.ProfileMediaPrimary = 1 AND profile.ProfileID IN (\". $cartString .\") ORDER BY profile.ProfileContactNameFirst ASC\";\r\n\t\t\t\t$results = $wpdb->get_results($query,ARRAY_A) or die( \"<a href=\\\"?page=\". $_GET['page'] .\"&action=cartEmpty\\\" class=\\\"button-secondary\\\">\". __(\"No profile selected. Try again\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\"); //die ( __(\"Error, query failed\", RBAGENCY_casting_TEXTDOMAIN ));\r\n\t\t\t\t$count = $wpdb->num_rows;\r\n\t\t\t\techo \"<div class=\\\"boxblock-container\\\" style=\\\"float: left; padding-top:24px; width: 49%; min-width: 500px;\\\">\\n\";\r\n\t\t\t\techo \"<div style=\\\"float: right; width: 100px; \\\"><a href=\\\"?page=\". $_GET['page'] .\"&action=cartEmpty\\\" class=\\\"button-secondary\\\">\". __(\"Empty Cart\", RBAGENCY_casting_TEXTDOMAIN) .\"</a></div>\";\r\n\t\t\t\techo \"<div style=\\\"float: left; line-height: 22px; font-family:Georgia; font-size:13px; font-style: italic; color: #777777; \\\">\". __(\"Currently\", RBAGENCY_casting_TEXTDOMAIN) .\" <strong>\". $count .\"</strong> \". __(\"in Cart\", RBAGENCY_casting_TEXTDOMAIN) .\"</div>\";\r\n\t\t\t\techo \"<div style=\\\"clear: both; border-top: 2px solid #c0c0c0; \\\" class=\\\"profile\\\">\";\r\n\r\n\t\t\t\tif ($count == 1) {\r\n\t\t\t\t\t$cartAction = \"cartEmpty\";\r\n\t\t\t\t} elseif ($count < 1) {\r\n\t\t\t\t\techo \"\". __(\"There are currently no profiles in the casting cart\", RBAGENCY_casting_TEXTDOMAIN) .\".\";\r\n\t\t\t\t\t$cartAction = \"cartEmpty\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$cartAction = \"cartRemove\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforeach ($results as $data) {\r\n\r\n\t\t\t\t\t$ProfileDateUpdated = $data['ProfileDateUpdated'];\r\n\t\t\t\t\techo \" <div style=\\\"position: relative; border: 1px solid #e1e1e1; line-height: 22px; float: left; padding: 10px; width: 210px; margin: 6px; \\\">\";\r\n\t\t\t\t\techo \" <div style=\\\"text-align: center; \\\"><h3>\". stripslashes($data['ProfileContactNameFirst']) .\" \". stripslashes($data['ProfileContactNameLast']) . \"</h3></div>\";\r\n\t\t\t\t\techo \" <div style=\\\"float: left; width: 100px; height: 100px; overflow: hidden; margin-top: 2px; \\\"><img style=\\\"width: 100px; \\\" src=\\\"\". RBAGENCY_UPLOADDIR .\"\". $data['ProfileGallery'] .\"/\". $data['ProfileMediaURL'] .\"\\\" /></div>\\n\";\r\n\t\t\t\t\techo \" <div style=\\\"float: left; width: 100px; height: 100px; overflow: scroll-y; margin-left: 10px; line-height: 11px; font-size: 9px; \\\">\\n\";\r\n\r\n\t\t\t\t\tif (!empty($data['ProfileDateBirth'])) {\r\n\t\t\t\t\t\techo \"<strong>\".__(\"Age:\",RBAGENCY_casting_TEXTDOMAIN).\"</strong> \". rb_agency_get_age($data['ProfileDateBirth']) .\"<br />\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// TODO: ADD MORE FIELDS\r\n\r\n\t\t\t\t\techo \" </div>\";\r\n\t\t\t\t\techo \" <div style=\\\"position: absolute; z-index: 20; top: 120px; left: 200px; width: 20px; height: 20px; overflow: hidden; \\\"><a href=\\\"?page=\". $_GET['page'] .\"&actiontwo=cartRemove&action=cartAdd&RemoveID=\". $data['ProfileID'] .\"&\\\" title=\\\"\". __(\"Remove from Cart\", RBAGENCY_casting_TEXTDOMAIN) .\"\\\"><img src=\\\"\". RBAGENCY_PLUGIN_URL .\"style/remove.png\\\" style=\\\"width: 20px; \\\" alt=\\\"\". __(\"Remove from Cart\", RBAGENCY_casting_TEXTDOMAIN) .\"\\\" /></a></div>\";\r\n\t\t\t\t\techo \" <div style=\\\"clear: both; \\\"></div>\";\r\n\t\t\t\t\techo \" </div>\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\techo \" <div style=\\\"clear: both;\\\"></div>\\n\";\r\n\t\t\t\techo \"</div>\";\r\n\r\n\t\t\t\tif (($cartAction == \"cartEmpty\") || ($cartAction == \"cartRemove\")) {\r\n\t\t\t\techo \"<a name=\\\"compose\\\"> </a>\";\r\n\t\t\t\techo \"<div class=\\\"boxblock\\\">\\n\";\r\n\t\t\t\techo \" <h3>\". __(\"Cart Actions\", RBAGENCY_casting_TEXTDOMAIN) .\"</h3>\\n\";\r\n\t\t\t\techo \" <div class=\\\"inner\\\">\\n\";\r\n\t\t\t\techo \" <a href=\\\"?page=rb_agency_searchsaved&action=searchSave\\\" title=\\\"\". __(\"Save Search & Email\", RBAGENCY_casting_TEXTDOMAIN) .\"\\\" class=\\\"button-primary\\\">\". __(\"Save Search & Email\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\\n\";\r\n\t\t\t\techo \" <a href=\\\"?page=rb_agency_search&action=massEmail#compose\\\" title=\\\"\". __(\"Mass Email\", RBAGENCY_casting_TEXTDOMAIN) .\"\\\" class=\\\"button-primary\\\">\". __(\"Mass Email\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\\n\";\r\n\t\t\t\techo \" <a href=\\\"#\\\" onClick=\\\"window.open('\". get_bloginfo(\"url\") .\"/profile-print/?action=castingCart&cD=1','mywindow','width=930,height=600,left=0,top=50,screenX=0,screenY=50,scrollbars=yes')\\\" title=\\\"Quick Print\\\" class=\\\"button-primary\\\">\". __(\"Quick Print\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\\n\";\r\n\t\t\t\techo \" <a href=\\\"#\\\" onClick=\\\"window.open('\". get_bloginfo(\"url\") .\"/profile-print/?action=castingCart&cD=0','mywindow','width=930,height=600,left=0,top=50,screenX=0,screenY=50,scrollbars=yes')\\\" title=\\\"Quick Print - Without Details\\\" class=\\\"button-primary\\\">\". __(\"Quick Print\", RBAGENCY_casting_TEXTDOMAIN) .\" - \". __(\"Without Details\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\\n\";\r\n\t\t\t\techo \" </div>\\n\";\r\n\t\t\t\techo \"</div>\\n\";\r\n\t\t\t\t}// Is Cart Empty\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\techo \"<p>There are no profiles added to the casting cart.</p>\\n\";\r\n\r\n\t\t\t}\r\n\r\n\r\n\t\t}",
"public function index()\n\t{\n\t\t$items = \\Cart::getContent();\n\t\t$this->data['items'] = $items;\n\n\t\treturn $this->load_theme('carts.index', $this->data);\n\t}",
"public function show(cart $cart)\n {\n //\n }",
"public function cart()\n {\n\n $cartCollection = \\Cart::getContent();\n\n return view('cart',compact('cartCollection'));\n }",
"public function index()\n\t{\n\t\t// $this->load->model('Product');\n\t\t// $queryRecords = $this->Product->list_product();\n\t\t// $data['products'] = $queryRecords; \n\t\t$data['cart_list'] = $this->cart->contents();\n\n\t\t$this->load->view('cart',$data);\n\t}",
"function view()\n\t{\n\t\t$data[] = 0;\n\t\t$num_items = $this->cart->total_items();\n\t\tgenerate_header($data);\n\t\t$this->_set_stock_info($data);\n\n\t\tcheck_domain_discount();\n\n\t\tif($num_items)\n\t\t{\n\t\t\t//$this->_show_cheat_code_after_timeout(5000);\n\t\t}\n\n\t\tif($this->config->item('auto_discounts'))\n\t\t{\n\t\t\t$this->_apply_auto_disc();\n\t\t}\n\n\t\t$data['cheat_hints'] = $this->load->view('cheatcode_hints', null, true);\n\t\tdisplay('cart',$data);\n\t}",
"public function index() \n\t{\n $this->initModel('Cart_model');\n\n\t\tif(!empty($_SESSION['cart']->getProdList()))\n\t\t{\n //We instansiate cartItems method where we save the new array from session\n\t\t$data = $this->modelObj->showCart();\n $this->reqView('Cart', $data);\n\n\t\t} else {\n\t\t\t$this->reqView('Cart');\n\t\t}\n //This will be shown on our cart page\n\t}",
"public function formato_cartas() {\n\t\t\n\t\t$this->layout->title('Advanzer - Carta y Constancia Laboral');\n\t\t$this->layout->view('servicio/formato_carta');\n\t}",
"function foodgrower_cart_link() {\n\t\t?>\n\t\t\t<a class=\"cart-contents\" href=\"<?php echo esc_url( WC()->cart->get_cart_url() ); ?>\" title=\"<?php esc_attr_e( 'View your shopping cart', 'storefront' ); ?>\">\n\t\t\t\t<span class=\"count\"><?php echo wp_kses_data( sprintf( _n( '%d ', '%d ', WC()->cart->get_cart_contents_count(), 'storefront' ), WC()->cart->get_cart_contents_count() ) );?></span>\n\t\t\t\t<img src=\"<?php echo get_stylesheet_directory_uri(); ?>/assets/images/cart.jpg\" class=\"img-responsive\">\n\t\t\t</a>\n\t\t<?php\n\t}",
"function displayCart()\n{\n if (isset($_SESSION['cart']))\n {\n //echo \"count = \" + count($_SESSION['cart']);\n \n if (count($_SESSION['cart']) == 0)\n {\n echo \"<h3>no items in cart</h3>\";\n return;\n }\n \n echo \"<table>\";\n echo \"<tr>\";\n echo \"<th class='cart cartImage'></th>\";\n echo \"<th class='cart'>Name</th>\";\n echo \"<th class='cart'>Base Price</th>\";\n echo \"<th class='cart'>Sale Price</th>\";\n echo \"<th class='cart'>Quantity</th>\";\n echo \"<th class='cart'></th>\";\n echo \"<th class='cart'></th>\";\n echo \"</tr>\";\n \n foreach ($_SESSION['cart'] as $item)\n {\n // grab the data from the array\n $id = $item['id'];\n $quantity = $item['quantity'];\n $name = $item['name'];\n $basePrice = $item['basePrice'];\n $salePrice = $item['salePrice'];\n $imageUrl = $item['imageUrl'];\n $desc = $item['desc'];\n \n // display the item as a table row\n echo \"<tr>\";\n echo \"<td class='cart cartImage'>\";\n echo empty($imageUrl) || $imageUrl == NULL ? \" \" : \"<img class='productImage' src='$imageUrl' width=100>\";\n echo \"</td>\";\n echo \"<td class='cart cartName'>$name</td>\";\n echo \"<td class='cart cartBasePrice'>\\$\" . number_format($basePrice,2) . \"</td>\";\n echo \"<td class='cart cartSalePrice'>\\$\" . number_format($salePrice,2) . \"</td>\";\n \n //name='update' class='form-control' placeHolder='$itemQuant'\n \n // form for quantity updates\n echo '<form method=\"post\">';\n echo \"<input type='hidden' name='itemId' value='$id'>\";\n echo \"<td class='cart'><input type='text' class='form-control' name='update' placeholder='$quantity' /></td>\";\n echo '<td class=\"cart\"><button class=\"btn btn-warning\">Update</button></td>';\n echo '</form>';\n \n // onclick='alert(\\\"id : \\\" $id \\\\n\\\"quantity : \\\" $quantity);'\n \n // handle the deletes\n echo \"<form method='post'>\";\n echo \"<input type='hidden' name='removeId' value='$id'>\";\n echo \"<td class='cart'><button class='btn btn-danger'>Remove</button></td>\";\n echo \"</form>\";\n \n echo \"</tr>\";\n }\n \n // build the totals display\n displayCartTotals();\n \n // show the checkout button\n echo \"<tr><td colspan=7 class='cartTotals'><br/>--------------------------</td></tr>\";\n echo \"<tr><td colspan=7 class='cartTotals'><a href='checkout.php' alt='Checkout'><button class='btn btn-danger'>Checkout</button></td></tr>\";\n \n echo \"</table>\";\n }\n}",
"public function renderBigCart() {\n\n $L = Mage::getSingleton('core/layout');\n\n\n $totals = $L\n ->createBlock('checkout/cart_totals')\n ->setTemplate('checkout/cart/totals.phtml')\n ;\n $shipping = $L\n ->createBlock('checkout/cart_shipping')\n ->setTemplate('checkout/cart/shipping.phtml')\n ;\n\n $coupon = $L\n ->createBlock('checkout/cart_coupon')\n ->setTemplate('checkout/cart/coupon.phtml')\n ;\n\n // top methods\n\n $t_onepage = $L\n ->createBlock('checkout/onepage_link')\n ->setTemplate('checkout/onepage/link.phtml')\n ;\n $t_methods = $L\n ->createBlock('core/text_list')\n ->append($t_onepage, 'top_methods');\n\n\n //methods\n $onepage = $L\n ->createBlock('checkout/onepage_link')\n ->setTemplate('checkout/onepage/link.phtml')\n ;\n\n $multishipping = $L\n ->createBlock('checkout/multishipping_link')\n ->setTemplate('checkout/multishipping/link.phtml')\n ;\n\n\n\n\n $methods = \t$L\n ->createBlock('core/text_list')\n ->append($onepage, \"onepage\")\n ->append($multishipping, \"multishipping\");\n\n\n // Cross-sales etc\n\n $crossel = $L\n ->createBlock('checkout/cart_crosssell')\n ->setTemplate('checkout/cart/crosssell.phtml')\n ;\n\n\n Mage::getSingleton('checkout/session')->setCartWasUpdated(true);\n\n $cart1 = $L\n ->createBlock('checkout/cart')\n ->setEmptyTemplate('checkout/cart/noItems.phtml')\n ->setCartTemplate('checkout/cart.phtml')\n ->addItemRender('simple', 'checkout/cart_item_renderer', 'checkout/cart/item/default.phtml')\n ->addItemRender('configurable', 'checkout/cart_item_renderer_configurable', 'checkout/cart/item/default.phtml')\n ->addItemRender('grouped', 'checkout/cart_item_renderer_grouped', 'checkout/cart/item/default.phtml')\n ->addItemRender('downloadable', 'downloadable/checkout_cart_item_renderer', 'downloadable/checkout/cart/item/default.phtml')\n ->addItemRender('bundle', 'bundle/checkout_cart_item_renderer', 'checkout/cart/item/default.phtml')\n ->addItemRender('subscription_simple', 'sarp/checkout_cart_item_renderer_simple', 'checkout/cart/item/default.phtml')\n ->addItemRender('bookable', 'booking/checkout_cart_item_renderer', 'checkout/cart/item/default.phtml')\n ->setTemplate('checkout/cart.phtml')\n ->setChild('top_methods',$t_methods)\n ->setChild('totals', $totals)\n ->setChild('shipping', $shipping)\n ->setChild('coupon', $coupon)\n ->setChild('methods', $methods)\n ->setChild('crosssell', $crossel)\n ;\n $cart1\n ->chooseTemplate();\n \n $readyCart = trim($cart1->renderView());\n\n /* Checkout Promo compatibility */\n $checkoutPromoName = 'AW_Checkoutpromo';\n if ($this->extensionEnabled($checkoutPromoName))\n {\n $CPcart = '';\n if (version_compare($this->getExtensionVersion($checkoutPromoName), '1.2.0') >= 0)\n {\n $appliedBlockIds = Mage::app()->getLayout()->createBlock('checkoutpromo/checkoutpromo')->getAppliedBlockIds();\n }\n else\n {\n $appliedBlockIds = Mage::helper('checkoutpromo')->getAppliedBlockIds();\n }\n if (is_array($appliedBlockIds) && array_key_exists('shoppingcartpromo', $appliedBlockIds))\n {\n foreach ($appliedBlockIds['shoppingcartpromo'] as $appliedBlockId)\n {\n $CPcart .= $L->createBlock('cms/block')\n ->setBlockId($appliedBlockId)\n ->toHtml();\n }\n }\n $readyCart = $CPcart.$readyCart;\n }\n\n return $readyCart;\n }",
"public function cart(){\n return view('pages.cart', compact('cart'));\n }",
"public function actionShow() {\n $session = $this->session;\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'cart_products', 'items_to_show'));\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function tempCart()\n\t{\n\t\t$cart_id = $_SESSION['wpcart_cart_id'];\n\n\t\t//$checkout_page = 'wpcart';\n\n\t\tswitch ($checkout_page) {\n\t\t\tcase 'wpcart':\n\t\t\t\t\n\t\t\t\t\t$action = site_url() . '?checkout';\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'paypal':\n\n\t\t\t\t\t$action = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\t$action = '';//site_url() . '?checkout''';\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$template = '<script type=\"text/template\" id=\"wpcart-ajax-template\" >\n\n\t\t<!-- PayPal details -->\n\t\t<input type=\"hidden\" value=\"<%= product.name %>\" name=\"item_name_1\" />\n\t\t<input type=\"hidden\" value=\"<%= product.price %>\" name=\"amount_16\" />\n\t <input type=\"hidden\" name=\"quantity_1\" value=\"<%= quantity %>\">\n\n\t\t<!-- End of PayPal details -->\n\n\t\t<strong><%= product.name %></strong> \n\t\t(<span style=\"width: 45px;\" class=\"wpcart-item-quantity\" ><%= quantity %></span> item<%= (quantity > 1) ? \"s\" : \"\" %> ) \n\t\t<span style=\"color: #cc0000;\" ><span>$</span><span class=\"item-subtotal\" ><%= product.price * quantity %></span> \n\t\t<span class=\"wpcart-remove-item\" >[×] </span>\n\n\t\t</script>';\n\n\t\t$notify_url = admin_url() . 'admin-ajax.php?action=wpcart_ipn';\n\t\t$cart = $template;\n\n\t\t$cart .= '<div id=\"wpcart-cart\" class=\"wpcart-basket\" >\n\n\t\t<form method=\"post\" action=\"'. $action . '\" >\n\t <input type=\"hidden\" name=\"business\" value=\"payhere@actionphp.com\"/>\n\t <input type=\"hidden\" name=\"notify_url\" value=\"' . $notify_url\n\t . '\"/>\n\t\t<input type=\"hidden\" name=\"cmd\" value=\"_cart\"/>\n\t\t<input type=\"hidden\" name=\"upload\" value=\"1\"/>\n\t <input type=\"hidden\" name=\"custom\"\tvalue=\"' . $cart_id . '\" />\n\n\t\t\t<ul id=\"wpcart-cart-basket\"></ul>\n\t\t\t\n\t\t\t<div style=\"padding: 10px;\" ><strong>Subtotal: </strong>$<span class=\"wpcart-subtotal\" ></span></div>\n\t\t\t<div id=\"wpcart-buttons\" >\n\t\t\t<input type=\"hidden\" name=\"wpcart_checkout\" value=\"true\" />\n\t\t\t<input type=\"submit\" value=\"Checkout\" />\n\t\t\t</div>\n\n\t\t</form>\n\t\t\n\t\t</div>';\n\n\t\treturn $cart;\n\t}",
"public function index()\n {\n $cartItems = $this->cartItems();\n $cartTotalPrice = $this->cartTotalAmount();\n // return $cartItems;\n return view('cart.index')->with([\n 'cartItems' => $cartItems,\n 'cartTotalPrice' => $cartTotalPrice\n ]);\n }",
"public function index()\n {\n $userId = \\Auth::user()->id;\n $cartContent = \\Cart::session($userId)->getContent();\n \n $itemsInCart = [];\n foreach ($cartContent as $cartItem) {\n $itemsInCart[] = Product::findOrFail($cartItem['id'])->toArray();\n }\n $sorteditemsInCart = collect($itemsInCart)->sortBy('brand')->all();\n\n return view('checkout', [\n 'itemsInCart' => $sorteditemsInCart,\n 'cartContent' => $cartContent,\n 'cartTotalPrice' => \\Cart::session($userId)->getTotal()\n ]);\n }",
"public function render() {\n $htmlContent = \"\";//Main Content\n \n //id und class Bezeichnungen der HTML Elementen\n $idContent = \"content\";\n $classProduct = \"product-detail\";\n $classImage = \"img-preview-detail\";\n $classDescription = \"description\";\n $classDescriptionText = \"description-text-detail\";\n $label1 = \"label1\";\n\n //local config\n $maxDescriptionCharlenght = 20000;\n $imagePath = \"/src/theme/images/\";\n $lang_pageTitel = i(\"Productview\");\n $button1 = (\"Buy\");\n \n //Product array\n $products = array();\n\n //TSCM TODO get from DB instead from Session..\n $products = $_SESSION['products'];\n\n\n //Array erstellen\n //TODO Array aus DB holen und verifizieren\n foreach($products as $book){\n\n// exit;\n if($_GET['id'] != $book['ISBN Number']){\n continue;\n }\n\n $paragraph = Utilities::buildParagraph($book);\n\n //too long text?\n if(strlen ( $book['Description'] ) > $maxDescriptionCharlenght)\n {\n $book['Description'] = substr ( $book['Description'] , 0 , $maxDescriptionCharlenght );\n $book['Description'] = $book['Description'] . \"...\";\n }else{\n //not too long, display it all\n $modDescription = $book['Description'];\n }\n \n/*\n * schwf5: Element in Warenkorb legen \n */\n\n//Auslesen der BuchID\nif(isset($_GET[\"id\"])) \n$currentID = $_GET[\"id\"];\nelse \n\t$currentID = 0; \n \n//Prüfen ob Seite mit added action geladen wurde (d.h. dass Buch in Korb gelegt wurde)\nif((isset($_GET[\"action\"])) && $_GET[\"action\"]==\"added\") {\n\n\t$amount = $_POST[\"amountSelection\"];\n\t//Seite wurde neu geladen. Prüfen, ob bereits ein Warenkorb existiert\n\t\n\t//Korb existiert schon. Items also in den Warenkorb hinzufügen\n\tif(isset($_COOKIE[\"shoppingCart\"])) {\n\t\t$cartArray = json_decode($_COOKIE[\"shoppingCart\"]);\n\t\tarray_push($cartArray, array (\"ID\"=>$currentID, \"amount\"=>$amount));\n\t\tsetcookie(\"shoppingCart\", json_encode($cartArray));\n\t}\n\t\n\t\n\t//neuen Korb machen mit erstem Item\n\telse { \n\t$cartArray = array\t(\n\t\tarray (\"ID\"=>$currentID, \"amount\"=>$amount));\n\tsetcookie(\"shoppingCart\", json_encode($cartArray));\n\t}\n\t\n\t//\n\t\n\t\n} \n\n\nelse \n\t;\n\n$htmlContent .= \"\n <div class=\\\"$classProduct\\\">\n <div class=\\\"$classImage\\\"><img src=\\\"\".$imagePath.$book['Picture'].\"\\\" />\n </div>\n <div class=\\\"$classDescription\\\">\n\n $paragraph\n\n <div>\n <a href='index.php?view=payment&id={$_GET[\"id\"]}'>\n <input class='buy_button' type='button' value='\".$button1.\"'></input>\n </a>\n \n <br>Amount: \n <form action='index.php?view=productdetail&id=$currentID&action=added' method='post'>\n <select name='amountSelection'>\n\t\t\t\t\n \t\t\t\t\t <option value='1'>1</option>\n \t\t\t\t\t <option value='2'>2</option>\n \t\t\t\t\t <option value='3'>3</option>\n \t\t\t\t\t <option value='4'>4</option>\n \t\t\t\t\t <option value='5'>5</option>\n \t\t\t\t\t \n\t\t\t\t\t</select>\n\t\t\t\t\t<input type='submit' name='submit' value='Add to Cart' />\n\t\t\t\t\t</form>\n \t\t\n \t\t\n \t\t\n </div>\n \n </div>\n </div>\";\n \n\n }\n\n\nif(isset($_GET[\"action\"])){\n\t\n\t$buyState= \"Produkt wurde in den Warenkorb gelegt.<br>\";\n\t\t\n} else $buyState=\"\";\n\t\n$htmlContentBody = \"\n\t\t<div id=\\\"content\\\">\n <span style='color:red'>$buyState</span>\n \n <h1>$lang_pageTitel</h1>\n $htmlContent\n </div>\n \n\";\n\n\nreturn $htmlContentBody;\n\n\n}",
"private function viewBasket() {\n $this->_session->put('url', $_SERVER['REQUEST_URI']);\n $contents = $this->_model->getContents();\n $products = array();\n foreach ($contents as $reference => $data) {\n $products[$data['product']] = $data;\n }\n $this->_template->basketProducts = $products;\n // $this->_template->total = $this->_basket->getTotal();\n $this->_template->buildFromTemplates('header.php', 'sidebar.php', 'main.basket.php', 'footer.php');\n }",
"function pre_r($array) // This will show the array after the user clicks 'add to cart' in a pretty way.\n{\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n}",
"public function show()\n {\n $cart = Cart::content();\n\n return view('customer_side.pages.cart') ->with('cart', $cart);\n }",
"public function cart()\n {\n return view('carts.cart');\n }",
"public function run()\n {\n \t\n return view('widgets.ajax_cart')->with([\n \t\t\t\t\t\t\t\t\t\t'total'=>Cart::total(),\n \t\t\t\t\t\t\t\t\t\t'count'=>Cart::count()\n \t\t\n ]); \n }",
"public function giohang(){\n\t\t$content = Cart::content();\n\t\t$total = Cart::total();\n\t\treturn view('frontend.cart',compact('content','total'));\n\t}",
"public function getCartHead()\n {\n $user_id = 0;\n if(Auth::check()){\n $user_id = Auth::id();\n }else{\n $user_id = (Cookie::has('user_id') ? Cookie::get('user_id') : Session::get('user_id'));\n }\n $getCart = Cart::where('user_id', $user_id)->orderBy('id', 'desc')->get();\n\n if(count($getCart)>0){\n echo view('frontend.carts.cart-head')->with(compact('getCart'));\n }else{\n echo '<h4 style=\"color:red;text-align: center;padding: 0px\">Your cart is empty.</h4>';\n }\n }",
"public function cartAction() {\n\t\t$result = $this->_updateShoppingCart();\n\n\t\tif ($result !== true) {\n\t\t\t$response = array('status' => 1, 'message' => $result);\n\t\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t\t\treturn;\n\t\t}\n\n\t\t$response = array('status' => 0);\n\n\t\t$quote = $this->_getCart()->getQuote();\n\t\t$checkoutHelper = Mage::helper('checkout');\n\n\t\t$items = array();\n\t\tforeach ($quote->getAllVisibleItems() as $item) {\n\t\t\t$items[] = array(\n\t\t\t\t'id' => $item->getId(),\n\t\t\t\t'qty' => $item->getQty(),\n\t\t\t\t'rowtotal' => $checkoutHelper->formatPrice($item->getRowTotal()),\n\t\t\t);\n\t\t}\n\n\t\t$response['items'] = $items;\n\n\t\t$totals = $quote->getTotals();\n\t\tif (isset($totals['subtotal'])) {\n\t\t\t$response['subtotal'] = $checkoutHelper->formatPrice($totals['subtotal']->getValue());\n\t\t}\n\t\tif (isset($totals['shipping'])) {\n\t\t\t$response['shipping'] = $checkoutHelper->formatPrice($totals['shipping']->getAddress()->getShippingAmount());\n\t\t}\n\t\tif (isset($totals['discount'])) {\n\t\t\t$response['discount'] = $checkoutHelper->formatPrice($totals['discount']->getValue());\n\t\t}\n\t\tif (isset($totals['grand_total'])) {\n\t\t\t$response['grand_total'] = $checkoutHelper->formatPrice($totals['grand_total']->getValue());\n\t\t}\n\n\t\t$response['version'] = strtotime($quote->getUpdatedAt());\n\n\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t}",
"function get_fu_view_cart() {\n if ( WC()->cart->get_cart_contents_count() > 0 ) {\n return \"<p>Your cart contains items and can be viewed <a href=\\\"\" . home_url( '/cart/' ) . \"\\\">here</a>.</p>\";\n }\n}",
"public function index()\n {\n //$cart = Cart::content();\n session::remove('orderid');\n\n // dd(Cart::instance('finalboqcart')->content());\n return view('customer_side.pages.cart');\n\n }",
"public function goToCart(){\n $cart = Cart::content();\n $this->data['cart'] = $cart;\n return view('Customer.Layouts.cart',$this->data);\n }",
"function listCart()\n{\n global $xoopsTpl, $uid;\n $cartForTemplate = $discountsDescription = array();\n $emptyCart = false;\n $shippingAmount = $commandAmount = $vatAmount = $commandAmountTTC = $discountsCount = $ecotaxeAmount = $discountAmount = $totalSavings = 0;\n $goOn = '';\n $reductions = new oledrion_reductions();\n $reductions->computeCart($cartForTemplate, $emptyCart, $shippingAmount, $commandAmount, $vatAmount, $goOn, $commandAmountTTC, $discountsDescription, $discountsCount, $ecotaxeAmount, $discountAmount, $totalSavings );\n $oledrion_Currency = & oledrion_Currency::getInstance();\n $xoopsTpl->assign('emptyCart', $emptyCart);\t\t\t\t\t\t\t\t\t\t\t// Caddy Vide ?\n $xoopsTpl->assign('caddieProducts', $cartForTemplate);\t\t\t\t\t\t\t\t// Produits dans le caddy\n $xoopsTpl->assign('shippingAmount', $oledrion_Currency->amountForDisplay($shippingAmount));\t\t// Montant des frais de port\n $xoopsTpl->assign('ecotaxeAmount', $oledrion_Currency->amountForDisplay($ecotaxeAmount));\t\t// Montant des frais de port\n $xoopsTpl->assign('commandAmount', $oledrion_Currency->amountForDisplay($commandAmount));\t\t// Montant HT de la commande\n $xoopsTpl->assign('discountAmount', $oledrion_Currency->amountForDisplay($discountAmount));\t\t// Total Discount\n $xoopsTpl->assign('totalSavings', $oledrion_Currency->amountForDisplay($totalSavings));\t\t// Total Savings\n $xoopsTpl->assign('vatAmount', $oledrion_Currency->amountForDisplay($vatAmount));\t\t\t\t// Montant de la TVA\n $xoopsTpl->assign('discountsCount', $discountsCount);\t\t\t\t\t\t\t\t// Nombre de réductions appliquées\n $xoopsTpl->assign('goOn', $goOn);\t\t\t\t\t\t\t\t\t\t\t\t\t// Adresse à utiliser pour continuer ses achats\n $xoopsTpl->assign('commandAmountTTC', $oledrion_Currency->amountForDisplay($commandAmountTTC, 'l'));\t// Montant TTC de la commande\n $xoopsTpl->assign('discountsDescription', $discountsDescription);\t\t\t\t\t// Liste des réductions accordées\n $showOrderButton = true;\n $showRegistredOnly = false;\n if (oledrion_utils::getModuleOption('restrict_orders', false) && $uid == 0) {\n $showRegistredOnly = true;\n $showOrderButton = false;\n }\n $xoopsTpl->assign('showRegistredOnly', $showRegistredOnly);\n $xoopsTpl->assign('showOrderButton', $showOrderButton);\n}",
"public function index()\n {\n return view('cart', [\n 'products' => Cart::content(),\n 'discount' => Cart::discount(),\n 'coupons' => Cart::coupons()->toArray(),\n 'total' => Cart::total(),\n 'total_with_discount' => Cart::totalWithDiscount(),\n ]);\n }",
"public function index()\n {\n $output = $this->generateOutputData();\n\n return view('invoice.cart')->with($output);\n }",
"public function show()\n {\n return view('cart.show')->with([\n 'cart' => cart(),\n ]);\n }",
"public function index() {\n $pageConfigs = [\n 'bodyClass' => 'ecommerce-application',\n 'mainLayoutType' => 'horizontal',\n 'isMain' => '0',\n ];\n $breadcrumbs = [\n ['link' => \"dashboard-analytics\", 'name' => \"Home\"], ['link' => \"dashboard-analytics\", 'name' => \"eCommerce\"], ['name' => \"Checkout\"]\n ];\n if (auth()->check()) {\n ProductCart()->setUser(auth()->user()->id);\n }\n $CartData = ProductCart()->data();\n $CartItems = ProductCart()->toArray(true)['CartItems'];\n \n return view('site.ForntEnd.prouduct_cart', compact('pageConfigs', 'breadcrumbs', 'CartData', 'CartItems'));\n }",
"public function create_cart()\n {\n // get products currently in cart\n\n $products = $this->get();\n\n $shipping = $this->get_shipping_cost();\n $data = '';\n $subtotal = 0;\n\n $data .= '<li class=\"header_row\"><div class=\"col1\">Product Name:</div>\n <div class=\"col2\">Quantity:</div><div class=\"col3\">Product Price:</div>\n <div class=col4>Total:</div></li>';\n\n if ($products != '') {\n //products to display\n\n $line = 1;\n foreach ($products as $product) {\n // create new item in cart\n $data .= '<li';\n if ($line % 2 == 0) {\n $data .= 'class=\"alt\"';\n }\n // displaying cart items(name, price,count)\n $data .= '><div class=\"col1\"><a href=\"' . SITE_PATH . 'product.php?id=' . $product['id'] . '\" >' . $product['name'] . '</a></div>';\n $data .= '<div class=\"col2\"><input name=\"product' . $product['id'] . '\" value=\"' . $_SESSION['cart'][$product['id']] . '\"></div>';\n $data .= '<div class=\"col3\">$' .number_format((float)($product['price']), 2, '.', '') . '</div>';\n $data .= '<div class=\"col4\">$' . $product['price'] * $_SESSION['cart'][$product['id']] . '</div></li>';\n\n // calculating subtotal\n $subtotal += $product['price'] * $_SESSION['cart'][$product['id']];\n\n $line++;\n }\n\n // add subtotal row\n $data .= '<li class=\"subtotal_row\"><div class=\"col1\">Subtotal</div>\n <div class=\"col2\">$' . number_format((float)($subtotal), 2, '.', '') . '</div></li>';\n\n // Tax row\n $data .= '<li class= \"taxes_row\"><div class=\"col1\">Tax (%' . (TAX * 100) . ' )</div>\n <div class=\"col2\">$' . number_format((float)(TAX * $subtotal), 2, '.', '') . '</div></li>';\n\n // Shipping row\n $data .= '<li class= \"shipping_row\"><div class=\"col1\">Total Shipping Cost</div>\n <div class=\"col2\">$' . number_format((float)($shipping), 2, '.', '') . '</div></li>';\n\n\n // add total row\n $data .= '<li class=\"total_row\"><div class=\"col1\">Total</div>\n <div class=\"col2\">$' . number_format((float)((TAX * $subtotal) + $subtotal) + $shipping, 2, '.', '') . '</div></li>';\n \n } else {\n // no products to display\n $data .= '<li><strong>No items in the Cart!</strong></li>';\n\n // add subtotal row\n $data .= '<li class=\"subtotal_row\"><div class=\"col1\">Subtotal</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // Tax row\n $data .= '<li class= \"taxes_row\"><div class=\"col1\">Tax (%' . (TAX * 100) . ' )</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // Shipping row\n $data .= '<li class= \"shipping_row\"><div class=\"col1\">Total Shipping Cost</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // add total row\n $data .= '<li class=\"total_row\"><div class=\"col1\">Total</div>\n <div class=\"col2\">$0.00</div></li>';\n }\n\n\n return $data;\n }",
"public function index()\n\t{\n\t\t$carts =$this-> cart ->contents();\n\t\t$total_items=$this-> cart->total_items();\n\t\t$this->data['carts']=$carts;\t\n\t\t// var_dump($carts);\n/*\t\techo \"<pre>\";\n \t\tprint_r($carts);\n \t\techo \"<pre>\";*/\n\n\t \t$this->load ->view('Fr_giohang_view',$this->data);\n\t\t\n\t }",
"function index()\n {\n // If the cart is empty, show the empty cart page\n if (empty($_SESSION['cart'])) {\n $this->registry->template->show('cart-empty');\n die();\n }\n\n $cartItemsHtml = '';\n $game = new \\Webshop\\Model\\Game();\n\n $resultGames = [];\n $subtotaal = 0.0;\n $verzendkosten = 1.98;\n\n // Load the games from the database\n foreach ($_SESSION['cart'] as $gameFromSession) {\n $gameId = $gameFromSession[0];\n if ($game->getOne(\"id\", $gameId)) {\n $resultGames[] = $game->getOne(\"id\", $gameId);\n }\n }\n\n // Create the html for eacht game\n $count = 0;\n foreach ($resultGames as $game) {\n\n if (file_exists(\"images/games/\" . $game->imageBackground)) {\n $gameBackgroundImage = $game->imageBackground;\n } else {\n $gameBackgroundImage = \"pc/General_background.jpg\";\n }\n\n $options = '';\n $amount = $_SESSION['cart'][$count][1];\n for ($index = 1; $index < $this->amountOfOption; $index++) {\n $selected = '';\n ($index == $amount) ? $selected = 'selected' : '';\n $options .= \"<option $selected>$index</option>\";\n }\n\n $gameTotalPrice = $game->price * $amount;\n $subtotaal += $gameTotalPrice;\n $cartItemsHtml .= <<< CARTITEMS\n <article style=\"background: url(/images/games/$gameBackgroundImage) center center no-repeat;\">\n <h2><a href = \"/games/id/$game->id\" >$game->title</a></h2>\n <a href=\"/games/id/$game->id\" >\n <img alt = \"Primary image of the article\" class=\"product-front-img\" src = \"/images/games/$game->image\">\n </a> \n <strong>$amount x € $game->price = € $gameTotalPrice</strong>\n <form method=\"post\" action=\"/cart/updateNumberOfItems\">\n <input type=\"hidden\" name=\"gameId\" value=\"$game->id\">\n <select name=\"amount\" onchange=\"this.form.submit()\">\n $options\n </select>\n </form>\n <a class=\"button remove-from-cart\" href=\"/cart/remove/$game->id\">\n <span class=\"lnr lnr-trash\"></span>\n </a> \n </article>\nCARTITEMS;\n\n $count++;\n }\n\n $totalPrice = $subtotaal + $verzendkosten; // Default verzendkosten\n $this->registry->template->verzendkosten = $verzendkosten;\n $this->registry->template->subTotal = $subtotaal;\n $this->registry->template->totalPrice = $totalPrice;\n $this->registry->template->cartItemsHtml = $cartItemsHtml;\n $this->registry->template->show('cart');\n unset($_SESSION['addToCartError']);\n }",
"public function showCart(Request $request){\n\n $cart_items=Cart::content();\n return view('frontend.cart',['configurations'=>$this->configuration,'cart_items'=>$cart_items]);\n\n }",
"function poco_handheld_footer_bar_cart() {\n ?>\n <a class=\"footer-cart\" href=\"<?php echo esc_url(wc_get_cart_url()); ?>\"\n title=\"<?php esc_attr_e('View your shopping cart', 'poco'); ?>\">\n\t\t\t\t<span\n class=\"count\"><?php echo wp_kses_data(sprintf(_n('%d', '%d', WC()->cart->get_cart_contents_count(), 'poco'), WC()->cart->get_cart_contents_count())); ?></span>\n <span class=\"title\"><?php echo esc_html__('Cart', 'poco'); ?></span>\n </a>\n <?php\n }",
"public function index(){\n $carts = Cart::content();\n $total = Cart::total();\n $subtotal = Cart::subtotal();\n\n return view('front.shop.cart', compact('carts','total', 'subtotal'));\n }",
"public function show()\n {\n return view('carts');\n }",
"public function create_cart()\n\t{\n\t\t#get products currently in cart\n\t\t$products = $this->get();\n\t\t\n\t\t$data = '';\n\t\t$form = '';\n\t\t$total = 0;\n\n\t\tif ($products != '')\n\t\t{\n\t\t\t#products to display\n\t\t\t$line = 1;\n\t\t\t$shipping = 0;\n\n\t\t\tforeach($products as $product)\n\t\t\t{\n\t\t\t\t$item_shipping = $this->get_shipping_cost($product['price']) * $_SESSION['cart'][$product['id']];\n\t\t\t\t$shipping += $item_shipping;\n\t\t\t\t\n\t\t\t\t$data .= '<li><b class=\"tab-head\">Product Name:</b>' . \"<b class='tab-detail'>\" . $product['name'] . '</b></li>';\n\t\t\t\t$data .= '<li><b class=\"tab-head\">Quantity:</b><b class=\"tab-detail\"><input name=\"product' . $product['id'] . '\" value=\"' . $_SESSION['cart'][$product['id']] .'\"></b></li>';\n\t\t\t\t$data .= '<li><b class=\"tab-head\">Product Price:</b><b class=\"tab-detail\">£' . $product['price'] . '</b></li><br>';\n\n\t\t\t\t//Create paypal form fields\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"item_name_' . $line . '\" value=\"' . $product['name'] . '\">';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"amount_' . $line . '\" value=\"' . number_format($product['price'], 2) . '\">';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"quantity_' . $line . '\" value=\"' . $_SESSION['cart'][$product['id']] . '\">';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"shipping_' . $line . '\" value=\"' . $item_shipping . '\">';\n\n\t\t\t\t$total += $product['price'] * $_SESSION['cart'][$product['id']];\n\t\t\t\t$line++;\n\t\t\t}\n\t\t\t#add subtotal row\n\t\t\t$data .= '<li><b class=\"tab-head\">Subtotal:</b><b class=\"tab-detail\">£' . $total . '</b></li>';\n\n\t\t\t#add shipping row\n\t\t\t$data .= '<li><b class=\"tab-head\">Shipping cost:</b><b class=\"tab-detail\">£' . number_format($shipping, 2) . '</b></li>';\n\n\t\t\t#add tax row\n\t\t\tif (SHOP_TAX > 0)\n\t\t\t{\n\t\t\t\t$data .= '<li><b class=\"tab-head\">VAT: (' .(SHOP_TAX * 100) . '%):</b><b class=\"tab-detail\">£' . number_format(SHOP_TAX * $total, 2) . '</b></li>';\n\t\t\t}\n\n\t\t\t#add total row\n\t\t\t$data .= '<br><li><b class=\"tab-head\">Total:</b><b class=\"tab-detail\">£' . number_format((SHOP_TAX * $total) + $total + $shipping, 2) . '</li></b>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t#no products to display\n\t\t\t$data .= '<li class=\"red\"><p class=\"text-warning\">There are no items are in your basket.</p></li>';\n\t\t\n\t\t\t#add subtotal row\n\t\t\t$data .= '<li><b class=\"tab-head\">Subtotal:</b><b class=\"tab-detail\">£0.00</b></li>';\n\t\t\n\t\t\t#add shipping row\n\t\t\t$data .= '<li><b class=\"tab-head\">Shipping cost:</b><b class=\"tab-detail\">£0.00</b></li>';\n\t\t\t\n\t\t\t#add tax row\n\t\t\tif (SHOP_TAX > 0)\n\t\t\t{\n\t\t\t\t$data .= '<li><b class=\"tab-head\">VAT: (' .(SHOP_TAX * 100) . '%):</b><b class=\"tab-detail\">£0.00</b></li>';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t#add total row\n\t\t\t$data .= '<br><li><b class=\"tab-head\">Total:</b><b class=\"tab-detail\">£0.00</b></li>';\n\t\t}\n\t\t//set PayPal tax rate \n\t\t$form .= '<input type=\"hidden\" name=\"tax_cart\" value=\"' . number_format(SHOP_TAX * $total, 2).'\">';\n\t\treturn array($data, $form);\n\t}",
"public function indexAction()\n\t{\n\t\t$cart = Cart::find();\n\t\n\t\t// send data to the view\n\t\t$this->view->cart = $cart;\n\t}",
"public function index()\n {\n $cart = Cart::name('shopping');\n $items = $cart->getItems();\n $total = $cart->getItemsSubtotal();\n $subtotal = $cart->getSubtotal();\n $action = $cart->sumActionsAmount();\n $quantity = $cart->sumItemsQuantity();\n\n // dd($items);\n\n return view('frontend.cart', compact(\n 'items',\n 'total',\n 'subtotal',\n 'action',\n 'quantity',\n ));\n }",
"public function getDisplayDetails($inCart, $inEmail = false)\n {\n $db = DataAccess::getInstance();\n $msgs = $db->get_text(true, 10202);\n $return = array (\n 'css_class' => '',//empty string to use default CSS class in the HTML, otherwise a string containing the css class name.\n 'title' => $msgs[500626],//text that is displayed for this item in list of items purchased.\n 'canEdit' => false, //show edit button for item?\n 'canDelete' => false, //show delete button for item?\n 'canPreview' => false, //show preview button for item?\n 'canAdminEditPrice' => false, //show edit price button for item, if displaying in admin panel cart?\n 'priceDisplay' => $msgs[500628], //Price as it is displayed\n 'cost' => $this->getCost(), //amount this adds to the total, what getCost returns\n 'total' => $this->getCost(), //amount this AND all children adds to the total (will add to it as we parse the children)\n 'children' => array() //should be array of child items, with the index\n //being the item's ID, and the contents being associative array like\n //this one. If no children, it should be an empty array. (Careful\n //not to get into any infinite recursion)\n );\n\n $sv = $this->getParent()->get('session_variables');\n if ($sv['auction_type'] == 3) {\n //special case: this is a reverse auction.\n //If charging final fees for reverse auctions is not enabled, kill the item and return false to not show anything here\n $planItem = geoPlanItem::getPlanItem('auction', $this->getPricePlan());\n if (!$planItem->charge_reverse_final_fees) {\n $id = $this->getId();\n geoOrderItem::remove($id);\n return false;\n }\n }\n\n\n $return['title'] .= '<a href=\"' . $db->get_site_setting('classifieds_url') . '?a=4&b=3#FF' . $this->getPricePlan() . '\" onclick=\"window.open(this.href); return false;\">' . $msgs[500627] . '</a>';\n\n\n //THIS PART IMPORTANT: Need to keep this part to make the item able to have children\n\n //go through children...\n $order = $this->getOrder();//get the order\n $items = $order->getItem();//get all the items in the order\n $children = array();\n foreach ($items as $i => $item) {\n if (is_object($item) && $item->getType() != $this->getType() && is_object($item->getParent())) {\n $p = $item->getParent();//get parent\n if ($p->getId() == $this->getId()) {\n //Parent is same as me, so this is a child of mine, add it to the array of children.\n //remember the function is not static, so cannot use callDisplay() or callUpdate(), need to call\n //the method directly.\n $displayResult = $item->getDisplayDetails($inCart, $inEmail);\n if ($displayResult !== false) {\n //only add if they do not return bool false\n $children[$item->getId()] = $displayResult;\n $return['total'] += $children[$item->getId()]['total']; //add to total we are returning.\n }\n }\n }\n }\n if (count($children)) {\n //add children to the array\n $return['children'] = $children;\n }\n return $return;\n }",
"public function viewCart()\n {\n return view('shoppingCart.cart');\n }",
"public function index()\n {\n $user = Auth::user();\n $carts = Cart::with(['product.galleries', 'user'])\n ->where('users_id', Auth::user()->id)->get();\n return view('pages.cart',[\n 'carts' => $carts,\n 'user' => $user\n ]);\n }",
"public function getCart();",
"public function index()\n {\n return view('frontend.pages.carts');\n }",
"public function viewCartAction(Request $request)\n {\n $session = $request->getSession();\n\n if (!$session->has('cart')) $session->set('cart', array());\n\n $em = $this->getDoctrine()->getManager();\n $products = $em->getRepository('WizishopCoreBundle:Product')->findArray(array_keys($session->get('cart')));\n\n return $this->render('WizishopCoreBundle:Core:cart.html.twig', array(\n 'products' => $products,\n 'cart' => $session->get('cart'),\n ));\n }",
"public function show()\n {\n\n\n if (session('cart')) {\n // dd(session('cart'));\n $products = collect([]);\n\n foreach (session('cart') as $product) {\n\n $currentProduct = collect([]);\n $currentProduct->push(Product::find($product['id']));\n $currentProduct->push($product['qty']);\n $products->push($currentProduct);\n }\n\n $total = 0;\n foreach ($products as $product) {\n\n $total = $total + ($product[0]['price'] * $product[1]);\n }\n\n $totalProducts = 0;\n foreach ($products as $product) {\n\n $totalProducts = $totalProducts + $product[1];\n }\n } else {\n\n return view('noproducts');\n }\n\n\n if (empty($products)) {\n\n $productsExists = false;\n } else {\n\n $productsExists = true;\n };\n\n return view('checkout', compact('products', 'total', 'totalProducts', 'productsExists'));\n }",
"public function show()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t//\tCalculando el total.\n\t\t$total = $this->total();\n\t\treturn view('home.cart',compact('cart', 'total'));\n\t}",
"public function index() {\n $prodData['cart_total'] = number_format($this->cart->getTotal(),2);\n $cart_layouts['md'] = '';\n $cart_layouts['sm'] = '';\n $cart_layouts['xs'] = '';\n\n $cart_count = $this->cart->countProducts();\n if($cart_count == 0)\n {\n $cart_layouts['cart_class'] = '';\n $prodData['cart_count'] = 'empty';\n }\n // elseif ($cart_count > 99) {\n // $prodData['cart_count'] = '99+';\n // }\n else {\n $prodData['cart_count'] = $cart_count. ' items';\n $cart_layouts['cart_class'] = 'full';\n }\n\n // $prodData['cart_count'] = 3;\n $cart_layouts['md'] = $this->load->view('ssan/cart_menu', $prodData);\n $cart_layouts['sm'] = $this->load->view('ssan/cart_menu_sm', $prodData);\n $cart_layouts['xs'] = $this->load->view('ssan/cart_menu_xs', $prodData);\n\n return $cart_layouts;\n }",
"private function __print_receipt()\n {\n\t//Assuming range\n\t$ret = $this->__view_receipt();\n\t$receipthead = $this->__receipt_head_html();\n\t$receiptfoot = $this->__receipt_foot_html();\n\t\n\t$receipts = $receipthead. sprintf(\"\n\t<div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t\n\t\", $ret, $ret, $ret, $ret, $ret, $ret).$receiptfoot;\n\t\n\techo $receipts;\n }",
"public function Render() {\n\t$out = NULL;\n\n\t$nPrice\t= $this->Price();\n\t$nShItm\t= $this->SH_perItem();\n\t$nShPkg\t= $this->SH_perPackage();\n\t$nQty\t= $this->Qty();\n\n\t$nPriceQty = $this->Price() * $nQty;\n\t$nShItmQty = $this->SH_perItem() * $nQty;\n\t$nLineTotal = $nPriceQty + $nShItmQty;\t// line total including per-item s/h\n\n\t$sCatNum = $this->CatNum();\n\t$sDescr = $this->Descrip();\n\n\t//$ftShipPkg = clsMoney::BasicFormat($dlrPerPkg);\n\n\t$out = sprintf($this->FormatString(),\n\t $sCatNum,\n\t $nPrice,\n\t $nShItm,\n\t $nQty,\n\t $nPriceQty,\n\t $nShItmQty,\n\t $nLineTotal\n\t )\n\t .\"\\n - $sDescr\\n\";\n\treturn $out;\n }",
"protected function toString(){\n echo '<br>The item name: '.$this->getName().'</br>The item price is : '.$this->getPrice();\n }",
"function custom_mini_cart() {\n\n echo '<div class=\"\">cart stuff</div>';\n\n }",
"public function success()\n {\n setcookie(\"shoppingCart\", \"\", time() - 3600, \"/\");\n return $this->twig->render('checkout/success.html.twig');\n }",
"public function index()\n {\n\n $cart = $this->cart->content();\n\n return view('public.cart.index', compact('cart'));\n }"
]
| [
"0.80911773",
"0.7838472",
"0.7701166",
"0.76332897",
"0.7404988",
"0.7333776",
"0.7331121",
"0.7313024",
"0.72378284",
"0.7112075",
"0.7092272",
"0.7074424",
"0.70626134",
"0.6957414",
"0.69048053",
"0.68893856",
"0.6880532",
"0.6846325",
"0.68112636",
"0.6798295",
"0.67745495",
"0.6758457",
"0.66835105",
"0.6678553",
"0.6647867",
"0.6627051",
"0.6620235",
"0.66200554",
"0.6617241",
"0.6612173",
"0.657852",
"0.6564798",
"0.65374297",
"0.6493552",
"0.6472565",
"0.6462046",
"0.6436258",
"0.64329684",
"0.6387616",
"0.63800776",
"0.63792974",
"0.63772",
"0.63741136",
"0.63733983",
"0.63578314",
"0.63461566",
"0.63323355",
"0.6314735",
"0.6314735",
"0.6314735",
"0.6314735",
"0.6314735",
"0.6314735",
"0.6314735",
"0.6314735",
"0.629226",
"0.6285326",
"0.6283346",
"0.6276095",
"0.6267808",
"0.62653863",
"0.62645435",
"0.6258778",
"0.625489",
"0.625487",
"0.6254465",
"0.6243024",
"0.6242371",
"0.6235633",
"0.6229816",
"0.6218501",
"0.6215956",
"0.621373",
"0.62034965",
"0.6202936",
"0.6190454",
"0.6189968",
"0.61886597",
"0.61700755",
"0.6167102",
"0.61315095",
"0.6131197",
"0.61293864",
"0.6106762",
"0.6105839",
"0.6101363",
"0.6096109",
"0.6094822",
"0.60934556",
"0.6088035",
"0.607039",
"0.6067984",
"0.6062624",
"0.60460746",
"0.6043841",
"0.6021995",
"0.60105544",
"0.6009496",
"0.6005724",
"0.5987876"
]
| 0.7227505 | 9 |
runs and SQL query to fetch all categories | function getProductCategories () {
$sql = "SELECT * FROM stockgroups";
return runQuery($sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }",
"private function getAllCategories()\n {\n $query = Queries::$getAllCategories;\n\n try {\n $stmt = $this->db->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n $this->successResponse($result);\n } catch (\\PDOException$e) {\n $this->errorResponse($e->getMessage());\n }\n }",
"public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}",
"public static function getCategories()\n {\n \t$query = \"SELECT * FROM categories\";\n \t$result = DB::select($query);\n\n \treturn $result;\n }",
"public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}",
"public function loadAllCategories() {\n\t\t$sql = \"SELECT * FROM categories_grumble ORDER BY category_name ASC\";\n\t\t$this->db->query($sql);\n\t\treturn $this->db->rows();\n\t}",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM categorias_vod';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }",
"function getCategories(){\n\treturn dbSelect('categories');\n}",
"public function getAllCategories();",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM auditoriacategoria';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"private function _loadCategories()\n {\n try {\n $this->_categories = Doctrine_Core::getTable('Category')->findAll(Doctrine_Core::HYDRATE_ARRAY);\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }",
"public static function getAll(){\n $result = static::$conn->query(\"SELECT * FROM enews.category\");\n return $result->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"public function findAllCategories(): iterable;",
"private function fetchAllCategories()\n {\n $sql = '\n SELECT * FROM Rm_Category;\n ';\n\n $res = $this->db->executeSelectQueryAndFetchAll($sql);\n\n $categoriesArray = array();\n foreach ($res as $key => $row) {\n $name = $row->name;\n $categoriesArray[] = $name;\n }\n\n return $categoriesArray;\n }",
"public function findCategories();",
"function afficherCategories()\n\t{\n\t\t$sql=\"SElECT * From categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry\n\t\t{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e)\n {\n die('Erreur: '.$e->getMessage());\n }\t\n\t}",
"function affichercategories(){\r\n\t\t$sql=\"SElECT * From categorie\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}",
"public function listCategories(){\n\t\t$lab = new lelabDB();\n\t\t$query = \"select * from $this->tableName order by id\";\n\t\t$result = $lab->getArray($query);\n\t\treturn $result;\n\t}",
"function getCategories() {\n\t$sql = \"select * FROM category ORDER BY id\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->query($sql); \n\t\t$categories = $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t$db = null;\n\t\techo '{\"data\": ' . json_encode($categories) . '}';\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}",
"function getCategories(){\n global $db;\n $queryString = \"select * from categories\";\n $data = $db->query($queryString);\n return $data;\n}",
"public static function getAll() {\n self::checkConnection();\n $results = self::$connection->execute(\"SELECT * FROM category;\");\n $categories = array();\n foreach ($results as $category_arr) {\n array_push($categories, new Category($category_arr));\n }\n return $categories;\n }",
"function listCategories(){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name FROM Category\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\n\t}",
"public function cat_select() {\n //formulate select query\n $sql = \"SELECT * FROM categories\"; \n //execute query \n return $this->db_query($sql);\n }",
"function getAllcate(){\n return db()->query(\"SELECT * FROM categories\");\n }",
"public function getAllCategory()\n {\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $id = '';\n $items = $result;\n return $items;\n }",
"public function getCategoriesStall(){\n\t\t$this->db->query('SELECT * FROM categories_tbl WHERE type=1');\n\t\treturn $this->db->resultSet();\n\t}",
"public function getCategoriesStall(){\n\t\t$this->db->query('SELECT * FROM categories_tbl WHERE type=1');\n\t\treturn $this->db->resultSet();\n\t}",
"public function getCategories()\n {\n $request = \"SELECT * FROM category\";\n $request = $this->connexion->query($request);\n $categories = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categories;\n }",
"public function getAllCategory(){\n $query = \"SELECT * FROM category ORDER BY catId DESC\";\n $result = $this->db->select($query);\n return $result; \n }",
"public function getAllWithCategory();",
"public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}",
"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 read_all_categories()\n {\n $result = array(\n \"status\" => \"\" ,\n \"body\" => array(\n \"categories\" => array(\n \"id\" => 0,\n \"category_name\" => \"\"\n ),\n \"count\" => 0\n ),\n \"error\" => array()\n );\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n $res = $stmt->get_result();\n $result['body']['count'] = $res->num_rows;\n if ($res->num_rows > 0){\n $result['status'] = \"Categories read \";\n while($row = $res->fetch_assoc()){\n $data = array(\n \"id\" => $row[\"id\"],\n \"category_name\" => $row['categoryName']\n );\n array_push($result['body']['categories'], $data);\n }\n } else {\n $result['status'] = \"No categories found \";\n }\n return $result;\n }",
"public function get_categories() {\n\t error_log(\"get_categories - category id: \" . $category_id,0);\n\n\t$query = \"SELECT * FROM category ORDER BY category_name ASC\";\n\n\t error_log(\"get_categories - query: \" . $query,0);\n\n \t $result = mysql_query($query);\n\n if ($result) {\n return $result;\n } else {\n\terror_log(\"did not get categories\",0);\n $error = mysql_errno();\n return -$error;\n }\n\n }",
"function get_all_category(){\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM evs_database.evs_set_form_attitude\";\n $query = $this->db->query($sql);\n\t\treturn $query;\n\n\t}",
"public function getCategories()\r\n {\r\n $this->db->query(\"SELECT * FROM categories\");\r\n\r\n $row = $this->db->resultset();\r\n\r\n //Check Rows\r\n return $row;\r\n }",
"public function __invoke(){\n $dbCate = new CategoriesTable(new TableGateway(\"categories\", $this->adapter));\n return $dbCate->getCategories();\n }",
"function viewAllCategories()\r\n{\r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"SELECT * FROM categories\");\r\n \r\n $results = array();\r\n if \r\n // Function used to pull all records from Table\r\n ($stmt->execute() && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n return $results;\r\n}",
"public function categories_all() {\n\t\t// Simple! Get the categories\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories();\n\t\t\n\t\t// ...and display the view. We won't\n\t\t// be needing Pagination or anything like that\n\t\t$this->_view('categories');\n\t}",
"public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}",
"function fetchAllCategory()\n\t{\t\t\n\t\t$query = $this->db->get('tbl_category');\n\t\treturn $query->result_array();\n\t\n\t}",
"function get_all_categorie($conn)\n\t{\n\t\t$query = \"SELECT * FROM categorie\";\n\t\treturn mysqli_query($conn,$query);\n\t}",
"public function showAllCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,true,true);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }",
"public function readAll()\n {\n $query = 'SELECT * FROM '.$this->table;\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n\n $categories = array();\n $num = $stmt->rowCount();\n if ($num > 0) {\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n array_push($categories, $row);\n }\n }\n return $categories;\n }",
"function getAllMainCategories() {\r\n\r\n $sql = \"SELECT * \"\r\n . \"FROM categories \"\r\n . \"WHERE parent_id = 0\";\r\n\r\n include '../config/db.php';\r\n\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}",
"public function all()\n {\n $sql =\"SELECT c.id, c.name_category, c.waiting, c.obs_waiting, c.cover, count(p.name_product) as total_prods FROM categories as c LEFT JOIN products as p ON(c.name_category = p.category) WHERE p.status = 0 GROUP BY c.id\";\n $sql = $this->db->query($sql);\n return $categories = $sql->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}",
"function get_all_category_ids()\n {\n }",
"public function getCategoryCloud()\n {\n $sql = \"\n SELECT\n PC.id as cat_id,\n PC.category,\n P2C.id,\n P2C.cat_id,\n COUNT(P2C.id) AS amount\n FROM Prod2Cat AS P2C\n LEFT OUTER JOIN ProdCategory AS PC\n ON PC.id = P2C.cat_id\n GROUP BY P2C.cat_id\n -- ORDER BY amount DESC\n \";\n\n $this->db->execute($sql);\n $res = $this->db->fetchAll();\n return $res;\n }",
"public function getCategories()\r\n{\r\n $query_string = \"SELECT categoryid, categoryname, categorydescription \";\r\n $query_string .= \"FROM categories\";\r\n\r\n return $query_string;\r\n}",
"private function getPopularCategories()\n {\n $query = Queries::$getPopularCategories;\n\n try {\n $stmt = $this->db->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n $this->successResponse($result);\n } catch (\\PDOException$e) {\n $this->errorResponse($e->getMessage());\n }\n }",
"function getCategories()\n\t{\n\t\tglobal $con;\n\t\t\t\n\t\t//echo var_dump($con);\n\t\t$get_cats = \"select * from categories\";\n\t\t$run_cats = mysqli_query($con, $get_cats);\n\t\twhile ($row = mysqli_fetch_array($run_cats)){\n\t\t\t$id = $row['cat_id'];\n\t\t\t$title =$row['cat_title'];\n\n\t\t\techo \"<div class='category_link'><a href='index.php?cat=$id'>$title</a></div>\";\n\t\t}\n\t}",
"public function getcategory()\r\n{\r\n {\r\n $sql = \"select * from categories\";\r\n $result = $this->connect()->query($sql);\r\n if ($result->rowCount() > 0) {\r\n while ($row = $result->fetch()) {\r\n $data[] = $row;\r\n\r\n }\r\n return $data;\r\n }\r\n }\r\n}",
"public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}",
"public function allCategories()\n {\n return Category::all();\n }",
"function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}",
"public function cargarCategorias($sql){\n $con= new conectar();\n $conexion= $con->conexion();\n $result= mysqli_query($conexion, $sql); \n return mysqli_fetch_all($result, MYSQLI_ASSOC);\n }",
"public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }",
"function call_categories() {\r\n\t\t\t$xyquery = \"SELECT * FROM categories\";\r\n\t\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t\treturn $xyresult;\r\n}",
"public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }",
"public function displayCategories()\n {\n $query = $this->categoryModel->displayCategories();\n $this->showCategories = $query->fetchAll();\n }",
"public function get_all_categories()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('category');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}",
"public function __construct() {\n parent::__construct();\n \n $query = \"SELECT * from categories\";\n // execute the SQL query in the database and return an array \n \n $this->query($query);\n }",
"function fetchAllCategory() {\n $query = $this->db->get('tbl_category');\n return $query->result_array();\n }",
"function getAllCategories()\n {\n return $this->data->getAllCategories();\n }",
"public function getAllCategories()\n {\n $this->datatables\n ->select('*,CategoryId')\n ->from($this->_categories)\n ->join($this->_modules, $this->_modules . '.ModuleId = ' . $this->_categories . '.ModuleId')\n ->select('ModuleName')\n ->select('CategoryName')\n ->add_column('Edit', '<a href=\"' . base_url() . 'categories_panel/$1\" target=\"_blank\"><i class=\"fa fa-pencil fa-fw\"></i></a>', 'CategoryId')\n ->add_column('Delete', '<a href=\"' . base_url() . 'categories_panel/$1\"><i class=\"fa fa-trash-o fa-fw\"></i></a>', 'CategoryId')\n ->unset_column('ModuleId')\n ->unset_column('Edit')\n ->unset_column('Delete')\n ->unset_column('CategoryId');\n\n $q = $this->datatables->generate();\n return $q;\n }",
"public function listCategories() //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\n\t$userGroup = $_SESSION[\"usergroup\"];\n\n\t$select_array = array(\n\t\"table\" => 'categories', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"category_pk\",\n\t\"category_name\",),\n\t\"returns\" => array(\n\t\"categoryPK\",\n\t\"categoryName\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"user_group\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$userGroup\",\n\t\t\"concat\" => \"\")\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array); //errors handled by dbase class\n\t$this->responseClass->apiResponse($returnedArray);\n\treturn true;\n\t}",
"public static function getAllCategories() {\n\t\t\t$db = Db::getInstance();\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description\n\t\t\t\t\t\t\t\t\t\t\t FROM categories\n\t\t\t\t\t\t\t\t\t\t ORDER BY location\n\t\t\t\t\t\t\t\t\t\t');\n\t\t\t\t$categoryQuery->execute();\n\t\t\t$allCategories = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $allCategories;\n\t\t}",
"function category(){\n global $pdo;\n $request = $pdo->query('SELECT * FROM `category`');\n return $request->fetchAll();\n}",
"public function getCategories() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE parent is null ORDER BY name ASC\");\n $stmt->setFetchMode(\\PDO::FETCH_CLASS, '\\App\\Model\\Category\\ProductCategoryModel');\n $stmt->execute();\n return $stmt->fetchAll();\n }",
"public function listarCategorias() {\n $sql = \"SELECT *\n FROM categorias\n ORDER BY id DESC\";\n\n return $sql;\n }",
"public function getAll()\n {\n return CategorieResource::collection(Categorie::paginate());\n }",
"public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}",
"public function getList()\n {\n $categories = array();\n\n $q = $this->_db->query('SELECT * FROM categorie ORDER BY idCategorie');\n\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\n {\n $categories[] = ($donnees);\n \n }\n }",
"function get_categories() {\n global $db;\n $query = \n ' SELECT * FROM categories\n ORDER BY cat_categoryID'; \n $statement = $db->prepare($query);\n $statement->execute();\n return $statement; \n}",
"function getAlldata(){\n return db()->query(\"SELECT * FROM categories INNER JOIN travels ON categories.categoryID = travels.categoryID\");\n }",
"public function getAll(){\n\n \t$categorias = $this->db->query(\"SELECT * FROM categorias ORDER BY id_categoria DESC\");\n\n \treturn $categorias;\n }",
"public function ListarCategorias()\n{\n\tself::SetNames();\n\t$sql = \" select * from categorias\";\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}",
"public function getCategories();",
"public function getCategories();",
"public static function all() {\n $list = [];\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM categories');\n\n // we create a list of Category objects from the database results\n foreach($req->fetchAll() as $category) {\n $list[] = new Category($category['id'], $category['name']);\n }\n\n return $list;\n }",
"public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}",
"public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}",
"function afficherCategoriess(){\n $sql=\"SElECT * From categorie\";\n $db = config2::getConnexion(); //config\n try{\n $liste=$db->query($sql);\n return $liste;\n }\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\n }",
"function GetAllCategories() {\r\n\t\t\r\n require 'Connection.php';\r\n\r\n //Open connection and Select database. \r\n $conn = new mysqli($servername, $username, $password, $dbname);\r\n\t\t//check connection\r\n\t\tif($conn->connect_error) {\r\n\t\t\tdie(\"Connection failed: \".$conn->connect_error);\r\n\t\t}\r\n\t\t\r\n $query = \"SELECT * FROM t_category\";\r\n $result = $conn->query($query);\r\n\t\t$CategoriesArray = array();\r\n\r\n //Get data from database.\r\n\t\twhile ($row = $result->fetch_assoc()) {\r\n\t\t\t$CategoryID = $row[\"CategoryID\"];\r\n $CategoryName = $row[\"CategoryName\"];\r\n $Description = $row[\"Description\"];\r\n $Image = $row[\"Image\"];\r\n\r\n //Create Category objects and store them in an array.\r\n $Category = new EntityCategory($CategoryID, $CategoryName, $Description, $Image);\r\n array_push($CategoriesArray, $Category);\r\n }\r\n //Close connection and return result\r\n\t\t$conn->close();\r\n return $CategoriesArray;\r\n }",
"public function get_allCategory_get(){\n\t\t$result = $this->dashboard_model->get_allCategory();\n\t\treturn $this->response($result);\t\t\t\n\t}",
"public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }",
"public function all()\n {\n return new CategoryCollection(Category::whereUserId(Auth::id())->ordered()->get());\n }",
"public function getCategorias(){\n\t\t\t$this->db->query(\"SELECT *\n\t\t\t\t\t\t\t\tFROM categorias \");\n\t\t\tif( $this->db->numRows() > 0 ) return $this->db->fetchAll();\n\t\t\treturn null;\n\t}",
"public function getCategories($conn) {\n $sql = \"SELECT category.*\n FROM category\n LEFT JOIN article_category\n ON category.id = article_category.category_id\n WHERE article_id = :id\";\n\n $stmt = $conn->prepare($sql);\n $stmt->bindValue(':id', $this->id, PDO::PARAM_INT);\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getAllCategories() {\n $q = $this->db->get('categories');\n if ($q->num_rows() > 0) {\n foreach (($q->result()) as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }",
"public function categories()\n {\n $query = \"SELECT DISTINCT category from blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $images = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $images;\n\n }",
"function selectCategory($c){\n\t$sql = \"SELECT id,name,category_code,description FROM category_tbl WHERE active=1\";\n\tprint_r(hasRows($c,$sql) ? json_encode(selectQuery($c,$sql)) : \"\");\n}",
"public function run()\n {\n Category::truncate();\n \t$cateLists = ['Sportswear','Mens','Womens','Kids','Fashion','Households','Interiors','Clothing','Bags','Shoes'];\n \tforeach ($cateLists as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t]);\n \t}\n \t$list_sportswear = ['Nike','Under Armour','Adidas','Puma','Asics'];\n \tforeach ($list_sportswear as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 1\n \t\t\t]);\n \t}\n \t$list_mens=['Fendi','Guess','Valentino','Dior','Versace','Armani','Prada','Dolce And Gabbana','Chanel','Gucci'];\n \tforeach ($list_mens as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 11\n \t\t\t]);\n \t}\n \t$list_womens = ['Womens Fende','Womens Guess','Valentino','Womens Dior','Verace'];\n \tforeach ($list_womens as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 21\n \t\t\t]);\n \t}\n }",
"function getCategories(){\r\n\t\trequire_once(\"AffiliateUserGroupPeer.php\");\r\n \trequire_once(\"AffiliateGroupCategoryPeer.php\");\r\n \t$sql = \"SELECT \".AffiliateCategoryPeer::TABLE_NAME.\".* FROM \".AffiliateUserGroupPeer::TABLE_NAME .\" ,\".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::TABLE_NAME .\", \".AffiliateCategoryPeer::TABLE_NAME .\r\n\t\t\t\t\t\t\" where \".AffiliateUserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\r\n\t\t\t\t\t\tAffiliateUserGroupPeer::GROUPID .\" = \".AffiliateGroupCategoryPeer::GROUPID .\" and \".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::CATEGORYID .\" = \".AffiliateCategoryPeer::ID .\" and \".\r\n\t\t\t\t\t\tAffiliateCategoryPeer::ACTIVE .\" = 1\";\r\n \t\r\n \t$con = Propel::getConnection(AffiliateUserPeer::DATABASE_NAME);\r\n $stmt = $con->createStatement();\r\n $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM); \r\n return BaseCategoryPeer::populateObjects($rs);\r\n }",
"public function getCategories()\n {\n return Category::all();\n }",
"public function getAll(): Collection\n {\n return $this->categoryRepository->getAll();\n }",
"public static function getAll($conn) {\n $sql = \"SELECT *\n FROM category\n ORDER BY name\";\n\n $stmt = $conn->query($sql);\n\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function selectAll(){\n $sql = SELECT. TABELA_CATEGORIA;\n\n //Abrindo conexão com o BD\n $PDO_conex = $this->conex->connectDataBase();\n\n //executa o script de select no bd\n $select = $PDO_conex->query($sql);\n $cont = 0;\n \n /* $select->fetch no formado pdo retorna os dados do BD\n também retorna com característica do PDO como o fetch\n é necessário especificar o modelo de conversão.\n EX: PDO::FETCH_ASSOC, PDO::FETCH_ARRAY etc. */\n while($rsCategorias=$select->fetch(PDO::FETCH_ASSOC)){\n $listCategorias[] = new Categoria();\n $listCategorias[$cont]->setIdCategoria_Veiculo($rsCategorias[\"idCategoria_Veiculo\"]);\n $listCategorias[$cont]->setIdTipo_Veiculo($rsCategorias[\"idTipo_Veiculo\"]);\n $listCategorias[$cont]->setNomeCategoria($rsCategorias[\"nomeCategoria\"]);\n $listCategorias[$cont]->setPorcentagemGanho($rsCategorias[\"porcentagemGanhoEmpresa\"]);\n\n $cont++;\n }\n\n $this->conex->closeDataBase();\n\n return($listCategorias);\n\n }"
]
| [
"0.84110564",
"0.7827202",
"0.76029456",
"0.7357666",
"0.7347776",
"0.730766",
"0.72772074",
"0.72244376",
"0.7210734",
"0.7203432",
"0.7160299",
"0.714754",
"0.7070573",
"0.7061162",
"0.7047508",
"0.701474",
"0.7009595",
"0.6996165",
"0.6988222",
"0.69643813",
"0.69624287",
"0.6953105",
"0.69495404",
"0.69327563",
"0.6931915",
"0.6913546",
"0.69101816",
"0.69101816",
"0.6906286",
"0.68770725",
"0.68727994",
"0.68528175",
"0.68457174",
"0.68440306",
"0.68268776",
"0.6787892",
"0.67754745",
"0.6775138",
"0.6772552",
"0.6771054",
"0.67707133",
"0.67579365",
"0.6738325",
"0.6734705",
"0.67346495",
"0.6723939",
"0.67182136",
"0.6712537",
"0.67103463",
"0.670623",
"0.6699567",
"0.6698139",
"0.66943383",
"0.6649415",
"0.6647925",
"0.6644826",
"0.65916884",
"0.65906",
"0.6582248",
"0.65752906",
"0.65680385",
"0.65624964",
"0.6561485",
"0.65586144",
"0.6540289",
"0.6540092",
"0.65288556",
"0.65235573",
"0.65162915",
"0.6511951",
"0.65066123",
"0.6496681",
"0.64953357",
"0.6494519",
"0.64937305",
"0.649039",
"0.6488296",
"0.6483125",
"0.6474355",
"0.64742005",
"0.64742005",
"0.64697134",
"0.6468482",
"0.6464204",
"0.64635813",
"0.6462515",
"0.64586574",
"0.6457569",
"0.6455683",
"0.6453377",
"0.6452219",
"0.6446469",
"0.64406973",
"0.6437461",
"0.64335144",
"0.64330465",
"0.6427012",
"0.64088774",
"0.6408445",
"0.640709"
]
| 0.6735235 | 43 |
prints the product categories | function printProductCategories () {
$stmt = getProductCategories();
print("<div class='p-2 productgroup'> <a href='#' value='all' onclick=searchCategory('all') class='px-3'>All</a></div>");
while ($row = $stmt->fetch()) {
print("<div class='p-2 productgroup'> <a href='#' value='" . $row['StockGroupID'] . "' onclick=searchCategory(" . $row['StockGroupID'] . ") class='px-3'>" . $row['StockGroupName'] . "</a></div>");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show_product_categories()\n {\n $product_id = get_queried_object_id();\n $product = get_queried_object();\n $categories = get_the_terms( $product_id , 'product_cat' );\n\n $output = '<div class=\"side-navigation\">';\n $output .= '<div class=\"side-menu-container\">';\n $output .= '<div class=\"single-product-side-menu\">';\n $output .= '<p>';\n $output .= '<a href=\"' . esc_url(home_url('/')) . '\">Home /</a>';\n $output .= $product->name;\n\n foreach ($categories as $category) :\n $found = false;\n foreach (fetch_blocked_categories() as $blocked_category) :\n if ($category->slug == $blocked_category->slug) :\n $found = true;\n endif;\n endforeach;\n if (!$found) :\n $output .= '<a href=\"' . esc_url(home_url('/product-category/' . $category->name)) . '\"> ';\n $output .= $category->name;\n $output .= ' / </a>';\n endif;\n endforeach;\n\n $output .= $product->post_title;\n $output .= '</p>';\n $output .= '</div>';\n $output .= '</div>';\n $output .= '</div>';\n\n echo $output;\n }",
"public function categoriesAction()\r\n {\r\n $categories = $this->getDoctrine()\r\n ->getManager()\r\n ->getRepository('NiftyThriftyShopBundle:ProductCategory')\r\n ->findNavigation();\r\n return $this->render('NiftyThriftyShopBundle:Navigation:_itemList.html.twig',\r\n array('title' => 'Categories',\r\n 'prefix' => 'cat',\r\n 'items' => $categories,\r\n 'path_name' => 'show_category'));\r\n }",
"public function get_categories() {\n\t\treturn [ 'dtwcbe-woo-single-product' ];\n\t}",
"function printlist($idcat){\n\t\n\t$cats0 = bucleCatPDF('',$idcat); // devuelve todas las categorias de la categoria\n\tif (count($cats0)>0){ // si hay categorias\n\t\tforeach ( $cats0 as $cat0 ){\n\t\t\t$prods = getProductsByCat($cat0['id']); // devuelte todos los productos de esa categoria\n\t\t\tif( is_array($prods) && count($prods)>0 ){ // si hay productos en esa categoria \n\t\t\t\t$_html = renderCategoriaxProducto($cat0['id']);\t// imprime todos los productos de esa categoria\n\t\t\t\techo $_html;\t\t\t\t\t\t\t\t\t\t\t\t\t// param1: idcat, param2: nombre categoria\n\t\t\t}else{ // si no hay productos en esa categoria\n\t\t\t\tprintlist($cat0['id']);\t// paso a la sig. categoria\n\t\t\t}\t\t\t\n\t\t}\n\t}else{ // si no hay categorias \n\t\t$prods = getProductsByCat($idcat); // prueba suerte si hay productos\n\t\t$categoria = new Categoria($idcat); // creo instancia de categoria para crear nombre \n\t\tif( is_array($prods) && count($prods)>0 ){ // si hay productos\n\t\t\t$_html = renderCategoriaxProducto($idcat);\t // imprimo los productos de esa categoria\n\t\t\techo $_html;\n\t\t}\n\t}\t }",
"function product_category_list(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\t$product_category_list = mysql_q(\"SELECT *\n\t\t\tFROM product_category\n\t\t\tORDER BY id\");\n\t\t$tpl->assign(\"product_category_list\", $product_category_list);\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_list.tpl\");\n\t\tdisplay($main);\n\t}",
"function displayCategory()\r\n\t {\r\n\t \t$productId = JRequest::getVar('product_id');\r\n\t \t\r\n\t \t$model = $this->getModel('qrcode');\r\n\t \t$productList = $model->getProductByCategory();//Store product details based on category.\r\n\t \tob_clean();\r\n\t \t\r\n\t \techo \"<b>\".JText::_('COM_QRCODE_VIEW_DEFAULT_PRODUCT_LIST').\"</b>\";\r\n \r\n\t \t\t\t$options = array();\r\n $default = \"\";\r\n if($productId)\r\n {\r\n \t$default = $productId;\r\n }\r\n $options[] = JHTML::_('select.option', \"0\", JText::_('COM_QRCODE_VIEW_DEFAULT_DISPLAY_ALL'));\r\n foreach ($productList as $key=>$val) {\r\n $options[] = JHTML::_('select.option', $val['product_id'], $val['product_name']);\r\n }\r\n echo JHTML::_('select.genericlist', $options, 'qrcode', 'onchange=getProductId(this.value)','value', 'text', $default); \r\n exit();\r\n\t }",
"function print_categories( $thisId ) { \n $thisCat = get_the_category( $thisId );\n foreach( $thisCat as $cat ) {\n echo $cat->slug . \" \";\n }\n}",
"function getcategorys_list(){\n \n global $wpdb;\n\n$post_per_page = (isset($_REQUEST['post_per_page'])) ? $_REQUEST['post_per_page'] : 1; \n\n$offset = $post_per_page * ($_REQUEST['page'] - 1);\n// Setup the arguments to pass in\n$args = array(\n'offset' => $offset,\n'number' => $post_per_page,\n'order' => 'DESC',\n'hide_empty'=>0\n);\n// Gather the series\n$mycategory = get_terms( 'products', $args );\n\n\n\n if(!empty($mycategory)){\n foreach($mycategory as $post)\n {\n\n \n $im = $post->taxonomy.'_'. $post->term_id; \n $collection_image = get_field('category_image',$im); \n\n $title = $collection_image['title'];\n $url = get_term_link($post);\n $medium= get_image_url($collection_image['id'],'medium');\n\n if(empty($medium)){\n $medium = (get_template_directory_uri().\"/images/no-image.png\"); \n }\n \n\n printf('<div class=\"col-lg-3 col-md-4 col-sm-4 col-xs-6\">\n <div class=\"product_info\"><a href=\"'.$url.'\" title=\"\" class=\"overly\"><span><img src=\"'.$medium.'\" alt=\"\" title=\"\"></span></a>\n <h4>'.$post->name.'</h4>\n <a href=\"'.$url.'\" title=\"View More\" class=\"link\">View More</a> </div>\n </div>');\n\n\n }\n }\n die();\n}",
"public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }",
"function getcategory_list(){\n \n global $wpdb;\n\n $post_per_page = (isset($_REQUEST['post_per_page'])) ? $_REQUEST['post_per_page'] : 1;\n $args = array('posts_per_page'=>$post_per_page,'order' => 'asc','paged'=>$_REQUEST['page'],'post_type'=>'product','tax_query' => array(\n array(\n 'taxonomy' => 'products',\n 'field' => 'term_id',\n 'terms' => $_REQUEST['tours']\n )\n ) ,'orderby' => 'ID');\n $posts = get_posts( $args );\n\n if(!empty($posts)){\n foreach($posts as $post)\n {\n\t\t\n\t\t\t\n $imgs_id = post_id_get_fetured_image($post->ID,'medium');\n\n $title = get_post(get_post_thumbnail_id($post->ID))->post_title;\n\n\nif(empty($imgs_id)){\n$imgs_id = (get_template_directory_uri().\"/images/no-image.png\"); \n}\n\n\n printf('<div class=\"col-lg-3 col-md-4 col-sm-4 col-xs-6\">\n <div class=\"product_info\"><a href=\"'.get_permalink($post).'\" title=\"\" class=\"overly\"><span><img src=\"'.$imgs_id.'\" alt=\"\" title=\"'.$post->post_title.'\"></span></a>\n <h4>'.$post->post_title.'</h4>\n <a href=\"'.get_permalink($post).'\" title=\"View More\" class=\"link\">View More</a> </div>\n </div>');\n\n\n\n }\n }\n die();\n}",
"public function render_products_category()\r\n {\r\n if ($_REQUEST['product_cat'] !== '') {\r\n wc_product_dropdown_categories(\r\n array(\r\n 'option_select_text' => __('Filter by category', 'woocommerce'),\r\n 'hide_empty' => 0,\r\n 'selected' => $_REQUEST['product_cat']\r\n )\r\n );\r\n } else {\r\n wc_product_dropdown_categories(\r\n array(\r\n 'option_select_text' => __('Filter by category', 'woocommerce'),\r\n 'hide_empty' => 0,\r\n )\r\n );\r\n }\r\n }",
"public function prod_list_by_category() {\n $url_cate = get_raw_app_uri();\n if (!empty($url_cate)) {\n $Product = new Product();\n $info = $Product->getProductByCategory($url_cate);\n $data['content'] = 'list_product'; \n $data['product'] = $info['product'];\n $data['paging'] = $info['paging'];\n $data['selected'] = $url_cate;\n \n //seo\n \n $Category = new ProductCategory();\n $list_cate = $Category->getCategoryByLink($url_cate);\n if ($list_cate->countRows() > 0){\n $list_cate->fetchNext();\n $data['title_page'] = $list_cate->get_prod_cate_name();\n $data['description'] = $list_cate->get_prod_cate_meta_description();\n $data['keywords'] = $list_cate->get_prod_cate_keywords();\n }else{\n $data['title_page'] = '';\n $data['description'] = '';\n $data['keywords'] = '';\n }\n \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n $data['array_menus'] = $array_menus;\n \n $this->load->view('temp', $data);\n } else {\n redirect(Variable::getDefaultPageString());\n }\n }",
"public function productCategoryName() {\n\t\treturn $this->generator->randomElement( static::$categories );\n\t}",
"function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }",
"function carton_product_dropdown_categories( $show_counts = 1, $hierarchical = 1, $show_uncategorized = 1, $orderby = '' ) {\n\tglobal $wp_query, $carton;\n\n\tinclude_once( $carton->plugin_path() . '/classes/walkers/class-product-cat-dropdown-walker.php' );\n\n\t$r = array();\n\t$r['pad_counts'] \t= 1;\n\t$r['hierarchical'] \t= $hierarchical;\n\t$r['hide_empty'] \t= 1;\n\t$r['show_count'] \t= $show_counts;\n\t$r['selected'] \t\t= ( isset( $wp_query->query['product_cat'] ) ) ? $wp_query->query['product_cat'] : '';\n\n\t$r['menu_order'] = false;\n\n\tif ( $orderby == 'order' )\n\t\t$r['menu_order'] = 'asc';\n\telseif ( $orderby )\n\t\t$r['orderby'] = $orderby;\n\n\t$terms = get_terms( 'product_cat', $r );\n\n\tif (!$terms) return;\n\n\t$output = \"<select name='product_cat' id='dropdown_product_cat'>\";\n\t$output .= '<option value=\"\" ' . selected( isset( $_GET['product_cat'] ) ? $_GET['product_cat'] : '', '', false ) . '>'.__( 'Select a category', 'carton' ).'</option>';\n\t$output .= carton_walk_category_dropdown_tree( $terms, 0, $r );\n\n\tif ( $show_uncategorized )\n\t\t$output .= '<option value=\"0\" ' . selected( isset( $_GET['product_cat'] ) ? $_GET['product_cat'] : '', '0', false ) . '>' . __( 'Uncategorized', 'carton' ) . '</option>';\n\n\t$output .=\"</select>\";\n\n\techo $output;\n}",
"public function product_categories()\n {\n $productCategories = ProductCategories::where('status', 'active')->orderBy('idx')->get();\n return view('setup.product_categories.index', compact('productCategories'));\n }",
"public function categoryIndex()\n {\n $output = $this->product->getProductCategory();\n\n return view('product_category.index',compact('output'));\n }",
"public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }",
"public function index()\n {\n $categories = ProductCategory::orderBy('name')->get();\n $subcategories = ProductSubcategory::orderBy('name')->get();\n $category_names = array();\n foreach ($categories as $category) {\n $category_names[$category->id] = $category->name;\n }\n\n return view('admin.product-categories')->withCategories($categories)->withSubcategories($subcategories)\n ->withCategory_names($category_names);\n }",
"public function action_cat()\n {\n $cat = $this->request->param('cat');\n $cat = mysql_real_escape_string ($cat);\n \n // Получаем список продукций\n // $category = ORM::factory('category')->where('cat_id', '=', $cat)->find();\n $category = ORM::factory('category')->where('path', '=', $cat)->find();\n\n if(!$category->loaded()){\n $this->redirect();\n }\n \n $count = $category->products->where('status', '<>', 0)->count_all();\n $pagination = Pagination::factory(array('total_items'=>$count,'items_per_page'=>2));\n $prods = array();\n $products = $category->products\n ->where('status', '<>', 0)\n ->limit($pagination->items_per_page)\n ->offset($pagination->offset)\n ->find_all();\n $prs = $category->products\n ->select('prod_cats.prod_id')\n ->where('status', '<>', 0)\n ->find_all();\n foreach ($prs as $p)\n {\n $prods[] = $p->prod_id;\n }\n if(count($prods))\n $brands = ORM::factory('brand')\n ->join('products')\n ->on('brand.brand_id', '=', 'products.brand_id')\n ->where('products.prod_id','in',$prods)\n ->group_by('brand.title')\n ->order_by('brand.title', 'ASC')\n ->find_all();\n \n \n \n //$products = $category->products->where('status', '!=', 0)->find_all();\n // $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/c' . $category->cat_id);\n $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/' . $category->path);\n $this->template->breadcrumbs = Breadcrumb::generate($this->breadcrumbs);\n \n $content = View::factory('/' . $this->theme . 'index/catalog/v_catalog_cat', array(\n 'products' => $products,\n 'cat' => $cat,\n 'pagination' =>$pagination,\n 'brands' =>$brands,\n \n ));\n \n // Выводим в шаблон\n \n $this->template->title = $category->title;\n $this->template->page_title = $category->title;\n $this->template->page_caption = $category->title;\n $this->template->center_block = array($content);\n $this->template->block_right = null; \n $filter = Filter::factory();\n $filter->loadFiltersOptions($category->cat_id);\n $this->template->filter = $filter->render();\n }",
"public function categories(){\n \n $this->data['categories'] = $this->books_model->getAllCategories();\n $this->render('books/categories');\n }",
"public function run()\n {\n $this->uploadFiles('product-categories');\n\n $categories = [\n [\n 'name' => 'Hot Promotions',\n 'icon' => 'icon-star',\n ],\n [\n 'name' => 'Electronics',\n 'icon' => 'icon-laundry',\n 'image' => 'product-categories/1.jpg',\n 'is_featured' => true,\n 'children' => [\n [\n 'name' => 'Consumer Electronic',\n 'children' => [\n [\n 'name' => 'Home Audio & Theaters',\n ],\n [\n 'name' => 'TV & Videos',\n ],\n [\n 'name' => 'Camera, Photos & Videos',\n ],\n [\n 'name' => 'Cellphones & Accessories',\n ],\n [\n 'name' => 'Headphones',\n ],\n [\n 'name' => 'Videos games',\n ],\n [\n 'name' => 'Wireless Speakers',\n ],\n [\n 'name' => 'Office Electronic',\n ],\n ],\n ],\n [\n 'name' => 'Accessories & Parts',\n 'children' => [\n [\n 'name' => 'Digital Cables',\n ],\n [\n 'name' => 'Audio & Video Cables',\n ],\n [\n 'name' => 'Batteries',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Clothing',\n 'icon' => 'icon-shirt',\n 'image' => 'product-categories/2.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Computers',\n 'icon' => 'icon-desktop',\n 'image' => 'product-categories/3.jpg',\n 'is_featured' => true,\n 'children' => [\n [\n 'name' => 'Computer & Technologies',\n 'children' => [\n [\n 'name' => 'Computer & Tablets',\n ],\n [\n 'name' => 'Laptop',\n ],\n [\n 'name' => 'Monitors',\n ],\n [\n 'name' => 'Computer Components',\n ],\n ],\n ],\n [\n 'name' => 'Networking',\n 'children' => [\n [\n 'name' => 'Drive & Storages',\n ],\n [\n 'name' => 'Gaming Laptop',\n ],\n [\n 'name' => 'Security & Protection',\n ],\n [\n 'name' => 'Accessories',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Home & Kitchen',\n 'icon' => 'icon-lampshade',\n 'image' => 'product-categories/4.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Health & Beauty',\n 'icon' => 'icon-heart-pulse',\n 'image' => 'product-categories/5.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Jewelry & Watch',\n 'icon' => 'icon-diamond2',\n 'image' => 'product-categories/6.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Technology Toys',\n 'icon' => 'icon-desktop',\n 'image' => 'product-categories/7.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Phones',\n 'icon' => 'icon-smartphone',\n 'image' => 'product-categories/8.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Babies & Moms',\n 'icon' => 'icon-baby-bottle',\n ],\n [\n 'name' => 'Sport & Outdoor',\n 'icon' => 'icon-baseball',\n ],\n [\n 'name' => 'Books & Office',\n 'icon' => 'icon-book2',\n ],\n [\n 'name' => 'Cars & Motorcycles',\n 'icon' => 'icon-car-siren',\n ],\n [\n 'name' => 'Home Improvements',\n 'icon' => 'icon-wrench',\n ],\n ];\n\n ProductCategory::truncate();\n Slug::where('reference_type', ProductCategory::class)->delete();\n MetaBoxModel::where('reference_type', ProductCategory::class)->delete();\n\n foreach ($categories as $index => $item) {\n $this->createCategoryItem($index, $item);\n }\n\n // Translations\n DB::table('ec_product_categories_translations')->truncate();\n\n $translations = [\n [\n 'name' => 'Khuyến mãi hấp dẫn',\n ],\n [\n 'name' => 'Điện tử',\n 'children' => [\n [\n 'name' => 'Điện tử tiêu dùng',\n 'children' => [\n [\n 'name' => 'Thiết bị nghe nhìn',\n ],\n [\n 'name' => 'TV & Videos',\n ],\n [\n 'name' => 'Camera, Photos & Videos',\n ],\n [\n 'name' => 'Điện thoại di động & Phụ kiện',\n ],\n [\n 'name' => 'Tai nghe',\n ],\n [\n 'name' => 'Trò chơi video',\n ],\n [\n 'name' => 'Loa không dây',\n ],\n [\n 'name' => 'Điện tử văn phòng',\n ],\n ],\n ],\n [\n 'name' => 'Phụ kiện & Phụ tùng',\n 'children' => [\n [\n 'name' => 'Digital Cables',\n ],\n [\n 'name' => 'Audio & Video Cables',\n ],\n [\n 'name' => 'Pin',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Quần áo',\n ],\n [\n 'name' => 'Máy tính',\n 'children' => [\n [\n 'name' => 'Máy tính & Công nghệ',\n 'children' => [\n [\n 'name' => 'Máy tính & Máy tính bảng',\n ],\n [\n 'name' => 'Máy tính xách tay',\n ],\n [\n 'name' => 'Màn hình',\n ],\n [\n 'name' => 'Linh kiện Máy tính',\n ],\n ],\n ],\n [\n 'name' => 'Mạng máy tính',\n 'children' => [\n [\n 'name' => 'Thiết bị lưu trữ',\n ],\n [\n 'name' => 'Máy tính xách tay chơi game',\n ],\n [\n 'name' => 'Thiết bị bảo mật',\n ],\n [\n 'name' => 'Phụ kiện',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Đồ dùng làm bếp',\n ],\n [\n 'name' => 'Sức khỏe & làm đẹp',\n ],\n [\n 'name' => 'Trang sức & Đồng hồ',\n ],\n [\n 'name' => 'Đồ chơi công nghệ',\n ],\n [\n 'name' => 'Điện thoại',\n ],\n [\n 'name' => 'Mẹ và bé',\n ],\n [\n 'name' => 'Thể thao & ngoài trời',\n ],\n [\n 'name' => 'Sách & Văn phòng',\n ],\n [\n 'name' => 'Ô tô & Xe máy',\n ],\n [\n 'name' => 'Cải tiến nhà cửa',\n ],\n ];\n\n $count = 1;\n foreach ($translations as $translation) {\n\n $translation['lang_code'] = 'vi';\n $translation['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($translation, ['children']));\n\n $count++;\n\n if (isset($translation['children'])) {\n foreach ($translation['children'] as $child) {\n\n $child['lang_code'] = 'vi';\n $child['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($child, ['children']));\n\n $count++;\n\n if (isset($child['children'])) {\n foreach ($child['children'] as $item) {\n\n $item['lang_code'] = 'vi';\n $item['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($item, ['children']));\n\n $count++;\n }\n }\n }\n }\n }\n }",
"function showCategory()\r\n {\r\n }",
"public function swc_homepage_product_categories_description() {\n\t\t$description = get_theme_mod( 'swc_homepage_category_description', '' );\n\n\t\tif ( '' !== $description ) {\n\t\t\techo '<div class=\"swc-section-description\">' . wpautop( wptexturize( $description ) ) . '</div>';\n\t\t}\n\t}",
"function wi_shop_link_markup(){\n\trequire_once \"components/shop_components/shop_catagory_markup.php\";\n\t $args = array(\n\t\t 'taxonomy' => 'product_cat',\n\t\t 'hide_empty' => true,\n\t\t 'meta_key' => 'thumbnail_id'\n\t );\n\t$categories = get_terms($args );\n\n\t//echo print_r($categories);\n\t$display = \"<section class='homepage-shop-link'>\";\n\t$display .= \"<h1>Find your darkness</h1>\";\n\techo $display;\n//\techo print_r(woocommerce_get_product_subcategories());\n\n\tforeach($categories as $category){\n\t\t//get_object_vars($category) ;\n\t\tshop_catagory($category);\n\t}\n \techo \"</section>\";\n\n //echo print_r(get_theme_mod(\"wi_hero_background_image\"));\n\n}",
"public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }",
"public function frontpage_categories_list() {\n global $CFG;\n $content = html_writer::start_tag('div', array('class' => 'container'));\n $content .= html_writer::tag('h2', get_string('categories'));\n\n global $CFG;\n $chelper = new coursecat_helper();\n $chelper->set_subcat_depth($CFG->maxcategorydepth)->set_show_courses(\n self::COURSECAT_SHOW_COURSES_COUNT)->set_categories_display_options(\n array(\n 'limit' => $CFG->coursesperpage,\n 'viewmoreurl' => new moodle_url('/course/index.php',\n array('browse' => 'categories', 'page' => 1))\n ))->set_attributes(array('class' => 'frontpage-category-names'));\n $categories = $this->get_categories();\n\n $attributes = $chelper->get_and_erase_attributes('course_category_tree clearfix');\n $content .= html_writer::start_tag('div', $attributes);\n $content .= html_writer::start_tag('div', array('class' => 'content'));\n $content .= html_writer::start_tag('div', array('class' => 'subcategories'));\n foreach ($categories as $key => $value) {\n $content .= $this->enlightlite_coursecat_category($chelper, core_course_category::get($key), 1);\n }\n $content .= html_writer::end_tag('div');\n $content .= html_writer::end_tag('div');\n $content .= html_writer::end_tag('div');\n $content .= html_writer::end_tag('div');\n return $content;\n }",
"public function displayCategories()\n {\n $query = $this->categoryModel->displayCategories();\n $this->showCategories = $query->fetchAll();\n }",
"public function showAllCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,true,true);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }",
"public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }",
"public static function renderCategories() \n {\n $categories = self::find()->indexBy('category_id')->asArray()->all();\n foreach($categories as $category) {\n ?>\n <li class=\"b-categories__item b-categories__<?= $category[\"name\"]; ?> transition3\">\n <ul class=\"submenu\">\n <li>\n <?= Html::a(\n Html::tag('span', mb_strtoupper($category[\"title\"]),\n ['class' => 'b-categories__link']),\n ['category/view', 'id' => $category['category_id']],\n ['class' => [$category[\"name\"], 'b-categories__alink']]\n ) ?>\n </li>\n </ul>\n </li>\n <?php\n }\n }",
"public function get_sidebar_categories(){\n\n $html = '<tr class=\"wm-widget-sub-title\"><td>{{categories-title}}:</td></tr><tr class=\"wm-widget-info\"><td>';\n\n $categories = get_the_category();\n $output = '';\n foreach( $categories as $category ){\n $id = get_cat_ID( $category->name );\n $url = get_category_link( $id );\n $output .= '<span class=\"wm-tags\"><a href=\"' . $url . '\">' . $category->name . '</a></span>, ';\n }\n\n if( count( $categories ) > 1 ){\n /** Replace the categories title to be plural. */\n $html = str_replace( '{{categories-title}}', 'Categories', $html );\n } else {\n /** Replace the categories title to be singular. */\n $html = str_replace( '{{categories-title}}', 'Category', $html );\n }\n\n /** Remove the extra comma and space from the loop and close the HTML. */\n $html .= substr( $output, 0, strlen( $output ) - 2 ) . '</td></tr>';\n return $html;\n }",
"public function index()\n {\n return ProductCategoryResource::collection(ProductCategory::all());\n }",
"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 }",
"function getProductsByCategory()\n\t{\n\t\tglobal $con;\n\t\tif (isset($_GET['cat'])){\n\t\t\t$cat_id = $_GET['cat'];\n\t\t\t$get_products = \"select * from products where prod_cat='$cat_id'\";\n\t\t\t$run_products = mysqli_query($con, $get_products);\n\t\t\t$count = mysqli_num_rows($run_products);\n\t\t\t\n\t\t\tif ($count == 0)\n\t\t\t\techo \"<h2>No Products in this category</h2>\";\n\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\techo \"\n\t\t\t\t<div class='single_product'>\n\t\t\t\t\t<h3>$prod_title</h3>\n\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t}\n\t}",
"protected function export_categoryless_products()\n {\n $table = $this->getTableName(\"catalog_product_entity\");\n $categoryProductsTable = $this->getTableName(\"catalog_category_product\");\n $catalogProductWebsite = $this->getTableName(\"catalog_product_website\");\n $rootCategoryId = $this->_fStore->getRootCategoryId();\n $sql = \"SELECT DISTINCT(entity_id), type_id, sku FROM {$table}\n LEFT JOIN (`{$categoryProductsTable}`) ON ({$table}.`entity_id` = `{$categoryProductsTable}`.`product_id`)\n LEFT JOIN (`{$catalogProductWebsite}`) ON ({$table}.`entity_id` = `{$catalogProductWebsite}`.`product_id`)\n WHERE (`{$categoryProductsTable}`.`product_id` IS NULL OR `{$categoryProductsTable}`.`category_id` NOT IN ({$this->_getCategoriesForStore()}))\n AND {$table}.entity_type_id = {$this->_product_entity_type_id}\n AND `{$catalogProductWebsite}`.`website_id` = \" . $this->getWebsiteId($this->_fStore_id); \n \n return $this->export_products($sql, 'categoryless_products');\n }",
"function get_categoriaslist(){\r\n $args = array(\r\n 'orderby' => 'name',\r\n 'order' => 'ASC'\r\n );\r\n $categories = get_categories($args);\r\n ?><ul><?php \r\n foreach($categories as $category) { \r\n ?><li><a href=\"<?php echo get_category_link( $category->term_id ); ?>\"><?php echo $category->name;?></a></li><?php \r\n }\r\n ?></ul><?php \r\n}",
"public function index()\n {\n return ProductCategory::orderBy('name')->get();\n }",
"function tc_category_list() {\r\n $post_terms = apply_filters( 'tc_cat_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = true ) );\r\n $html = false;\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_category_list_class', 'btn btn-mini' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if $postcats\r\n return apply_filters( 'tc_category_list', $html );\r\n }",
"public function getProdCategory()\n {\n return $this->prod_category;\n }",
"public function categoriesPageAction()\n {\n // Get entity Manager\n $em = $this->get('doctrine')->getManager();\n\n // Retrive all exsisting categories\n $categories = $em->getRepository('VideotechBundle:Category')\n ->findAll();\n\n\n // Render display\n return $this->render('@Videotech/Category/list.twig', array(\n \"categories\" => $categories\n ));\n }",
"function superfood_elated_woocommerce_category_html_part($class_name = '') {\n\t\tglobal $product;\n\t\t\n\t\t$html = '';\n\t\t$product_categories = wc_get_product_category_list($product->get_id(), ', ');\n\n\t\tif (!empty($product_categories)) {\n\t\t\t\n\t\t\t$html = '<h6 class=\"eltdf-'.esc_attr($class_name).'-category\">'.$product_categories.'</h6>';\n\t\t}\n\t\t\n\t\treturn $html;\n\t}",
"function bh_products_category_loop(){\n//post sorting\n\n\n?>\n\n<?php\n//display content\n?>\t\n\n<div class=\"inner\">\n<div class=\"sidebar grid col-220 product-categories\">\n<?php //get_sidebar(); \n//should only be child category, so display parent.\n\nif (is_category()) {\n$this_category = get_category( get_query_var( 'cat' ) );\n}\n\n\n\n//if child category\nif($this_category->category_parent) {\n$parent_cat = get_category($this_category->category_parent);\n//check for third-level cat\n\tif($parent_cat->category_parent){\n\t\t$parent_parent = get_category($parent_cat->category_parent);\n\t\techo '<h2><a href=\"'. get_category_link($parent_parent->cat_ID) .'\">'. $parent_parent->name .'</a></h2>';\n\t\techo '<ul>';\n\t\t$categorylist = wp_list_categories('show_count=0&title_li=&use_desc_for_title=0&child_of='.$parent_cat->category_parent.\"&orderby=slug&hide_empty=0&exclude=1649\"); \t\n\t\techo '</ul>';\n\t\t\n\tif ($parent_parent->name == \"Apps\"){\n\techo '<p> </p>';\n\techo '<h2>Platforms</h2>';\n\techo '<ul>';\n\t$platforms = \twp_list_categories('show_count=0&title_li=&use_desc_for_title=0&hide_empty=0&child_of=1649');\n\techo '</ul>';\n\t\n}\n\t\t\n\t}else{\n\t\techo '<h2><a href=\"'. get_category_link($parent_cat->cat_ID) .'\">'. $parent_cat->name .'</a></h2>';\n\t\techo '<ul>';\n\t\t$categorylist = wp_list_categories('show_count=0&title_li=&use_desc_for_title=0&child_of='.$this_category->category_parent.\"&orderby=slug&hide_empty=0&exclude=1649\"); \n\t\techo '</ul>';\n\t\t\n\t\tif ($parent_cat->name == \"Apps\"){\n\techo '<p> </p>';\n\techo '<h2>Platforms</h2>';\n\techo '<ul>';\n\t$platforms = \twp_list_categories('show_count=0&title_li=&use_desc_for_title=0&hide_empty=0&child_of=1649');\n\techo '</ul>';\n\t\n}\n\t}\n}else{\n\n//if top-level category\necho '<h2>'. $this_category->name .'</h2>';\necho '<ul>';\n$categorylist = wp_list_categories('show_count=0&title_li=&use_desc_for_title=0&child_of='.$this_category->cat_ID.\"&orderby=slug&hide_empty=0&exclude=1649\");\necho '</ul>';\n\nif ($this_category->name == \"Apps\"){\n\techo '<p> </p>';\n\techo '<h2>Platforms</h2>';\n\techo '<ul>';\n\t$platforms = \twp_list_categories('show_count=0&title_li=&use_desc_for_title=0&hide_empty=0&child_of=1649');\n\techo '</ul>';\n\t\n}\n}\necho '<p> </p>';\n\n\n\n ?>\n\t\n\n</div>\n\n <div id=\"content\" class=\"grid col-700 fit\">\n <!-- <div class=\"select-post-sorting\"></div> -->\n\t\t<?php \n\t\t$cat = get_query_var('cat');\n\t\t$category_info = get_category($cat);\n\t\t//echo 'Is first level? = '. $category_info->parent;\n\t\t\n\t\t$parent_info = get_category($category_info->parent);\n\t\t//echo 'Is second level? = '. $parent_info->parent;\n\t\t\n\t\t$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; //pagination\t\t\n\t\t//$ext_query = '&meta_key=wpcf-pubdate&orderby=meta_value_num&posts_per_page=25&paged='.$paged.'';\n\t\t$sort_meta_key = 0; //init\n\t\t//get sort information from query vars or defaults\n\t\t$sort_orderby = (get_query_var('orderby')) ? get_query_var('orderby') : 'pubdate';\n\t\t$sort_order = (get_query_var('order')) ? get_query_var('order') : 'DESC';\n\t\t$sort_posts_per_page = (get_query_var('ppp')) ? get_query_var('ppp') : '25';\n\t\t\n\t\tif($sort_orderby =='pubdate'){\n\t\t\t$sort_orderby = 'meta_value_num';\n\t\t\t$sort_meta_key = 'wpcf-pubdate';\n\t\t}\n\t\n\t\t$ext_query = array(\n\t\t\t\t\t\t\t\t\t\t\t\t'post_type'=>'products',\n\t\t\t\t\t\t\t\t\t\t\t\t'category_name'=>$category_info->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t'meta_key'=>'wpcf-pubdate',\n\t\t\t\t\t\t\t\t\t\t\t\t'orderby'=>'meta_value_num',\n\t\t\t\t\t\t\t\t\t\t\t\t'order'=>'DESC',\n\t\t\t\t\t\t\t\t\t\t\t\t'posts_per_page'=>'25',\n\t\t\t\t\t\t\t\t\t\t\t\t'tag'=>'listed',\n\t\t\t\t\t\t\t\t\t\t\t\t'paged'=>$paged\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tif($sort_meta_key){\n\t\t\t$ext_query['meta_key'] = $sort_meta_key;\t\n\t\t}\n\t\t\n\t\t$title_qual = \"\";\n\t\t//query_posts($query_string . $ext_query );\n\t\tglobal $wp_query;\n\t\t//show only main product of groups, if product-group-parent field is populated, hide the post\n\t\t//edit: needs refinement - only for Bibles, and needs to compare non-existent OR blank\n\t\t// modified 3/18/14 to use custom SQL searching indexed taxonomy instead of custom field\n\t\t\n\t\t\n\t\t$newQuery = $ext_query;\n\t\t//$newQuery = array_replace($wp_query->query_vars, $ext_query);// + $p_groups; //changed for WP 4.0 something in WP_Query changed, found 0 posts\n\t\t//var_dump($newQuery);\n\t\n\t\t\t$books_in_cat = new WP_Query($newQuery);\n\t\t\n\t\t//echo '<br/>#posts: '.$books_in_cat->found_posts; //troubleshooting\n\t\t\t\nif ($books_in_cat->have_posts()) : ?>\n<div>\n<div class=\"product-category product-list\">\n<h2><?php echo $title_qual; ?><?php single_cat_title(); ?> </h2>\n<ul>\n\t\t<?php while ($books_in_cat->have_posts()) : $books_in_cat->the_post(); ?>\n \n <li id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t\t<?php\n\t\t\t bh_thumbnail(get_the_ID(),'medium',true);\n\t\t\t \n\t\t\t $product_title = get_the_title(); //init\n\t\t\t $pg_names = array(); //init\n\t\t\t \n\t\t\t if (has_term('listed','post_tag')){\n\t\t\t\t $pg_names = wp_get_post_terms(get_the_ID(),'product-group',array('fields'=>'names'));\n\t\t\t\t if (!empty($pg_names)){\n\t\t\t\t\t$product_title = reset($pg_names);//change to product group title\n\t\t\t\t }\n\t\t\t\t $pg_names = array(); //re-initalize array\n\t\t\t }\n\t\t\t \n\t\t\t $short_title = wp_trim_words($product_title,8);\n?>\n <a href=\"<?php the_permalink(); ?>\"><?php echo $short_title; ?></a>\n \t\t\t\t<?php $pubdate = get_post_meta(get_the_ID(),'wpcf-pubdate',true); \n\t\t\t\t\t\t\t//turn pubdate into Month Year\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//modify product list display\n\t\t\t\t\t\t\t//if title is too long, don't show subtitle/authors\n\t\t\t\t\t\t\tif(strlen(get_the_title())<32){\n\t\t\t\t\t\t\t\t//get current category or parent category\n\t\t\t\t\t\t\t\t//get category\n\t\t\t\t\t\t\t\tif($parent_info){\n\t\t\t\t\t\t\t\t\t//if child category\n\t\t\t\t\t\t\t\t\t$current_cat = $parent_info->slug;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$current_cat = $category_info->slug;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//ge\tt subtitle\n\t\t\t\t\t\t\t$p_subtitle = types_render_field('subtitle', array(\"raw\"=>\"true\"));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//if Bibles or Reference, show subtitle\n\t\t\t\t\t\t\t//echo $current_cat;\n\t\t\t\t\t\t\tif($current_cat =='bibles' || $current_cat == 'reference' || $category_info->slug == 'commentaries' ):\n\t\t\t\t\t\t\t?>\n <span class=\"author-names\"><?php echo $p_subtitle ?></span>\n <?php\t\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t//else show author(s)\t\n\t\t\t\t\t\t\t//get author name(s)\n\t\t\t\t\t\t\t$a_list=false;\n\t\t\t\t\t\t\t$a_terms = wp_get_post_terms(get_the_ID(), 'a', array(\"fields\" => \"names\"));\n\t\t\t\t\t\t\tif($a_terms){\n\t\t\t\t\t\t\t\t$a_list = implode(', ', $a_terms);\t\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tif($a_list){\n\t\t\t\t\t\t\t?>\n <span class=\"author-names\"><?php echo $a_list; ?></span>\n <?php\n\t\t\t\t\t\t\t}elseif ($p_subtitle){\n\t\t\t\t\t\t\t//no authors (?) - show subtitle if exists\t\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t <span class=\"author-names\"><?php echo $p_subtitle; ?></span>\n <?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t//title too long, no room for other text\n\t\t\t\t\t\t\t}\n ?>\n </li><!-- end of #post-<?php the_ID(); ?> -->\n \n\n \n <?php endwhile; \n\t\t if(!$hide_navi){\n\t\t if(function_exists('wp_pagenavi')) { \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twp_pagenavi( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'query' =>$books_in_cat \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t }\n\t\t\n\t\t?> \n \n\t\t</ul>\n </div>\n\t <?php else : ?>\n\n <!-- <h1 class=\"title-404\"><?php _e('404 — Fancy meeting you here!', 'minimum'); ?></h1> -->\n \n <p><?php _e('No products found in '. $parent_info->name.' > '. single_cat_title('',false) .'.', 'minimum'); ?></p>\n \n <!-- <h6><?php printf( __('You can return %s or search for the page you were looking for.', 'minimum'),\n\t sprintf( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a>',\n\t\t esc_url( get_home_url() ),\n\t\t esc_attr__('Home', 'minimum'),\n\t\t esc_attr__('← Home', 'minimum')\n\t )); \n\t\t\t ?></h6>\n \n <?php get_search_form(); ?> -->\n\n<?php endif; ?> \n \n </div><!-- end of #content -->\n</div>\n</div>\n<?php\n}",
"function sportal_categories()\n{\n\tglobal $context, $scripturl, $txt;\n\n\tloadTemplate('PortalCategories');\n\n\t$context['categories'] = sportal_get_categories(0, true, true);\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=portal;sa=categories',\n\t\t'name' => $txt['sp-categories'],\n\t);\n\n\t$context['page_title'] = $txt['sp-categories'];\n\t$context['sub_template'] = 'view_categories';\n}",
"public function showMovieCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\n <h1>Movies</h1>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,false,true);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }",
"public function list()\n {\n $getCategoryList = $this->product->activeCategoryList();\n \n return view('product.list',compact('getCategoryList'));\n }",
"public function index()\n {\n return ProductResource::collection(Product::with('categories')->get());\n }",
"public function productByCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsByCategory($category);\n $this->view->render('Riding Gear', $vars);\n }",
"function mts_the_category( $separator = ', ' ) {\n $categories = get_the_category();\n $count = count($categories);\n foreach ( $categories as $i => $category ) {\n echo '<a href=\"' . get_category_link( $category->term_id ) . '\" title=\"' . sprintf( __( \"View all posts in %s\", 'mythemeshop' ), $category->name ) . '\" ' . ' itemprop=\"articleSection\">' . $category->name.'</a>';\n if ( $i < $count - 1 )\n echo $separator;\n }\n}",
"function tep_show_category($counter) {\r\n\r\n// BoF - Contribution Category Box Enhancement 1.1\r\n global $tree, $categories_string, $cPath_array, $cat_name;\r\n\r\n for ($i=0; $i<$tree[$counter]['level']; $i++) {\r\n $categories_string .= \" \";\r\n }\r\n $cPath_new = 'cPath=' . $tree[$counter]['path'];\r\n if (isset($cPath_array) && in_array($counter, $cPath_array) && $cat_name == $tree[$counter]['name']) { //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a style=\"color:#874b5a;text-decoration:none\" href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t //Link nicht anklickbar, wenn angewählt\r\n } else {\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\r\n }\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //Link nicht anklickbar, wenn angewählt\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '<b>';\r\n }\r\n\r\n if ($cat_name == $tree[$counter]['name']) {\r\n $categories_string .= '<span class=\"errorText\">';\r\n }\r\n\r\n// display category name\r\n $categories_string .= '<img src=\"'. DIR_WS_IMAGES .'m25.gif\" align=\"absmiddle\" border=0 hspace=\"5\" vspace=\"0\">' . $tree[$counter]['name'];\r\n\r\n\t\tif ($cat_name == $tree[$counter]['name']) {\r\n\t\t\t$categories_string .= '</span>';\r\n }\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '</b>';\r\n }\r\n// \tEoF Category Box Enhancement\r\n\r\n $categories_string .= '</a>';\r\n\r\n if (SHOW_COUNTS == 'true') {\r\n $products_in_category = tep_count_products_in_category($counter);\r\n if ($products_in_category > 0) {\r\n $categories_string .= ' (' . $products_in_category . ')';\r\n }\r\n }\r\n\r\n $categories_string .= '<br>';\r\n\r\n if ($tree[$counter]['next_id'] != false) {\r\n\t\t$categories_string .= '<div style=\"height:5px; line-height:5px; background: url('.DIR_WS_IMAGES .'m26.gif) center repeat-x;\"></div>';\r\n tep_show_category($tree[$counter]['next_id']);\r\n }\r\n }",
"public static function route_products_and_categories()\n\t{\n\t\tforeach(ORM::factory('product')->find_all() as $object)\n\t\t{\n\t\t\tKohana::config_set('routes.' . $object->show_path(false), inflector::plural($object->object_name) . '/show/' . $object);\n\t\t}\n\t\t\n\t\tforeach(ORM::factory('category')->find_all() as $object)\n\t\t{\n\t\t\tKohana::config_set('routes.' . $object->show_path(false), inflector::plural($object->object_name) . '/show/' . $object);\n\t\t}\n\t}",
"public function categoryproductDisplay($bran_id){\n $result= $this->categoryProduct($bran_id);\n\n if($result == \"PRODUCTS_NOT_FOUND\"){\n echo(\"NO_PRODUCT_FOUND_UNDER_CATEGORY\");\n }\n else{\n foreach($result as $categoryProduct){\n echo('<div class=\"col-lg-6\">'.\n \n '<div class=\"d-block d-md-flex listing vertical\">'.\n '<a href=\"#\" class=\"img d-block\" style=\"background-image: url('.$categoryProduct[\"product_mainimg\"].')\"></a>'.\n '<div class=\"lh-content\">'.\n '<a href=\"#\" class=\"bookmark\"><span class=\"icon-heart\"></span></a>'.\n '<h3><a href=\"#\">'.$categoryProduct[\"product_title\"].'</a></h3>'.\n '<address>'.$categoryProduct[\"post_time\"].'</address>'.\n '<p class=\"mb-0\">'.\n '<span class=\"review\">$'.$categoryProduct[\"product_price\"].'.00</span>'.\n '</p>'.\n '</div>'.\n '</div>'.\n\n '</div>');\n }\n }\n \n }",
"private function loadProductCategoryOptions($productCategory)\n {\n $selectCategoryQueries = $this->DBH->query(\"SELECT pcat_name, pcat_id FROM product_category ORDER BY pcat_name\");\n\n while($r = mysql_fetch_assoc($selectCategoryQueries))\n {\n\n echo \"<option disabled='disabled' value='$r[pcat_id]'>$r[pcat_name]</option>\";\n\n $selectSubcategories = $this->DBH->query(\"SELECT psub_name, psub_id FROM product_subcategory WHERE psub_category = '\".$r[\"pcat_id\"].\"'\");\n while($sc = mysql_fetch_assoc($selectSubcategories))\n {\n\n if($productCategory == $sc[\"psub_id\"])\n {\n $selectedAdd = \" selected='selected' \";\n }\n else\n {\n $selectedAdd = \"\";\n }\n\n echo \"<option $selectedAdd value='$sc[psub_id]'> $sc[psub_name]</option>\";\n }\n }\n }",
"function user_the_categories() {\n // get all categories for this post\n global $cats;\n $cats = get_the_category();\n // echo the first category\n echo $cats[0]->cat_name;\n // echo the remaining categories, appending separator\n for ($i = 1; $i < count($cats); $i++) {echo ', ' . $cats[$i]->cat_name ;}\n}",
"function listCat()\n {\n session(['action' => 'listCat']);\n $list_cats = Product_cat::select('id', 'name', 'slug', 'created_at', 'parent_id')->get();\n $result = $this->data_tree($list_cats, 0, 0);\n\n //Duyệt từng ptu mảng $result\n foreach ($result as $k => $v) {\n //gán số lượng của tên danh mục = đếm số bản ghi có post_cat_id là id của danh mục\n $count_post[$v['name']] = Product::where('product_cat_id', $v['id'])->count();\n }\n return view('admin.product.cat', compact('result', 'list_cats', 'count_post'));\n }",
"function showCategory($catList) {\n $str =\"<ul id='menu-categories-menu'>\";\n foreach ($catList->getCategoriesActive()->getList() as $k => $v) {\n $str .=\"<li><a href='#'>\".$v->getCatname().\"</a></li>\";\n }\n $str .=\"</ul>\";\n return $str;\n}",
"function getDocumentCategories()\n\t{\n\t\tif(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');\n\t\t$module_srl = Context::get('module_srl');\n\t\t$categories= $this->getCategoryList($module_srl);\n\t\t$lang = Context::get('lang');\n\t\t// No additional category\n\t\t$output = \"0,0,{$lang->none_category}\\n\";\n\t\tif($categories)\n\t\t{\n\t\t\tforeach($categories as $category_srl => $category)\n\t\t\t{\n\t\t\t\t$output .= sprintf(\"%d,%d,%s\\n\",$category_srl, $category->depth,$category->title);\n\t\t\t}\n\t\t}\n\t\t$this->add('categories', $output);\n\t}",
"function get_categories( $sep = ', ', $before = '', $after = '' ) {\n\t\treturn get_the_term_list($this->id, 'product_cat', $before, $sep, $after);\n\t}",
"public function action_catalog_products_cout()\n {\n echo '<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\n echo '<tr><td width=\"120px\">Catalog Name</td><td width=\"100px\">在架产品数量</td><td width=\"100px\">下架产品数量</td></tr>';\n $catalogs = DB::select('id')->from('products_category')->where('visibility', '=', 1)->where('on_menu', '=', 1)->execute('slave');\n foreach($catalogs as $cata)\n {\n $catalog = Catalog::instance($cata['id']);\n $posterity_ids = $catalog->posterity();\n $posterity_ids[] = $cata['id'];\n $posterity_sql = implode(',', $posterity_ids);\n\n $sql = 'SELECT count(distinct products.id) as num FROM products LEFT JOIN catalog_products ON catalog_products.product_id=products.id \n WHERE catalog_products.catalog_id IN (' . $posterity_sql . ') AND products.site_id =1 AND products.visibility = 1';\n\n $onsale_count = DB::query(Database::SELECT, $sql . ' AND status = 1')->execute('slave')->get('num');\n $offsale_count = DB::query(Database::SELECT, $sql . ' AND status = 0')->execute('slave')->get('num');\n\n echo '<tr><td>' . $catalog->get('name') . '</td><td>' . $onsale_count . '</td><td>' . $offsale_count . '</td></tr>';\n }\n echo '</table>';\n }",
"public function show(Category $Products)\n {\n //\n }",
"function GetCategories(){\n\t\t\tglobal $wpdb;\n\n\t\t\t$categories = get_all_category_ids();\n\t\t\t$separator = '|';\n\t\t\t$output = array();\n\t\t\tif($categories){\n\t\t\t\tforeach($categories as $category) {\n\t\t\t\t\t$temp_catname = get_cat_name($category);\n\t\t\t\t\tif ($temp_catname !== \"Uncategorized\"){\n\t\t\t\t\t\t$output[$category] = $temp_catname;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$output = 'test';\n\t\t\t}\n\t\t\treturn $output;\n\t\t}",
"public function actionCategories()\n {\n // $model ->select('category')\n // ->from('product')\n // ->distinct()\n // ->all();\n \n // if ($model) {\n // foreach ($model as $row) {\n // print_r($row['category']);\n // }\n // }\n $query = product::find()->select('category')->distinct();\n foreach($query as $row)\n {\n print_r($row->category);\n }\n \n exit();\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return $model;\n\n }",
"public function run()\n\t{\n\t\tDB::table('product_category')->where('id', '!=', 1)->delete();\n\n\t\t$now = date('Y-m-d H:i:s');\n\n\t\t$category['main'] = 'Art';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Art Zines';\n\t\t\t$sub_category[] = 'Collage & Mixed Media';\n\t\t\t$sub_category[] = 'Custom Portraits';\n\t\t\t$sub_category[] = 'Decorative Arts';\n\t\t\t$sub_category[] = 'Drawing & Illustration';\n\t\t\t$sub_category[] = 'Figurines & Art Objects';\n\t\t\t$sub_category[] = 'Painting';\n\t\t\t$sub_category[] = 'Photography';\n\t\t\t$sub_category[] = 'Printmaking';\n\t\t\t$sub_category[] = 'Prints & Posters';\n\t\t\t$sub_category[] = 'Sculpture';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Home & Living';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Bath & Beauty';\n\t\t\t$sub_category[] = 'Books, Music & Media';\n\t\t\t$sub_category[] = 'Collectables';\n\t\t\t$sub_category[] = 'Decor & Housewares';\n\t\t\t$sub_category[] = 'Dining & Entertaining';\n\t\t\t$sub_category[] = 'Electronics & Gadgets';\n\t\t\t$sub_category[] = 'Food Market';\n\t\t\t$sub_category[] = 'Furniture';\n\t\t\t$sub_category[] = 'Kitchen';\n\t\t\t$sub_category[] = 'Lighting';\n\t\t\t$sub_category[] = 'Musical Instruments';\n\t\t\t$sub_category[] = 'Outdoors & Garden';\n\t\t\t$sub_category[] = 'Pets';\n\t\t\t$sub_category[] = 'Stationery & Party';\n\t\t\t$sub_category[] = 'Storage & Organisation';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Mobile Accessories';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Decals';\n\t\t\t$sub_category[] = 'Docking Stations & Chargers';\n\t\t\t$sub_category[] = 'Flash Drives';\n\t\t\t$sub_category[] = 'Gear for Android';\n\t\t\t$sub_category[] = 'Gear for Kindle';\n\t\t\t$sub_category[] = 'Gear for iPad Mini';\n\t\t\t$sub_category[] = 'Gear for iPad';\n\t\t\t$sub_category[] = 'Gear for iPhone';\n\t\t\t$sub_category[] = 'Headphones';\n\t\t\t$sub_category[] = 'Keyboard Accessories';\n\t\t\t$sub_category[] = 'Laptop Bags';\n\t\t\t$sub_category[] = 'Laptop Cases';\n\t\t\t$sub_category[] = 'Phone Cases & Wallets';\n\t\t\t$sub_category[] = 'Phone Covers';\n\t\t\t$sub_category[] = 'Phone Plugs & Charms';\n\t\t\t$sub_category[] = 'Speakers';\n\t\t\t$sub_category[] = 'Stands';\n\t\t\t$sub_category[] = 'Styluses';\n\t\t\t$sub_category[] = 'Tablet Accessories';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Jewellery';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Body';\n\t\t\t$sub_category[] = 'Bracelets';\n\t\t\t$sub_category[] = 'Brooches';\n\t\t\t$sub_category[] = 'Earrings';\n\t\t\t$sub_category[] = 'Eco-Friendly';\n\t\t\t$sub_category[] = 'Fine Jewellery';\n\t\t\t$sub_category[] = 'Kids';\n\t\t\t$sub_category[] = 'Men';\n\t\t\t$sub_category[] = 'Necklaces';\n\t\t\t$sub_category[] = 'Personalised';\n\t\t\t$sub_category[] = 'Rings';\n\t\t\t$sub_category[] = 'Storage & Organisation';\n\t\t\t$sub_category[] = 'Watches';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Women';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Accessories';\n\t\t\t$sub_category[] = 'Bags & Purses';\n\t\t\t$sub_category[] = 'Bottoms';\n\t\t\t$sub_category[] = 'Costumes';\n\t\t\t$sub_category[] = 'Dresses';\n\t\t\t$sub_category[] = 'Outerwear';\n\t\t\t$sub_category[] = 'Shoes';\n\t\t\t$sub_category[] = 'Nightwear & Intimates';\n\t\t\t$sub_category[] = 'Specialty';\n\t\t\t$sub_category[] = 'Sizes';\n\t\t\t$sub_category[] = 'Swimwear & Coverups';\n\t\t\t$sub_category[] = 'Tops';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Men';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Tanks';\n\t\t\t$sub_category[] = 'Bags & Wallets';\n\t\t\t$sub_category[] = 'Belts & Buckles';\n\t\t\t$sub_category[] = 'Bottoms';\n\t\t\t$sub_category[] = 'Coats & Jackets';\n\t\t\t$sub_category[] = 'Costumes';\n\t\t\t$sub_category[] = 'Cufflinks';\n\t\t\t$sub_category[] = 'Hats';\n\t\t\t$sub_category[] = 'Hoodies & Sweatshirts';\n\t\t\t$sub_category[] = 'Shirts';\n\t\t\t$sub_category[] = 'Shoes';\n\t\t\t$sub_category[] = 'Suits';\n\t\t\t$sub_category[] = 'Jumpers';\n\t\t\t$sub_category[] = 'T-Shirts';\n\t\t\t$sub_category[] = 'Ties, Clips & Bow Ties';\n\t\t\t$sub_category[] = 'Other Clothing';\n\t\t\t$sub_category[] = 'Other Accessories';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Kids';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Baby & Toddler';\n\t\t\t$sub_category[] = 'Bath';\n\t\t\t$sub_category[] = 'Boys';\n\t\t\t$sub_category[] = 'Costumes';\n\t\t\t$sub_category[] = 'Eco-Friendly';\n\t\t\t$sub_category[] = 'Furniture & Decor';\n\t\t\t$sub_category[] = 'Girls';\n\t\t\t$sub_category[] = 'Personalised';\n\t\t\t$sub_category[] = 'School & Learning';\n\t\t\t$sub_category[] = 'Special Occasions';\n\t\t\t$sub_category[] = 'Toys';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Vintage';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Accessories';\n\t\t\t$sub_category[] = 'Antiques';\n\t\t\t$sub_category[] = 'Art';\n\t\t\t$sub_category[] = 'Bags & Purses';\n\t\t\t$sub_category[] = 'Books';\n\t\t\t$sub_category[] = 'Clothing';\n\t\t\t$sub_category[] = 'Collectables';\n\t\t\t$sub_category[] = 'Electronics';\n\t\t\t$sub_category[] = 'Furniture';\n\t\t\t$sub_category[] = 'Home Decor';\n\t\t\t$sub_category[] = 'Housewares';\n\t\t\t$sub_category[] = 'Jewellery';\n\t\t\t$sub_category[] = 'Paper Ephemera';\n\t\t\t$sub_category[] = 'Serving';\n\t\t\t$sub_category[] = 'Toys';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Weddings';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'Bridal Accessories';\n\t\t\t$sub_category[] = 'Decor';\n\t\t\t$sub_category[] = 'Dresses';\n\t\t\t$sub_category[] = 'Groom\\'s Corner';\n\t\t\t$sub_category[] = 'Paper Goods';\n\t\t\t$sub_category[] = 'Rings';\n\t\t\t$sub_category[] = 'Wedding Party';\n\t\t\t$sub_category[] = 'Real Weddings';\n\t\t\t$sub_category[] = 'Registry';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Craft Supplies';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'DIY Weddings';\n\t\t\t$sub_category[] = 'Fine Arts';\n\t\t\t$sub_category[] = 'Floral & Gardening';\n\t\t\t$sub_category[] = 'Food Crafting';\n\t\t\t$sub_category[] = 'Framing';\n\t\t\t$sub_category[] = 'Gift Wrapping';\n\t\t\t$sub_category[] = 'Jewellery Making';\n\t\t\t$sub_category[] = 'Knitting & Crochet';\n\t\t\t$sub_category[] = 'Paper Crafts';\n\t\t\t$sub_category[] = 'Scrapbooking';\n\t\t\t$sub_category[] = 'Sewing, Quilting & Needle Crafts';\n\t\t\t$sub_category[] = 'Woodworking';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$category['main'] = 'Gift Ideas';\n\t\t\t$sub_category = array();\n\t\t\t$sub_category[] = 'For Couples';\n\t\t\t$sub_category[] = 'For Her';\n\t\t\t$sub_category[] = 'For Him';\n\t\t\t$sub_category[] = 'Teens';\n\t\t\t$sub_category[] = 'Kids & Baby';\n\t\t\t$sub_category[] = 'DIYer';\n\t\t\t$sub_category[] = 'Friends & Coworkers';\n\t\t\t$sub_category[] = 'Gardener & Naturalist';\n\t\t\t$sub_category[] = 'Hostess & Gourmet';\n\t\t\t$sub_category[] = 'Outdoor & Sportsman';\n\t\t\t$sub_category[] = 'Pets & Pet Lovers';\n\t\t\t$sub_category[] = 'Tech Lover';\n\t\t\t$sub_category[] = 'Novelty & Gag Gifts';\n\t\t\t$sub_category[] = 'Stocking Stuffers';\n\t\t\t$sub_category[] = 'Cards & Wrap';\n\t\t$category['sub'] = $sub_category;\n\t\t$categories[] = $category;\n\n\t\t$template_id = $addresses_id = 1;\n\t\t$id = 2;\n\t\t$category_left = 2;\n\t\tforeach($categories as $main_category){\n\t\t\t//main category details\n\t\t\t$main = array();\n\t\t\t$main['id'] = $id;\n\t\t\t$main['seo_category_name'] = $this->slugify($main_category['main']);\n\t\t\t$main['category_name'] = $main_category['main'];\n\t\t\t$main['category_level'] = 1;\n\t\t\t$main['parent_category_id'] = 1;\n\t\t\t$main['category_left'] = $category_left;\n\t\t\t$main['category_right'] = $category_left + (count($main_category['sub']) * 2) + 1;\n\t\t\t$main['date_added'] = $now;\n\t\t\t$category_left++;\n\t\t\t$id++;\n\n\t\t\tDB::table('product_category')->insert($main);\n\t\t\t//echo '$main_category:'. $main_category['main']; echo \"\\n\";\n\t\t\tforeach($main_category['sub'] as $sub_category) {\n\t\t\t\t//sub category details\n\t\t\t\t$sub = array();\n\t\t\t\t$sub['id'] = $id;\n\t\t\t\t$sub['seo_category_name'] = $this->slugify($sub_category);\n\t\t\t\t$sub['category_name'] = $sub_category;\n\t\t\t\t$sub['category_level'] = 2;\n\t\t\t\t$sub['parent_category_id'] = $main['id'];\n\t\t\t\t$sub['category_left'] = $category_left;\n\t\t\t\t$sub['category_right'] = $category_left + 1;\n\t\t\t\t$sub['date_added'] = $now;\n\t\t\t\t$category_left++;\n\t\t\t\t$category_left++;\n\t\t\t\t$id++;\n\t\t\t\t//echo ' ****************************** $sub_category:'. $sub_category; echo \"\\n\";\n\t\t\t\tDB::table('product_category')->insert($sub);\n\t\t\t}\n\t\t\t$category_left++;\n\t\t}\n\t\tDB::table('product_category')->where('id', 1)->update(array('category_right' => $category_left));\n\t}",
"public function getCatalogoCategory($category) {\n $cat = Category::findOrFail($category);\n $prods = $cat->productTypes->pluck('id');\n $products = ProductType::whereIn('id', $prods)->paginate(8);\n\n // Manipolazione dei prodotti !!!\n $products->map(function ($product) {\n\n });;\n\n return view('frontoffice.pages.shop', ['products' => $products, 'parent' => $cat]);\n }",
"public function GetAllProduct(){\r\n\t\r\n\t\t\t$m_product = new m_product();\r\n\t\t\t$CatFlowingPro = $m_product->GetAll();\r\n\t\t\r\n\t\t\r\n\t\t\t//view\r\n\t\t\tinclude(\"view/layout/header.php\");\r\n\t\t\tinclude(\"view/layout/menu.php\");\r\n\t\t\tinclude(\"view/category/cat_detail.php\");\r\n\t\t\tinclude(\"view/layout/footer.php\");\r\n\t\t}",
"public function run()\n {\n $c = \\App\\Category::find(373);\n foreach ($c->sub as $cat) {\n \tforeach($cat->products as $p){\n \t\t$p->name = str_replace($cat->title.', ', $cat->title.'. ', $p->name);\n \t\t//$p->name = $cat->title.', '.$p->name;\n \t\t$p->title = $p->name;\n \t\t$p->h1 = $p->name;\n \t\t$p->save();\n \t}\n \techo $cat->title;\n }\n }",
"function cl_woo_render_shop_cat_filter() {\n\n\t//vars\n\t$output = null;\n\t$terms = null;\n\t$args = array();\n\n\t$templates = array();\n\t$templates[] = \"template_parts/woocommerce/part-shop_nav.php\";\n\n\t$current_cat = get_queried_object();\n\n\t//First get top level terms, if already on a product cat page, get children of current qureied obj\n\tif ( is_product_category() ) {\n\n\t\tif ( ! is_object( $current_cat ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$args = array(\n\t\t\t'parent' => $current_cat->term_id,\n\t\t);\n\n\t} elseif ( is_shop() ) {\n\n\t\t$args = array(\n\t\t\t'parent' => 0,\n\t\t);\n\n\t}\n\n\t$terms = Prso_Woocom::get_product_terms( $args );\n\n\tif ( ! empty( $terms->terms ) ) {\n\n\t\t//Prepare data array for nav output (form hierarchy)\n\t\t$filter_data = cl_woo_prepare_cat_filter_data( $terms->terms );\n\n\t\tob_start();\n\t\trequire( locate_template( $templates, false ) );\n\t\t$output = ob_get_contents();\n\t\tob_end_clean();\n\n\t} elseif ( 0 !== $current_cat->parent ) { //Does the current item have a parent and siblings?\n\n\t\t$args = array(\n\t\t\t'parent' => $current_cat->parent,\n\t\t);\n\n\t\t$terms = Prso_Woocom::get_product_terms( $args );\n\n\t\tif ( ! empty( $terms->terms ) ) {\n\n\t\t\t//Prepare data array for nav output (form hierarchy)\n\t\t\t$filter_data = cl_woo_prepare_cat_filter_data( $terms->terms );\n\n\t\t\tob_start();\n\t\t\trequire( locate_template( $templates, false ) );\n\t\t\t$output = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t}\n\n\t} else { //Fallback and just display current term\n\n\t\t//Prepare data array for nav output (form hierarchy)\n\t\t$filter_data = cl_woo_prepare_cat_filter_data( array( $current_cat ) );\n\n\t\tob_start();\n\t\trequire( locate_template( $templates, false ) );\n\t\t$output = ob_get_contents();\n\t\tob_end_clean();\n\n\t}\n\n\techo $output;\n}",
"public function getProductCategories($product) {\n $categoryIds = $product->getCategoryIds();\n if (!$categoryIds) {\n return \"\";\n }\n\n // Fetch collection\n $categoryCollection = $this->objectManager->create('Magento\\Catalog\\Model\\ResourceModel\\Category\\CollectionFactory')\n ->create()\n ->addAttributeToSelect('*')\n ->addAttributeToFilter('entity_id', $categoryIds)\n ->addIsActiveFilter();\n\n // Prepare string\n $categories = array();\n foreach ($categoryCollection as $category) {\n array_push($categories, $category->getName());\n }\n\n return implode(\",\", $categories);\n }",
"public function list()\n {\n $productCategories = ProductCategory::paginate(15);\n if(empty($productCategories) || count($productCategories) == 0) {\n session()->flash('message', 'No product categories records available to show!');\n }\n \n return view('product-category.list',[\n 'productCategories' => $productCategories\n ]);\n }",
"public function get_productcategory_details($id)\n\t{\n\t\techo(json_encode($this->product_category->get_product_category($id)));\n\t}",
"function custom_get_product_category_by_slug_shortcode_function($atts){\n\n extract( shortcode_atts(\n array(\n 'cat_id' => '',\n 'cate_slug' => '',\n 'title' => '',\n 'title2' => '',\n 'view_more' => ''\n ), $atts )\n );\n \n \n $category = get_queried_object();\n \n $term_id = $category->term_id;\n \n $name = $category->name;\n \n if($term_id == \"\"){\n $term_id = $cat_id;\n $name = $title;\n \n }\n \n \n $args = array(\n 'hierarchical' => 1,\n 'show_option_none' => '',\n 'hide_empty' => 0,\n 'parent' => $term_id,\n 'taxonomy' => 'product_cat',\n //'orderby' => 'name',\n //'order' => 'DESC'\n );\n $subcats = get_categories($args);\n \n \n /* $thisCat = get_category(get_query_var('cat'));\n \n echo '<pre>';\n print_r($thisCat);\n echo '</pre>';*/\n \n ob_start();\n?>\n<div class=\"category-list\">\n <div class=\"category-heading\"><h5><?php echo $name;?></h5></div>\n <ul>\n <?php if(sizeof($subcats)==0){ ?>\n \n <?php\n $term_data = get_term($term_id);\n $get_parent_cat = get_term($term_data->parent);\n ?>\n \n <!-- <li><a href=\"<?php //echo get_term_link( $get_parent_cat->term_id , 'product_cat' );?>\"><?php //echo $get_parent_cat->name?><i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i></a></li>-->\n \n \n <?php }else{ ?>\n \n <?php foreach ($subcats as $sc) { $link = get_term_link( $sc->slug, $sc->taxonomy ); ?>\n \n <?php \n \n $hide_category_from_sidebar = get_term_meta($sc->term_id, 'hide_category_from_sidebar', true);\n \n if ( !in_array( 'Hide', $hide_category_from_sidebar, true ) ) {\n \n ?>\n <li><a href=\"<?php echo $link;?>\"><?php echo $sc->name?><i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i></a></li>\n <?php\n \n }\n ?>\n \n <?php } ?>\n \n <?php } ?>\n \n \n \n \n \n \n \n \n <?php if(!empty($view_more) && $view_more == 'true'){ ?>\n <li><a href=\"<?php echo wc_get_page_permalink( 'shop' );?>\">More <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i></a></li>\n <?php }?>\n \n </ul>\n </div><!--category-list-->\n</div> \n \n<?php\nreturn ob_get_clean();\n}",
"public function index()\n {\n $productParentCategories = ProductCategory::where('parent_id', '=', '0')->orderBy('name')->get();\n foreach ($productParentCategories as $productParentCategories){\n $productParentCategoriesData[$productParentCategories->id]['id'] = $productParentCategories->id;\n $productParentCategoriesData[$productParentCategories->id]['name'] = $productParentCategories->name;\n }\n $productCategories = ProductCategory::with(['user','productList'])->orderBy('name')->get();\n return view('admin.shop.productCategoriesList')\n ->with('productParentCategoriesData', $productParentCategoriesData)\n ->with('productCategories', $productCategories);\n }",
"private function getCategory() {\n return '';\n }",
"public function catDisplay(){\n $query = \"SELECT * FROM shop_category\";\n $result = $this->db->select($query);\n\n return $result;\n }",
"function saveCategories($product_id)\n {\n //var_dump(Category::$cats); exit;\n if(is_null($this->categories) || sizeof($this->categories) < 1){\n return;\n }\n \n foreach ($this->categories as $ids) {\n if(empty($ids)){\n continue;\n }\n \tif(isset(Category::$cats[$ids]) && is_object(Category::$cats[$ids])){\n\t $names[] = array('name'=>Category::$cats[$ids]->name);\n\t $cids[] = array('name'=>Category::$cats[$ids]->cid);\n\t $i = 0;\n\t $parent_id = $ids;\n\t \n\t while(($parent_id = Category::$cats[$parent_id]->parent_id) != 0){\n\t \n\t $names[] = array('name'=>Category::$cats[$parent_id]->name);\n\t $cids[] = array('name'=>Category::$cats[$parent_id]->cid);\n\t $i++;\n\t if($i > 7 ){ $i = 0; break; }\n\t }\n\t \t\n\t // \t\n\t \t$this->saveWords(Category::$cats[$ids]->name, $product_id, 2);\n\t \t $this->saveWords(Category::$cats[$ids]->description, $product_id, 1);\n\t\t//\t\t}\n\t\t\t}\n } \n\t\tif(isset($names)){\n \t$this->options['category'] = array('name'=>'category','value'=>$names);\n \t$this->options['category_id'] = array('name'=>'category_id','value'=>$cids);\n\t\t}\n }",
"function category($title, $id, $page)\n {\n $sort = Input::get('sort');\n\n $aliexpressApi = new AliexpressAPI();\n\n $options = [\n \"sort\" => $sort,\n \"pageNo\" => $page\n ];\n if (Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort) == null) {\n Cache::put('aliCategory' . $id . '-' . $page . '-' . $sort, json_decode($aliexpressApi->getCategoryProducts($id,\n 39, \"USD\", App::getLocale(), $options)), Config::get('cache.storeAliHotProducts'));\n }\n $aliData = Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort);\n\n $similarCategories = $this->model->getSimilarCategory($id);\n $breadCramb = $this->model->getBreadCramb($id);\n $resultsAmount = isset($aliData->result->totalResults) ? $aliData->result->totalResults : 100;\n\n // pagination ( not the perfect of implementations, but it works )\n $totalPages = 100;\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n\n $categoryData = $this->makeCategoryData($page, $id, $title, $sort, $resultsAmount);\n\n // product forms action route base\n $productBaseRoute = \"/{$this->siteslug}/product\";\n $categoryBaseRoute = \"/{$this->siteslug}/category/$title/$id\";\n\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $title, $page, $this->siteslug, null, $id);\n\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n /*if (is_null($categoryData['sort'])){\n $sortForTitle='';\n }else{\n $sortForTitle='-' . $categoryData['sort'];\n }*/\n // dd($categoryData);\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.aliexpress');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'aliexpress';\n };\n $this->title =$categoryData['title']. ' - ' . $breadCramb['category']. ' - ' . $this->shopName . ' - ' . $categoryData['page'] . ' - ' .'עליאקספרס' ;\n// $this->title = $categoryData['title'];\n $this->description = $categoryData['title'] . $pageForTitle . '- ' . \"עליאקספרס בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n return view(\"aliexpress.category\", [\n 'timerTime' => $this->timerTime,\n 'nextPageLink' => $pageNext,\n 'pageLinks' => $pages,\n 'pagination' => $pagesAvailable,\n 'categoryData' => $categoryData,\n 'productBase' => $productBaseRoute,\n 'categoryBase' => $categoryBaseRoute,\n 'aliData' => $this->model->parseCategoryData($aliData),\n 'categories' => $this->categories,\n 'siteslug' => $this->siteslug,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }",
"public function getCategories();",
"public function getCategories();",
"public function category()\n\t{\n\t\t$crud = $this->generate_crud('blog_categories');\n\t\t$crud->columns('title');\n\t\t$this->mPageTitle = 'Blog Categories';\n\t\t$this->mViewData['crud_note'] = modules::run('adminlte/widget/btn', 'Sort Order', 'blog/category_sortable');\n\t\t$this->render_crud();\n\t}",
"function showCategory()\n\t {\n\t\t\n\t\t $res=mysql_query(\"select * from category\");\n\t\t while($data=mysql_fetch_array($res))\n\t\t {\n\t\t\t\n\t\t\techo '<option value=\"'.$data['cat_id'].'\">'.$data['cat_title'].'</option>';\n\t\t }\n\t\t \n\t }",
"public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }",
"public function showCategory(){\n \t$form = M(\"categoryinfo\");\n \t$data = $form->select();\n \t$data = json_encode($data);\n \techo $data;\n \t//$this->display();\n }",
"public function index()\n {\n\t\t\n\t\t$data['menucategories'] = $this->category->withSubcategories();\n\t\t$data['pageheader'] = 'Category & Subcategory Setup';\n\t\t$data['title'] = 'Cat - Setup';\n\t\treturn view('settings.catalog.products.list.index', $data);\n }",
"public function index()\n {\n $product_collection = Categorycollection::all();\n return view(\"admin/product_category/list_collection\", compact('product_collection'));\n }",
"public function categories_all() {\n\t\t// Simple! Get the categories\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories();\n\t\t\n\t\t// ...and display the view. We won't\n\t\t// be needing Pagination or anything like that\n\t\t$this->_view('categories');\n\t}",
"public function showTVShowCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\n <h1>TV Shows</h1>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,true,false);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }",
"public function show(ProductCategory $productCategory)\n {\n //\n }",
"public function show(ProductCategory $productCategory)\n {\n //\n }",
"public function show_membership_categories()\n {\n $this->show_objects('Booking_membership_category');\n }",
"public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}",
"public function index()\n {\n $list_cat=Product_category::paginate(2);\n return view('admin.products.list_category',['list_cat'=>$list_cat]);\n }",
"public function executeListCategories()\n {\n $this->adminLayout();\n\n $this->page->addVar('title', 'Liste des catégories');\n\n $listCategories = $this->manager->getManagerOf('Category')->getAllCategories();\n\n $this->page->addVar('categories', $listCategories);\n }",
"public function categories($idProduct)\n {\n $product = $this->product->find($idProduct);\n\n if(!$product) {\n return redirect()->back();\n }\n\n $categories = $product->categories()->paginate();\n\n return view('admin.pages.products.categories.categories', ['product' => $product,'categories' => $categories]);\n\n }",
"public function index()\n {\n $category = category::get();\n $product = product::get();\n return view('pages.categories',[\n 'categories' => $category,\n 'products' => $product,\n ]);\n }",
"public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }",
"function displayCategoryLinks() {\n\n\t$catquery = \"select distinct ngroup from nassets where type like '0tdn%'\";\n\t$cresults = mysql_query($catquery);\n\t$has_null = false;\n\t$categories = array();\n\twhile ($acRow = mysql_fetch_array($cresults)) {\n\t\t$thisgroup = $acRow['ngroup'];\n\t\t$categories[] = $thisgroup;\n\t}\n\t\n\n\techo \"<ul>View by Category<br>\";\n\t$size = count($categories);\n \tforeach ($categories as $category) {\n \t\techo \"<li><a href=\\\"menu2.php?category=$category\\\" target=\\\"menu2\\\">$category</a><br/></li>\";\n \t}\n\n\techo \"</ul>\";\n}",
"private function printTabs($terms)\n {\n echo '<ul class=\"as-lecturers-ul\">';\n\n echo '<li class=\"as-lecturers-li\"><span class=\"bold\">카테고리</span></li>';\n\n echo '<li class=\"as-lecturers-li\"><a href=\"' . get_permalink() . '\">전체</a></li>';\n foreach ($terms as $term) {\n if ($term->slug == 'package') {\n continue;\n }\n echo '<li class=\"as-lecturers-li\">';\n echo '<a href=\" ' . get_permalink() . '?' . $this->PARAM_CATEGORY . '=' . $term->slug . '\">' . $term->name . '</a>';\n echo '</li>';\n }\n\n echo '</ul>';\n }",
"function print_categories(&$categories, $parent_id = NULL, &$row = 0, $indent = 0, $hide = 'false', &$set_parents = '') {\n\tif (!isset($categories) || !isset($categories[$parent_id])) {\n\t\treturn;\n\t}\n\n\tforeach($categories[$parent_id] as $category) {\n\t\t$class='';\n\t\tif ($hide === 'false') {\n\t\t\tif ($row % 2 == 0) {\n\t\t\t\t$class='even';\n\t\t\t} else {\n\t\t\t\t$class='odd';\n\t\t\t}\n\t\t\t$row++;\n\t\t}\n\n\t\t// Fix for NULL parent\n\t\t$parent_print = $parent_id;\n\t\tif ($parent_id === NULL) {\n\t\t\t$parent_print = '\\'null\\'';\n\t\t}\n\n\t\techo \"document.write(getCategoryHtml(\" . $category['id'] . \", '\" . $category['name'] . \"', \" . $parent_print . \", '\" . $class . \"', \" . $indent . \", \" . $hide . \"));\\n\";\n\n\t\t$set_parents .= 'setParent(' . $category['id'] . ', ' . $parent_print . \");\\n\";\n\n\t\t// Print subcategories, always hide children on default\n\t\tprint_categories($categories, $category['id'], $row, $indent+1, 'true', $set_parents);\n\t}\n\n\tif ($parent_id === NULL) {\n\t\techo \"$(document).ready( function() {\\n\";\n\t\techo $set_parents;\n\t\techo \"});\\n\";\n\t}\n}",
"public function testGetProductsListByCategory()\n\t{\n\t\t/**\n\t\t * @var shopModel $shopModel\n\t\t */\n\t\t$shopModel = getModel('shop');\n\n\t\t$product_repository = $shopModel->getProductRepository();\n\n\t\t$args = new stdClass();\n\t\t$args->module_srl = 104;\n\t\t$args->category_srls = array(self::CATEGORY_TSHIRTS);\n\t\t$output = $product_repository->getProductList($args);\n\n\t\t$products = $output->products;\n\t\t$this->assertEquals(1, count($products));\n\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$this->assertNull($product->parent_product_srl);\n\n\t\t\t$this->assertTrue($product->isConfigurable());\n\t\t\t$this->assertTrue(is_a($product, 'ConfigurableProduct'));\n\n\t\t\t$this->assertEquals(6, count($product->associated_products));\n\n\t\t\tforeach($product->associated_products as $associated_product)\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($associated_product, 'SimpleProduct'));\n\t\t\t}\n\t\t}\n\n\t}",
"public function index()\n { \n \n $data['products_list'] = \\App\\Models\\Product::with('category_info')->get(); \n \n \n $common_model = new Common(); \n $data['categories_list'] = $common_model->allCategories(); \n \n return view('admin.product.index', ['data'=>$data]);\n // \n }"
]
| [
"0.7568461",
"0.6813237",
"0.6677674",
"0.659654",
"0.6554468",
"0.655082",
"0.64663994",
"0.6417595",
"0.6411708",
"0.63661385",
"0.6364571",
"0.6349633",
"0.63440007",
"0.63376456",
"0.63358146",
"0.6308299",
"0.63054603",
"0.62872696",
"0.62581486",
"0.62225616",
"0.62172914",
"0.619774",
"0.6191028",
"0.6186079",
"0.6169227",
"0.61679024",
"0.61651087",
"0.6163315",
"0.6160023",
"0.61380607",
"0.6131085",
"0.6126158",
"0.6109515",
"0.6090504",
"0.6069879",
"0.604835",
"0.60482794",
"0.60409826",
"0.6029999",
"0.60169446",
"0.6015326",
"0.6013478",
"0.6009683",
"0.5991239",
"0.59804815",
"0.59719896",
"0.59491277",
"0.59483105",
"0.5924522",
"0.5921333",
"0.59211904",
"0.5920087",
"0.5908248",
"0.58944464",
"0.5888481",
"0.5878169",
"0.58738",
"0.5853994",
"0.58445436",
"0.5839552",
"0.582645",
"0.582356",
"0.58224106",
"0.5821244",
"0.58200353",
"0.58200115",
"0.5819276",
"0.5817837",
"0.5817709",
"0.5816522",
"0.58027524",
"0.57968634",
"0.5794531",
"0.5781209",
"0.57728803",
"0.57727635",
"0.57591873",
"0.57591873",
"0.57547385",
"0.5731933",
"0.57314414",
"0.57311964",
"0.572768",
"0.57276666",
"0.572558",
"0.57250106",
"0.57227874",
"0.57227874",
"0.5722542",
"0.5715653",
"0.57156193",
"0.5709869",
"0.57075596",
"0.5700152",
"0.5696391",
"0.56906354",
"0.5688734",
"0.56876594",
"0.5677508",
"0.56712246"
]
| 0.626602 | 18 |
Readonly access to property objects. | public function __get($key)
{
return $this->$key;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _getReadonlyProperties()\n {\n return array();\n }",
"abstract protected function properties();",
"public function allowProperties() {}",
"abstract protected function getDirectGetters();",
"public function __get($prop) {}",
"public function __get($property) {}",
"public function isReadOnly() {}",
"public function isReadOnly() {}",
"public function isReadOnly() {}",
"public function getExposedProperties(): array;",
"protected function isObjectAccessorMode() {}",
"public function isReadonly(): bool;",
"abstract protected function propertyGet($name);",
"abstract protected function get_properties();",
"public function isReadOnly();",
"public function isReadOnly();",
"public function isReadOnly();",
"abstract protected function getProperties();",
"public function isReadonly()\n {\n return false;\n }",
"public function isReadonly() : bool {\n return (bool) ($this->flags & Class_::MODIFIER_READONLY);\n }",
"public function allowAllProperties() {}",
"function getReadOnly() { return $this->_readonly; }",
"function properties()\n {\n }",
"public function properties() { }",
"public function __set($property, $value) {}",
"public function property($key) { }",
"abstract protected function setRequiredGetters();",
"abstract protected function propertySet($name, $value);",
"protected function getPublicProperties() {\n\t\t$getPublicProperties = function($obj) { return get_object_vars($obj); };\n\t\treturn $getPublicProperties($this);\n\t}",
"public function isReadOnly()\n {\n }",
"abstract public function getProperties();",
"public function isReadOnly(): bool;",
"public function getReadOnlyFlag() {}",
"protected function property_map() { return array(); }",
"public function setReadOnly()\n {\n $this->_allowModifications = false;\n foreach ($this->_data as $key => $value) {\n if ($value instanceof Zend_Config) {\n $value->setReadOnly();\n }\n }\n }",
"public function getReadOnlyFields();",
"function createProperty();",
"public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }",
"public function setReadOnly($ro){\n\t\tparent::setReadOnly($ro);\n\t\t$this->_year->setReadOnly($ro);\n\t\t$this->_month->setReadOnly($ro);\n\t\t$this->_day->setReadOnly($ro);\n\t}",
"function _getProperties() ;",
"public function isReadonly()\n {\n return $this->_isReadonly;\n }",
"private function getWriteAccessInfo($class, $property, $value)\n {\n $key = $class.'::'.$property;\n\n if (isset($this->writePropertyCache[$key])) {\n $access = $this->writePropertyCache[$key];\n } else {\n $access = array();\n\n $reflClass = new \\ReflectionClass($class);\n $access[self::ACCESS_HAS_PROPERTY] = $reflClass->hasProperty($property);\n $camelized = $this->camelize($property);\n $singulars = (array) StringUtil::singularify($camelized);\n\n if (is_array($value) || $value instanceof \\Traversable) {\n $methods = $this->findAdderAndRemover($reflClass, $singulars);\n\n if (null !== $methods) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_ADDER_AND_REMOVER;\n $access[self::ACCESS_ADDER] = $methods[0];\n $access[self::ACCESS_REMOVER] = $methods[1];\n }\n }\n\n if (!isset($access[self::ACCESS_TYPE])) {\n $setter = 'set'.$camelized;\n $getsetter = lcfirst($camelized); // jQuery style, e.g. read: last(), write: last($item)\n\n if ($this->isMethodAccessible($reflClass, $setter, 1)) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;\n $access[self::ACCESS_NAME] = $setter;\n } elseif ($this->isMethodAccessible($reflClass, $getsetter, 1)) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;\n $access[self::ACCESS_NAME] = $getsetter;\n } elseif ($this->isMethodAccessible($reflClass, '__set', 2)) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;\n $access[self::ACCESS_NAME] = $property;\n } elseif ($access[self::ACCESS_HAS_PROPERTY] && $reflClass->getProperty($property)->isPublic()) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;\n $access[self::ACCESS_NAME] = $property;\n } elseif ($this->magicCall && $this->isMethodAccessible($reflClass, '__call', 2)) {\n // we call the getter and hope the __call do the job\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_MAGIC;\n $access[self::ACCESS_NAME] = $setter;\n } else {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_NOT_FOUND;\n $access[self::ACCESS_NAME] = sprintf(\n 'Neither the property \"%s\" nor one of the methods %s\"%s()\", \"%s()\", '.\n '\"__set()\" or \"__call()\" exist and have public access in class \"%s\".',\n $property,\n implode('', array_map(function ($singular) {\n return '\"add'.$singular.'()\"/\"remove'.$singular.'()\", ';\n }, $singulars)),\n $setter,\n $getsetter,\n $reflClass->name\n );\n }\n }\n\n $this->writePropertyCache[$key] = $access;\n }\n\n return $access;\n }",
"abstract public function property($propertyIdent);",
"function set_property(){\n }",
"public function setReadOnly($readOnly = true) {}",
"public function setReadOnly($readOnly = true) {}",
"protected function getPropertyValue() {}",
"public function isReadOnly() {\n\t\treturn false;\n\t}",
"function getProperties($public = true) {\n\t\t$vars = get_object_vars ( $this );\n\n\t\tif ($public) {\n\t\t\tforeach ( $vars as $key => $value ) {\n\t\t\t\tif ('_' == substr ( $key, 0, 1 )) {\n\t\t\t\t\tunset ( $vars [$key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $vars;\n\t}",
"public function getProperties() {\n $modifiable_properties = [];\n $fields = $this->getFields();\n foreach (Framework::instance()->entityProperties($this->getEntity()) as $property => $info) {\n if (!in_array($property, array_keys($fields)) && $this->filter($property)) {\n $this->addModifier($modifiable_properties, 'property', $property);\n }\n }\n return $modifiable_properties;\n }",
"public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}",
"public function propertyObject($propertyIdent);",
"abstract public function getJsProperties();",
"public function populatableProperties() : array;",
"function isReadonly()\n {\n return $this->readonly;\n }",
"public function makeReadonly()\n {\n $this->transform(new ReadonlyTransformation());\n return $this;\n }",
"public function set($value): IProperty;",
"public function define_readonly($p_readonly)\r\n\t\t{\r\n\t\t\t$this->c_readonly = $p_readonly;\r\n\t\t}",
"public function __set($name, $value)\n {\n throw new \\BadMethodCallException( 'Writing data to inaccessible properties is not allowed.' );\n }",
"public function __set($name, $value)\n {\n throw new \\BadMethodCallException( 'Writing data to inaccessible properties is not allowed.' );\n }",
"public function setReadOnly($readOnly = true);",
"public function setReadOnly($readOnly = true);",
"public function _getProperties() {}",
"public function testUserCantViewAProperty()\n {\n // Create a user with team and one public property\n $userOne = User::factory()->withPersonalTeam()->create();\n $userOne->assignRole(Role::findByName('user'));\n $userOne->assignRole(Role::findByName('team-admin'));\n $team = $userOne->personalTeam();\n $publicProperty = Property::factory()->create([\n 'team_id' => $team->getKey(),\n 'is_private' => false\n ]);\n\n // Create another user to access the public property\n $userTwo = User::factory()->withPersonalTeam()->create();\n $userTwo->assignRole(Role::findByName('user'));\n\n $response = $this->actingAs($userTwo)->get('/properties/' . $publicProperty->getKey());\n $response->assertStatus(403);\n }",
"public function get_readonly() {\n return $this->readonly;\n }",
"public function __get($name)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Reading data from inaccessible properties is not allowed.');\n }",
"public function __get($name)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Reading data from inaccessible properties is not allowed.');\n }",
"public function __get($name)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Reading data from inaccessible properties is not allowed.');\n }",
"abstract public function field_props();",
"public function property(&$class, $property);",
"public function __get($key)\n {\n $protected_property = \"_\".$key;\n if(property_exists($this,$protected_property))\n {\n if(isset($this->$protected_property)) return $this->$protected_property;\n else\n {\n throw new ExceptionMember($key,\n \"Экземпляр \".__CLASS__.\"::$key не существует!\");\n }\n }\n else\n {\n throw new Exception(\"Свойство \".__CLASS__.\"::$protected_property не найдено!\");\n }\n }",
"public function isReadonly(): bool\n {\n return $this->readonly;\n }",
"public function setReadOnlyFlag($readOnly = true) {}",
"public function getReadonly() {\n\t\treturn $this->readonly;\n\t}",
"public function set_readonly() {\n $this->readonly = true;\n\n return $this;\n }",
"public function setReadOnly($flag);",
"abstract public function getObjectDefinitionProperty();",
"public function allowAllPropertiesExcept() {}",
"private function accessor_wakeup(): void\n {\n $properties = get_object_vars($this);\n\n foreach ($properties as $property => $value) {\n if (\n $this->has_method(static::accessor_format(\n $property,\n HasAccessor::ACCESSOR_TYPE_GETTER,\n HasAccessor::ACCESSOR_IS_LAZY\n ))\n ) {\n unset($this->$property);\n }\n }\n }",
"function __get($property)\n {\n return $this->value;\n }",
"function get_properties()\r\n {\r\n return $this->properties;\r\n }",
"public function __set($key, $value)\n {\n throw new \\Exception(\"The {$key} property is read-only, and can't set any value.\");\n }",
"public function getProperties($public = true)\n {\n $vars = get_object_vars($this);\n\n if ($public) {\n foreach ($vars as $key => $value) {\n if ('_' == substr($key, 0, 1)) {\n unset($vars[$key]);\n }\n }\n }\n\n return $vars;\n }",
"public function getAccessibleProperty(string $class, string $property);",
"public function getProperties() {}",
"public function getProperties() {}",
"public function getProperties() {}",
"public function getProperties() {}",
"public function isReadOnlyReal(): bool\n {\n return ($this->getFlags() & ast\\flags\\MODIFIER_READONLY) !== 0;\n }",
"public function canHaveACopyOfProperties()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $properties = array('content', 'objIds', 'names', 'classes');\n foreach ($properties as $property) {\n $this->object->iterateOn($property);\n $expect = $this->object->getArrayCopy();\n $this->assertAttributeEquals($expect, $property, $this->object);\n }\n }",
"function performReadonlyTransformation() {\n\t\t$stars = '*****';\n\n\t\t$field = new ReadonlyField($this->name, $this->title ? $this->title : '', $stars);\n\t\t$field->setForm($this->form);\n\t\t$field->setReadonly(true);\n\t\treturn $field;\n\t}",
"public function __get($prop)\r\n {\r\n return $this->wrappedObj->$prop;\r\n }",
"public function __get($property)\n\t{\n\t\t$getter = '__volatile_get_' . $property;\n\n\t\tif (method_exists($this, $getter))\n\t\t{\n\t\t\treturn $this->$getter();\n\t\t}\n\n\t\t$getter = '__get_' . $property;\n\n\t\tif (method_exists($this, $getter))\n\t\t{\n\t\t\treturn $this->$property = $this->$getter();\n\t\t}\n\n\t\t#\n\t\t# The object does not define any getter for the property, let's see if a getter is defined\n\t\t# in the methods.\n\t\t#\n\n\t\t$getter = $this->find_method_callback('__volatile_get_' . $property);\n\n\t\tif ($getter)\n\t\t{\n\t\t\treturn call_user_func($getter, $this, $property);\n\t\t}\n\n\t\t$getter = $this->find_method_callback('__get_' . $property);\n\n\t\tif ($getter)\n\t\t{\n\t\t\treturn $this->$property = call_user_func($getter, $this, $property);\n\t\t}\n\n\t\t#\n\t\t#\n\t\t#\n\n\t\t$rc = $this->__defer_get($property, $success);\n\n\t\tif ($success)\n\t\t{\n\t\t\treturn $this->$property = $rc;\n\t\t}\n\n\t\t$reflexion_class = new \\ReflectionClass($this);\n\n\t\ttry\n\t\t{\n\t\t\t$reflexion_property = $reflexion_class->getProperty($property);\n\n\t\t\tthrow new Exception\\PropertyNotReadable(array($property, $this));\n\t\t}\n\t\tcatch (\\ReflectionException $e) { }\n\n\t\t$properties = array_keys(get_object_vars($this));\n\n\t\tif ($properties)\n\t\t{\n\t\t\tthrow new Exception\\PropertyNotFound\n\t\t\t(\n\t\t\t\t\\ICanBoogie\\format\n\t\t\t\t(\n\t\t\t\t\t'Unknow or unaccessible property %property for object of class %class (available properties: :list).', array\n\t\t\t\t\t(\n\t\t\t\t\t\t'property' => $property,\n\t\t\t\t\t\t'class' => get_class($this),\n\t\t\t\t\t\t'list' => implode(', ', $properties)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tthrow new Exception\\PropertyNotFound(array($property, $this));\n\t}",
"public function __get($name) {\n\t\treturn array_key_exists($name, $this->readonly) ? $this->readonly[$name] : @$this->$name;\n\t}",
"public function properties()\r\n {\r\n $props = $this->class->getProperties();\r\n \r\n sort( $props );\r\n \r\n foreach ( $props as $key => $property )\r\n {\r\n // Only show public properties, because Reflection can't get the private ones\n if ( $property->isPublic() )\r\n {\r\n $props[$key] = new Docs_Property( $this->class->name, $property->name );\r\n }\r\n else\r\n {\r\n unset( $props[$key] );\r\n }\r\n }\r\n \r\n return $props;\r\n }",
"public function performReadonlyTransformation()\n {\n return clone $this;\n }",
"public function __set( $name, $value ) {\n $this->_checkValid();\n $this->_magicError( debug_backtrace(), 'Attempt to set read-only property: ' . $name );\n return null;\n }",
"public function __set($name, $value)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Writing data to inaccessible properties is not allowed.');\n }",
"public function __set($name, $value)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Writing data to inaccessible properties is not allowed.');\n }",
"public function __set($name, $value)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Writing data to inaccessible properties is not allowed.');\n }",
"public function __get($name) {\n $allowed = ['instance', 'contextlevel', 'context', 'contextname'];\n if (in_array($name, $allowed)) {\n return $this->{'get_'.$name}();\n } else {\n throw new \\coding_exception($name.' is not a publicly accessible property of '.get_class($this));\n }\n }"
]
| [
"0.75453776",
"0.6830317",
"0.6822066",
"0.64157206",
"0.6389839",
"0.63006413",
"0.62462133",
"0.62462133",
"0.6245917",
"0.61735165",
"0.6169313",
"0.61224353",
"0.6117116",
"0.61140764",
"0.61105984",
"0.61105984",
"0.61105984",
"0.60988915",
"0.60848",
"0.6071",
"0.60480666",
"0.6010515",
"0.5997548",
"0.5993571",
"0.5971564",
"0.5960689",
"0.5958557",
"0.5939247",
"0.59137595",
"0.5895319",
"0.58398414",
"0.58296007",
"0.5829443",
"0.58176506",
"0.5817405",
"0.58126414",
"0.57996476",
"0.5798962",
"0.57877713",
"0.5787456",
"0.57642496",
"0.57569355",
"0.57444143",
"0.57340413",
"0.5733156",
"0.5732639",
"0.5727107",
"0.57125723",
"0.57040316",
"0.57001626",
"0.5674901",
"0.5670926",
"0.565931",
"0.5649584",
"0.563708",
"0.5634781",
"0.5632392",
"0.5622229",
"0.56222266",
"0.56222266",
"0.5619235",
"0.5618245",
"0.5617997",
"0.5609531",
"0.5597584",
"0.55920506",
"0.55920506",
"0.55920506",
"0.5589629",
"0.5589466",
"0.55791456",
"0.5578809",
"0.55780274",
"0.55661607",
"0.5564438",
"0.55641896",
"0.55614287",
"0.5559929",
"0.5551467",
"0.5540552",
"0.55347973",
"0.5533372",
"0.5525233",
"0.55222845",
"0.5514847",
"0.55146307",
"0.55146307",
"0.55146307",
"0.5496443",
"0.54945946",
"0.54858786",
"0.5475717",
"0.54732",
"0.5466161",
"0.54534614",
"0.5450301",
"0.54473305",
"0.54448944",
"0.54448944",
"0.54448944",
"0.54431784"
]
| 0.0 | -1 |
Handle an incoming request. | public function handle($request, Closure $next)
{
//before handling the API request
$ApiLog = new ApiLog();
$Payload = array_filter($request->input());
if (isset($Payload['password'])) {
//if the payload contains a password redact it
$Payload['password'] = '**redacted**';
}
$ApiLog->json_parameters = json_encode($Payload);
$ApiLog->requester_ip = $request->ip();
$ApiLog->method = $request->method();
$ApiLog->path = $request->path();
try {
//get the id of the user if they are authorized
$ApiLog->user_id = $request->user()['user_id'];
} catch (NoActiveAccessTokenException $e) {
// no logged in user
$ApiLog->user_id = null;
}
try {
$ApiLog->save();
} catch (QueryException $e) {
//There is a good chance the URL was to long for the path column, try truncating it as a last effort
$ApiLog->path = substr($ApiLog->path, 0, 254);
try {
$ApiLog->save();
} catch (QueryException $e) {
if (
// these are all exceptions that generally mean the api
// couldn't contact mysql. During dev this likely mans
// the api machine went to sleep. In production... we
// haven't seen it, but returning 503 (service unavailable)
// is a reasonable thing to do.
preg_match('/PDOException: SQLSTATE\[HY000\] \[2002\] Network is down/', $e) ||
preg_match('/PDOException: SQLSTATE\[HY000\] \[2002\] Host is down/', $e) ||
preg_match('/SQLSTATE\[HY000\] \[2002\] Network is unreachable/', $e) ||
preg_match('/PDOException: SQLSTATE\[HY000\] \[2002\] Operation timed out/', $e)
) {
\Log::info('Api logger middleware unable to contact database');
return response()->json('API unable to contact database.', 503);
}
//it still failed so handle it without crashing.
Log::info('ApiLogger middleware exception:');
Log::info($e);
return $next($request);
}
}
//handle the API request
$response = $next($request);
try {
//After handling the API request, update the response code
$ApiLog->response_code = $response->status();
$ApiLog->save();
} finally {
return $response;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function handle_request();",
"public function handleRequest();",
"public function handleRequest();",
"public function handleRequest();",
"protected abstract function handleRequest();",
"abstract public function handleRequest($request);",
"abstract public function handleRequest(Request $request);",
"public function handle($request);",
"public function handleRequest() {}",
"function handleRequest() ;",
"public function handle(Request $request);",
"protected function handle(Request $request) {}",
"public function handle(array $request);",
"public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }",
"public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }",
"abstract protected function process(Request $request);",
"public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }",
"abstract function handle(Request $request, $parameters);",
"protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }",
"public function handle(ServerRequestInterface $request);",
"public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }",
"function handle(Request $request = null, Response $response = null);",
"public function processRequest();",
"public abstract function processRequest();",
"public function handleRequest(Request $request, Response $response);",
"abstract public function processRequest();",
"public function handle(array $request = []);",
"public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }",
"public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }",
"protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }",
"public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }",
"public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }",
"public function process(Request $request, Response $response, RequestHandlerInterface $handler);",
"public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }",
"public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function handle(Request $request): Response;",
"public static function process_http_request()\n {\n }",
"public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }",
"abstract public function handle(ServerRequestInterface $request): ResponseInterface;",
"public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}",
"function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}",
"public function handle($request, $next);",
"public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }",
"public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }",
"public function process($path, Request $request);",
"public function handle(string $query, ServerRequestInterface $request);",
"public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}",
"private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}",
"public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}",
"public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }",
"public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }",
"public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }",
"final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }",
"public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}",
"function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }",
"public function handle(RequestInterface $request): ResponseInterface;",
"public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }",
"public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );",
"protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}",
"public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}",
"public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}",
"public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }",
"public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }",
"public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }",
"public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);",
"public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}",
"public function serve_request()\n {\n }",
"public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}",
"function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }",
"public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}",
"private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }",
"function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }",
"public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}",
"public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }",
"public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}",
"public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }",
"final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }",
"public function RouteRequest ();",
"public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;",
"public function DispatchRequest ();",
"protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}",
"public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}",
"abstract public function request();",
"public function run() {\r\n $this->routeRequest(new Request());\r\n }",
"public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }",
"public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }",
"public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);",
"public function handle(Request $request, Closure $next);",
"public function handleGetRequest($id);",
"abstract function doExecute($request);",
"public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }",
"abstract public function mapRequest($request);",
"public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }",
"abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);",
"private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }",
"public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}",
"protected function handle(Request $request)\n {\n return 1;\n }",
"public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }",
"public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }",
"public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }"
]
| [
"0.8299201",
"0.8147294",
"0.8147294",
"0.8147294",
"0.8127764",
"0.7993589",
"0.7927201",
"0.7912899",
"0.7899075",
"0.76317674",
"0.75089735",
"0.7485808",
"0.74074036",
"0.7377414",
"0.736802",
"0.7294553",
"0.72389543",
"0.7230166",
"0.72108",
"0.71808434",
"0.7170364",
"0.71463037",
"0.7126907",
"0.7122795",
"0.71225274",
"0.7116879",
"0.70607233",
"0.6981947",
"0.6966695",
"0.69393975",
"0.6912079",
"0.68985975",
"0.6887614",
"0.68774897",
"0.6806274",
"0.67969805",
"0.67778915",
"0.6762979",
"0.67565143",
"0.67533374",
"0.67192745",
"0.6683243",
"0.66487724",
"0.66395754",
"0.6634629",
"0.66283566",
"0.6617558",
"0.6610097",
"0.6610011",
"0.6544976",
"0.653806",
"0.6512757",
"0.64682734",
"0.64381886",
"0.6416964",
"0.63373476",
"0.63359964",
"0.6334543",
"0.63308066",
"0.6321675",
"0.63176167",
"0.631661",
"0.6310991",
"0.63108873",
"0.6295945",
"0.6279438",
"0.62778515",
"0.62508965",
"0.62422955",
"0.62321424",
"0.62237644",
"0.6203428",
"0.61954546",
"0.6191255",
"0.61774665",
"0.61682004",
"0.6151806",
"0.61271876",
"0.61257905",
"0.6116093",
"0.61126447",
"0.6112368",
"0.6101652",
"0.60893977",
"0.60871464",
"0.60862815",
"0.60734737",
"0.60535145",
"0.6028341",
"0.60250086",
"0.60224646",
"0.6011745",
"0.6011483",
"0.60106593",
"0.5998867",
"0.5997086",
"0.5991233",
"0.59844923",
"0.59668386",
"0.5961315",
"0.5954762"
]
| 0.0 | -1 |
Loads the TypoScript config/setup for the formhandler on the current page. | private function loadTypoScriptConfig()
{
$sysPageObj = GeneralUtility::makeInstance('t3lib_pageSelect');
if (!$GLOBALS['TSFE']->sys_page) {
$GLOBALS['TSFE']->sys_page = $sysPageObj;
}
$rootLine = $sysPageObj->getRootLine($GLOBALS['TSFE']->id);
$TSObj = GeneralUtility::makeInstance('t3lib_tsparser_ext');
$TSObj->tt_track = 0;
$TSObj->init();
$TSObj->runThroughTemplates($rootLine);
$TSObj->generateConfig();
$conf = $TSObj->setup['plugin.']['Tx_Formhandler.']['settings.'];
$this->tsConf = $conf;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function configure()\n\t{\n\t\tif (!$this->form)\n\t\t{\n\t\t\t$this->form = new WebForm\\Form($this->getId());\n\t\t}\n\n\t\t$data = $this->form->get();\n\t\t$isCloud = Loader::includeModule('bitrix24');\n\n\t\t$this->fileDir = 'form';\n\t\t$this->fileName = str_replace(\n\t\t\t['#id#', '#sec#'],\n\t\t\t[$this->getId(), $data['SECURITY_CODE']],\n\t\t\t$isCloud ? 'loader_#id#.js' : 'loader_#id#_#sec#.js'\n\t\t);\n\n\t\t$name = 'crm.site.form.embed.unit';\n\t\t$this->addExtension($name);\n\t\t$module = $this->getModule($name);\n\t\t$module->getProfile()->setCallParameter($this->getCallParameter());\n\n\t\t$this->embeddedModuleName = 'crm.site.form.unit.loader';\n\t}",
"public function hookConfigForm()\n {\n require 'config_form.php';\n }",
"public function hookConfigForm() {\n\t\trequire IIIF_API_BRIDGE_DIRECTORY . '/config_form.php';\n\t}",
"function init()\t{\n\t\tglobal $BACK_PATH;\n\t\t$this->strExtKey = 'tx_pbsurvey';\n\t\t$this->arrWizardParameters = GeneralUtility::_GP('P');\n\t\t$this->arrTableParameters = GeneralUtility::_GP($this->strExtKey);\n\t\t$this->objDoc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');\n\t\t$this->objDoc->backPath = $BACK_PATH;\n\t\t$this->objDoc->JScode=$this->objDoc->wrapScriptTags('\n\t\t\tfunction jumpToUrl(URL,formEl)\t{\t//\n\t\t\t\tdocument.location = URL;\n\t\t\t}\n\t\t');\n\t\tlist($strRequestUri) = explode('#', GeneralUtility::getIndpEnv('REQUEST_URI'));\n\t\t$this->objDoc->form ='<form action=\"'.htmlspecialchars($strRequestUri).'\" method=\"post\" name=\"wizardConditions\">';\n\t\tif ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n\t\t\t$this->include_once[] = PATH_t3lib.'class.t3lib_tcemain.php';\n\t\t}\n\t}",
"public function settingsPage() {\n require_once 'form.phtml';\n }",
"public function hookConfigForm() {\n }",
"function framework_init(){\n // Registering the form where the data have to be saved\n $args['forms'] = array( 'myform' );\n $args['text_domain'] = 'my_text_domain';\n \n require_once( 'loader.php' );\n tk_framework( $args );\n}",
"public function init_form_fields() {\n\t\t$this->form_fields = include( 'settings-xendit.php' );\n\t}",
"public function page_init()\r\n {\r\n register_setting(\r\n 'tapatalk_general_group', \r\n 'tapatalk_general',\r\n array($this, 'sanitize')\r\n );\r\n\r\n $this->add_default_value('tapatalk_general', array(\r\n 'mobile_welcome_screen' => false,\r\n 'mobile_smart_banner' => true,\r\n 'facebook_twitter_deep_link' => true,\r\n ));\r\n\r\n add_settings_section(\r\n 'tapatalk_general', // ID\r\n 'Tapatalk-General', // Title\r\n array($this, 'print_section_info'), // Callback\r\n 'tapatalk_general_admin' // Page\r\n );\r\n\r\n add_settings_field(\r\n 'mobile_welcome_screen', // ID\r\n 'Mobile Welcome Screen', // Title \r\n array($this->page_common, 'create_section_for_checkbox'), // Callback\r\n 'tapatalk_general_admin', // Page\r\n 'tapatalk_general', // Section\r\n array( //Callback function parameter\r\n \"id\" => \"mobile_welcome_screen\",\r\n \"group\" => \"tapatalk_general\",\r\n \"options\" => array(\r\n \"desc\" => 'Tapatalk will show a one-time welcome screen to mobile web users informing them to download and view your site in the free app.',\r\n ),\r\n )\r\n );\r\n\r\n add_settings_field(\r\n 'mobile_smart_banner',\r\n 'Mobile Smart Banner',\r\n array($this->page_common, 'create_section_for_checkbox'), \r\n 'tapatalk_general_admin',\r\n 'tapatalk_general',\r\n array(\r\n \"id\" => \"mobile_smart_banner\",\r\n \"group\" => \"tapatalk_general\",\r\n \"options\" => array(\r\n \"desc\" => 'Tapatalk will show a smart banner to mobile users, when your site is viewed by a mobile web browser.',\r\n ),\r\n )\r\n );\r\n\r\n add_settings_field(\r\n 'facebook_twitter_deep_link',\r\n 'Facebook and Twitter Deep Linking',\r\n array($this->page_common, 'create_section_for_checkbox'), \r\n 'tapatalk_general_admin',\r\n 'tapatalk_general',\r\n array(\r\n \"id\" => \"facebook_twitter_deep_link\",\r\n \"group\" => \"tapatalk_general\",\r\n \"options\" => array(\r\n \"desc\" => 'Allow your members to open the same blog in Tapatalk from your Facebook post / Twitter tweet.',\r\n ),\r\n )\r\n );\r\n\r\n add_settings_field(\r\n 'api_key',\r\n 'Tapatalk Key',\r\n array($this->page_common, 'create_section_for_text'),\r\n 'tapatalk_general_admin',\r\n 'tapatalk_general',\r\n array(\r\n \"desc\" => \"This field is mandatory. Please input the key provided in tapatalk site owner account.\",\r\n \"id\" => \"api_key\",\r\n \"group\" => \"tapatalk_general\",\r\n \"title\" => 'Tapatalk API Key',\r\n \"std\" => '',\r\n )\r\n );\r\n }",
"public function init_form_fields() {\n\t\t$this->form_fields = include( 'data/data-settings.php' );\n\t}",
"public function page_init()\n { \n register_setting(\n 'firebird_grupo',\n 'firebird_name',\n array( $this, 'sanitize' )\n );\n\n add_settings_section(\n 'setting_section_id',\n 'Configurações',\n array( $this, 'print_section_info' ),\n 'integracao-firebird-admin'\n ); \n\n add_settings_field(\n 'chave_token_api',\n 'Chave a ser utilizada no acesso a API de Importação',\n array( $this, 'chave_token_api_callback' ),\n 'integracao-firebird-admin',\n 'setting_section_id'\n );\n }",
"protected function loadForm(): void\n {\n $rbtHiddenValues = [\n ['label' => BL::lbl('Hidden'), 'value' => 1],\n ['label' => BL::lbl('Published'), 'value' => 0],\n ];\n $internalLinks = BackendSpotlightsModel::getInternalLinks();\n\n // create form\n $this->form = new BackendForm('add');\n\n $this->form->addText('title', null, null, 'form-control title', 'form-control danger title');\n $this->form->addEditor('text');\n $this->form->addText('link', null, null);\n $this->form->addDropdown('categories', $this->categories);\n $this->form->addImage('image');\n $this->form->addRadiobutton('hidden', $rbtHiddenValues, 0);\n $this->form->addText('link_title');\n $this->form->addCheckbox('external_link');\n $this->form->addText('external_url');\n $this->form->addDropdown('internal_url', $internalLinks, '',\n false,\n 'chzn-select'\n )->setDefaultElement('');\n\n // meta\n $this->meta = new BackendMeta($this->form, null, 'title', true);\n\n }",
"public function startup() {\n\t\tA('AdminInterface')->bind('GatherAdminPages', array(\n\t\t\t'Core Settings' => array(\n\t\t\t\t'config' => $this->config,\n\t\t\t\t'fields' => array(\n\t\t\t\t\tSETTING_DEFAULT_BASE_PATH => array( \n\t\t\t\t\t\t'title' => 'Base Path',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_DEFAULT_BASE_PATH)),\n\t\t\t\t\tSETTING_SITE_URL => array(\n\t\t\t\t\t\t'title' => 'Base URL',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_SITE_URL, '')),\t\n\t\t\t\t\tSETTING_ENVIRONMENT => array(\n\t\t\t\t\t\t'title' => 'Environment',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'values' => array(\"Development\" => ENV_DEVELOPMENT, \"Test\" => ENV_TEST, \"Production\" => ENV_PRODUCTION),\n\t\t\t\t\t\t'selected' => $this->config->getConfigValue(SETTING_ENVIRONMENT)),\n\t\t\t\t),\n\t\t\t)\n\t\t));\n\t}",
"function loadFlowConfig(): FormFlowConfig;",
"abstract function setupform();",
"function ux_t3lib_TCEforms()\t{\n\t\tglobal $CLIENT, $TYPO3_CONF_VARS;\n\n\t\t$this->clientInfo = t3lib_div::clientInfo();\n\n\t\tif ($GLOBALS['BE_USER'])\t{\n\t\t\t$this->RTEenabled = $GLOBALS['BE_USER']->isRTE();\n\t\t} else\t{\n\t\t\t$this->RTEenabled = $this->FE_RTE;\n\t\t}\n\t\tif (!$this->RTEenabled)\t{\n\t\t\t$this->RTEenabled_notReasons = implode(chr(10),$GLOBALS['BE_USER']->RTE_errors);\n\t\t\t$this->commentMessages[] = 'RTE NOT ENABLED IN SYSTEM due to:'.chr(10).$this->RTEenabled_notReasons;\n\t\t}\n\n\t\t\t// Default color+class scheme\n\t\t$this->defColorScheme = array(\n\t\t\t$GLOBALS['SOBE']->doc->bgColor,\t// Background for the field AND palette\n\t\t\tt3lib_div::modifyHTMLColorAll($GLOBALS['SOBE']->doc->bgColor,-20),\t// Background for the field header\n\t\t\tt3lib_div::modifyHTMLColorAll($GLOBALS['SOBE']->doc->bgColor,-10),\t// Background for the palette field header\n\t\t\t'black',\t// Field header font color\n\t\t\t'#666666'\t// Palette field header font color\n\t\t);\n\t\t$this->defColorScheme = array();\n\n\t\t\t// Override / Setting defaults from TBE_STYLES array\n\t\t$this->resetSchemes();\n\n\t\t\t// Setting the current colorScheme to default.\n\t\t$this->defColorScheme = $this->colorScheme;\n\t\t$this->defClassScheme = $this->classScheme;\n\n \t\t\t// Prepare user defined objects (if any) for hooks which extend this function:\n \t\t$this->hookObjectsMainFields = array();\n \t\tif (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass']))\t{\n \t\t\tforeach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'] as $classRef)\t{\n \t\t\t\t$this->hookObjectsMainFields[] = &t3lib_div::getUserObj($classRef);\n \t\t\t}\n \t\t}\n \t\t$this->hookObjectsSingleField = array();\n \t\tif (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass']))\t{\n \t\t\tforeach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'] as $classRef)\t{\n \t\t\t\t$this->hookObjectsSingleField[] = &t3lib_div::getUserObj($classRef);\n \t\t\t}\n \t\t}\n\t\t$this->inline = t3lib_div::makeInstance('t3lib_TCEforms_inline');\n\t}",
"public function configure()\n\t{\n\t\t$this->fileDir = 'form';\n\t\t$this->fileName = 'resourcebooking.js';\n\n\t\t$this->addExtension('crm.site.form.resourcebooking');\n\t\t//$this->addExtension('ui.vue.components.datepick');\n\t\t//$this->addExtension('calendar.resourcebooking');\n\n\t\t$this->embeddedModuleName = 'crm.form.resourcebooking';\n\t}",
"protected function initTypoScriptConfiguration() {\n\t\t$GLOBALS['TSFE']->getPageAndRootline();\n\t\t$GLOBALS['TSFE']->initTemplate();\n\t\t$GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site;\n\t\t$GLOBALS['TSFE']->getConfigArray();\n\t\treturn $this;\n\t}",
"public function load_settings_page() {\n\t\tglobal $pagenow, $socialflow;\n\n\t\t$allowed_page = array(\n\t\t\t'post.php',\n\t\t\t'post-new.php',\n\t\t\t'admin.php',\n\t\t\t'edit.php', // posts list.\n\t\t\t'options-general.php',\n\t\t\t'upload.php', // uploads list.\n\t\t);\n\n\t\tif ( in_array( $pagenow, $allowed_page, true ) ) {\n\n\t\t\t// Enqueue neccessary scripts.\n\t\t\twp_enqueue_script( 'timepicker', plugins_url( 'assets/js/jquery.timepicker.js', SF_FILE ), array( 'jquery', 'jquery-ui-slider', 'jquery-ui-datepicker' ), true );\n\t\t\twp_enqueue_script( 'jquery.maxlength', plugins_url( 'assets/js/jquery.maxlength.js', SF_FILE ), array( 'jquery' ), '1.0.5', true );\n\n\t\t\twp_enqueue_script( 'socialflow-categories', plugins_url( 'assets/js/sf-categories.js', SF_FILE ), array( 'jquery' ), '2.0', true );\n\t\t\twp_enqueue_script( 'twitter-text', plugins_url( 'assets/js/twitter-text.js', SF_FILE ), array( 'jquery' ), '1.0', true );\n\n\t\t\twp_localize_script(\n\t\t\t\t'socialflow-admin', 'socialFlowData', array(\n\t\t\t\t\t'homeUrl' => home_url(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( in_array( $pagenow, array( 'post.php', 'post-new.php', 'edit.php', 'upload.php' ), true ) ) {\n\t\t\t\twp_enqueue_script( 'socialflow-common', plugins_url( 'assets/js/angular/common.js', SF_FILE ), array( 'jquery' ), '1.0', true );\n\t\t\t\twp_enqueue_script( 'angular', plugins_url( 'assets/js/angular/lib/angular.js', SF_FILE ), array(), '1.0', true );\n\t\t\t\twp_enqueue_script( 'socialflow-angular', plugins_url( 'assets/js/angular/module.js', SF_FILE ), array( 'angular' ), '1.0', true );\n\t\t\t\twp_localize_script( 'socialflow-angular', 'sfPostFormTmpls', SocialFlow_Post_Form_Data::get_templates() );\n\t\t\t}\n\n\t\t\t// Enqeue styles.\n\t\t\twp_enqueue_style( 'socialflow-admin', plugins_url( 'assets/css/styles.min.css', SF_FILE ) );\n\t\t\twp_enqueue_style( 'jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/smoothness/jquery-ui.css', false, '1.8.1', false );\n\n\t\t\twp_enqueue_media();\n\n\t\t\t// Thickbox scripts for compose now post action.\n\t\t\twp_enqueue_script( 'thickbox' );\n\t\t\twp_enqueue_style( 'thickbox' );\n\n\t\t\tif ( $socialflow->is_localhost() ) {\n\t\t\t\twp_enqueue_script( 'live-reload', '//localhost:35729/livereload.js', false, '1', false );\n\t\t\t}\n\t\t}\n\t}",
"private function loadForm()\n {\n // init settings form\n $this->frm = new Form('settings');\n\n // add festival year\n $this->frm->addText('year', $this->get('fork.settings')->get($this->URL->getModule(), 'year'));\n\n // add fields for pagination\n $this->frm->addDropdown(\n 'overview_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'overview_num_items', 10)\n );\n $this->frm->addDropdown(\n 'recent_festival_list_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'recent_festival_list_num_items', 5)\n );\n\n // add functions fields\n $this->frm->addCheckbox('cover_image_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_enabled', false));\n $this->frm->addCheckbox('cover_image_required', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_required', false));\n $this->frm->addCheckbox('multi_images_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'multi_images_enabled', false));\n\n // add god user only fields\n if ($this->godUser) {\n $this->frm->addText('image_size_limit', (float) $this->get('fork.settings')->get($this->URL->getModule(), 'image_size_limit', 10));\n }\n }",
"public function loadConfig(){\n\t\t\n\t\t$opt[] = [\n\t\t\t'method' => 'setFormParams',\n\t\t\t'value'=>$this->paramsLoad(3, \\sevian\\s::getReq('command_idx'), \\sevian\\s::getReq('unit_idx'))\n\t\t\t\n\t\t];\n\t\t$this->info = $opt;//$form->getInfo();\n\t}",
"abstract protected function getTypoScriptSetup();",
"function load() {\n\tadd_action( 'hnf_bb_init', __NAMESPACE__ . '\\\\setup' );\n\tadd_filter( 'fl_builder_register_settings_form', __NAMESPACE__ . '\\\\settings', 10, 2 );\n}",
"public function page_init()\n { \n register_setting(\n 'program_manager_option_group', // Option group\n 'program_manager_option', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'program_manager_section_id', // ID\n 'Program generator options', // Title\n array( $this, 'print_section_info' ), // Callback\n 'program_manager_admin' // Page\n ); \n\n add_settings_field(\n 'pre_days', // ID\n 'PRE conference days (separated by ,)', // Title \n array( $this, 'pre_days_callback' ), // Callback\n 'program_manager_admin', // Page\n 'program_manager_section_id' // Section \n ); \n\n add_settings_field(\n 'main_days', \n 'MAIN conference days (separated by ,)', \n array( $this, 'main_days_callback' ), \n 'program_manager_admin', \n 'program_manager_section_id'\n ); \n \n\tadd_settings_field(\n 'pre_days_file', // ID\n 'PRE conference xlsx file', // Title \n array( $this, 'pre_days_file_callback' ), // Callback\n 'program_manager_admin', // Page\n 'program_manager_section_id' // Section \n ); \n\n add_settings_field(\n 'main_days_file', \n 'MAIN conference xlsx file', \n array( $this, 'main_days_file_callback' ), \n 'program_manager_admin', \n 'program_manager_section_id'\n ); \n \n }",
"protected function setupPage() {}",
"public function onLoadSetup()\n {\n $this->prepareComponent();\n\n $options['columns'] = $this->listWidget->getSetupListColumns();\n $options['perPageOptions'] = $this->listWidget->getSetupPerPageOptions();\n $options['recordsPerPage'] = $this->listWidget->recordsPerPage;\n\n $this->defaultSuffix = 'pc-list-setup';\n\n // return [ '#'.$divId => $this->listWidget->makePartial('setup_form', ['options' => $options])];\n return $this->listWidget->makePartial('setup_form', ['options' => $options, 'componentOptions' => $this->options]);\n }",
"protected function initTSFE() {\n\t\t$GLOBALS['TSFE'] = $tsfe = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Frontend\\\\Controller\\\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], GeneralUtility::_GP('id'), '');\n\t\t/** @var \\TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController $tsfe */\n\t\t$tsfe->connectToDB();\n\t\t$tsfe->initFEuser();\n\t\t\\TYPO3\\CMS\\Frontend\\Utility\\EidUtility::initTCA();\n\t\t$tsfe->determineId();\n\t\t$tsfe->initTemplate();\n\t\t$tsfe->getConfigArray();\n\t\t$tsfe->settingLanguage();\n\n\t\t// Get linkVars, absRefPrefix, etc\n\t\t\\TYPO3\\CMS\\Frontend\\Page\\PageGenerator::pagegenInit();\n\t}",
"public function load()\n {\n if ($this->is_loaded()) {\n return;\n }\n\n foreach($this->get_shortcodes() as $shortcode) {\n $this->register_shortcode($shortcode);\n }\n\n foreach ($this->get_subscribers() as $subscriber) {\n $this->event_manager->add_subscriber($subscriber);\n }\n \n // Settings Page\n $settings_page = new CommentIQ_Admin_Settings();\n $settings_page->run();\n\n $this->loaded = true;\n }",
"function tap_mod_init() \n {\n $funcion = 'mod_page_handler';\n elgg_register_page_handler('tap_mod', $funcion);\n }",
"public function initConfigurationForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$pl = $this->getPluginObject();\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\n\t\t// setting 1 (a checkbox)\n\t\t$cb = new ilCheckboxInputGUI($pl->txt(\"setting_1\"), \"setting_1\");\n\t\t$form->addItem($cb);\n\t\t\n\t\t// setting 2 (text)\n\t\t$ti = new ilTextInputGUI($pl->txt(\"setting_2\"), \"setting_2\");\n\t\t$ti->setRequired(true);\n\t\t$ti->setMaxLength(10);\n\t\t$ti->setSize(10);\n\t\t$form->addItem($ti);\n\t\n\t\t$form->addCommandButton(\"save\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($pl->txt(\"example_plugin_configuration\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t\t\n\t\treturn $form;\n\t}",
"public function output_setup_form() {\n\t\t$this->output_controls_html( 'klicktipp' );\n\t}",
"function init(){\n $this->pi_initPIflexForm(); // Init and get the flexform data of the plugin\n //merge lConf with standard tt_content column, so in $this->cObj->data there are all data from xflextemplate\n $this->cObj->data=array_merge($this->cObj->data,xmlTransformation::getArrayFromXMLData($this->cObj->data['xflextemplate']));\n //fetch all other data from template\n $res=$GLOBALS['TYPO3_DB']->exec_SELECTquery('xml,typoscript,html','tx_xflextemplate_template','title=\"'.$this->cObj->data['xtemplate'].'\" AND deleted=0 AND hidden=0');\n $databaseRow=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n $this->typoscript=$databaseRow['typoscript'];\n //debug();\n //This code updates typoscript of template with template from page\n $GLOBALS['TSFE']->tmpl->config[count($GLOBALS['TSFE']->tmpl->config)] = $this->typoscript;\n $typoscriptParser = $GLOBALS['TSFE']->tmpl;\n $typoscriptParser->generateConfig();\n\n //$ts contains all typoscript from xflextemplate\n $xml=str_replace(\"''\",\"'\",$databaseRow['xml']);\n //create correct element data from xml in the xflextemplate\n $xmlArray=xmlTransformation::getArrayFromXML($xml);\n if(is_array($xmlArray)){\n foreach($xmlArray as $xElemet){\n $this->xflexData[$xElemet['name']]=$xElemet;\n }\n }\n //assign typoscript\n $this->typoscript=$typoscriptParser->setup;\n //$this->template=($databaseRow['html']) ? $databaseRow['html'] : $this->cObj->TEMPLATE($this->typoscript['templateFile.']);\n if(!$databaseRow['html']){\n $this->template=$this->cObj->getSubpart($this->cObj->TEMPLATE($this->typoscript['templateFile.']), '###'.strtoupper(str_replace(' ','_',$this->cObj->data['xtemplate'])).'###');\n }\n else{\n $this->template = $databaseRow['html'];\n }\n //only for back compatibility\n $this->template=($this->template)?$this->template:$this->getTemplateString($dbrow['file']);//retrieve file data, only if is not defined in template\n //Updating conf array with typoscript\n $this->conf=t3lib_div::array_merge_recursive_overrule($this->conf,$typoscriptParser->setup);\n }",
"public function init_settings_page()\n\t\t{\n\n\t\t\t$this->template_header();\n\t\t\t$this->template_body();\n\t\t\t$this->template_footer();\n\n\t\t}",
"public function page_init()\n { \n register_setting(\n 'ccgr_extras_options', // Group name. Must match the settings_fields function call\n 'cc_restricted_email_domains', // Option name\n array( $this, 'sanitize' ) // Callback function for validation.\n );\n\n add_settings_section(\n 'ccgr_extras_options', // ID for the section\n 'Registration Extras', // Title\n array( $this, 'print_section_info' ), // Callback function. Outputs section description.\n 'ccgr_extras' // Page name. Must match do_settings_section function call.\n ); \n\n add_settings_field(\n 'restricted_domains', // ID for the field\n 'Restricted Email Domains', // Title \n array( $this, 'print_domain_form_field' ), // Callback function. Outputs form field inputs.\n 'ccgr_extras', // Page name. Must match do_settings_section function call.\n 'ccgr_extras_options' // ID of the settings section that this goes into (same as the first argument of add_settings_section). \n );\n\n }",
"function init_form_fields() {\n\n \tinclude ( SUMO_SAGEPLUGINPATH . 'includes/sagepay-form-admin.php' );\n\n }",
"public function initializeAction() {\n\t\t// TypoScript configuration\n\t\t$this->frontendConfiguration = $GLOBALS['TSFE']->tmpl->setup['config.'];\n\n\t\t// Perhaps a better way to do that ...\n\t\t$configuration = $this->configurationManager->getConfiguration('FullTypoScript');\n\t\t$this->configuration = $configuration['page_9090.']['10.']['10.'];\n\n\t\tif (empty($this->configuration)) {\n\t\t\tthrow new Exception('Exception 1323945007: configuration empty. Check existence of TS key \"page_9090\"', 1323945007);\n\t\t}\n\t\t//\t\t$this->contentObjectData = $this->configurationManager->getcontentObject()->data;\n\t}",
"protected function setupForms()\n {\n if (null === $this->forms) {\n $configuration = $this->getConfiguration();\n foreach ($configuration['routes'] as $name => $conf) {\n $this->forms[$name] = $this->setupForm($name, $conf);\n }\n }\n }",
"public function load_settings_page() : void {\n\n\t\t\tglobal $learndash_assets_loaded;\n\n\t\t\t$object = array(\n\t\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' ),\n\t\t\t\t'plugin_url' => LEARNDASH_LMS_PLUGIN_URL,\n\t\t\t\t'admin_dashboard_url' => admin_url( '/' ),\n\t\t\t\t'learndash_cloud_setup_url' => add_query_arg(\n\t\t\t\t\tarray( 'page' => 'learndash-setup' ),\n\t\t\t\t\tadmin_url( 'admin.php' )\n\t\t\t\t),\n\t\t\t\t'learndash_cloud_setup_wizard_url' => add_query_arg(\n\t\t\t\t\tarray( 'page' => 'learndash-setup-wizard' ),\n\t\t\t\t\tadmin_url( 'admin.php' )\n\t\t\t\t),\n\t\t\t\t'learndash_setup_wizard_url' => add_query_arg(\n\t\t\t\t\tarray( 'page' => 'learndash-setup-wizard' ),\n\t\t\t\t\tadmin_url( 'admin.php' )\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t\tif ( isset( $_GET['page'] ) && 'learndash-setup' === $_GET['page'] ) {\n\t\t\t\tHelp_Page::enqueue_support_assets();\n\n\t\t\t\twp_enqueue_style(\n\t\t\t\t\t'learndash-setup',\n\t\t\t\t\tLEARNDASH_LMS_PLUGIN_URL . '/assets/css/setup.css',\n\t\t\t\t\tarray(),\n\t\t\t\t\tLEARNDASH_VERSION,\n\t\t\t\t\t'all'\n\t\t\t\t);\n\t\t\t\t$learndash_assets_loaded['styles']['learndash-admin-setup-page-style'] = __FUNCTION__;\n\n\t\t\t\twp_enqueue_script(\n\t\t\t\t\t'learndash-setup',\n\t\t\t\t\tLEARNDASH_LMS_PLUGIN_URL . '/assets/js/setup.js',\n\t\t\t\t\tarray( 'jquery', 'wp-element' ),\n\t\t\t\t\tLEARNDASH_VERSION,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\t$learndash_assets_loaded['scripts']['learndash-admin-setup-page-script'] = __FUNCTION__;\n\n\t\t\t\twp_localize_script(\n\t\t\t\t\t'learndash-setup',\n\t\t\t\t\t'LearnDashSetup',\n\t\t\t\t\t$object\n\t\t\t\t);\n\t\t\t}\n\t\t}",
"public function getTypoScriptSetup() {}",
"public function getTypoScriptSetup() {}",
"protected function setUpSite() {\n // Recreate the container so that we can simulate the submission of the\n // SyncConfigureForm after the full bootstrap has occurred. Without out this\n // drupal_realpath() does not work so uploading files through\n // WebTestBase::postForm() is impossible.\n $request = Request::createFromGlobals();\n $class_loader = require $this->container->get('app.root') . '/vendor/autoload.php';\n Settings::initialize($this->container->get('app.root'), DrupalKernel::findSitePath($request), $class_loader);\n foreach ($GLOBALS['config_directories'] as $type => $path) {\n $this->configDirectories[$type] = $path;\n }\n $this->kernel = DrupalKernel::createFromRequest($request, $class_loader, 'prod', FALSE);\n $this->kernel->prepareLegacyRequest($request);\n $this->container = $this->kernel->getContainer();\n\n $this->setUpSyncForm();\n $this->setUpInstallConfigureForm();\n // If we've got to this point the site is installed using the regular\n // installation workflow.\n $this->isInstalled = TRUE;\n }",
"public function onLoadSetup()\n {\n $this->vars['columns'] = $this->getSetupListColumns();\n $this->vars['perPageOptions'] = $this->getSetupPerPageOptions();\n $this->vars['recordsPerPage'] = $this->recordsPerPage;\n return $this->makePartial('setup_form');\n }",
"abstract public function getTypoScriptSetup() ;",
"function setConfig() {\n\n\t\t\t// Mapping array for PI flexform\n\t\t\t$flex2conf = array(\n\t\t\t\t'news' => 'sDEF:news',\n\t\t\t\t'days' => 'sDEF:days',\n\t\t\t\t'darkdesign' => 'sDEF:dark',\n\t\t\t\t'show_last' => 'sDEF:show_last',\n\t\t\t\t'order_by' => 'sDEF:listOrderBy',\n\t\t\t\t'asc_desc' => 'sDEF:ascDesc',\n\t\t\t\t'category_mode' => 'sDEF:categoryMode',\n\t\t\t\t'category' => 'sDEF:categorySelection',\n\t\t\t\t'sideTop' => 'sSIDE:blog',\n\t\t\t\t'sideTopTitle' => 'sSIDE:blogTitle',\n\t\t\t\t'sideTopText' => 'sSIDE:blogText',\n\t\t\t\t'sideTopImage' => 'sSIDE:blogImage',\n\t\t\t\t'sideMiddle' => 'sSIDE:reader',\n\t\t\t\t'sideMiddleTitle' => 'sSIDE:readerTitle',\n\t\t\t\t'sideMiddleText' => 'sSIDE:readerText',\n\t\t\t\t'sideMiddleImage' => 'sSIDE:readerImage',\n\t\t\t\t'sideBottom' => 'sSIDE:bottom',\n\t\t\t\t'sideBottomTitle' => 'sSIDE:bottomTitle',\n\t\t\t\t'swfParams.' => array(\n\t\t\t\t\t'loop' => 'sFLASH:loop',\n\t\t\t\t\t'menu' => 'sFLASH:menu',\n\t\t\t\t\t'quality' => 'sFLASH:quality',\n\t\t\t\t\t'scale' => 'sFLASH:scale',\n\t\t\t\t\t'bgcolor' => 'sFLASH:bgcolor',\n\t\t\t\t\t'swliveconnect' => 'sFLASH:swliveconnect',\n\t\t\t\t),\n\t\t\t\t'playerParams.' => array(\n\t\t\t\t\t'timer' => 'sPLAYER:timer',\n\t\t\t\t\t'transition' => 'sPLAYER:transition',\n\t\t\t\t\t'random' => 'sPLAYER:random',\n\t\t\t\t\t'navigation' => 'sPLAYER:navigation',\n\t\t\t\t),\n\t\t\t\t'width' => 'sFLASH:width',\n\t\t\t\t'height' => 'sFLASH:height',\n\t\t\t\t'version' => 'sFLASH:version',\n\t\t\t);\n\n\t\t\t// Ovverride TS setup with flexform\n\t\t\t$this->conf = $this->api->fe_mergeTSconfFlex($flex2conf,$this->conf,$this->piFlexForm);\n\n\t\t\t$this->conf['swfParams.']['width'] = $this->conf['width'];\n\t\t\t$this->conf['swfParams.']['height'] = $this->conf['height'];\n\t\t\t$this->conf['swfParams.']['wmode'] = $this->conf['wmode'];\n \t\t//$this->conf['width'] = 512;\n\t\t\t//$this->conf['height'] = 265;\n\t\t\t//$this->conf['wmode'] = 'opaque';\n\t\t\t// DEBUG ONLY - Output configuration array\n\t\t\t#$this->api->debug($this->conf,'MP3 Player: configuration array');\n\t\t}",
"public function page_init()\n {\n register_setting(\n 'sepw_option_group', // Option group\n 'sepw_settings', // Option name\n array($this, 'sanitize') // Sanitize\n );\n\n add_settings_section(\n 'info_section_id',\n __('Guide', 'sepw'),\n array($this, 'print_info_section_info'),\n 'sepw-setting-admin'\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n __('Settings', 'sepw'), // Title\n array($this, 'print_settings_section_info'), // Callback\n 'sepw-setting-admin' // Page\n );\n\n add_settings_section(\n 'generate_section_id',\n __('Create Pricelist', 'sepw'),\n array($this, 'print_generate_section_info'),\n 'sepw-setting-admin'\n );\n\n add_settings_field(\n 'product_fields',\n __('Filters', 'sepw'),\n array($this, 'product_fields_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'images_size',\n __('Thumbnail size', 'sepw'),\n array($this, 'images_size_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'cache_lifetime',\n __('Update Frequency', 'sepw'),\n array($this, 'cache_lifetime_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n }",
"public function load_settings_page() : void {\n\n\t\t\tglobal $learndash_assets_loaded;\n\n\t\t\tself::enqueue_support_assets();\n\n\t\t\t$learndash_assets_loaded['styles']['learndash-admin-help-page-style'] = __FUNCTION__;\n\n\t\t\t$learndash_assets_loaded['scripts']['learndash-admin-help-page-script'] = __FUNCTION__;\n\t\t}",
"public function page_init()\n { \n register_setting(\n 'my_option_group', // Option group\n 'my_option_name', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'CLAS DEPT Theme Settings', // Title\n array( $this, 'print_section_info' ), // Callback\n 'my-setting-admin' // Page\n ); \n\n add_settings_field(\n 'dept_address', // ID\n 'Department Address', // Title \n array( $this, 'dept_address_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section \n ); \n\n add_settings_field(\n 'title', \n 'Footer Title', \n array( $this, 'title_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'fb', \n 'Facebook Link', \n array( $this, 'fb_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'twitter', \n 'Twitter Link', \n array( $this, 'twitter_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'instagram', \n 'Instagram Link', \n array( $this, 'instagram_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'youtube', \n 'Youtube Link', \n array( $this, 'youtube_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'rss', \n 'RSS Link', \n array( $this, 'rss_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n \n }",
"public function plugin_page() {\n\t\t$this->setting_api->show_forms();\n\t}",
"public function page_init()\n {\n register_setting(\n 'mj_groups_fields', // group name\n 'mj_option_theme',\n array($this, 'sanitize') // sanitize\n );\n\n add_settings_section(\n 'section_default',\n '',\n '',\n 'config-theme-options'\n );\n\n foreach ($this->formRenderInputs as $key => $value) {\n add_settings_field(\n $value['args']['atributos']['name'],\n $value['titulo'],\n array($this, 'render_field_input'),\n 'config-theme-options',\n 'section_default',\n array('valores' => $value)\n );\n }\n }",
"public function page_init()\n {\n register_setting(\n 'fo_general_options', // Option group\n 'fo_general_options', // Option name\n array( $this, 'general_sanitize' ) // Sanitize\n );\n register_setting(\n 'fo_elements_options', // Option group\n 'fo_elements_options', // Option name\n array( $this, 'elements_sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_elements', // ID\n '', // Title\n array( $this, 'print_elements_section_info' ), // Callback\n 'font-setting-admin' // Page\n );\n\n // Add all the elements to the elements section.\n foreach ($this->elements as $id => $title) {\n add_settings_field(\n $id, // ID\n htmlspecialchars($title), // Title\n array( $this, 'fonts_list_field_callback' ), // Callback\n 'font-setting-admin', // Page\n 'setting_elements', // Section\n $id // Parameter for Callback\n );\n\n add_settings_field(\n $id . '_weight', // ID\n __('Font Weight', 'bk-fonts'), // Title\n array( $this, 'fonts_weight_list_field_callback' ), // Callback\n 'font-setting-admin', // Page\n 'setting_elements', // Section\n $id . '_weight' // Parameter for Callback\n );\n\n add_settings_field(\n $id . '_important', // ID\n '', // Title\n array( $this, 'is_important_element_field_callback' ), // Callback\n 'font-setting-admin', // Page\n 'setting_elements', // Section\n $id . '_important' // Parameter for Callback\n );\n }\n\n register_setting(\n 'bk_misc_options',\n 'bk_misc_options',\n array( $this, 'cpc_options_sanitize' )\n );\n register_setting(\n 'bk_cpc_options',\n 'bk_cpc_options',\n array( $this, 'cpc_options_sanitize' )\n );\n register_setting(\n 'bk_pimg_options',\n 'bk_pimg_options',\n array( $this, 'cpc_options_sanitize' )\n );\n /* material */\n register_setting(\n 'bk_material_options',\n 'bk_material_options',\n array( $this, 'cpc_material_sanitize' )\n );\n /* material */ \n add_settings_section(\n 'setting_general', // ID\n '', // Title\n '',\n 'font-setting-admin' // Page\n );\n add_settings_section(\n 'bk_misc_settings', // ID\n '', // Title\n '',\n 'font-setting-admin' // Page\n );\n add_settings_section(\n 'bk_pimg_settings', // ID\n '', // Title\n '',\n 'font-setting-admin' // Page\n );\n /* material section */\n add_settings_section(\n 'bk_material_settings', // ID\n '', // Title\n '',\n 'font-setting-admin' // Page\n );\n\n\n /* material */\n add_settings_field(\n 'bk_material_dibond',\n 'Black Dibond',\n array( $this, 'print_material_section_info_dibond' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_white_dibond',\n 'White Dibond',\n array( $this, 'print_material_section_info_white_dibond' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_acrylic',\n 'Black Acrylic',\n array( $this, 'print_material_section_info_acrylic' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_acrylic_white',\n 'White Acrylic',\n array( $this, 'print_material_section_info_acrylic_white' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_acrylic_coloured',\n 'Coloured Acrylic',\n array( $this, 'print_material_section_info_acrylic_coloured' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_painted_aluminium',\n 'Painted Aluminium',\n array( $this, 'print_material_section_info_painted_aluminium' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_brushed_dibond',\n 'Brushed Dibond',\n array( $this, 'print_material_section_info_brushed_dibond' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_brushed_aluminium',\n 'Brushed Aluminium',\n array( $this, 'print_material_section_info_brushed_aluminium' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_brushed_stainless',\n 'Stainless Steel',\n array( $this, 'print_material_section_info_brushed_stainless' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_brushed_brass',\n 'Brushed Brass',\n array( $this, 'print_material_section_info_brushed_brass' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_brushed_copper',\n 'Brushed Copper',\n array( $this, 'print_material_section_info_brushed_copper' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n add_settings_field(\n 'bk_material_brushed_bronze',\n 'Brushed Bronze',\n array( $this, 'print_material_section_info_brushed_bronze' ),\n 'font-setting-admin',\n 'bk_material_settings'\n );\n /* material */\n add_settings_section(\n 'cpc_settings_section',\n 'cpc Settings Section',\n array( $this, 'print_elements_section_info' ),\n 'font-setting-admin'\n );\n add_settings_field(\n 'cpc_dibond',\n 'Black Dibond',\n array( $this, 'dibond_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_dibond_white',\n 'White Dibond',\n array( $this, 'dibond_white_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_acrylic',\n 'Black Acrylic',\n array( $this, 'acrylic_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_acrylic_white',\n 'White Acrylic',\n array( $this, 'acrylic_white_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_acrylic_coloured',\n 'Coloured Acrylic',\n array( $this, 'acrylic_coloured_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_pa',\n 'Painted Aluminium',\n array( $this, 'pa_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n\n add_settings_field(\n 'cpc_brushed_dibond',\n 'Brushed Dibond',\n array( $this, 'brushed_dibond_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_ba',\n 'Brushed Aluminium',\n array( $this, 'ba_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_bs',\n 'Stainless Steel',\n array( $this, 'brushed_stainless_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n\n add_settings_field(\n 'cpc_brushed_brass',\n 'Brushed Brass',\n array( $this, 'brushed_brass_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_brushed_copper',\n 'Brushed Copper',\n array( $this, 'brushed_copper_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n add_settings_field(\n 'cpc_brushed_bronze',\n 'Brushed Bronze',\n array( $this, 'brushed_bronze_callback' ),\n 'font-setting-admin',\n 'setting_general'\n );\n\n /* Misc Settings */\n add_settings_field(\n 'bk_character_spacing',\n 'Character Spacing Average',\n array( $this, 'bk_character_spacing_callback' ),\n 'font-setting-admin',\n 'bk_misc_settings'\n );\n add_settings_field(\n 'bk_misc_tax',\n 'HST GST Tax',\n array( $this, 'bk_hst_gst_cb' ),\n 'font-setting-admin',\n 'bk_misc_settings'\n );\n add_settings_field(\n 'bk_installation_rate',\n 'Installation Rate',\n array( $this, 'bk_installation_cb' ),\n 'font-setting-admin',\n 'bk_misc_settings'\n );\n add_settings_field(\n 'bk_delivery_rate',\n 'Delivery Rate',\n array( $this, 'bk_delivery_cb' ),\n 'font-setting-admin',\n 'bk_misc_settings'\n );\n\n /* Product Images */\n add_settings_field(\n 'bk_dibond_pimg',\n 'Black Dibond',\n array( $this, 'bk_dibond_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_dibond_white_pimg',\n 'White Dibond',\n array( $this, 'bk_dibond_white_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_acrylic_pimg',\n 'Black Acrylic',\n array( $this, 'bk_acrylic_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_acrylic_white_pimg',\n 'White Acrylic',\n array( $this, 'bk_acrylic_white_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_acrylic_coloured_pimg',\n 'Coloured Acrylic',\n array( $this, 'bk_acrylic_coloured_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_pa_pimg',\n 'Painted Aluminium',\n array( $this, 'bk_pa_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_bd_pimg',\n 'Brushed Dibond',\n array( $this, 'bk_bd_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_ba_pimg',\n 'Brushed Aluminium',\n array( $this, 'bk_ba_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_bs_pimg',\n 'Stainless Steel',\n array( $this, 'bk_bs_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_bbrass_pimg',\n 'Brushed Brass',\n array( $this, 'bk_bbrass_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_bc_pimg',\n 'Brushed Copper',\n array( $this, 'bk_bc_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n add_settings_field(\n 'bk_bbronze_pimg',\n 'Brushed Bronze',\n array( $this, 'bk_bbronze_pimg_cb' ),\n 'font-setting-admin',\n 'bk_pimg_settings'\n );\n }",
"public function initialize_settings_page()\n {\n }",
"public function page_init()\n {\n register_setting(\n 'my_option_group', // Option group\n 'linkedin_api_option', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'Request Settings', // Title\n array(), // Callback\n 'my-setting-admin' // Page\n );\n\n add_settings_field(\n 'redirect_url', // ID\n 'Redirect URL', // Title\n array( $this, 'redirect_url_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section\n );\n\n add_settings_field(\n 'client_id',\n 'Client ID',\n array( $this, 'client_id_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'client_secret',\n 'Client Secret',\n array( $this, 'client_secret_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'authorization_code',\n 'Authorization Code For An Access Token',\n array( $this, 'authorization_code_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'access_token',\n 'Access Token',\n array( $this, 'access_token_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n }",
"public function setup_settings() {\n\t\t$this->init_sections();\n\t\t$this->init_fields();\n\t\t$this->settings_fields();\n\t}",
"function main($content,$conf)\t{\n\t\t$this->conf=$conf;\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t\t$this->pi_USER_INT_obj=1;\t// Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!\n\t\n\t\t// HOOK: allow multiple hooks to manipulate formdesc\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['pt_gsauserreg']['pi5_hooks']['main_formdescHook'])) {\n\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['pt_gsauserreg']['pi5_hooks']['main_formdescHook'] as $className) {\n\t\t\t\t$hookObj = &t3lib_div::getUserObj($className);\n\t\t\t\t$this->formdesc = $hookObj->main_formdescHook($this, $this->formdesc);\n\t\t\t}\n\t\t}\n\n\t\t/* get template and instantiate form handler */\n\t\ttrace($conf);\n\t\t$templateFilePath = $this->conf['templateFile'];\n\t\t$this->templateFile = $this->cObj->fileResource($templateFilePath);\n\t\t$this->formHandler = new tx_pttools_formTemplateHandler($this, $this->formdesc);\n\n\t\t// load filter object from session, if available; else create new\n\t\t$filter = tx_pttools_sessionStorageAdapter::getInstance()->read(self::SESSION_KEY_FILTER);\n\t\tif (is_object($filter)) {\n\t\t\ttrace('loaded filter from session');\n\t\t\ttrace($filter);\n\t\t\ttx_pttools_sessionStorageAdapter::getInstance()->delete(self::SESSION_KEY_FILTER);\n\t\t}\n\t\telse {\n\t\t\ttrace('create new filter object');\n\t\t\t$filter = new tx_ptgsauserreg_adminFilter();\n\t\t}\n\n\t\t// default form is SearchForm\n\t\t$nextform = 'SearchForm';\n\t\t$myObj = $filter;\n\n\t\t// check for form submits\n\t\t$checkmsg = '';\n\t\tswitch (true) {\n\t\t\t// we check if the case labels evaluate to true\n\n\t\t\tcase isset($this->piVars['submit_SearchForm']):\n\t\t\t\ttrace('found submit from SearchForm');\n\t\t\t\t// verify and process form input\n\t\t\t\t$checkmsg = $this->processSearchForm($filter);\n\t\t\t\tif ($checkmsg == '') {\n\t\t\t\t\t// load search result and proceed to select form\n\t\t\t\t\t$userCollection = new tx_ptgsauserreg_userCollection();\n\t\t\t\t\t$checkmsg = $this->searchUsers($userCollection, $filter);\n\t\t\t\t\tif ($checkmsg != '') {\n\t\t\t\t\t\t// search failed, complain\n\t\t\t\t\t\t$msgBoxObj = new tx_pttools_msgBox('error', $checkmsg);\n\t\t\t\t\t\t$checkmsg = $msgBoxObj->__toString();\n\t\t\t\t\t\t$nextform = 'SearchForm';\n\t\t\t\t\t\t$myObj = $filter;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$nextform = 'SelectForm';\n\t\t\t\t\t\t$myObj = $userCollection;\n\t\t\t\t\t\ttx_pttools_sessionStorageAdapter::getInstance()->store(self::SESSION_KEY_FILTER, $filter);\n\t\t\t\t\t\ttrace('storing filter in session');\n\t\t\t\t\t\ttrace($filter);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$nextform = 'SearchForm';\n\t\t\t\t\t$myObj = $filter;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase isset($this->piVars['submit_SelectForm']):\n\t\t\t\ttrace('found submit from SelectForm');\n\t\t\t\t// verify and process form input\n\t\t\t\t$userCollection = new tx_ptgsauserreg_userCollection();\n\t\t\t\t$checkmsg = $this->searchUsers($userCollection, $filter);\n\t\t\t\tif ($checkmsg != '') {\n\t\t\t\t\t// should be impossible: we are using a formerly successful filter\n\t\t\t\t\tthrow new tx_pttools_exception('filter failed', 3);\n\t\t\t\t}\n\t\t\t\t$checkmsg = $this->processSelectForm($userCollection);\n\t\t\t\tif ($checkmsg == '') {\n\t\t\t\t\t$user = $userCollection->getSelectedItem();\n\t\t\t\t\ttrace($user);\n\t\t\t\t\t$this->switchUser($user);\n\t\t\t\t}\n\t\t\t\tthrow new tx_pttools_exception('oops, I lost my identity!', 0);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase isset($this->piVars['back_SelectForm']):\n\t\t\t\ttrace('go back from SelectForm');\n\t\t\t\t$nextform = 'SearchForm';\n\t\t\t\t$myObj = $filter;\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$method = 'display'.$nextform;\n\t\t$content = $checkmsg.$this->$method($myObj);\n\t\n\t\treturn $this->pi_wrapInBaseClass($content);\n\t}",
"public function loadSettings()\n\t{\n\t\t// Update picto for Dolibarr 12++\n\t\tif (function_exists('version_compare') && version_compare(DOL_VERSION, '12.0.0') >= 0) {\n\t\t\t$this->picto = \"quicknotes_128.png@quicknotes\";\n\t\t}\n\n\t\t$this->addJsFile('quicknotes.js.php');\n\t\t$this->enableHooks(array(\n\t\t\t'toprightmenu',\n\t\t\t'main',\n\t\t\t'login'\n\t\t));\n\t}",
"public function settings_page_init() {\n $this->registration();\n $this->sections();\n }",
"public function init()\n {\n parent::init();\n\n // **************************\n // Initializing\n // **************************\n /** @var \\TYPO3\\CMS\\Backend\\Template\\DocumentTemplate doc */\n $this->doc = GeneralUtility::makeInstance('TYPO3\\\\CMS\\Backend\\\\Template\\\\DocumentTemplate');\n $this->doc->setModuleTemplate('EXT:restructure_redirect/mod/redirects.html');\n\n $this->doc->form = '<form action=\"\" method=\"post\">';\n }",
"public function pre_run()\n {\n require_code('input_filter_2');\n modsecurity_workaround_enable();\n\n require_all_lang();\n\n $type = get_param_string('type', 'browse');\n\n require_lang('config');\n\n if ($type == 'browse') {\n set_helper_panel_tutorial('tut_adv_configuration');\n\n $this->title = get_screen_title('CONFIGURATION');\n }\n\n if ($type == 'category') {\n /*Actually let's save the space set_helper_panel_tutorial('tut_adv_configuration');*/\n\n $category = get_param_string('id');\n\n $test = do_lang('CONFIG_CATEGORY_' . $category, null, null, null, null, false);\n if (is_null($test)) {\n attach_message(do_lang_tempcode('CAT_NOT_FOUND', escape_html($category), 'OPTION_CATEGORY'), 'warn');\n\n $this->title = get_screen_title('CONFIGURATION');\n } else {\n breadcrumb_set_parents(array(array('_SELF:_SELF:browse', do_lang_tempcode('CONFIGURATION'))));\n breadcrumb_set_self(do_lang_tempcode('CONFIG_CATEGORY_' . $category));\n\n $this->title = get_screen_title(do_lang_tempcode('CONFIG_CATEGORY_' . $category), false);\n }\n\n $this->category = $category;\n }\n\n if ($type == 'set') {\n $category = get_param_string('id', 'MAIN');\n\n $test = do_lang('CONFIG_CATEGORY_' . $category, null, null, null, null, false);\n if (is_null($test)) {\n $this->title = get_screen_title('CONFIGURATION');\n } else {\n $this->title = get_screen_title(do_lang_tempcode('CONFIG_CATEGORY_' . $category), false);\n }\n }\n\n if ($type == 'base') {\n $this->title = get_screen_title('CONFIGURATION');\n }\n\n if ($type == 'upgrader') {\n $this->title = get_screen_title('FU_UPGRADER_TITLE');\n }\n\n if ($type == 'backend') {\n $this->title = get_screen_title('FEEDS');\n }\n\n if ($type == 'code_editor') {\n $this->title = get_screen_title('CODE_EDITOR');\n }\n\n if ($type == 'xml_fields') {\n set_helper_panel_tutorial('tut_fields_filter');\n set_helper_panel_text(comcode_lang_string('DOC_FIELD_FILTERS'));\n\n $this->title = get_screen_title('FIELD_FILTERS');\n }\n\n if ($type == '_xml_fields') {\n $this->title = get_screen_title('FIELD_FILTERS');\n }\n\n if ($type == 'xml_breadcrumbs') {\n set_helper_panel_tutorial('tut_structure');\n set_helper_panel_text(comcode_lang_string('DOC_BREADCRUMB_OVERRIDES'));\n\n $this->title = get_screen_title('BREADCRUMB_OVERRIDES');\n }\n\n if ($type == '_xml_breadcrumbs') {\n $this->title = get_screen_title('BREADCRUMB_OVERRIDES');\n }\n\n return null;\n }",
"function wcfm_settings_init() {\n\t\tglobal $WCFM;\n\t\t // register a new setting for \"wcfm\" page\n\t\t register_setting( 'wcfm', 'wcfm_page_options' );\n\t\t \n\t\t // register a new section in the \"wcfm\" page\n\t\t add_settings_section(\n\t\t\t 'wcfm_section_developers',\n\t\t\t __( 'WCFM Page Settings', $WCFM->text_domain ),\n\t\t\t array( &$this, 'wcfm_section_developers_cb'),\n\t\t\t 'wcfm'\n\t\t );\n\t\t \n\t\t // register a new field in the \"wcfm_section_developers\" section, inside the \"wcfm\" page\n\t\t add_settings_field(\n\t\t\t 'wcfm_field_page', \n\t\t\t __( 'WCFM Page', $WCFM->text_domain ),\n\t\t\t array( &$this, 'wcfm_field_page_cb' ),\n\t\t\t 'wcfm',\n\t\t\t 'wcfm_section_developers',\n\t\t\t [\n\t\t\t 'label_for' => 'wc_frontend_manager_page_id',\n\t\t\t 'class' => 'wcfm_row',\n\t\t\t 'wcfm_custom_data' => 'wc_frontend_manager_page',\n\t\t\t ]\n\t\t );\n\t\t \n\t}",
"public function page_init()\n { \n add_settings_section(\n 'setting_section_id', // ID\n 'My Custom Settings', // Title\n array( $this, 'print_section_info' ), // Callback\n 'my-setting-admin' // Page\n ); \n\n add_settings_field(\n 'id_number', // ID\n 'ID Number', // Title \n array( $this, 'id_number_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section \n ); \n\n add_settings_field(\n 'title', \n 'Title', \n array( $this, 'title_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n );\n add_settings_field(\n 'checkbox', \n 'Checkbox', \n array( $this, 'checkbox_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n add_settings_field(\n 'radio', \n 'Radio', \n array( $this, 'radio_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n add_settings_field(\n 'textarea', \n 'Textarea', \n array( $this, 'textarea_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n );\n add_settings_field(\n 'select', \n 'Select', \n array( $this, 'select_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n }",
"function tk_template_forms_init (&$app, &$this)\n{\n $this->_scanner->dirtag (XML_TEMPLATE_NS, 'FORM-ACTION');\n $this->_app =& $app;\n $app->tk_template =& $this;\n}",
"function initForm(&$conf) {\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\n\t\t// Create shortcuts to these arrays\n\t\t$this->conf = &$conf;\n\t\t$this->data = &$this->cObj->data;\n\n\t\t$row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( 'uid', 'pages', \"module='newsletter'\" );\n\t\t$this->newsletterPID = is_array($row) ? current($row) : 0;\n\t\t$this->newsletterRegEnabled = $this->newsletterPID && $this->data['tx_gokontakt_newsletterUsergroup'];\n\n\t\t$this->submitted = (int) $this->piVars['submitted'];\n\t\tif ( !$this->submitted ) { // first call\n\t\t\t// reset session\n\t\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey(\"ses\", $this->extKey, NULL);\n\t\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey(\"ses\", $this->extKey . \"_successfully_submitted\", 0);\n\t\t}\n\n\t\tif ( $this->piVars['uid'] == $this->data['uid'] ) { // if this form has been submitted\n\t\t\t$this->mergePiVarsWidthSession();\n\t\t} else { // if a different form has been submitted\n\t\t\t$this->piVars = array();\n\t\t}\n\t}",
"public function page_init()\n {\n register_setting(\n 'cementlap_option_group', // Option group\n 'cementlap_option_name', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'Cementlap Custom Settings', // Title\n array( $this, 'print_section_info' ), // Callback\n 'cementlap-setting-admin' // Page\n );\n\n\n\n /***** Konténer vége ******/\n\n add_settings_field(\n 'ntd',\n 'Gyártandó termékek ekkor érkezhetnek legkorábban',\n array( $this, 'ntd_callback' ),\n 'cementlap-setting-admin',\n 'setting_section_id'\n );\n add_settings_field(\n 'subtitle',\n 'Advert Sub Title',\n array( $this, 'subtitle_callback' ),\n 'cementlap-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'button_text', // ID\n 'Advert button text', // Title\n array( $this, 'button_text_callback' ), // Callback\n 'cementlap-setting-admin', // Page\n 'setting_section_id' // Section\n );\n\n add_settings_field(\n 'button_url', // ID\n 'Button url', // Title\n array( $this, 'button_url_callback' ), // Callback\n 'cementlap-setting-admin', // Page\n 'setting_section_id' // Section\n );\n\n add_settings_field(\n 'change', // ID\n 'Euro arfolyam', // Title\n array( $this, 'change_callback' ), // Callback\n 'cementlap-setting-admin', // Page\n 'setting_section_id' // Section\n );\n\n add_settings_field(\n 'vat', // ID\n 'ÁFA', // Title\n array( $this, 'vat_callback' ), // Callback\n 'cementlap-setting-admin', // Page\n 'setting_section_id' // Section\n );\n\n\n }",
"public function load_import_custom_form_ninja() {\n\t\tif ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled('ninjaforms') ) {\n\t\t\twp_send_json_success( '' );\n\t\t}\t\t\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_popup_import_cform_ninjaforms\" );\n\n\t\t$html = forminator_template( 'custom-form/popup/import-ninjaforms' );\n\n\t\twp_send_json_success( $html );\n\t}",
"private function _initGeneralSettingsForm()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// Instantiate the form\n\t\t$this->_generalSettingsForm = new Settings_Form(Settings_Form::DB_ADAPTER);\n\n\t\t$config_vars = array(\n\t\t\tarray('select', 'sp_portal_mode', explode('|', $txt['sp_portal_mode_options'])),\n\t\t\tarray('check', 'sp_maintenance'),\n\t\t\tarray('text', 'sp_standalone_url'),\n\t\t\t'',\n\t\t\tarray('select', 'portaltheme', $context['SPortal']['themes']),\n\t\t\tarray('check', 'sp_disableColor'),\n\t\t\tarray('check', 'sp_disableForumRedirect'),\n\t\t\tarray('check', 'sp_disable_random_bullets'),\n\t\t\tarray('check', 'sp_disable_php_validation', 'subtext' => $txt['sp_disable_php_validation_desc']),\n\t\t\tarray('check', 'sp_disable_side_collapse'),\n\t\t\tarray('check', 'sp_resize_images'),\n\t\t\tarray('check', 'sp_disableMobile'),\n\t\t);\n\n\t\t$this->_generalSettingsForm->setConfigVars($config_vars);\n\t}",
"public function initPage() {}",
"public function initPage() {}",
"function initSettingsTypeForm()\n\t{\n\t\tinclude_once(\"./Services/Administration/classes/class.ilSetting.php\");\n\t\t$type = ilSetting::_getValueType();\n\n\t\tinclude_once (\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n $form = new ilPropertyFormGUI();\n\n\t\t$form->setId(\"settings_type\");\n\t\t$form->setTitle($this->lng->txt(\"settings_type\"));\n\t\t$form->setFormAction(\"setup.php?cmd=gateway\");\n\n\t\t$item = new ilNonEditableValueGUI($this->lng->txt('settings_type_current'));\n\t\t$item->setValue(strtoupper($type));\n\n\t\tif ($type == \"clob\")\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt('settings_info_clob'));\n $form->addCommandButton(\"showLongerSettings\", $this->lng->txt(\"settings_show_longer\"));\n $form->addCommandButton(\"changeSettingsType\", $this->lng->txt(\"settings_change_text\"));\n\t }\n\t\telse\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt('settings_info_text'));\n \t$form->addCommandButton(\"changeSettingsType\", $this->lng->txt(\"settings_change_clob\"));\n\t\t}\n\t\t$form->addItem($item);\n\n\t\tif (is_array($this->longer_settings))\n\t\t{\n\t\t\t$item = new ilCustomInputGUI($this->lng->txt('settings_longer_values'));\n\n\t\t\tif (count($this->longer_settings))\n\t\t\t{\n\t foreach ($this->longer_settings as $row)\n\t\t\t\t{\n\t $subitem = new ilCustomInputGUI(sprintf($this->lng->txt('settings_key_info'), $row['module'], $row['keyword']));\n\t\t\t\t\t$subitem->setInfo($row['value']);\n\t\t\t\t\t$item->addSubItem($subitem);\n\t }\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t $item->setHTML($this->lng->txt('settings_no_longer_values'));\n\t }\n\t\t\t$form->addItem($item);\n\t }\n\n\t\treturn $form;\n\t}",
"function initPage(){\n if (($c = $_GET[\"configure\"]) && $this->showConfigure()){\n $this->stop_render = true;\n $this->api->stickyGET(\"configure\");\n if ($c == \"page\"){\n $f = $this->add(\"MVCForm\");\n $f->add(\"Hint\")->set(\"Leave blank unless you know what you do\");\n $this->m->getField('name')->system(true);\n $f->setModel($this->m);\n $f->addSubmit(\"Save\");\n if ($f->isSubmitted()){\n $f->update();\n $this->reload();\n }\n } else if ($cid = $_GET[\"component_id\"]){\n /* here? */\n\n $this->api->stickyGET(\"component_id\");\n $m = $this->add(\"cms/Model_Cms_Component\")->loadData($_GET[\"component_id\"]);\n $m2 = $this->add($m->getRef(\"cms_componenttype_id\")->get(\"class\"));\n $m2->useComponent($m);\n $f = $m2->showConfigureForm($this);\n $b = $this->add(\"Button\", \"close\".$cid)->set(\"Close\");\n $b->js(\"click\", $f->js()->univ()->closeDialog());\n \n } else {\n /* configuring tag */\n $m = $this->add(\"cms/Model_Cms_Pagecomponent\");\n $m->addCondition(\"cms_page_id\", $this->m->get(\"id\"));\n $m->addCondition(\"template_spot\", $c);\n $g = $this->add(\"MVCGrid\");\n /* ordering should be done here */\n $g->setModel($m, array(\"id\", \"cms_component\"));\n $g->add('cms/Controller_GridOrder');\n $g->addColumn(\"button\", \"setup\");\n $g->addColumn(\"delete\", \"delete\");\n if ($page_component_id = $_GET[$g->name . \"_setup\"]){\n $m = $this->add(\"cms/Model_Cms_Pagecomponent\");\n $m->load($page_component_id);\n if ($m->loaded()){\n $component_id = $m->get(\"cms_component_id\");\n\n $g->js()->univ()->frameURL(\"Configure\", $this->api->url($this->getCmsAdminPage()\n , array(\"component_id\" => $component_id)))->execute();\n } else {\n $g->js()->univ()->alert(\"error - could not load $page_component_id?\")->execute();\n }\n }\n $this->add(\"Text\")->set(\"Create new component\");\n $f =$this->add(\"MVCForm\");\n $f->setModel($mc=$this->add(\"cms/Model_Cms_Component\"), array(\"name\", \"cms_componenttype_id\"));\n $f->addSubmit(\"Create\");\n if ($f->isSubmitted()){\n $f->update();\n $mc->update(array(\"is_enabled\" => true));\n $m->update(array(\"cms_component_id\" => $mc->get(\"id\")));\n $f->js(null, $g->js(null, $f->js()->reload())->reload()->execute())->univ()->successMessage(\"Component has been created\");\n }\n $this->add(\"Text\")->set(\"Attach existing component\");\n $f =$this->add(\"Form\");\n $f->addField(\"Dropdown\", \"component\")->setModel(\"cms/Cms_Component\");\n $f->addSubmit(\"Attach\");\n if ($f->isSubmitted()){\n $m->update(array(\"cms_component_id\" => $f->get(\"component\")));\n $f->js(null, $g->js(null, $f->js()->reload())->reload()->execute())->univ()->successMessage(\"Component has been attached\");\n }\n\n \n $this->add(\"Button\", \"close\")->set(\"Close\")->js(\"click\")->univ()->location($this->stripUrl($this->cms_page));\n }\n } else {\n \n if ($this->showConfigure('dev')){\n $this->conf->add(\"Button\")->set(\"Page settings\")->js(\"click\")\n ->univ()->frameURL(\"Page settings\", $this->api->url($this->getCmsAdminPage()\n , array(\"configure\" => \"page\")));\n }\n /* add configure buttons for each \"tag\" */\n $tags = array_keys($this->template->tags);\n $api_tags = array_keys($this->api->template->tags);\n foreach ($api_tags as $tag){\n if (in_array($tag, $this->allowed_tags)){\n if (!in_array($tag, $tags)){\n $tags[] = $tag;\n }\n }\n }\n $mc = $this->add(\"cms/Model_Cms_Component\");\n foreach ($tags as $tag){\n if (in_array($tag, $this->protected_tags)){\n continue;\n }\n if (preg_match(\"/^_.*/\", $tag)){\n continue;\n }\n if (!preg_match(\"/#[0-9]+$/\", $tag) && !in_array($tag, array(\"_page\", \"_name\"))){\n if ($this->showConfigure('dev')){\n $this->conf->add(\"Button\")->set(\"Spot: $tag\")->js(\"click\")\n ->univ()->frameURL(\"Mangage content of tag $tag\",\n $this->api->url($this->getCmsAdminPage()\n , array(\"configure\" => $tag)));\n }\n $m = $this->add(\"cms/Model_Cms_Pagecomponent\")->addCondition(\"cms_page_id\", $this->m->get(\"id\"));\n $elems = $m->addCondition(\"template_spot\", $tag)->setOrder(\"ord\")->getRows();\n if (($tag != \"Content\") && in_array($tag, $api_tags)){\n $dest = $this->api;\n } else {\n $dest = $this;\n }\n if ($elems){\n foreach ($elems as $e){\n $component = $m->loadData($e[\"id\"])->getRef(\"cms_component_id\");\n $driver = $component->getRef(\"cms_componenttype_id\");\n $obj=null;\n\n if ($this->showConfigure()){\n $button = $dest->add(\"Button\", null, $tag);\n //if($obj)$button->js('mouseover',$obj->js()->fadeOut()->fadeIn());\n $this->api->stickyGET(\"cms_page\");\n $button->set(\"Edit '\" . $component->get(\"name\").\"'\")->js(\"click\")\n ->univ()->frameURL(\"Configure \" . $component->get(\"name\"),\n $this->api->url($this->getCmsAdminPage()\n , array(\"configure\" => \"component\", \"component_id\" => $component->get(\"id\"))));\n }\n\n if ($component->get(\"is_enabled\")){\n $element = $this->add($driver->get(\"class\"), null, $tag);\n $element->useComponent($component);\n try {\n $obj = $element->configure($dest, $tag);\n } catch (Exception $e){\n //$this->api->caughtException($e);\n if($this->api->logger->log_output){\n // a bit of hacing\n $this->api->logger->logCaughtException($e);\n }\n $dest->add('View_Error')->set('Problem with this widget: '.$e->getMessage());\n }\n }\n }\n }\n /*\n $dest->add('Button',null,$tag)->set('Add Text')\n ->js('click');\n */\n }\n }\n if ($this->showConfigure()){\n if ($this->warning){\n $this->add(\"Text\")->set(\"<div style=\\\"color:red; background: yellow\\\"><b>Warning:</b><br />\" . implode(\"<br />\", $this->warning) . \"</div>\");\n }\n }\n }\n }",
"public function setUp(): void\n {\n $this->setUpForm(new TypeForm());\n }",
"public function create_plugin_settings_page()\n {\n require_once 'views/settings.phtml';\n }",
"protected function getConfigForm()\n {\n // TODO : add default blog text per lang ?\n $employees = Employee::getEmployeesByProfile(\n 1,\n true\n );\n $default_snippet = array(\n array(\n 'snippet' => 'Article',\n 'name' => $this->l('Simple article')\n ),\n array(\n 'snippet' => 'NewsArticle',\n 'name' => $this->l('News article')\n ),\n );\n $layouts = array(\n array(\n 'layout' => 'layouts/layout-full-width.tpl',\n 'name' => $this->l('Full width')\n ),\n array(\n 'layout' => 'layouts/layout-left-column.tpl',\n 'name' => $this->l('Left column')\n ),\n array(\n 'layout' => 'layouts/layout-right-column.tpl',\n 'name' => $this->l('Right column')\n ),\n array(\n 'layout' => 'layouts/layout-both-columns.tpl',\n 'name' => $this->l('Both columns')\n ),\n );\n $trash_days = array(\n array(\n 'id_trash' => 0,\n 'name' => $this->l('Do not empty trash')\n ),\n array(\n 'id_trash' => 1,\n 'name' => $this->l('One day')\n ),\n array(\n 'id_trash' => 2,\n 'name' => $this->l('Two days')\n ),\n array(\n 'id_trash' => 3,\n 'name' => $this->l('Three days')\n ),\n array(\n 'id_trash' => 4,\n 'name' => $this->l('Four days')\n ),\n array(\n 'id_trash' => 5,\n 'name' => $this->l('Five days')\n ),\n array(\n 'id_trash' => 6,\n 'name' => $this->l('Six days')\n ),\n array(\n 'id_trash' => 7,\n 'name' => $this->l('One week')\n ),\n );\n $css_files = array(\n array(\n 'id_file' => 'default',\n 'name' => $this->l('default.css file')\n ),\n array(\n 'id_file' => 'red',\n 'name' => $this->l('red.css file')\n ),\n array(\n 'id_file' => 'green',\n 'name' => $this->l('green.css file')\n ),\n array(\n 'id_file' => 'yellow',\n 'name' => $this->l('yellow.css file')\n ),\n array(\n 'id_file' => 'white',\n 'name' => $this->l('white.css file')\n ),\n );\n $post_status = array(\n array(\n 'id_status' => 'draft',\n 'name' => $this->l('draft')\n ),\n array(\n 'id_status' => 'pending',\n 'name' => $this->l('pending')\n ),\n array(\n 'id_status' => 'published',\n 'name' => $this->l('published')\n ),\n array(\n 'id_status' => 'trash',\n 'name' => $this->l('trash')\n ),\n array(\n 'id_status' => 'planned',\n 'name' => $this->l('planned')\n ),\n );\n $form_fields = [];\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Blog default Settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'text',\n 'label' => $this->l('Blog base route'),\n 'name' => 'EVERPSBLOG_ROUTE',\n 'desc' => $this->l('Leaving empty will set \"blog\"'),\n 'hint' => $this->l('Use a keyword associated to your shop'),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Post content excerpt'),\n 'name' => 'EVERPSBLOG_EXCERPT',\n 'desc' => $this->l('Post excerpt length for content on listing'),\n 'hint' => $this->l('Please set post content excerpt'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Post title length'),\n 'name' => 'EVERPSBLOG_TITLE_LENGTH',\n 'desc' => $this->l('Post title length for content on listing'),\n 'hint' => $this->l('Please set post title length'),\n 'required' => true,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Extends TinyMCE on blog management ?'),\n 'desc' => $this->l('Set yes to extends TinyMCE on blog management pages'),\n 'hint' => $this->l('Else TinyMCE will be default'),\n 'required' => false,\n 'name' => 'EVERBLOG_TINYMCE',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show post views count ?'),\n 'desc' => $this->l('Set yes to show views count'),\n 'hint' => $this->l('Else will only be shown on admin'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_POST_COUNT',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show post on homepage ?'),\n 'desc' => $this->l('Set yes to show posts on homepage'),\n 'hint' => $this->l('Else posts won\\'t be shown on homepage'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_HOME',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of posts for home'),\n 'name' => 'EVERPSBLOG_HOME_NBR',\n 'desc' => $this->l('Leaving empty will set 4 posts'),\n 'hint' => $this->l('Posts are 4 per row'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of posts for product'),\n 'name' => 'EVERPSBLOG_PRODUCT_NBR',\n 'desc' => $this->l('Leaving empty will set 4 posts'),\n 'hint' => $this->l('Posts are 4 per row'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Posts per page'),\n 'name' => 'EVERPSBLOG_PAGINATION',\n 'desc' => $this->l('Leaving empty will set 10 posts per page'),\n 'hint' => $this->l('Will add pagination'),\n 'required' => true,\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Admin email'),\n 'desc' => $this->l('Will receive new comments notification by email'),\n 'hint' => $this->l('You can set a new account on your shop'),\n 'required' => true,\n 'name' => 'EVERBLOG_ADMIN_EMAIL',\n 'options' => array(\n 'query' => $employees,\n 'id' => 'id_employee',\n 'name' => 'email'\n )\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Allow comments on posts ?'),\n 'desc' => $this->l('Set yes to allow comments'),\n 'hint' => $this->l('You can check them before publishing'),\n 'required' => false,\n 'name' => 'EVERBLOG_ALLOW_COMMENTS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Check comments on posts before they are published ?'),\n 'desc' => $this->l('Set yes to check comments before publishing'),\n 'hint' => $this->l('In order to avoid spam'),\n 'required' => false,\n 'name' => 'EVERBLOG_CHECK_COMMENTS',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Allow only registered customers to comment ?'),\n 'desc' => $this->l('Set yes to allow only registered customers to comment'),\n 'hint' => $this->l('Else everyone will be able to comment'),\n 'required' => false,\n 'name' => 'EVERBLOG_ONLY_LOGGED_COMMENT',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Empty trash'),\n 'desc' => $this->l('Please choose auto empty trash in days'),\n 'hint' => $this->l('Will auto delete trashed posts on CRON task'),\n 'required' => true,\n 'name' => 'EVERBLOG_EMPTY_TRASH',\n 'options' => array(\n 'query' => $trash_days,\n 'id' => 'id_trash',\n 'name' => 'name',\n ),\n 'lang' => false,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Default blog SEO title'),\n 'name' => 'EVERBLOG_TITLE',\n 'desc' => $this->l('Max 65 characters for SEO'),\n 'hint' => $this->l('Will impact SEO'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog SEO meta description'),\n 'name' => 'EVERBLOG_META_DESC',\n 'desc' => $this->l('Max 165 characters for SEO'),\n 'hint' => $this->l('Will impact SEO'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default blog type'),\n 'desc' => $this->l('Will be used for structured metadatas'),\n 'hint' => $this->l('Select blog type depending on your posts'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_TYPE',\n 'options' => array(\n 'query' => $default_snippet,\n 'id' => 'snippet',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog top text'),\n 'name' => 'EVERBLOG_TOP_TEXT',\n 'desc' => $this->l('Will be shown on blog top default page'),\n 'hint' => $this->l('Explain your blog purpose'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n 'autoload_rte' => true\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog bottom text'),\n 'name' => 'EVERBLOG_BOTTOM_TEXT',\n 'desc' => $this->l('Will be shown on blog bottom default page'),\n 'hint' => $this->l('Explain your blog purpose'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n 'autoload_rte' => true\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Use RSS feed ?'),\n 'desc' => $this->l('Will add a link to RSS feed on blog and each tag, category, author'),\n 'hint' => $this->l('Else feed wont be used'),\n 'required' => false,\n 'name' => 'EVERBLOG_RSS',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show author ?'),\n 'desc' => $this->l('Will show author name and avatar on posts'),\n 'hint' => $this->l('Else author name and avatar will be hidden'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_AUTHOR',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Banned users'),\n 'name' => 'EVERBLOG_BANNED_USERS',\n 'desc' => $this->l('Add banned users typing their emails, one per line'),\n 'hint' => $this->l('Unwanted users won\\'t be able to post comments'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Banned IP'),\n 'name' => 'EVERBLOG_BANNED_IP',\n 'desc' => $this->l('Add banned users typing their IP addresses, one per line'),\n 'hint' => $this->l('Unwanted users won\\'t be able to post comments'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show parent categories list on left/right columns ?'),\n 'desc' => $this->l('Set yes show a list of all parent categories on left or right columns'),\n 'hint' => $this->l('Will show ordered parent categories on left/right columns'),\n 'name' => 'EVERBLOG_CATEG_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show tags list on left/right columns ?'),\n 'desc' => $this->l('Set yes to activate cool stuff'),\n 'hint' => $this->l('Set yes show a tags cloud on left or right columns'),\n 'required' => false,\n 'name' => 'EVERBLOG_TAG_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show archives list on left/right columns ?'),\n 'desc' => $this->l('Set yes show links for monthly posts on left or right columns'),\n 'hint' => $this->l('Will show yearly and monthly posts'),\n 'required' => false,\n 'name' => 'EVERBLOG_ARCHIVE_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show related posts on products pages ?'),\n 'desc' => $this->l('Set yes show related posts on product pages footer'),\n 'hint' => $this->l('Will show related posts on product page footer'),\n 'required' => false,\n 'name' => 'EVERBLOG_RELATED_POST',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show featured images on categories ?'),\n 'desc' => $this->l('Set yes to show each category featured image'),\n 'hint' => $this->l('Else category featured image won\\'t be shown'),\n 'name' => 'EVERBLOG_SHOW_FEAT_CAT',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show featured images on tags ?'),\n 'desc' => $this->l('Set yes to show each tag featured image'),\n 'hint' => $this->l('Else tag featured image won\\'t be shown'),\n 'name' => 'EVERBLOG_SHOW_FEAT_TAG',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Activate cool CSS animations ?'),\n 'desc' => $this->l('Set yes to activate cool stuff'),\n 'hint' => $this->l('Will add animations on posts, images, etc'),\n 'name' => 'EVERBLOG_ANIMATE',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable Fancybox'),\n 'hint' => $this->l('Set no if your theme already uses it'),\n 'desc' => $this->l('Use Fancybox for popups on post images'),\n 'name' => 'EVERBLOG_FANCYBOX',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Featured category on blog default page'),\n 'name' => 'EVERBLOG_CAT_FEATURED',\n 'desc' => $this->l('Featured category'),\n 'hint' => $this->l('Will show category products on blog page'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n ),\n 'buttons' => array(\n 'generateBlogSitemap' => array(\n 'name' => 'submitGenerateBlogSitemap',\n 'type' => 'submit',\n 'class' => 'btn btn-default pull-right',\n 'icon' => 'process-icon-refresh',\n 'title' => $this->l('Generate sitemaps')\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Blog layout settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Default blog layout'),\n 'desc' => $this->l('Will add or remove columns from blog page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_BLOG_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default post layout'),\n 'desc' => $this->l('Will add or remove columns from post page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_POST_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default category layout'),\n 'desc' => $this->l('Will add or remove columns from category page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_CAT_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default author layout'),\n 'desc' => $this->l('Will add or remove columns from author page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_AUTHOR_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default tag layout'),\n 'desc' => $this->l('Will add or remove columns from tag page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_TAG_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('WordPress XML import settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Default post state on XML import'),\n 'desc' => $this->l('Will set default post state on XML import'),\n 'hint' => $this->l('Please select default post state on XML file import'),\n 'required' => true,\n 'name' => 'EVERBLOG_IMPORT_POST_STATE',\n 'options' => array(\n 'query' => $post_status,\n 'id' => 'id_status',\n 'name' => 'name',\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress authors from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress authors'),\n 'hint' => $this->l('Else no authors will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_AUTHORS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress categories from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress categories'),\n 'hint' => $this->l('Else no categories will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_CATS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress tags from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress tags'),\n 'hint' => $this->l('Else no tags will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_TAGS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress authors from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress authors'),\n 'hint' => $this->l('Else no authors will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_AUTHORS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress categories from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress categories'),\n 'hint' => $this->l('Else no categories will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_CATS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress tags from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress tags'),\n 'hint' => $this->l('Else no tags will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_TAGS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'file',\n 'label' => $this->l('Import WordPress XML file'),\n 'desc' => $this->l('Import WordPress XML posts file'),\n 'hint' => $this->l('Will import posts from WordPress XML file'),\n 'name' => 'wordpress_xml',\n 'required' => false\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save and import'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Design settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Custom CSS file'),\n 'desc' => $this->l('You can change here default CSS file'),\n 'hint' => $this->l('By changing CSS file, you will change blog colors'),\n 'required' => true,\n 'name' => 'EVERBLOG_CSS_FILE',\n 'options' => array(\n 'query' => $css_files,\n 'id' => 'id_file',\n 'name' => 'name',\n ),\n 'lang' => false,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Custom CSS for blog'),\n 'desc' => $this->l('Add here your custom CSS rules'),\n 'hint' => $this->l('Webdesigners here can manage CSS rules for blog'),\n 'name' => 'EVERBLOG_CSS',\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n return $form_fields;\n }",
"function loadFromForm() \r\n {\t \t\r\n\t parent::loadFromForm();\r\n\t \r\n// \t $this->formName = $_REQUEST['form_name']; \t \r\n// \t \r\n// // \t echo 'Inside load_from_form of main page: <pre>'.print_r($this->formValues,true).'</pre><br>';\t \r\n// \t \r\n// \t\tswitch($this->formName) {\r\n// \t\t\t\r\n// \t\t\tcase 'basicStaffForm':\r\n// \t\t\t\t \r\n// \t\t\t\t$this->active_subPage = $this->basic_form;\t\r\n// \t\t\t\tbreak;\r\n// \t\t\tcase 'scheduledActivityForm':\r\n\r\n// \t\t\t\t$this->active_subPage = $this->optional_sheduled_activity_form;\t \r\n// \t\t\t\tbreak;\t\t\t\r\n// \t\t\tdefault:\r\n// \t\t\t\tdie('VALID FORM NAME **NOT** FOUND; name = '.$this->formName);\r\n// \t\t} \r\n// \t\t$this->active_subPage->loadFromForm(); \r\n// \t\t$this->form_submitted = true; \r\n \r\n }",
"function createPluginConfig()\n {\n $form = $this->Form();\n $parent = $this->Forms()->findOneBy(array('name' => 'Interface'));\n $form->setParent($parent);\n\n $form->setElement('checkbox', 'fontawesome_add', array(\n 'label' => 'Fontawesome Icons über CDN einbinden?',\n 'value' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n 'description' => 'Wenn aktiviert wird die Fontawesome Iconbibliothek welche für die Socialmedia Icons benötigt wird im header eingebunden'\n ));\n\n $form->setElement('checkbox', 'social_footer', array(\n 'label' => 'Socialmedia Icons im Footer einbinden?',\n 'value' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n 'description' => 'Erzeugt einen Socialmedia Block unter dem Newsletter Bereich im Footer. Es werden Icons für alle Socialmedia kanäle erzeugt, für die eine URL hinterlegt ist.'\n ));\n\n $form->setElement('text', 'base_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Social Media Icon Grundfarbe',\n 'value' => '@brand-secondary',\n 'description' => 'Social Media Icon Grundfarbe'\n ));\n\n $form->setElement('text', 'fb_url', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Facebook URL',\n 'value' => '#',\n 'description' => 'Facebook URL'\n ));\n\n $form->setElement('text', 'fb_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Facebook Farbe Hover',\n 'value' => '#3b5998',\n 'description' => 'Facebook Farbe Hover'\n ));\n\n $form->setElement('text', 'tw_url', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Twitter URL',\n 'value' => '#',\n 'description' => 'Twitter URL'\n ));\n\n $form->setElement('text', 'tw_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Twitter Farbe Hover',\n 'value' => '#00aced',\n 'description' => 'Twitter Farbe Hover'\n ));\n\n $form->setElement('text', 'gp_url', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'GooglePlus URL',\n 'value' => '#',\n 'description' => 'GooglePlus URL'\n ));\n\n $form->setElement('text', 'gp_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'GooglePlus Farbe Hover',\n 'value' => '#dd4b39',\n 'description' => 'GooglePlus Farbe Hover'\n ));\n\n $form->setElement('text', 'yt_url', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'YouTube URL',\n 'value' => '#',\n 'description' => 'YouTube URL'\n ));\n\n $form->setElement('text', 'yt_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Youtube Farbe Hover',\n 'value' => '#bb0000',\n 'description' => 'Youtube Farbe Hover'\n ));\n }",
"public function main($content, $setup) {\n\t\t$this->pi_USER_INT_obj = 1;\n\t\t$this->componentManager = GeneralUtility::makeInstance(\\Typoheads\\Formhandler\\Component\\Manager::class);\n\t\t$this->globals = GeneralUtility::makeInstance(\\Typoheads\\Formhandler\\Utility\\Globals::class);\n\t\t$this->utilityFuncs = GeneralUtility::makeInstance(\\Typoheads\\Formhandler\\Utility\\GeneralUtility::class);\n\t\ttry {\n\n\t\t\t//init flexform\n\t\t\t$this->pi_initPIflexForm();\n\n\t\t\t/*\n\t\t\t * Parse values from flexform:\n\t\t\t * - Template file\n\t\t\t * - Translation file\n\t\t\t * - Predefined form\n\t\t\t * - E-mail settings\n\t\t\t * - Required fields\n\t\t\t * - Redirect page\n\t\t\t */\n\t\t\t$templateFile = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'template_file', 'sDEF');\n\t\t\t$langFile = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'lang_file', 'sDEF');\n\t\t\t$predef = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'predefined', 'sDEF');\n\n\t\t\t$this->globals->setCObj($this->cObj);\n\t\t\t$this->globals->getCObj()->setCurrentVal($predef);\n\t\t\tif($setup['usePredef']) {\n\t\t\t\t$predef = $this->utilityFuncs->getSingle($setup, 'usePredef');\n\t\t\t}\n\n\t\t\t$this->globals->setPredef($predef);\n\t\t\t$this->globals->setOverrideSettings($setup);\n\n\t\t\t/*\n\t\t\t * set controller:\n\t\t\t * 1. Default controller\n\t\t\t * 2. TypoScript\n\t\t\t */\n\t\t\t$controller = '\\Typoheads\\Formhandler\\Controller\\Form';\n\t\t\tif ($setup['controller']) {\n\t\t\t\t$controller = $setup['controller'];\n\t\t\t}\n\t\t\t$controller = $this->componentManager->getComponent($controller);\n\n\t\t\tif (isset($content)) {\n\t\t\t\t$controller->setContent($this->componentManager->getComponent($this->utilityFuncs->prepareClassName('Typoheads\\Formhandler\\Controller\\Content'), $content));\n\t\t\t}\n\t\t\tif (strlen($templateFile) > 0) {\n\t\t\t\t$controller->setTemplateFile($templateFile);\n\t\t\t}\n\t\t\tif (strlen($langFile) > 0) {\n\t\t\t\t$controller->setLangFiles(array($langFile));\n\t\t\t}\n\t\t\tif (strlen($predef) > 0) {\n\t\t\t\t$controller->setPredefined($predef);\n\t\t\t}\n\n\t\t\t$result = $controller->process();\n\t\t} catch(Exception $e) {\n\t\t\t\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::sysLog(\n\t\t\t\t$e->getFile() . '(' . $e->getLine() . ')' . ' ' . $e->getMessage(),\n\t\t\t\t'formhandler',\n\t\t\t\t\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::SYSLOG_SEVERITY_ERROR\n\t\t\t);\n\t\t\t$result = $this->utilityFuncs->getTranslatedMessage($this->globals->getLangFiles(), 'fe-exception');\n\t\t\tif(!$result) {\n\t\t\t\t$result = '<div style=\"color:red; font-weight: bold\">' . $this->utilityFuncs->getExceptionMessage('fe-exception') . '</div>';\n\t\t\t}\n\t\t\tif ($this->globals->getSession() && $this->globals->getSession()->get('debug')) {\n\t\t\t\t$result = '<div style=\"color:red; font-weight: bold\">' . $e->getMessage() . '</div>';\n\t\t\t\t$result .= '<div style=\"color:red; font-weight: bold\">File: ' . $e->getFile() . '(' . $e->getLine() . ')</div>';\n\t\t\t\t$result .= '<div style=\"color:red; font-weight: bold\">' . $e->getTraceAsString() . '</div>';\n\t\t\t}\n\t\t}\n\t\tif ($this->globals->getSession() && $this->globals->getSession()->get('debug')) {\n\t\t\t$debuggers = $this->globals->getDebuggers();\n\t\t\tforeach($debuggers as $idx => $debugger) {\n\t\t\t\t$debugger->outputDebugLog();\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"public function config()\n\t{\n\t\tparent::config();\n\n\t\t// change inpu\n\t\tif(self::done_step('username'))\n\t\t{\n\t\t\t// if user go to this page from username page\n\t\t\t$this->data->mobile_username = 'eusername';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if user go to this page from mobile page\n\t\t\t$this->data->mobile_username = 'emobile';\n\t\t}\n\n\t\t// load temp username in username field\n\t\tif(self::get_session('username', 'temp_username'))\n\t\t{\n\t\t\t$this->data->get_username = self::get_session('username', 'temp_username');\n\t\t}\n\n\t\t$this->data->page['title'] = T_('Password');\n\t\t$this->data->page['desc'] = T_('Please enter password to enter');\n\n\t\tswitch (\\lib\\router::get_url(1))\n\t\t{\n\t\t\tcase 'recovery':\n\t\t\t\t$this->data->page['title'] = T_('Recovery Password');\n\t\t\t\t$this->data->page['desc'] = T_('If forget your password, Please enter new password. after pass verification your new password is usable.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'signup':\n\t\t\tcase 'set':\n\t\t\t\t$this->data->page['title'] = T_('Set Password');\n\t\t\t\t$this->data->page['desc'] = T_('Please set your password to secure signup.'). ' '. T_('Next time we only need your mobile and this password to enter');\n\t\t\t\tbreak;\n\n\t\t\tcase 'change':\n\t\t\t\t$this->data->page['title'] = T_('Change to new Password');\n\t\t\t\t$this->data->page['desc'] = T_('Please set your old and new password to change it');\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function initSettingsPage()\n {\n // admin sections\n $this->_addSection('schemas', __('Schemas', 'my_seo_settings'));\n $this->_addSection('special', __('Thematic Schemas', 'my_seo_settings'));\n $this->_addSection('front_page', __('General Settings', 'my_seo_settings'));\n $this->_addSection('compatibility', __('Compatibility', 'my_seo_settings'));\n\n /*\n * Adds fields to default section\n */\n $this->_addSchemaTagLocation('generate_json_ld_fpwebpage_hook_short_code', __('Schema Tag Location', 'my_seo_settings'), 'front_page');\n $this->_addInputField('generate_json_ld_fpwebpage_name', __('Website Title', 'my_seo_settings'), 'front_page');\n\t\t$this->_addInputField('generate_json_ld_fpwebpage_inlanguage', __('Website Language', 'my_seo_settings'), 'front_page');\n // Schemas\n $this->_addCheckboxField('generate_json_ld_fpwebpage', __('WebPage Schema for Home Page', 'my_seo_settings'), 'schemas');\n $this->_addCheckboxField('generate_json_ld_webpage', __('WebPage Schema for Pages', 'my_seo_settings'), 'schemas');\n $this->_addCheckboxField('generate_json_ld_posts', __('WebPage Schema for Posts', 'my_seo_settings'), 'schemas');\n $this->_addMenuDropbox('generate_json_ld_fpwebpage_menu', __('WPHeader Schema', 'my_seo_settings'), 'schemas');\n $this->_addMenuDropbox('generate_json_ld_fpwebpage_fmenu', __('WPFooter Schema', 'my_seo_settings'), 'schemas');\n\t\t$this->_addInputField('generate_json_ld_logo_url', __( 'Logo URL', 'my_seo_settings'), 'schemas');\n\n // Special\n $recipeHint = 'On individual post editing page Recipe specific fields will appear. When filled in they would show up in a Recipe schema on the page.';\n $faqHint = 'FAQ questions and answers are being added manually. go to the each page/post editor you would like to add - this schema must be enabled to take effect';\n\n $this->_addCheckboxField('generate_json_ld_recipe', __('Recipe Schema', 'my_seo_settings'), 'special', $recipeHint);\n $this->_addCheckboxField('generate_json_ld_faq', __('FAQ Schema', 'my_seo_settings'), 'special', $faqHint);\n $this->_addCustomField('generate_json_ld_person_schema', __('Person Schema', 'my_seo_settings'), [$this, '_renderPersonSchemaField'], 'special');\n $this->_addCustomField('generate_json_ld_product_schema', __('Product Schema', 'my_seo_settings'), [$this, '_renderProductSchemaField'], 'special');\n $this->_addCustomField('generate_json_ld_contact_page_schema', __('Contact Page Schema', 'my_seo_settings'), [$this, '_renderContactPageSchemaField'], 'special');\n $this->_addCustomField('generate_json_ld_about_page_schema', __('About Page Schema', 'my_seo_settings'), [$this, '_renderAboutPageSchemaField'], 'special');\n\t\t$this->_addCheckboxField('search_bar', __('Search Bar - Does the website have a search bar?', 'my_seo_settings'), 'compatibility');\n\t\t$this->_addCheckboxField('generate_json_ld_author', __( 'Author Schema', 'my_seo_settings'), [$this, '_renderAuthorPageSchemaField'], 'special' );\n $this->_addCheckboxField('yoast_disable', __('Yoast schema Off', 'my_seo_settings'), 'compatibility');\n }",
"public function loadConfigForm(sfEvent $event)\n {\n $form = $event->getSubject();\n $form->addSetting('content_list', 'rows_per_page', 'Rows Per Page');\n }",
"private function _initArticleSettingsForm()\n\t{\n\t\t// instantiate the article form\n\t\t$this->_articleSettingsForm = new Settings_Form(Settings_Form::DB_ADAPTER);\n\n\t\t$config_vars = array(\n\t\t\tarray('check', 'sp_articles_index'),\n\t\t\tarray('int', 'sp_articles_index_per_page'),\n\t\t\tarray('int', 'sp_articles_index_total'),\n\t\t\tarray('int', 'sp_articles_length'),\n\t\t\t'',\n\t\t\tarray('int', 'sp_articles_per_page'),\n\t\t\tarray('int', 'sp_articles_comments_per_page'),\n\t\t\t'',\n\t\t\tarray('text', 'sp_articles_attachment_dir')\n\t\t);\n\n\t\t$this->_articleSettingsForm->setConfigVars($config_vars);\n\t}",
"public function setViewConfigurationFilesFromTypoScriptConfiguration()\r\n {\r\n // Sets the template root path with the default\r\n $this->templateRootPath = $this->defaultTemplateRootPath;\r\n $this->getController()\r\n ->getPageTypoScriptConfigurationManager()\r\n ->setViewConfigurationFilesFromPageTypoScriptConfiguration();\r\n $this->getController()\r\n ->getExtensionConfigurationManager()\r\n ->setViewConfigurationFilesFromTypoScriptConfiguration();\r\n $this->getController()\r\n ->getLibraryConfigurationManager()\r\n ->setViewConfigurationFilesFromTypoScriptConfiguration();\r\n }",
"public function config()\n {\n $errors = [];\n $values = [];\n\n if ($this->request->isPost()) {\n $values = $this->request->getValues();\n\n $validation_errors = $this->validateValues($values);\n\n if (!$validation_errors) {\n $values['human_name'] = $this->fixHumanName($values['human_name']); \n $machine_name = $this->createMachineName($values['human_name']);\n $beauty_name = $this->beautyName($values['human_name']);\n $values['machine_name'] = $machine_name;\n $values['beauty_name'] = $beauty_name;\n $type_id = $this->db->table(MetadataTypeModel::TABLE)->persist($values);\n if ($type_id) {\n $this->flash->success(t('Metadata type created successfully.'));\n } else {\n $this->flash->failure(t('Error saving the metadata type. Retry.'));\n }\n } else {\n $errors = $validation_errors;\n $this->flash->failure(t('There are errors in your submission.'));\n }\n }\n\n $metadataTypes = $this->metadataTypeModel->getAll();\n\n $this->response->html($this->helper->layout->config('MetaMagik:config/metadata_types', [\n 'values' => $values,\n 'errors' => $errors,\n 'types' => $metadataTypes,\n 'title' => t('Settings').' > '.t('Custom Fields'),\n ]));\n }",
"public function setUp()\n\t{\n\t\t\\Session::$instance = null;\n\n\t\t// load the session.\n\t\t\\Session::load();\n\n\t\t\\Config::set('orchestra::support.form.fieldset', array(\n\t\t\t'select' => array(),\n\t\t\t'textarea' => array(),\n\t\t\t'input' => array(),\n\t\t\t'file' => array(),\n\t\t\t'password' => array(),\n\t\t\t'radio' => array(),\n\t\t));\n\t}",
"public function init() {\n\n\t\t// WPForms Pro is required.\n\t\tif ( ! \\class_exists( 'WPForms_Pro', false ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load translated strings.\n\t\t\\load_plugin_textdomain( 'wpforms-conversational-forms', false, \\dirname( \\plugin_basename( WPFORMS_CONVERSATIONAL_FORMS_FILE ) ) . '/languages/' );\n\n\t\tif ( \\wpforms_is_admin_page( 'builder' ) ) {\n\t\t\tnew Admin\\Builder();\n\t\t}\n\n\t\tif ( \\wpforms_is_admin_page( 'overview' ) ) {\n\t\t\tnew Admin\\Overview();\n\t\t}\n\n\t\tif ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n\t\t\tnew Admin\\Ajax();\n\t\t}\n\n\t\tif ( ! \\is_admin() ) {\n\t\t\tnew Frontend();\n\t\t}\n\n\t\t// Register the updater of this plugin.\n\t\t$this->updater();\n\t}",
"public function setupForm()\n {\n\n// if ($this->config['db_name'] != NO_DATABASE)\n // $this->redirect(\"login.php\");\n // login here?\n \n/* if ( !$this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n*/\n require_once('views/SetupView.class.php'); \n \n $site = new SiteContainer($this->db);\n \n $sv = new SetupView();\n\n $site->printHeader();\n $site->printNav(\"owner\");\n $sv->printHtml();\n $site->printFooter(); \n }",
"protected function loadForm()\n {\n $form = $this->createForm();\n\n $bridge = $this->model->getBridgeFor('form', $form);\n\n $this->addFormElements($bridge, $this->model);\n\n $this->form = $bridge->getForm();\n }",
"protected function _init() {\n\n\t\t$options = new SBTT_Options();\n\t\t$this->addOptionsPage(\n\t\t\t__( 'Scroll Back to Top Settings', $this->textDomain() ),\n\t\t\t__( 'Scroll Back to Top', $this->textDomain() ),\n\t\t\t$options\n\t\t);\n\t}",
"function init_form_fields() {\n\t\t\t\n\t\t\t$abs_path = str_replace('/wp-admin', '', getcwd());\n\t\t\n\t\t\t$this->form_fields = array(\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Activer/Désactiver:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'checkbox', \n\t\t\t\t\t\t\t\t'label' => __( 'Activer le module de paiement Atos.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => 'yes'\n\t\t\t\t\t\t\t), \n\t\t\t\t'title' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Nom:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Intitulé affiché à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __( 'Paiement sécurisé par carte bancaire', 'woothemes' )\n\t\t\t\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Description:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Description affichée à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Payez en toute sécurité grâce à notre système de paiement Atos.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'merchant_id' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Identifiant commerçant:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Identifiant commerçant fourni par votre banque. Ex: 014295303911112', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('014295303911112', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'pathfile' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier pathfile:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier de configuration \"pathfile\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/param/pathfile', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'request_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier request:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"request\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/request', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'response_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier response:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"response\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/response', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'payment_means' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Cartes acceptées:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Moyens de paiement acceptés. Ex pour CB, Visa et Mastercard: CB,2,VISA,2,MASTERCARD,2', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('CB,2,VISA,2,MASTERCARD,2', 'woothemes')\n\t\t\t\t\t\t\t),\n\n\t\t\t\t'currency_code' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Devise:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'select', \n\t\t\t\t\t\t\t\t'description' => __( 'Veuillez sélectionner une devise pour les paiemenents.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => '978',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'840' => 'USD',\n\t\t\t\t\t\t\t\t\t'978' => 'EUR',\n\t\t\t\t\t\t\t\t\t'124' => 'CAD',\n\t\t\t\t\t\t\t\t\t'392' => 'JPY',\n\t\t\t\t\t\t\t\t\t'826' => 'GBP',\n\t\t\t\t\t\t\t\t\t'036' => 'AUD' \n\t\t\t\t\t\t\t\t ) \t\t\t\t\t\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\n\t\t\t\t'paybtn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton qui redirige vers le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Régler la commande.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'paymsg' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Message page de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Message affiché sur la page de commande validée, avant passage sur le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Merci pour votre commande. Veuillez cliquer sur le bouton ci-dessous pour effectuer le règlement.', 'woothemes')\n\t\t\t\t\t\t\t)\n\t\t\t\t/*'payreturn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton retour:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton de retour ver la boutique.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Retour', 'woothemes')\n\t\t\t\t\t\t\t)*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t);\n\t\t\n\t\t}",
"public function setup_wizard() {\n\t\t\tif ( empty( $_GET['page'] ) || $this->page_slug !== $_GET['page'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tob_end_clean();\n\n\t\t\t$this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) );\n\n\t\t\twp_register_script( 'jquery-blockui', $this->plugin_url . 'js/jquery.blockUI.js', array( 'jquery' ), '2.70', true );\n\t\t\twp_register_script( 'envato-setup', $this->plugin_url . 'js/envato-setup.js', array(\n\t\t\t\t'jquery',\n\t\t\t\t'jquery-blockui',\n\t\t\t), $this->version );\n\t\t\twp_localize_script( 'envato-setup', 'envato_setup_params', array(\n\t\t\t\t'tgm_plugin_nonce' => array(\n\t\t\t\t\t'update' => wp_create_nonce( 'tgmpa-update' ),\n\t\t\t\t\t'install' => wp_create_nonce( 'tgmpa-install' ),\n\t\t\t\t),\n\t\t\t\t'tgm_bulk_url' => admin_url( $this->tgmpa_url ),\n\t\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' ),\n\t\t\t\t'wpnonce' => wp_create_nonce( 'envato_setup_nonce' ),\n\t\t\t\t'verify_text' => esc_html__( '...verifying', 'dfd-native' ),\n\t\t\t) );\n\n\t\t\t//wp_enqueue_style( 'envato_wizard_admin_styles', $this->plugin_url . '/css/admin.css', array(), $this->version );\n\t\t\twp_enqueue_style( 'envato-setup', $this->plugin_url . 'css/envato-setup.css', array(\n\t\t\t\t'wp-admin',\n\t\t\t\t'dashicons',\n\t\t\t\t'install',\n\t\t\t), $this->version );\n\n\t\t\t//enqueue style for admin notices\n\t\t\twp_enqueue_style( 'wp-admin' );\n\n\t\t\twp_enqueue_media();\n\t\t\twp_enqueue_script( 'media' );\n\n\t\t\tob_start();\n\t\t\t$this->setup_wizard_header();\n\t\t\t$this->setup_wizard_steps();\n\t\t\t$show_content = true;\n\t\t\techo '<div class=\"envato-setup-content\">';\n\t\t\techo '<span class=\"shadow shadow-first\"></span>';\n\t\t\techo '<span class=\"shadow shadow-second\"></span>';\n\t\t\tif ( ! empty( $_REQUEST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) {\n\t\t\t\t$show_content = call_user_func( $this->steps[ $this->step ]['handler'] );\n\t\t\t}\n\t\t\tif ( $show_content ) {\n\t\t\t\t$this->setup_wizard_content();\n\t\t\t}\n\t\t\techo '</div>';\n\t\t\t$this->setup_wizard_footer();\n\t\t\texit;\n\t\t}",
"function ywig_create_settings_page_cb() {\n\trequire_once get_template_directory() . '/inc/templates/ywig-site-settings.php';\n}",
"protected function initTSFE() {\n\t\tif (!is_object($GLOBALS['TSFE'])) {\n\t\t\t$GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], 0, 0, TRUE);\n\t\t\t$GLOBALS['TSFE']->initFEuser();\n\t\t\t$GLOBALS['TSFE']->fetch_the_id();\n\t\t\t$GLOBALS['TSFE']->getPageAndRootline();\n\t\t\t$GLOBALS['TSFE']->initTemplate();\n\t\t\t$GLOBALS['TSFE']->forceTemplateParsing = 1;\n\t\t\t$GLOBALS['TSFE']->getConfigArray();\n\t\t\t$GLOBALS['TSFE']->includeTCA();\n\t\t\t$GLOBALS['TSFE']->newCObj();\n\t\t}\n\t}",
"function load_config($conf) {\n $this->conf = $conf; // Store configuration\n\n $this->pi_setPiVarDefaults(); // Set default piVars from TS\n $this->pi_initPIflexForm(); // Init FlexForm configuration for plugin\n\n // Read extension configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);\n\n if (is_array($extConf)) {\n $conf = t3lib_div::array_merge($extConf, $conf);\n\n }\n\n // Read TYPO3_CONF_VARS configuration\n $varsConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey];\n\n if (is_array($varsConf)) {\n\n $conf = t3lib_div::array_merge($varsConf, $conf);\n\n }\n\n // Read FlexForm configuration\n if ($this->cObj->data['pi_flexform']['data']) {\n\n foreach ($this->cObj->data['pi_flexform']['data'] as $sheetName => $sheet) {\n\n foreach ($sheet as $langName => $lang) {\n foreach(array_keys($lang) as $key) {\n\n $flexFormConf[$key] = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], \n $key, $sheetName, $langName);\n\n if (!$flexFormConf[$key]) {\n unset($flexFormConf[$key]);\n\n }\n }\n }\n }\n }\n\n if (is_array($flexFormConf)) {\n\n $conf = t3lib_div::array_merge($conf, $flexFormConf);\n }\n\n $this->conf = $conf;\n\n }",
"public function initGeneralSettingsForm()\n\t{\n\t\tglobal $lng, $ilUser, $styleDefinition, $ilSetting;\n\t\t\n\t\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\n\t\t// language\n\t\tif ($this->userSettingVisible(\"language\"))\n\t\t{\n\t\t\t$languages = $this->lng->getInstalledLanguages();\n\t\t\t$options = array();\n\t\t\tforeach($languages as $lang_key)\n\t\t\t{\n\t\t\t\t$options[$lang_key] = ilLanguage::_lookupEntry($lang_key,\"meta\", \"meta_l_\".$lang_key);\n\t\t\t}\n\t\t\t\n\t\t\t$si = new ilSelectInputGUI($this->lng->txt(\"language\"), \"language\");\n\t\t\t$si->setOptions($options);\n\t\t\t$si->setValue($ilUser->getLanguage());\n\t\t\t$si->setDisabled($ilSetting->get(\"usr_settings_disable_language\"));\n\t\t\t$this->form->addItem($si);\n\t\t}\n\n\t\t// skin/style\n\t\tinclude_once(\"./Services/Style/classes/class.ilObjStyleSettings.php\");\n\t\tif ($this->userSettingVisible(\"skin_style\"))\n\t\t{\n\t\t\t$templates = $styleDefinition->getAllTemplates();\n\t\t\tif (is_array($templates))\n\t\t\t{ \n\t\t\t\t$si = new ilSelectInputGUI($this->lng->txt(\"skin_style\"), \"skin_style\");\n\t\t\t\t\n\t\t\t\t$options = array();\n\t\t\t\tforeach($templates as $template)\n\t\t\t\t{\n\t\t\t\t\t// get styles information of template\n\t\t\t\t\t$styleDef = new ilStyleDefinition($template[\"id\"]);\n\t\t\t\t\t$styleDef->startParsing();\n\t\t\t\t\t$styles = $styleDef->getStyles();\n\n\t\t\t\t\tforeach($styles as $style)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!ilObjStyleSettings::_lookupActivatedStyle($template[\"id\"],$style[\"id\"]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$options[$template[\"id\"].\":\".$style[\"id\"]] =\n\t\t\t\t\t\t\t$styleDef->getTemplateName().\" / \".$style[\"name\"];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$si->setOptions($options);\n\t\t\t\t$si->setValue($ilUser->skin.\":\".$ilUser->prefs[\"style\"]);\n\t\t\t\t$si->setDisabled($ilSetting->get(\"usr_settings_disable_skin_style\"));\n\t\t\t\t$this->form->addItem($si);\n\t\t\t}\n\t\t}\n\n\t\t// screen reader optimization\n\t\tif ($this->userSettingVisible(\"screen_reader_optimization\"))\n\t\t{ \n\t\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"user_screen_reader_optimization\"), \"screen_reader_optimization\");\n\t\t\t$cb->setChecked($ilUser->prefs[\"screen_reader_optimization\"]);\n\t\t\t$cb->setDisabled($ilSetting->get(\"usr_settings_disable_screen_reader_optimization\"));\n\t\t\t$cb->setInfo($this->lng->txt(\"user_screen_reader_optimization_info\"));\n\t\t\t$this->form->addItem($cb);\n\t\t}\n\n\t\t// hits per page\n\t\tif ($this->userSettingVisible(\"hits_per_page\"))\n\t\t{\n\t\t\t$si = new ilSelectInputGUI($this->lng->txt(\"hits_per_page\"), \"hits_per_page\");\n\t\t\t\n\t\t\t$hits_options = array(10,15,20,30,40,50,100,9999);\n\t\t\t$options = array();\n\n\t\t\tforeach($hits_options as $hits_option)\n\t\t\t{\n\t\t\t\t$hstr = ($hits_option == 9999)\n\t\t\t\t\t? $this->lng->txt(\"no_limit\")\n\t\t\t\t\t: $hits_option;\n\t\t\t\t$options[$hits_option] = $hstr;\n\t\t\t}\n\t\t\t$si->setOptions($options);\n\t\t\t$si->setValue($ilUser->prefs[\"hits_per_page\"]);\n\t\t\t$si->setDisabled($ilSetting->get(\"usr_settings_disable_hits_per_page\"));\n\t\t\t$this->form->addItem($si);\n\t\t}\n\n\t\t// Users Online\n\t\tif ($this->userSettingVisible(\"show_users_online\"))\n\t\t{\n\t\t\t$si = new ilSelectInputGUI($this->lng->txt(\"show_users_online\"), \"show_users_online\");\n\t\t\t\n\t\t\t$options = array(\n\t\t\t\t\"y\" => $this->lng->txt(\"users_online_show_y\"),\n\t\t\t\t\"associated\" => $this->lng->txt(\"users_online_show_associated\"),\n\t\t\t\t\"n\" => $this->lng->txt(\"users_online_show_n\"));\n\t\t\t$si->setOptions($options);\n\t\t\t$si->setValue($ilUser->prefs[\"show_users_online\"]);\n\t\t\t$si->setDisabled($ilSetting->get(\"usr_settings_disable_show_users_online\"));\n\t\t\t$this->form->addItem($si);\n\t\t}\n\n\t\t// Store last visited\n\t\t$lv = new ilSelectInputGUI($this->lng->txt(\"user_store_last_visited\"), \"store_last_visited\");\n\t\t$options = array(\n\t\t\t0 => $this->lng->txt(\"user_lv_keep_entries\"),\n\t\t\t1 => $this->lng->txt(\"user_lv_keep_only_for_session\"),\n\t\t\t2 => $this->lng->txt(\"user_lv_do_not_store\"));\n\t\t$lv->setOptions($options);\n\t\t$lv->setValue((int) $ilUser->prefs[\"store_last_visited\"]);\n\t\t$this->form->addItem($lv);\n\n\t\t// hide_own_online_status\n\t\tif ($this->userSettingVisible(\"hide_own_online_status\"))\n\t\t{ \n\t\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"hide_own_online_status\"), \"hide_own_online_status\");\n\t\t\t$cb->setChecked($ilUser->prefs[\"hide_own_online_status\"] == \"y\");\n\t\t\t$cb->setDisabled($ilSetting->get(\"usr_settings_disable_hide_own_online_status\"));\n\t\t\t$this->form->addItem($cb);\n\t\t}\n\t\t\n\t\tinclude_once 'Services/Authentication/classes/class.ilSessionReminder.php';\n\t\tif(ilSessionReminder::isGloballyActivated())\n\t\t{\n\t\t\t$cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');\n\t\t\t$cb->setInfo($this->lng->txt('session_reminder_info'));\n\t\t\t$cb->setValue(1);\n\t\t\t$cb->setChecked((int)$ilUser->getPref('session_reminder_enabled'));\n\n\t\t\t$expires = ilSession::getSessionExpireValue();\n\t\t\t$lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');\n\t\t\t$lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true)));\n\n\t\t\t$min_value = ilSessionReminder::MIN_LEAD_TIME;\n\t\t\t$max_value = max($min_value, ((int)$expires / 60) - 1);\n\n\t\t\t$current_user_value = $ilUser->getPref('session_reminder_lead_time');\n\t\t\tif($current_user_value < $min_value ||\n\t\t\t $current_user_value > $max_value)\n\t\t\t{\n\t\t\t\t$current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME;\n\t\t\t}\n\t\t\t$value = min(\n\t\t\t\tmax(\n\t\t\t\t\t$min_value, $current_user_value\n\t\t\t\t),\n\t\t\t\t$max_value\n\t\t\t);\n\n\t\t\t$lead_time_gui->setValue($value);\n\t\t\t$lead_time_gui->setSize(3);\n\t\t\t$lead_time_gui->setMinValue($min_value);\n\t\t\t$lead_time_gui->setMaxValue($max_value);\n\t\t\t$cb->addSubItem($lead_time_gui);\n\n\t\t\t$this->form->addItem($cb);\n\t\t}\n\n\t\t// calendar settings (copied here to be reachable when calendar is inactive)\n\t\t// they cannot be hidden/deactivated\n\n\t\tinclude_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');\n\t\tinclude_once('Services/Calendar/classes/class.ilCalendarUtil.php');\n\t\t$lng->loadLanguageModule(\"dateplaner\");\n\t\t$user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());\n\n\t\t$select = new ilSelectInputGUI($lng->txt('cal_user_timezone'),'timezone');\n\t\t$select->setOptions(ilCalendarUtil::_getShortTimeZoneList());\n\t\t$select->setInfo($lng->txt('cal_timezone_info'));\n\t\t$select->setValue($user_settings->getTimeZone());\n\t\t$this->form->addItem($select);\n\n\t\t$year = date(\"Y\");\n\t\t$select = new ilSelectInputGUI($lng->txt('cal_user_date_format'),'date_format');\n\t\t$select->setOptions(array(\n\t\t\tilCalendarSettings::DATE_FORMAT_DMY => '31.10.'.$year,\n\t\t\tilCalendarSettings::DATE_FORMAT_YMD => $year.\"-10-31\",\n\t\t\tilCalendarSettings::DATE_FORMAT_MDY => \"10/31/\".$year));\n\t\t$select->setInfo($lng->txt('cal_date_format_info'));\n\t\t$select->setValue($user_settings->getDateFormat());\n\t\t$this->form->addItem($select);\n\n\t\t$select = new ilSelectInputGUI($lng->txt('cal_user_time_format'),'time_format');\n\t\t$select->setOptions(array(\n\t\t\tilCalendarSettings::TIME_FORMAT_24 => '13:00',\n\t\t\tilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));\n\t\t$select->setInfo($lng->txt('cal_time_format_info'));\n\t $select->setValue($user_settings->getTimeFormat());\n\t\t$this->form->addItem($select);\n\t\t\n\t\t\n\t\t// starting point\t\n\t\tinclude_once \"Services/User/classes/class.ilUserUtil.php\";\n\t\tif(ilUserUtil::hasPersonalStartingPoint())\n\t\t{\n\t\t\t$this->lng->loadLanguageModule(\"administration\");\n\t\t\t$si = new ilRadioGroupInputGUI($this->lng->txt(\"adm_user_starting_point\"), \"usr_start\");\n\t\t\t$si->setRequired(true);\n\t\t\t$si->setInfo($this->lng->txt(\"adm_user_starting_point_info\"));\n\t\t\t$def_opt = new ilRadioOption($this->lng->txt(\"adm_user_starting_point_inherit\"), 0);\n\t\t\t$def_opt->setInfo($this->lng->txt(\"adm_user_starting_point_inherit_info\"));\n\t\t\t$si->addOption($def_opt);\n\t\t\tforeach(ilUserUtil::getPossibleStartingPoints() as $value => $caption)\n\t\t\t{\n\t\t\t\t$si->addOption(new ilRadioOption($caption, $value));\n\t\t\t}\n\t\t\t$si->setValue(ilUserUtil::hasPersonalStartPointPref()\n\t\t\t\t? ilUserUtil::getPersonalStartingPoint()\n\t\t\t\t: 0);\n\t\t\t$this->form->addItem($si);\n\t\t\t\t\t\t\n\t\t\t// starting point: repository object\n\t\t\t$repobj = new ilRadioOption($lng->txt(\"adm_user_starting_point_object\"), ilUserUtil::START_REPOSITORY_OBJ);\n\t\t\t$repobj_id = new ilTextInputGUI($lng->txt(\"adm_user_starting_point_ref_id\"), \"usr_start_ref_id\");\n\t\t\t$repobj_id->setRequired(true);\n\t\t\t$repobj_id->setSize(5);\n\t\t\tif($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ)\n\t\t\t{\n\t\t\t\t$start_ref_id = ilUserUtil::getPersonalStartingObject();\n\t\t\t\t$repobj_id->setValue($start_ref_id);\n\t\t\t\tif($start_ref_id)\n\t\t\t\t{\n\t\t\t\t\t$start_obj_id = ilObject::_lookupObjId($start_ref_id);\n\t\t\t\t\tif($start_obj_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$repobj_id->setInfo($lng->txt(\"obj_\".ilObject::_lookupType($start_obj_id)).\n\t\t\t\t\t\t\t\": \".ilObject::_lookupTitle($start_obj_id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t$repobj->addSubItem($repobj_id);\n\t\t\t$si->addOption($repobj);\n\t\t}\t\t\n\t\t\n\t\t// selector for unicode characters\n\t\tglobal $ilSetting;\n\t\tif ($ilSetting->get('char_selector_availability') > 0)\n\t\t{\n\t\t\trequire_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';\n\t\t\t$char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_USER);\n\t\t\t$char_selector->getConfig()->setAvailability($ilUser->getPref('char_selector_availability'));\n\t\t\t$char_selector->getConfig()->setDefinition($ilUser->getPref('char_selector_definition'));\n\t\t\t$char_selector->addFormProperties($this->form);\n\t\t\t$char_selector->setFormValues($this->form);\n\t\t}\n\t\t\n\t\t$this->form->addCommandButton(\"saveGeneralSettings\", $lng->txt(\"save\"));\n\t\t$this->form->setTitle($lng->txt(\"general_settings\"));\n\t\t$this->form->setFormAction($this->ctrl->getFormAction($this));\n\t \n\t}",
"public function page_init() { \n\n\t\t\tif (!get_option('dls_settings_site_id')) {\n\t\t\t\tadd_option('dls_settings_site_id');\n\t\t\t}\n\n\t\t\tif (!get_option('dls_settings_enabled_post_types')) {\n\t\t\t\tadd_option('dls_settings_enabled_post_types');\n\t\t\t}\n\n\t\t\tif (!get_option('dls_settings_replace_host_list')) {\n\t\t\t\tadd_option('dls_settings_replace_host_list');\n }\n\n\t\t\tif (!get_option('dls_settings_auto_redirect_to_admin_page')) {\n\t\t\t\tadd_option('dls_settings_auto_redirect_to_admin_page');\n }\n\n\t\t\tif (!get_option('dls_overwrite_viewable_permalink')) {\n\t\t\t\tadd_option('dls_overwrite_viewable_permalink');\n }\n\n \t\t\tif (!get_option('dls_overwrite_viewable_permalink_host')) {\n\t\t\t\tadd_option('dls_overwrite_viewable_permalink_host');\n\t\t\t}\n \n register_setting( 'my_option_group', 'dls_settings_site_id', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_enabled_post_types', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_replace_host_list', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_auto_redirect_to_admin_page', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_overwrite_viewable_permalink', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_overwrite_viewable_permalink_host', array( $this, 'sanitize' ) );\n\n add_settings_section( 'settings_site_id', 'Site ID', array( $this, 'print_site_id' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Set the site id for this site', array( $this, 'site_id_callback'), 'my-setting-admin', 'settings_site_id' ); \n\n add_settings_section( 'setting_section_id', 'Post types settings', array( $this, 'print_post_types_info' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Select post types', array( $this, 'post_type_callback'), 'my-setting-admin', 'setting_section_id' ); \n\n add_settings_section( 'settings_replace_hosts', 'Hosts to replace', array( $this, 'print_replace_hosts_info' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'List of hosts', array( $this, 'replace_hosts_callback'), 'my-setting-admin', 'settings_replace_hosts' ); \n\n add_settings_section( 'settings_auto_redirect_to_admin', 'Auto redirect to admin page', array( $this, 'print_auto_redirect_to_admin' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Auto redirect to admin page', array( $this, 'auto_redirect_to_admin_callback'), 'my-setting-admin', 'settings_auto_redirect_to_admin' ); \n\n add_settings_section( 'settings_overwrite_viewable_permalink', 'Overwrite the viewable permalink', array( $this, 'print_overwrite_viewable_permalink' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Overwrite the viewable permalink', array( $this, 'overwrite_viewable_permalink_callback'), 'my-setting-admin', 'settings_overwrite_viewable_permalink' ); \n\t\t\tadd_settings_field( 'dls-settings-overwrite_viewable_permalink_host', 'Overwrite the viewable permalink host', array( $this, 'overwrite_viewable_permalink_host_callback'), 'my-setting-admin', 'settings_overwrite_viewable_permalink' ); \n\n\t\t}",
"public function setup()\n\t{\n\t\t$this->setupPage();\n\n\t\t$this->setupSubPages();\n\n\t\tadd_action('admin_enqueue_scripts', function($hook_suffix)\n\t\t{\n\t\t\t// first check that $hook_suffix is appropriate for your admin page\n\t\t\twp_enqueue_style('wp-color-picker');\n\t\t\twp_enqueue_script('color-settings', get_template_directory_uri() . '/assets/js/color-settings.js', ['wp-color-picker'], false, true);\n\t\t});\n\t}",
"private function before_login_form_generic() {\n\t\n\t\tstatic $already_included = false;\n\t\tif ($already_included) return;\n\t\t$already_included = true;\n\t\n\t\t$script_ver = (defined('WP_DEBUG') && WP_DEBUG) ? time() : $this->version;\n\t\twp_enqueue_script( 'tfa-wc-ajax-request', SIMBA_TFA_PLUGIN_URL.'/includes/wooextend.js', array('jquery'), $script_ver);\n\n\t\t$localize = array(\n\t\t\t'ajaxurl' => admin_url('admin-ajax.php'),\n\t\t\t'click_to_enter_otp' => __(\"Enter One Time Password (if you have one)\", 'two-factor-authentication'),\n\t\t\t'enter_username_first' => __('You have to enter a username first.', 'two-factor-authentication'),\n\t\t\t'otp' => __(\"One Time Password\", 'two-factor-authentication'),\n\t\t\t'nonce' => wp_create_nonce(\"simba_tfa_loginform_nonce\"),\n\t\t\t'otp_login_help' => __('(check your OTP app to get this password)', 'two-factor-authentication'),\n\t\t);\n\t\t// Spinner exists since WC 3.8. Use the proper functions to avoid SSL warnings.\n\t\tif (file_exists(ABSPATH.'wp-admin/images/spinner-2x.gif')) {\n\t\t\t$localize['spinnerimg'] = admin_url('images/spinner-2x.gif');\n\t\t} elseif (file_exists(ABSPATH.WPINC.'/images/spinner-2x.gif')) {\n\t\t\t$localize['spinnerimg'] = includes_url('images/spinner-2x.gif');\n\t\t}\n\n\t\twp_localize_script( 'tfa-wc-ajax-request', 'simbatfa_wc_settings', $localize);\n\t}",
"public function loadForm()\n\t{\n\t\tJForm::addFormPath(__DIR__ . '/forms');\n\t\t$this->form = JForm::getInstance('com_monitor.project', 'project');\n\n\t\tif ($data = $this->app->getUserState($this->form->getName() . '.data'))\n\t\t{\n\t\t\t$this->form->bind($data);\n\t\t}\n\t\telseif ($this->projectId)\n\t\t{\n\t\t\t$this->form->bind($this->getProject());\n\t\t}\n\t}",
"protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }",
"public function settings_view()\n {\n $this->register_handler('plugin.settingsform', array($this, 'settings_form'));\n $this->register_handler('plugin.settingslist', array($this, 'settings_list'));\n $this->register_handler('plugin.factoradder', array($this, 'settings_factoradder'));\n $this->register_handler('plugin.highsecuritydialog', array($this, 'settings_highsecuritydialog'));\n\n $this->include_script('kolab2fa.js');\n $this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css');\n\n if ($this->check_secure_mode()) {\n $this->api->output->set_env('session_secured', $_SESSION['kolab_2fa_secure_mode']);\n }\n\n $this->api->output->add_label('save','cancel');\n $this->api->output->set_pagetitle($this->gettext('settingstitle'));\n $this->api->output->send('kolab_2fa.config');\n }",
"public function page_init(){\n\t\tregister_setting(\n\t\t'custom_option_group', // Option group\n\t\tCUSTOM_CONFIG_OPTIONS, // Option name\n\t\tarray( $this, 'sanitize' ) // Sanitize\n\t\t);\n\n\t\t// --- Key activation\n\n\t\tadd_settings_section(\n\t\t'custom_settings_key_activation_id', // ID\n\t\t__(\"Activation\"), // Title\n\t\tarray( $this, 'print_section_key_activation_info' ), // Callback\n\t\t'custom-admin' // Page\n\t\t);\n\n\t\tadd_settings_field(\n\t\t'key-activation-id', // ID\n\t\t__(\"enter your key\", CUSTOM_PLUGIN_TEXT_DOMAIN), // Title\n\t\tarray( $this, 'print_setting_key_activation' ), // Callback\n\t\t'custom-admin', // Page\n\t\t'custom_settings_key_activation_id' // Section\n\t\t);\n\n\t\t$this->fields[] = \"key-activation\";\n\n\t\t// --- Tools\n\n\t\tif (custom_is_registered()){\n\n\t\t\t$tools = custom_get_available_tools();\n\t\t\tforeach ($tools as $tool){\n\t\t\t\t$fields = array();\n\t\t\t\t$fields = apply_filters(\"custom_config_options_fields_tool_\".$tool['slug'], $fields);\n\n\t\t\t\tif (!empty($fields)){\n\n\t\t\t\t\t// tool section\n\t\t\t\t\t$callback = null;\n\t\t\t\t\tif (function_exists(\"tool_\".$tool['slug'].\"_get_config_options_section_description\"))\n\t\t\t\t\t\t$callback = \"tool_\".$tool['slug'].\"_get_config_options_section_description\";\n\t\t\t\t\t$documentation_link = \"\";\n\t\t\t\t\tif (function_exists(\"tool_\".$tool['slug'].\"_get_config_options_section_documentation_url\"))\n\t\t\t\t\t\t$documentation_link = '<a class=\"tool-documentation\" href=\"'.call_user_func(\"tool_\".$tool['slug'].\"_get_config_options_section_documentation_url\").'\" target=\"_blank\"><i class=\"fa fa-info-circle\"></i></a>';\n\t\t\t\t\tadd_settings_section(\n\t\t\t\t\t'custom_settings_tool_'.$tool['slug'].'_id', // ID\n\t\t\t\t\t$tool['name'].$documentation_link, // Title\n\t\t\t\t\t$callback, // Callback\n\t\t\t\t\t'custom-admin' // Page\n\t\t\t\t\t);\n\n\t\t\t\t\t// tool fields\n\t\t\t\t\tif (!empty($fields)){\n\t\t\t\t\t\tforeach ($fields as $field){\n\t\t\t\t\t\t\tadd_settings_field(\n\t\t\t\t\t\t\t$field['slug'], // ID\n\t\t\t\t\t\t\t$field['title'], // Title\n\t\t\t\t\t\t\t$field['callback'], // Callback\n\t\t\t\t\t\t\t'custom-admin', // Page\n\t\t\t\t\t\t\t'custom_settings_tool_'.$tool['slug'].'_id', // Section\n\t\t\t\t\t\t\tarray('options' => $this->options) // Args\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->fields[] = $field['slug'];\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\t}",
"function typekit_page_callback() {\n\t\trequire_once 'includes/typekit-page.view.php';\n\t}"
]
| [
"0.6985523",
"0.65642977",
"0.64532304",
"0.6375892",
"0.63083094",
"0.6239377",
"0.6228651",
"0.6124932",
"0.6105932",
"0.6091369",
"0.6066843",
"0.60411626",
"0.60262454",
"0.6011756",
"0.5996541",
"0.5995343",
"0.5979754",
"0.59525514",
"0.59500605",
"0.5942481",
"0.593596",
"0.5900335",
"0.5884134",
"0.5870331",
"0.5866993",
"0.58553076",
"0.5854186",
"0.5849995",
"0.5839104",
"0.58120245",
"0.5809867",
"0.57922494",
"0.57764107",
"0.5757416",
"0.57550985",
"0.5743423",
"0.573787",
"0.5732998",
"0.5712319",
"0.5712319",
"0.57078105",
"0.57076055",
"0.5702627",
"0.57016665",
"0.56995153",
"0.56971985",
"0.5696467",
"0.569595",
"0.56936806",
"0.56911004",
"0.5684207",
"0.56795716",
"0.5678966",
"0.5672359",
"0.5667533",
"0.56654507",
"0.5664611",
"0.56635684",
"0.56514007",
"0.5642211",
"0.5634069",
"0.5627632",
"0.56126356",
"0.56073314",
"0.5603109",
"0.5591782",
"0.5591782",
"0.5588339",
"0.5586331",
"0.55807346",
"0.55749327",
"0.55653286",
"0.5562625",
"0.55593234",
"0.5554414",
"0.55339307",
"0.55267805",
"0.5521215",
"0.551855",
"0.5510156",
"0.5503123",
"0.54859227",
"0.54828656",
"0.54828626",
"0.5465742",
"0.54629797",
"0.54528403",
"0.54477733",
"0.544681",
"0.5443069",
"0.5438627",
"0.5434972",
"0.5429851",
"0.5427354",
"0.54136974",
"0.54015756",
"0.54004073",
"0.5400339",
"0.53980416",
"0.53974134"
]
| 0.7874659 | 0 |
Returns a component object from the cache. If there is no object stored already, a new one is created and stored in the cache. | public function getComponent($componentName)
{
//Avoid component manager creating multiple instances of itself:
if (get_class($this) == $componentName) {
return $this;
}
if (!is_array($this->classFiles)) {
$this->classFiles = [];
}
/*if ($this->componentObjectExists($componentName)) {
$componentObject = $this->componentObjects[$componentName];
} else */
if (!array_key_exists($componentName, $this->classFiles)) {
$this->loadClass($componentName);
$componentObject = $this->createComponentObject($componentName, []);
$this->putComponentObject($componentName, $componentObject);
} else {
$arguments = array_slice(func_get_args(), 1, null, true); // array keys are preserved (TRUE) -> argument array starts with key=1
$componentObject = $this->createComponentObject($componentName, $arguments);
}
return $componentObject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getObject()\n\t{\n\t\tif( !isset( $this->object ) ) {\n\t\t\t$this->object = \\Aimeos\\MAdmin\\Cache\\Manager\\Factory::createManager( $this->context )->getCache();\n\t\t}\n\n\t\treturn $this->object;\n\t}",
"function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }",
"public function getObjFromCache($key);",
"public function cache(): object\n {\n return $this->baseApp($this)->loadCache();\n }",
"public function getFromCache() {}",
"protected function getFromCache()\n {\n return $this->cache->get($this->getCacheKey());\n }",
"private function getObject($name){\n return $this->cache->get($name);\n }",
"public static function get($cacheName='_'){\n\t\tif(!isset(self::$_instances[$cacheName]))\n\t\t\tself::$_instances[$cacheName]=CCache::create(self::$_config[$cacheName]);\n\t\treturn self::$_instances[$cacheName];\n\t}",
"public function getCache()\n\t{\n\t\treturn CacheBot::get($this->getCacheKey(), self::$objectCacheLife);\n\t}",
"public static function getObject()\n\t{\n\t\tif (class_exists(\"Memcache\"))\n\t\t{\n\t\t\tself::$_memcache = new Memcache;\n\t\t\tif (!self::$_memcache->connect(\"localhost\", 11211)) return self::createObject();\n\n\t\t\tif (self::$_memcache->get(\"customer_object\")) return self::$_memcache->get(\"customer_object\");\n\t\t\telse return self::createObject();\n\t\t}\n\t\telse return self::createObject();\n\t}",
"function getCache() {\n\t\tif (!is_a($this->_cache, 'PubObjectCache')) {\n\t\t\t// Instantiate the cache.\n\t\t\timport('classes.plugins.PubObjectCache');\n\t\t\t$this->_cache = new PubObjectCache();\n\t\t}\n\t\treturn $this->_cache;\n\t}",
"public function getCache()\n\t{\n\t\tif( ! $this->cache_on)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(isset($this->cache_obj))\n\t\t{\n\t\t\treturn $this->cache_obj;\n\t\t}\n\t\t\n\t\t$class = 'Db_Cache_'.$this->cachedrv;\n\t\t\n\t\t$this->cache_obj = new $class($this->cacheopt);\n\t\t\n\t\treturn $this->cache_obj;\n\t}",
"static function getInstance($name){\n\t\tif(! isset( self::$_instances[$name]))\n\t\t\tself::$_instances[$name] = new cacheItem($name);\n\t\treturn self::$_instances[$name];\n\t}",
"protected function load_cache(){\r\n\t\tstatic $cached = null;\r\n\t\t\r\n\t\tif(!$cached){\r\n\t\t\t\r\n\t\t\tif($this->_cfg->get('sfversion') == 'auto'){\r\n\t\t\t\t// get version from sourceforge/cache\r\n\t\t\t\tif (!$this->is_cached()) $this->update_cache();\r\n\t\t\t\t$cached = (object)include($this->get_cache());\r\n\t\t\t}else{\r\n\t\t\t\t// use predefined version from config\r\n\t\t\t\t$cached = (object)$this->_cfg->get('sfversion');\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $cached;\r\n\t}",
"public function getCache()\r\n\t{\r\n\t\treturn \\Bitrix\\Main\\Data\\Cache::createInstance();\r\n\t}",
"public function getCacheInstance($cacheName = null);",
"public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}",
"public function &get_cache_object_by_id($id)\n {\n $row =& $this->get_cache_row($id);\n if (!is_array($row) || !count($row)) {\n return $false;\n }\n\n $obj =& $this->create();\n if (!is_object($obj)) {\n return $false;\n }\n\n $obj->set_vars($row);\n return $obj;\n }",
"public function getCache() {\n\n // return our instance of Cache\n return $this->oCache;\n }",
"function eve_api_get_page_cache($name) {\n ctools_include('object-cache');\n $cache = ctools_object_cache_get('eve_api', $name);\n\n // If the cached object doesn't exist yet, create an empty object.\n if (!$cache) {\n $cache = new stdClass();\n $cache->locked = ctools_object_cache_test('eve_api', $name);\n }\n\n return $cache;\n}",
"function getCache() {\n\t\t// The following line is only for classloading purposes\n\t\t$categoryEntryDao =& $this->getEntryDAO();\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\n\t\t// Load and return the cache, building it if necessary.\n\t\t$filename = $this->getCacheFilename();\n\t\tif (!file_exists($filename)) $this->rebuildCache();\n\t\t$contents = file_get_contents($filename);\n\t\tif ($contents) return unserialize($contents);\n\t\treturn null;\n\t}",
"public function get()\n {\n return Cache::get($this->cacheKey);\n }",
"public function getCache(): Cache\n {\n return $this->cache;\n }",
"protected function get_cache() {\n\t\n // uncomment next line to flush previous cache\n\t //delete_transient($this->get_cache_id()); \n\t\n \treturn get_transient( $this->get_cache_id() ); \t \n\t}",
"public function make()\n {\n if (self::$newComponentCache === null) {\n self::$newComponentCache = new \\IvoPetkov\\BearFramework\\Addons\\HTMLServerComponents\\Internal\\Component();\n }\n return clone (self::$newComponentCache);\n }",
"public static function getInstance()\n {\n if (!isset(self::$instance)) {\n switch (CACHE_TYPE) {\n case CacheType::apc:\n self::$cache = new APC();\n break;\n case CacheType::eaccelerator:\n self::$cache = new eAccelerator;\n break;\n case CacheType::xcache:\n self::$cache = new XCache;\n break;\n case CacheType::file:\n self::$cache = new File;\n break;\n\n case CacheType::none:\n default:\n self::$cache = new NoCache;\n break;\n }\n\n $c = __CLASS__;\n self::$instance = new $c;\n }\n\n return self::$instance;\n }",
"static public function getInstance()\n\t{\n\t\tif (self::$_instance == null)\n\t\t\tself::$_instance = new Ivc_Cache;\n\t\treturn (self::$_instance);\n\t}",
"public function getItem($key)\n {\n $cacheItem = new CacheItem();\n $cacheItem->setKey($key);\n\n if ($this->hasItem($key)) {\n $this->initializeItem($cacheItem);\n }\n\n return $cacheItem;\n }",
"public static function cache(){\n\n if (!isset(self::$_cache)) {\n if(!GO::isInstalled()){\n self::$_cache=new \\GO\\Base\\Cache\\None();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(!isset(GO::session()->values['cacheDriver'])){\n\t\t\t\t\t\t\t\t$cachePref = array(\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Apcu\",\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Disk\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tforeach($cachePref as $cacheDriver){\n\t\t\t\t\t\t\t\t\t$cache = new $cacheDriver;\n\t\t\t\t\t\t\t\t\tif($cache->supported()){\n\n\t\t\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\t\t\tGO::session()->values['cacheDriver'] = $cacheDriver;\n\t\t\t\t\t\t\t\t\t\tself::$_cache=$cache;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cacheDriver = GO::session()->values['cacheDriver'];\n\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\tself::$_cache = new $cacheDriver;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n }\n return self::$_cache;\n }",
"public function getCache() {\n if( null === $this->_cache ) {\n $this->_cache = Zend_Cache::factory\n ( $this->_frontend\n , $this->_backend\n , $this->_frontendOptions\n , $this->_backendOptions\n );\n }\n return $this->_cache;\n }",
"function getItem($name){\n\t\t$i = cacheItem::getInstance($name);\n\t\tif(empty($i->cacheTime) && empty($i->content) ){\n\t\t\t$datas = $this->db->select_row(self::$tableName,'*',array('WHERE name=?',$name));\n\t\t\tif( false !== $datas)\n\t\t\t\t$i->setDatas($datas);\n\t\t}\n\t\treturn $i;\n\t}",
"public function get($cache_name);",
"public static function getById($id){\n #If caching is enabled, search in cache first\n if( static::$cachePrefix ){\n $obj = Memc::get(static::$cachePrefix . $id);\n\n #if instance was not found in cache, query MongoDB\n if( !$obj ){\n $obj = static::getInstance( array('_id' => static::parseId($id)) );\n\n #object found, cache it\n if( $obj ){\n Memc::set(static::$cachePrefix . $id, $obj);\n }\n }else{\n $obj->_autosave = false;\n }\n\n return $obj;\n\n #If caching is disabled, query object from Mongo\n }else{\n return static::getInstance( array('_id' => static::parseId($id)) );\n }\n }",
"public static function getCache()\n\t{\n\t\tif (null === self::$_cache) {\n\t\t\tself::setCache(Zend_Cache::factory(\n\t\t\t\tnew Core_Cache_Frontend_Runtime(),\n\t\t\t\tnew Core_Cache_Backend_Runtime()\n\t\t\t));\n\t\t}\n\t\n\t\treturn self::$_cache;\n\t}",
"function object_cache_get($id, $flag = '') {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->get($id, $flag);\n}",
"public function getItem($key): CacheItem;",
"public function getCache()\r\n {\r\n \treturn $this->_cache;\r\n }",
"public function getCache() {\n\t\t$this->sync();\n\t\treturn $this->cache;\n\t}",
"protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}",
"public function getManagedCache()\r\n\t{\r\n\t\tif ($this->managedCache == null)\r\n\t\t\t$this->managedCache = new \\Bitrix\\Main\\Data\\ManagedCache();\r\n\t\treturn $this->managedCache;\r\n\t}",
"public function __get($id)\n {\n return $this->getCache($id);\n }",
"public function get($name) {\n if($this->memcached !== false) {\n return $this->memcached->get(\"MystoreApiCache_\".$name);\n } else {\n return $this->$name;\n }\n }",
"public function getCache()\r\n\t{\r\n\t\treturn $this->m_cache;\r\n\t}",
"public function cache() {\n\t\treturn $this->_cache;\n\t}",
"function get($key) {\n return $this->cacheObj->get($key);\n }",
"protected function getCache()\n {\n return $this->cache;\n }",
"protected function loadFromCache() {}",
"protected static function getCache($key)\n {\n \tif(!self::cacheExsits($key))\n \t\treturn null;\n \t$class = get_called_class();\n \treturn BaseEntityAbstract::$_entityCache[$class][$key];\n }",
"public function cache(string $key)\n {\n if (isset($this->caches[$key]) === true) {\n return $this->caches[$key];\n }\n\n // get the options for this cache type\n $options = $this->cacheOptions($key);\n\n if ($options['active'] === false) {\n // use a dummy cache that does nothing\n return $this->caches[$key] = new NullCache();\n }\n\n $type = strtolower($options['type']);\n $types = $this->extensions['cacheTypes'] ?? [];\n\n if (array_key_exists($type, $types) === false) {\n throw new InvalidArgumentException([\n 'key' => 'app.invalid.cacheType',\n 'data' => ['type' => $type]\n ]);\n }\n\n $className = $types[$type];\n\n // initialize the cache class\n $cache = new $className($options);\n\n // check if it is a useable cache object\n if (is_a($cache, 'Kirby\\Cache\\Cache') !== true) {\n throw new InvalidArgumentException([\n 'key' => 'app.invalid.cacheType',\n 'data' => ['type' => $type]\n ]);\n }\n\n return $this->caches[$key] = $cache;\n }",
"public function getItem(string $key): CacheItemInterface;",
"function &createCache() {}",
"public function getCache()\n\t{\n\t\treturn $this->cache;\n\t}",
"public static function modelCache() {\n\t\tif (!isset(self::$_modelCache)) {\n\t\t\tself::$_modelCache=new \\GO\\Base\\Model\\ModelCache();\n\t\t}\n\t\treturn self::$_modelCache;\n\t}",
"function lockCacheObject ()\n {\n return copy($this->cacheObjectId, $this->cacheObjectId.'.lock');\n }",
"private function getCache() {\n // cache for single run\n // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)\n if (isset($this->parsed)) {\n return $this->parsed;\n }\n\n // check from cache first\n $cache = null;\n $cacheId = $this->getCacheId();\n if ($this->cache->isValid($cacheId, 0)) {\n if ($cache = $this->cache->fetch($cacheId)) {\n $cache = unserialize($cache);\n }\n }\n\n $less = $this->getCompiler();\n $input = $cache ? $cache : $this->filepath;\n $cache = $less->cachedCompile($input);\n\n if (!is_array($input) || $cache['updated'] > $input['updated']) {\n $this->cache->store($cacheId, serialize($cache));\n }\n\n return $this->parsed = $cache;\n }",
"public function getCache()\n {\n return $this->Cache;\n }",
"public function get($key) {\n\n\t\t\t// If desired clean up all expired cached objects\n\t\t\tif ($this->_autoDeleteExpired) {\n\t\t\t\t$this->deleteExpired();\n\t\t\t}\n\n\t\t\t$filename = $this->_getFileName();\n\t\t\t$cachedData = $this->_loadCache($filename);\n\t\t\t// If key exists unserialize and return\n\t\t\tif (!isset($cachedData[$key]['data'])) return null;\n\t\t\treturn unserialize($cachedData[$key]['data']);\n\n\t\t}",
"function getCache() {\n return $this->cache;\n }",
"public function getCache();",
"protected function readFromCache()\r\n {\r\n $result = null;\r\n if(extension_loaded('apc') && ini_get('apc.enabled')) {\r\n $result = apc_fetch($this->getCacheKey());\r\n }\r\n return $result;\r\n }",
"public function getCache()\n {\n return $this->_cache;\n }",
"public function get($key)\n {\n $prefixed = $this->prefix.$key;\n\n $cache = $this->table()->where('key', '=', $prefixed)->first();\n\n // If we have a cache record we will check the expiration time against current\n // time on the system and see if the record has expired. If it has, we will\n // remove the records from the database table so it isn't returned again.\n if (! is_null($cache)) {\n if (is_array($cache)) {\n $cache = (object) $cache;\n }\n\n if (time() >= $cache->expiration) {\n $this->forget($key);\n\n return;\n }\n\n return unserialize($cache->value);\n }\n }",
"public function getCache() {\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n $isCacheEnabled = $this->isCacheEnabled();\n if (empty($isCacheEnabled))\n return false;\n\n $cacheName = $this->_cacheName();\n if (empty($cacheName))\n return null;\n $cache = Zend_Registry::get('Zend_Cache');\n\n try {\n $getCache = $cache->load($cacheName);\n } catch (Exception $e) {\n return null;\n }\n if (!empty($getCache))\n return $getCache;\n\n return null;\n }",
"public function getCache()\n\t{\n\t\treturn ($this->_cache);\n\t}",
"public function cache()\n {\n return $this->cache;\n }",
"public function getModelFromCache($class)\r\n {\r\n if (!isset($this->_modelCache[$class])) {\r\n $this->_modelCache[$class] = XenForo_Model::create($class);\r\n }\r\n \r\n return $this->_modelCache[$class];\r\n }",
"abstract public function getCache( $cacheID = '', $unserialize = true );",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache(): Repository\n {\n return $this->cache;\n }",
"protected function cache(): CacheManager\n {\n $cache = cache();\n if ($cache->supportsTags()) {\n $cache->tags($this->tags);\n }\n\n return $cache;\n }",
"static public function cache($provider = null) {\n $impl = self::instance();\n return $impl->get_resource('cache', $provider);\n }",
"final public function get():? object\n\t{\n\t\tif ($stm = $this->_prepare('SELECT `value`,\n\t\t\t\tDATE_FORMAT(`expires`, \"%Y-%m-%dT%TZ\") AS `expires`\n\t\t\t\t FROM `Cache`\n\t\t\t\t WHERE `key` = :key\n\t\t\t\t LIMIT 1;')\n\t\t) {\n\t\t\t$stm->execute(['key' => $this->getKey()]);\n\n\t\t\tif ($result = $stm->fetchObject()) {\n\t\t\t\tprint_r($result);\n\t\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"function getCache() {\n return $this->cache;\n }",
"public function getCache($key)\n {\n return $this->memcache->get($key);\n }",
"public static function getCache()\n {\n return self::$_cache;\n }",
"public function load ($key) {\n return $this->cache->get($key);\n }",
"protected function loadModelFromCache($path)\n {\n /** @var \\im\\cms\\components\\Cms $cms */\n $cms = Yii::$app->cms;\n /* @var $cache Cache */\n $cache = is_string($cms->pageCache) ? Yii::$app->get($cms->pageCache, false) : $cms->pageCache;\n $dependency = is_array($cms->pageCacheDependency)\n ? Yii::createObject($cms->pageCacheDependency) : $cms->pageCacheDependency;\n if ($cache instanceof Cache) {\n $key = $this->getCacheKey($path);\n $model = $cache->get($key);\n if ($model === false) {\n $model = $this->loadModel($path);\n if ($model !== null)\n $cache->set($key, $model, $cms->pageCacheDuration, $dependency);\n }\n }\n return $model;\n }",
"public static function getCache()\n\t{\n\t if (!self::$cache) {\n\t\t\t$frontendOptions = array('lifetime' => 604800, \n\t\t\t\t\t\t\t\t\t 'automatic_serialization' => true);\n\t\t\t$backendOptions = array('cache_dir' => APPLICATION_PATH . '/../data/cache');\n\t\t\tself::$cache \t = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);\n\t }\n\t\treturn self::$cache;\n\t}",
"public static function getInstance() {\r\n if (!Website_Service_Cache::$instance instanceof self) {\r\n Website_Service_Cache::$instance = new self();\r\n }\r\n return Website_Service_Cache::$instance;\r\n }",
"protected function _getCache()\n\t{\n\t\t/**\n\t\t * @todo needs to be adjusted for use with Zend_Cache_Manager\n\t\t */\n\t\treturn self::$_cache;\n\n\t}",
"public function & get($class) {\n\t\t# Create object if not already created\n\t\tif (!isset($this->objects[$class])) {\n\t\t\t# Caching and Creating object\n\t\t\t$this->objects[$class] = $this->create($class);\n\t\t}\n\t\t# Return object\n\t\treturn $this->objects[$class];\n\t}",
"public function getCache() {\n return $this->cache;\n }",
"public function getAtCache($key)\n {\n return self::$__cache->getItem($key);\n }",
"public function get(string $name)\n {\n $name = $this->getName($name);\n\n if (array_key_exists($name, $this->instances)) {\n return $this->instances[$name];\n } else {\n $object = $this->create($name);\n\n if (in_array($name, $this->storeInstances, true)) {\n $this->set($name, $object);\n }\n\n return $object;\n }\n }",
"public function getCache()\n {\n return $this->get('cache', false);\n }",
"public function GetObject()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\tif (!$this->object)\n\t\t\t$this->object = $this->project->GetObject($this->objectHash);\n\n\t\treturn $this->object;\n\t}",
"private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }",
"public static function fetch($key) {\n\t\t\t$klass = self::getInstance();\n\t\t\treturn $klass->cache[crc32($key)];\n\t\t}",
"public static function get(string $name): Object {\n $hash = md5($name);\n if(!isset(self::$objects[$hash])){\n self::$objects[$hash] = FactoryObjects::getInstance()->getObject($name);\n }\n\n return self::$objects[$hash];\n }",
"protected function get_cache_engine() {\n\n if ($this->caching && !$this->cache) {\n $rcube = rcube::get_instance();\n $ttl = $rcube->config->get('dbmail_cache_ttl', '10d');\n $this->cache = $rcube->get_cache('DBMAIL', $this->caching, $ttl);\n }\n\n return $this->cache;\n }",
"private static function getAssetCache($asset)\n\t{\n\t\treturn new AssetCache\n\t\t(\t$asset\n\t\t,\tnew FilesystemCache(self::cachePath())\n\t\t);\n\t}",
"public function get($cacheType)\n {\n if (!isset($this->_instances[$cacheType])) {\n $frontendId = $this->_getCacheFrontendId($cacheType);\n $frontendInstance = $this->_frontendPool->get($frontendId);\n /** @var $frontendInstance AccessProxy */\n $frontendInstance = $this->_objectManager->create(\n \\Magento\\Framework\\App\\Cache\\Type\\AccessProxy::class,\n ['frontend' => $frontendInstance, 'identifier' => $cacheType]\n );\n $this->_instances[$cacheType] = $frontendInstance;\n }\n return $this->_instances[$cacheType];\n }",
"function loadLockedObject()\n {\n return $this->cacheObjectContents($this->cacheObjectId.'.lock');\n }",
"public static function fetch()\n {\n if (!isset(self::$instance)) {\n $c = __CLASS__;\n self::$instance = new $c;\n }\n\n return self::$instance;\n }",
"protected function getRuntimeCache() {}"
]
| [
"0.7265745",
"0.71719944",
"0.70647484",
"0.70387894",
"0.6885782",
"0.6818091",
"0.68030316",
"0.6635201",
"0.65680367",
"0.6567422",
"0.65450656",
"0.6337983",
"0.63241875",
"0.6312659",
"0.6298744",
"0.6263644",
"0.6246448",
"0.62344426",
"0.6220433",
"0.6215352",
"0.62088084",
"0.62018776",
"0.61611",
"0.61345834",
"0.6101159",
"0.6096609",
"0.60868734",
"0.6079133",
"0.6074871",
"0.605599",
"0.60480565",
"0.60342276",
"0.60327935",
"0.6030298",
"0.6016759",
"0.60097176",
"0.5994635",
"0.5989726",
"0.5987597",
"0.5971738",
"0.5955357",
"0.59276307",
"0.59244126",
"0.59205294",
"0.5908622",
"0.58999175",
"0.5892679",
"0.58886033",
"0.5885373",
"0.58815324",
"0.5874736",
"0.58698946",
"0.58424866",
"0.58388835",
"0.5838202",
"0.58342344",
"0.58333755",
"0.58328044",
"0.58249503",
"0.58227175",
"0.5822515",
"0.58108526",
"0.5807906",
"0.58058417",
"0.58057964",
"0.5801894",
"0.57998216",
"0.5789717",
"0.5789717",
"0.5789717",
"0.5789717",
"0.5789717",
"0.5789717",
"0.5789717",
"0.57891876",
"0.57774436",
"0.5775991",
"0.5767199",
"0.57527655",
"0.57525426",
"0.57444245",
"0.5741185",
"0.57332987",
"0.57237196",
"0.5723154",
"0.5721068",
"0.5715868",
"0.5714512",
"0.5709735",
"0.570049",
"0.56975496",
"0.56941414",
"0.5683403",
"0.567996",
"0.56735516",
"0.5670444",
"0.56519306",
"0.564633",
"0.564623",
"0.56447124",
"0.5630385"
]
| 0.0 | -1 |
Requires a class file and instanciates a class. | protected function createComponentObject($componentName, array $overridingConstructorArguments)
{
$componentObject = null;
$componentConfiguration = $this->getComponentConfiguration($componentName);
$className = $componentConfiguration['className'] ? $componentConfiguration['className'] : $componentName;
if (!class_exists($className, true)) {
throw new Exception('No valid implementation class for component "' . $componentName . '" found while building the component object (Class "' . $className . '" does not exist).');
}
$constructorArguments = $componentConfiguration['arguments.'] ? $componentConfiguration['arguments.'] : [];
foreach ($overridingConstructorArguments as $index => $value) {
$constructorArguments[$index] = $value;
}
$class = new ReflectionClass($className);
$constructorArguments = $this->autoWireConstructorArguments($constructorArguments, $class);
$injectedArguments = [];
$preparedArguments = [];
$this->injectConstructorArguments($constructorArguments, $injectedArguments, $preparedArguments);
$instruction = '$componentObject = new ' . $className . '(';
$instruction .= implode(', ', $preparedArguments);
$instruction .= ');';
eval($instruction);
$scope = $this->getComponentScope($componentName, $componentConfiguration);
switch ($scope) {
case 'singleton' :
$this->putComponentObject($componentName, $componentObject);
break;
case 'prototype' :
break;
default :
throw new Exception('Support for scope "' . $scope . '" has not been implemented (yet)', 1167484148);
}
return $componentObject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadClass($className)\r\n{\r\n require $className . '.php';\r\n}",
"function load_class($class_name) {\n\t$class_file = CLASSES_DIR.strtolower($class_name).'.class.php';\n\n\tif (class_exists($class_name)) {\n\t\treturn true;\n\t}\n\telseif (file_exists($class_file) && is_readable($class_file)) {\n\t\trequire_once $class_file;\n\t\treturn true;\n\t}\n\telse {\n\t\tthrow new MyException(__FUNCTION__.': Class file ('.$class_file.') not found');\n\t}\n}",
"private function loadClass($path, $class_name)\n {\n if (file_exists($path)) {\n $instance = new $class_name();\n return $instance;\n } else {\n throw new FileNotFoundException();\n }\n }",
"function __autoload($class) {\n\t\n\tglobal $_;\n\n try {\n if(file_exists('classes/class.'.$class.'.php'))\n {\n require 'classes/class.'.$class . '.php';\n }\n else\n {\n \t$error = sprintf($_['e_class'], 'classes/class.'.$class.'.php');\n throw new Exception($error);\n }\n } catch(Exception $e)\n {\n die($e->getMessage());\n }\n}",
"function __autoload($className) {\n\t$fileClass = 'library/' . $className . '.class.php';\n\n\ttry {\n\t\tif (file_exists($fileClass) === true) {\n\t\t\trequire_once($fileClass);\n\t\t} else {\n\t\t\tthrow new RunException('Class ' . $fileClass . ' doesn\\'t load');\n\t\t}\n\t} catch (RunException $e) {\n\t\t$e->showMessage();\n\t}\n}",
"function load_class( $file_name, $class_name, $pass_var=\"\" )\n\t{\n\t\tif ( ! $class_name )\n\t\t{\n\t\t\t$class_name = $file_name;\n\t\t}\n\t\t\n\t\trequire_once( $file_name );\n\t\t\n\t\tif ( $pass_var )\n\t\t{\n\t\t\t$class = new $class_name ( $pass_var );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$class = new $class_name;\n\t\t}\n\t\t\n\t\t$class->ipsclass =& $this;\n\t\treturn $class;\n\t}",
"function load($classname)\r\n{\r\n\r\n\r\n if (file_exists($file = dirname (__FILE__) . '/' . $classname .'.class.php'))\r\n require_once $file;\r\n}",
"public function create(string $class);",
"function __autoload($class_name)\n{\n if (file_exists(\"classes/class.$class_name.php\"))\n {\n require_once \"classes/class.$class_name.php\";\n }else{echo'can not load';}\n}",
"function loader($class)\n{\n\t$file = dirname(__DIR__) . DIRECTORY_SEPARATOR . $class . '.php';\n\tif (file_exists($file)) {\n\t\trequire $file;\n\t}\n}",
"function classLoader($className) {\n\t\trequire_once dirname(__FILE__) .\"/Classes/\". $className . '.php';\n\t}",
"function loadClass($class_name) {\n include \"$class_name.php\";\n}",
"function myLoad($className){\n\t$path = MYPHP_SOURCE.'/'.str_replace('\\\\', '/', $className).'.class.php';\n\tif(file_exists($path)){\n\t\trequire_once $path;\n\t}\n}",
"function __autoload($class){\n\tif (file_exists(\"{$class}/{$class}.php\")) {\n\t\trequire_once \"{$class}/{$class}.php\";\n\t}\n}",
"function __autoload($class){\n require \"classes/\".$class.\".php\";\n }",
"public function load(string $class);",
"function class_loader($class) {\n require('classes/' . $class . '.php');\n}",
"function myAutoLoader($class) {\n\t$path = TRITON_INSTALL_PATH . \"/src/{$class}/{$class}.php\";\n\tif(is_file($path)) {\n\t\tinclude($path);\n\t} else {\n\t\tthrow new Exception(\"Classfile '{$class} does not exist.\");\n\t}\n}",
"function myAutoLoader($class) {\n\t$path = TRITON_INSTALL_PATH . \"/src/{$class}/{$class}.php\";\n\tif(is_file($path)) {\n\t\tinclude($path);\n\t} else {\n\t\tthrow new Exception(\"Classfile '{$class} does not exist.\");\n\t}\n}",
"function autoloadclass($scriptName) {\r\n if (substr($scriptName, -4, 4)==\".php\")\r\n $scriptName=substr($scriptName,0,strlen($scriptName)-4);\r\n if (substr($scriptName, -4, 4)==\".class\")\r\n $scriptName=substr($scriptName,0,strlen($scriptName)-4);\r\n $explodedName = explode(\"/\", $scriptName);\r\n $className = $explodedName[count($explodedName)-1];\r\n $scriptName=\"./\".$scriptName.\".class.php\";\r\n \r\n if (file_exists($scriptName)){\r\n include_once($scriptName);\r\n return new $className;\r\n }else\r\n throw new Exception(\"Unable to load class $scriptName\");\r\n}",
"function loader($class){\n $class_file = DIR. DS . $class . '.php';\n\n if(file_exists($class_file)){\n require_once($class_file);\n }else{\n foreach (AUTOLOAD_CLASSES as $path){\n $class_file = $path . DS . $class . '.php';\n if(file_exists($class_file)) require_once($class_file);\n }\n }\n}",
"function loader($class)\n{\n $file = $class . '.php';\n if (file_exists($file)) {\n include $file;\n }\n}",
"function autoload($class)\n{\n require('classes/' . $class . '.class.php');\n}",
"function __autoload($class)\n{\n\trequire_once $class . '.php';\n}",
"function autoloadClass($classe)\n{\n require $classe . \".php\";\n}",
"function __autoload($class)\n\t{\n\t\trequire_once('class/'. strtolower($class) . '.class.php');\n\t}",
"function __autoload($className){\n\t$file = ROOT.DS.'library'.DS.str_replace('\\\\',DS,$className).'.php';\n\tif(file_exists($file)){\n\t\trequire_once($file);\n\t}\n\telse {\n\t\tthrow new Exception(\"Couldn't load class: \".$className);\n\t}\n}",
"public function instantiate($className);",
"public function LoadClass($classname){\r\n\r\n\t\tif(strrpos($classname, '.class.php') === false){\r\n\t\t\t$path = $this->conf['CLASS'].$classname.'.class.php';\r\n\t\t\t$class = ucfirst($classname);\r\n\t\t} else{\r\n\t\t\t$path = $this->conf['CLASS'].$classname;\r\n\t\t\t$class = ucfirst(str_replace('.class.php', '', $classname));\r\n\t\t}\r\n\t\techo '$classname:'.$classname;echo '<br/>';\r\n\t\techo '$path:'.$path;echo '<hr>';\r\n\t\techo '$class:'.$class;\r\n\r\n\t\tif(is_file($path)){\r\n\t\t\tinclude_once $path;\r\n\t\t\t$object = new $class();\r\n\t\t\treturn $object;\r\n\t\t}else{\r\n\t\t\t$this->ShowErrorMsg(\"The require class was not found\");\r\n\t\t}\r\n\t}",
"function __autoload($className) {\r\n\t$className = strtolower($className);\r\n\t$className = basename(str_replace(\"\\\\\", \"/\", $className ));\r\n\t//echo $className. PHP_EOL;\r\n\r\n\tif (file_exists(__DIR__.'/'. $className . '.class.php')) {\r\n\t\trequire_once( __DIR__.'/'.$className . '.class.php' );\r\n\t}else{\r\n\t\tthrow new \\Exception('Class \"' . $className . '.class.php\" could not be autoloaded');\r\n\t}\r\n\r\n}",
"function __autoload($classname){\n\t$file=\"$classname.php\";\n\tif(is_file($file)) require_once $file;\n\telse die('Class not found.');\n}",
"function __autoload($className) {\n $classeFile = dirname(__FILE__) . '/../classes/' . strtolower($className) . '.class.php';\n if (file_exists($classeFile)) {\n include_once $classeFile;\n }\n}",
"function __autoload($class){\n $class = 'classes/' . str_replace('\\\\', '/', $class) . '.php';\n if(file_exists($class)) {\n require $class;\n } else {\n var_dump($class); //die();\n }\n\n}",
"function autoload( $className ){\n\tif ( file_exists( $file = dirname( __FILE__). \"/../class/\".$className.\".class.php\" ) ){\n\t\trequire ( $file ); \n\t}\n}",
"function __autoload($class_name) {\n\n require_once $class_name . '.class.php';\n\t\n}",
"function classLoader($class){\n $filename = $class . '.class.php';\n $file ='classes'. DIRECTORY_SEPARATOR . $filename;\n\n // Smarty ligger i libs-mappa.\n if ($class == 'Smarty') {\n $file = 'libs' . DIRECTORY_SEPARATOR . $filename;\n }\n if (!file_exists($file))\n {\n return false;\n }\n\n include $file;\n}",
"function __autoload($class_name) {include $class_name . '.php';}",
"function __autoload($className)\n{\n if (file_exists($className . \".php\"))\n require_once $className . \".php\";\n else {\n die(\"Class not found! $className\");\n }\n}",
"public function testFileLoaderClassCanBeCreated()\n {\n $f = new FileLoader;\n }",
"function __autoload( $className ){\n require_once 'classes/'.$className.'.class.php';\n }",
"function classLoader($classname)\n{\n \n $classname = str_replace(\"\\\\\",'/',$classname);\n\n if (file_exists('../'.$classname.'.class.php')) {\n\trequire_once '../'.$classname.'.class.php';\n }\n \n}",
"function classLoader($className){\r\n $classAry = explode('\\\\',$className);\r\n $class = array_pop($classAry);\r\n $subPath = strtolower(implode(DS,$classAry));\r\n $path = ROOT . DS . $subPath . DS . $class . '.php';\r\n if(file_exists($path)){\r\n require_once($path);\r\n }\r\n}",
"function __autoload($class_name) {\n include \"classes/\" . $class_name . \".class.php\";\n}",
"function __autoload($class_name){\n $classname = strtolower($class_name);\n $path = LIB_PATH.DS.\"class.{$classname}.php\";\n if(file_exists($path)){\n require_once \"$path\";\n }else{\n die(\"the file {$classname}.php could not be found\");\n }\n}",
"function autoload ($className) {\n \n $file = dirname(__FILE__) . '/' . $className . '.php';\n if (file_exists($file)) {\n require $file;\n }\n}",
"function __autoload($className){\n\t\tif(file_exists(DOCUMENTROOT.'/classes/class.'.$className.'.php')){\n\t\t\tinclude_once(DOCUMENTROOT.'/classes/class.'.$className.'.php');\n\t\t}\n\t}",
"function __autoload($class) {\n require ($class . '.php');\n}",
"public static function loadClassByName ($className, $arguments = null)\n\t{\n\n\t\t$fileExists = file_exists(self::$path.$className.\".php\");\n\t\tif ($fileExists)\n\t\t{\n\t\t\t// we know file exists so load it up (if not already)\n\t\t\trequire_once (self::$path.$className.\".php\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::throw404();\n\t\t}\n\n\t\t// if arguments exist, pass them as you instantiate class\n\t\t// otherwise, just call it without arguments\n\t\tif ($fileExists && isset ($arguments) && is_array ($arguments))\n\t\t{\n\n\t\t\t$instance = new $className ($arguments);\n\t\t}\n\t\telse if ($fileExists)\n\t\t{\n\n\t\t\t$instance = new $className ();\n\t\t}\n\n\t\treturn $instance;\n\n\t}",
"function chargerClasse($classname)\n{\n require $classname . '.php';\n}",
"function classAutoload($class_name) {\n if (file_exists( __DIR__ . '/includes/classes/' . $class_name . '.php')) {\n require_once __DIR__ . '/includes/classes/' . $class_name . '.php';\n }\n}",
"function loadClass($class, $params=array())\n\t{ \n\t\t$className = ltrim($class, '\\\\');\n\t\t$file = '';\n\t\t$namespace = '';\n\t\tif ($lastNsPos = strripos($className, '\\\\')) {\n\t\t $namespace = substr($className, 0, $lastNsPos);\n\t\t $className = substr($className, $lastNsPos + 1);\n\t\t $file = str_replace('\\\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;\n\t\t}\n\t\t\n\t\t$file = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';\n\t\trequire_once($file);\n\t\t\n\t\t\n\t\t$file_info = array('namespace'=>$namespace,'className'=>$className,'file'=>$file,);\n\t}",
"function __autoload($class) {\r\n\t\t\t\t$classPathAndFileName = \"./clases/\" . $class . \".class.php\";\r\n\t\t\t\trequire_once($classPathAndFileName);\r\n\t\t\t}",
"function __autoload($class){\n\t$filename = \"../sys/class/class.\".$class.\".php\";\n\tif(file_exists($filename))\n\t{\n\t\tinclude_once $filename; \n\t}\n}",
"function __autoload($class_name) {\n include 'classes/' . $class_name . '.php';\n}",
"function guoClassLoader($class)\n{\n $path = str_replace('Jwt\\\\', '', $class);\n $file = __DIR__ . '/src/' . $path . '.php';\n if (file_exists($file)) {\n require_once $file;\n }\n}",
"public static function load_class_file( $class_path ) {\n\t\t$file_path = self::get_file_path_for_class( $class_path );\n\n\t\t// Check that a file was found.\n\t\tif ( $file_path ) {\n\t\t\trequire_once $file_path;\n\t\t}\n\t}",
"function __autoload($className) {\n $class = ucfirst($className);\n $file = BASE . 'libraries' . DS . $class . EXT;\n if (file_exists($file)) {\n require_once($file);\n } else {\n exit(\"Class '$class' was not found in '$file'\");\n }\n }",
"function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}",
"function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}",
"function __autoload($className){\n $className = BASEDIR . \"include/class/\" . str_replace(\"_\", \"/\", $className) . \".php\";\n if(!file_exists($className)){\n throw new Exception(\"Bad class name - cannot autoload file: \" . $className . \" as it does not exist.\");\n }\n else{\n require_once($className);\n }\n}",
"function __autoload($class_name) {\n require_once '/' . $class_name . '.php';\n}",
"abstract protected static function autoload($class);",
"public static function autoload($class) {\n include $class . '.php';\n}",
"function autoload($class) {\n\n if (file_exists(dirname(__FILE__) . \"/\" . $class . \".php\")) {\n require (dirname(__FILE__) . \"/\" . $class . \".php\");\n } else {\n exit('The file ' . $class . '.php is missing in the includes folder.');\n }\n}",
"function __autoload($nomeClasse)\n{\n include_once './classes/' . $nomeClasse . '.class.php';\n}",
"public static function load($class) {\n\t\t\t\n\t\t\tif ( !class_exists($class) ) { \n\t\t\t\t\n\t\t\t\t$file = str_replace(['\\\\', '_'], '/', $class);\n\t\t\t\t\n\t\t\t\t$path = path('framework').$file.'.php';\n\t\t\t\t\n\t\t\t\tif ( file_exists($path) ) {\n\t\t\t\t\t\n\t\t\t\t\trequire_once $path;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}",
"function __autoload($class){\n\t$class = strtolower($class);\n\t$path = \"include/{$class}.php\";\n\n\t\tif(file_exists($path)){\n\t\t\trequire_once(\"$path\");\n\t\t}\n\t\telse{\n\t\t\tdie(\"{$class}.php dose not exists.\");\n\t\t}\n}",
"function __autoload($class_name) {\r\n include '../class/' . $class_name . '.php';\r\n}",
"function furasta_autoload( $class_name ){\n\n\t$file = HOME . '_inc/class/' . $class_name . '.php';\n\n\tif( file_exists( $file ) )\n\t\treturn require_once HOME . '_inc/class/' . $class_name . '.php';\n\n\treturn false;\n\n}",
"function autoloadClasses($className) {\n $filename = \"classes\\\\\" . strtolower($className) . \".class.php\";\n $filename = str_replace('\\\\', DIRECTORY_SEPARATOR, $filename);\n if (is_readable($filename)) {\n include_once $filename;\n } else {\n throw new exception(\"File not found: \" . $className . \" (\" . $filename . \")\");\n logError($errstr);\n }\n }",
"function __autoload($className){\n include_once \"Classes/$className.php\";\n}",
"function class_loader($class) {\r\n require_once('classes/' . strtolower($class) . '.class.php');\r\n}",
"function __autoload($class) {\n\t$filename = \"sys/class/class.\" .$class. \".inc.php\";\n\tif (file_exists($filename)) {\n\t\tinclude_once($filename);\n\t}\n}",
"function classLoad ($myClass) {\n\t\tif(file_exists('../model/'.$myClass.'.class.php')){\n\t\t\tinclude('../model/'.$myClass.'.class.php');\n\t\t}\n elseif(file_exists('../controller/'.$myClass.'.class.php')){\n\t\t\tinclude('../controller/'.$myClass.'.class.php');\n\t\t}\n }",
"function classLoad ($myClass) {\n\t\tif(file_exists('../model/'.$myClass.'.class.php')){\n\t\t\tinclude('../model/'.$myClass.'.class.php');\n\t\t}\n elseif(file_exists('../controller/'.$myClass.'.class.php')){\n\t\t\tinclude('../controller/'.$myClass.'.class.php');\n\t\t}\n }",
"public static function my_autoload($clazz){\n\t\t// Check to see whether the include declared the class\n\t\tif (!class_exists($clazz, false)) {\n\t\t\ttrigger_error(\"Unable to load class: ${clazz}\", E_USER_WARNING);\n\t\t}\n\t}",
"function import($class, $file, $path = null) {\n\tstatic $_classes = array();\n\n\t$class = strtolower($class);\n\t$class_exists = isset($_classes[$class]);\n\n\tif(!$class_exists) {\n\t\t$_classes[$class] = $class;\n\t\t$path = is_null($path) ? APPPATH : $path;\n\t\tinclude_once($path.$file);\n\t}\n}",
"function _autoload($class)\r {\r $class = str_replace(\"\\\\\", \"/\", $class);\r $class = str_replace('yqn/sdkmiddle/', 'src/', $class);\r $file = __DIR__ . '/../' . $class . '.php';\r require_once $file;\r }",
"function chargeClass($class) {\n\t\trequire_once 'models/' . $class . '.class.php';\n\t}",
"public static function loadClass(string $className)\n {\n $path = self::detectClassTypeDir($className) . '/' . $className . '.php';\n if (file_exists($path)) {\n require_once $path;\n } else {\n exit(\"Class not found!\");\n }\n }",
"function __autoload($class_name) {\r\n\t// For security measures, remove any dangerous characters\r\n\t$class_name = preg_replace('/[^a-z_]/i', '', $class_name); \r\n\t\r\n\t// Make sure we always know where the main class is\r\n\tif($class_name === 'BrainPal') {\r\n\t // The main class should alwyas be located in the root of the 'classes' folder\r\n\t $include_path = CLASS_PATH . 'BrainPal.php';\r\n\t} else {\r\n \t// For any other class, just guess the class file path\r\n \t$include_path = CLASS_PATH . preg_replace('/([a-z])([A-Z])/', '$1/$2', $class_name) . '.php';\r\n\t}\r\n\t\r\n\t// Check if the file exists\r\n\tif( file_exists($include_path) ) {\r\n\t\t// Include the class file\r\n\t\trequire_once $include_path;\r\n\r\n\t\t// Check if the class exists\r\n\t\tif( class_exists($class_name, false) ) {\r\n\t\t\t// It is, return true\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Return false, the class could not be loaded\r\n\treturn false;\r\n}",
"function __autoload($classe){\n if(file_exists(\"../../class/{$classe}.class.php\")){\n\t\t//echo \"class/{$classe}.class.php\\n\";\n include_once \"../../class/{$classe}.class.php\";\n }else{\n\t\t//echo \"{$classe}\\n\";\n\t}\n}",
"function __autoload($classe){\n if(file_exists(\"../../class/{$classe}.class.php\")){\n\t\t//echo \"class/{$classe}.class.php\\n\";\n include_once \"../../class/{$classe}.class.php\";\n }else{\n\t\t//echo \"{$classe}\\n\";\n\t}\n}",
"function __autoload($classe){\n if(file_exists(\"../../class/{$classe}.class.php\")){\n\t\t//echo \"class/{$classe}.class.php\\n\";\n include_once \"../../class/{$classe}.class.php\";\n }else{\n\t\t//echo \"{$classe}\\n\";\n\t}\n}",
"function class_autoloader($class)\n{\n $filename = dirname(__FILE__) . DS . '..' . DS . 'includes' . DS . 'class-' . strtolower($class) . '.php';\n\n if (file_exists($filename)) {\n require $filename;\n }\n}",
"public function testClassInstantiation()\n {\n $object = new FileBasedParser(RoboFile::SOURCE_ROOT);\n $this->assertInstanceOf(\n 'WPCoreBootstrap\\DocumentationParser\\Parser',\n $object\n );\n }",
"public static function loadClass($className)\r\n {\r\n if (class_exists ($className, false) || \r\n interface_exists($className, false)) \r\n {\r\n return;\r\n }\r\n // Simple path calculation\r\n $path = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';\r\n include $path;\r\n }",
"function chargerClasse($classname)\n{\n require $classname.'.php';\n}",
"function __autoload($name){\n require_once './class/' . $name . \".class.php\";\n}",
"function register_class()\n\t{\n\t\t\n\t\t// NO LONGER NEEDED\n\t}",
"function my_class_loader ($class) {\n include 'classes' . DIRECTORY_SEPARATOR . $class . '.class.php';\n}",
"function loader($class)\n{\n if (strpos($class, 'Tests\\\\') !== false) {\n\n $file = __DIR__ . '/' . str_replace('\\\\', '/', substr($class, 17)) . '.php';\n\n } else {\n\n $file = __DIR__ . '/../src/' . str_replace('\\\\', '/', substr($class, 11)) . '.php';\n }\n\n if (file_exists($file)) {\n\n require $file;\n }\n}",
"function autoloadClasses($className) {\r\n $filename = \"./classes/\" . $className . \".php\";\r\n if (is_readable($filename)) {\r\n include $filename;\r\n }\r\n}",
"function __autoload($classname) {\n $path = '../classes/' . $classname . '.php';\n\n return file_exists($path) ? require_once $path : false;\n}",
"public function createFromClass($class, array $args = []);",
"private function instantiateClass( $pageFilePath ) : Page\n {\n $isDebug = false;\n\n if($isDebug) {\n echo '<span style=\"color:blue;\">instantiateClass()</span> | pageFilePath = ' . $pageFilePath . '<br>';\n }\n // Strip the directories off the filename\n $filePathArray = explode(\n '/',\n $pageFilePath\n );\n\n $filename = $filePathArray[count($filePathArray) - 1];\n\n\n $page = $filePathArray[count($filePathArray) - 1];\n $topic = $this->allPages[$this->stripExtFromFile($filename)][0];\n $course = $this->allPages[$this->stripExtFromFile($filename)][1];\n\n if($isDebug) {\n echo '<span style=\"color:blue;\">Filename</span>: ' . $filename . '<br>';\n }\n\n $class = explode(\n \".\",\n $filename\n\n );\n\n if($this->isDebug) {\n echo 'Class: ' . $class[0] . '<br>';\n// echo $this->modulesAssoc[$_SESSION['page']] . '<br>';\n// echo 'J\\\\ClassNotes\\\\' . $this->stripClassNameFromFilePath($this->modulesAssoc[$_SESSION['module']], true) . '<br>';\n }\n // Instantiate the class with the filePath ( eg. )as param\n $className = 'J\\\\ClassNotes\\\\' . $class[0];\n\n if($isDebug) {\n echo '<span style=\"color:blue;\">ClassName</span>: ' . $className . '<br>';\n }\n // $filepath = $this->stripClassNameFromFilePath([ $_SESSION[ 'module' ]] );\n\n require_once $pageFilePath;\n\n $newPage = new $className( $filename, $topic, $course );\n\n\n return $newPage;\n\n }",
"function chargerClasse($classname)\n\t{\n\t\trequire_once('../../../../classes/'.$classname.'.class.php');\n\t}",
"function __autoload($class_name) {\n include $class_name . '.php';\n}",
"function __autoload($class_name) {\n include $class_name . '.php';\n}",
"function __autoload($class_name) {\n include $class_name . '.php';\n}",
"function __autoload( $class_name ) {\n\t\tif (file_exists('models/' . strtolower( $class_name ) . '.class.php' )) \n\t\t{\n\t\t\trequire_once 'models/' . strtolower( $class_name ) . '.class.php';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Impossible de charger la classe $class_name.\");\n\t\t}\n\t}"
]
| [
"0.6883943",
"0.6830735",
"0.6807278",
"0.677561",
"0.6772912",
"0.6754897",
"0.6749033",
"0.6720373",
"0.6674607",
"0.6660424",
"0.6656798",
"0.66118103",
"0.65779996",
"0.65616256",
"0.65555537",
"0.654708",
"0.6540408",
"0.653866",
"0.653866",
"0.64888227",
"0.6479112",
"0.6458197",
"0.64489144",
"0.64451766",
"0.6441841",
"0.64261436",
"0.6412607",
"0.6411867",
"0.63991433",
"0.63933957",
"0.63923234",
"0.63807076",
"0.6361941",
"0.63539034",
"0.6351472",
"0.63443947",
"0.632609",
"0.6311728",
"0.631055",
"0.63045007",
"0.6303838",
"0.63003224",
"0.6297414",
"0.6286825",
"0.62824243",
"0.62809867",
"0.6279305",
"0.6274642",
"0.6263638",
"0.6259643",
"0.62589306",
"0.6253174",
"0.6251819",
"0.62509716",
"0.6250633",
"0.6244151",
"0.6244129",
"0.62436074",
"0.62436074",
"0.6234752",
"0.6232953",
"0.6228356",
"0.6221528",
"0.6214734",
"0.62128425",
"0.6210579",
"0.62096995",
"0.62052536",
"0.62023306",
"0.61981195",
"0.6192178",
"0.6185918",
"0.6184027",
"0.6183066",
"0.6183066",
"0.6178724",
"0.61782146",
"0.6177436",
"0.61745733",
"0.61629254",
"0.6161588",
"0.61596286",
"0.61596286",
"0.61596286",
"0.6152989",
"0.61494917",
"0.6147252",
"0.61441404",
"0.6135963",
"0.61303496",
"0.6128838",
"0.61275274",
"0.6126333",
"0.6124446",
"0.6118758",
"0.6103543",
"0.6089441",
"0.60884863",
"0.60884863",
"0.60884863",
"0.60883445"
]
| 0.0 | -1 |
If mandatory constructor arguments have not been defined yet, this function tries to autowire them if possible. | protected function autoWireConstructorArguments(array $constructorArguments, \ReflectionClass $class)
{
$className = $class->getName();
$constructor = $class->getConstructor();
if ($constructor !== null) {
foreach ($constructor->getParameters() as $parameterIndex => $parameter) {
$index = $parameterIndex + 1;
if (!isset($constructorArguments[$index])) {
try {
if ($parameter->isOptional()) {
$defaultValue = ($parameter->isDefaultValueAvailable()) ? $parameter->getDefaultValue() : null;
$constructorArguments[$index] = $defaultValue;
} elseif ($parameter->getClass() !== null) {
$constructorArguments[$index] = $parameter->getClass()->getName();
} elseif ($parameter->allowsNull()) {
$constructorArguments[$index] = null;
} else {
$this->debugMessages[] = 'Tried everything to autowire parameter $' . $parameter->getName() . ' in ' . $className . '::' . $constructor->getName() . '() but I saw no way.';
}
} catch (ReflectionException $exception) {
throw new Exception('While trying to autowire the parameter $' . $parameter->getName() . ' of the method ' . $className . '::' . $constructor->getName() . '() a ReflectionException was thrown. Please verify the definition of your constructor method in ' . $constructor->getFileName() . ' line ' . $constructor->getStartLine() . '. Original message: ' . $exception->getMessage());
}
} else {
$this->debugMessages[] = 'Did not try to autowire parameter $' . $parameter->getName() . ' in ' . $className . '::' . $constructor->getName() . '() because it was already set.';
}
}
} else {
$this->debugMessages[] = 'Autowiring for class ' . $className . ' disabled because no constructor was found.';
}
return $constructorArguments;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function autoWiringWorksForConstructorInjection() {\n\t\t$objectName = 'F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected';\n\t\t$this->mockObjectManager->expects($this->at(0))->method('getObject')->with('F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface')->will($this->returnValue(new \\F3\\FLOW3\\Tests\\Object\\Fixture\\SomeImplementation));\n\t\t$this->mockObjectManager->expects($this->at(1))->method('getObject')->with('F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass')->will($this->returnValue(new \\F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass));\n\t\t$this->mockReflectionService->expects($this->once())->method('getClassConstructorName')->with($objectName)->will($this->returnValue('__construct'));\n\t\t$constructorParameters = array(\n\t\t\t'argument1' => array(\n\t\t\t\t'position' => 0,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface'\n\t\t\t),\n\t\t\t'argument2' => array(\n\t\t\t\t'position' => 1,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass'\n\t\t\t)\n\t\t);\n\t\t$this->mockReflectionService->expects($this->at(1))->method('getMethodParameters')->with($objectName, '__construct')->will($this->returnValue($constructorParameters));\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected');\n\n\t\t$object = $this->objectBuilder->createObject($objectName, $objectConfiguration);\n\t\t$this->assertType('F3\\FLOW3\\Tests\\Object\\Fixture\\SomeImplementation', $object->argument1, 'Autowiring didn\\'t work out for ' . $objectName);\n\t}",
"public function autoWiringForConstructorInjectionRespectsAlreadyDefinedArguments() {\n\t\t$objectName = 'F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected';\n\t\t$this->mockObjectManager->expects($this->at(0))->method('getObject')->with('F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface')->will($this->returnValue(new \\F3\\FLOW3\\Tests\\Object\\Fixture\\SomeImplementation));\n\t\t$this->mockReflectionService->expects($this->once())->method('getClassConstructorName')->with($objectName)->will($this->returnValue('__construct'));\n\t\t$constructorParameters = array(\n\t\t\t'argument1' => array(\n\t\t\t\t'position' => 0,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface'\n\t\t\t),\n\t\t\t'argument2' => array(\n\t\t\t\t'position' => 1,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass'\n\t\t\t)\n\t\t);\n\t\t$this->mockReflectionService->expects($this->at(1))->method('getMethodParameters')->with($objectName, '__construct')->will($this->returnValue($constructorParameters));\n\n\t\t$injectedClassName = uniqid('Injected');\n\t\teval('namespace F3\\Virtual; class ' . $injectedClassName . ' extends \\F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass {}');\n\t\t$injectedClassName = 'F3\\Virtual\\\\' .$injectedClassName;\n\t\t$injectedClass = new $injectedClassName();\n\t\t$this->mockObjectManager->expects($this->at(1))->method('getObject')->with($injectedClassName)->will($this->returnValue($injectedClass));\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, $injectedClassName, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_OBJECT)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject($objectName, $objectConfiguration);\n\t\t$this->assertSame($object->argument2, $injectedClass, 'Autowiring didn\\'t respect that the second constructor argument was already set in the object configuration!');\n\t}",
"public function __construct()\n {\n // Dependencies automatically resolved by service container...\n }",
"public function __construct()\n {\n $this->metadatas = app(MetadataRepository::class);\n $this->fileRepository = app(FileRepository::class);\n if(method_exists($this, 'init')){\n $this->init();\n }\n }",
"public function __construct()\n {\n if($this->model == null || $this->model->modelAttributes = null)\n {\n throw new MissingMandatoryParametersException('No model on class or no attributes on model');\n }\n }",
"public function __construct()\n {\n # no args = no further setup\n if (func_num_args() == 0) return;\n\n # use this to work out whether an arg refers to an Orm name\n $name_specified = 0;\n\n if (is_array($input = func_get_arg(0))) { # array = new object with initial values\n if (func_num_args() == 2)\n $name_specified = 1;\n\n foreach($input as $key => $val)\n $this->$key = $val;\n\n }\n\n if ($name_specified > 0) {\n $this->setup_name = func_get_arg($name_specified);\n }\n }",
"public function __construct() {\n\t\t\t\t$this->buildDbInterface();\n\t\t\t\t$in = func_get_args();\n\t\t\t\t$i = func_num_args();\n\t\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\t\tcall_user_func_array(array($this,$f),$in);\n\t\t\t\t} \n\t\t}",
"public function __construct()\n { \n $methods = $this->getClassMethods($this);\n foreach ($methods as $method) {\n // call parameterless methods which are prefixed with '_init'.\n if ($method->getNumberOfParameters() == 0 && strpos($method->getName(), '_init') === 0) {\n $method->setAccessible(true);\n $method->invoke($this);\n }\n }\n }",
"public function __construct()\n {\n // Dependencies automatically resolved by service container...\n //$this->users = $users;\n }",
"public function __construct()\n {\n $this->setUpTableFactory();\n $this->setupElementFactory();\n $this->loadConfig();\n }",
"public function __construct()\n {\n $this->registerBaseServiceProviders();\n\n $this->registerCoreContainerAliases();\n }",
"public function __construct()\n {\n $this->setRequiredFields($this->_aDefaultRequiredFields);\n\n $aRequiredFields = oxRegistry::getConfig()->getConfigParam('aMustFillFields');\n if (is_array($aRequiredFields)) {\n $this->setRequiredFields($aRequiredFields);\n }\n }",
"public function __construct()\n {\n if (5 == func_num_args()) {\n $this->serviceName = func_get_arg(0);\n $this->template = func_get_arg(1);\n $this->replicas = func_get_arg(2);\n $this->selector = func_get_arg(3);\n $this->volumeClaimTemplates = func_get_arg(4);\n }\n }",
"function __construct()\n {\n $argn = func_num_args();\n $argv = func_get_args();\n\n if (method_exists($this, $f='__construct'.$argn))\n {\n call_user_func_array(array($this,$f), $argv);\n }\n }",
"public function __construct() {\t\t\n\t\t$a = func_get_args();\n $i = func_num_args();\n\t\t\n if (method_exists($this, $f='__construct'.$i))\n call_user_func_array(array($this, $f), $a);\n\t}",
"public function __construct() {\n $this->bootstrap = $this->Plugin();\n $this->crudService = $this->Plugin()->get('shopware_attribute.crud_service');\n }",
"public function __construct() {\n\n\t\t$this->registerDefaultBindings();\n\t\t$this->registerDefaultProviders();\n\t\t$this->registerDefaultProxies();\n\t}",
"public function __construct()\n {\n $this->abertura_contador_repository = app(AberturaContadorRepository::class);\n $this->abertura_contador_patrimonio_repository = app(AberturaContadorPatrimonioRepository::class);\n $this->gerarChamadoService = app(GerarChamadoService::class);\n\n parent::__construct();\n }",
"protected function __construct() {\n $a = func_get_args();\n $i = func_num_args();\n if (method_exists($this,$f='__construct'.$i) && $i>0) {\n call_user_func_array(array($this,$f),$a);\n }\n\t\telseif(method_exists($this,$f='__construct0')){\n\t\t\tcall_user_func_array(array($this,$f),array());\n\t\t}\n }",
"function __construct() {\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tparent::__construct();\n\t\t\t}\n\t\t}",
"function __construct()\n\t\t{\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t}",
"public function __construct()\n {\n // initialize the default configuration\n $this->initDefaultDirectories();\n $this->initDefaultLoggers();\n $this->initDefaultScanners();\n $this->initDefaultExtractors();\n $this->initDefaultProvisioners();\n $this->initDefaultInitialContext();\n }",
"public function createObjectCanDoConstructorInjectionWithDifficultArguments() {\n\t\t$firstValue = \"Hir hier deser d'Sonn am, fu dem Ierd d'Liewen, ze schéinste Kirmesdag hannendrun déi.\";\n\t\t$secondValue = 'Oho ha halo\\' maksimume, \"io fari jeso naŭ plue\" om backslash (\\\\)nea komo triliono postpostmorgaŭ.';\n\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $firstValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, $secondValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\t\t$this->assertEquals($firstValue, $object->argument1, 'The first value (string with quotes) has not been constructor-injected although it should have been.');\n\t\t$this->assertEquals($secondValue, $object->argument2, 'The second value (string with double quotes and backslashes) has not been constructor-injected although it should have been.');\n\t}",
"public function __construct()\n {\n $this->initIngredientsQuantityTrait();\n $this->initCreateDateAwareTrait();\n }",
"public function __construct()\n {\n $this->initializeSingleton();\n\n $this->container = new Container();\n\n $this->loadServices($this->container);\n }",
"public function __construct(Container $container) {\n $this->_commonService = $container->get(Service::class);\n $this->_userService = $container->get(UserService::class);\n $this->_authorize = $container->get('authorize');\n }",
"public function __construct()\n {\n $this->container = null;\n $this->alreadyUsedMethodNames = [];\n $this->alreadyUsedMethodNamesInterface = [];\n $this->_usePrefixInMethodNames = true;\n $this->useCustomInterfaces = true;\n $this->_allPrefixes = [];\n $this->customTemplates = [];\n }",
"function __construct()\n\t\t{\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t}",
"public function __construct()\n {\n $this->initClasses();\n }",
"public function createObjectCanDoSimpleConstructorInjection() {\n\t\t$injectedClassName = uniqid('Injected');\n\t\teval('namespace F3\\Virtual; class ' . $injectedClassName . '{}');\n\t\t$injectedClassName = 'F3\\Virtual\\\\' .$injectedClassName;\n\t\t$injectedClass = new $injectedClassName();\n\t\t$this->mockObjectManager->expects($this->once())->method('getObject')->with($injectedClassName)->will($this->returnValue($injectedClass));\n\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $injectedClassName, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_OBJECT),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, 42, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(3, 'Foo Bar Skårhøj', \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\n\t\t$injectionSucceeded = (\n\t\t\t$object->argument1 === $injectedClass &&\n\t\t\t$object->argument2 === 42 &&\n\t\t\t$object->argument3 === 'Foo Bar Skårhøj'\n\t\t);\n\t\t$this->assertTrue($injectionSucceeded, 'The class Injected class has not been (correctly) constructor-injected although it should have been.');\n\t}",
"public function __construct()\n {\n // Bind Faker instance if available\n if (class_exists('Faker\\Factory')) {\n $this->faker = Faker::create();\n }\n }",
"public function __construct()\n {\n // Get the module factory instance\n $this->moduleFactory = App::make(ModuleFactoryContract::class);\n\n // Get the installation repository instance\n $this->installationRepository = App::make(InstallationRepositoryContract::class);\n }",
"public function __construct()\n {\n if (9 == func_num_args()) {\n $this->availableReplicas = func_get_arg(0);\n $this->latestVersion = func_get_arg(1);\n $this->observedGeneration = func_get_arg(2);\n $this->replicas = func_get_arg(3);\n $this->unavailableReplicas = func_get_arg(4);\n $this->updatedReplicas = func_get_arg(5);\n $this->conditions = func_get_arg(6);\n $this->details = func_get_arg(7);\n $this->readyReplicas = func_get_arg(8);\n }\n }",
"public function __construct()\n {\n $this->propertyHandler = container_resolve(PropertyHandler::class, [$this]);\n $this->relationHandler = container_resolve(RelationHandler::class, [$this]);\n $this->actionHandler = container_resolve(ActionHandler::class, [$this]);\n }",
"public function __construct()\n {\n $this->kitchenRecipeRepository = app(KitchenRecipeRepository::class);\n $this->kitchenIngredientRepository = app(KitchenIngredientRepository::class);\n $this->kitchenIngredientKitchenRecipeRepository = app(KitchenIngredientKitchenRecipeRepository::class);\n }",
"public function __construct()\n {\n //koji su mu prosledjeni\n $a = func_get_args();\n $i = func_num_args();\n $f = \"__construct\" . $i;\n if (method_exists($this, $f)) {\n call_user_func_array(array($this, $f), $a);\n\n }\n\n }",
"public function __construct()\n {\n $this->prophet = new Prophet();\n $this->CantineUserRepository = new CantineUserInMemoryRepository();\n $this->TicketRegistrar = $this->prophet->prophesize(TicketRegistrar::class);\n $this->dispatcher = $this->prophet->prophesize(EventBus::class);\n $this->bus = $this->prophet->prophesize(CommandBus::class);\n }",
"public function __construct()\n {\n\n $this->postService = new PostService();\n $this->categoryService = new CategoryService();\n }",
"public function __construct() {\n $this->instance = & get_instance();\n $this->_db = $this->instance->load->database('', TRUE);\n\n $args = func_get_args(); //get arguments passed to function\n $numArgs = func_num_args(); //get number of argumetns passed to function\n\n if ($numArgs == 1) {\n if (is_int($args[0])) {\n if (method_exists($this, $func = '__constructInt')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n } else if (is_string($args[0])) {\n if (method_exists($this, $func = '__constructStr')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n } else if (is_bool($args[0])) {\n if (method_exists($this, $func = '__constructBool')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n }\n } else if ($numArgs > 1) {\n if (method_exists($this, $func = '__construct' . $numArgs)) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n }\n }",
"public function __construct(ContainerInterface $container)\n {\n $this->authService = new CAuthService();\n $this->userModel = new User();\n $this->authHandler = new CAuthHandler();\n $this->email = new CSendEmail();\n }",
"protected function _construct()\n {\n $this->_init(SomethingElse::class, \\Umc\\Sample\\Model\\ResourceModel\\SomethingElse::class);\n }",
"public function __construct(\n AutoQuoteRepositoryInterface $autoQuoteRepository,\n CategoryRepositoryInterface $categoryRepository,\n DealerApplicationRepositoryInterface $dealerApplicationRepository,\n FeatureRepositoryInterface $features,\n UsedVehicleRepositoryInterface $usedVehicleRepository,\n UserRepositoryInterface $userRepository,\n VehicleAssetRepositoryInterface $vehicleAssetRepository,\n VehicleMakeRepositoryInterface $vehicleMakeRepository,\n VehicleModelRepositoryInterface $vehicleModelRepository,\n VehicleStyleRepositoryInterface $vehicleStyleRepository,\n VehicleYearRepositoryInterface $vehicleYearRepository,\n ZipcodeRepositoryInterface $zipcodeRepository)\n {\n $this->geoip = json_decode(GeoIp::getGeoIp('json'));\n $this->autoQuoteRepository = $autoQuoteRepository;\n $this->categoryRepository = $categoryRepository;\n $this->features = $features;\n $this->usedVehicleRepository = $usedVehicleRepository;\n $this->userRepository = $userRepository;\n $this->zipcodeRepository = $zipcodeRepository;\n $this->vehicleAssetRepository = $vehicleAssetRepository;\n $this->vehicleMakeRepository = $vehicleMakeRepository;\n $this->vehicleModelRepository = $vehicleModelRepository;\n $this->vehicleStyleRepository = $vehicleStyleRepository;\n $this->vehicleYearRepository = $vehicleYearRepository;\n $this->dealerApplicationRepository = $dealerApplicationRepository;\n }",
"protected function __construct() {\n\n // Cargamos Clases.\n $this -> setup_hooks();\n }",
"protected function __construct() {\n\n // Cargamos Clases.\n $this -> setup_hooks();\n }",
"public function __construct()\r\n {\r\n if(3 == func_num_args())\r\n {\r\n $this->compositeFault = func_get_arg(0);\r\n $this->customerSupport = func_get_arg(1);\r\n $this->servicePoints = func_get_arg(2);\r\n }\r\n }",
"function __construct()\n\t{\n\t\t$this->customerService = new CustomerService;\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n // extensions, you'll need to inject services using this constructor\n }",
"public function __construct()\n {\n $this->registerComposerAutoload();\n $app = $this->makeApplication();\n $this->boot($app);\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->clientArticleService = app()->make(ClientArticleService::class);\n }",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->persons = func_get_arg(0);\n $this->companies = func_get_arg(1);\n }\n }",
"public function __construct()\n {\n $this->middleware('auth');\n\n $this->cityRepo = app(CityRepository::class);\n\n $this->playerRepo = app(PlayerRepository::class);\n\n $this->locationRepo = app(LocationRepository::class);\n\n }",
"public function __construct()\n\t{\n\t\t$this->userService = new UserService();\n\t\t$this->helper = new HelperController();\n\t}",
"protected function _construct()\n {\n $this->_init(QuotePickupLocation::class, QuotePickupLocationResource::class);\n }",
"public function __construct()\n {\n $this->Seat_Service = new Seat();\n $this->Permission_Service = new Permission();\n $this->User_Service = new UserService();\n $this->Contace_Service = new ContactList(); \n $this->Assessment_Service = new Assessment(); \n $this->Report_Service = new Report(); \n $this->student_paravalue_repo = new StudentParaValue();\n $this->student_para_repo = new StudentParameter(); \n $this->Utils = new Utils();\n }",
"public function __construct()\n {\n $this->applyDefaultValues();\n }",
"public function __construct()\n {\n $this->applyDefaultValues();\n }",
"public function __construct()\n {\n $this->applyDefaultValues();\n }",
"public function __construct()\n {\n $this->applyDefaultValues();\n }",
"public function __construct()\n {\n $this->applyDefaultValues();\n }",
"final public function __construct()\n {\n // Mengecek folder vendor jika sudah ada\n // Untuk memuat Autoload yang di buat oleh composer.\n $vendor = getProjectDirectory() . DIRECTORY_SEPARATOR . '/vendor';\n \n if ( is_dir( $vendor ) ) {\n if ( file_exists( $vendor . $this->autoload ) ) {\n require $vendor . $this->autoload;\n }\n return false;\n }\n spl_autoload_register( 'Autoload', 'loadClassBySplAutoload' );\n }",
"public function __construct() {\n $this->oUserService = new UserService();\n $this->oArticleService = new ArticleService();\n $this->oLeagueService = new LeagueService();\n// $this->oTeamService = new TeamService();\n// $this->oMatchService = new MatchService(); \n }",
"public function __construct()\n {\n $this->middleware('auth');\n\n $this->userRepository = new \\App\\Repositories\\UserRepository();\n $this->companyRepository = new \\App\\Repositories\\CompanyRepository();\n }",
"public function __construct()\n {\n parent::__construct();\n $this->userService = App::make(UserService::class);\n }",
"public function __construct()\n {\n $this->extendableConstruct();\n }",
"public function __construct()\n {\n // Dependencies automatically resolved by service container...\n $this->user = auth()->user();\n }",
"public function __construct()\n {\n $param = func_get_args();\n switch (count($param)) {\n case 0:\n $this->setupApiConfigFromEnv();\n $this->setupApiConfigFromFile();\n break;\n case 1:\n $this->setupApiConfigFromFile($param[0]);\n break;\n case 2:\n $this->api_key = $param[0];\n $this->api_secret = $param[1];\n break;\n default:\n throw new ApiConstructorException('Invalid constructor parameters.');\n }\n $this->client = new Client(['base_uri' => self::BASE_URI, 'timeout' => self::TIMEOUT]);\n }",
"public function __construct(){\r\n $this->init_hooks();\r\n $this->includes_and_requires();\r\n }",
"public function __construct($arg = null)\n {\n }",
"public function __construct()\n\t\t{\n\t\t\t$this->doctrineHelper = new DoctrineHelper();\n\t\t\tself::$entityManager = $this->doctrineHelper->entityManager;\n\n\t\t\t$classes = $this->doctrineHelper->entityManager->getMetadataFactory()->getAllMetadata();\n\n\t\t\t$schemaTool = new SchemaTool($this->doctrineHelper->entityManager);\n\t\t\t$schemaTool->dropSchema($classes);\n\t\t\t$schemaTool->createSchema($classes);\n\n\t\t\t$appBuilderFactory = new Conpago\\AppBuilderFactory();\n\t\t\t$appBuilder = $appBuilderFactory->createAppBuilder(\"Web\", \".\");\n\t\t\t$appBuilder->registerAdditionalModule(new TestModule());\n\t\t\t$appBuilder->buildApp();\n\t\t\t$this->container = $appBuilder->getContainer();\n\n\t\t\t$this->passwordHasher = $this->container->resolve('Conpago\\Helpers\\Contract\\IPasswordHasher');\n\n\t\t\t$this->presenter = $this->container->resolve('Conpago\\Presentation\\Contract\\IJsonPresenter');\n\t\t}",
"public function __construct()\n {\n parent::__construct();\n $this->payoutService = new PayoutService();\n $this->winningService = new WinningService();\n }",
"public function ensureRequiredFactoriesFor(AutoWiringClassInterface $class): void;",
"public function __construct(){\n\t\tif(method_exists($this, 'initialize')){\n\t\t\t$this->initialize();\n\t\t}\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function initializeControllerArgumentsBaseValidators() {}",
"public function __construct()\r\n {\r\n $this->includes();\r\n $this->setup();\r\n $this->hooks();\r\n }",
"public function __construct()\n {\n $this->userService = Core::getService(UserService::class);\n $this->applicationService = Core::getService(ApplicationService::class);\n $this->libraryService = Core::getService(LibraryService::class);\n $this->middleware('auth');\n }",
"public function __construct(ContainerInterface $container)\n {\n //Set stuff\n $this->container = $container;\n }",
"public function setUp()\n {\n // leading to an errant invalid class alias being reported.\n $this->container = $this->prophesize(ServiceManager::class);\n $this->container->willImplement(ContainerInterface::class);\n }",
"public function __construct() {\r\n\t\t$this->daoFactory = new DaoFactory ();\r\n\t\t$this->daoFactory->initDbResources ();\r\n\t\t$this->appUserDao = $this->daoFactory->getAppUserDao ();\r\n\t\t$this->coreAuthenticationFactory = new CoreAuthenticationFactory ( $this->appUserDao );\r\n\t\t$this->validationFactory = new ValidationFactory ();\r\n\t\t$this->appName = APP_NAME;\r\n\t\t$this->baseUrl = \"http://\" . BASE_URL;\r\n\t}",
"public function __construct() {\n\t\t$this->autoSetConfigurationFolder();\n\t}",
"public function __construct(ContainerInterface $container) {\n $this->container = $container;\n\n $this->repo = new CompanyRepository();\n }",
"function __construct() {\n\t\t$this->Inject();\n\t}",
"protected function _construct($arguments){\n\t\treturn parent::_construct($arguments);\n\t}",
"public function __construct()\n {\n if (3 == func_num_args()) {\n $this->command = func_get_arg(0);\n $this->environment = func_get_arg(1);\n $this->image = func_get_arg(2);\n }\n }",
"public function __construct()\n {\n if (10 == func_num_args()) {\n $this->productTypeUuid = func_get_arg(0);\n $this->customer = func_get_arg(1);\n $this->adults = func_get_arg(2);\n $this->children = func_get_arg(3);\n $this->seniors = func_get_arg(4);\n $this->arrivalDate = func_get_arg(5);\n $this->partnerReference = func_get_arg(6);\n $this->options = func_get_arg(7);\n $this->message = func_get_arg(8);\n $this->timeSlotUuid = func_get_arg(9);\n }\n }",
"public function __construct()\n {\n $this->checkrequest();\n $this->initialize();\n }",
"public function __construct() {\n $this->addCompilerPass(new AddConsoleCommandPass());\n $this->addCompilerPass(new ControllerServicePass());\n parent::__construct();\n }",
"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 {\n $this->arguments = func_get_args();\n }",
"function __construct() {\n $bootstrap = new Bootstrap();\n \n $this->entityManager = $bootstrap->getEntityManager();\n }",
"public function __construct()\n {\n parent::__construct();\n $this->userRepository = new UserRepository();\n }",
"function __construct()\n {\n if (AhpMethod::first() == null) {\n $ahp_method_service = new AhpMethodService();\n $ahp_method_service->recalculateAhpValues();\n }\n\n // Generate wp method values\n if (WpMethod::first() == null) {\n $wp_method_service = new WpMethodService();\n $wp_method_service->recalculateWpValues();\n }\n }",
"public function __construct()\r\n\t{\r\n\t\t// Services dont have constructors Apparently\r\n\t\t//parent::__construct();\r\n\t\t//\r\n\r\n\t}",
"public function __construct()\n {\n $this->initContrexxCaching();\n $this->initOPCaching();\n $this->initUserCaching();\n $this->getActivatedCacheEngines();\n }",
"public function __construct(array $parameters = []) {\n // Initialize your context here\n }",
"function constructor_inject($instance, $args, $exclude = [], $classContext = null)\n{\n $classContext = $classContext?:$instance;\n\n $reflection = new ReflectionClass($classContext);\n $constructor = $reflection->getConstructor();\n $params = $constructor->getParameters();\n \n foreach($args as $pos => $value) {\n if(in_array($pos, $exclude, true)) {\n continue;\n }\n \n $param = $params[$pos];\n $paramName = $param->getName();\n if(in_array($paramName, $exclude, true)) {\n continue;\n }\n \n $prop = $reflection->getProperty($paramName);\n $prop->setAccessible(true);\n $prop->setValue($instance, $value);\n }\n}"
]
| [
"0.6576044",
"0.64033335",
"0.61507124",
"0.6124889",
"0.6023206",
"0.5994281",
"0.5918725",
"0.5856044",
"0.5831549",
"0.58202493",
"0.5814662",
"0.5790529",
"0.5769353",
"0.57320535",
"0.57013196",
"0.5679271",
"0.56762344",
"0.5662175",
"0.5624795",
"0.56237614",
"0.5623123",
"0.560601",
"0.56026083",
"0.5601939",
"0.5581648",
"0.5579816",
"0.55751735",
"0.557468",
"0.5574124",
"0.5564734",
"0.5563577",
"0.5561637",
"0.5558147",
"0.5554337",
"0.55537087",
"0.55518556",
"0.5547574",
"0.553908",
"0.55390567",
"0.5530981",
"0.5526168",
"0.5522412",
"0.5512072",
"0.5512072",
"0.5506341",
"0.54930294",
"0.5487161",
"0.548492",
"0.54745024",
"0.5466578",
"0.5447787",
"0.544708",
"0.54244345",
"0.54137003",
"0.5409589",
"0.5409589",
"0.5409589",
"0.5409589",
"0.5409589",
"0.5409533",
"0.5405695",
"0.5386863",
"0.5386176",
"0.5370542",
"0.5357806",
"0.5355741",
"0.53555775",
"0.5344012",
"0.534336",
"0.5341447",
"0.5332838",
"0.5325096",
"0.5320279",
"0.5320279",
"0.5320279",
"0.5320279",
"0.5320279",
"0.53177094",
"0.5317563",
"0.53142565",
"0.53135085",
"0.5310692",
"0.5304017",
"0.5303584",
"0.53002524",
"0.52975184",
"0.5297243",
"0.5293338",
"0.5281725",
"0.52751064",
"0.5269522",
"0.5267892",
"0.52675205",
"0.52665097",
"0.5264927",
"0.5261184",
"0.5259432",
"0.52585006",
"0.5256866",
"0.5247252"
]
| 0.571028 | 14 |
Checks and resolves dependencies of the constructor arguments and prepares an array of constructor arguments (strings) which can be used in a "new" statement to instantiate the component. | public function injectConstructorArguments($constructorArguments, &$injectedArguments, &$preparedArguments)
{
foreach ($constructorArguments as $index => $constructorArgument) {
// TODO Testing the prefix is not very sophisticated. Should be is_object()
if (substr($constructorArgument, 0, 3) === self::PACKAGE_PREFIX . '_') {
$value = $this->getComponent($constructorArgument);
} else {
$value = $constructorArgument;
}
if (is_string($value)) {
$escapedValue = str_replace("'", "\\'", str_replace('\\', '\\\\', $value));
$preparedArguments[] = "'" . $escapedValue . "'";
} elseif (is_numeric($value)) {
$preparedArguments[] = $value;
} elseif ($value === null) {
$preparedArguments[] = 'NULL';
} else {
$preparedArguments[] = '$injectedArguments[' . $index . ']';
$injectedArguments[$index] = $value;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createObjectCanDoConstructorInjectionWithDifficultArguments() {\n\t\t$firstValue = \"Hir hier deser d'Sonn am, fu dem Ierd d'Liewen, ze schéinste Kirmesdag hannendrun déi.\";\n\t\t$secondValue = 'Oho ha halo\\' maksimume, \"io fari jeso naŭ plue\" om backslash (\\\\)nea komo triliono postpostmorgaŭ.';\n\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $firstValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, $secondValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\t\t$this->assertEquals($firstValue, $object->argument1, 'The first value (string with quotes) has not been constructor-injected although it should have been.');\n\t\t$this->assertEquals($secondValue, $object->argument2, 'The second value (string with double quotes and backslashes) has not been constructor-injected although it should have been.');\n\t}",
"public function createObjectCanDoConstructorInjectionWithArrays() {\n\t\t$someArray = array(\n\t\t\t'foo' => 'bar',\n\t\t\t199 => 837,\n\t\t\t'doo' => TRUE\n\t\t);\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $someArray, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\t\t$this->assertEquals($someArray, $object->argument1, 'The array has not been constructor-injected although it should have been.');\n\t}",
"public function __construct()\n {\n $this->arguments = func_get_args();\n }",
"public function getConstructorArguments() {}",
"public function __construct() {\t\t\n\t\t$a = func_get_args();\n $i = func_num_args();\n\t\t\n if (method_exists($this, $f='__construct'.$i))\n call_user_func_array(array($this, $f), $a);\n\t}",
"public function __construct()\n {\n # no args = no further setup\n if (func_num_args() == 0) return;\n\n # use this to work out whether an arg refers to an Orm name\n $name_specified = 0;\n\n if (is_array($input = func_get_arg(0))) { # array = new object with initial values\n if (func_num_args() == 2)\n $name_specified = 1;\n\n foreach($input as $key => $val)\n $this->$key = $val;\n\n }\n\n if ($name_specified > 0) {\n $this->setup_name = func_get_arg($name_specified);\n }\n }",
"protected function vedConstructArg(array $args = array()) {\n }",
"abstract protected function construct($params);",
"protected function __construct() {\n $a = func_get_args();\n $i = func_num_args();\n if (method_exists($this,$f='__construct'.$i) && $i>0) {\n call_user_func_array(array($this,$f),$a);\n }\n\t\telseif(method_exists($this,$f='__construct0')){\n\t\t\tcall_user_func_array(array($this,$f),array());\n\t\t}\n }",
"public function __construct(array $arguments) {\t\t\n\t\tlist ($this->command, \n\t\t\t $this->arguments,\n\t\t\t $this->flags) = $this->parseArguments(array_slice($arguments, 1));\n\t\t\t\n\t\tif (is_null($this->command)) {\n\t\t\tif (in_array('--version', $this->flags)) {\n\t\t\t\techo 'This is Cobweb ' . Cobweb::VERSION;\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\t\n\t\t\t$this->fail('Specify a command to invoke');\n\t\t}\n\t\t\n\t\t$this->command = $this->loadCommand($this->command);\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"public function __construct() {\r\n\t\t$args = func_get_args ();\r\n\t\t$num_args = func_num_args ();\r\n\t\t$method = \"__construct\" . $num_args;\r\n\t\t\r\n\t\tif (method_exists ( $this, $method ))\r\n\t\t\tcall_user_func_array ( array (\r\n\t\t\t\t\t$this,\r\n\t\t\t\t\t$method \r\n\t\t\t), $args );\r\n\t\telse\r\n\t\t\tdie ( \"CONSTRUCT '\" . $method . \"' NOT DEFINED!\" );\r\n\t}",
"function __construct()\n\t\t{\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t}",
"public function __construct(array $arguments = array()) {\n\n\t}",
"function __construct()\n {\n $argn = func_num_args();\n $argv = func_get_args();\n\n if (method_exists($this, $f='__construct'.$argn))\n {\n call_user_func_array(array($this,$f), $argv);\n }\n }",
"public function __construct(array $arguments)\n {\n $this->arguments = $arguments;\n }",
"function __construct()\n\t\t{\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t}",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->name = func_get_arg(0);\n $this->values = func_get_arg(1);\n }\n }",
"function __construct() {\n\t\t\t$a = func_get_args();\n\t\t\t$i = func_num_args();\n\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\tcall_user_func_array(array($this,$f),$a);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tparent::__construct();\n\t\t\t}\n\t\t}",
"function __construct($arguments){\n\t\t}",
"public function __construct()\n {\n //koji su mu prosledjeni\n $a = func_get_args();\n $i = func_num_args();\n $f = \"__construct\" . $i;\n if (method_exists($this, $f)) {\n call_user_func_array(array($this, $f), $a);\n\n }\n\n }",
"public function autoWiringForConstructorInjectionRespectsAlreadyDefinedArguments() {\n\t\t$objectName = 'F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected';\n\t\t$this->mockObjectManager->expects($this->at(0))->method('getObject')->with('F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface')->will($this->returnValue(new \\F3\\FLOW3\\Tests\\Object\\Fixture\\SomeImplementation));\n\t\t$this->mockReflectionService->expects($this->once())->method('getClassConstructorName')->with($objectName)->will($this->returnValue('__construct'));\n\t\t$constructorParameters = array(\n\t\t\t'argument1' => array(\n\t\t\t\t'position' => 0,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface'\n\t\t\t),\n\t\t\t'argument2' => array(\n\t\t\t\t'position' => 1,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass'\n\t\t\t)\n\t\t);\n\t\t$this->mockReflectionService->expects($this->at(1))->method('getMethodParameters')->with($objectName, '__construct')->will($this->returnValue($constructorParameters));\n\n\t\t$injectedClassName = uniqid('Injected');\n\t\teval('namespace F3\\Virtual; class ' . $injectedClassName . ' extends \\F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass {}');\n\t\t$injectedClassName = 'F3\\Virtual\\\\' .$injectedClassName;\n\t\t$injectedClass = new $injectedClassName();\n\t\t$this->mockObjectManager->expects($this->at(1))->method('getObject')->with($injectedClassName)->will($this->returnValue($injectedClass));\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, $injectedClassName, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_OBJECT)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject($objectName, $objectConfiguration);\n\t\t$this->assertSame($object->argument2, $injectedClass, 'Autowiring didn\\'t respect that the second constructor argument was already set in the object configuration!');\n\t}",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->persons = func_get_arg(0);\n $this->companies = func_get_arg(1);\n }\n }",
"public function goodConstructorArgumentsProvider()\n {\n return [\n 'NULL' => [null, true],\n 'integer' => [1, true],\n 'double' => [1.9999, true],\n 'string' => ['str', true],\n ToString::class => [new ToString(), true],\n 'array' => [[], false],\n 'stdClass' => [new \\stdClass, false],\n __CLASS__ => [$this, false],\n ];\n }",
"public function createObjectCanDoSimpleConstructorInjection() {\n\t\t$injectedClassName = uniqid('Injected');\n\t\teval('namespace F3\\Virtual; class ' . $injectedClassName . '{}');\n\t\t$injectedClassName = 'F3\\Virtual\\\\' .$injectedClassName;\n\t\t$injectedClass = new $injectedClassName();\n\t\t$this->mockObjectManager->expects($this->once())->method('getObject')->with($injectedClassName)->will($this->returnValue($injectedClass));\n\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $injectedClassName, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_OBJECT),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, 42, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(3, 'Foo Bar Skårhøj', \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\n\t\t$injectionSucceeded = (\n\t\t\t$object->argument1 === $injectedClass &&\n\t\t\t$object->argument2 === 42 &&\n\t\t\t$object->argument3 === 'Foo Bar Skårhøj'\n\t\t);\n\t\t$this->assertTrue($injectionSucceeded, 'The class Injected class has not been (correctly) constructor-injected although it should have been.');\n\t}",
"public function build(array $arguments = [])\n {\n if (Test::assertClassHasConstructor($this->className)) {\n if (!Test::assertRequiredConstructorParameters($this->className, $arguments)) {\n throw new \\Exception('Missing Argument '.(count($arguments) + 1).' for '.$this->className.'::__construct');\n }\n\n return $this->getReflectionClass()->newInstanceArgs($arguments);\n }\n\n return $this->getReflectionClass()->newInstance();\n }",
"protected function _construct($arguments){\n\t\treturn parent::_construct($arguments);\n\t}",
"public function __construct()\n {\n $args = func_get_args();\n\n // if an array or object load using fromArray\n if (!empty($args[0]) && (Validate::isAssociativeArray($args[0]) || is_object($args[0]))) {\n $this->fromArray((array)$args[0]);\n }\n }",
"public function goodConstructorArgumentsProvider(): array\n {\n return [\n 'NULL' => [null],\n 'integer' => [1],\n 'double' => [1.9999],\n 'string' => ['str'],\n ToString::class => [new ToString()],\n 'array' => [[]],\n 'stdClass' => [new \\stdClass()],\n __CLASS__ => [$this],\n\n 'string: ' . ToString::class => [ToString::class, true],\n 'string: ' . stdClass::class => [stdClass::class, true],\n 'non string as `$obj` arg' => [new stdClass(), true],\n ];\n }",
"public function __construct(array $params = []);",
"function __construct()\r\n {\r\n $this->field_names = func_get_args();\r\n }",
"public function initializeArguments() {}",
"public function initializeArguments() {}",
"public function initializeArguments() {}",
"public function initializeArguments() {}",
"public function __construct()\n {\n if (5 == func_num_args()) {\n $this->serviceName = func_get_arg(0);\n $this->template = func_get_arg(1);\n $this->replicas = func_get_arg(2);\n $this->selector = func_get_arg(3);\n $this->volumeClaimTemplates = func_get_arg(4);\n }\n }",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->catalogName = func_get_arg(0);\n $this->brands = func_get_arg(1);\n }\n }",
"public function __construct($string, array $arguments) {\n $this->string = (string) $string;\n $this->arguments = $arguments;\n }",
"public function autoWiringWorksForConstructorInjection() {\n\t\t$objectName = 'F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected';\n\t\t$this->mockObjectManager->expects($this->at(0))->method('getObject')->with('F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface')->will($this->returnValue(new \\F3\\FLOW3\\Tests\\Object\\Fixture\\SomeImplementation));\n\t\t$this->mockObjectManager->expects($this->at(1))->method('getObject')->with('F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass')->will($this->returnValue(new \\F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass));\n\t\t$this->mockReflectionService->expects($this->once())->method('getClassConstructorName')->with($objectName)->will($this->returnValue('__construct'));\n\t\t$constructorParameters = array(\n\t\t\t'argument1' => array(\n\t\t\t\t'position' => 0,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\SomeInterface'\n\t\t\t),\n\t\t\t'argument2' => array(\n\t\t\t\t'position' => 1,\n\t\t\t\t'byReference' => FALSE,\n\t\t\t\t'array' => FALSE,\n\t\t\t\t'optional' => FALSE,\n\t\t\t\t'allowsNull' => FALSE,\n\t\t\t\t'class' => 'F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass'\n\t\t\t)\n\t\t);\n\t\t$this->mockReflectionService->expects($this->at(1))->method('getMethodParameters')->with($objectName, '__construct')->will($this->returnValue($constructorParameters));\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithSomeImplementationInjected');\n\n\t\t$object = $this->objectBuilder->createObject($objectName, $objectConfiguration);\n\t\t$this->assertType('F3\\FLOW3\\Tests\\Object\\Fixture\\SomeImplementation', $object->argument1, 'Autowiring didn\\'t work out for ' . $objectName);\n\t}",
"public function __construct(...$arguments)\n {\n $this->arguments = $arguments;\n $this->argumentsCount = count($arguments);\n $this->index = [];\n $this->callables = [];\n }",
"function __construct($args)\n\t\t{\n\t\t\t$this->validateFields\t=\t$args;\n\t\t}",
"public function __construct($argument1)\n {\n }",
"public function __construct() {\n\t\t\t\t$this->buildDbInterface();\n\t\t\t\t$in = func_get_args();\n\t\t\t\t$i = func_num_args();\n\t\t\t\tif (method_exists($this,$f='__construct'.$i)) {\n\t\t\t\t\tcall_user_func_array(array($this,$f),$in);\n\t\t\t\t} \n\t\t}",
"function mdl_create_class_constructor(array $properties)\n{\n $required_parameters = array_map(function ($item) {\n return mdl_create_function_parameter([\n 'name' => $item['name'],\n 'type' => $item['type'] ?? null,\n 'optional' => false\n ]);\n }, array_filter($properties, function ($item) {\n return !isset($item['optional']) || (isset($item['optional']) && boolval($item['optional']) === false);\n }));\n $optional_parameters = array_map(function ($item) {\n return mdl_create_function_parameter([\n 'name' => $item['name'],\n 'type' => $item['type'] ?? null,\n 'optional' => true,\n 'default' => $item['default'] ?? null\n ]);\n }, array_filter($properties, function ($item) {\n return isset($item['optional']) && boolval($item['optional']) === true;\n }));\n $constructor_parameters = [...$required_parameters, ...$optional_parameters];\n $constructor = PHPClassMethod(\n '__construct',\n $constructor_parameters,\n null,\n 'public',\n 'Create new class instance'\n );\n foreach ($constructor_parameters as $parameter) {\n $constructor = $constructor->addLine(\"\\$this->\" . $parameter->name() . ' = ' . \"\\$\" . $parameter->name());\n }\n return $constructor;\n}",
"public function __construct()\n\t{\n\t\t$array = $_SERVER['argv'];\n\t\t$this->command = $array[1];\n\t\tunset($array[0]);\n\t\tunset($array[1]);\n\t\tforeach ($array as $parameter) {\t\t\t\n\t\t\tif (strstr($parameter, '=')) {\n\t\t\t\t$explode = explode('=', $parameter);\n\t\t\t\t$this->parameters[str_replace('--', '', $explode[0])] = $explode[1];\n\t\t\t} else {\n\t\t\t\t$this->parameters[] = str_replace('--', '', $parameter);\n\t\t\t}\t\t\t\n\t\t}\n\t}",
"public function __construct($args = '')\n {\n }",
"public function __construct()\n {\n if (3 == func_num_args()) {\n $this->command = func_get_arg(0);\n $this->environment = func_get_arg(1);\n $this->image = func_get_arg(2);\n }\n }",
"public function __construct($args=[]) {\n $this->transport_name = $args['transport_name'] ?? '';\n $this->batch_name = $args['batch_name'] ?? '';\n $this->transport_cost = $args['transport_cost'] ?? '';\n $this->used_date = $args['used_date'] ?? '';\n\n }",
"function __construct($argument_order)\n {\n $this->argument_order = $argument_order;\n }",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->names = func_get_arg(0);\n $this->sizeBytes = func_get_arg(1);\n }\n }",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->causes = func_get_arg(0);\n $this->message = func_get_arg(1);\n }\n }",
"public function prepareArguments() {}",
"public function __construct()\n {\n if (13 == func_num_args()) {\n $this->name = func_get_arg(0);\n $this->mvaNumber = func_get_arg(1);\n $this->companyPhone = func_get_arg(2);\n $this->companyEmail = func_get_arg(3);\n $this->id = func_get_arg(4);\n $this->customerNumber = func_get_arg(5);\n $this->resources = func_get_arg(6);\n $this->companyUrl = func_get_arg(7);\n $this->contact = func_get_arg(8);\n $this->address = func_get_arg(9);\n $this->dealer = func_get_arg(10);\n $this->settings = func_get_arg(11);\n $this->country = func_get_arg(12);\n }\n }",
"public function __construct(array $args=array()) {\n $this->parsers = $this->initParsers();\n $this->fields = $this->fields();\n $this->defaultParser = new DefaultParser();\n foreach ($args as $key => $val)\n $this->set($key, $val);\n }",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->clusterRole = func_get_arg(0);\n $this->literals = func_get_arg(1);\n }\n }",
"public function __construct(array $parameters)\n {\n }",
"public function __construct(array $parameters)\n {\n }",
"public function __construct(array $parameters)\n {\n }",
"public function __construct(array $parameters)\n {\n }",
"public function __construct() {\n $this->instance = & get_instance();\n $this->_db = $this->instance->load->database('', TRUE);\n\n $args = func_get_args(); //get arguments passed to function\n $numArgs = func_num_args(); //get number of argumetns passed to function\n\n if ($numArgs == 1) {\n if (is_int($args[0])) {\n if (method_exists($this, $func = '__constructInt')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n } else if (is_string($args[0])) {\n if (method_exists($this, $func = '__constructStr')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n } else if (is_bool($args[0])) {\n if (method_exists($this, $func = '__constructBool')) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n }\n } else if ($numArgs > 1) {\n if (method_exists($this, $func = '__construct' . $numArgs)) {\n call_user_func_array(array($this, $func), $args); //Call $func in this class with $args arguments\n }\n }\n }",
"public function __construct() {\n if ( func_num_args() > 0 ) {\n $this->list = func_get_args();\n } else {\n $this->list = array();\n }\n }",
"public function __construct()\r\n {\r\n if(3 == func_num_args())\r\n {\r\n $this->compositeFault = func_get_arg(0);\r\n $this->customerSupport = func_get_arg(1);\r\n $this->servicePoints = func_get_arg(2);\r\n }\r\n }",
"public function __construct()\n {\n if (11 == func_num_args()) {\n $this->valid = func_get_arg(0);\n $this->country = func_get_arg(1);\n $this->providerType = func_get_arg(2);\n $this->countryCode = func_get_arg(3);\n $this->hostname = func_get_arg(4);\n $this->providerDomain = func_get_arg(5);\n $this->city = func_get_arg(6);\n $this->providerWebsite = func_get_arg(7);\n $this->ip = func_get_arg(8);\n $this->region = func_get_arg(9);\n $this->providerDescription = func_get_arg(10);\n }\n }",
"public function __construct($arguments = null) {\n if (!is_null($arguments) && is_array($arguments) && !empty($arguments)) {\n\n // argument count\n $this->argument_count = count($arguments);\n\n // get script name\n $this->name = basename($arguments[0]);\n $this->path = dirname($arguments[0]);\n\n $args = ScriptArgs::arguments($arguments);\n $arg_count = 0;\n \n $this->flags = new DataStore();\n $this->arguments = new DataStore();\n\n // handle the options\n $this->options = new DataStore($args['options']);\n\n // loop over the flags\n foreach ($args['flags'] as $flag) {\n $this->flags->set($flag,true); \n }\n\n // determine which argument group to use\n if (count($args['commands']) > 0) {\n $args_list = $args['commands'];\n }\n else {\n $args_list = $args['arguments'];\n }\n\n // loop over the arguments\n foreach ($args_list as $argument) {\n // increment arg_count\n $arg_count++;\n $this->arguments->set(\"arg\" . $arg_count,new Parameter($argument)); \n }\n }\n\n }",
"public function __construct(array $arguments)\n {\n foreach ($arguments as $argumentName => $argumentValue) {\n if (!property_exists($this, $argumentName)) {\n throw new \\LogicException(sprintf('Attempting to set undefined property %s on %s',\n $argumentName, get_class($this))\n );\n }\n $this->$argumentName = $argumentValue;\n }\n }",
"public function __construct($strs)\n {\n $this->strs = $strs;\n\n }",
"public function __construct()\n {\n if (4 == func_num_args()) {\n $this->currency = func_get_arg(0);\n $this->name = func_get_arg(1);\n $this->notes = func_get_arg(2);\n $this->price = func_get_arg(3);\n }\n }",
"public function create(string $className, array $args = []);",
"public function __construct($args = array())\n {\n }",
"public function __construct($args = array())\n {\n }",
"public function __construct($args = array())\n {\n }",
"public function __construct($args = array())\n {\n }",
"public function __construct()\n {\n if (5 == func_num_args()) {\n $this->capacity = func_get_arg(0);\n $this->description = func_get_arg(1);\n $this->gender = func_get_arg(2);\n $this->name = func_get_arg(3);\n $this->thingTypeId = func_get_arg(4);\n }\n }",
"function __construct($args)\n {\n if (is_string($args)) {\n $this->ruleID = $args;\n $this->getRules();\n $this->offerID = $this->rules[0][\"offer_idoffer\"];\n } else // if we're creating a new device rule\n {\n\n $this->postData = $args;\n\n $this->offerID = $args[0];\n\n $this->ruleName = $args[1];\n\n $this->redirectOffer = $args[2];\n\n $this->deny = $args[3];\n\n for ($i = 4; $i < count($args); $i++) {\n $this->deviceList[] = $args[$i];\n }\n\n if ($this->deny == true) {\n $this->deny = 1;\n } else {\n $this->deny = 0;\n }\n }\n\n\n }",
"public function __construct()\n {\n $this->argumentDescriptions = [\n 'subject' => new ArgumentDescription(true),\n 'length' => new ArgumentDescription(true, 'int'),\n 'suffix' => new ArgumentDescription(false, 'string', '...'),\n ];\n\n parent::__construct();\n }",
"public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }",
"public function __construct(array $args = [])\n {\n $this->args = $args;\n }",
"public function __construct(){\n\t\tglobal $GLANG;\n\t\t$this->arguments = func_get_args();\n\t\t$this->lang = $GLANG;\n\t\t}",
"public function __construct()\n {\n if (10 == func_num_args()) {\n $this->productTypeUuid = func_get_arg(0);\n $this->customer = func_get_arg(1);\n $this->adults = func_get_arg(2);\n $this->children = func_get_arg(3);\n $this->seniors = func_get_arg(4);\n $this->arrivalDate = func_get_arg(5);\n $this->partnerReference = func_get_arg(6);\n $this->options = func_get_arg(7);\n $this->message = func_get_arg(8);\n $this->timeSlotUuid = func_get_arg(9);\n }\n }",
"public function create(array $arguments = []);",
"private function __construct() {\n $args = func_get_args();\n $this->name = $args[0];\n $this->title = $args[1];\n $this->email = $args[2];\n $this->valediction = $args[3];\n }",
"public function __construct(array $inputs = []){\n\n # Set inputs\n $this->inputs = $inputs;\n\n }",
"public function __construct(array $parameters)\n {\n }",
"public function __construct($params);",
"protected function initializeCommandMethodArguments() {}",
"public static function factory(string $arguments): static\n\t{\n\t\t$arguments = A::map(\n\t\t\t// split by comma, but not inside skip groups\n\t\t\tpreg_split('!,|' . self::OUTSIDE . '!', $arguments),\n\t\t\tfn ($argument) => Argument::factory($argument)\n\t\t);\n\n\t\treturn new static($arguments);\n\t}",
"public function __construct($argv)\n {\n }",
"public function construct() {\n\n }",
"public function __construct() {\n\t\t$this->args = util_cli::getArgs();\n\t}",
"public function __construct()\n {\n $this->processors = func_get_args();\n if (count($this->processors) == 1 && is_array($this->processors[0])) {\n $this->processors = $this->processors[0];\n }\n }",
"public static function make(...$args);",
"public function __construct()\n {\n if (11 == func_num_args()) {\n $this->valid = func_get_arg(0);\n $this->internationalCallingCode = func_get_arg(1);\n $this->countryCode = func_get_arg(2);\n $this->location = func_get_arg(3);\n $this->isMobile = func_get_arg(4);\n $this->type = func_get_arg(5);\n $this->internationalNumber = func_get_arg(6);\n $this->localNumber = func_get_arg(7);\n $this->country = func_get_arg(8);\n $this->countryCode3 = func_get_arg(9);\n $this->currencyCode = func_get_arg(10);\n }\n }",
"public function __construct()\n {\n if (3 == func_num_args()) {\n $this->dialogs = func_get_arg(0);\n $this->language = func_get_arg(1);\n $this->styling = func_get_arg(2);\n }\n }",
"public static function make(...$arguments)\n {\n return new static(...$arguments);\n }",
"public static function make(...$arguments)\n {\n return new static(...$arguments);\n }",
"public static function make(...$arguments)\n {\n return new static(...$arguments);\n }",
"protected function configure()\n {\n $this->addArgument('name', InputArgument::REQUIRED, 'The name of the created component.');\n $this->addOption(\n 'force', 'f', InputOption::VALUE_NONE, \n 'If the component already exists its forced to the overrided.'\n );\n $this->addOption(\n 'constructor', 'c', InputOption::VALUE_NONE,\n 'Creates the new class with its constructor already defined.'\n );\n\n foreach ($this->options() as $opt) {\n $this->addOption(...$opt);\n }\n foreach ($this->arguments() as $arg) {\n $this->addArgument(...$arg);\n }\n }"
]
| [
"0.704986",
"0.65557116",
"0.64532256",
"0.64264584",
"0.6386329",
"0.638463",
"0.63789284",
"0.6305677",
"0.62760764",
"0.6263371",
"0.62581617",
"0.62581617",
"0.62581617",
"0.62581617",
"0.62581617",
"0.62564975",
"0.6255559",
"0.62458324",
"0.6235159",
"0.6233915",
"0.61903775",
"0.61573696",
"0.61138356",
"0.6088401",
"0.60877746",
"0.60802317",
"0.60384935",
"0.60368174",
"0.6023498",
"0.60107785",
"0.5992533",
"0.598773",
"0.5976842",
"0.59660786",
"0.594687",
"0.594687",
"0.594687",
"0.59460163",
"0.5945779",
"0.5940577",
"0.5932331",
"0.5926033",
"0.5911594",
"0.5910968",
"0.59026295",
"0.5888933",
"0.58867013",
"0.5872202",
"0.5840299",
"0.5828292",
"0.5816181",
"0.5802322",
"0.5794238",
"0.57639545",
"0.57509506",
"0.5747583",
"0.573852",
"0.5729325",
"0.57229596",
"0.57229596",
"0.57229596",
"0.57229596",
"0.57222927",
"0.57202965",
"0.57132584",
"0.5707267",
"0.57071334",
"0.5701907",
"0.5694169",
"0.56933683",
"0.56874096",
"0.56761384",
"0.5675525",
"0.5675525",
"0.5675332",
"0.5667638",
"0.5666874",
"0.56648356",
"0.56604224",
"0.5656555",
"0.5654027",
"0.5652439",
"0.56510204",
"0.56418884",
"0.56388766",
"0.56293184",
"0.5624951",
"0.5621211",
"0.5614297",
"0.56127024",
"0.56091183",
"0.559739",
"0.559116",
"0.55659854",
"0.5564415",
"0.5556247",
"0.5555584",
"0.5555584",
"0.5555584",
"0.554875"
]
| 0.6493048 | 2 |
Returns the component configuration from cache or fetches it from scratch. | protected function getComponentConfiguration($componentName)
{
$componentNameParts = explode('_', $componentName, 3);
if (($componentNameParts[0] !== self::PACKAGE_PREFIX) || !isset($componentNameParts[1])) {
throw new Exception('Invalid component name. Component name "' . $componentName . '" must be prefixed by "' . self::PACKAGE_PREFIX . '_".');
}
if (isset($GLOBALS['TSFE']->tmpl->setup['plugin.'][self::PACKAGE_PREFIX . '_' . $componentNameParts[1] . '.']['components.'][$componentName . '.'])) {
$componentConfiguration = $GLOBALS['TSFE']->tmpl->setup['plugin.'][self::PACKAGE_PREFIX . '_' . $componentNameParts[1] . '.']['components.'][$componentName . '.'];
} elseif (isset($GLOBALS['TSFE']->tmpl->setup['plugin.'][self::PACKAGE_PREFIX . '_' . ucfirst(self::THIS_PACKAGE_KEY) . '.']['components.'][$componentName . '.'])) {
$componentConfiguration = $GLOBALS['TSFE']->tmpl->setup['plugin.'][self::PACKAGE_PREFIX . '_' . ucfirst(self::THIS_PACKAGE_KEY) . '.']['components.'][$componentName . '.'];
} else {
$componentConfiguration = null;
}
return $componentConfiguration;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCacheConfig()\n {\n $config = null;\n if (file_exists($this->options['cache_path'])) {\n $content = @file_get_contents($this->options['cache_path']);\n $config = new Config($this->app, $content);\n }\n return $config;\n }",
"function cacheConfig() {\n\t\tif(!isset($this->_options['configCachePath'])) {\n\t\t\tthrow new PPI_Exception('Missing path to the config cache path');\n\t\t}\n\n\t\t$path = sprintf('%s%s.%s.cache',\n\t\t\t$this->_options['configCachePath'],\n\t\t\t$this->_options['configFile'],\n\t\t\t$this->_options['configBlock']);\n\n\t\tif(file_exists($path)) {\n\t\t\treturn unserialize(file_get_contents($path));\n\t\t}\n\t\t$config = $this->parseConfig();\n\t\tfile_put_contents($path, serialize($config));\n\t\treturn $config;\n\t}",
"function getConfig() {\n\t\tif($this->_oConfig === null) {\n\t\t\tif(isset($this->_options['cacheConfig']) && $this->_options['cacheConfig']) {\n\t\t\t\t$this->_oConfig = $this->cacheConfig();\n\t\t\t} else {\n\t\t\t\t$this->_oConfig = $this->parseConfig();\n\t\t\t}\n\t\t}\n\t\treturn $this->_oConfig;\n\t}",
"protected function load_cache(){\r\n\t\tstatic $cached = null;\r\n\t\t\r\n\t\tif(!$cached){\r\n\t\t\t\r\n\t\t\tif($this->_cfg->get('sfversion') == 'auto'){\r\n\t\t\t\t// get version from sourceforge/cache\r\n\t\t\t\tif (!$this->is_cached()) $this->update_cache();\r\n\t\t\t\t$cached = (object)include($this->get_cache());\r\n\t\t\t}else{\r\n\t\t\t\t// use predefined version from config\r\n\t\t\t\t$cached = (object)$this->_cfg->get('sfversion');\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $cached;\r\n\t}",
"function _biurnal_conf_get_conf_cache($name) {\n ctools_include('object-cache');\n $cache = ctools_object_cache_get('biurnal_conf', $name);\n if (!$cache) {\n $cache = biurnal_conf_load($name);\n if ($cache) {\n $cache->locked = ctools_object_cache_test('biurnal_conf', $name);\n }\n }\n\n return $cache;\n}",
"public function fromCache()\n {\n try {\n $cache = $this->cache->get('config');\n\n if ($cache === false) {\n $cache = array_merge($this->_defaults, $this->getFromDb());\n $this->cache->set('config', $cache);\n }\n\n return $cache;\n }\n catch (Exception $e) {\n Log::error($e->getMessage(), null, __METHOD__);\n }\n }",
"protected function getCurrentPageCacheConfiguration() {}",
"public static function getConfiguration ($cname='') {\r\n\t\tif (!$cname AND defined('_THIS_COMPONENT_NAME')) $cname = _THIS_COMPONENT_NAME;\r\n\t\tif (!$cname OR false !== strpos($cname, '..')) {\r\n\t\t\techo aliroBase::trace();\r\n\t\t\tdie (T_('Invalid component name in aliroComponent Configuration'));\r\n\t\t}\r\n\t\tif (empty(self::$instance)) {\r\n\t\t\tself::$cache = new aliroSimpleCache('aliroComponentConfiguration');\r\n\t\t\t$cached = self::$cache->get('instances');\r\n\t\t\tif (!empty($cached)) self::$instance = $cached;\r\n\t\t}\r\n if (empty(self::$instance[$cname])) {\r\n\t\t\t$database = aliroCoreDatabase::getInstance();\r\n\t\t\t$database->setQuery(\"SELECT configuration FROM #__cmsapi_configurations WHERE component = '$cname'\");\r\n\t\t\t$configdata = $database->loadResult();\r\n\t\t\tif ($configdata) {\r\n\t\t\t\t$configdata = base64_decode($configdata);\r\n\t\t\t\tself::$instance[$cname] = unserialize($configdata);\r\n\t\t\t}\r\n\t\t\telse self::$instance[$cname] = new self($cname);\r\n\t\t\tself::saveCache();\r\n\t\t}\r\n return self::$instance[$cname];\r\n }",
"private function get_config() {\n if (isset($this->config)) {\n return $this->config;\n }\n\n $this->config = get_config('tool_coursebank');\n\n return $this->config;\n }",
"public function getFromCache() {}",
"public function getContentCacheConfig() {\n return $this->contentCacheConfig;\n }",
"static public function getConfiguration($id) {\n\t\t$mCache=new Maerdo_Model_Componentcache();\n\t\t$cacheConfig=$mCache->find($id)->toArray();\n\t\t\n\t\tif($cacheConfig['backend_type']==\"file\") {\t\n\t\t\t$mComponentcachebackendoption=new Maerdo_Model_Componentcachebackendfileoption();\n\t\t\t$backendOptions=$mComponentcachebackendoption->findByField('cc_id',$id,$mComponentcachebackendoption);\n\t\t\t\n\t\t\tforeach($backendOptions as $key=>$value) {\t\t\t\t\n\t\t\t\t$value=$value->toArray();\t\t\t\t\t\t\t\t\t\n\t\t\t\t$cacheConfig['backend']=$value;\n\t\t\t}\n\t\t\t\n\t\t\t// Set other support option to null\t\t\t\n\t\t\t$cacheConfig['backend']['automatic_vacuum_factor']=\"\";\n\t\t\t$cacheConfig['backend']['cache_db_complete_path']=\"\";\n\t\t\t\n\t\t} elseif($cacheConfig['backend_type']==\"sqlite\") {\n\t\t\t$mComponentcachebackendoption=new Maerdo_Model_Componentcachebackendsqliteoption();\n\t\t\t$backendOptions=$mComponentcachebackendoption->findByField('cc_id',$id,$mComponentcachebackendoption);\n\t\t\t\n\t\t\tforeach($backendOptions as $key=>$value) {\t\t\t\t\n\t\t\t\t$value=$value->toArray();\t\t\t\t\t\t\t\t\t\n\t\t\t\t$cacheConfig['backend']=$value;\n\t\t\t} \t \t\n\t\t\t// Set other support option to null \t \t \t \t\n\t\t\t$cacheConfig['backend']['cache_dir']=\"\";\n\t\t\t$cacheConfig['backend']['file_locking']=\"\";\n\t\t\t$cacheConfig['backend']['read_control']=\"\";\n\t\t\t$cacheConfig['backend']['read_control_type']=\"\";\n\t\t\t$cacheConfig['backend']['hashed_directory_level']=\"\";\n\t\t\t$cacheConfig['backend']['hashed_directory_umask']=\"\";\n\t\t\t$cacheConfig['backend']['metatadatas_array_max_size']=\"\";\t\n\t\t\t\t\t\t\t\n\t\t} else {\t\n\t\t\t$cacheConfig['backend']=array();\t\n\t\t}\n\t\t\n\t\t$mCacheFrontend=new Maerdo_Model_Componentcachefrontendoption();\n\t\t$frontendOptions=$mCacheFrontend->findByField('cc_id',$id,$mCacheFrontend);\n\t\tforeach($frontendOptions as $key=>$value) {\t\n\t\t\t$value=$value->toArray();\t\t\t\t\t\n\t\t\t$cacheConfig['frontend'][$value['option']]=$value['value'];\n\t\t}\t\t\n\n\t\t//var_dump($cacheConfig);die;\n\t\treturn($cacheConfig);\n\t}",
"function _config_cache(){\n Mapper::config(array('use_cache'=>false));\n \n}",
"protected function include_configuration() {\n $config = new tool_forcedcache_cache_config();\n return $config->include_configuration_wrapper();\n }",
"public function getCache()\n {\n return $this->get('cache', false);\n }",
"public function getConfig()\n {\n return $this->config ?: $this->setConfig()->getConfig();\n }",
"private function getCache() {\n // cache for single run\n // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)\n if (isset($this->parsed)) {\n return $this->parsed;\n }\n\n // check from cache first\n $cache = null;\n $cacheId = $this->getCacheId();\n if ($this->cache->isValid($cacheId, 0)) {\n if ($cache = $this->cache->fetch($cacheId)) {\n $cache = unserialize($cache);\n }\n }\n\n $less = $this->getCompiler();\n $input = $cache ? $cache : $this->filepath;\n $cache = $less->cachedCompile($input);\n\n if (!is_array($input) || $cache['updated'] > $input['updated']) {\n $this->cache->store($cacheId, serialize($cache));\n }\n\n return $this->parsed = $cache;\n }",
"protected function &getConfig(){\n \n if( is_null($this->config) ){\n $this->config = new \\stdClass();\n }\n \n return $this->config;\n \n }",
"protected function _getConfig()\n {\n if (Zend_Registry::isRegistered('Zend_Cache_Manager') && Zend_Registry::get('Zend_Cache_Manager')->hasCache('navigation')) {\n $cache = Zend_Registry::get('Zend_Cache_Manager')->getCache('navigation');\n Core_Module_Config_Xml::setCache($cache);\n }\n $moduleConfig = new Core_Module_Config_Xml($this->_options);\n $config = $moduleConfig->readConfigs(true);\n return $config;\n }",
"public function getCache();",
"private function fetchFromCache($name)\n {\n return $this->cache->getValue('conf_' . $name);\n }",
"public function load()\n\t{\n\t\tif(($cache=$this->getApplication()->getCache())!==null && ($value=$cache->get(self::CACHE_NAME))!==false)\n\t\t\treturn unserialize($value);\n\t\telse\n\t\t{\n\t\t\tif(($content=@file_get_contents($this->getStateFilePath()))!==false)\n\t\t\t\treturn unserialize($content);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t}",
"function get_config() {\n //$memcached = new \\Memcached();\n //$memcached->addServer(MEMCACHED_HOST, MEMCACHED_PORT);\n \n if (false) {//$memcached->get('lc_config') && MEMCACHED_ENABLED) {\n //return $memcached->get('lc_config');\n }\n else { \n // Load our master config\n $master_config = parse_ini_file(LC_HOME . LC_MASTER_CONFIG, True);\n \n // Let's get the local config based on the resource type (an action parameter)\n if (!empty($this->http_request->action_params['resource_type'])){\n $resource_type = $this->http_request->action_params['resource_type'];\n if (!empty($resource_type) && !in_array($resource_type, array_keys($master_config['resource_types']))) {\n throw new \\Exception('Incorrect resource type specified' .\n ' --> ' . $resource_type . ' <-- See ' .\n $master_config['doc']['lc_doc_loc'] . ' for documention on resource types.');\n }\n }\n \n $resource_config = parse_ini_file(LC_HOME . $master_config['resource_types'][$resource_type]);\n\n // Since we turn all sections in our master config into arrays (this \n // way we can validate keys easily), we need to flatten it back down\n $flattened_master_config = array();\n foreach ($master_config as $top_level_element) {\n foreach ($top_level_element as $key => $value) {\n $flattened_master_config[$key] = $value;\n }\n }\n\n $merged = array_merge($flattened_master_config, $resource_config);\n //$memcached->set('lc_config', $merged);\n return $merged;\n }\n }",
"private function cached()\n {\n if (isset(self::$_cached)) {\n $this->_config = self::$_cached;\n return true;\n } else {\n return false;\n }\n }",
"public function configurationIsCached();",
"public static function getCache() {}",
"public function getConfigCacheEnabled()\n {\n return $this->configCacheEnabled;\n }",
"public function get() {\n\n\t\tif (is_multisite()) {\n\t\t\t$config = get_site_option('wpo_cache_config', $this->get_defaults());\n\t\t} else {\n\t\t\t$config = get_option('wpo_cache_config', $this->get_defaults());\n\t\t}\n\n\t\treturn wp_parse_args($config, $this->get_defaults());\n\t}",
"public function getCachedConfigPath();",
"public function get()\r\n {\r\n $this->ensureLoaded();\r\n return $this->config;\r\n }",
"protected function getFromCache()\n {\n return $this->cache->get($this->getCacheKey());\n }",
"public function getConfig() : \\codename\\core\\config {\r\n return $this->config;\r\n }",
"protected function getCache()\n {\n return $this->cache;\n }",
"public function GetConfiguration() {\n //----------------------------------------------------------\n if ($this->Config != false) return $this->Config;\n //----------------------------------------------------------\n if ($this->test) {\n $this->testclass->AppendTest('GetConfiguration', array('type' => 'function_check'), array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__));\n }\n //----------------------------------------------------------\n $db_query = '\n SELECT *\n FROM `'.$this->db_prefix.$this->db_orbitvu.'configuration`\t\n ';\n\n //---------------------------------------------------------------------\n /**/\t$this->return_sql_debug(__FUNCTION__, $db_query);\n //---------------------------------------------------------------------\n\n try {\n $query = $this->database->FetchAll($db_query);\n }\n catch (Exception $e) {\n $this->Install();\n \n //----------------------------------------------------------\n /**/\t$this->return_debug(array(\n /**/\t\t'function' \t=> 'Install',\n /**/\t\t'response'\t=> 'Database installed!'\n /**/\t));\n //----------------------------------------------------------\n \n $query = $this->database->FetchAll($db_query);\n }\n\n /*\n * Synchronize config with current store configuration\n */\n $store_config = $this->database->GetConfiguration();\n\n //-------------------------------------------------------------------------------------------------------\n $conf = new stdClass();\n $i = 0;\n foreach ($query as $q) {\n $conf->$q['var'] = $q['value'];\n\n if (isset($store_config[$q['var']]) && $store_config[$q['var']] != $conf->$q['var']) {\n $this->SetConfiguration($q['var'], $store_config[$q['var']]);\n $conf->$q['var'] = $store_config[$q['var']];\n }\n $i++;\n }\n\n //----------------------------------------------------------\n /**/\t$this->return_debug(array(\n /**/\t\t'function' \t\t=> __FUNCTION__,\n /**/\t\t'configuration'\t=> $conf\n /**/\t));\n //----------------------------------------------------------\n\n //-------------------------------------------------------------------------------------------------------\n return $conf;\n //-------------------------------------------------------------------------------------------------------\n }",
"static public function getCache(){\n return static::$cache;\n }",
"function getCache() {\n return $this->cache;\n }",
"private function loadConfig() {\n if (file_exists($this->_data['cache_config_file'])) {\n $data = unserialize(file_get_contents($this->_data['cache_config_file']));\n \n self::$_configInstance = (object)$data; //instance of stdClass with all the properties public\n //$this->_data = (array)$data; \n return true;\n } \n return false;\n }",
"public function get($name)\n {\n $config = $this->fromCache();\n return isset($config[$name]) ? $config[$name] : null;\n }",
"public function getCache() {\n if( null === $this->_cache ) {\n $this->_cache = Zend_Cache::factory\n ( $this->_frontend\n , $this->_backend\n , $this->_frontendOptions\n , $this->_backendOptions\n );\n }\n return $this->_cache;\n }",
"public function loadConfig() {\n return (object)$this->config;\n }",
"public static function getCache()\n\t{\n\t if (!self::$cache) {\n\t\t\t$frontendOptions = array('lifetime' => 604800, \n\t\t\t\t\t\t\t\t\t 'automatic_serialization' => true);\n\t\t\t$backendOptions = array('cache_dir' => APPLICATION_PATH . '/../data/cache');\n\t\t\tself::$cache \t = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);\n\t }\n\t\treturn self::$cache;\n\t}",
"public function getCache()\r\n {\r\n \treturn $this->_cache;\r\n }",
"public function getCache()\r\n\t{\r\n\t\treturn \\Bitrix\\Main\\Data\\Cache::createInstance();\r\n\t}",
"public function get($cache_name);",
"public function &getConfig() {\n return $this->config;\n }",
"public function readAndCache() {\n\n $config = $this->read(false);\n $tempPath = App::tempPath();\n \\jFile::createDir($tempPath, $config->chmodDir);\n $filename = $tempPath.str_replace('/', '~', $this->configFileName);\n\n if (BYTECODE_CACHE_EXISTS) {\n $filename .= '.conf.php';\n if ($f = @fopen($filename, 'wb')) {\n fwrite($f, '<?php $config = '.var_export(get_object_vars($config),true).\";\\n?>\");\n fclose($f);\n chmod($filename, $config->chmodFile);\n }\n else {\n throw new Exception('Error while writing configuration cache file -- '.$filename);\n }\n }\n else {\n IniFileMgr::write(get_object_vars($config), $filename.'.resultini.php', \";<?php die('');?>\\n\", $config->chmodFile);\n }\n return $config;\n }",
"private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }",
"public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}",
"protected function loadFromCache() {}",
"protected function getConfig($name)\n\t{\n\t return $this->royalcms['config'][\"cache.drivers.{$name}\"];\n\t}",
"public function getCache() {\n\t\t$this->sync();\n\t\treturn $this->cache;\n\t}",
"protected function _getCache()\n {\n if (!isset($this->_configuration)) {\n $this->_configuration = \\Yana\\Db\\Binaries\\ConfigurationSingleton::getInstance();\n }\n return $this->_configuration->getFileNameCache();\n }",
"abstract protected function getConfig();",
"protected function getCacheService()\n {\n return $this->services['cache'] = new \\phpbb\\cache\\service(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, './../', 'php');\n }",
"function cfg($param = null) {\n static $config;\n if (!$config) {\n $config = new \\Core\\ConfigStore('app');\n if ($config->environment) {\n $defaults = $config;\n $config = new \\Core\\ConfigStore($config->environment);\n $config->setDefaults($defaults);\n }\n }\n if ($param) {\n return $config->get($param);\n }\n return $config;\n}",
"function getCache() {\n return $this->cache;\n }",
"function getCache() {\n\t\t// The following line is only for classloading purposes\n\t\t$categoryEntryDao =& $this->getEntryDAO();\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\n\t\t// Load and return the cache, building it if necessary.\n\t\t$filename = $this->getCacheFilename();\n\t\tif (!file_exists($filename)) $this->rebuildCache();\n\t\t$contents = file_get_contents($filename);\n\t\tif ($contents) return unserialize($contents);\n\t\treturn null;\n\t}",
"public static function getConfig() {\n\t\tif (self::$temp_config !== null) {\n\t\t\treturn self::$temp_config;\n\t\t}\n\n\t\t$config_file = self::getConfigFile();\n\t\treturn (!file_exists($config_file)) ? array() : json_decode(file_get_contents($config_file), true);\n\t}",
"public static function cache()\n {\n $cache = Cache::instance('system');\n if (!$cache->get('config-autoload')) {\n $cache->set('config-autoload', self::$data);\n }\n }",
"protected function getConfigService()\n {\n return $this->services['config'] = new \\phpbb\\config\\db(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, 'phpbb_config');\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"protected function readFromCache()\r\n {\r\n $result = null;\r\n if(extension_loaded('apc') && ini_get('apc.enabled')) {\r\n $result = apc_fetch($this->getCacheKey());\r\n }\r\n return $result;\r\n }",
"public function cache(): object\n {\n return $this->baseApp($this)->loadCache();\n }",
"public function cached()\n {\n // check cache is available else set cache and return\n return Cache::get('Klaravel\\Settings\\Setting', function () {\n $data = $this->get();\n Cache::put('Klaravel\\Settings\\Setting', $data, 60 * 24);\n\n return $data;\n });\n }",
"public function getCache()\n\t{\n\t\treturn $this->cache;\n\t}",
"protected function getConfigCacheFactoryService()\n {\n return $this->services['config_cache_factory'] = new \\Symfony\\Component\\Config\\ResourceCheckerConfigCacheFactory(array());\n }",
"public function getCache()\n\t{\n\t\treturn ($this->_cache);\n\t}",
"public static function getConfig() {\n if (!self::$_configInstance)\n new acs_config();\n \n return self::$_configInstance;\n }",
"public function getConfig()\n { // Try the template specific path first\n $fname = APPLICATION_PATH.$this->_paths['pkg_template'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Next try the domain common path\n $fname = APPLICATION_PATH.$this->_paths['pkg_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Finally, try the app common path\n $fname = APPLICATION_PATH.$this->_paths['app_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // If none of these files were found, return false to indicate failure\n if( !$this->_config) throw new CException('Configuration not found');\n }",
"public function getCache()\n {\n return $this->_cache;\n }",
"public function __get ($name) {\t\t\n\t\tif ( $name=='config') {\n\t\t\treturn $this->config;\n\t\t}\n\t\treturn $this->load($name);\n\t}",
"public static function getCachedConfigPath(){\n return \\Illuminate\\Foundation\\Application::getCachedConfigPath();\n }",
"public function getCache()\n {\n return $this->Cache;\n }",
"private function _readDefaultCache() {\n $settingFile = APPLICATION_PATH . '/application/settings/restapi_cache.php';\n $defaultFilePath = APPLICATION_PATH . '/temporary/restapicache';\n\n if (file_exists($settingFile)) {\n $currentCache = include $settingFile;\n } else {\n $currentCache = array(\n 'default_backend' => 'File',\n 'frontend' => array(\n 'automatic_serialization' => true,\n 'cache_id_prefix' => 'Engine4_restapi',\n 'lifetime' => '300',\n 'caching' => true,\n 'status' => true,\n 'gzip' => true,\n ),\n 'backend' => array(\n 'File' => array(\n 'file_locking' => true,\n 'cache_dir' => APPLICATION_PATH . '/temporary/restapicache',\n ),\n ),\n );\n }\n $currentCache['default_file_path'] = $defaultFilePath;\n\n return $currentCache;\n }",
"protected function _initCache()\n {\n $this->bootstrap('Config');\n $appConfig = Zend_Registry::get('config');\n $cache = NULL;\n\n // only attempt to init the cache if turned on\n if ($appConfig->app->caching) {\n\n // get the cache settings\n $config = $appConfig->app->cache;\n\n if (NULL !== $this->_tmpFolder) {\n if ('File' == $config->backend->adapter && !isset($config->backend->options->cache_dir)) {\n $config->backend->options->cache_dir = $this->_tmpFolder . '/cache';\n if (!is_dir($config->backend->options->cache_dir)) {\n mkdir($config->backend->options->cache_dir);\n }\n }\n }\n\n try {\n $cache = Zend_Cache::factory(\n $config->frontend->adapter,\n $config->backend->adapter,\n $config->frontend->options->toArray(),\n $config->backend->options->toArray()\n );\n } catch (Zend_Cache_Exception $e) {\n // send email to alert caching failed\n Zend_Registry::get('log')->alert(\n 'Caching failed: adapter=' . $config->backend->adapter . ', message=' . $e->getMessage(\n ));\n }\n }\n Zend_Registry::set('cache', $cache);\n return $cache;\n }",
"protected function getFreshConfiguration()\n {\n $app = require $this->laravel->bootstrapPath('app.php');\n\n $app->make(Kernel::class)->bootstrap();\n $config = $app->make('config');\n\n $files = \\array_merge(\n $this->configToCache(), $this->getConfigurationFiles()\n );\n\n foreach ($files as $file) {\n $config[$file];\n }\n\n return $config->all();\n }",
"public function getCache() {\n return $this->cache;\n }",
"public final function getConfig()\n {\n return clone($this->config);\n }",
"public function getCache()\r\n\t{\r\n\t\treturn $this->m_cache;\r\n\t}",
"protected function getCache()\n {\n return Mage::app()->getCache();\n }",
"protected function getCache()\n {\n return Mage::app()->getCache();\n }",
"abstract public function getConfig();",
"protected function getRuntimeCache() {}",
"public function getConfig()\n {\n return $this->get('config');\n }",
"public static function getCache()\n {\n return self::$_cache;\n }",
"protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig(): Config\n {\n return $this->config;\n }",
"public function getConfig(): Config\n {\n return clone $this->config;\n }",
"static public function getInstance ($base) {\n # Is the configuration file already in memory?\n if (isset (self::$_cache[$base])) {\n\n # Yes, the file has already been loaded\n $obj = self::$_cache[$base];\n\n } else {\n\n # No, load the file from disk and save it to cache\n $obj = new Config ($base);\n self::$_cache[$base] = $obj;\n\n }\n return $obj;\n }",
"public static function getCached()\n {\n return static::$cached;\n }",
"protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }",
"public function getConfig() : Config\n {\n return $this->config;\n }",
"public function get() {\n return new ConfigurationObject($this->config);\n }",
"function getConfig()\n {\n return $this->config;\n }"
]
| [
"0.70140225",
"0.69254977",
"0.6849435",
"0.68068624",
"0.67806053",
"0.66686136",
"0.64723283",
"0.64378583",
"0.6387685",
"0.6361934",
"0.63198483",
"0.62894624",
"0.62535775",
"0.6174728",
"0.616764",
"0.616312",
"0.61432207",
"0.61128676",
"0.61055416",
"0.6099306",
"0.6093612",
"0.60580015",
"0.6057669",
"0.60485584",
"0.60391283",
"0.6025291",
"0.6023782",
"0.60158074",
"0.6014898",
"0.5970753",
"0.5964007",
"0.5953119",
"0.5952442",
"0.5947334",
"0.5946004",
"0.594048",
"0.59368944",
"0.5936544",
"0.5935248",
"0.59227127",
"0.5922631",
"0.5913939",
"0.59056425",
"0.58919674",
"0.5889077",
"0.58837694",
"0.58801687",
"0.5879635",
"0.5874196",
"0.58643734",
"0.58642423",
"0.5858713",
"0.5857867",
"0.5855058",
"0.5853908",
"0.5852193",
"0.5847332",
"0.5845555",
"0.5841034",
"0.58256584",
"0.5821759",
"0.5821759",
"0.5821759",
"0.5821759",
"0.5821759",
"0.5821759",
"0.5821759",
"0.58196974",
"0.58177954",
"0.58149",
"0.58142626",
"0.5811112",
"0.5809404",
"0.5808085",
"0.5806038",
"0.5804104",
"0.5798312",
"0.57982415",
"0.5788707",
"0.5783859",
"0.5782388",
"0.5778987",
"0.57635593",
"0.5744332",
"0.5733862",
"0.5730897",
"0.5730897",
"0.5728894",
"0.572273",
"0.5720983",
"0.5717687",
"0.5712814",
"0.5712318",
"0.57049966",
"0.5694086",
"0.5688989",
"0.5688796",
"0.56840795",
"0.56768936",
"0.56709",
"0.56676537"
]
| 0.0 | -1 |
Puts a component object and its configuration to the cache | protected function putComponentObject($componentName, $componentObject)
{
if (is_object($componentObject)) {
$this->componentObjects[$componentName] = $componentObject;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function addCache($configuration) {\n\t\tif(!isset($configuration['cache_id'])) {\n\t\t\t$mComponentcache=new Maerdo_Model_Componentcache();\n\t\t\treturn($mComponentcache->insert(array('name'=>$configuration['name'],'type'=>$configuration['frontend_type'],'backend_type'=>$configuration['backend_type'])));\n\t\t}\n\t\t\n\t}",
"function components_rebuildcache()\n\t{\n\t\t$this->ipsclass->cache['components'] = array();\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'com_id,com_enabled,com_section,com_filename,com_url_uri,com_url_title,com_position',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'com_enabled=1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'com_position ASC' ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->cache['components'][] = $r;\n\t\t}\n\n\t\t$this->ipsclass->update_cache( array( 'name' => 'components', 'array' => 1, 'deletefirst' => 1 ) );\n\t}",
"protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }",
"public function enableObjectCache() {\n\t\t$this->asset_model->useObjectCaching = true;\n\t}",
"public function storeCache() {\n\t\tif ($this->cacheFilePath) {\n\t\t\tfile_put_contents($this->cacheFilePath, serialize($this->classFileIndex));\n\t\t}\n\t}",
"public static function cache()\n {\n $cache = Cache::instance('system');\n if (!$cache->get('config-autoload')) {\n $cache->set('config-autoload', self::$data);\n }\n }",
"private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }",
"public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}",
"public function writeToCache(CacheObject $object) {\n $type = $object->getType();\n $id = $object->getId();\n\n $this->readType($type);\n\n if (!array_key_exists($type, $this->cache)) {\n $this->cache[$type] = array();\n }\n\n $this->cache[$type][$id] = $object;\n }",
"protected function saveToCache() {}",
"public function setObjToCache($key, $value, $timeToCache = 0);",
"public function updateCache();",
"function cleanComponentCache() {\r\n\t\t$cache = & JFactory::getCache($this->component);\r\n\t\t$cache->clean($this->component);\r\n\t}",
"protected function saveToPackageCache() {}",
"public function testCreateCachedObject() {\n\t\t// Load the config file\n\t\tCore\\Config::load('MyProject');\n\t\tCore\\Config::set('cache', 'enable', true, true);\n\n\t\t// Put the cache\n\t\tCore\\Cache::put('foo', 'bar');\n\n\t\t// The file exists?\n\t\t$this->assertTrue(Core\\Cache::has('foo'));\n\n\t\t// And the file has the correct contents?\n\t\t$this->assertEquals(Core\\Cache::get('foo'), 'bar');\n\t}",
"public function setCache()\n\t{\n\t\treturn CacheBot::set($this->getCacheKey(), $this->getDataToCache(), self::$objectCacheLife);\n\t}",
"public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }",
"public function set($key, $value): CacheInterface;",
"protected function cacheModel()\n {\n $xmlObject = $this->getSimpleXmlObject();\n if ($xmlObject === null) {\n return;\n }\n\n $this->cache = $this->convertItem($xmlObject);\n }",
"public function cacheObjectInfo($obj) {\n\t\t$this->_link_cache[$obj->id] = $obj->links;\n\t\t$this->_title_cache[$obj->id] = $obj->properties[\"cmis:name\"]; // Broad Assumption Here?\n\t\t$this->_objTypeId_cache[$obj->id] = $obj->properties[\"cmis:objectTypeId\"];\n\t\tif (isset($obj->properties[\"cmis:changeToken\"])) {\n\t\t\t$this->_changeToken_cache[$obj->id] = $obj->properties[\"cmis:changeToken\"];\n\t\t}\n\t}",
"public function setCaching($cache);",
"private function updateObject($name,$object){\n $this->cache->set($name, $object);\n }",
"public function setObject($key, $value)\n {\n $this->objectCache[$key] = $value;\n }",
"public function saveToCache(){\r\n\t\t$n = \"hotspot_\" . $this->id;\r\n\r\n\t\t\\CacheHandler::setToCache($n,$this,20*60);\r\n\t}",
"function add_to_cache($className, $path)\n{\n global $cache_map, $cache_file;\n\n if(!empty($className))\n {\n if(!$cache_map)\n $cache_map = array();\n\n $cache_map[$className] = $path;\n\n file_put_contents($cache_file, '<?php ' . \"\\n\" . '$cache_map = ' .\"\\n\" . var_export($cache_map, true) . ';' );\n\n }\n}",
"protected function setCache()\n {\n if ($this->cache) {\n $cacheFile = $this->getCacheFile();\n $this->setupCachePath($cacheFile);\n file_put_contents($cacheFile, $this->templateOutput);\n }\n }",
"public function cleanComponentCache() {\r\n\t\t$cache =& JFactory::getCache('com_hwdphotoshare');\r\n\t\t$cache->clean('com_hwdphotoshare');\r\n }",
"protected function cache()\n {\n // Cache location items\n $this->locations->get(); // All\n $this->locations->menu(); // Menu\n $this->locations->mapItems(); // Map\n $this->locations->featured(); // Featured\n\n // Cache properties\n $this->properties->cacheAll(); // All\n $this->properties->specials();\n }",
"private function mockCache()\n {\n $this->objectManager->configure([\n 'preferences' => [\n Cache::class => DummyCache::class\n ]\n ]);\n }",
"public function save()\n\t{\n\t\t$this->componentConfig->save();\n\t}",
"public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}",
"public static function setCache($cache) {}",
"function wp_using_ext_object_cache($using = \\null)\n {\n }",
"function update_category_cache()\n {\n }",
"function _biurnal_conf_set_conf_cache($name, $conf) {\n ctools_include('object-cache');\n $cache = ctools_object_cache_set('biurnal_conf', $name, $conf);\n}",
"public function cache()\n {\n add_settings_field(\n 'cache',\n apply_filters($this->plugin_name . 'label-cache', esc_html__('Cache', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description' => 'Enable cacheing of your security.txt file.',\n 'id' => 'cache',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['cache']) ? $this->options['cache'] : false,\n ]\n );\n }",
"public function enableCaching()\n {\n $this->cache = true;\n }",
"public function enableCache() :void\n {\n Settings::setCache($this->cacheAdapter->buildCache());\n }",
"function cleanComponentCache() {\r\n\t\t$cache = & JFactory::getCache('com_eventlist');\r\n\t\t$cache->clean('com_eventlist');\r\n\t}",
"public function put ( $obj , $cache_key_field = null )\r\n\t{\r\n\t\tif ( $obj == null || is_array ( $obj ) ) return;\r\n\t\t\r\n\t\t$obj_clazz = get_class ( $obj );\r\n\t\t\r\n\t\tif ( $cache_key_field == null )\r\n\t\t{\r\n\t\t\t$id = $obj->getId();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$getter_func_name = \"get{$cache_key_field}\";\r\n\t\t\t$id = \"{$cache_key_field}_\" . $obj->$getter_func_name();\r\n\t\t}\r\n//\t\techo \"\\nmyObjectCache::put: [\" . $obj_clazz . \"] [$id]\\n\"; \r\n\t\t\t\t\r\n\t\t$key = $obj_clazz . \"_\" . $id;\r\n\t\t\r\n\t\t// make the memory cache much shorter - for whn using it in batch processes. the memcahce can be cleared easily\r\n\t\tself::$s_memory_cache->put ( $key , $obj , (int)($this->m_expiry_in_seconds /10) ); \r\n\t\tself::$s_cache->put ( $key , $obj , $this->m_expiry_in_seconds);\r\n\t}",
"public function saveToCacheForever();",
"public static function bootCacheTrait() {\n static::saving(function (Model $model) {\n $dirty = $model->getDirtyCached();\n\n $key = Helpers::cacheKey($model);\n if (!empty($dirty))\n lRedis::hmset($key . \":properties\", $dirty);\n }, 1000);\n }",
"private function initData()\n {\n $data = $this->cache->load($this->cacheId);\n if (false === $data) {\n /** @var Reader $reader */\n $reader = $this->readerFactory->create(\n ['fileName' => sprintf(self::SEARCH_PATTERN, $this->componentName)]\n );\n $data = $reader->read();\n $this->cache->save($this->serializer->serialize($data), $this->cacheId);\n } else {\n $data = $this->serializer->unserialize($data);\n }\n\n if (!empty($data)) {\n $this->data[$this->componentName] = [Converter::DATA_ATTRIBUTES_KEY => ['name' => $this->componentName]];\n $this->merge([$this->componentName => $data]);\n $this->data = $this->evaluateComponentArguments($this->data);\n }\n }",
"protected function setFromCache($object)\r\n {\r\n // TODO: Implement setFromCache() method.\r\n }",
"function _cache_put ($cache_name = \"\", $data = null) {\n\t\tif (is_null($data)) {\n\t\t\t$data = [];\n\t\t}\n\t\t$cache_file_path = $this->_prepare_cache_path($cache_name);\n\t\t$this->_put_cache_file($data, $cache_file_path, $data);\n\t}",
"public function setUpCache();",
"private function registerCache()\n\t{\n\t\t$this->app->singleton('glottos.cache', function($app) {\n\t\t\treturn new Cache();\n\t\t});\n\t}",
"private static function setCache($data)\n\t{\n\t\t// Initialiase variables.\n\t\t$file = JPATH_CACHE . '/twitter';\n\t\t$data = serialize($data);\n\n\t\tJFile::write($file, $data);\n\t}",
"public static function store($object){\n\t\t\tif(!is_object($object)){\n\t\t\t\tLogger::warning(MessageUtility::CACHE_LOAD_WARNING, \"A primitive value of type \".gettype($object).\" cannot be cached.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//Check that the specified $object is an object of PersistentClass\n\t\t\t$objectClass = Mirror::reflectClass($object);\n\t\t\tif(!$objectClass->descendsFrom(\"Wadapi\\Persistence\\PersistentClass\")){\n\t\t\t\tLogger::warning(MessageUtility::CACHE_LOAD_WARNING, \"Object of class \".get_class($object).\" is not a descendant \".\n\t\t\t\t\t\t\t\t \"of PersistentClass and cannot be stored in cache.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tself::$cache[$object->getId()] = $object;\n\t\t}",
"function _config_cache(){\n Mapper::config(array('use_cache'=>false));\n \n}",
"protected function initCache()\n {\n $this->di->set('viewCache', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $frontend = new FrontOutput(['lifetime' => $config->get('viewCache')->lifetime]);\n\n $config = $config->get('viewCache')->toArray();\n $backend = '\\Phalcon\\Cache\\Backend\\\\' . $config['backend'];\n unset($config['backend'], $config['lifetime']);\n\n return new $backend($frontend, $config);\n });\n\n $this->di->setShared('modelsCache', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $frontend = '\\Phalcon\\Cache\\Frontend\\\\' . $config->get('modelsCache')->frontend;\n $frontend = new $frontend(['lifetime' => $config->get('modelsCache')->lifetime]);\n\n $config = $config->get('modelsCache')->toArray();\n $backend = '\\Phalcon\\Cache\\Backend\\\\' . $config['backend'];\n unset($config['backend'], $config['lifetime'], $config['frontend']);\n\n return new $backend($frontend, $config);\n });\n\n $this->di->setShared('dataCache', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $frontend = '\\Phalcon\\Cache\\Frontend\\\\' . $config->get('dataCache')->frontend;\n $frontend = new $frontend(['lifetime' => $config->get('dataCache')->lifetime]);\n\n $config = $config->get('dataCache')->toArray();\n $backend = '\\Phalcon\\Cache\\Backend\\\\' . $config['backend'];\n unset($config['backend'], $config['lifetime'], $config['frontend']);\n\n return new $backend($frontend, $config);\n });\n }",
"private function storeCacheSetting()\n {\n Cache::forever('setting', $this->setting->getKeyValueToStoreCache());\n }",
"private function refreshCache()\n\t{\n\t\t$this->lookupCache = array();\n\n\t\tif ($this instanceof IComponentContainer) {\n\t\t\tforeach ($this->getComponents() as $component) {\n\t\t\t\tif ($component instanceof self) {\n\t\t\t\t\t$component->refreshCache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function loadFromCache() {}",
"public static function initCache()\n {\n// $cache->delete('config');\n }",
"private function setup_cache() {\n // Set up non-persistent object caching groups\n wp_cache_add_non_persistent_groups( [ '_np_pedestal' ] );\n }",
"public function setFinalCachingFrameworkCacheConfiguration() {}",
"private function registerCache()\n {\n $this->app->singleton('firewall.cache', function () {\n return new Cache(app('cache'));\n });\n }",
"private function _saveCache($buffer)\r\n {\r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // save to the cache\r\n file_put_contents(\"{$this->_config['paths']['cache']}/{$hash}\", $buffer);\r\n }",
"function &createCache() {}",
"protected function initializeCache() {}",
"protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }",
"protected function initializeCache() {}",
"public function enableCache()\n\t{\n\t\t$this->_enableCache = true;\n\t}",
"public function set($key, $value) {\n if (@apc_store($key, array('time' => time(), 'data' => serialize($value)), Shindig_ConfigGet('cache_time')) == false) {\n throw new CacheException(\"Couldn't store data in cache\");\n }\n }",
"public function store()\n {\n $classes = [];\n\n foreach ($this->classes as $class) {\n $classes[] = $class['input_file'];\n }\n\n $json_classes = json_encode($classes);\n\n $this->filesystem->put(config('larinterface.cache_directory') . '/larinterface.json', $json_classes);\n }",
"protected function flushCached()\n\t{\n\t\t$this->objectCache = [];\n\t}",
"private function storeInCache($name, $value)\n {\n if ($this->isCacheEnabled()) {\n $this->cache->setValue('conf_' . $name, $value);\n }\n }",
"public static function enableCaching(): void\n {\n static::$caching = true;\n }",
"private function setCache()\n\t{\n\t\t$this->_cache = new Cache('./', array('prefix' => 'pageReader'));\n\t}",
"function object_cache_init() {\n\tif (!isset($GLOBALS['ts_object_cache']))\n\t\t$GLOBALS['ts_object_cache'] = service('ObjectCache');\n}",
"private function readCache(): void{\n //stdClass é uma classe predefinido ou dinamica\n $this->cache = new stdClass();\n if(file_exists('cache.cache')){\n $this->cache = json_decode(file_get_contents('cache.cache'));\n }\n }",
"function tep_cache_categories_box2($auto_expire = false, $refresh = false) {\nglobal $cPath, $language;\n\n$cache_output = '';\n\nif (($refresh == true) || !read_cache($cache_output, 'categories_box2-' . $language . '.cache' . $cPath, $auto_expire)) {\nif (!class_exists('bm_categories_accordion')) {\ninclude(DIR_WS_MODULES . 'boxes/bm_categories_accordion.php');\n}\n\n$bm_categories_accordion = new bm_categories_accordion();\n$cache_output = $bm_categories_accordion->getData();\n\nwrite_cache($cache_output, 'categories_box2-' . $language . '.cache' . $cPath);\n}\n\nreturn $cache_output;\n}",
"public function set(CacheableInterface $item)\n {\n $this->connection->set($item->getHashKey(), $item->getDataForCache(), $item->getTtl());\n }",
"public function getObjFromCache($key);",
"function __construct() {\n $this->_cache = [];\n }",
"static function set($name,$content){\n\t\tif(! self::$enable )\n\t\t\treturn $content;\n\t\tself::init();\n\t\t$i = cacheItem::getInstance($name);\n\t\t$i->content = $content;\n\t\tself::$backend->saveItem($i);\n\t\treturn $content;\n\t}",
"public function put($configKey, $key, $data);",
"private function writeCache($object)\r\n {\r\n $fp = fopen(WEMO_CACHE, 'w');\r\n fwrite($fp, json_encode($object));\r\n fclose($fp);\r\n }",
"public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }",
"abstract protected function cacheData();",
"static public function putCache($key, $data)\n {\n if (getenv('AMTEL_CACHE') == 'redis') {\n Cache::store('redis')->put($key, $data, getenv('AMTEL_CACHE_SEC'));\n }\n }",
"public function setComponent($component);",
"protected function set_cache($value) {\n \t set_transient( $this->get_cache_id(), $value, $this->cache_time ); \t \t\n\t}",
"function storeObjectAttribute ( \n $attribute )\n {\n if ( isset( $GLOBALS['eZCreditcardCache'] ) )\n unset( $GLOBALS['eZCreditcardCache'] );\n }",
"private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }",
"private function storeCache($key, $data)\n {\n if ($this->cache) {\n $this->cache->save($key, $data);\n }\n }",
"public function put();",
"public function put();",
"private function write_cache($content)\r\n\t{\r\n\t\tfile_put_contents($this->cache_file, $content);\r\n\t}",
"static public function getConfiguration($id) {\n\t\t$mCache=new Maerdo_Model_Componentcache();\n\t\t$cacheConfig=$mCache->find($id)->toArray();\n\t\t\n\t\tif($cacheConfig['backend_type']==\"file\") {\t\n\t\t\t$mComponentcachebackendoption=new Maerdo_Model_Componentcachebackendfileoption();\n\t\t\t$backendOptions=$mComponentcachebackendoption->findByField('cc_id',$id,$mComponentcachebackendoption);\n\t\t\t\n\t\t\tforeach($backendOptions as $key=>$value) {\t\t\t\t\n\t\t\t\t$value=$value->toArray();\t\t\t\t\t\t\t\t\t\n\t\t\t\t$cacheConfig['backend']=$value;\n\t\t\t}\n\t\t\t\n\t\t\t// Set other support option to null\t\t\t\n\t\t\t$cacheConfig['backend']['automatic_vacuum_factor']=\"\";\n\t\t\t$cacheConfig['backend']['cache_db_complete_path']=\"\";\n\t\t\t\n\t\t} elseif($cacheConfig['backend_type']==\"sqlite\") {\n\t\t\t$mComponentcachebackendoption=new Maerdo_Model_Componentcachebackendsqliteoption();\n\t\t\t$backendOptions=$mComponentcachebackendoption->findByField('cc_id',$id,$mComponentcachebackendoption);\n\t\t\t\n\t\t\tforeach($backendOptions as $key=>$value) {\t\t\t\t\n\t\t\t\t$value=$value->toArray();\t\t\t\t\t\t\t\t\t\n\t\t\t\t$cacheConfig['backend']=$value;\n\t\t\t} \t \t\n\t\t\t// Set other support option to null \t \t \t \t\n\t\t\t$cacheConfig['backend']['cache_dir']=\"\";\n\t\t\t$cacheConfig['backend']['file_locking']=\"\";\n\t\t\t$cacheConfig['backend']['read_control']=\"\";\n\t\t\t$cacheConfig['backend']['read_control_type']=\"\";\n\t\t\t$cacheConfig['backend']['hashed_directory_level']=\"\";\n\t\t\t$cacheConfig['backend']['hashed_directory_umask']=\"\";\n\t\t\t$cacheConfig['backend']['metatadatas_array_max_size']=\"\";\t\n\t\t\t\t\t\t\t\n\t\t} else {\t\n\t\t\t$cacheConfig['backend']=array();\t\n\t\t}\n\t\t\n\t\t$mCacheFrontend=new Maerdo_Model_Componentcachefrontendoption();\n\t\t$frontendOptions=$mCacheFrontend->findByField('cc_id',$id,$mCacheFrontend);\n\t\tforeach($frontendOptions as $key=>$value) {\t\n\t\t\t$value=$value->toArray();\t\t\t\t\t\n\t\t\t$cacheConfig['frontend'][$value['option']]=$value['value'];\n\t\t}\t\t\n\n\t\t//var_dump($cacheConfig);die;\n\t\treturn($cacheConfig);\n\t}",
"function wp_start_object_cache()\n {\n }",
"public function set(CacheableInterface $item)\n {\n $this->getConnection()->set($item->getHashKey(), $item->getDataForCache());\n if (null !== $item->getTtl()) {\n $this->getConnection()->expire($item->getHashKey(), $item->getTtl());\n }\n }",
"public function __set(string $path, /* mixed */ $component) : void\n {\n $this->add($path, $component);\n }",
"public static function setCache($caching)\n{\nself::$caching=$caching;\n}",
"function object_cache_set($key, $data, $flag = '', $expire = 0) {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->set($key, $data, $flag, $expire);\n}",
"public function cachePageContent(): void\n {\n $value = [\n 'checksum' => $this->getCacheChecksum(),\n 'content' => $this->_content,\n 'content_meta' => $this->_content_meta\n ];\n\n $cache = $this->getCache('render');\n $key = md5($this->getCacheKey() . '-content');\n\n $cache->set($key, $value);\n }",
"function cache_classes_Add($classname, $path)\n{\n cache_classes_Initialize();\n\n $filecontents = file_get_contents($path);\n $cache = core_cache_Get(CACHE_CLASSES_KEY);\n $cache[$classname] = $filecontents;\n core_cache_Set(CACHE_CLASSES_KEY, $cache, CACHE_CLASSES_TTL);\n}",
"private function _store()\n {\n return $this->redis->redis->set($this->clientPrefix, json_encode($this->cache));\n }",
"public function afterConstruct($event=null) {\n self::$_cached[get_class($this)][$this->_id = self::$_wc++] = $this;\n }",
"function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL) {\n global $trampoline_cache;\n\n //Use a simple variable based cache.\n //Cache will automatically expire after request completion\n if (!isset($trampoline_cache)) {\n $trampoline_cache = array();\n }\n $trampoline_cache[$table.'_'.$cid] = $data;\n}"
]
| [
"0.6166923",
"0.6070735",
"0.59497476",
"0.58895904",
"0.58871293",
"0.5859806",
"0.58025753",
"0.57754004",
"0.57273424",
"0.5705497",
"0.5703952",
"0.5609852",
"0.5566317",
"0.5564023",
"0.55556834",
"0.5475898",
"0.54611766",
"0.5448947",
"0.5374408",
"0.53565955",
"0.5346315",
"0.53365564",
"0.5336244",
"0.5334442",
"0.5315305",
"0.53102636",
"0.5305593",
"0.5304139",
"0.52782685",
"0.5273028",
"0.5266068",
"0.5249034",
"0.5237095",
"0.5228706",
"0.5227407",
"0.52026576",
"0.5190757",
"0.5175281",
"0.51710576",
"0.5168667",
"0.51603085",
"0.51591915",
"0.51457745",
"0.5136703",
"0.5135292",
"0.5133891",
"0.51244986",
"0.5121958",
"0.5098156",
"0.5081944",
"0.5081728",
"0.50768995",
"0.50733554",
"0.5059703",
"0.5053921",
"0.5053661",
"0.5053512",
"0.50508547",
"0.50435483",
"0.50388944",
"0.5023446",
"0.5016604",
"0.5016314",
"0.5009215",
"0.50064665",
"0.49922645",
"0.49829608",
"0.49785697",
"0.49765816",
"0.49636355",
"0.49573836",
"0.49462578",
"0.49444932",
"0.49438804",
"0.49337444",
"0.49217296",
"0.4919587",
"0.49179715",
"0.49102932",
"0.4909257",
"0.49033138",
"0.4902398",
"0.48927176",
"0.48877192",
"0.4868206",
"0.4867864",
"0.486422",
"0.48528674",
"0.48528674",
"0.48465437",
"0.48343638",
"0.4833283",
"0.4829914",
"0.48296374",
"0.48276335",
"0.48247766",
"0.48189136",
"0.48166648",
"0.48165262",
"0.48116347",
"0.48071882"
]
| 0.0 | -1 |
Tests if a component object already exists in cache | protected function componentObjectExists($componentName)
{
if (!is_string($componentName)) {
throw new InvalidArgumentException('The component name must be of type string, ' . gettype($componentName) . ' given.');
}
return array_key_exists($componentName, $this->componentObjects);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }",
"function exists() {\n \n return !empty($this->cache);\n \n }",
"static private function _doesExist($object) {\n $id = $object->_id;\n $type = $object->_type;\n if (!isset(self::$cache[$type])) {\n self::$cache[$type] = self::getStack($type);\n }\n if(isset(self::$cache[$type][$id])){\n return TRUE;\n }\n return FALSE;\n }",
"public function isExistInCache($key);",
"public function objectcache_installed() {\n\t\treturn file_exists( W3TC_ADDIN_FILE_OBJECT_CACHE );\n\t}",
"protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }",
"private function _checkCache()\r\n {\r\n // get a string representation of the object\r\n ob_start();\r\n var_dump(get_object_vars($this));\r\n $buffer = ob_get_clean();\r\n \r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // check if the cache file exists, if it does use it\r\n if (file_exists(\"{$this->_config['paths']['cache']}/{$hash}\")){\r\n die(file_get_contents(\"{$this->_config['paths']['cache']}/{$hash}\"));\r\n }\r\n }",
"public function isCacheExists()\n {\n if(file_exists($this->cachedPath))\n return true;\n else\n return false;\n }",
"public function hasCacheStore(): bool;",
"public function isCached() {}",
"public function isCached(): bool;",
"function exists($name, $key=null) {\n if ($key) {\n if(!$this->cache[$name]) {\n return false;\n }\n return array_key_exists($key, $this->cache[$name]);\n }\n return array_key_exists($name, $this->cache);\n }",
"function is_cached($template, $cache_id=null)\n {\n // insert the condition to check the cache here!\n // if (functioncheckdb($this -> module)) {\n // return parent :: clear_cache($template, $this -> cache_id);\n //}\n\t $this->_setup_template($template);\n\n\t\tif ($cache_id) {\n\t\t\t$cache_id = $this->module . '|' . $cache_id;\n\t\t} else {\n\t\t\t$cache_id = $this->module . '|' . $this->cache_id;\n\t\t}\n\n return parent::is_cached($template, $cache_id);\n }",
"public function testRemoveNonExistentObjectFromCache() {\n\t\t$this->assertFalse(Core\\Cache::remove('foobar'));\n\t}",
"private function isCached()\n {\n return Cache::has($this->cacheKey());\n }",
"public static function hasCache() {\n\t\treturn false;\n\t}",
"protected static function cacheExsits($key)\n {\n \t$class = get_called_class();\n \treturn isset(BaseEntityAbstract::$_entityCache[$class]) && isset(BaseEntityAbstract::$_entityCache[$class][$key]);\n }",
"public function exists($id) {\n\t\t$is_cached = false;\n\t\tapc_fetch($id, $is_cached);\n\t\treturn $is_cached;\n\t}",
"function cacheObjectLocked ()\n {\n return is_file($this->cacheObjectId.'.lock');\n }",
"public static function cache_exists($name) {\n if(self::$adapter === false)\n throw new rcException('The Cache system is not initialized');\n return self::$adapter->cache_exists($name);\n }",
"final public function isHit(): bool\n\t{\n\t\tif ($stm = $this->_prepare('SELECT COUNT(*) AS `found` FROM `Cache` WHERE `key` = :key LIMIT 1;')) {\n\t\t\t$stm->execute(['key' => $this->getkey()]);\n\t\t\t$result = $stm->fetchObject();\n\t\t\tvar_dump($result);\n\t\t\treturn $result->found === '1';\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasCache(): bool\n {\n return isset($this->contents);\n }",
"public static function has($key){\n return \\Illuminate\\Cache\\Repository::has($key);\n }",
"public function exists($key)\n\t{\n\t\t$result = $this->cacheLayer->exists($key);\n\t\tLogger::getInstance()->log(LoggerEntry::CACHE, 'Cache', 'Try to find key [' . $key . '] into cache: ' . ($result ? 'true' : 'false'));\n\t\treturn $result;\n\t}",
"protected function _exists( $id ) {\n\t\tif ( isset( $this->cache[ $id ] ) || array_key_exists( $id, $this->cache ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn $this->redis->exists( $id );\n\t\t}\n\t}",
"public static function isCached($key) {\n\t\t\t$klass = self::getInstance();\n\t\t\treturn isset($klass->cache[crc32($key)]);\n\t\t}",
"private function hasCache()\n {\n if (!$this->isActive()) {\n return false;\n }\n\n return !empty($this->getCache(false));\n }",
"public function is_property_cached($key) {\n\t\treturn array_key_exists($key, $this->_cached_properties);\n\t}",
"public static function hasDefaultCache();",
"public function is_objectcache_add_in() {\n\t\tif ( !$this->objectcache_installed() )\n\t\t\treturn false;\n\n\t\treturn ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_OBJECT_CACHE ) )\n\t\t\t&& strstr( $script_data, '//ObjectCache Version: 1.4' ) !== false );\n\t}",
"public function is_objectcache_old_add_in() {\n\t\tif ( !$this->objectcache_installed() )\n\t\t\treturn false;\n\n\t\treturn ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_OBJECT_CACHE ) )\n\t\t\t&& ( ( strstr( $script_data, 'W3 Total Cache Object Cache' ) !== false ) ||\n\t\t\t\tstrstr( $script_data, 'w3_instance' ) !== false ) );\n\t}",
"private function checkCacheFolder(){\n if (file_exists($this->folder_path)) {\n $this->cacheCreated = true;\n }else{\n $this->cacheCreated = false;\n }\n }",
"public function exists($key)\n {\n return !empty($this->cache->get($key, 'bladerunner'));\n }",
"private function checkCache()\n {\n if ($this->createFolder()) {//if folder already exists\n\n $cache_time = time() - filemtime($this->cacheFile); //check to see how long since cached\n\n if ($cache_time > 60 * $this->cacheTime) {\n return true;//cache the file again\n }\n } else {\n $this->createFolder();\n return true;\n }\n }",
"private function _isCached($key)\n {\n return Cache::has($key);\n }",
"public function should_suggest_persistent_object_cache()\n {\n }",
"public function cacheExists()\n {\n $cacheFile = $this->getCacheFile();\n if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {\n return(true);\n } else {\n return(false);\n }\n }",
"private function lookUpNonceInCache():bool\n {\n if (!$this->di->has('cache')) {\n throw new Exception(\n \"Nonce backend 'cache' requires cache service to be configured.\"\n );\n }\n return $this->cache->get($this->nonceCacheKey);\n }",
"protected function useCache()\n {\n // Should we use a cached version?\n if ($this->cache && $this->cacheExists()) {\n $this->templateOutput = $this->getCache();\n if ($this->templateOutput !== false) {\n return true;\n }\n }\n return false;\n }",
"public function hasCacheFactory(): bool\n {\n return isset($this->cacheFactory);\n }",
"public static function isCached($id) {\n return array_key_exists(strtolower($id), self::$steamIds);\n }",
"public function cacheExists($key)\n\t{\n\n\t\t$exists = $this->_cache->exists($key);\n\t\treturn $exists;\n\n\t}",
"public function has()\n\t{\n\t\t$name = $this->name();\n\n\t\tif(($has = Cache::has($name)) && $this->forget)\n\t\t{\n\t\t\tCache::forget($name);\n\n\t\t\t// We don't want to return the cached assets because we cleared\n\t\t\t// the cache and we want a new fresh copy of the assets returned.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $has;\n\t}",
"function check_cache ( $url ) {\n $this->ERROR = \"\";\n $filename = $this->file_name( $url );\n \n if ( file_exists( $filename ) ) {\n // find how long ago the file was added to the cache\n // and whether that is longer then MAX_AGE\n $mtime = filemtime( $filename );\n $age = time() - $mtime;\n if ( $this->MAX_AGE > $age ) {\n // object exists and is current\n return 'HIT';\n }\n else {\n // object exists but is old\n return 'STALE';\n }\n }\n else {\n // object does not exist\n return 'MISS';\n }\n }",
"private function isCacheFileExists($key, $id)\n {\n return is_readable(RL_CACHE . $key . '_' . $id);\n }",
"function exists()\n {\n return false;\n }",
"final protected function getCacheNeed()\n\t{\n\t\treturn\tintval($this->arParams['CACHE_TIME']) > 0 &&\n\t\t\t\t$this->arParams['CACHE_TYPE'] != 'N' &&\n\t\t\t\tConfig\\Option::get(\"main\", \"component_cache_on\", \"Y\") == \"Y\";\n\t}",
"public function wasCached();",
"public function checkCache() {\n \tif (file_exists(dirname($this->cache_file)) || !is_writable(dirname($this->cache_file))) {\n \t\t$this->createCacheDirectory();\n \t}\n \tif (file_exists($this->cache_file)) {\n \t\t$this->mod_time = filemtime($this->cache_file) + $this->cache_time;\n \t\tif ($this->mod_time > time()) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn false;\n \t}\n \n }",
"protected static function isCached($id){\n\t\t\tif(!is_string($id) && !is_int($id)){\n\t\t\t\tLogger::warning(MessageUtility::UNEXPECTED_ARGUMENT_WARNING, \"QuarterMaster release expects string argument, \".gettype($id).\" given.\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn array_key_exists($id, self::$cache);\n\t\t}",
"public function isCached()\n {\n if ($this->cache->has($this->cacheKey)) {\n return true;\n }\n\n return false;\n }",
"public function cachedRenderExists($template, array $options = array()) {\n\n\t\t$options = array(\n\t\t\t'partial' => true,\n\t\t\t'cache' => true,\n\t\t\t'cacheHandler' => $this->getCache()->getHandler(),\n\t\t\t'cachePrefix' => 'Juvasoft'\n\t\t) + $options;\n\t\treturn parent::cachedRenderExists($template, $options);\n\t}",
"function exists() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT post_id FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( $results[0] )\n\t\t\treturn true;\n\t\t\t\n\t\treturn false;\n\t\t\n\t}",
"function MustUseCache()\n {\n if ($this->cacheLifetime == 0)\n {\n return false;\n }\n if (!File::Exists($this->file))\n {\n return false;\n }\n $now = Date::Now();\n $lastMod = File::GetLastModified($this->file);\n if ($now->TimeStamp() - $lastMod->TimeStamp() < $this->cacheLifetime)\n {\n return true;\n }\n return false;\n }",
"public function isCacheUsed()\n\t{\n\t\treturn $this->__isMainTree() and $this->use_cache;\n\t}",
"protected function isCached(array $identifier)\n {\n return isset($this->objectCache[$identifier[0]][$identifier[1]]);\n }",
"function isCached() {\r\n if ($this->_cachingEnabled) {\r\n $isCached = $this->_templateObject->isCached($this->_viewId);\r\n }\r\n else $isCached = false;\r\n return $isCached;\r\n }",
"public function testCreateCachedObject() {\n\t\t// Load the config file\n\t\tCore\\Config::load('MyProject');\n\t\tCore\\Config::set('cache', 'enable', true, true);\n\n\t\t// Put the cache\n\t\tCore\\Cache::put('foo', 'bar');\n\n\t\t// The file exists?\n\t\t$this->assertTrue(Core\\Cache::has('foo'));\n\n\t\t// And the file has the correct contents?\n\t\t$this->assertEquals(Core\\Cache::get('foo'), 'bar');\n\t}",
"function _validate_cache_id($object_id)\n {\n }",
"public function hasCache()\n {\n return (null !== $this->getCacheAdapter());\n }",
"public function isStaticCacheble() {}",
"function _cacheTableExists(){\n\t\tif ( isset($this->_cacheTableExists) ) return $this->_cacheTableExists;\n\t\t$res = mysql_query(\"SHOW TABLES LIKE '\".addslashes($this->tableName).\"'\", $this->app->db());\n\t\tif ( !$res ){\n\t\t\ttrigger_error(mysql_error($this->app->db()), E_USER_ERROR);\n\t\t}\n\t\treturn (mysql_num_rows($res) > 0);\n\t}",
"static public function hasCache($key)\n {\n if (getenv('AMTEL_CACHE') == 'redis') {\n return Cache::store('redis')->has($key);\n } else {\n return false;\n }\n }",
"public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }",
"public function isProvidersCached(): bool;",
"public function alreadyExists($key) {\r\n return $this->modx->getCount('modContext',$key) > 0;\r\n }",
"public function exists() {\n\t\ttry {\n\t\t\t$this->load();\n\t\t\treturn true;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function testGetHit()\n {\n $key = \"unique\";\n $item = $this->cache->getItem($key);\n $item->set(\"content\");\n\n $res = $item->get();\n $this->assertNull($res, \"Should not be able to find a value\");\n\n $this->cache->save($item);\n $res = $item->get();\n $this->assertTrue(!is_null($res), \"Should have a value\");\n }",
"function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }",
"public function isCached($template)\r\n {\r\n return $this->_smarty->is_cached($template);\r\n }",
"public function exists( $id ) {\r\r\n if ($this->refresh) {\r\r\n $this->init();\r\r\n $this->refresh = false;\r\r\n }\r\r\n return isset($this->instances[$id]);\r\r\n }",
"public function testRemoveCachedObject() {\n\t\t// Now remove the file\n\t\t$this->assertTrue(Core\\Cache::remove('foo'));\n\n\t\t// The file exists?\n\t\t$this->assertFalse(Core\\Cache::has('foo'));\n\t}",
"static function is_cache()\n\t{\n\t\tif (file_exists(Cache::$path))\n\t\t{\n\t\t\tif(Cache::$time>0)\n\t\t\t{\n\t\t\t\t$info_file=stat(Cache::$path);\n\t\t\t\tif(time() > $info_file[9]+Cache::$time)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tCache::delete();\n\t\t\t\t\tCache::$time=0;\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function alreadyExists($name) {\r\n if ($this->classKey == 'modTemplate') {\r\n $c = array('templatename' => $name);\r\n } else {\r\n $c = array('name' => $name);\r\n }\r\n return $this->modx->getCount($this->classKey,$c) > 0;\r\n }",
"protected function loadCacheData()\n\t{\n\t\t//is it enabled?\n\t\tif ($this->useObjectCaching)\n\t\t{\n\t\t\t//get our cache data... is it there?\n\t\t\t$data = $this->getCache();\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t//load it, and we're good.\n\t\t\t\t$this->hydrate($data);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function is_cached()\n\t\t{\n\t\t\treturn $this->cached;\n\t\t}",
"function MustStoreToCache()\n {\n return $this->cacheLifetime > 0;\n }",
"public function checkCache($key)\n {\n return $this->cache->exists($key);\n }",
"protected function isMemcachedUsed() {}",
"protected function isMemcachedUsed() {}",
"public function has($key): bool\n {\n return isset($this->cache[$key]);\n }",
"protected function exists() {}",
"public function exists($id)\n {\n if (array_key_exists($id, $this->components)) {\n return true;\n }\n\n if (isset($this->instances[$id])) {\n return true;\n }\n\n return false;\n }",
"public function IsCacheDifferent(){\r\n\t\tself::Debug('Determine if the cache is different from this instance');\r\n\t\t// Load the cache\r\n\t\t$temp=new PhpWsdl(null,$this->EndPoint);\r\n\t\t$temp->GetWsdlFromCache();\r\n\t\tif(is_null($temp->WSDL))\r\n\t\t\treturn true;// Not cached yet\r\n\t\t// Initialize this instance\r\n\t\t$this->DetermineConfiguration();\r\n\t\t$this->ParseSource();\r\n\t\t// Compare the cache with this instance\r\n\t\t$res=serialize(\r\n\t\t\t\tArray(\r\n\t\t\t\t\t$this->Methods,\r\n\t\t\t\t\t$this->Types\r\n\t\t\t\t)\r\n\t\t\t)!=serialize(\r\n\t\t\t\tArray(\r\n\t\t\t\t\t$temp->Methods,\r\n\t\t\t\t\t$temp->Types\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\tself::Debug('Cache is '.(($res)?'equal':'different'));\r\n\t\treturn $res;\r\n\t}",
"public function hasCachedData(): bool\n {\n return !empty(static::$cachedData);\n }",
"public function isCached(string $label) : bool\n {\n $filename = $this->path . \"/\" . md5($label);\n if (file_exists($filename) && (filemtime($filename) + $this->ttl >= time())) {\n return true;\n }\n return false;\n }",
"public function getObjFromCache($key);",
"function __isset($name) {\n\t\treturn array_key_exists($name,$this->object);\n\t}",
"public function isCached()\n\t{\n\t\treturn is_file($this->getCacheFile());\n\t}",
"public function enableObjectCache() {\n\t\t$this->asset_model->useObjectCaching = true;\n\t}",
"function exists() {\n\t\tif ($this->exists) return true;\n\t\treturn false;\n\t}",
"public function objectExists()\n {\n if ($this->data()->useObjectExistsHandling()) {\n return singleton($this->CreateType)->objectExists($this->request->postVars(), $this->pid);\n }\n }",
"function components_rebuildcache()\n\t{\n\t\t$this->ipsclass->cache['components'] = array();\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'com_id,com_enabled,com_section,com_filename,com_url_uri,com_url_title,com_position',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'com_enabled=1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'com_position ASC' ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->cache['components'][] = $r;\n\t\t}\n\n\t\t$this->ipsclass->update_cache( array( 'name' => 'components', 'array' => 1, 'deletefirst' => 1 ) );\n\t}",
"protected function componentDoesNotExist() : bool\n\t{\n\t\treturn ! method_exists($this->className(), $this->component);\n\t}",
"function cache_classes_IsLoaded($classname)\n{\n $cache = core_cache_Get(CACHE_CLASSES_KEY);\n RETURN array_key_exists($classname, $cache);\n}",
"public function hasObject();",
"protected function _loadCache()\n {\n return false;\n }",
"public function hasObject($key) {\r\n return isset($this->objects[$key]);\r\n }",
"public function isCacheEnabled(){\n return(true);\n }",
"public function isCacheEnabled(){\n return(true);\n }",
"public function has(string $key): bool\n {\n return $this->laravelCache->has($key);\n }"
]
| [
"0.7307906",
"0.7065242",
"0.7022028",
"0.7010389",
"0.67418027",
"0.6619877",
"0.65443224",
"0.65055037",
"0.648631",
"0.6433262",
"0.6416852",
"0.63347983",
"0.63084865",
"0.63046",
"0.6295871",
"0.62905455",
"0.6279199",
"0.6252388",
"0.6224084",
"0.6168828",
"0.61563617",
"0.6118031",
"0.6098352",
"0.6090791",
"0.60905963",
"0.60782474",
"0.6028403",
"0.6011142",
"0.5998174",
"0.5988537",
"0.5978817",
"0.59548247",
"0.5942863",
"0.5938008",
"0.59305054",
"0.59260327",
"0.5919474",
"0.59084296",
"0.58927345",
"0.5885166",
"0.58836806",
"0.5870433",
"0.5865295",
"0.5864621",
"0.58604944",
"0.58577824",
"0.5840152",
"0.5835072",
"0.5832206",
"0.5828294",
"0.5822368",
"0.58169204",
"0.58153903",
"0.5802192",
"0.5790921",
"0.57902235",
"0.5785984",
"0.57517815",
"0.5749309",
"0.5736447",
"0.573016",
"0.57255787",
"0.5723008",
"0.57206154",
"0.5700644",
"0.56993425",
"0.568824",
"0.56860554",
"0.5684893",
"0.56785464",
"0.56765956",
"0.5669136",
"0.56681246",
"0.56641126",
"0.5628416",
"0.56239617",
"0.56158185",
"0.5608193",
"0.560599",
"0.560599",
"0.56025165",
"0.5593802",
"0.5577433",
"0.5573924",
"0.5571453",
"0.55701804",
"0.5558429",
"0.5551807",
"0.5548701",
"0.55469155",
"0.5533574",
"0.5523245",
"0.55214065",
"0.55175716",
"0.55174",
"0.5513016",
"0.5513007",
"0.5500427",
"0.5500008",
"0.5500008",
"0.5496512"
]
| 0.0 | -1 |
Tests if a component configuration already exists in cache | protected function componentConfigurationExists($componentName)
{
if (!is_string($componentName)) {
throw new InvalidArgumentException('The component name must be of type string, ' . gettype($componentName) . ' given.');
}
return array_key_exists($componentName, $this->componentConfigurations);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function configurationIsCached();",
"private function cached()\n {\n if (isset(self::$_cached)) {\n $this->_config = self::$_cached;\n return true;\n } else {\n return false;\n }\n }",
"public function hasCacheStore(): bool;",
"public function isCacheExists()\n {\n if(file_exists($this->cachedPath))\n return true;\n else\n return false;\n }",
"function exists() {\n \n return !empty($this->cache);\n \n }",
"protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }",
"public function isExistInCache($key);",
"public static function configurationIsCached(){\n return \\Illuminate\\Foundation\\Application::configurationIsCached();\n }",
"protected function checkCache()\n {\n if (file_exists(app()->getCachedConfigPath())) {\n Artisan::call('config:clear');\n Artisan::call('config:cache');\n return true;\n }\n return false;\n }",
"public static function hasCache() {\n\t\treturn false;\n\t}",
"public static function cache_exists($name) {\n if(self::$adapter === false)\n throw new rcException('The Cache system is not initialized');\n return self::$adapter->cache_exists($name);\n }",
"public function isCached() {}",
"public function isCached(): bool;",
"function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }",
"public function hasCacheFactory(): bool\n {\n return isset($this->cacheFactory);\n }",
"public function hasCache(): bool\n {\n return isset($this->contents);\n }",
"public function isProvidersCached(): bool;",
"function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }",
"public static function hasDefaultCache();",
"public function cacheExists()\n {\n $cacheFile = $this->getCacheFile();\n if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {\n return(true);\n } else {\n return(false);\n }\n }",
"public static function is_set_cache(): bool\n {\n return self::getConfigDB(self::cache);\n }",
"public function objectcache_installed() {\n\t\treturn file_exists( W3TC_ADDIN_FILE_OBJECT_CACHE );\n\t}",
"private function isCached()\n {\n return Cache::has($this->cacheKey());\n }",
"final protected function getCacheNeed()\n\t{\n\t\treturn\tintval($this->arParams['CACHE_TIME']) > 0 &&\n\t\t\t\t$this->arParams['CACHE_TYPE'] != 'N' &&\n\t\t\t\tConfig\\Option::get(\"main\", \"component_cache_on\", \"Y\") == \"Y\";\n\t}",
"public function is_property_cached($key) {\n\t\treturn array_key_exists($key, $this->_cached_properties);\n\t}",
"function exists($name, $key=null) {\n if ($key) {\n if(!$this->cache[$name]) {\n return false;\n }\n return array_key_exists($key, $this->cache[$name]);\n }\n return array_key_exists($name, $this->cache);\n }",
"private function hasCache()\n {\n if (!$this->isActive()) {\n return false;\n }\n\n return !empty($this->getCache(false));\n }",
"protected function useCache()\n {\n // Should we use a cached version?\n if ($this->cache && $this->cacheExists()) {\n $this->templateOutput = $this->getCache();\n if ($this->templateOutput !== false) {\n return true;\n }\n }\n return false;\n }",
"static public function addCache($configuration) {\n\t\tif(!isset($configuration['cache_id'])) {\n\t\t\t$mComponentcache=new Maerdo_Model_Componentcache();\n\t\t\treturn($mComponentcache->insert(array('name'=>$configuration['name'],'type'=>$configuration['frontend_type'],'backend_type'=>$configuration['backend_type'])));\n\t\t}\n\t\t\n\t}",
"function _biurnal_conf_get_conf_cache($name) {\n ctools_include('object-cache');\n $cache = ctools_object_cache_get('biurnal_conf', $name);\n if (!$cache) {\n $cache = biurnal_conf_load($name);\n if ($cache) {\n $cache->locked = ctools_object_cache_test('biurnal_conf', $name);\n }\n }\n\n return $cache;\n}",
"public static function has($key){\n return \\Illuminate\\Cache\\Repository::has($key);\n }",
"private function checkCacheFolder(){\n if (file_exists($this->folder_path)) {\n $this->cacheCreated = true;\n }else{\n $this->cacheCreated = false;\n }\n }",
"public function hasConfig();",
"private static function hasCacheFile() {\r\n if (!isset(self::$_hasCacheFile)) {\r\n self::$_hasCacheFile = File::exists(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH);\r\n }\r\n return self::$_hasCacheFile;\r\n }",
"static public function hasCache($key)\n {\n if (getenv('AMTEL_CACHE') == 'redis') {\n return Cache::store('redis')->has($key);\n } else {\n return false;\n }\n }",
"function is_cached($template, $cache_id=null)\n {\n // insert the condition to check the cache here!\n // if (functioncheckdb($this -> module)) {\n // return parent :: clear_cache($template, $this -> cache_id);\n //}\n\t $this->_setup_template($template);\n\n\t\tif ($cache_id) {\n\t\t\t$cache_id = $this->module . '|' . $cache_id;\n\t\t} else {\n\t\t\t$cache_id = $this->module . '|' . $this->cache_id;\n\t\t}\n\n return parent::is_cached($template, $cache_id);\n }",
"public function checkIfEssentialConfigurationExists() {}",
"public function has(string $name):bool\n {\n /**\n * @var ConfigModel $model\n */\n\n $found = $this->cache->has($name);\n\n if (!$found) {\n $model = $this->loadOne($name);\n\n $found = false !== $model;\n if ($found) {\n $this->cache->set($name, $model);\n }\n }\n\n return $found;\n }",
"private function checkCache()\n {\n if ($this->createFolder()) {//if folder already exists\n\n $cache_time = time() - filemtime($this->cacheFile); //check to see how long since cached\n\n if ($cache_time > 60 * $this->cacheTime) {\n return true;//cache the file again\n }\n } else {\n $this->createFolder();\n return true;\n }\n }",
"private function _shouldBeCached()\n {\n $item = $this->repo->get(SettingKeys::CACHE_SETTINGS);\n //The setting failed to fetch, don't cache value to be on the safe side.\n if (!$item) {\n Log::channel('runtime')->warning(\n '[SettingsManager:39] Failed to fetch setting.',\n ['key' => SettingKeys::CACHE_SETTINGS]\n );\n return false;\n }\n return $item->value;\n }",
"function MustUseCache()\n {\n if ($this->cacheLifetime == 0)\n {\n return false;\n }\n if (!File::Exists($this->file))\n {\n return false;\n }\n $now = Date::Now();\n $lastMod = File::GetLastModified($this->file);\n if ($now->TimeStamp() - $lastMod->TimeStamp() < $this->cacheLifetime)\n {\n return true;\n }\n return false;\n }",
"public function testCreateCachedObject() {\n\t\t// Load the config file\n\t\tCore\\Config::load('MyProject');\n\t\tCore\\Config::set('cache', 'enable', true, true);\n\n\t\t// Put the cache\n\t\tCore\\Cache::put('foo', 'bar');\n\n\t\t// The file exists?\n\t\t$this->assertTrue(Core\\Cache::has('foo'));\n\n\t\t// And the file has the correct contents?\n\t\t$this->assertEquals(Core\\Cache::get('foo'), 'bar');\n\t}",
"public function hasConfig($key);",
"public function has()\n\t{\n\t\t$name = $this->name();\n\n\t\tif(($has = Cache::has($name)) && $this->forget)\n\t\t{\n\t\t\tCache::forget($name);\n\n\t\t\t// We don't want to return the cached assets because we cleared\n\t\t\t// the cache and we want a new fresh copy of the assets returned.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $has;\n\t}",
"public static function has($key)\n {\n if (isset(static::$cache[$key])) return true;\n\n $config = DBConfig::where('_key', '=', $key)->first();\n\n if (is_null($config)) return false;\n else return true;\n }",
"public function checkCache() {\n \tif (file_exists(dirname($this->cache_file)) || !is_writable(dirname($this->cache_file))) {\n \t\t$this->createCacheDirectory();\n \t}\n \tif (file_exists($this->cache_file)) {\n \t\t$this->mod_time = filemtime($this->cache_file) + $this->cache_time;\n \t\tif ($this->mod_time > time()) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn false;\n \t}\n \n }",
"public function hasCache()\n {\n return (null !== $this->getCacheAdapter());\n }",
"public function checkCache()\n {\n $this->assertWritableDir($this->config->getPath('cache'));\n }",
"private function lookUpNonceInCache():bool\n {\n if (!$this->di->has('cache')) {\n throw new Exception(\n \"Nonce backend 'cache' requires cache service to be configured.\"\n );\n }\n return $this->cache->get($this->nonceCacheKey);\n }",
"function _config_cache(){\n Mapper::config(array('use_cache'=>false));\n \n}",
"public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }",
"public function get_css_cache_invalidated(): bool{\n\t\t\t// false = cache valid\n\n\t\t\tif($this->module_css_cache_invalidated !== NULL){\n\t\t\t\treturn $this->module_css_cache_invalidated; // status already retrieved\n\t\t\t}\n\n\t\t\tif(!isset(static::$list[$this->get_UID()]['cache'][ 'invalidated' ])){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // setting not saved yet\n\t\t\t}\n\n\t\t\tif(is_admin() && intval(static::$list[$this->get_UID()]['cache'][ 'invalidated' ]['gutenberg']->get_data()) === 1){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // cache is invalidated\n\t\t\t}\n\t\t\tif(!is_admin() && intval(static::$list[$this->get_UID()]['cache'][ 'invalidated' ]['frontend']->get_data()) === 1){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // cache is invalidated\n\t\t\t}\n\n\t\t\t$this->module_css_cache_invalidated = false;\n\t\t\treturn false; // cache is valid\n\t\t}",
"public function configFileExists() {\n $_fileName = \\Config::get('fontello::config.file');\n $_folderName = \\Config::get('fontello::config.folder');\n if (\\File::exists($_folderName . $_fileName)) {\n $this->_configFile = $_folderName . $_fileName;\n return true;\n }\n return false;\n }",
"public function testCacheConfig() {\n\t\tif (!$this->_hasTrigger('setupCache')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$expected = $this->_manualCall('setupCache', $this->ObjectEvent);\n\n\t\t$result = $this->Event->trigger($this->ModelObject, $this->plugin . '.setupCache');\n\t\t$this->assertEquals($expected, $result);\n\t}",
"protected static function cacheExsits($key)\n {\n \t$class = get_called_class();\n \treturn isset(BaseEntityAbstract::$_entityCache[$class]) && isset(BaseEntityAbstract::$_entityCache[$class][$key]);\n }",
"public function getConfigCacheEnabled()\n {\n return $this->configCacheEnabled;\n }",
"public function hasConfig(string $key): bool;",
"public function exists($id) {\n\t\t$is_cached = false;\n\t\tapc_fetch($id, $is_cached);\n\t\treturn $is_cached;\n\t}",
"private function loadConfig() {\n if (file_exists($this->_data['cache_config_file'])) {\n $data = unserialize(file_get_contents($this->_data['cache_config_file']));\n \n self::$_configInstance = (object)$data; //instance of stdClass with all the properties public\n //$this->_data = (array)$data; \n return true;\n } \n return false;\n }",
"protected function _loadCache()\n {\n return false;\n }",
"public function cacheExists($key)\n\t{\n\n\t\t$exists = $this->_cache->exists($key);\n\t\treturn $exists;\n\n\t}",
"public function testCacheableInstallWithConfig() {\n $this->installProcedure->shouldBeCalledOnce();\n $this->updateProcedure->shouldNotBeCalled();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }",
"public function exists($key)\n\t{\n\t\t$result = $this->cacheLayer->exists($key);\n\t\tLogger::getInstance()->log(LoggerEntry::CACHE, 'Cache', 'Try to find key [' . $key . '] into cache: ' . ($result ? 'true' : 'false'));\n\t\treturn $result;\n\t}",
"public static function cache()\n {\n $cache = Cache::instance('system');\n if (!$cache->get('config-autoload')) {\n $cache->set('config-autoload', self::$data);\n }\n }",
"public function isUseCache()\n {\n return $this->use_cache;\n }",
"private function check_cache() {\n if (!file_exists($this->cache_file)) {\n return false;\n }\n if (filemtime($this->cache_file) >= strtotime(\"-\" . CACHE_EXPIRATION . \" seconds\")) {\n return true;\n } else {\n return false;\n }\n }",
"public function isCached()\n\t{\n\t\treturn is_file($this->getCacheFile());\n\t}",
"protected function isAlreadyInstalled($key = 'config')\n {\n $path = $this->getCorePath();\n\n return file_exists(realpath(\"{$path}/config/{$key}.inc.php\"));\n }",
"public function wasCached();",
"private function _checkCache()\r\n {\r\n // get a string representation of the object\r\n ob_start();\r\n var_dump(get_object_vars($this));\r\n $buffer = ob_get_clean();\r\n \r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // check if the cache file exists, if it does use it\r\n if (file_exists(\"{$this->_config['paths']['cache']}/{$hash}\")){\r\n die(file_get_contents(\"{$this->_config['paths']['cache']}/{$hash}\"));\r\n }\r\n }",
"static function is_cache()\n\t{\n\t\tif (file_exists(Cache::$path))\n\t\t{\n\t\t\tif(Cache::$time>0)\n\t\t\t{\n\t\t\t\t$info_file=stat(Cache::$path);\n\t\t\t\tif(time() > $info_file[9]+Cache::$time)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tCache::delete();\n\t\t\t\t\tCache::$time=0;\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function exists($key)\n {\n return !empty($this->cache->get($key, 'bladerunner'));\n }",
"public static function config_file_exists() {\n // Allow for late static binding by using static.\n $configfilepath = static::get_config_file_path();\n\n // Invalidate opcode php cache, so we get correct status of file.\n core_component::invalidate_opcode_php_cache($configfilepath);\n return file_exists($configfilepath);\n }",
"private function _loadConfig() {\n\t\t$this->_config = $this->_call('configuration', '');\n\n\t\treturn ! empty($this->_config);\n\t}",
"public static function isCached($key) {\n\t\t\t$klass = self::getInstance();\n\t\t\treturn isset($klass->cache[crc32($key)]);\n\t\t}",
"public function isCached()\n {\n if ($this->cache->has($this->cacheKey)) {\n return true;\n }\n\n return false;\n }",
"private function _isCached($key)\n {\n return Cache::has($key);\n }",
"public function cacheExists($bForce = false) {\n\t\tif(!file_exists($this -> sCacheDir . $this -> sCacheFile) || $bForce == true) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"private function _configurationExists($input) {\n\t\t$check = $this->db->queryFetchSingle(\"SELECT * FROM \"._WE_CREDITSYS_.\" WHERE config_id = ?\", array($input));\n\t\tif($check) return true;\n\t\treturn false;\n\t}",
"public function hasCachedData(): bool\n {\n return !empty(static::$cachedData);\n }",
"public function isCacheClearEnabled(): bool;",
"public function isCacheEnabled(): bool\n {\n return Environment::CACHE_ENABLED;\n }",
"public function isCacheEnabled(){\n return(true);\n }",
"public function isCacheEnabled(){\n return(true);\n }",
"public function isCacheEnabled(Widget $widget)\n {\n $widgets = $this->container->getParameter('victoire_core.widgets');\n foreach ($widgets as $widgetParams) {\n if ($widgetParams['class'] === ClassUtils::getClass($widget)) {\n if (array_key_exists('cache', $widgetParams)) {\n return $widgetParams['cache'];\n } else {\n return true;\n }\n }\n }\n\n throw new \\Exception('Widget config not found for widget '.ClassUtils::getClass($widget).'. Is this widget right declared in AppKernel ?');\n }",
"public function isCacheUsed()\n\t{\n\t\treturn $this->__isMainTree() and $this->use_cache;\n\t}",
"public function has_config() {\n return false;\n }",
"public function has_config() {\n return false;\n }",
"protected function configureCaching() {\n $_CONFIG = array();\n\n require_once ASCMS_CORE_MODULE_PATH . '/Cache/Controller/CacheLib.class.php';\n\n $isInstalled = function($cacheEngine) {\n switch ($cacheEngine) {\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC:\n return extension_loaded('apc');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE:\n return extension_loaded('opcache') || extension_loaded('Zend OPcache');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE:\n return extension_loaded('memcache') || extension_loaded('memcached');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE:\n return extension_loaded('xcache');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_FILESYSTEM:\n return true;\n }\n };\n\n $isConfigured = function($cacheEngine, $user = false) {\n switch ($cacheEngine) {\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC:\n if ($user) {\n return ini_get('apc.serializer') == 'php';\n }\n return true;\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE:\n return ini_get('opcache.save_comments') && ini_get('opcache.load_comments');\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE:\n return false;\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE:\n if ($user) {\n return (\n ini_get('xcache.var_size') > 0 &&\n ini_get('xcache.admin.user') &&\n ini_get('xcache.admin.pass')\n );\n }\n return ini_get('xcache.size') > 0;\n case \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_FILESYSTEM:\n return is_writable(ASCMS_DOCUMENT_ROOT . '/tmp/cache');\n }\n };\n\n // configure opcaches\n $configureOPCache = function() use($isInstalled, $isConfigured, &$_CONFIG) {\n // APC\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC) && $isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC)) {\n $_CONFIG['cacheOPCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC;\n return;\n }\n\n // Disable zend opcache if it is enabled\n // If save_comments is set to TRUE, doctrine2 will not work properly.\n // It is not possible to set a new value for this directive with php.\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE)) {\n ini_set('opcache.save_comments', 1);\n ini_set('opcache.load_comments', 1);\n ini_set('opcache.enable', 1);\n\n if ($isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE)) {\n $_CONFIG['cacheOPCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_ZEND_OPCACHE;\n return;\n }\n }\n\n // XCache\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE) &&\n $isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE)\n ) {\n $_CONFIG['cacheOPCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE;\n return;\n }\n return false;\n };\n\n // configure user caches\n $configureUserCache = function() use($isInstalled, $isConfigured, &$_CONFIG) {\n // APC\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC)) {\n // have to use serializer \"php\", not \"default\" due to doctrine2 gedmo tree repository\n ini_set('apc.serializer', 'php');\n if ($isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC, true)) {\n $_CONFIG['cacheUserCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_APC;\n return;\n }\n }\n\n // Memcache\n if ($isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE) && $isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE)) {\n $_CONFIG['cacheUserCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_MEMCACHE;\n return;\n }\n\n // XCache\n if (\n $isInstalled(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE) &&\n $isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE, true)\n ) {\n $_CONFIG['cacheUserCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_XCACHE;\n return;\n }\n\n // Filesystem\n if ($isConfigured(\\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_FILESYSTEM)) {\n $_CONFIG['cacheUserCache'] = \\Cx\\Core_Modules\\Cache\\Controller\\CacheLib::CACHE_ENGINE_FILESYSTEM;\n return;\n }\n return false;\n };\n\n if ($configureOPCache() === false) {\n $_CONFIG['cacheOpStatus'] = 'off';\n } else {\n $_CONFIG['cacheOpStatus'] = 'on';\n }\n\n if ($configureUserCache() === false) {\n $_CONFIG['cacheDbStatus'] = 'off';\n } else {\n $_CONFIG['cacheDbStatus'] = 'on';\n }\n\n $objDb = $this->_getDbObject($statusMsg);\n foreach ($_CONFIG as $key => $value) {\n $objDb->Execute(\"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings` SET `setvalue` = '\".$value.\"' WHERE `setname` = '\".$key.\"'\");\n }\n }",
"function MustStoreToCache()\n {\n return $this->cacheLifetime > 0;\n }",
"public function has($name) {\n\n if(isset($this->settings[$name])) {\n return true;\n }\n\n /** @var Setting $setting */\n if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) {\n $this->addToCache($setting);\n return true;\n }\n\n return false;\n }",
"public function canBeCached(): bool\n {\n foreach ($this->getValidators() as $validator) {\n if (!$validator->canBeCached()) {\n return false;\n }\n }\n\n return true;\n }",
"protected function isCached(): bool\n {\n $cacheTime = self::CACHE_TIME * 60;\n\n if (!is_file($this->pathCache)) {\n return false;\n }\n\n $cachedTime = filemtime($this->pathCache);\n $cacheAge = $this->time - $cachedTime;\n\n return $cacheAge < $cacheTime;\n }",
"public function has($key): bool\n {\n return isset($this->cache[$key]);\n }",
"public function testConfigExists() {\n if (isset($this->app->config) && sizeof($this->app->config) > 0) {\n $this->pass(\"The configuration file has been loaded.\");\n }\n else {\n $this->fail(\"The configuration file was not loaded or is empty.\");\n }\n }",
"public function useCache()\n {\n return false;\n }",
"static private function backupFileExists() {\n return file_exists( self::$cache_config_file_backup );\n }",
"public function testCacheableInstallWithoutConfig() {\n $this->installProcedure->shouldBeCalledOnce();\n $this->updateProcedure->shouldNotBeCalled();\n\n $this->cachedInstall\n ->setConfigDir(NULL)\n ->install($this->installer, $this->updater);\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteNotCached($this->cachedInstall->getUpdateCacheId());\n }",
"public function checkCache($key)\n {\n return $this->cache->exists($key);\n }",
"protected function useCache() {\n\t\tif (isset($_COOKIE['nc']) && $_COOKIE['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (isset($_GET['nc']) && $_GET['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"public function IsCacheDifferent(){\r\n\t\tself::Debug('Determine if the cache is different from this instance');\r\n\t\t// Load the cache\r\n\t\t$temp=new PhpWsdl(null,$this->EndPoint);\r\n\t\t$temp->GetWsdlFromCache();\r\n\t\tif(is_null($temp->WSDL))\r\n\t\t\treturn true;// Not cached yet\r\n\t\t// Initialize this instance\r\n\t\t$this->DetermineConfiguration();\r\n\t\t$this->ParseSource();\r\n\t\t// Compare the cache with this instance\r\n\t\t$res=serialize(\r\n\t\t\t\tArray(\r\n\t\t\t\t\t$this->Methods,\r\n\t\t\t\t\t$this->Types\r\n\t\t\t\t)\r\n\t\t\t)!=serialize(\r\n\t\t\t\tArray(\r\n\t\t\t\t\t$temp->Methods,\r\n\t\t\t\t\t$temp->Types\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\tself::Debug('Cache is '.(($res)?'equal':'different'));\r\n\t\treturn $res;\r\n\t}"
]
| [
"0.74050444",
"0.6943311",
"0.66596097",
"0.6659518",
"0.6620545",
"0.6600044",
"0.65929997",
"0.6559171",
"0.64751995",
"0.643274",
"0.6328009",
"0.62962157",
"0.6294914",
"0.62888086",
"0.6264338",
"0.62566394",
"0.62435853",
"0.62369764",
"0.620755",
"0.62035394",
"0.6144992",
"0.611739",
"0.61152154",
"0.6093971",
"0.6065622",
"0.60632586",
"0.60400516",
"0.6031343",
"0.5984901",
"0.59830266",
"0.59768254",
"0.5972745",
"0.59695244",
"0.5968052",
"0.59234685",
"0.5918955",
"0.59149635",
"0.59134674",
"0.5893053",
"0.5892816",
"0.5874702",
"0.58636457",
"0.58603376",
"0.58568764",
"0.58421296",
"0.5831646",
"0.58307236",
"0.5829081",
"0.58272266",
"0.5816818",
"0.5811628",
"0.57947546",
"0.5791664",
"0.5789775",
"0.5779273",
"0.5778935",
"0.57647073",
"0.57638633",
"0.57606184",
"0.5759884",
"0.5755977",
"0.5754888",
"0.5725813",
"0.572039",
"0.5694627",
"0.56926674",
"0.568898",
"0.56835103",
"0.568257",
"0.5671639",
"0.56676435",
"0.5664591",
"0.5662888",
"0.5662014",
"0.56609124",
"0.5655595",
"0.564983",
"0.56382394",
"0.5636443",
"0.5634819",
"0.563257",
"0.5629902",
"0.562577",
"0.562577",
"0.56196964",
"0.5598908",
"0.5590816",
"0.5590816",
"0.5587522",
"0.5577372",
"0.5564344",
"0.5559258",
"0.5551313",
"0.5547514",
"0.5533925",
"0.5532937",
"0.55279684",
"0.552268",
"0.55175406",
"0.5516501",
"0.5515917"
]
| 0.0 | -1 |
Returns the scope of the specified component. If it is not defined in the component configuration, the scope is 'singleton'. | protected function getComponentScope($componentName, $componentConfiguration)
{
$scope = !is_null($componentConfiguration['scope']) ? $componentConfiguration['scope'] : 'prototype';
return $scope;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getScope() {\n\t\treturn self::getPathParams()['scope'];\n\t}",
"public static function getScope()\n {\n return self::$scope;\n }",
"public function getScope()\n {\n return $this->scope;\n }",
"public function getScope()\n {\n return $this->scope;\n }",
"public function getScope()\n {\n return $this->scope;\n }",
"public function getScope()\n {\n return $this->scope;\n }",
"public function getScope()\n {\n return $this->scope;\n }",
"public function getScope()\n {\n return $this->scope;\n }",
"public function getScope()\n {\n return $this->scope;\n }",
"static public function getScope()\r\n {\r\n return self::$_scope;\r\n }",
"public function getScope() {\n\t\treturn $this->scope;\n\t}",
"protected function _scope()\n\t{\n\t\treturn $this->_meta['scope'];\n\t}",
"public function getScope();",
"public function getScope();",
"public function getScope()\n {\n return $this->_scope;\n }",
"public function getScope() {\n\t\treturn $this->_scope;\n\t}",
"public function getScope(): ?string\n {\n return $this->scope;\n }",
"public function getScope(): ?string\n {\n return $this->scope;\n }",
"public function getDefaultScope()\n {\n return $this->_defaultScope;\n }",
"abstract public function getScope();",
"private function scope($params)\n {\n if (isset($params['scope'])) {\n return $params['scope'];\n }\n\n return 'global';\n }",
"protected function _getScope()\n {\n if (!$this->hasData('scope')) {\n $this->setScope(null);\n }\n return $this->_getData('scope');\n /*\n if (!$this->_scope) {\n $this->_scope = $this->_storeFactory->create(\n [\n 'url' => $this,\n 'data' => ['force_disable_rewrites' => false, 'disable_store_in_url' => false],\n ]\n );\n }\n return $this->_scope; */\n }",
"public function singleton() {\n return $this->scope( 'singleton' );\n }",
"function getScope($type) {\n\t\tif ($type == \"static\")\n\t\t\treturn \"static\";\n\t\telse\n\t\t\treturn \"instance\";\n\t}",
"public function getComponentNameSpace(): string\n {\n if ($this->namespace === null) {\n return Arr::get($this->component->getComponentNameSpace(), 'component');\n }\n\n return $this->namespace;\n }",
"public function getClassScope() {\n\t\t$matches = array();\n\t\tpreg_match(self::PATTERN_SCOPE_ANNOTATION, $this->originalClassCode, $matches);\n\t\tif (!isset($matches['scope'])) {\n\t\t\treturn self::SCOPE_PROTOTYPE;\n\t\t}\n\t\tswitch ($matches['scope']) {\n\t\t\tcase self::SCOPE_PROTOTYPE:\n\t\t\t\treturn self::SCOPE_PROTOTYPE;\n\t\t\tcase self::SCOPE_SESSION:\n\t\t\t\treturn self::SCOPE_SESSION;\n\t\t\tcase self::SCOPE_SINGLETON:\n\t\t\t\treturn self::SCOPE_SINGLETON;\n\t\t\tdefault:\n\t\t\t\tthrow new \\TYPO3\\Backporter\\Exception\\InvalidScopeException('Invalid scope \"' . $matches['scope'] . '\"');\n\t\t}\n\t}",
"public function component()\n {\n return $this->component;\n }",
"public function getCurrentScope()\n {\n return $this->getPersistentData('currentScope', $this->getDefaultScope());\n }",
"public function getDirectoryScope()\n {\n if (array_key_exists(\"directoryScope\", $this->_propDict)) {\n if (is_a($this->_propDict[\"directoryScope\"], \"\\Microsoft\\Graph\\Model\\DirectoryObject\") || is_null($this->_propDict[\"directoryScope\"])) {\n return $this->_propDict[\"directoryScope\"];\n } else {\n $this->_propDict[\"directoryScope\"] = new DirectoryObject($this->_propDict[\"directoryScope\"]);\n return $this->_propDict[\"directoryScope\"];\n }\n }\n return null;\n }",
"protected function getScope(array $params) {\n\t\tswitch ($params['table']) {\n\t\t\tcase 'pages':\n\t\t\t\t$scope = \\Extension\\Templavoila\\Domain\\Model\\AbstractDataStructure::SCOPE_PAGE;\n\t\t\tbreak;\n\t\t\tcase 'tt_content':\n\t\t\t\t$scope = \\Extension\\Templavoila\\Domain\\Model\\AbstractDataStructure::SCOPE_FCE;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$scope = \\Extension\\Templavoila\\Domain\\Model\\AbstractDataStructure::SCOPE_UNKNOWN;\n\t\t}\n\t\treturn $scope;\n\t}",
"public function isScope();",
"public function getActiveComponent(): string\n {\n return $this->rule->getComponent($this->dotIndex);\n }",
"public function getScope($objectName) {\n\t\treturn $this->objectContainer->getScope($objectName);\n\t}",
"public function getApiScope()\n {\n return $this->api_scope;\n }",
"public function getComponent()\n\t{\n\t\treturn $this->component;\n\t}",
"public function getScope()\n {\n $code = Mage::app()->getRequest()->getParam('store');\n $code_w = Mage::app()->getRequest()->getParam('website');\n if ($code != '') {\n $store_id = Mage::getModel('core/store')->load($code)->getId();\n } else if ($code_w != '') {\n $website_id = Mage::getModel('core/website')->load($code)->getId();\n $store_id = Mage::app()->getWebsite($website_id)->getDefaultStore()->getId();\n } else {\n $store_id = 0;\n }\n\n if ($code == '' && $code_w == '') {\n $data['scope'] = 'default';\n $data['scope_id'] = 0;\n } else if (isset($website_id)) {\n $data['scope'] = 'websites';\n $data['scope_id'] = $website_id;\n } else if (isset($store_id)) {\n $data['scope'] = 'stores';\n $data['scope_id'] = $store_id;\n } else {\n $data['scope'] = 'default';\n $data['scope_id'] = 0;\n }\n\n return $data;\n }",
"public function getAppScope()\n {\n if (array_key_exists(\"appScope\", $this->_propDict)) {\n if (is_a($this->_propDict[\"appScope\"], \"\\Microsoft\\Graph\\Model\\AppScope\") || is_null($this->_propDict[\"appScope\"])) {\n return $this->_propDict[\"appScope\"];\n } else {\n $this->_propDict[\"appScope\"] = new AppScope($this->_propDict[\"appScope\"]);\n return $this->_propDict[\"appScope\"];\n }\n }\n return null;\n }",
"public function getScope(): Oauth2ScopeInterface;",
"public function getScope($objectName)\n {\n if (!$this->isRegistered($objectName)) {\n throw new \\TYPO3\\CMS\\Extbase\\Object\\Container\\Exception\\UnknownObjectException('Object \"' . $objectName . '\" is not registered.', 1265367590);\n }\n return $this->objectContainer->isSingleton($objectName) ? Container::SCOPE_SINGLETON : Container::SCOPE_PROTOTYPE;\n }",
"public function getSettingScope()\n {\n if (array_key_exists(\"settingScope\", $this->_propDict)) {\n if (is_a($this->_propDict[\"settingScope\"], \"\\Beta\\Microsoft\\Graph\\Model\\GroupPolicySettingScope\") || is_null($this->_propDict[\"settingScope\"])) {\n return $this->_propDict[\"settingScope\"];\n } else {\n $this->_propDict[\"settingScope\"] = new GroupPolicySettingScope($this->_propDict[\"settingScope\"]);\n return $this->_propDict[\"settingScope\"];\n }\n }\n return null;\n }",
"public function getDeviceScopeId()\n {\n if (array_key_exists(\"deviceScopeId\", $this->_propDict)) {\n return $this->_propDict[\"deviceScopeId\"];\n } else {\n return null;\n }\n }",
"public function scopes()\n {\n return [\n 'none' => 'Testing Unit',\n 'tag' => new TagScope(),\n 'category' => new CategoryScope(),\n\n ];\n }",
"private function determine_scope() {\n\t\t$taxonomy = $this->get_taxonomy();\n\n\t\tif ( $taxonomy === 'category' ) {\n\t\t\treturn 'category';\n\t\t}\n\n\t\tif ( $taxonomy === 'post_tag' ) {\n\t\t\treturn 'tag';\n\t\t}\n\n\t\treturn 'term';\n\t}",
"public function getScope(): ?TermGroupScope {\n $val = $this->getBackingStore()->get('scope');\n if (is_null($val) || $val instanceof TermGroupScope) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'scope'\");\n }",
"public function getQueryScope()\n {\n return $this->query_scope;\n }",
"public function componentName()\n {\n return 'config';\n }",
"public function scopes()\n {\n return [\n 'category' => new CategoryScope(),\n ];\n }",
"public function getDirectoryScopeId()\n {\n if (array_key_exists(\"directoryScopeId\", $this->_propDict)) {\n return $this->_propDict[\"directoryScopeId\"];\n } else {\n return null;\n }\n }",
"public function get_component() : string\n {\n return $this->component;\n }",
"public function findScopeByScope(string $scope): ?object;",
"public function getScope(): ?AccessReviewScope {\n $val = $this->getBackingStore()->get('scope');\n if (is_null($val) || $val instanceof AccessReviewScope) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'scope'\");\n }",
"public function getComponentName()\n {\n $component = $this->argument('component') ?: app('components')->getUsedNow();\n\n $component = app('components')->findOrFail($component);\n\n return $component->getStudlyName();\n }",
"public function getClosureScopeClass()\n\t{\n\t\treturn null;\n\t}",
"public function getScope(): ?Filter {\n $val = $this->getBackingStore()->get('scope');\n if (is_null($val) || $val instanceof Filter) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'scope'\");\n }",
"public function getCompleteScope(): int;",
"public function getScopeLabel()\r\n {\r\n $html = '';\r\n $attribute = $this->getElement()->getEntityAttribute();\r\n if (!$attribute || Mage::app()->isSingleStoreMode() || $attribute->getFrontendInput()=='gallery') {\r\n return $html;\r\n }\r\n\r\n /*\r\n * Check if the current attribute is a 'price' attribute. If yes, check\r\n * the config setting 'Catalog Price Scope' and modify the scope label.\r\n */\r\n $isGlobalPriceScope = false;\r\n if ($attribute->getFrontendInput() == 'price') {\r\n $priceScope = Mage::getStoreConfig('catalog/price/scope');\r\n if ($priceScope == 0) {\r\n $isGlobalPriceScope = true;\r\n }\r\n }\r\n\r\n if ($attribute->isScopeGlobal() || $isGlobalPriceScope) {\r\n $html .= Mage::helper('adminhtml')->__('[GLOBAL]');\r\n } elseif ($attribute->isScopeWebsite()) {\r\n $html .= Mage::helper('adminhtml')->__('[WEBSITE]');\r\n } elseif ($attribute->isScopeStore()) {\r\n $html .= Mage::helper('adminhtml')->__('[STORE VIEW]');\r\n }\r\n\r\n return $html;\r\n }",
"public function getResetScope()\n {\n if (array_key_exists(\"resetScope\", $this->_propDict)) {\n if (is_a($this->_propDict[\"resetScope\"], \"\\Beta\\Microsoft\\Graph\\Model\\SynchronizationJobRestartScope\") || is_null($this->_propDict[\"resetScope\"])) {\n return $this->_propDict[\"resetScope\"];\n } else {\n $this->_propDict[\"resetScope\"] = new SynchronizationJobRestartScope($this->_propDict[\"resetScope\"]);\n return $this->_propDict[\"resetScope\"];\n }\n }\n return null;\n }",
"private function getAutoScope(){\n $model=$this->model;\n $static=$this->model->subClassOf;\n if(property_exists($static,\"scope\") && array_key_exists(\"auto\",$static->scope)){\n $this->autoScope=$static->scope['auto'];\n }\n if($this->autoScope!==null && !is_array($this->autoScope)){\n $this->autoScope=[$this->autoScope];\n }\n\n $this->scope($this->autoScope,$model);\n\n }",
"public function getViewScope() {\n \t\n \t// Return our scope\n \treturn $this->oView;\n }",
"public function getInstanceEnumerationScope(): ?AccessReviewScope {\n $val = $this->getBackingStore()->get('instanceEnumerationScope');\n if (is_null($val) || $val instanceof AccessReviewScope) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'instanceEnumerationScope'\");\n }",
"public static function isScopeType($token) {\n\t\t\t// TODO uncomment session code\n\t\t\t// return is_string($token) && preg_match('/^(singleton|prototype|session)$/', $token);\n\t\t\treturn is_string($token) && preg_match('/^(singleton|prototype)$/', $token);\n\t\t}",
"public function scope(string $path = null, $default = null)\n {\n if (mb_strlen($path)) {\n $path = \".$path\";\n }\n\n return $this->get($this->config['scope_key'].\"$path\", $default);\n }",
"public function isScopeGlobal()\n {\n return true;\n }",
"public function disableDefaultScope() {\n $this->_disabled = true;\n return $this->Owner;\n }",
"protected function getComponent($component)\n\t{\n\t\tif (!Yii::app() instanceof CWebApplication) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($instance = Yii::app()->getComponent($component)) {\n\t\t\treturn $instance;\n\t\t}\n\n\t\treturn null;\n\t}",
"public function setScope($var)\n {\n GPBUtil::checkString($var, True);\n $this->scope = $var;\n\n return $this;\n }",
"public function getAttributesScope(string $name);",
"public function defaultScope()\n { \n \t// Dont do the scope check for logging in and for admin pages \n \t// **ATTENTION: This will need to be changed in the future\n\n \t// admin page can only show tutor\n \tif ('admin' == Yii::app()->controller->getAction()->getId())\n\t return array( \n\t 'condition'=>'(type=\"tutor\")', \n\t ); \n\n\n\t\tif (null == Yii::app()->user->id) \n\t\t\treturn array();\n\t\telse if ('view' == Yii::app()->controller->getAction()->getId())\n\t\t\treturn array();\n\t\telse \n\t return array( \n\t 'condition'=>'(id='.Yii::app()->user->id.')', \n\t ); \n\n }",
"public function getComponent()\n {\n return $this->hasOne(Component::className(), ['id' => 'component_id']);\n }",
"public function get_global_component_rules() {\n\t\treturn $this->get_attr_by_name( 'Global Component Rules' )['val'];\n\t}",
"public function getScopeType(): ?string {\n $val = $this->getBackingStore()->get('scopeType');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'scopeType'\");\n }",
"public function getAppScopeId()\n {\n if (array_key_exists(\"appScopeId\", $this->_propDict)) {\n return $this->_propDict[\"appScopeId\"];\n } else {\n return null;\n }\n }",
"public function isScopeRoot();",
"public function checkAuthScope()\n {\n if (auth()->check() && auth()->user()->is_admin) {\n $this->model = $this->model->withoutGlobalScope(StatusScope::class);\n }\n\n return $this->model;\n }",
"public function getOwner()\n {\n if(!($domainId = $this->getData('domainId'))) {\n return null;\n }\n \n return Core_Model_DiFactory::getClientManager()->getClientByDomain($domainId);\n }",
"function get_component_directory_uri( $component = null ) {\n\tif ( is_null( $component ) )\n\t\treturn get_stylesheet_directory_uri() . '/components';\n\tglobal $components;\n\tif ( is_file( $component ) ) {\n\t\t$dir = basename( dirname( $component ) );\n\t\tif ( $dir == 'components' )\n\t\t\t$dir = '';\n\t\treturn get_stylesheet_directory_uri() . '/components/' . $dir;\n\t} else {\n\t\tif ( !array_key_exists( $component, $components ) )\n\t\t\treturn null; // return null if component doesnt exists\n\t\treturn $components[ $component ]->get_directory_uri();\n\t}\n}",
"public static function getClass() {\n return Singleton::$_class;\n }",
"private function scopeCondition()\n {\n $theScope = $this->scopeName();\n\n if ($theScope === null) {\n throw new NullScopeException('You cannot pass in a null scope into Listify. It breaks stuff.');\n }\n\n if ($theScope === $this->defaultScope) {\n return $theScope;\n }\n if (is_string($theScope)) {\n //Good for you for being brave. Let's hope it'll run in your DB! You sanitized it, right?\n $this->stringScopeValue = $theScope;\n return $theScope;\n }\n if (! is_object($theScope)) {\n throw new InvalidScopeException('Listify scope parameter must be a String, an Eloquent BelongsTo object, or a Query Builder object.');\n }\n\n $reflector = new \\ReflectionClass($theScope);\n if ($reflector->getName() == 'Illuminate\\Database\\Eloquent\\Relations\\BelongsTo') {\n $relationshipId = $this->getAttribute($theScope->getForeignKey());\n\n if ($relationshipId === null) {\n throw new NullForeignKeyException('The Listify scope is a \"belongsTo\" relationship, but the foreign key is null.');\n }\n\n return $theScope->getForeignKey().' = '.$this->getAttribute($theScope->getForeignKey());\n }\n if ($reflector->getName() != 'Illuminate\\Database\\Query\\Builder') {\n throw new InvalidScopeException('Listify scope parameter must be a String, an Eloquent BelongsTo object, or a Query Builder object.');\n }\n $theQuery = ( new GetConditionStringFromQueryBuilder())->handle($theScope);\n $this->stringScopeValue = $theQuery;\n\n return $theQuery;\n }",
"public function getScopes();",
"public function getScopes();",
"public function getScopes();",
"private function getMappedScope($key)\n {\n $scope = 'default';\n\n if (array_key_exists($key, self::$nameMapping)) {\n $scope = self::$nameMapping[$key]['scope'];\n }\n\n return $scope;\n }",
"function _get( $varname, $scope=false ){\n if( $scope ){\n $scope = (int)$scope; // local or global?\n if( $scope==2 ){\n // search only in global scope\n if( isset($this->ctx[0]['_scope_']) ){\n return $this->ctx[0]['_scope_'][$varname];\n }\n }\n else{\n // search only in local scope\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n return $this->ctx[$x]['_scope_'][$varname];\n }\n }\n }\n }\n else{\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n return $this->ctx[$x]['_scope_'][$varname];\n }\n }\n }\n\n return null;\n }",
"static function org($org=null)\n {\n self::$org = $org;\n\n return __CLASS__;\n }",
"public function defaultScope()\n {\n $scope=array();\n\n \n return $scope;\n }",
"public function getIssueOfComponent() {\n return $this->issueOfComponent;\n }",
"public function getContainer()\n {\n return $this->getModule()->getContainer();\n }",
"function getComponentName()\n {\n $p = get_class($this);\n\n $reflector = new ReflectionClass($p);\n $path = dirname($reflector->getFileName());\n\n $component = str_replace(BW_PATH_COMPONENTS . DS, '', $path);\n $component = str_replace(DS . 'models', '', $component);\n\n if (bwFolder::is(BW_PATH_COMPONENTS . DS . $component)) {\n return $component;\n } else {\n return NULL;\n }\n }",
"protected function getScope($type)\n {\n switch ($type) {\n case AbstractFee::CART_TYPE:\n return 'mageworxFeeForm';\n case AbstractFee::SHIPPING_TYPE:\n return 'mageworxShippingFeeForm';\n case AbstractFee::PAYMENT_TYPE:\n return 'mageworxPaymentFeeForm';\n case AbstractFee::PRODUCT_TYPE:\n return 'mageworxProductFeeForm';\n default:\n return 'mageworxFeeForm';\n }\n }",
"public function getComponent()\n {\n return $this->hasOne(Component::class, ['id' => 'component_id']);\n }",
"public function getComponentClass()\n {\n return $this->_componentClass;\n }",
"protected function channel()\n {\n return $this->app->bound('env') ? $this->app->environment() : 'production';\n }",
"public function getIsComponent()\n {\n return $this->_blIsComponent;\n }",
"public function getActiveAuth() {\n\tif (!$this->activecontainer) {return false;}\n\treturn $this->activecontainer;\n}",
"public function setScope($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->scope = $arr;\n\n return $this;\n }",
"public function isScopeWebsite()\n {\n return $this->getIsGlobal() == self::SCOPE_WEBSITE;\n }",
"function culturefeed_get_facet_component() {\n if ($type = culturefeed_get_searchable_type_by_path()) {\n $page = culturefeed_get_search_page($type);\n return $page->getFacetComponent();\n }\n return FALSE;\n}",
"final public function &access( $scope, $parameter = null )\n\t{\n\t\tif ( !class_exists( '\\de\\toxa\\txf\\txf', false ) )\n\t\t\tthrow new \\RuntimeException( 'missing TXF context for accessing managed data' );\n\n\t\t// ensure session has been restored from serialization\n\t\t$this->makeUsable();\n\n\t\t/*\n\t\t * process selected scope\n\t\t */\n\n\t\t// validate provided parameter\n\t\tif ( $scope & self::SCOPE_CLASS )\n\t\t\tif ( !( $parameter = data::isNonEmptyString( $parameter ) ) )\n\t\t\t\tthrow new \\InvalidArgumentException( 'invalid/missing class selector' );\n\n\t\t// prepare subset of session data according to scope and parameter and\n\t\t// return reference on it for read/write access\n\t\tswitch ( $scope )\n\t\t{\n\t\t\tcase self::SCOPE_SCRIPT :\n\t\t\t\tself::makeArray( $this->usable['applications'] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['scripts'] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['scripts'][TXF_SCRIPT_PATH] );\n\t\t\t\treturn $this->usable['applications'][TXF_APPLICATION]['scripts'][TXF_SCRIPT_PATH];\n\n\t\t\tcase self::SCOPE_CLASS + self::SCOPE_SCRIPT :\n\t\t\t\tself::makeArray( $this->usable['applications'] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['scripts'] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['scripts'][TXF_SCRIPT_PATH] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['scripts'][TXF_SCRIPT_PATH]['classes'] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['scripts'][TXF_SCRIPT_PATH]['classes'][$parameter] );\n\t\t\t\treturn $this->usable['applications'][TXF_APPLICATION]['scripts'][TXF_SCRIPT_PATH]['classes'][$parameter];\n\n\t\t\tcase self::SCOPE_CLASS + self::SCOPE_APPLICATION :\n\t\t\t\tself::makeArray( $this->usable['applications'] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['classes'] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['classes'][$parameter] );\n\t\t\t\treturn $this->usable['applications'][TXF_APPLICATION]['classes'][$parameter];\n\n\t\t\tcase self::SCOPE_CLASS + self::SCOPE_GLOBAL :\n\t\t\t\tself::makeArray( $this->usable['classes'] );\n\t\t\t\tself::makeArray( $this->usable['classes'][$parameter] );\n\t\t\t\treturn $this->usable['classes'][$parameter];\n\n\t\t\tcase self::SCOPE_APPLICATION :\n\t\t\t\tself::makeArray( $this->usable['applications'] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION] );\n\t\t\t\tself::makeArray( $this->usable['applications'][TXF_APPLICATION]['shared'] );\n\t\t\t\treturn $this->usable['applications'][TXF_APPLICATION]['shared'];\n\n\t\t\tcase self::SCOPE_GLOBAL :\n\t\t\t\tself::makeArray( $this->usable['shared'] );\n\t\t\t\treturn $this->usable['shared'];\n\n\t\t\tdefault :\n\t\t\t\tthrow new \\InvalidArgumentException( 'invalid session scope' );\n\t\t}\n\t}",
"public function setScope( $scope = \"\" ) {\n\t\t$this->_scope = $scope;\n\n\t\treturn $this->owner;\n\t}",
"function getValidationScope();"
]
| [
"0.6296105",
"0.5952538",
"0.5859421",
"0.5859421",
"0.5859421",
"0.5859421",
"0.5859421",
"0.5859421",
"0.5859421",
"0.58592176",
"0.5854779",
"0.57882154",
"0.57802844",
"0.57802844",
"0.5777821",
"0.57702506",
"0.571507",
"0.571507",
"0.56110346",
"0.55839187",
"0.5529928",
"0.54769206",
"0.54643434",
"0.5415851",
"0.5301559",
"0.5261611",
"0.52414757",
"0.52117395",
"0.5199832",
"0.5182268",
"0.49838036",
"0.49597463",
"0.49524787",
"0.49146914",
"0.4877426",
"0.48746166",
"0.4858104",
"0.48364267",
"0.48353323",
"0.48290256",
"0.48060513",
"0.47850025",
"0.47793588",
"0.47329512",
"0.4725402",
"0.4705096",
"0.47026",
"0.470162",
"0.468009",
"0.4671301",
"0.46688014",
"0.466853",
"0.46589285",
"0.46495512",
"0.46315226",
"0.4597779",
"0.45674685",
"0.4555653",
"0.4552606",
"0.45492235",
"0.45311305",
"0.45257783",
"0.45246136",
"0.45081404",
"0.44711298",
"0.4468454",
"0.44662106",
"0.44605863",
"0.44413006",
"0.4434587",
"0.44308722",
"0.44304433",
"0.44236594",
"0.44168797",
"0.44147897",
"0.4401677",
"0.439429",
"0.43833426",
"0.43616787",
"0.43616787",
"0.43616787",
"0.43479064",
"0.4347035",
"0.4340644",
"0.4333206",
"0.4332767",
"0.43262193",
"0.4324782",
"0.43236172",
"0.43184847",
"0.43164185",
"0.43133694",
"0.4293703",
"0.4289602",
"0.42872903",
"0.42820847",
"0.42818126",
"0.4281115",
"0.42746043",
"0.4272354"
]
| 0.7105636 | 0 |
Builds and returns an array of class names => file names of all tx_.php files in the extension's Classes directory and its sub directories. | protected function buildArrayOfClassFiles($packageKey, $subDirectory = '', $recursionLevel = 0)
{
$classFiles = [];
if (strpos($packageKey, '/') === false) {
$currentPath = $this->getPackagePath($packageKey) . self::DIRECTORY_CLASSES . $subDirectory;
} else {
$currentPath = $this->getPackagePath($packageKey) . $subDirectory;
}
if (!is_dir($currentPath)) {
return [];
}
if ($recursionLevel > 100) {
throw new Exception('Recursion too deep.');
}
try {
$classesDirectoryIterator = new DirectoryIterator($currentPath);
while ($classesDirectoryIterator->valid()) {
$filename = $classesDirectoryIterator->getFilename();
if ($filename{0} != '.') {
if (is_dir($currentPath . $filename)) {
$classFiles = array_merge($classFiles, $this->buildArrayOfClassFiles($packageKey, $subDirectory . $filename . '/', ($recursionLevel+1)));
} else {
if (substr($filename, 0, 3) == self::PACKAGE_PREFIX . '_' && substr($filename, -4, 4) == '.php') {
$classFiles[substr($filename, 0, -4)] = $currentPath . $filename;
}
}
}
$classesDirectoryIterator->next();
}
} catch (Exception $exception) {
throw new Exception($exception->getMessage());
}
return $classFiles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClasses(): array\n {\n $suffix = $this->suffix;\n\n $directoryIterator = new RecursiveDirectoryIterator($this->directory);\n $recursive = new RecursiveIteratorIterator($directoryIterator);\n $iterator = new RegexIterator($recursive, \"/[A-Za-z0-9]*{$suffix}.php/\");\n \n $classes = [];\n\n foreach ($iterator as $file) {\n if ($file->isFile()) {\n $path = $file->getPathname();\n\n $class = \\str_replace($this->directory . DIRECTORY_SEPARATOR, $this->namespace, $path);\n $class = \\str_replace(DIRECTORY_SEPARATOR, '\\\\', $class);\n $class = \\rtrim($class, '.php');\n\n $classes[$path] = $class;\n }\n }\n \n $this->classes = $classes;\n\n return $this->classes;\n }",
"public function findAllClassFiles($extension = NULL) {\n $classmap = [];\n $namespaces = $this->registerTestNamespaces();\n if (isset($extension)) {\n // Include tests in the \\Drupal\\Tests\\{$extension} namespace.\n $pattern = \"/Drupal\\\\\\(Tests\\\\\\)?$extension\\\\\\/\";\n $namespaces = array_intersect_key($namespaces, array_flip(preg_grep($pattern, array_keys($namespaces))));\n }\n foreach ($namespaces as $namespace => $paths) {\n foreach ($paths as $path) {\n if (!is_dir($path)) {\n continue;\n }\n $classmap += static::scanDirectory($namespace, $path);\n }\n }\n return $classmap;\n }",
"private static function classList()\n {\n // $path = __DIR__;\n $path = base_path(config('spatie-permission-generate.controllers_root_path'));\n $fqcns = array();\n\n $allFiles = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($path));\n $phpFiles = new \\RegexIterator($allFiles, '/\\.php$/');\n foreach ($phpFiles as $phpFile) {\n $content = file_get_contents($phpFile->getRealPath());\n $tokens = token_get_all($content);\n $namespace = '';\n for ($index = 0; isset($tokens[$index]); $index++) {\n if (!isset($tokens[$index][0])) {\n continue;\n }\n if (T_NAMESPACE === $tokens[$index][0]) {\n $index += 2; // Skip namespace keyword and whitespace\n while (isset($tokens[$index]) && is_array($tokens[$index])) {\n $namespace .= $tokens[$index++][1];\n }\n }\n if (T_CLASS === $tokens[$index][0] && T_WHITESPACE === $tokens[$index + 1][0] && T_STRING === $tokens[$index +\n 2][0]) {\n $index += 2; // Skip class keyword and whitespace\n if ($namespace != 'App\\Http\\Controllers\\Auth') {\n $fqcns[] = $namespace . '\\\\' . $tokens[$index][1];\n }\n\n\n # break if you have one class per file (psr-4 compliant)\n # otherwise you'll need to handle class constants (Foo::class)\n break;\n }\n }\n }\n\n return $fqcns;\n }",
"public function classProvider(): array\n {\n $result = [];\n\n $eventsDir = $this->dir;\n $eventsNameSpace = $this->namespace;\n\n $directory = new RecursiveDirectoryIterator($eventsDir);\n $iterator = new RecursiveIteratorIterator($directory);\n $regex = new RegexIterator($iterator, '/^.+\\.php$/', RecursiveRegexIterator::GET_MATCH);\n foreach ($regex as $file) {\n $file = $file[0];\n if ('EventName' === pathinfo($file, PATHINFO_FILENAME)) {\n continue;\n }\n // Remove file extension\n $file = pathinfo($file, PATHINFO_DIRNAME) . DS . pathinfo($file, PATHINFO_FILENAME);\n // Remove path prefix\n $file = substr($file, strlen($eventsDir));\n // Switch to namespace\n $file = str_replace(DS, '\\\\', $file);\n // Prefix namespace\n $file = $eventsNameSpace . $file;\n $result[] = [$file];\n }\n\n return $result;\n }",
"function getAllClasses(string $dirName){\n $files = getAllFiles($dirName);\n $classes = array_map(function($file){\n return str_replace(\"/\", \"\\\\\", substr($file, 0, strlen($file)-4));\n }, $files);\n return $classes;\n}",
"public function getAllClassNames()\n {\n $classes = array();\n\n if ($this->_paths) {\n foreach ((array) $this->_paths as $path) {\n if ( ! is_dir($path)) {\n throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);\n }\n \n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($path),\n \\RecursiveIteratorIterator::LEAVES_ONLY\n );\n \n foreach ($iterator as $file) {\n if (($fileName = $file->getBasename($this->_fileExtension)) == $file->getBasename()) {\n continue;\n }\n \n // NOTE: All files found here means classes are not transient!\n $classes[] = str_replace('.', '\\\\', $fileName);\n }\n }\n }\n \n return $classes;\n }",
"protected function getAllClasses()\n {\n return $this->getClassesFromNamespace($this->getAppNamespace());\n }",
"protected function loadClassFiles() {}",
"function rex_com_mediaaccess_getExtensionsSendfile()\n{\n global $REX;\n\n $classes = array();\n\n foreach($REX['ADDON']['community']['plugin_mediaaccess']['extension_sendfile_dir'] as $path)\n {\n if($dir = opendir($path))\n {\n while($file = readdir($dir))\n {\n if(!is_dir($file))\n {\n $classname = explode(\".\", $file);\n $class = $classname[1];\n\n if(file_exists($path.$file))\n {\n include_once($path.$file);\n $classes[] = $class;\n }\n }\n }\n closedir($dir);\n }\n }\n\n return $classes;\n}",
"public function generateClassMap()\n {\n $classMap = array();\n foreach ($this->classMapDirs as $dir) {\n $dir = $this->baseDir . '/' . $dir;\n foreach (ClassMapGenerator::createMap($dir) as $class => $path) {\n $classMap[$class] = $this->getRelativePath($path);\n }\n }\n return $classMap;\n }",
"public function getClasses();",
"public function getClasses();",
"public function getClasses();",
"abstract public function getClasses();",
"public static function compiles()\r\n {\r\n $dir = static::guessPackageClassPath('royalcms/storage');\r\n\r\n return [\r\n $dir . \"/Contracts/StorageInterface.php\",\r\n $dir . \"/Adapter/Aliyunoss.php\",\r\n $dir . \"/Adapter/Direct.php\",\r\n $dir . \"/Adapter/Local.php\",\r\n $dir . \"/Filesystem.php\",\r\n $dir . \"/FilesystemAdapter.php\",\r\n $dir . \"/FilesystemBaseTrait.php\",\r\n $dir . \"/FilesystemManager.php\",\r\n $dir . \"/Facades/Storage.php\",\r\n $dir . \"/StorageServiceProvider.php\",\r\n ];\r\n }",
"public static function compiles()\n {\n $dir = static::guessPackageClassPath('royalcms/repository');\n\n return [\n $dir . \"/Repositories/AbstractRepository.php\",\n $dir . \"/Traits/Cacheable.php\",\n $dir . \"/Contracts/RepositoryContract.php\",\n $dir . \"/RepositoryServiceProvider.php\",\n ];\n }",
"public function mapClasses() {\n // TODO: this is needed when the class map is not created yet (i.e. at very first install).\n if (!is_dir($this->dir['tmp'])) {\n mkdir($this->dir['tmp']);\n }\n $fop = fopen(CLASS_MAP_FILE, 'w+');\n\n foreach ($this->modules_loaded as $module) {\n $autoload_paths = array('Common', 'Qtags');\n foreach ($autoload_paths as $autoload_path) {\n $full_autoload_path = $module['path'] . '/classes/' . $autoload_path;\n /**\n * Autoload module's qtags.\n */\n if (is_dir($full_autoload_path)) {\n $classes = $this->scanDirectory($full_autoload_path);\n foreach ($classes as $class) {\n // Parse the Qtag.\n $exp1 = explode('/', $class);\n $exp2 = explode('.', $exp1[count($exp1) - 1]);\n $item_name = $exp2[0];\n $this->class_map[$autoload_path][$item_name] = $full_autoload_path . '/' . $class;\n }\n }\n }\n }\n fwrite($fop, serialize($this->class_map));\n fclose($fop);\n }",
"public static function classes(array $list = null) {\n\n if ($list === null) {\n $list = Kohana::list_files('classes');\n }\n $namespaces = Kohana::$config->load('userguide.namespaces');\n Debug::stop($namespaces);\n $namespaces = \\Arr::map(function ($namespace) {\n $namespace = trim($namespace, '/');\n $namespace = trim($namespace, '\\\\');\n return str_replace('/', '\\\\', $namespace);\n }, $namespaces);\n $namespaces = Arr::flatten($namespaces);\n //Debug::info($namespaces);\n $namespaces = array_unique($namespaces);\n $classes = array();\n // This will be used a lot!\n $ext_length = strlen(EXT);\n foreach ($list as $name => $path) {\n if (is_array($path)) {\n $classes += Kodoc::classes($path);\n }\n elseif (substr($name, -$ext_length) === EXT) {\n // Remove \"classes/\" and the extension\n $class = substr($name, 8, -$ext_length);\n // Convert slashes to underscores\n $class = str_replace(DIRECTORY_SEPARATOR, '_', $class);\n $ret = '';\n //print '<hr />1) ' . $name . '<br />';\n //print '2) ' . $class . '<hr />';\n foreach ($namespaces as $namespace) {\n $_namespace = str_replace('\\\\', '_', $namespace);\n //print '4) ' . $_namespace . '<br />';\n if (mb_strpos($class, $_namespace) === 0) {\n $class = '\\\\'.$namespace.'\\\\'.str_replace($_namespace.'_', '', $class);\n break;\n }\n }\n\n $classes[$class] = $class;\n }\n }\n return $classes;\n }",
"public function getAllClasses() {\n return array_unique(array_values($this->alias2class));\n }",
"private function findSubContextClasses() {\n $class_names = array();\n\n // Initialize any available sub-contexts.\n if (isset($this->parameters['subcontexts'])) {\n $paths = array();\n // Drivers may specify paths to subcontexts.\n if ($this->parameters['subcontexts']['autoload']) {\n foreach ($this->drupal->getDrivers() as $name => $driver) {\n if ($driver instanceof SubDriverFinderInterface) {\n $paths += $driver->getSubDriverPaths();\n }\n }\n }\n\n // Additional subcontext locations may be specified manually in behat.yml.\n if (isset($this->parameters['subcontexts']['paths'])) {\n $paths = array_merge($paths, $this->parameters['subcontexts']['paths']);\n }\n\n // Load each class.\n foreach ($paths as $path) {\n if ($subcontexts = $this->findAvailableSubContexts($path)) {\n $this->loadSubContexts($subcontexts);\n }\n }\n\n // Find all subcontexts, excluding abstract base classes.\n $classes = get_declared_classes();\n foreach ($classes as $class) {\n $reflect = new \\ReflectionClass($class);\n if (!$reflect->isAbstract() && $reflect->implementsInterface('Drupal\\DrupalExtension\\Context\\DrupalSubContextInterface')) {\n $class_names[] = $class;\n }\n }\n\n }\n\n return $class_names;\n }",
"public function getCoreNames() {\n $extension = '.' . $this->getFileExtension();\n $pattern = '/' . preg_quote($extension, '/') . '$/';\n $folders = [];\n $directory = $this->getCoreFolder();\n if (is_dir($directory)) {\n // glob() directly calls into libc glob(), which is not aware of PHP\n // stream wrappers. Same for \\GlobIterator (which additionally requires an\n // absolute realpath() on Windows).\n // @see https://github.com/mikey179/vfsStream/issues/2\n $files = scandir($directory);\n\n foreach ($files as $file) {\n if ($file[0] !== '.' && preg_match($pattern, $file)) {\n $folders[basename($file, $extension)] = $directory;\n }\n }\n }\n return $folders;\n }",
"public static function classes(): array;",
"public static function loadAllClassesOfPackage($packageName) {\n\n\t\t$packageName = trim($packageName, ' _');\n\n\t\t$packagePath = str_replace('_', DIRECTORY_SEPARATOR, $packageName);\n\t\t$include_path = explode(PATH_SEPARATOR, get_include_path());\n\t\t$classes = array();\n\t\tCustomweb_Core_Util_Error::deactivateErrorMessages();\n\t\tforeach($include_path as $path) {\n\t\t\t$file = realpath($path . DIRECTORY_SEPARATOR . $packagePath);\n\t\t\t$phpFile = realpath($path . DIRECTORY_SEPARATOR . $packagePath . '.php');\n\t\t\tif(@file_exists($file)) {\n\t\t\t\tif (@is_dir($file)) {\n\t\t\t\t\t$classes = array_merge($classes, self::loadAllClassesOfDirectory($file, $packageName));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (@file_exists($phpFile)) {\n\t\t\t\t$className = $packageName;\n\t\t\t\tif (!isset($classes[$className]) && !self::isClassLoaded($className)) {\n\t\t\t\t\tCustomweb_Core_Util_Error::activateErrorMessages();\n\t\t\t\t\trequire_once $phpFile;\n\t\t\t\t\tCustomweb_Core_Util_Error::deactivateErrorMessages();\n\t\t\t\t}\n\t\t\t\t$classes[$className] = $className;\n\t\t\t}\n\t\t}\n\t\tCustomweb_Core_Util_Error::activateErrorMessages();\n\n\t\treturn $classes;\n\t}",
"protected function getClassesToScan()\n\t{\n\t\t$classes = [];\n\n\t\tforeach ($this->scan as $class)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$classes[] = new ReflectionClass($class);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t//\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}",
"private function _discover() {\n\n $dir = new DirectoryIterator($this->dirname);\n\n foreach ($dir as $file) {\n\n if ($file->isFile() && !$file->isDot()) {\n\n $filename = $file->getFilename();\n $pathname = $file->getPathname();\n\n if (preg_match('/^(\\d+\\W*)?(\\w+)\\.php$/', $filename, $matches)) {\n require_once($pathname);\n $class = \"{$matches[2]}_{$this->suffix}\";\n $files[$filename] = new $class();\n }\n\n }\n\n }\n\n ksort($files);\n $plugins = array_values($files);\n\n return $plugins;\n\n }",
"function mapClassFiles( $directory )\n{\n global $_classFiles;\n static $ignore = array( 'Engine/System' );\n\n if ( in_array( $directory, $ignore ) )\n {\n return;\n }\n\n $dir = opendir( $directory );\n while ( ($entry = readdir( $dir ) ) )\n {\n if ( $entry[0] == '.' )\n {\n //ignore ., .., .svn, .git, etc\n continue;\n }\n $file = \"{$directory}/{$entry}\";\n if ( is_dir( $file ) )\n {\n mapClassFiles($file);\n }\n elseif ( is_file( $file ) && preg_match( ';(^|/)([^/]+)[.]inc$;', $file, $regs ) )\n {\n $_classFiles[$regs[2]] = $file;\n }\n }\n}",
"private function includeFiles(){\n foreach($this->files as $file){\n require implode('', $file);\n $class_name = $this->getClassNameFromFileName($file);\n $this->classes[$file['name']] = new $class_name();\n }\n }",
"public function getAllClasses () {\n\t\t$qry = \"SELECT * from $this->table_name\";\n\t\t$dbh = $this->db->prepare($qry);\n\t\t$dbh->execute();\n\t\tif($dbh->rowCount()) {\n\t\t\treturn $dbh->fetchAll();\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}",
"public function getClasses()\n {\n $conf_classes = config('larinterface.classes');\n $conf_directories = config('larinterface.directories');\n $conf_ignore = config('larinterface.ignore');\n\n $classesArray = [];\n\n // Forge classes\n foreach ($conf_classes as $output => $classes) {\n if (is_numeric($output)) {\n $output = 0;\n }\n\n if (is_string($classes)) {\n $classes = [$classes];\n }\n\n if (isset($classesArray[$output])) {\n $classesArray[$output] = array_merge($classesArray[$output], $classes);\n } else {\n $classesArray[$output] = $classes;\n }\n }\n\n // Forge directories\n foreach ($conf_directories as $output => $directories) {\n if (is_numeric($output)) {\n $output = 0;\n }\n\n if (is_string($directories)) {\n $directories = [$directories];\n }\n\n foreach ($directories as $directory) {\n $classes = $this->classFinder->findClasses(base_path($directory));\n\n if (isset($classesArray[$output])) {\n $classesArray[$output] = array_merge($classesArray[$output], $classes);\n } else {\n $classesArray[$output] = $classes;\n }\n }\n }\n\n // Clean forged class\n foreach ($classesArray as $key => $value) {\n\n // Ignore files\n foreach ($conf_ignore as $class) {\n $classKey = array_search($class, $value);\n\n if ($classKey !== false) {\n unset($value[$classKey]);\n }\n }\n\n $classesArray[$key] = array_unique($value);\n }\n\n return $this->classes = $this->extractInterfacePathFromClasses($classesArray);\n }",
"public function findCommandClasses()\n {\n $dirs = $this->getDirs();\n foreach ($dirs as $dir => $classPrefix) {\n $files = scandir($dir);\n if (count($files) > 0) {\n foreach ($files as $f) {\n if (fnmatch('*.php', $f)) {\n $this->findCommandClass($dir, $classPrefix, $f);\n }\n }\n }\n }\n return $this;\n }",
"function get_classes($directory, Closure $closure = null)\n {\n $classes = array_filter(scandir($directory), function ($file) use ($closure) {\n if (!ends_with($file, '.php') || studly_case($file) !== $file) {\n return false;\n }\n\n if (is_null($closure)) {\n return true;\n }\n\n return $closure($file);\n });\n\n return array_map(function ($file) {\n return str_replace('.php', '', $file);\n }, $classes);\n }",
"protected function getMigrationClasses()\n {\n $files = glob(sprintf('%s/Migration/Attribute/*Migration.php', $this->getPath()));\n\n $migrationClasses = [];\n foreach ($files as $file) {\n $class = $this->getName() . '\\Migration\\Attribute\\\\' . basename($file, '.php');\n if (class_exists($class)) {\n $migration = new $class;\n if ($migration instanceof AbstractAttributeMigration) {\n $migrationClasses[] = $migration;\n }\n }\n }\n\n return $migrationClasses;\n }",
"public function autoloadFilesAreBuildCorrectlyDataProvider()\n {\n return [\n 'Psr-4 section' => [\n [\n 'autoload' => [\n 'psr-4' => [\n 'TYPO3\\\\CMS\\\\TestExtension\\\\' => 'Classes/',\n ],\n ],\n ],\n [\n '\\'TYPO3\\\\\\\\CMS\\\\\\\\TestExtension\\\\\\\\\\' => array($typo3InstallDir . \\'/Fixtures/test_extension/Classes\\')',\n ],\n [],\n ],\n 'Psr-4 section with array' => [\n [\n 'autoload' => [\n 'psr-4' => [\n 'TYPO3\\\\CMS\\\\TestExtension\\\\' => ['Classes/', 'Resources/PHP/'],\n ],\n ],\n ],\n [\n '\\'TYPO3\\\\\\\\CMS\\\\\\\\TestExtension\\\\\\\\\\' => array($typo3InstallDir . \\'/Fixtures/test_extension/Classes\\',$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP\\')',\n ],\n [],\n ],\n 'Psr-4 section without trailing slash' => [\n [\n 'autoload' => [\n 'psr-4' => [\n 'TYPO3\\\\CMS\\\\TestExtension\\\\' => 'Classes',\n ],\n ],\n ],\n [\n '\\'TYPO3\\\\\\\\CMS\\\\\\\\TestExtension\\\\\\\\\\' => array($typo3InstallDir . \\'/Fixtures/test_extension/Classes\\')',\n ],\n [],\n ],\n 'Classmap section' => [\n [\n 'autoload' => [\n 'classmap' => [\n 'Resources/PHP/',\n ],\n ],\n ],\n [],\n [\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Test.php\\'',\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/AnotherTestFile.php\\'',\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Subdirectory/SubdirectoryTest.php\\'',\n ],\n ],\n 'Classmap section without trailing slash' => [\n [\n 'autoload' => [\n 'classmap' => [\n 'Resources/PHP',\n ],\n ],\n ],\n [],\n [\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Test.php\\'',\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/AnotherTestFile.php\\'',\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Subdirectory/SubdirectoryTest.php\\'',\n ],\n ],\n 'Classmap section pointing to a file' => [\n [\n 'autoload' => [\n 'classmap' => [\n 'Resources/PHP/Test.php',\n ],\n ],\n ],\n [],\n [\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Test.php\\'',\n '!$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/AnotherTestFile.php\\'',\n '!$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Subdirectory/SubdirectoryTest.php\\'',\n ],\n ],\n 'No autoload section' => [\n [],\n [],\n [\n '!$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Test.php\\'',\n '!$typo3InstallDir . \\'/Fixtures/test_extension/Tests/TestClass.php\\'',\n '!$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/AnotherTestFile.php\\'',\n '!$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Subdirectory/SubdirectoryTest.php\\'',\n '!$typo3InstallDir . \\'/Fixtures/test_extension/class.ext_update.php\\'',\n ],\n ],\n 'Classmap section pointing to two files' => [\n [\n 'autoload' => [\n 'classmap' => [\n 'Resources/PHP/Test.php',\n 'Resources/PHP/AnotherTestFile.php',\n ],\n ],\n ],\n [],\n [\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Test.php\\'',\n '$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/AnotherTestFile.php\\'',\n '!$typo3InstallDir . \\'/Fixtures/test_extension/Resources/PHP/Subdirectory/SubdirectoryTest.php\\'',\n ],\n ],\n ];\n }",
"public function getClasses(): array\n {\n return $this->classes;\n }",
"public function findCommandClasses()\n {\n foreach ($this->getExtensionNames() as $extensionName) {\n $extDir = $this\n ->getMageBridge()\n ->_module_()\n ->getExtensionDir($extensionName).DIRECTORY_SEPARATOR.'Command';\n $files = scandir($extDir);\n if (count($files) > 0) {\n foreach ($files as $f) {\n if (fnmatch('*.php', $f)) {\n $className = sprintf(\n '%s_Command_%s',\n $extensionName,\n ucfirst(str_replace('.php', '', $f))\n );\n if (!in_array($className, $this->commandClasses)) {\n $this->commandClasses[] = $className;\n }\n }\n }\n }\n }\n return $this;\n }",
"public function getAllClassNames() \n {\n\n }",
"public function getClasses() {\n return $this->robot->getIndexedClasses();\n }",
"protected function GetClasses($file)\n\t{\n\n\t\t$php_code = file_get_contents ( $file );\n\t\t$classes = array ();\n\t\t$namespace=\"\";\n\t\t$tokens = token_get_all ( $php_code );\n\t\t$count = count ( $tokens );\n\n\t\tfor($i = 0; $i < $count; $i ++)\n\t\t{\n\t\t\tif ($tokens[$i][0]===T_NAMESPACE)\n\t\t\t{\n\t\t\t\tfor ($j=$i+1;$j<$count;++$j)\n\t\t\t\t{\n\t\t\t\t\tif ($tokens[$j][0]===T_STRING)\n\t\t\t\t\t\t$namespace.=\"\\\\\".$tokens[$j][1];\n\t\t\t\t\telseif ($tokens[$j]==='{' or $tokens[$j]===';')\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($tokens[$i][0]===T_CLASS)\n\t\t\t{\n\t\t\t\tfor ($j=$i+1;$j<$count;++$j)\n\t\t\t\tif ($tokens[$j]==='{')\n\t\t\t\t{\n\t\t\t\t\t$classes[]=$namespace.\"\\\\\".$tokens[$i+2][1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $classes;\n\t\t//is_subclass_of(class, parent_class,/* allow first param to be string */true)\n\t}",
"public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"protected static function getClassesFromDir($dir)\n\t{\n\t\t$classes = array();\n\n\t\t$path = Manager::getDocRoot() . $dir;\n\t\tif (($handle = opendir($path)))\n\t\t{\n\t\t\twhile ((($entry = readdir($handle)) !== false))\n\t\t\t{\n\t\t\t\tif ($entry != '.' && $entry != '..')\n\t\t\t\t{\n\t\t\t\t\t$classes[] = mb_strtoupper(pathinfo($entry, PATHINFO_FILENAME));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}",
"public function getTestClasses($extension = NULL, array $types = []) {\n if (!isset($extension) && empty($types)) {\n if (!empty($this->testClasses)) {\n return $this->testClasses;\n }\n }\n $list = [];\n\n $classmap = $this->findAllClassFiles($extension);\n\n // Prevent expensive class loader lookups for each reflected test class by\n // registering the complete classmap of test classes to the class loader.\n // This also ensures that test classes are loaded from the discovered\n // pathnames; a namespace/classname mismatch will throw an exception.\n $this->classLoader->addClassMap($classmap);\n\n foreach ($classmap as $classname => $pathname) {\n $finder = MockFileFinder::create($pathname);\n $parser = new StaticReflectionParser($classname, $finder, TRUE);\n try {\n $info = static::getTestInfo($classname, $parser->getDocComment());\n }\n catch (MissingGroupException $e) {\n // If the class name ends in Test and is not a migrate table dump.\n if (preg_match('/Test$/', $classname) && strpos($classname, 'migrate_drupal\\Tests\\Table') === FALSE) {\n throw $e;\n }\n // If the class is @group annotation just skip it. Most likely it is an\n // abstract class, trait or test fixture.\n continue;\n }\n // Skip this test class if it is a Simpletest-based test and requires\n // unavailable modules. TestDiscovery should not filter out module\n // requirements for PHPUnit-based test classes.\n // @todo Move this behavior to \\Drupal\\simpletest\\TestBase so tests can be\n // marked as skipped, instead.\n // @see https://www.drupal.org/node/1273478\n if ($info['type'] == 'Simpletest') {\n if (!empty($info['requires']['module'])) {\n if (array_diff($info['requires']['module'], $this->availableExtensions['module'])) {\n continue;\n }\n }\n }\n\n foreach ($info['groups'] as $group) {\n $list[$group][$classname] = $info;\n }\n }\n\n // Sort the groups and tests within the groups by name.\n uksort($list, 'strnatcasecmp');\n foreach ($list as &$tests) {\n uksort($tests, 'strnatcasecmp');\n }\n\n if (!isset($extension) && empty($types)) {\n $this->testClasses = $list;\n }\n\n if ($types) {\n $list = NestedArray::filter($list, function ($element) use ($types) {\n return !(is_array($element) && isset($element['type']) && !in_array($element['type'], $types));\n });\n }\n\n return $list;\n }",
"static public function getRegisteredClasses () {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:160: characters 3-19\n\t\t$result = new \\Array_hx();\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:161: lines 161-163\n\t\t$collection = Boot::$aliases;\n\t\tforeach ($collection as $key => $value) {\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:162: characters 4-39\n\t\t\t$x = Boot::getClass($key);\n\t\t\t$result->arr[$result->length] = $x;\n\t\t\t++$result->length;\n\n\t\t}\n\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:164: characters 3-16\n\t\treturn $result;\n\t}",
"protected function buildJSClassesArray() {}",
"function include_classes() {\n\t// Open the includes directory.\n\t$classes = scandir(ABSPATH . '/includes');\n\n\t// Loop through each subdirectory.\n\tforeach ($classes as $class) {\n\t\t// Skip directories.\n\t\tif (is_dir(ABSPATH . '/includes/' . $class)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Check for files matching class.*.php.\n\t\t$file_bits = explode('.', $class);\n\t\tif (count($file_bits) !== 3 || $file_bits[0] !== 'class' || $file_bits[2] !== 'php') {\n\t\t\tcontinue;\n\t\t}\n\t\trequire_once(ABSPATH . '/includes/' . $class);\n\t}\n}",
"#[@test]\n public function getTestClasses() {\n $base= 'net.xp_framework.unittest.reflection.classes';\n $classes= \\lang\\reflect\\Package::forName($base)->getClasses();\n $this->assertEquals(sizeof(self::$testClasses), sizeof($classes), \\xp::stringOf($classes));\n foreach ($classes as $class) {\n $this->assertTrue(\n in_array(substr($class->getName(), strlen($base)+ 1), self::$testClasses), \n $class->getName()\n );\n }\n }",
"protected function getExtensions() {\n $listing = new ExtensionDiscovery($this->root);\n // Ensure that tests in all profiles are discovered.\n $listing->setProfileDirectories([]);\n $extensions = $listing->scan('module', TRUE);\n $extensions += $listing->scan('profile', TRUE);\n $extensions += $listing->scan('theme', TRUE);\n return $extensions;\n }",
"public static function get_class_names($driver_class)\n\t{\n\n\t\tif (!property_exists($driver_class, 'driver_folder'))\n\t\t\tthrow new Exception('Please create a static definintion '. $driver_class .'::$driver_folder which declares the drivers folder name (eg: payment_types)');\n\n\t\tif (!property_exists($driver_class, 'driver_suffix'))\n\t\t\tthrow new Exception('Please create a static definintion '. $driver_class .'::$driver_suffix which declares the drivers file name suffix (eg: _type)');\n\n\t\t$driver_folder = new ReflectionProperty($driver_class, 'driver_folder');\n\t\t$driver_folder = $driver_folder->getValue();\n\n\t\t$driver_suffix = new ReflectionProperty($driver_class, 'driver_suffix');\n\t\t$driver_suffix = $driver_suffix->getValue();\n\n\t\tif (array_key_exists($driver_class, self::$_class_cache))\n\t\t\treturn self::$_class_cache[$driver_class];\n\n\t\t$modules = Module_Manager::get_modules();\n\t\tforeach ($modules as $id => $module_info)\n\t\t{\n\t\t\t$class_path = PATH_APP.\"/\".PHPR_MODULES.\"/\".$id.\"/\".self::drivers_directory.\"/\".$driver_folder;\n\t\t\t\n\t\t\tif (!file_exists($class_path))\n\t\t\t\tcontinue;\n\n\t\t\t$iterator = new \\DirectoryIterator($class_path);\n\n\t\t\tforeach ($iterator as $file)\n\t\t\t{\n\t\t\t\tif (!$file->isDir() && preg_match('/^'.$id.'_[^\\.]*'.preg_quote($driver_suffix).'.php$/i', $file->getFilename()))\n\t\t\t\t\trequire_once($class_path.'/'.$file->getFilename());\n\t\t\t}\n\t\t}\n\n\t\t$classes = get_declared_classes();\n\t\t$driver_classes = array();\n\t\tforeach ($classes as $class_name) {\n\t\t\tif (get_parent_class($class_name) != $driver_class)\n\t\t\t\tcontinue;\n\n\t\t\t$driver_classes[] = $class_name; \n\t\t}\n\n\t\treturn self::$_class_cache[$driver_class] = $driver_classes;\n\t}",
"function _get_filenames($path) {\n $finderFiles = Finder::create()->files()->in($path)->name('*.php');\n $filenames = array();\n foreach ($finderFiles as $finderFile) {\n $filenames[] = \"App\\\\Discount\\\\\".$this->_get_classname($finderFile->getRealpath());\n }\n\n return $filenames;\n }",
"#[@test]\n public function getTestClassNames() {\n $base= 'net.xp_framework.unittest.reflection.classes';\n $names= \\lang\\reflect\\Package::forName($base)->getClassNames();\n $this->assertEquals(sizeof(self::$testClasses), sizeof($names), \\xp::stringOf($names));\n foreach ($names as $name) {\n $this->assertTrue(\n in_array(substr($name, strlen($base)+ 1), self::$testClasses), \n $name\n );\n }\n }",
"public static function findClasses($subfolder){\n\n\t\t$classes=array();\n\t\t$folder = new \\GO\\Base\\Fs\\Folder(\\GO::config()->root_path.'go/base/'.$subfolder);\n\t\tif($folder->exists()){\n\n\t\t\t$items = $folder->ls();\n\n\t\t\tforeach($items as $item){\n\t\t\t\tif($item instanceof \\GO\\Base\\Fs\\File){\n\t\t\t\t\t$className = 'GO\\Base\\\\'.ucfirst($subfolder).'\\\\'.$item->nameWithoutExtension();\n\t\t\t\t\t$classes[] = new \\ReflectionClass($className);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}",
"public function listExtensions()\n {\n $result = [];\n foreach ($this->extensionClassNames as $className) {\n $result[] = $this->getExtension($className);\n }\n\n usort($result, function($a, $b) {\n if ($a->getExtensionSortOrder() >= $b->getExtensionSortOrder()) {\n return 1;\n }\n\n return -1;\n });\n\n return $result;\n }",
"protected function initClasses()\n {\n $classList = __DIR__ . DS . 'classes.txt';\n if(file_exists($classList)) {\n $contents = file_get_contents($classList);\n $classes = explode(',', $contents);\n foreach($classes as $class)\n $this->classes[] = trim($class);\n }\n\n }",
"private function find_templates () {\r\n\t\t$results = array();\r\n\r\n\t\t$files = WooDojo_Utils::glob_php( '*.php', GLOB_MARK, $this->templates_dir );\r\n\r\n\t\tif ( is_array( $files ) && count( $files ) > 0 ) {\r\n\t\t\tforeach ( $files as $k => $v ) {\r\n\t\t\t\t$data = $this->get_template_data( $v );\r\n\t\t\t\tif ( is_object( $data ) && isset( $data->title ) ) {\r\n\t\t\t\t\t$results[$v] = $data->title;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n\t}",
"public function getUsedClasses(): array\n {\n return [$this->getBeanClassName()];\n }",
"public function getClasses($extension = null, $version = null);",
"public function provideTestLoadsOfFiles()\n {\n AutoloaderTestHelper::deleteDirectory(\"testLoadsOfFiles\");\n $alTestHelper = new AutoloaderTestHelper($this);\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\"anyClass\", \"testLoadsOfFiles/flat\");\n\n }\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\n \"anyClass\", \"testLoadsOfFiles\" . str_repeat('/sub', $i)\n );\n\n }\n\n return array(\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/sub\"\n )\n );\n }",
"private static function loadAllClassesOfDirectory($directory, $packageName) {\n\t\t// with PHP files in it. This can cause issues by loading classes twice.\n\t\tif (strpos($directory, '.svn') !== false) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$classes = array();\n\t\tif ($handle = opendir($directory)) {\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif (substr($file, -4) === '.php') {\n\t\t\t\t\t$className = $packageName . '_' . substr($file, 0, -4);\n\t\t\t\t\tif (!isset($classes[$className]) && !self::isClassLoaded($className)) {\n\t\t\t\t\t\trequire_once $directory . DIRECTORY_SEPARATOR . $file;\n\t\t\t\t\t}\n\t\t\t\t\t$classes[$className] = $className;\n\t\t\t\t}\n\t\t\t\telse if ($file !== '..' && $file !== '.' && is_dir($directory . DIRECTORY_SEPARATOR . $file)) {\n\t\t\t\t\t$classes = array_merge($classes, self::loadAllClassesOfDirectory($directory . DIRECTORY_SEPARATOR . $file, $packageName . '_' . $file));\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\n\t\treturn $classes;\n\t}",
"function discoverExistingClasses($recursive = FALSE);",
"public function classes(): array\n {\n return $this->classes;\n }",
"protected function getRegisteredClasses() {}",
"public function getFiles()\n {\n $dir = $this->getDir();\n\n return array_filter(array_map(function ($file) use ($dir) {\n if (is_file($dir.$file) && pathinfo($file, PATHINFO_EXTENSION) == 'php') {\n return $dir.$file;\n }\n }, scandir($dir)));\n }",
"protected function buildClass()\n {\n return $this->files->get($this->getStub());\n }",
"public function getSubClasses(): array;",
"function testSearchClasses() {\n $this->search->findClasses($this->test_class_dir . '/class.TestClass.php');\n\n // Create the array output that the class search should have generated.\n $comparison = array(\n $this->test_class_dir . '/class.TestClass.php' => array(\n 'TestClass'\n )\n );\n\n // Assert that they are equal.\n $this->assertEqual($this->search->getClassList(), $comparison,\n 'Single class search does not match expected result.');\n }",
"public function getClassMap()\n {\n return array();\n }",
"public static function findClasses($path)\n {\n $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait';\n if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) {\n $extraTypes .= '|enum';\n }\n try {\n $contents = @php_strip_whitespace($path);\n if (!$contents) {\n if (!file_exists($path)) {\n throw new \\Exception('File does not exist');\n }\n if (!is_readable($path)) {\n throw new \\Exception('File is not readable');\n }\n }\n } catch (\\Exception $e) {\n throw new \\RuntimeException('Could not scan for classes inside '.$path.\": \\n\".$e->getMessage(), 0, $e);\n }\n // return early if there is no chance of matching anything in this file\n if (!preg_match('{\\b(?:class|interface'.$extraTypes.')\\s}i', $contents)) {\n return [];\n }\n // strip heredocs/nowdocs\n $contents = preg_replace('{<<<\\s*(\\'?)(\\w+)\\\\1(?:\\r\\n|\\n|\\r)(?:.*?)(?:\\r\\n|\\n|\\r)\\\\2(?=\\r\\n|\\n|\\r|;)}s', 'null', $contents);\n // strip strings\n $contents = preg_replace('{\"[^\"\\\\\\\\]*+(\\\\\\\\.[^\"\\\\\\\\]*+)*+\"|\\'[^\\'\\\\\\\\]*+(\\\\\\\\.[^\\'\\\\\\\\]*+)*+\\'}s', 'null', $contents);\n // strip leading non-php code if needed\n if (substr($contents, 0, 2) !== '<?') {\n $contents = preg_replace('{^.+?<\\?}s', '<?', $contents, 1, $replacements);\n if ($replacements === 0) {\n return [];\n }\n }\n // strip non-php blocks in the file\n $contents = preg_replace('{\\?>.+<\\?}s', '?><?', $contents);\n // strip trailing non-php code if needed\n $pos = strrpos($contents, '?>');\n if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) {\n $contents = substr($contents, 0, $pos);\n }\n preg_match_all('{\n (?:\n \\b(?<![\\$:>])(?P<type>class|interface'.$extraTypes.') \\s++ (?P<name>[a-zA-Z_\\x7f-\\xff:][a-zA-Z0-9_\\x7f-\\xff:\\-]*+)\n | \\b(?<![\\$:>])(?P<ns>namespace) (?P<nsname>\\s++[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*+(?:\\s*+\\\\\\\\\\s*+[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*+)*+)? \\s*+ [\\{;]\n )\n }ix', $contents, $matches);\n $classes = [];\n $namespace = '';\n for ($i = 0, $len = count($matches['type']); $i < $len; $i++) {\n if (!empty($matches['ns'][$i])) {\n $namespace = str_replace([' ', \"\\t\", \"\\r\", \"\\n\"], '', $matches['nsname'][$i]).'\\\\';\n } else {\n $name = $matches['name'][$i];\n if ($name[0] === ':') {\n // This is an XHP class, https://github.com/facebook/xhp\n $name = 'xhp'.substr(str_replace(['-', ':'], ['_', '__'], $name), 1);\n } elseif ($matches['type'][$i] === 'enum') {\n // In Hack, something like:\n // enum Foo: int { HERP = '123'; }\n // The regex above captures the colon, which isn't part of\n // the class name.\n $name = rtrim($name, ':');\n }\n $classes[] = ltrim($namespace.$name, '\\\\');\n }\n }\n\n return $classes;\n }",
"protected function getLanguageFiles(): array {\n\t\t$extensions = ExtensionManagementUtility::getLoadedExtensionListArray();\n\t\t$extensions = array_filter($extensions, function(string $extensionName) {\n\t\t\treturn str_starts_with($extensionName, 'vierwd_');\n\t\t});\n\t\tsort($extensions);\n\n\t\t$files = [];\n\t\tforeach ($extensions as $extensionName) {\n\t\t\t$path = ExtensionManagementUtility::extPath($extensionName, 'Resources/Private/Language');\n\t\t\tif (!is_dir($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$languageFiles = glob($path . '/*.xlf') ?: [];\n\n\t\t\t// remove language files which are translations\n\t\t\t$languageFiles = array_filter($languageFiles, function(string $pathName) {\n\t\t\t\t$fileName = basename($pathName);\n\t\t\t\treturn substr_count($fileName, '.') === 1;\n\t\t\t});\n\n\t\t\tif (!$languageFiles) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// only use filename\n\t\t\t$languageFiles = array_map('basename', $languageFiles);\n\n\t\t\t$files[$extensionName] = [];\n\t\t\tforeach ($languageFiles as $fileName) {\n\t\t\t\t$files[$extensionName][$fileName] = $fileName;\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}",
"function getClassesInNamespace($psrNamespace = NULL) : array\n {\n $store = \\Cache::driver();\n $key = $psrNamespace ? md5($psrNamespace) : 'all_classes';\n\n if ( \\Cache::supportsTags() ) {\n $store = \\Cache::tags([ 'classes_in_namespace' ]);\n }\n\n return $store->get($key, function() use ($psrNamespace, $key){\n $namespaces = array_keys(( new \\Facade\\Ignition\\Support\\ComposerClassMap() )->listClasses());\n\n if ( $psrNamespace ) {\n $namespaces = array_filter($namespaces, function ($n) use ($psrNamespace) {\n return \\Illuminate\\Support\\Str::startsWith($n, $psrNamespace);\n });\n }\n\n if(\\Cache::supportsTags()){\n Cache::tags(['classes_in_namespace'])->forever($key, $namespaces);\n }else{\n Cache::forever($key, $namespaces);\n }\n\n return $namespaces;\n });\n }",
"final private function _classesInScript ($code = '') {\n\t\t$classes = array();\n\n\t\t// Find tokens that are classes\n\t\t$tokens = token_get_all($code);\n\t\tfor ($i = 2; $i < count($tokens); $i++) {\n\n\t\t\t// Assess tokens to find class declarations of subclasses\n\t\t\tif (\n\t\t\t\t$tokens[$i-2][0] === T_CLASS and\n\t\t\t\t$tokens[$i-1][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i][0] === T_STRING and\n\t\t\t\t$tokens[$i+1][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i+2][0] === T_EXTENDS and\n\t\t\t\t$tokens[$i+3][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i+4][0] === T_STRING\n\t\t\t) {\n\t\t\t\t$inheritedFrom = $tokens[$i+4][1];\n\n\t\t\t\t// See if class extends Unitest\n\t\t\t\tif ($this->_isValidSuiteClass($inheritedFrom)) {\n\t\t\t\t\t$classes[] = $tokens[$i][1];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}",
"public static function getProcessors()\n {\n $folders = array(\n 'DB',\n 'Row',\n );\n $prefix = APPLICATION_PATH . '/CSVRunner/Processor/';\n $suffix = '/*.php';\n $folders = array_map(function ($e) use ($prefix, $suffix) {return $prefix . $e . $suffix;}, $folders);\n $files = array_map('basename', call_user_func_array('array_merge', array_map('glob', $folders)));\n $files = array_map(function ($e) {return str_replace('.php', '', $e);}, $files);\n $files = array_unique($files);\n $files = array_filter($files, function ($e) {return $e !== 'Abstract';});\n return $files;\n }",
"public static function allCTL(){\n $names = array();\n foreach (self::glob_recursive(dirname(__FILE__).'/CTL/*.php') as $filename)\n {\n $name = \"Main\\\\\".str_replace(dirname(__FILE__).'/', \"\", $filename);\n $name = str_replace(\"/\", \"\\\\\", $name);\n $name = str_replace(\".php\", \"\", $name);\n $names[] = $name;\n }\n\n return $names;\n }",
"public function getContextClasses();",
"function cargarClases($ruta) {\n if (is_dir($ruta)) {\n if ($dh = opendir($ruta)) {\n while (($file = readdir($dh)) !== false) {\n if (is_dir($ruta.$file) && $file != \".\" && $file != \"..\") {\n if (strstr($file, \"clases\")) {\n //echo $ruta.$file;\n $clases = opendir($ruta.$file);\n while ($clase = readdir($clases)) {\n if (preg_match('/class\\.php$/',$clase)) {\n include_once($ruta.$file.'/'.$clase);\n //echo $ruta.$file.'/'.$clase.'<br/>';\n }\n }\n }//solo si el archivo es un directorio, distinto que \".\" y \"..\"\n\n cargarClases($ruta.$file.\"/\");\n }\n }\n closedir($dh);\n }\n }\n}",
"protected function get_migration_file_list()\n\t{\n\t\tif ($this->migrations !== false)\n\t\t{\n\t\t\treturn $this->migrations;\n\t\t}\n\n\t\t// Only have the finder search in this extension path directory\n\t\t$migrations = $this->extension_finder\n\t\t\t->extension_directory('/migrations')\n\t\t\t->find_from_extension($this->extension_name, $this->extension_path);\n\n\t\t$migrations = $this->extension_finder->get_classes_from_files($migrations);\n\n\t\t$this->migrator->set_migrations($migrations);\n\n\t\t$migrations = $this->migrator->get_migrations();\n\n\t\treturn $migrations;\n\t}",
"public function extensions_directories()\n\t{\n\t\t$grouped_extensions = (array) glob(path('extensions').'*'.DS.'*'.DS.'extension'.EXT, GLOB_NOSORT);\n\t\t$top_level_extensions = (array) glob(path('extensions').'*'.DS.'extension'.EXT, GLOB_NOSORT);\n\n\t\treturn $this->cascade_extensions_directories($top_level_extensions, $grouped_extensions);\n\t}",
"function collect_classes($folder, &$faecher, $depth=0) {\n $depth++;\n $dir_content = glob(\"$folder/*\");\n foreach ($dir_content as $file) {\n if (is_dir($file) && $file != \".\" && $file != \"..\") {\n $faecher[] .= $file;\n collect_classes($file, $faecher, $depth);\n }\n }\n }",
"public static function getClassList\n\t(\n\t\t$dir = \"\"\t\t// <str> A strict directory to look it for plugins; disallows any other paths if set\n\t)\t\t\t\t\t// RETURNS <int:str> a list of plugins located.\n\t\n\t// $classList = Classes_Meta::getClassList([$dir]);\n\t{\n\t\t// If a directory is provided, ONLY look through that directory for plugins\n\t\tif($dir !== \"\")\n\t\t{\n\t\t\t$dir = rtrim(Sanitize::filepath($dir), \"/\");\n\t\t\treturn Dir::getFolders($dir);\n\t\t}\n\t\t\n\t\t// Get the full list of available plugins\n\t\t$classes = Dir::getFolders(APP_PATH . \"/classes\");\n\t\t$classes = array_merge(Dir::getFolders(SYS_PATH . \"/core-classes\"), $classes);\n\t\t$classes = array_merge(Dir::getFolders(SYS_PATH . \"/plugin-classes\"), $classes);\n\t\t\n\t\treturn $classes;\n\t}",
"public function getClassNames($filename)\n {\n return $this->parse($filename)['classes'];\n }",
"public function fluentClasses()\n {\n $classes = [];\n $dataClasses = ClassInfo::subclassesFor(DataObject::class);\n array_shift($dataClasses);\n foreach ($dataClasses as $class) {\n $base = DataObject::getSchema()->baseDataClass($class);\n foreach (DataObject::get_extensions($base) as $extension) {\n if (is_a($extension, FluentExtension::class, true)) {\n $classes[] = $base;\n break;\n }\n }\n }\n return array_unique($classes);\n }",
"protected function getFilesToLoad()\n\t{\n\t\t$includingFiles = array(\n\t\t\tRD.\"Functions.php\",\n\t\t);\n\t\t$plugins = $this->getPluginFiles();\n\t\tif(!empty($plugins))\n\t\t\t$includingFiles = array_merge($includingFiles, $plugins);\n\t\treturn $includingFiles;\n\t}",
"function _generateFilesList() {\n return array();\n }",
"public static function getAllExtensions():array;",
"public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}",
"public function all()\n\t{\n\t\t$extensions = array();\n\n\t\t// Loop through extensions directories\n\t\tforeach ($this->extensions_directories() as $directory)\n\t\t{\n\t\t\t// Get our extension slug - always\n\t\t\t// matches the folder name.\n\t\t\t$slug = basename($directory);\n\n\t\t\t// Read extension info. Always do this even\n\t\t\t// if no details are required as this will\n\t\t\t// validate the extension.\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$extensions[$slug] = $this->get($slug);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tksort($extensions);\n\t\treturn array_values($extensions);\n\t}",
"public function getClasses() {\n return $this->classes;\n }",
"public function loadAllClassesIncrementally()\n {\n }",
"public function getClasses() {\n\t\treturn $this->classes;\n\t}",
"protected function getExtensionsWithTestSuites () {\r\n\t\t\t// Fetch extension manager configuration options\r\n\t\t$excludeExtensions = t3lib_div::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['phpunit']['excludeextensions']);\r\n\t\t$outOfLineTestCases = $this->traversePathForTestCases($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['phpunit']['outoflinetestspath']);\r\n\t\r\n\t\t\t// Get list of loaded extensions\r\n\t\t$extList = explode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList']);\r\n\t\r\n\t\t$extensionsOwnTestCases = array();\r\n\t\tforeach ($extList as $extKey) {\r\n\t\t\t$extPath = t3lib_extMgm::extPath($extKey);\r\n\t\t\tif (is_dir($extPath . 'Tests/')) {\r\n\t\t\t\t$testCasesDirectory = $extPath . 'Tests/';\r\n\t\t\t} else {\r\n\t\t\t\t$testCasesDirectory = $extPath . 'tests/';\r\n\t\t\t}\r\n\t\r\n\t\t\t$testCasesArr = $this->findTestCasesInDir($testCasesDirectory);\r\n\t\t\tif (!empty($testCasesArr)) {\r\n\t\t\t\t$extensionsOwnTestCases[$extKey] = $testCasesArr;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t$coreTestCases = array();\r\n\t\t$coreTestsDirectory = file_exists(PATH_site . 'tests/') ? PATH_site . 'tests/' : PATH_site . 'typo3_src/tests/';\r\n\t\tif (@is_dir($coreTestsDirectory)) {\r\n\t\t\t$coreTestCases['typo3'] = $this->findTestCasesInDir(\r\n\t\t\t\t\t$coreTestsDirectory\r\n\t\t\t);\r\n\t\t}\r\n\t\r\n\t\t$totalTestsArr = array_merge_recursive(\r\n\t\t\t\t$outOfLineTestCases, $extensionsOwnTestCases, $coreTestCases\r\n\t\t);\r\n\t\r\n\t\t\t// Exclude extensions according to extension manager config\r\n\t\t$returnTestsArr = array_diff_key($totalTestsArr, array_flip($excludeExtensions));\r\n\t\treturn $returnTestsArr;\r\n\t}",
"public function getClassMap(): array\n {\n $parentMap = $this->getBoundIterator()->getClassMap();\n $map = iterator_to_array($this->getIterator());\n\n foreach ($map as $name => &$fileinfo) {\n $fileinfo = $parentMap[$name];\n }\n\n return $map;\n }",
"public function getClassList()\n {\n $return = array();\n $classes = eZContentClass::fetchList();\n $classBlacklist = self::getClassBlacklist(); \n foreach( $classes as $class )\n {\n if ( !isset( $classBlacklist[$class->attribute('identifier')] ) )\n {\n $return[$class->attribute('identifier')] = $class;\n }\n }\n ksort( $return );\n return $return;\n }",
"protected function _scan_files()\n\t{\n\t\t$terms = array();\n\n\t\t$parser = new PHPParser_Parser(new PHPParser_Lexer);\n\n\t\tforeach ($this->_list_files(array('views', 'classes')) as $file)\n\t\t{\n\t\t\t$statements = $parser->parse(file_get_contents($file));\n\n\t\t\t$terms = Arr::merge($terms, $this->_get_terms_from_statements($statements));\n\t\t}\n\n\t\treturn $terms;\n\t}",
"function _get_templates()\n\t{\n\t\t$location = FILESYSTEM_PATH .'modules/customcats/templates/cattemplates/';\n\t\t$filelist=array();\n\t\tif ($handle = opendir($location))\n\t\t{\n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{\n\t\t\t\tif ($file != \".\" && $file != \"..\" && $file!=\".svn\" && $file!=\"index.htm\")\n\t\t\t\t{\n\t\t\t\t\t$filelist[]=$file;\n\t\t\t\t}\n\t\t\t}\n \t\t\tclosedir($handle);\n\t\t}\n\t\treturn $filelist;\n\t}",
"function getPaths()\n {\n $paths = array();\n foreach ($this->names as $name) {\n $paths[] = $this->dir.$name.$this->ext;\n }\n return $paths;\n }",
"protected function listEntityClasses()\n {\n $classNames = [];\n $classNames[] = 'MU\\FilesModule\\Entity\\CollectionEntity';\n $classNames[] = 'MU\\FilesModule\\Entity\\CollectionCategoryEntity';\n $classNames[] = 'MU\\FilesModule\\Entity\\FileEntity';\n $classNames[] = 'MU\\FilesModule\\Entity\\HookAssignmentEntity';\n \n return $classNames;\n }",
"public function getInitFiles() {\n $aOut = array();\n foreach ($this->getBasePaths('init') as $aPaths) {\n foreach ($aPaths as $aInfo) {\n $aOut[] = $aInfo['path'];\n }\n }\n foreach ($this->getBasePaths('include') as $aPaths) {\n foreach ($aPaths as $aInfo) {\n $aOut[] = $aInfo['path'];\n }\n }\n return $aOut;\n }",
"public function load()\n {\n $this->_retrievedFiles = $this->getRetrievedFiles();\n $this->_loadedClasses = [];\n\n $manifestRepository = $this->_registry->getManifestRepository();\n $providerRepository = $this->_registry->getProviderRepository();\n\n $loadedClasses = [];\n\n // loop through files and find the classes declared by loading the file\n foreach ($this->_retrievedFiles as $file) {\n if(is_dir($file)) {\n continue;\n }\n\n $classesLoadedBefore = get_declared_classes();\n $oldLevel = error_reporting(E_ALL | ~E_STRICT); // remove strict so that other packages wont throw warnings\n // should we lint the files here? i think so\n include_once $file;\n error_reporting($oldLevel); // restore old error level\n $classesLoadedAfter = get_declared_classes();\n $loadedClasses = array_merge($loadedClasses, array_diff($classesLoadedAfter, $classesLoadedBefore));\n }\n\n // loop through the loaded classes and ensure that\n foreach ($loadedClasses as $loadedClass) {\n\n // reflect class to see if its something we want to load\n $reflectionClass = new ReflectionClass($loadedClass);\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Manifest_Interface')\n && !$reflectionClass->isAbstract())\n {\n $manifestRepository->addManifest($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Provider_Interface')\n && !$reflectionClass->isAbstract()\n && !$providerRepository->hasProvider($reflectionClass->getName(), false))\n {\n $providerRepository->addProvider($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n }\n\n return $this->_loadedClasses;\n }",
"public function getPackages(): array\n {\n return $this->packagesClasses;\n }",
"protected function getFilesToProcess()\n {\n return array(\n 'custom/modules/Quotes/metadata/detailviewdefs.php',\n );\n }",
"public static function get_all_types() {\t\t$types = scandir(str_replace(\"/\", \"\\\\\", dirname(plugin_dir_path( __FILE__ )) . \"\\\\ESWP\\\\MyTypes\"));\r\n\t\t$size = count($types);\r\n\t\t$_types = array();\r\n\t\t\r\n\t\t//Feed in the extra types\r\n\t\t$extra_types = array();\r\n\t\tif(has_filter(\"es_include_types\")) {\r\n\t\t\t$extra_types = apply_filters(\"es_include_types\", $extra_types);\r\n\t\t\t\r\n\t\t\t$size += count($extra_types);\r\n\t\t\t\r\n\t\t\tforeach ($extra_types as $type) {\r\n\t\t\t\t$order = $size;\r\n\t\t\t\t\r\n\t\t\t\tif (method_exists($type, \"get_order\")) {\r\n\t\t\t\t\t$order = $type->get_order();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tarray_push($_types, array(\r\n\t\t\t\t\t\"order\" => $order,\r\n\t\t\t\t\t\"type\" => $type\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Add the included types\r\n\t\tforeach ($types as $type) {\r\n\t\t\tif ($type !== \"BaseType.php\" && trim($type, \".\") !== \"\") {\r\n\t\t\t\t$order = $size + 10;\r\n\t\t\t\t$_type = \"\\\\ESWP\\\\MyTypes\\\\\". explode(\".\", $type)[0];\r\n\t\t\t\t\r\n\t\t\t\tif (class_exists($_type)) {\r\n\t\t\t\t\t$_type_obj = new $_type();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (method_exists($_type, \"get_order\")) {\r\n\t\t\t\t\t\t$order = $_type_obj->get_order();\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\tarray_push($_types, array(\r\n\t\t\t\t\t\t\"order\" => $order,\r\n\t\t\t\t\t\t\"type\" => $_type_obj\r\n\t\t\t\t\t));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $_types;\r\n\t}",
"public static function getClasses()\n {\n $classes = SchoolClass::all();\n $classes_array = [];\n foreach ($classes as $class) {\n $classes_array[$class->name] = [\n \"name\" => $class->name,\n \"year\" => $class->year,\n \"holder\" => $class->holder,\n \"delegate\" => $class->delegate,\n \"status\" => $class->status,\n ];\n }\n return $classes_array;\n }"
]
| [
"0.7804645",
"0.71560675",
"0.7048785",
"0.69356614",
"0.6918307",
"0.688314",
"0.65367264",
"0.6367707",
"0.63034505",
"0.62769014",
"0.61314994",
"0.61314994",
"0.61314994",
"0.6121845",
"0.61206365",
"0.6116074",
"0.609877",
"0.6073294",
"0.6048848",
"0.60483134",
"0.5989792",
"0.5958583",
"0.5951419",
"0.59207773",
"0.59131074",
"0.5904029",
"0.5900674",
"0.5900316",
"0.58955425",
"0.58893883",
"0.588557",
"0.58626044",
"0.585787",
"0.58485377",
"0.5842006",
"0.58392525",
"0.58320874",
"0.58070374",
"0.57975364",
"0.57952136",
"0.57917726",
"0.57736605",
"0.5744113",
"0.5741978",
"0.5736907",
"0.5734804",
"0.57295156",
"0.57262",
"0.5714224",
"0.5704461",
"0.5691716",
"0.56901056",
"0.5674298",
"0.56733656",
"0.5669773",
"0.5660911",
"0.5654625",
"0.5645259",
"0.5644757",
"0.5639491",
"0.5636944",
"0.56159586",
"0.5610425",
"0.55959797",
"0.55939037",
"0.5571007",
"0.55565494",
"0.5538376",
"0.5533575",
"0.5532423",
"0.55280775",
"0.5519483",
"0.55187136",
"0.5518393",
"0.5518294",
"0.55138576",
"0.5511964",
"0.5501558",
"0.5501408",
"0.5486493",
"0.5459881",
"0.5456181",
"0.5453879",
"0.54491377",
"0.54469436",
"0.5431151",
"0.5414231",
"0.5412864",
"0.54125917",
"0.5411794",
"0.54110205",
"0.54054457",
"0.5403328",
"0.54032654",
"0.53963006",
"0.5394782",
"0.5391797",
"0.5390821",
"0.53902465",
"0.5387052"
]
| 0.59520584 | 22 |
Loads php files containing classes or interfaces found in the classes directory of a package and specifically registered classes. | private function loadClass($className)
{
$classNameParts = explode('_', $className, 3);
if ($classNameParts[0] === self::PACKAGE_PREFIX) {
// Caches the $classFiles
if ($this->classFiles === null || empty($this->classFiles)) {
$this->classFiles = $this->buildArrayOfClassFiles($classNameParts[1]);
}
if (is_array($this->tsConf['additionalIncludePaths.'])) {
foreach ($this->tsConf['additionalIncludePaths.'] as $dir) {
$temp = [];
$temp = $this->buildArrayOfClassFiles($dir);
$this->classFiles = array_merge($temp, $this->classFiles);
}
}
$classFilePathAndName = isset($this->classFiles[$className]) ? $this->classFiles[$className] : null;
if (isset($classFilePathAndName) && file_exists($classFilePathAndName)) {
require_once($classFilePathAndName);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function loadClassFiles() {}",
"public function load()\n {\n $this->_retrievedFiles = $this->getRetrievedFiles();\n $this->_loadedClasses = [];\n\n $manifestRepository = $this->_registry->getManifestRepository();\n $providerRepository = $this->_registry->getProviderRepository();\n\n $loadedClasses = [];\n\n // loop through files and find the classes declared by loading the file\n foreach ($this->_retrievedFiles as $file) {\n if(is_dir($file)) {\n continue;\n }\n\n $classesLoadedBefore = get_declared_classes();\n $oldLevel = error_reporting(E_ALL | ~E_STRICT); // remove strict so that other packages wont throw warnings\n // should we lint the files here? i think so\n include_once $file;\n error_reporting($oldLevel); // restore old error level\n $classesLoadedAfter = get_declared_classes();\n $loadedClasses = array_merge($loadedClasses, array_diff($classesLoadedAfter, $classesLoadedBefore));\n }\n\n // loop through the loaded classes and ensure that\n foreach ($loadedClasses as $loadedClass) {\n\n // reflect class to see if its something we want to load\n $reflectionClass = new ReflectionClass($loadedClass);\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Manifest_Interface')\n && !$reflectionClass->isAbstract())\n {\n $manifestRepository->addManifest($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Provider_Interface')\n && !$reflectionClass->isAbstract()\n && !$providerRepository->hasProvider($reflectionClass->getName(), false))\n {\n $providerRepository->addProvider($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n }\n\n return $this->_loadedClasses;\n }",
"public function load()\n {\n if( $this->autoload ) {\n $loader = new BasePathClassLoader( $this->paths );\n $loader->useEnvPhpLib();\n $loader->register();\n }\n\n foreach( $this->paths as $path ) {\n $di = new RecursiveDirectoryIterator($path);\n $ita = new RecursiveIteratorIterator($di);\n $regex = new RegexIterator($ita, '/^.+\\.php$/i', \n RecursiveRegexIterator::GET_MATCH);\n\n foreach( $regex as $matches ) foreach( $matches as $match ) {\n try {\n require_once $match;\n } \n catch ( Exception $e ) {\n echo \"$match class load failed.\\n\";\n }\n }\n }\n }",
"public static function autoload() {\n // autoload\n include('cache/classes.yml.php');\n foreach($return as $class) {\n require_once($class);\n }\n }",
"public static function loadAllClassesOfPackage($packageName) {\n\n\t\t$packageName = trim($packageName, ' _');\n\n\t\t$packagePath = str_replace('_', DIRECTORY_SEPARATOR, $packageName);\n\t\t$include_path = explode(PATH_SEPARATOR, get_include_path());\n\t\t$classes = array();\n\t\tCustomweb_Core_Util_Error::deactivateErrorMessages();\n\t\tforeach($include_path as $path) {\n\t\t\t$file = realpath($path . DIRECTORY_SEPARATOR . $packagePath);\n\t\t\t$phpFile = realpath($path . DIRECTORY_SEPARATOR . $packagePath . '.php');\n\t\t\tif(@file_exists($file)) {\n\t\t\t\tif (@is_dir($file)) {\n\t\t\t\t\t$classes = array_merge($classes, self::loadAllClassesOfDirectory($file, $packageName));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (@file_exists($phpFile)) {\n\t\t\t\t$className = $packageName;\n\t\t\t\tif (!isset($classes[$className]) && !self::isClassLoaded($className)) {\n\t\t\t\t\tCustomweb_Core_Util_Error::activateErrorMessages();\n\t\t\t\t\trequire_once $phpFile;\n\t\t\t\t\tCustomweb_Core_Util_Error::deactivateErrorMessages();\n\t\t\t\t}\n\t\t\t\t$classes[$className] = $className;\n\t\t\t}\n\t\t}\n\t\tCustomweb_Core_Util_Error::activateErrorMessages();\n\n\t\treturn $classes;\n\t}",
"public function loadClasses(){\n spl_autoload_register(function($className){\n require_once preg_replace(\"/\\\\\\\\/\", \"/\", $className).\".php\";\n });\n }",
"function autoloadClasses($className) {\r\n $filename = \"./classes/\" . $className . \".php\";\r\n if (is_readable($filename)) {\r\n include $filename;\r\n }\r\n}",
"public function mapClasses() {\n // TODO: this is needed when the class map is not created yet (i.e. at very first install).\n if (!is_dir($this->dir['tmp'])) {\n mkdir($this->dir['tmp']);\n }\n $fop = fopen(CLASS_MAP_FILE, 'w+');\n\n foreach ($this->modules_loaded as $module) {\n $autoload_paths = array('Common', 'Qtags');\n foreach ($autoload_paths as $autoload_path) {\n $full_autoload_path = $module['path'] . '/classes/' . $autoload_path;\n /**\n * Autoload module's qtags.\n */\n if (is_dir($full_autoload_path)) {\n $classes = $this->scanDirectory($full_autoload_path);\n foreach ($classes as $class) {\n // Parse the Qtag.\n $exp1 = explode('/', $class);\n $exp2 = explode('.', $exp1[count($exp1) - 1]);\n $item_name = $exp2[0];\n $this->class_map[$autoload_path][$item_name] = $full_autoload_path . '/' . $class;\n }\n }\n }\n }\n fwrite($fop, serialize($this->class_map));\n fclose($fop);\n }",
"protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}",
"public function load()\n {\n $files = $this->finder->files()->in($this->shimsDirectory);\n\n foreach ($files as $file) {\n $this->loadFile($file);\n }\n }",
"abstract protected static function autoload($class);",
"function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}",
"function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}",
"public static function findClasses($path)\n {\n $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait';\n if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) {\n $extraTypes .= '|enum';\n }\n try {\n $contents = @php_strip_whitespace($path);\n if (!$contents) {\n if (!file_exists($path)) {\n throw new \\Exception('File does not exist');\n }\n if (!is_readable($path)) {\n throw new \\Exception('File is not readable');\n }\n }\n } catch (\\Exception $e) {\n throw new \\RuntimeException('Could not scan for classes inside '.$path.\": \\n\".$e->getMessage(), 0, $e);\n }\n // return early if there is no chance of matching anything in this file\n if (!preg_match('{\\b(?:class|interface'.$extraTypes.')\\s}i', $contents)) {\n return [];\n }\n // strip heredocs/nowdocs\n $contents = preg_replace('{<<<\\s*(\\'?)(\\w+)\\\\1(?:\\r\\n|\\n|\\r)(?:.*?)(?:\\r\\n|\\n|\\r)\\\\2(?=\\r\\n|\\n|\\r|;)}s', 'null', $contents);\n // strip strings\n $contents = preg_replace('{\"[^\"\\\\\\\\]*+(\\\\\\\\.[^\"\\\\\\\\]*+)*+\"|\\'[^\\'\\\\\\\\]*+(\\\\\\\\.[^\\'\\\\\\\\]*+)*+\\'}s', 'null', $contents);\n // strip leading non-php code if needed\n if (substr($contents, 0, 2) !== '<?') {\n $contents = preg_replace('{^.+?<\\?}s', '<?', $contents, 1, $replacements);\n if ($replacements === 0) {\n return [];\n }\n }\n // strip non-php blocks in the file\n $contents = preg_replace('{\\?>.+<\\?}s', '?><?', $contents);\n // strip trailing non-php code if needed\n $pos = strrpos($contents, '?>');\n if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) {\n $contents = substr($contents, 0, $pos);\n }\n preg_match_all('{\n (?:\n \\b(?<![\\$:>])(?P<type>class|interface'.$extraTypes.') \\s++ (?P<name>[a-zA-Z_\\x7f-\\xff:][a-zA-Z0-9_\\x7f-\\xff:\\-]*+)\n | \\b(?<![\\$:>])(?P<ns>namespace) (?P<nsname>\\s++[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*+(?:\\s*+\\\\\\\\\\s*+[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*+)*+)? \\s*+ [\\{;]\n )\n }ix', $contents, $matches);\n $classes = [];\n $namespace = '';\n for ($i = 0, $len = count($matches['type']); $i < $len; $i++) {\n if (!empty($matches['ns'][$i])) {\n $namespace = str_replace([' ', \"\\t\", \"\\r\", \"\\n\"], '', $matches['nsname'][$i]).'\\\\';\n } else {\n $name = $matches['name'][$i];\n if ($name[0] === ':') {\n // This is an XHP class, https://github.com/facebook/xhp\n $name = 'xhp'.substr(str_replace(['-', ':'], ['_', '__'], $name), 1);\n } elseif ($matches['type'][$i] === 'enum') {\n // In Hack, something like:\n // enum Foo: int { HERP = '123'; }\n // The regex above captures the colon, which isn't part of\n // the class name.\n $name = rtrim($name, ':');\n }\n $classes[] = ltrim($namespace.$name, '\\\\');\n }\n }\n\n return $classes;\n }",
"function __autoload($class_name) {\n include 'classes/' . $class_name . '.php';\n}",
"function __autoload($class_name) {\r\n include '../class/' . $class_name . '.php';\r\n}",
"protected function loadCoreClasses() {\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Config.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Router.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Loader.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Controller.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Database.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Model.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Library.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'View.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Request.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Response.php';\r\n }",
"private static function autoLoader($namespace)\n {\n $filePath = explode('\\\\', $namespace);\n\n /**\n * To remove the Class name (Not class file name) from the end of the namespace.\n */\n array_pop($filePath);\n /**\n * to remove the root key from the beginning the namespace.\n */\n array_shift($filePath);\n \n /**\n * After taking and removing those stuffs, then we are converting namespace from array to an string .\n * using the directory separator that it can work perfectly in every OS (like: windows, linux, ...) .\n */\n $filePath = implode(DIRECTORY_SEPARATOR, $filePath);\n\n /**\n * Now we have just removed that root key from the beginning of the namespace that was extra and also\n * took the Class name (not its file name) from the namespace.\n * And now we have got the address to the class file from the root of the Framework.\n * \n * It means that with combining the (FILE_PATH) constant that gives us the absolute path to the Framework's root and having the address of the class name in the\n * Framework (that we it is) and adding the file extension to these things we can have the full path to that class that was called!\n */\n $filePath = FILE_PATH . $filePath . '.php';\n \n /*\n * We are checking to see whether that class exists or not,\n * If it exists then we are calling that class with using the (require_once) function.\n */\n if (is_readable($filePath))\n {\n require_once $filePath;\n self::registryInjection($namespace);\n\n return;\n }else\n {\n self::$registry->error->reportError(\"The Called Class File Does Not Exists! ({$filePath})\", __LINE__, __METHOD__, false);\n return;\n }\n return;\n }",
"protected abstract function registerClasses(): void;",
"function my_class_loader ($class) {\n include 'classes' . DIRECTORY_SEPARATOR . $class . '.class.php';\n}",
"public function loadTree($folder)\n {\n $filter = \".class.php\";\n $files = file::file_tree_filtered($this->ApplicationRootFolder().\"/\".$folder,\"/\",$filter);\n\n $files = file::arrayFilterOut($files, \"~\");\n $files = file::arrayFilterOut($files, \".new\");\n $files = file::arrayFilterOut($files, \".backup\");\n\n\n // load classes found\n foreach ($files as $key => $value)\n {\n\n include_once $value;\n }\n\n }",
"public function autoload($class) {\n if (isset(static::$map[$class])){\n $pathInfo = static::$map[$class];\n Yaf_Loader::import(sprintf('%s%s',$pathInfo[0], $pathInfo[1]));\n } else if (strpos($class, 'Builder') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/views/builder/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Pagelet') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/pagelets/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Halo') === 0){\n Yaf_Loader::import(sprintf('%s/halo/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Util') == strlen($class) - 4 || strpos($class, 'Utils') == strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/utils/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Model') === strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/application/models/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'Service') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/service/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'HTMLPurifier') !== false){\n Yaf_Loader::import(sprintf('%s/htmlpurifier/HTMLPurifier.safe-includes.php',LIB_PATH));\n }else if (strpos($class, 'Api') === strlen($class) - 3){\n Yaf_Loader::import(sprintf('%s/application/Api/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'Object') === strlen($class) - 6){\n Yaf_Loader::import(sprintf('%s/application/objects/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'MemCache') === 0){\n// var_dump('================');\n// /Users/worker/php/wk/wcontact_cache/lib/wcontact/MemCacheBase.php\n Yaf_Loader::import(sprintf('%s/wzhaopin/%s.php',LIB_PATH, $class));\n }\n }",
"function autoload($className) {\n\tstatic $paths;\n\t\n\t// Collect all sub-folders of \"plugins\" (the directory of this file)\n\t// Each plugin directory contains a folder called \"scripts\" which contains\n\t// a common namespace structure.\n\tif (!$paths) {\n\t\t$paths = array();\n\t\tforeach (new DirectoryIterator(__DIR__) as $fileInfo) {\n\t if ($fileInfo->isDir() && !$fileInfo->isDot()) \n\t \t$paths[] = $fileInfo->getPathname();\n\t\t}\n\t}\n\t\n\tforeach ($paths as $path) {\n\t\t$fileName = $path.'/scripts/'.str_replace('\\\\', '/', $className).'.php';\n\t\tif (\\file_exists($fileName) && \\is_file($fileName)) {\n\t\t\trequire_once($fileName);\n\t\t\tbreak;\n\t\t}\n\t}\n}",
"public function loadAllClassesIncrementally()\n {\n }",
"function autoload($class) \n{\n $paths = explode(PATH_SEPERATOR, get_include_path());\n $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE;\n $file = str_replace(\"\\\\\", DIRECTORY_SEPARATOR, trim($class, \"\\\\\")).\".php\"; //need to set name of php file to lowercase because of stringtolower command\n foreach ($paths as $path) {\n\t\t $combined = $path.DIRECTORY_SEPARATOR.$file;\n\t\t if (file_exists($combined)) {\n\t\t\t //echo '<br>'.$combined.'<br>'; //Troubleshooting code to echo out the file that's being loaded\n\t\t\t //exit;\n\t\t \tinclude($combined);\n\t\t\t return;\n }\n }\n throw new Exception(\"{$class} not found\");\n}",
"private function includeFiles(){\n foreach($this->files as $file){\n require implode('', $file);\n $class_name = $this->getClassNameFromFileName($file);\n $this->classes[$file['name']] = new $class_name();\n }\n }",
"function __autoload($class) {\n global $classesDirs;\n\n foreach ($classesDirs as $directory) {\n $filename = $directory . $class . '.php';\n\n if (file_exists($filename)) {\n require_once($filename);\n return;\n }\n }\n}",
"public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }",
"function __autoload($class_name) {\n include \"classes/\" . $class_name . \".class.php\";\n}",
"function yap_autoloader($class) {\n $directories = array(LIB_DIR, MODEL_DIR);\n\n foreach($directories as $directory) {\n if(!@include(\"$directory/$class.php\"))\n @include($directory.strtolower($class).\".php\");\n }\n}",
"function __autoload($className) {\n include \"src/\" . $className . '.php';\n}",
"protected function processSourceTree () {\n\t\t$this->processFileTree();\n\t\tforeach (get_declared_interfaces() as $interface) {\n\t\t$ref = new ReflectionClass($interface);\n\t\t\tif ($ref->isUserDefined()) {\n\t\t\t\t$this->classes[] = $ref;\n\t\t\t}\n\t\t}\n\t\tforeach (get_declared_classes() as $class) {\n\t\t\t$ref = new ReflectionClass($class);\n\t\t\tif ($ref->isUserDefined() && !preg_match('/^Spd/', $class)) {\n\t\t\t\t$this->classes[] = $ref;\n\t\t\t}\n\t\t}\n\t}",
"public static function autoload($class) {\n include $class . '.php';\n}",
"function __autoload($class){\n require \"classes/\".$class.\".php\";\n }",
"function autoload ($clase, $dir=null){\r\n if(is_null($dir)){\r\n $dirname = str_replace('/public','', dirname(__FILE__));\r\n $dir = realpath($dirname);\r\n }\r\n //escaneo la clase de forma recursiva\r\n foreach (scandir($dir)as $file){\r\n //si es un dirrectorio (y no es de sistema)accedo y busco la clase dentro de el\r\n if (is_dir($dir.\"/\".$file) AND substr($file, 0, 1) !== '.'){\r\n autoload($clase, $dir.\"/\".$file); \r\n }\r\n //si es un fichero y el nombre coincide con el de la clase\r\n else if(is_file($dir.\"/\".$file) AND $file == substr (strrchr ($clase, \"\\\\\"), 1).\".php\"){\r\n require ($dir.\"/\".$file);\r\n }\r\n }\r\n}",
"function autoload($class_name)\n{\n $parts = str_replace('\\\\', '/', $class_name);\n \n $dir = dirname(__FILE__). '/';\n \n if (is_file($dir . $parts . '.php')) {\n include_once $dir . $parts . '.php';\n }\n}",
"function autoload($class)\n{\n require('classes/' . $class . '.class.php');\n}",
"protected function getRegisteredClasses() {}",
"function class_autoloader($class_name) {\n include 'classes/' .$class_name . '.php';\n}",
"public static function autoload($class)\n {\n $folders = array();\n $folders[] = 'app/model';\n $folders[] = 'app/control';\n $folders[] = 'app/view';\n $folders[] = 'app/lib';\n $folders[] = 'app/helpers';\n $folders[] = 'app/service';\n \n // search in app root\n if (file_exists(\"{$class}.class.php\"))\n {\n require_once \"{$class}.class.php\";\n return TRUE;\n }\n \n // search in app root\n if (file_exists(\"{$class}.php\"))\n {\n require_once \"{$class}.php\";\n return TRUE;\n }\n \n foreach ($folders as $folder)\n {\n if (file_exists(\"{$folder}/{$class}.class.php\"))\n {\n require_once \"{$folder}/{$class}.class.php\";\n return TRUE;\n }\n if (file_exists(\"{$folder}/{$class}.php\"))\n {\n require_once \"{$folder}/{$class}.php\";\n return TRUE;\n }\n else if (file_exists(\"{$folder}/{$class}.iface.php\"))\n {\n require_once \"{$folder}/{$class}.iface.php\";\n return TRUE;\n }\n else\n {\n try\n {\n if (file_exists($folder))\n {\n foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($folder),\n RecursiveIteratorIterator::SELF_FIRST) as $entry)\n {\n if (is_dir($entry))\n {\n if (file_exists(\"{$entry}/{$class}.class.php\"))\n {\n require_once \"{$entry}/{$class}.class.php\";\n return TRUE;\n }\n else if (file_exists(\"{$entry}/{$class}.php\"))\n {\n require_once \"{$entry}/{$class}.php\";\n return TRUE;\n }\n else if (file_exists(\"{$entry}/{$class}.iface.php\"))\n {\n require_once \"{$entry}/{$class}.iface.php\";\n return TRUE;\n }\n }\n }\n }\n }\n catch(Exception $e)\n {\n new TMessage('error', $e->getMessage());\n }\n }\n }\n }",
"function __autoload($name){\n require_once './class/' . $name . \".class.php\";\n}",
"function loader($class){\n $class_file = DIR. DS . $class . '.php';\n\n if(file_exists($class_file)){\n require_once($class_file);\n }else{\n foreach (AUTOLOAD_CLASSES as $path){\n $class_file = $path . DS . $class . '.php';\n if(file_exists($class_file)) require_once($class_file);\n }\n }\n}",
"function __autoload($class_name) {\n require_once '../../include/' . $class_name . '.php';\n}",
"private static final function loadClasses() {\n if(isset(self::$_config['include']) && is_array(self::$_config['include'])) {\n self::$_config['include'] = array_merge(self::$defaultInclude, self::$_config['include']);\n $defaultIncludeCount = count(self::$defaultInclude);\n foreach(self::$_config['include'] as $key => $include) {\n /* @var string $include */\n $include = ($key < $defaultIncludeCount) ? self::$basePath . $include : self::$path . $include;\n $matches = [];\n if(preg_match('/(.*)\\/?\\*$/', $include, $matches)) {\n if(is_dir($matches[1])) {\n $files = scandir($matches[1]);\n foreach ($files as $file) {\n /* @var string $file */\n if($file === '.' || $file === '..' || is_dir($matches[1] . $file)) {\n continue;\n }\n if (preg_match('/^.+\\.php$/', $file)) { // include only php files\n require_once($matches[1] . $file);\n }\n }\n } else {\n static::error500(\"Wrong config parameter in <strong>include</strong>:\n {$matches[1]} is not a directory\");\n }\n } else {\n if(file_exists($include)) {\n if(!is_dir($include)) {\n require_once($include);\n } else {\n static::error500(\"Wrong config parameter in <strong>include</strong>:\n $include is a directory\");\n }\n } else {\n static::error500(\"Wrong config parameter in <strong>include</strong>:\n $include is not exists.\");\n }\n }\n }\n } else {\n static::error500('Include is missing from config.');\n }\n }",
"function autoload($className) {\n if(\\strpos($className, 'WordPress\\ThammIT\\Plugins\\TiWpShortcodes') === false) {\n return;\n }\n\n // Split the class name into an array to read the namespace and class.\n $fileParts = \\explode('\\\\', $className);\n\n // Do a reverse loop through $fileParts to build the path to the file.\n $namespace = '';\n for($i = \\count($fileParts) - 1; $i > 0; $i--) {\n // Read the current component of the file part.\n $current = \\str_ireplace('_', '-', $fileParts[$i]);\n\n $namespace = '/' . $current . $namespace;\n\n // If we're at the first entry, then we're at the filename.\n if(\\count($fileParts) - 1 === $i) {\n $namespace = '';\n $fileName = $current . '.php';\n\n /* If 'interface' is contained in the parts of the file name, then\n * define the $file_name differently so that it's properly loaded.\n * Otherwise, just set the $file_name equal to that of the class\n * filename structure.\n */\n if(\\strpos(\\strtolower($fileParts[\\count($fileParts) - 1]), 'interface')) {\n // Grab the name of the interface from its qualified name.\n $interfaceNameParts = \\explode('_', $fileParts[\\count($fileParts) - 1]);\n $interfaceName = $interfaceNameParts[0];\n\n $fileName = $interfaceName . '.php';\n }\n }\n\n // Now build a path to the file using mapping to the file location.\n $filepath = \\trailingslashit(\\dirname(\\dirname(__FILE__)) . $namespace);\n $filepath .= $fileName;\n\n // If the file exists in the specified path, then include it.\n if(\\file_exists($filepath)) {\n include_once($filepath);\n }\n }\n}",
"function __autoload($className){\n include_once \"Classes/$className.php\";\n}",
"function autoloadClass($classe)\n{\n require $classe . \".php\";\n}",
"function mapClassFiles( $directory )\n{\n global $_classFiles;\n static $ignore = array( 'Engine/System' );\n\n if ( in_array( $directory, $ignore ) )\n {\n return;\n }\n\n $dir = opendir( $directory );\n while ( ($entry = readdir( $dir ) ) )\n {\n if ( $entry[0] == '.' )\n {\n //ignore ., .., .svn, .git, etc\n continue;\n }\n $file = \"{$directory}/{$entry}\";\n if ( is_dir( $file ) )\n {\n mapClassFiles($file);\n }\n elseif ( is_file( $file ) && preg_match( ';(^|/)([^/]+)[.]inc$;', $file, $regs ) )\n {\n $_classFiles[$regs[2]] = $file;\n }\n }\n}",
"private function loadClasses()\n\t\t{\n\t\t\t// foreach($GLOBALS['classes'] as $var => $class)\n\t\t\t// {\n\t\t\t\t// $this->$var = $class;\n\t\t\t// }\n\t\t\t\n\t\t\t// $this->load = _new('loader');\n\t\t\t\n\t\t\t/** Registramos todos os objetos que serão necessários **/\n\t\t\tforeach(Registry::getAll() as $var => $object)\n\t\t\t{\n\t\t\t\t$this->$var = $object;\n\t\t\t}\n\t\t\t\n\t\t\t// E também a classe loader\n\t\t\t$this->load = Registry::get('loader');\n\t\t}",
"private function _discover() {\n\n $dir = new DirectoryIterator($this->dirname);\n\n foreach ($dir as $file) {\n\n if ($file->isFile() && !$file->isDot()) {\n\n $filename = $file->getFilename();\n $pathname = $file->getPathname();\n\n if (preg_match('/^(\\d+\\W*)?(\\w+)\\.php$/', $filename, $matches)) {\n require_once($pathname);\n $class = \"{$matches[2]}_{$this->suffix}\";\n $files[$filename] = new $class();\n }\n\n }\n\n }\n\n ksort($files);\n $plugins = array_values($files);\n\n return $plugins;\n\n }",
"function include_classes() {\n\t// Open the includes directory.\n\t$classes = scandir(ABSPATH . '/includes');\n\n\t// Loop through each subdirectory.\n\tforeach ($classes as $class) {\n\t\t// Skip directories.\n\t\tif (is_dir(ABSPATH . '/includes/' . $class)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Check for files matching class.*.php.\n\t\t$file_bits = explode('.', $class);\n\t\tif (count($file_bits) !== 3 || $file_bits[0] !== 'class' || $file_bits[2] !== 'php') {\n\t\t\tcontinue;\n\t\t}\n\t\trequire_once(ABSPATH . '/includes/' . $class);\n\t}\n}",
"function autoloadClasses($className) {\n $filename = \"classes\\\\\" . strtolower($className) . \".class.php\";\n $filename = str_replace('\\\\', DIRECTORY_SEPARATOR, $filename);\n if (is_readable($filename)) {\n include_once $filename;\n } else {\n throw new exception(\"File not found: \" . $className . \" (\" . $filename . \")\");\n logError($errstr);\n }\n }",
"static function autoload($class){\n require 'sources/dao/' . $class . '.class.php';\n require 'sources/dao/' . $class . '.model.class.php';\n require 'sources/controller/' . $class . '.controller.class.php';\n require 'sources/template/' . $class . '.template.php';\n }",
"private function load($className) {\r\n\t// TODO\r\n\t\t$folders = ['classes', 'model', 'controller', 'view'];\r\n\t\tforeach ($folders as $f) {\r\n\t\t\tif(is_readable(__ROOT_DIR.'/'.$f.'/'.ucfirst($className).'.class.php'))\r\n\t\t\t{\r\n\t\t\t\trequire_once(__ROOT_DIR.'/'.$f.'/'.ucfirst($className).'.class.php');\r\n\t\t\t\t// echo 'AutoLoader /'.$f.'/'.ucfirst($className).'.class.php<br>';\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function class_loader($class) {\n require('classes/' . $class . '.php');\n}",
"function cargarClases($classname)\n{\n require '../clases/' . $classname . '.php';\n}",
"function cargarClases($classname)\n{\n require '../clases/' . $classname . '.php';\n}",
"function autoloadClassesPerso($classe){\n $nomClasse = $classe;\n // On remplace les \\ du namespace par le caractère de séparation de dossier (windows : /, linux : \\), pour faire correspondre l'arborescence\n $classe = str_replace('\\\\', DIRECTORY_SEPARATOR, $classe).'.php';\n if(file_exists($classe)){ // Si le fichier existe\n require_once $classe; // On l'inclu\n if(!class_exists($nomClasse) && !trait_exists($nomClasse) && !interface_exists($nomClasse)){\n // Si le fichier ne contenait pas le/la class/trait/interface\n throw new ClasseException($nomClasse, ClasseException::CLASSE_ABSENTE);\n }\n return true;\n }\n elseif(file_exists(\"src/$classe\")){ // On regarde dans les fichiers du développeurs\n require_once \"src/$classe\"; // On l'inclu\n if(!class_exists($nomClasse) && !trait_exists($nomClasse) && !interface_exists($nomClasse)){\n // Si le fichier ne contenait pas le/la class/trait/interface\n throw new ClasseException($nomClasse, ClasseException::CLASSE_ABSENTE);\n }\n return true;\n }\n // Aucun fichier trouvé\n throw new ClasseException($classe, ClasseException::FICHIER_INTROUVABLE);\n}",
"protected static function _scanForPlugins(){\n\t\t$directory = __DIR__ . Config::$pluginsDirectory;\n\t\t$handle = opendir( $directory );\n\n\t\t// check to make sure we could open the directory handle\n\t\tif( !$handle )\n\t\t\treturn;\n\n\t\t// now begin looping through all of the contents of the plugin directory\n\t\twhile( ( $dir = readdir( $handle ) ) !== false ){\n\t\t\tif( $dir === '.' || $dir === '..' )\n\t\t\t\tcontinue;\n\n\t\t\t// now we need to verify that the current \"file\" is a directory before continuing\n\t\t\tif( !is_dir( $directory . $dir ) )\n\t\t\t\tcontinue;\n\n\t\t\t// expect a class file to exist in the format \"class-<DirectoryName>.php\"\n\t\t\t$classFile = $directory . $dir . '/' . $dir . '.php';\n\t\t\tif( !file_exists( $classFile ) )\n\t\t\t\tcontinue;\n\n\t\t\t// now actually include the code\n\t\t\trequire_once( $classFile );\n\n\t\t\t// now expect the class name to match whatever the $dir name was\n\t\t\tif( !class_exists( $dir ) )\n\t\t\t\tcontinue;\n\n\t\t\t// now we can instantiate the class name and store it now\n\t\t\tself::$_plugins[] = new $dir();\n\t\t}\n\t}",
"function __autoload($classe){\n\t$pontos = array(\"./\", \"../\", \"../../\");\n foreach($pontos AS $ponto){\n\t\tif(file_exists(\"{$ponto}class/{$classe}.class.php\")){\n\t\t\t//echo \"class/{$classe}.class.php\\n\";\n\t\t\tinclude_once \"{$ponto}class/{$classe}.class.php\";\n\t\t}\n\t}\n}",
"function autoload($classname)\n{\n if (file_exists($file = __DIR__ . '/' . $classname . '.php'))\n {\n require $file;\n }\n}",
"function loadLibrary($className) {\n $it = new RecursiveDirectoryIterator(dirname(__FILE__));\n $it = new RecursiveIteratorIterator($it);\n \n foreach ($it as $fileinfo) { \n if ($fileinfo->isFile() && $className.\".php\" === basename($fileinfo->getPathname()))\n require_once $fileinfo->getPathname();\n }\n}",
"function chargerclasses($class){\n require(\"../dao/\".$class.\".class.php\");\n }",
"function discoverExistingClasses($recursive = FALSE);",
"function __autoload($class_name) {\n require_once '/' . $class_name . '.php';\n}",
"protected function registerClasses()\n {\n // register helpers\n if ($path = $this->app->path->path('zlpath:helpers')) {\n $this->app->path->register($path, 'helpers');\n $this->app->loader->register('ZlHelper', 'helpers:zlhelper.php');\n }\n\n // register helpers\n if ($path = $this->app->path->path('zlfw:helpers')) {\n $this->app->path->register($path, 'helpers');\n $this->app->loader->register('zlfwHelper', 'helpers:zlfwhelper.php');\n $this->app->loader->register('ZLDependencyHelper', 'helpers:zldependency.php');\n $this->app->loader->register('ZlStringHelper', 'helpers:zlstring.php');\n $this->app->loader->register('ZlFilesystemHelper', 'helpers:zlfilesystem.php');\n $this->app->loader->register('ZlPathHelper', 'helpers:zlpath.php');\n $this->app->loader->register('ZlModelHelper', 'helpers:model.php');\n $this->app->loader->register('ZLXmlHelper', 'helpers:zlxmlhelper.php');\n $this->app->loader->register('ZLFieldHTMLHelper', 'helpers:zlfieldhtml.php');\n }\n\n // register classes\n if ($path = $this->app->path->path('zlfw:classes')) {\n $this->app->path->register($path, 'classes');\n $this->app->loader->register('ZLStorage', 'classes:zlstorage/ZLStorage.php');\n }\n\n // register elements fields\n if ($path = $this->app->path->path('zlfw:zlfield')) {\n $this->app->path->register($path, 'zlfield'); // used since ZLFW 2.5.8\n $this->app->path->register($path . '/fields/elements', 'zlfields'); // temporal until all ZL Extensions adapted\n $this->app->path->register($path . '/fields/elements', 'fields'); // necessary since ZOO 2.5.13\n }\n\n // register elements - order is important!\n if ($path = $this->app->path->path('zlfw:elements')) {\n $this->app->path->register($path, 'elements'); // register elements path\n\n $this->app->loader->register('ElementPro', 'elements:pro/pro.php');\n $this->app->loader->register('ElementRepeatablepro', 'elements:repeatablepro/repeatablepro.php');\n $this->app->loader->register('ElementFilespro', 'elements:filespro/filespro.php');\n }\n }",
"public static function register(): void\r\n {\r\n // Run the SPL autoloader\r\n spl_autoload_register([self::class, 'loadClass']);\r\n\r\n // Iterate through the PSR4 namespace array\r\n $namespaces = array_filter(self::$psr4);\r\n if ( ! empty($namespaces) ) {\r\n foreach ( self::$psr4 as $psr4 => $path ) {\r\n self::addNamespace($psr4, $path);\r\n }\r\n }\r\n // Iterate through the PSR4 classmap array\r\n $classmap = array_filter(self::$classmap);\r\n if ( ! empty($classmap) ) {\r\n foreach ( self::$classmap as $class => $file) {\r\n self::requireFiles(strpos($file, '.php')? $file: $file . '.php');\r\n }\r\n }\r\n }",
"function autoloader($class_name) {\n\n $array_paths = [\n '/models/',\n '/components/',\n '/controllers/',\n ];\n\n foreach ($array_paths as $path) {\n\n $path = ROOT . $path . $class_name . '.php';\n\n if (is_file($path)) {\n include_once $path;\n }\n }\n}",
"function autoload($class_name)\n{\n $class_name = ltrim($class_name, '\\\\');\n $file_name = '';\n $namespace = '';\n if ($last_ns_pos = strrpos($class_name, '\\\\')) {\n $namespace = substr($class_name, 0, $last_ns_pos);\n $class_name = substr($class_name, $last_ns_pos + 1);\n $file_name = str_replace('\\\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;\n }\n $file_name .= str_replace('_', DIRECTORY_SEPARATOR, $class_name) . '.php';\n\n require $file_name;\n}",
"function __autoload($classe){\n\t$pontos = array(\"./\", \"../\", \"../../\");\n foreach($pontos AS $ponto){\n\t\tif(file_exists(\"{$ponto}class/{$classe}.class.php\")){\n\t\t\t//echo \"{$ponto}class/{$classe}.class.php\\n\";\n\t\t\tinclude_once \"{$ponto}class/{$classe}.class.php\";\n\t\t}\n\t}\n}",
"function __autoload($classe){\n\t$pontos = array(\"./\", \"../\", \"../../\");\n foreach($pontos AS $ponto){\n\t\tif(file_exists(\"{$ponto}class/{$classe}.class.php\")){\n\t\t\t//echo \"{$ponto}class/{$classe}.class.php\\n\";\n\t\t\tinclude_once \"{$ponto}class/{$classe}.class.php\";\n\t\t}\n\t}\n}",
"function autoload($class)\n{\n // if file does not exist in LIBS_PATH folder [set it in config/config.php]\n //require dirname( __FILE__ ).'/../classes/PHPLogin.php';\n}",
"function autoloader($class_name)\r\n{\r\n\t//array of directories\r\n\t$directories\t\t\t\t\t\t= array(\r\n\t\t'classes/',\r\n\t\t'../classes/',\r\n\t\t'../../classes/',\r\n\t\t'lib/',\r\n\t\t'../lib/',\r\n\t\t'../../lib/',\r\n\t);\r\n\r\n\t\r\n\t//array of filename formats\r\n\t$file_name_formats\t\t\t\t\t= array(\r\n\t\t'%s.php'\r\n\t);\r\n\t\r\n\t// Iterate through directories\r\n\tforeach($directories as $directory)\r\n\t{\r\n\t\tforeach($file_name_formats as $file_name_format)\r\n\t\t{\r\n\t\t\t$file_path\t\t\t\t\t= $directory.sprintf($file_name_format,$class_name);\r\n\t\t\t//echo $file_path.\"<br>\";\r\n\t\t\tif(file_exists($file_path))\r\n\t\t\t{\r\n\t\t\t\t//echo '<br><br>this there => '.$file_path;\r\n\t\t\t\trequire_once $file_path;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n}",
"private static function loadServices() {\n\n Application::$services = array();\n\n $config = Application::getConfig();\n\n if ($handle = opendir($config[\"system\"][\"service-folder\"])) {\n\n /* Das ist der korrekte Weg, ein Verzeichnis zu durchlaufen. */\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n require $config[\"system\"][\"service-folder\"] . \"/\" . $entry;\n $className = $config[\"system\"][\"namespace\"] . \"\\\\services\\\\\" . basename($entry,\".php\");\n $testClass = new \\ReflectionClass($className);\n if (!$testClass->isAbstract()) {\n Application::$services[basename($entry,\".php\")] = new $className();\n }\n\n }\n }\n closedir($handle);\n }\n }",
"public function autoLoad($class) {\n\n $success = false;\n $filename = $class . '.php';\n\n /*\n * #1. Try and load the file by searching in the autoloaded directories\n */\n\n foreach ($this->directories as $start) {\n $file = \"{$start}/{$filename}\";\n if ($this->loadFile($file)) {\n $success = true;\n break;\n }\n }\n\n if (!$success) {\n\n /*\n * #2. Try and load the file by searching the aliases\n * Note: Here, we only search the Vendor directory!\n */\n\n $namespaces = ConfigLoader::instance()->autoload(\"namespaces\");\n $namespaceParts = explode(\"\\\\\", $filename); // Extract the file into different parts\n $size = count($namespaceParts); // Get the size of the parts array\n\n foreach ($namespaceParts as $key => $part) {\n unset($namespaceParts[--$size]);\n $namespaceKey = implode(\"\\\\\", $namespaceParts);\n\n if (array_key_exists($namespaceKey, $namespaces)) {\n $namespacePath = $namespaces[$namespaceKey];\n $actualFilePath = str_replace(\"\\\\\", '/',\n str_replace($namespaceKey, $namespacePath, $filename)\n );\n $success = $this->loadFile(VENDOR_DIR . \"/{$actualFilePath}\");\n $success = $success ? : $this->loadFile(ROOT_DIR . \"/{$actualFilePath}\");\n break;\n }\n }\n\n /*\n * #3. Default, try and search the current directory\n */\n if (!$success) {\n if (!$this->loadFile(__DIR__ . \"/{$filename}\")) {\n throw new \\Exception(self::UNABLE_TO_LOAD . ' ' . $class);\n }\n }\n }\n return $success;\n }",
"function autoload($class_name)\n{\n $exp_arr = explode('_', $class_name);\n if (count($exp_arr) === 1) {\n $folder = 'core';\n } else {\n $n = array_pop($exp_arr);\n $folder = $n . ($n[strlen($n) - 1] == 's' ? 'es' : 's');\n }\n switch($folder) {\n case \"controllers\":\n $arr = explode('_', $class_name);\n $sub_folder = array_shift($arr);\n $class_file = PROTECTED_DIR . $folder . DS . PROJECT . DS . $sub_folder . DS . $class_name . '.php';\n break;\n case \"helpers\":\n case \"templates\":\n $class_file = PROTECTED_DIR . $folder . DS . PROJECT . DS . $class_name . '.php';\n break;\n default:\n $class_file = PROTECTED_DIR . $folder . DS . $class_name . '.php';\n break;\n }\n if (file_exists($class_file)) {\n require_once($class_file);\n }\n}",
"function load_my_classes($_cls)\n{\n //echo '<hr />' . $_cls . '<hr />';\n $PATH_SEPARATOR = DIRECTORY_SEPARATOR;\n //$ROOTPATH = $_SERVER[\"DOCUMENT_ROOT\"];\n\t$ROOTPATH = dirname($_SERVER[\"SCRIPT_FILENAME\"]);\n\t\n\t//print_r($_SERVER);\n \n\t\n\n\n if(class_exists($_cls))\n {\n //doe niks, het is een ingebouwde class zoals \\SplObjectStorage o.i.d.\n }\n elseif(strpos($_cls, 'Exception') !== false)\n {\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . 'Exceptions.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n elseif(strpos($_cls, 'Common') === false)\n {\n $dirsToLookIn = Array(\"controller\", \"core\", \"model\", \"view\");\n \n foreach($dirsToLookIn as $dir)\n {\n if(strpos($_cls, __NAMESPACE__) !== false)\n {\n //namespace eraf strippen anders komt die mee in de padverwijzingen\n $_cls = substr($_cls, strlen(__NAMESPACE__)+1); \n }\n \n \n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . $dir . $PATH_SEPARATOR . $_cls . '.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n }\n else\n {\n $_cls = substr($_cls, 7);\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . $_cls . '.php';\n \n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n //echo '<hr />';\n}",
"public static function load(array $classes);",
"public static function compiles()\n {\n $dir = static::guessPackageClassPath('royalcms/repository');\n\n return [\n $dir . \"/Repositories/AbstractRepository.php\",\n $dir . \"/Traits/Cacheable.php\",\n $dir . \"/Contracts/RepositoryContract.php\",\n $dir . \"/RepositoryServiceProvider.php\",\n ];\n }",
"function cargarClases($ruta) {\n if (is_dir($ruta)) {\n if ($dh = opendir($ruta)) {\n while (($file = readdir($dh)) !== false) {\n if (is_dir($ruta.$file) && $file != \".\" && $file != \"..\") {\n if (strstr($file, \"clases\")) {\n //echo $ruta.$file;\n $clases = opendir($ruta.$file);\n while ($clase = readdir($clases)) {\n if (preg_match('/class\\.php$/',$clase)) {\n include_once($ruta.$file.'/'.$clase);\n //echo $ruta.$file.'/'.$clase.'<br/>';\n }\n }\n }//solo si el archivo es un directorio, distinto que \".\" y \"..\"\n\n cargarClases($ruta.$file.\"/\");\n }\n }\n closedir($dh);\n }\n }\n}",
"function autoload($class)\n{\n require dirname($_SERVER['SCRIPT_FILENAME']) . '//..//..//' . str_replace('\\\\', '/', $class) . '.php';\n}",
"function __autoload($class_name) {include $class_name . '.php';}",
"function chargerclasses($class){\n require(\"../dao/\".$class.\".class.php\");\n }",
"public static function autoload($class){\n // List the differents folders where to look for the class to load\n $directory = array( 'Model/', 'Controller/', 'View/');\n // Loop the search in all the specified folders\n foreach ($directory as $current_dir) {\n $file = $current_dir . $class .'.php';\n if(file_exists($file)){\n require_once $file;\n return;\n }\n }\n }",
"function my_autoloader($class) {\n require_once './../../classes/' . $class . '.php';\n}",
"private static function loadAllClassesOfDirectory($directory, $packageName) {\n\t\t// with PHP files in it. This can cause issues by loading classes twice.\n\t\tif (strpos($directory, '.svn') !== false) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$classes = array();\n\t\tif ($handle = opendir($directory)) {\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif (substr($file, -4) === '.php') {\n\t\t\t\t\t$className = $packageName . '_' . substr($file, 0, -4);\n\t\t\t\t\tif (!isset($classes[$className]) && !self::isClassLoaded($className)) {\n\t\t\t\t\t\trequire_once $directory . DIRECTORY_SEPARATOR . $file;\n\t\t\t\t\t}\n\t\t\t\t\t$classes[$className] = $className;\n\t\t\t\t}\n\t\t\t\telse if ($file !== '..' && $file !== '.' && is_dir($directory . DIRECTORY_SEPARATOR . $file)) {\n\t\t\t\t\t$classes = array_merge($classes, self::loadAllClassesOfDirectory($directory . DIRECTORY_SEPARATOR . $file, $packageName . '_' . $file));\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\n\t\treturn $classes;\n\t}",
"function __autoload($class_name) {\n include $class_name . '.php';\n}",
"function __autoload($class_name) {\n include $class_name . '.php';\n}",
"function __autoload($class_name) {\n include $class_name . '.php';\n}",
"function classes_autoloader($class) {\n\t\n\t$subforder = '';\n\t\n\tif (substr($class, -9) === 'Converter') {\n\t\t$subforder = 'converters/';\n\t} else if (substr($class, -4) === 'Skin') {\n\t\t$subforder = 'skins/';\n\t} else if (substr($class, -5) === 'Model') {\n\t\t$subforder = 'models/';\n\t} else if (substr($class, -9) === 'Validator') {\n\t\t$subforder = 'validators/';\n\t} else if (substr($class, -10) === 'Controller') {\n\t\t$subforder = 'actions/';\n\t} else if (substr($class, -7) === 'Service') {\n\t\t$subforder = 'services/';\n\t} else if (substr($class, -3) === 'Job') {\n\t\t$subforder = 'jobs/';\n\t} else if (substr($class, -11) === 'LoginMethod') {\n\t\t$subforder = 'loginmethods/';\n\t} else if (substr($class, -5) === 'Event') {\n\t\t$subforder = 'events/';\n\t} else if (substr($class, -6) === 'Plugin') {\n\t\t$subforder = 'plugins/';\n\t}\n\t\n\t@include(BASE_FOLDER . '/classes/' . $subforder . $class . '.class.php');\n}",
"public function load(): void\n {\n if ($this->paths->isEmpty()) {\n return;\n }\n\n foreach ((new Finder)->in($this->paths->toArray())->files() as $file) {\n $this->loadAction(\n $this->getClassnameFromPathname($file->getPathname())\n );\n }\n }",
"private function load_dependencies() {\n /**\n * \"BEHIND THE SCENCE\" CLASSES\n * Note: usually the admin and public do not directly use them, they are\n * necessary for the plugin (eg. i18n)\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-i18n.php';\n\n /* ADMIN */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-api.php';\n\n /* PUBLIC */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-public.php';\n }",
"function __autoload($className)\n{\n if (preg_match('/.*Dao$/', $className) > 0) {\n # Dao class\n if (file_exists(realpath(dirname(__FILE__)) . '/../dao/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../dao/' . $className . '.php');\n }\n } elseif (preg_match('/.*Manager$/', $className) > 0) {\n # Managers interfaces\n if (file_exists(realpath(dirname(__FILE__)) . '/../managers/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../managers/' . $className . '.php');\n }\n } elseif (preg_match('/.*Module$/', $className) > 0) {\n # Get the module name\n $moduleName = strtolower(preg_replace('/^(.*)Module$/', '\\1', $className));\n if (file_exists(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php');\n }\n } else {\n # Models\n if (file_exists(realpath(dirname(__FILE__)) . '/../model/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../model/' . $className . '.php');\n }\n }\n Utils::log(LOG_DEBUG, \"Class $className loaded\", __FILE__, __LINE__);\n}",
"function autoLoad() {\n\t$path = dirname(__FILE__);\n\n\t// Autoload manual important files\n\t$Autoload = array();\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Utils' . DIRECTORY_SEPARATOR . 'lexa-xml-serialization.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Client' . DIRECTORY_SEPARATOR . 'Builder' . DIRECTORY_SEPARATOR . 'PartyBuilder.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'ServiceConnection' . DIRECTORY_SEPARATOR . 'ServiceConnection.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'ServiceConnection' . DIRECTORY_SEPARATOR . 'Communication.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Client' . DIRECTORY_SEPARATOR . 'Party.php';\n\n\n\tforeach ($Autoload as &$a) {\n\t\tif (file_exists($a)) {\n\t\t\trequire_once($a);\n\t\t}\n\t}\n\n\n\t$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);\n\tforeach ($objects as $name => $object) {\n\t\tif (substr($object->getBasename(), strpos($object->getBasename(), \".\")) == '.php') {\n\t\t\tif (!stristr($object->getBasename(), 'test')) {\n\t\t\t\trequire_once($object->getPath() . DIRECTORY_SEPARATOR . $object->getBasename());\n\t\t\t}\n\t\t}\n\t}\n}",
"function __autoload($class)\n{\n $fileName = __DIR__ . '/' . str_replace('\\\\', '/', $class) . '.php';\n include ($fileName);\n}",
"public function loadClass($classname, $namespace = '\\\\', $path = '/');",
"public function load(): void\n {\n $requested = 0;\n $loaded = 0;\n foreach ($this->storage->loadClassList() as $class) {\n ++$requested;\n if ($this->accept($class) && !class_exists($class, false)) {\n ++$loaded;\n if ($this->verbose) {\n echo \"[Preloader] Loading {$class}\" . PHP_EOL;\n }\n class_exists($class, true);\n }\n }\n\n if ($this->verbose) {\n echo \"[Preloader] Preloaded {$loaded}/{$requested} classes\" . PHP_EOL;\n }\n }",
"function __autoload($class) {\n require ($class . '.php');\n}",
"function import_classes(){\n\t\n\tclass_exists('Database') || require('classes/class.Database.php');\n\tclass_exists('Response') || require('classes/class.Response.php');\n\tclass_exists('User') || require('classes/class.User.php');\n\tclass_exists('GUI') || require('classes/class.GUI.php');\n\tclass_exists('FileItem') || require('classes/class.FileItem.php');\n\tclass_exists('Comment') || require('classes/class.Comment.php');\n\tclass_exists('MLLib') || require('classes/class.MLLib.php');\n}",
"private function load_classes() {\n\n\t\t\trequire_once ASCRIPTA_ENGINE_ADMIN_PATH . 'class-ae-settings.php';\n\n\t\t}"
]
| [
"0.71837157",
"0.70366144",
"0.6998842",
"0.6647589",
"0.6437493",
"0.6348574",
"0.6333859",
"0.62995934",
"0.62761676",
"0.6193403",
"0.61278623",
"0.60921276",
"0.60921276",
"0.6089598",
"0.60854626",
"0.60782427",
"0.6067092",
"0.60565805",
"0.6049133",
"0.60489047",
"0.604617",
"0.60336035",
"0.6029672",
"0.6022245",
"0.6017108",
"0.60018367",
"0.5999315",
"0.5995052",
"0.598666",
"0.59606",
"0.59598595",
"0.59514636",
"0.59454167",
"0.5935643",
"0.59338486",
"0.59318644",
"0.59284395",
"0.5925913",
"0.5917522",
"0.5914514",
"0.59045976",
"0.5897674",
"0.5894295",
"0.5883219",
"0.5878679",
"0.58707875",
"0.5867042",
"0.585762",
"0.5841209",
"0.58371174",
"0.5835915",
"0.5824977",
"0.58133006",
"0.58071434",
"0.580698",
"0.5800171",
"0.5800171",
"0.57979804",
"0.57964385",
"0.57881355",
"0.5784595",
"0.5779196",
"0.5776692",
"0.5774851",
"0.5773523",
"0.57668245",
"0.5766382",
"0.5764511",
"0.57624453",
"0.5761591",
"0.5761591",
"0.5760476",
"0.5759927",
"0.5753272",
"0.57504386",
"0.574481",
"0.5742888",
"0.5739906",
"0.5738729",
"0.57333976",
"0.5732892",
"0.57262313",
"0.57213575",
"0.5718226",
"0.57139426",
"0.57115704",
"0.5708735",
"0.5708735",
"0.5708735",
"0.5705057",
"0.5698075",
"0.56955105",
"0.5694485",
"0.56872314",
"0.5684275",
"0.5680607",
"0.56790245",
"0.56786424",
"0.5677174",
"0.56731665"
]
| 0.57063 | 89 |
Display a listing of the resource. | public function __construct(){
Date::setLocale('es');
} | {
"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\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 $modules = Module::all();\n return Resource::collection($modules);\n }",
"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 Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\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 index()\n {\n $this->indexPage('list-product', 'List Product');\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 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 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 $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"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 $this->_list();\n\t}",
"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}",
"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 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 showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\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 return ProductResource::collection(Product::latest()->paginate(10));\n }",
"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 //\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.7446838",
"0.7361646",
"0.7299749",
"0.7246801",
"0.7163394",
"0.7148201",
"0.71318537",
"0.7104601",
"0.7101873",
"0.709985",
"0.70487136",
"0.69936216",
"0.6988242",
"0.69347453",
"0.68989795",
"0.68988764",
"0.68909055",
"0.68874204",
"0.68650436",
"0.6848891",
"0.6829478",
"0.6801521",
"0.67970383",
"0.6794992",
"0.678622",
"0.67595136",
"0.67416173",
"0.6730242",
"0.67248064",
"0.6724347",
"0.6724347",
"0.6724347",
"0.6717754",
"0.67069757",
"0.67046493",
"0.67045283",
"0.66652155",
"0.6662764",
"0.6659929",
"0.6659647",
"0.665744",
"0.6653796",
"0.66483474",
"0.6620148",
"0.6619058",
"0.66164845",
"0.6606442",
"0.66005665",
"0.65998816",
"0.6593891",
"0.6587057",
"0.6584887",
"0.65822107",
"0.65806025",
"0.6576035",
"0.65731865",
"0.6571651",
"0.65702003",
"0.6569641",
"0.6564336",
"0.65618914",
"0.65526754",
"0.6552204",
"0.6545456",
"0.653638",
"0.65332466",
"0.65329266",
"0.65268785",
"0.6525191",
"0.652505",
"0.65196913",
"0.6517856",
"0.6517691",
"0.65152586",
"0.6515112",
"0.6507232",
"0.65038383",
"0.65013176",
"0.64949673",
"0.6491598",
"0.6486873",
"0.64857864",
"0.6484881",
"0.6483896",
"0.64777964",
"0.6476692",
"0.64711976",
"0.6469358",
"0.64685416",
"0.64659655",
"0.6462483",
"0.6461606",
"0.6459046",
"0.6457556",
"0.6454214",
"0.6453915",
"0.64524966",
"0.64499927",
"0.6448528",
"0.6447461",
"0.6445687"
]
| 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view('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\t{\n\t\treturn view('loisier/create');\n\t}",
"public function create()\n {\n return view('url.form');\n }",
"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\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 {\n return view('saldo.form');\n }",
"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 $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\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 {\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\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"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.7594873",
"0.7594873",
"0.75862724",
"0.7577369",
"0.75727355",
"0.7500874",
"0.74348205",
"0.74339336",
"0.7389178",
"0.73531044",
"0.73364365",
"0.73124814",
"0.7296061",
"0.72818893",
"0.7274119",
"0.72423935",
"0.72292763",
"0.72266877",
"0.7187332",
"0.717915",
"0.7174258",
"0.7150343",
"0.7144378",
"0.7144238",
"0.7134942",
"0.7128289",
"0.71236694",
"0.7115823",
"0.7115823",
"0.7115823",
"0.7112145",
"0.70943975",
"0.70857024",
"0.70802104",
"0.70800203",
"0.7057187",
"0.7057187",
"0.7055648",
"0.7039616",
"0.7039533",
"0.7036246",
"0.70346695",
"0.70305556",
"0.7027626",
"0.7026509",
"0.70199776",
"0.7017972",
"0.70049554",
"0.7003876",
"0.7000925",
"0.69973546",
"0.6994639",
"0.69937307",
"0.69898754",
"0.6986977",
"0.69664884",
"0.6965616",
"0.69563985",
"0.6951776",
"0.69510984",
"0.69472855",
"0.69444585",
"0.6942343",
"0.69411284",
"0.69378203",
"0.69378203",
"0.6936664",
"0.69344825",
"0.69317704",
"0.69282645",
"0.69263744",
"0.6924216",
"0.6918314",
"0.6915855",
"0.69128567",
"0.6911424",
"0.6910289",
"0.69085616",
"0.6903973",
"0.6901382",
"0.6901172",
"0.6900354",
"0.6895054",
"0.6893486",
"0.6893189",
"0.68918854",
"0.6891604",
"0.6891604",
"0.6889186",
"0.6888053",
"0.6887076",
"0.6884677",
"0.68822217",
"0.6880916",
"0.6875967",
"0.68739045",
"0.6873874",
"0.6870332",
"0.6869766",
"0.68696475",
"0.6868746"
]
| 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\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)
{
//
} | {
"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)
{
//
} | {
"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($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($id)\n {\n return view('cataloguemodule::edit');\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 $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 displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\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($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\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(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"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 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\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.78561044",
"0.7695814",
"0.72755414",
"0.72429216",
"0.71737534",
"0.7064628",
"0.7056257",
"0.69859976",
"0.6949863",
"0.6948435",
"0.6942811",
"0.69298875",
"0.69032556",
"0.6900465",
"0.6900465",
"0.6880163",
"0.6865618",
"0.68620205",
"0.6859499",
"0.6847944",
"0.6837563",
"0.6812879",
"0.68089813",
"0.6808603",
"0.68049484",
"0.67966837",
"0.6795056",
"0.6795056",
"0.67909557",
"0.6787095",
"0.67825735",
"0.67783386",
"0.6771208",
"0.67658216",
"0.67488056",
"0.67488056",
"0.67481846",
"0.67474896",
"0.67430425",
"0.6737776",
"0.67283165",
"0.6715326",
"0.66959506",
"0.66939133",
"0.6690822",
"0.6690126",
"0.66885006",
"0.6687302",
"0.6685716",
"0.6672116",
"0.6671334",
"0.6667436",
"0.6667436",
"0.6664605",
"0.6663487",
"0.6662144",
"0.6659632",
"0.6658028",
"0.66556853",
"0.6645572",
"0.66350394",
"0.66338056",
"0.6630717",
"0.6630717",
"0.66214246",
"0.66212183",
"0.661855",
"0.6617633",
"0.6612846",
"0.66112465",
"0.66079855",
"0.65980226",
"0.6597105",
"0.6596064",
"0.6593222",
"0.65920717",
"0.6589676",
"0.6582856",
"0.65828097",
"0.6582112",
"0.6578338",
"0.65776545",
"0.65774703",
"0.6572131",
"0.65708333",
"0.65703875",
"0.6569249",
"0.6564464",
"0.6564464",
"0.65628386",
"0.6560576",
"0.6559898",
"0.65583706",
"0.6558308",
"0.6557277",
"0.65571105",
"0.6557092",
"0.6556115",
"0.655001",
"0.6549598",
"0.6547666"
]
| 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\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(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(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(IEntity $entity);",
"public function update($request, $id);",
"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 }",
"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 }",
"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 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 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 $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(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()\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);",
"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 put($path, $data = null);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\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(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.7424884",
"0.7062319",
"0.70572054",
"0.6897199",
"0.658233",
"0.6450576",
"0.6347209",
"0.6211253",
"0.6146092",
"0.6121878",
"0.6114851",
"0.61005586",
"0.608833",
"0.60537165",
"0.60196865",
"0.60068345",
"0.5972924",
"0.594671",
"0.5940615",
"0.5938648",
"0.58927333",
"0.58618903",
"0.5855116",
"0.5855116",
"0.58517504",
"0.5816175",
"0.5807103",
"0.5753658",
"0.5753658",
"0.57354003",
"0.5724066",
"0.5714874",
"0.56957984",
"0.5692136",
"0.5688278",
"0.5670771",
"0.5656715",
"0.5651525",
"0.5647887",
"0.563695",
"0.5635239",
"0.5633743",
"0.5633203",
"0.56296664",
"0.5622203",
"0.56089646",
"0.5602395",
"0.55937296",
"0.55837464",
"0.5582684",
"0.55814886",
"0.5575469",
"0.5572433",
"0.55668694",
"0.556366",
"0.5562336",
"0.55611396",
"0.55611396",
"0.55611396",
"0.55611396",
"0.55611396",
"0.5560869",
"0.55574787",
"0.55562645",
"0.5554329",
"0.5553793",
"0.5553788",
"0.55448633",
"0.55448294",
"0.5541889",
"0.55402213",
"0.5537772",
"0.55359083",
"0.55358595",
"0.55248064",
"0.5520229",
"0.5517453",
"0.5513332",
"0.5511126",
"0.55085385",
"0.5508433",
"0.5503835",
"0.5502763",
"0.5501662",
"0.5500294",
"0.5498694",
"0.5496697",
"0.5496697",
"0.5495247",
"0.5494445",
"0.5494331",
"0.549349",
"0.5492967",
"0.5484066",
"0.5480196",
"0.5479421",
"0.54788667",
"0.546669",
"0.5464114",
"0.54621613",
"0.5458347"
]
| 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $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 |
devolve numero de recursos removidos | public function destroy(int $id)
{
$qtdRemove = $this->class::destroy($id);
if ($qtdRemove === 0) {
return response()->json(
['erro' => 'Recurso não encontrado'],
404
);
}
return new JsonResponse('', 204);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unite_projets_supprimer_callback($form, &$form_state){\r\n if ($form_state['pro_nums'] > 1) {\r\n $form_state['pro_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function personne_projets_supprimer_callback($form, &$form_state){\r\n if ($form_state['pro_nums'] > 1) {\r\n $form_state['pro_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function eliminaRecursivo($dir) {\r\n\t\t$error=0;\r\n\t\tif (is_dir($dir)) {\r\n\t\t\t$cont=scandir($dir); //Recojemos todo el contenido del directorio\r\n\t\t\tforeach ($cont as $elem) {\r\n\t\t\t\t//Por cada elemento del contenido, si no es el . o los ..\r\n\t\t\t\tif ($elem != \".\" && $elem != \"..\") {\r\n\t\t\t\t\t//generamos la nueva ruta\r\n\t\t\t\t\t$ruta=$dir.\"/\".$elem;\r\n\t\t\t\t\tif (is_dir($ruta)){\r\n\t\t\t\t\t\t//si es un directorio volvemos a llamar a la funcion\r\n\t\t\t\t\t\t$error=$error+eliminaRecursivo($ruta); \r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//si no lo es, intentamos eliminar el archivo (o lo que sea)\r\n\t\t\t\t\t\tif(!unlink($ruta)){\r\n\t\t\t\t\t\t\t$error=$error+1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tunset($cont);//reseteamos la array de contenidos e intentamos eliminar el directorio\r\n\t\t\tif(!rmdir($dir)){\r\n\t\t\t\t$error=$error+1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error;\r\n\t}",
"function wbf_unite_projets_supprimer_callback($form, &$form_state){\r\n if ($form_state['pro_nums'] > 1) {\r\n $form_state['pro_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function wbf_personne_projets_supprimer_callback($form, &$form_state){\r\n if ($form_state['pro_nums'] > 1) {\r\n $form_state['pro_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function wbf_projet_fournitures_supprimer_callback($form, &$form_state){\r\n if ($form_state['frn_nums'] > 1) {\r\n $form_state['frn_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"public function obtener_recursos_nuevos($pagina = 1) {\n $recursos = LectorRecursos::obtenerRecursos();\n foreach ($recursos as $index => $re) {\n if ($this->exists('recurso = \\'' . $re['recurso'] . '\\'')) {\n unset($recursos[$index]);\n }\n }\n $recursos = LectorRecursos::paginar($recursos, $pagina, 6);\n $this->recursos_nuevos = $recursos->items;\n array_unshift($this->recursos_nuevos, null);\n return $recursos;\n }",
"function wbf_projet_personnes_supprimer_callback($form, &$form_state){\r\n if ($form_state['per_nums'] > 1) {\r\n $form_state['per_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function projet_personnes_supprimer_callback($form, &$form_state){\r\n if ($form_state['per_nums'] > 1) {\r\n $form_state['per_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function elimina(&$valores)\n {\n $this->iniVar();\n if (isset($this->bvictimacolectiva->_do->id_grupoper)) {\n $this->eliminaVic($this->bvictimacolectiva->_do, true);\n $_SESSION['fvc_total']--;\n }\n }",
"private function undo_cleanup_actions() {\n global $db;\n $elements_locked = array();\n $undo_nodes = $db->fetch_table(\"SELECT * FROM `\".$this->table.\"_undo` ORDER BY ID_UNDO DESC\");\n for ($i = 0; $i < count($undo_nodes); $i++) {\n $node = $undo_nodes[$i];\n foreach ($elements_locked as $id => $lock) {\n if (($node[\"FK_PARENT\"] == $id) ||\n (!$this->element_read($id)) ||\n ($this->element_is_child($node[\"FK_PARENT\"], $id)) ||\n ($this->element_is_child($node[\"FK_PARENT_PREV\"], $id))) {\n $db->querynow(\"DELETE FROM `\".$this->table.\"_undo` WHERE ID_UNDO=\".$node[\"ID_UNDO\"]);\n }\n }\n if ($node[\"ACTION\"] == \"MOVE\") {\n // Element wurde verschoben\n $elements_locked[$node[\"FK_PARENT\"]] = true;\n $elements_locked[$node[\"FK_PARENT_PREV\"]] = true;\n }\n }\n }",
"function projet_fournitures_supprimer_callback($form, &$form_state){\r\n if ($form_state['frn_nums'] > 1) {\r\n $form_state['frn_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"public function _unset() {\r\n\t\t$index = 0;\r\n\t\t$children = $this->_parent()->_children();\r\n\t\tforeach ($children as $child) {\r\n\t\t\tif ($child->identifier() == $this->identifier()) {\r\n\t\t\t\t$this->_parent()->_removeChildAtIndex($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$index++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $index;\r\n\t}",
"function unite_personnes_supprimer_callback($form, &$form_state){\r\n if ($form_state['per_nums'] > 1) {\r\n $form_state['per_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function prune ();",
"public function delete_list_requerimientos($aper_id){\n $insumos=$this->model_insumo->insumos_por_unidad($aper_id);\n $nro_ins=0;\n foreach ($insumos as $rowi) {\n /*--------- delete temporalidad --------*/\n $this->db->where('ins_id', $rowi['ins_id']);\n $this->db->delete('temporalidad_prog_insumo');\n\n $this->db->where('ins_id', $rowi['ins_id']);\n $this->db->delete('_insumoproducto');\n\n /*--------- delete Insumos --------*/\n $this->db->where('ins_id', $rowi['ins_id']);\n $this->db->delete('insumos');\n\n if(count($this->minsumos->get_insumo_producto($rowi['ins_id']))==0){\n $nro_ins++;\n }\n }\n\n return $nro_ins;\n }",
"function contarReprobados($espacios_por_cursar){\n $cantidad=0;\n if(count($espacios_por_cursar)>0){\n foreach ($espacios_por_cursar as $key => $espacio) {\n if($espacio['REPROBADO']==1){\n $cantidad++;\n \t }\n }\n }\n return $cantidad; \n }",
"function undo_op(log_op_move $log, tree $t): tree {\n $GLOBALS['undo_call_cnt'] ++; // for stats, not part of algo \n\n if(is_null($log->oldp)) {\n $t->rm_child($log->child_id);\n } else {\n $t->rm_child($log->child_id);\n\n $oldp = $log->oldp;\n $t->add_node($log->child_id, new tree_node($oldp->parent_id, $oldp->meta));\n }\n\n return $t;\n}",
"function removePacote($campos){\n\t\t\t$listDel = $campos['InputDelPacote'];\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($listDel)){\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<sizeof($listDel);$i++){\n\t\t\t\t\t\tif($listDel[$i] != 0){\n\t\t\t\t\t\t\t\t$sql = \" DELETE FROM vekttor_venda_pacote WHERE pacotes_id = '$listDel[$i]' AND vekttor_venda_id = '$campos[venda_id]'\";\n\t\t\t\t\t\t\t\t//echo $sql;\n\t\t\t\t\t\t\t\tmysql_query($sql);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t/*Seleciona os pacote para trazer os modulos */\n\t\t\t\t\t$sqlPacote = mysql_query($tn=\" SELECT * FROM pacote_item WHERE pacote_id = '$listDel[$i]' \");\n\t\t\t\t\t\twhile($pct=mysql_fetch_object($sqlPacote)){\n\t\t\t\t\t\t\t\t$modulos[] = $pct->sis_modulo_id;\n\t\t\t\t\t\t}\n\t\t\t\t} /*Fim de For*/\n\t\t\t\t\n\t\t\t\t\tfor($j=0;$j<sizeof($modulos);$j++){\n\t\t\t\t\t\t\t$sqlModulos = \" DELETE FROM usuario_tipo_modulo WHERE modulo_id = '$modulos[$j]' AND usuario_tipo_id = '$campos[id_usuario_tipo]'\";\n\t\t\t\t\t\t\tmysql_query($sqlModulos);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n}",
"function borrar_opciones(){\n $tuplas = $this->references(\"opcion\");\n foreach($tuplas as $valor){\n $eliminar=$this->Connection->DB->get_object_by_id(\"opcion\", $valor->id_opcion);\n $eliminar->delete();\n }\n }",
"function vistaportal_references_remove($form, &$form_state) {\n if ($form_state['references_count'] > 6) {\n $form_state['references_count']--;\n }\n $form_state['rebuild'] = TRUE;\n }",
"function wbf_unite_personnes_supprimer_callback($form, &$form_state){\r\n if ($form_state['per_nums'] > 1) {\r\n $form_state['per_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function borrar_posts_previos($tipo)\n{\n $args = array(\n 'post_type' => $tipo,\n 'posts_per_page' => -1,\n );\n\n // Query\n $query = new WP_Query($args);\n\n // Contador de posts borrados\n $count = 0;\n\n if ($query->have_posts()): while ($query->have_posts()): $query->the_post();\n\n $id = get_the_ID();\n\n wp_delete_post($id);\n\n $count++;\n\n endwhile;endif;\n wp_reset_postdata();\n\n return $count;\n\n}",
"function inscription_jesa_link_remove_child($form, &$form_state) {\n if ($form_state['num_stagiaires'] > 1) {\n $form_state['num_stagiaires']--;\n }\n\n // Setting $form_state['rebuild'] = TRUE causes the form to be rebuilt again.\n $form_state['rebuild'] = TRUE;\n}",
"public function eliminarNRC()\r\n {\r\n $nrc = $this->input->post('nrc');\r\n\r\n if ($nrc)\r\n {\r\n $bloques = $this->Nrc_model->get($nrc);\r\n $horario = $this->session->horario;\r\n $materias = $this->Materias_model->get();\r\n\r\n foreach ($materias as $materia)\r\n {\r\n foreach ($materia['secciones'] as $seccion)\r\n {\r\n if ($seccion['nrc'] == $nrc)\r\n {\r\n $creditos = $materia['creditos'];\r\n $id = $materia['id'];\r\n break 2;\r\n }\r\n }\r\n }\r\n\r\n foreach ($bloques as $bloque)\r\n {\r\n $horario[$bloque[0]][$bloque[1]] = null;\r\n }\r\n\r\n $this->toggle_enabled($id);\r\n $this->session->set_userdata('horario', $horario);\r\n $this->session->set_userdata('creditos', $this->session->creditos - $creditos);\r\n }\r\n }",
"public function eliminar($objeto){\r\n\t}",
"function setRestarPais(){\n\t\t$this->cantidad_paises--;\n\t}",
"public function gera_pagamentos_renovacao()\n {\n $this->FinanceiroPagamento->geraPagamentoRenovacaoMatriculas();\n }",
"function eliminar($bd);",
"public function remover() {\n \n $queryVerificaInscricao = '\n select * from tb_inscricao_atividade where id_atividade = :id_atividade \n ';\n \n $stmtInscAtt = $this->conexao->prepare($queryVerificaInscricao);\n $stmtInscAtt->bindValue(':id_atividade', $_GET['id_att']);\n $stmtInscAtt->execute();\n \n $inscAtt = $stmtInscAtt->fetchAll(PDO::FETCH_OBJ);\n \n // echo '<pre>';\n // print_r($inscAtt);\n // echo '</pre>';\n \n if (!empty($inscAtt)) {\n foreach ($inscAtt as $inscAttInd) {\n $queryDeleteInscAtt = 'delete from tb_inscricao_atividade where \n id_atividade = :id_atividadeDel and \n id_evento = :id_eventoDel and \n id_usuario = :id_usuarioDel';\n \n $stmtInscAttDel = $this->conexao->prepare($queryDeleteInscAtt);\n $stmtInscAttDel->bindValue(':id_atividadeDel', $inscAttInd->id_atividade);\n $stmtInscAttDel->bindValue(':id_eventoDel', $inscAttInd->id_evento);\n $stmtInscAttDel->bindValue(':id_usuarioDel', $inscAttInd->id_usuario);\n $stmtInscAttDel->execute();\n }\n }\n\n $queryInscCupomAtt = '\n select * from tb_cupom where id_atividade = :id_atividadeCupDel\n ';\n\n $stmtInscCupomAtt = $this->conexao->prepare($queryInscCupomAtt);\n $stmtInscCupomAtt->bindValue(':id_atividadeCupDel', $_GET['id_att']);\n $stmtInscCupomAtt->execute();\n\n $cupomAtt = $stmtInscCupomAtt->fetchAll(PDO::FETCH_OBJ);\n\n // echo '<pre>';\n // print_r($cupomAtt);\n // echo '</pre>';\n\n if (!empty($cupomAtt)) {\n foreach ($cupomAtt as $cupomAttInd) {\n $queryDeleteCupomAtt = '\n delete from tb_cupom where id = :id_cupomDel\n ';\n\n echo $cupomAttInd->id;\n\n $stmtInscCupomAttDel = $this->conexao->prepare($queryDeleteCupomAtt);\n $stmtInscCupomAttDel->bindValue(':id_cupomDel', $cupomAttInd->id);\n $stmtInscCupomAttDel->execute();\n }\n }\n \n $query = '\n delete from tb_atividade \n where id = :id';\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id', $_GET['id_att']);\n\n return $stmt->execute();\n }",
"public function reset_rezultati()\n {\n $query = $this->query(\"SELECT * FROM rezultati;\");\n foreach ($query->getResultArray() as $row)\n {\n $this->delete($row['idrezultati']);\n }\n }",
"function dedupeFolders()\n{\n $do = new DB_DataObject();\n\n // Get a count before the operation:\n $countSql = \"SELECT DISTINCT * FROM work_folder\";\n $do->query($countSql);\n echo \"<p>Before: {$do->N}</p>\";\n\n // Find duplicate rows:\n $dupSql = \"SELECT *, count(*) AS c FROM work_folder GROUP BY work_id, folder_id HAVING c > 1\";\n $c = $do->query($dupSql);\n echo \"<p>Found {$do->N} duplicates...</p>\";\n\n while ($do->fetch()) {\n // Delete all but one in each set of duplicate rows:\n $do2 = new DB_DataObject();\n $count = $do->c - 1;\n $sql = \"DELETE FROM work_folder WHERE work_id={$do->work_id} AND folder_id={$do->folder_id} LIMIT {$count}\";\n $do2->query($sql);\n }\n\n // Get a count after the operation -- should match \"before\" number:\n $do->query($countSql);\n echo \"<p>After: {$do->N}</p>\";\n}",
"function eliminarpermiso()\n {\n $oconexion = new conectar();\n //se establece conexión con la base de datos\n $conexion = $oconexion->conexion();\n //consulta para eliminar el registro\n $sql = \"UPDATE permiso SET eliminado=1 WHERE id_permiso=$this->id_permiso\";\n // $sql=\"DELETE FROM estudiante WHERE id=$this->id\";\n //se ejecuta la consulta\n $result = mysqli_query($conexion, $sql);\n return $result;\n }",
"public function borrarExamen($idExamen){\n $funciona=false;\n //comprobamos si se ha conectado a la base de datos\n $preguntas = $this->cargaUnicoExamenPreguntas($idExamen, true);\n foreach ($preguntas as $pregunta) {\n $sqlReferencia = \"UPDATE `preguntas` SET `referencias` = `referencias` - 1 WHERE id=\".$pregunta['id_pregunta'];\n $this->query($sqlReferencia);\n }\n $sql = \"DELETE FROM examenes WHERE id=\".$idExamen;\n $this->query($sql);\n $funciona=true;\n echo $funciona;\n }",
"function eliminar_insumos($objeto){\n\t\t$sql=\"\tDELETE FROM\n\t\t\t\t\t app_producto_material\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto =\".$objeto['id'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}",
"function wbf_projet_financements_supprimer_callback($form, &$form_state){\r\n if ($form_state['fin_nums'] > 1) {\r\n $form_state['fin_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function wbf_projet_domaines_supprimer_callback($form, &$form_state){\r\n if ($form_state['dom_nums'] > 1) {\r\n $form_state['dom_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function projet_domaines_supprimer_callback($form, &$form_state){\r\n if ($form_state['dom_nums'] > 1) {\r\n $form_state['dom_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function borrar_directorio($id_dir,$id_usuario,$parent,$ruta) {\n\t\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\t\t\n\t\t$query2 = \"SELECT * FROM repositorio_directorios\n\t\tWHERE ruta_dir LIKE '$ruta%' AND id_usuario='$id_usuario'\";\n\t\t$result2 = mysql_query($query2); \n\t\t\n\t\twhile ($row2=mysql_fetch_array($result2)) {\n\t\t\n\t\t\t$id_directorio=$row2['id'];\n\t\t\t$qDelete4 = \"DELETE FROM repositorio_archivos WHERE id_directorio='$id_directorio' AND id_usuario='$id_usuario'\";\n\t\t\t$result4 = mysql_query($qDelete4);\n\t\t\t$qDelete = \"DELETE FROM repositorio_directorios WHERE id='$id_directorio' AND id_usuario='$id_usuario'\";\n\t\t\t$result = mysql_query($qDelete);\n\t\t\n\t\t}\n\t\t\n\t\tmysql_close($connection);\n\t\t \t\n\t}",
"static public function ctrEliminarReceta($receta){\n\n $idReceta = $receta;\n $tabla = \"Receta\";\n $tablaRecetaDetalle = \"RecetaDetalle\";\n\n //ELIMINAMOS PRIMERO EL DETALLE DE LA VENTA\n\n $eliminoDetalle = ModeloRecetas::mdlEliminarDetalleReceta($tablaRecetaDetalle, $idReceta);\n\n //ELIMINAMOS LA RECETA\n\n $respuesta = ModeloRecetas::mdlEliminarReceta($tabla, $idReceta); \n\n if($respuesta==\"ok\"){\n\n echo 0;\n\n }else{\n\n echo 1;\n\n }\n }",
"function rm_r ($what)\n{\n\tif (!is_dir($what))\n\t\tunlink($what);\n\telse\n\t{\n\t\t$dir = getTreeStructure($what, GTS_ALL, GTS_SHALLOW);\n\t\t\n\t\tfor($i=0; $i<count($dir); $i++)\n\t\t\trm_r($what . '/' . $dir[$i]);\n\t\t\n\t\trmdir($what);\n\t}\n}",
"public function EliminarDetallesVentas()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\n\t\t$sql = \" select * from detalleventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql2);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t$sql = \" update productos set \"\n\t.\" existencia = ? \"\n\t.\" where \"\n\t.\" codproducto = ?;\n\t\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1, $existencia);\n\t$stmt->bindParam(2, $codproducto);\n\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$existencia = $existenciadb + $cantventa;\n\t$stmt->execute();\n\n\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$coddetalleventa);\n\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$codventa);\n\t$stmt->bindParam(2,$codproducto);\n\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\n if($num>0) {\n\n$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\t\t }\n}\n############ FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ##############\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t$totaldb = $paea[0][\"totalpago\"];\n\t\t$montopagado = $paea[0][\"montopagado\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = ($pae[0][\"preciocompra\"]== \"\" ? \"0\" : $pae[0][\"preciocompra\"]);\n\t\t$importeivasi = ($pae[0][\"importe\"]== \"\" ? \"0\" : $pae[0][\"importe\"]);\n\t\t$importe2si = ($pae[0][\"importe2\"]== \"\" ? \"0\" : $pae[0][\"importe2\"]);\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $roww;\n\t\t\t}\n\t\t$preciocompra = ($roww[\"preciocompra\"]== \"\" ? \"0\" : $roww[\"preciocompra\"]);\n\t\t$importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\t\t$importe2 = ($roww[\"importe2\"]== \"\" ? \"0\" : $roww[\"importe2\"]);\n\t\t\nif(base64_decode($_GET[\"ivaproducto\"])==\"SI\"){\t\n\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentove);\n\t\t$stmt->bindParam(4, $totalpago);\n\t\t$stmt->bindParam(5, $devuelto);\n\t\t$stmt->bindParam(6, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t\t } else {\n\n $sql = \" update ventas set \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentove);\n\t\t$stmt->bindParam(3, $totalpago);\n\t\t$stmt->bindParam(4, $devuelto);\n\t\t$stmt->bindParam(5, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasive+$totalivave,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t } \n\necho \"<div class='alert alert-info'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\necho \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\necho \"</div>\";\nexit;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\tif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $roww;\n\t\t\t}\n\t\t$totaldb = $roww[\"totalpago\"];\n\n\t\t$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\tif (isset($row['ingresos'])) { $ingreso = $row['ingresos']; } else { $ingreso ='0.00'; }\n\t\t//$ingreso = $row['ingresos'];\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$txtTotal = rount($ingreso-$totaldb,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t$sql = \" update mesas set \"\n\t\t.\" statusmesa = ? \"\n\t\t.\" where \"\n\t\t.\" codmesa = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $statusmesa);\n\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t$statusmesa = strip_tags('0');\n\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t$stmt->execute();\n\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\n\techo \"</div>\";\n\texit;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR DETALLES EN VENTAS, NO ERES EL ADMINISTRADOR DEL SISTEMA</center>\";\n\techo \"</div>\";\n\texit;\n\t\t}\n\t}",
"public function delete_operaciones(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $proy_id = $this->security->xss_clean($post['proy_id']);\n $pfec_id = $this->security->xss_clean($post['pfec_id']);\n $com_id = $this->security->xss_clean($post['com_id']);\n\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); \n\n $nro=0; $nro_ins=0;\n if (!empty($_POST[\"req\"]) && is_array($_POST[\"req\"]) ) {\n foreach ( array_keys($_POST[\"req\"]) as $como){\n /*--------- delete Insumosproducto --------*/\n $insumos = $this->model_producto->insumo_producto($_POST[\"req\"][$como]); /// Insumo del producto\n foreach ($insumos as $rowi) {\n /*--------- delete temporalidad --------*/\n $this->db->where('ins_id', $rowi['ins_id']);\n $this->db->delete('temporalidad_prog_insumo');\n\n $this->db->where('prod_id', $_POST[\"req\"][$como]);\n $this->db->where('ins_id', $rowi['ins_id']);\n $this->db->delete('_insumoproducto');\n\n /*--------- delete Insumos --------*/\n $this->db->where('ins_id', $rowi['ins_id']);\n $this->db->delete('insumos');\n\n if(count($this->minsumos->get_insumo_producto($rowi['ins_id']))==0){\n $nro_ins++;\n }\n }\n\n /*------ delete Productos -----*/\n $this->db->where('prod_id', $_POST[\"req\"][$como]);\n $this->db->delete('prod_programado_mensual');\n\n /*------ delete Productos -----*/\n $this->db->where('prod_id', $_POST[\"req\"][$como]);\n $this->db->delete('_productos');\n \n \n $prod=$this->model_producto->get_producto_id($_POST[\"req\"][$como]);\n if(count($prod)==0){\n $nro++;\n }\n \n }\n\n $this->session->set_flashdata('success','SE ELIMINO CORRECTAMENTE '.$nro.' OPERACIONES SELECCIONADOS y '.$nro_ins.' REQUERIMIENTOS ');\n redirect(site_url(\"\").'/admin/prog/list_prod/'.$com_id);\n }\n else{\n $this->session->set_flashdata('danger','ERROR AL ELIMINAR OPERACIONES');\n redirect(site_url(\"\").'/admin/prog/list_prod/'.$com_id);\n }\n }\n else{\n echo \"<font color=red><b>Error al Eliminar Operaciones</b></font>\";\n }\n }",
"function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }",
"function borrarrepetidosvaloresin($idmodelodetalle,$iddetalleingreso,$cantidadm,$iddetalleingreso,$tallafin,$tallafinal1,$talla1,$return = false ){\n //$sql[] = \"UPDATE historialkardextienda SET precio2bs='$precionuevo' WHERE idcalzado = '$iddetalleingreso'; \";\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidadm',cantidad='$cantidadm',generado='0' ,fallado='1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND (talla='$tallafin' OR talla='$tallafinal1');\";\n\n//MostrarConsulta($sqlA);\n ejecutarConsultaSQLBeginCommit($sqlA);\n}",
"abstract public function mass_remove();",
"function borrar ($arrayLineas,$id,$foto){\n $valorRetornado=false; \n foreach ($arrayLineas as $key => $value) {\n $auxArray= (array)$value; \n if($auxArray){\n if($auxArray[\"patente\"] === $id){\n var_dump($foto[\"name\"]);\n var_dump($auxArray[\"foto\"]);\n if($foto[\"name\"] !== $auxArray[\"foto\"] ){\n var_dump(\"./imagenes/\".$auxArray[\"foto\"]);\n //cambia de directorio la imagen vieja a backUpFotos, pero no la conserva.\n //rename(\"./imagenes/\".$auxArray[\"foto\"], './backUpFotos/'.$auxArray[\"patente\"].$auxArray[\"foto\"]);\n //cambia de directorio la imagen vieja a backUpFotos, pero la conserva en ambos directorios.\n copy(\"./imagenes/\".$auxArray[\"foto\"], './backUpFotos/'.$auxArray[\"patente\"].$auxArray[\"foto\"]);\n }\n unset($arrayLineas[$key]);\n $valorRetornado=true;\n break;\n }\n } \n } \n if($valorRetornado){\n echo(\"Se Removio: \".$id.\"\\n\\n\");\n }\n else{\n echo('No se encontro'.\"\\n\\n\");\n $arrayLineas=null;\n } \n return $arrayLineas;\n}",
"public function actiRecurDel($id,$recur) {\r\n\t\t$stmt = $this->db->prepare(\"DELETE FROM resources_activity WHERE actividad=? AND recurso=?\");\r\n\t\t$stmt->execute(array($id,$recur));\r\n\t}",
"public function sweep(): int\n {\n $pruning = 0;\n foreach ($this->items as $key => $item) {\n if (null === $item) {\n // Item was removed from memory, delete from cache\n $this->delete($key);\n $pruning++;\n } elseif ($item instanceof Part) {\n // Skip ID related to Bot\n if ($key != $this->discord->id) {\n // Item is no longer used other than in the repository, weaken so it can be garbage collected\n $this->items[$key] = WeakReference::create($item);\n }\n }\n }\n if ($pruning) {\n $this->discord->getLogger()->debug('Pruning repository cache', ['count' => $pruning, 'class' => $this->class]);\n }\n\n return $pruning;\n }",
"function eliminarDirectorio($directorio,$rutaActual){\n\t$carpeta = @scandir($rutaActual.\"/\".$directorio);\n\tif (count($carpeta) > 2){\n\t echo \"El directorio contiene Archivos, verifique la informacion\";\n\t}else{\n\t if(rmdir($rutaActual.\"/\".$directorio)){\n\t\techo \"<script type='text/javascript'> abrirDirectorio('\".$rutaActual.\"'); </script>\";\n\t }else{\n\t\techo \"<script type='text/javascript'> alert('Error al ejecutar la operacion'); </script>\";\n\t }\n\t}\n }",
"function projet_financements_supprimer_callback($form, &$form_state){\r\n if ($form_state['fin_nums'] > 1) {\r\n $form_state['fin_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function gaus_jordan_metoda_eliminacije_pokusaj_2($niz_cvorovi, $tacke_x) // $matrica, \n{\n\t// ------------------------------------- Priprema matrice -----------------------------------//\n\n\t// FORMIRANJE MATRICE NA OSNOVU CVOROVA\n\t// $niz_cvorovi = niz_cvorovi($cvorovi);\n // $niz_tacke = niz_tacke($tacke_x);\n $niz_tacke = $tacke_x;\n // sortirani cvorovi po x vrednosti u rastucem poretku radi formiranja intervala\n $niz_cvorovi = sortiranje_cvorova_po_intervalu($niz_cvorovi);\n\n $niz_intervali = niz_intervali($niz_cvorovi);\n // var_dump($niz_intervali);\n $matrica = formiranje_matrice($niz_cvorovi, $niz_intervali);\n\n // -----------------------------------------------------------------------------------------//\n\n\n\t//---------------------------------- RESAVANJE SISTEMA JEDNACINA(matrice) ------------------//\n\n\t$matrica = sort_gl_dijagonala($matrica);\n\t// echo ( napravi_tabelu( $matrica ) );\n\t// exit();\n\n\t// echo ( napravi_tabelu( zaokruzi_koeficijente_za_prikaz ($matrica) ) );\n\t// exit();\n\n\t$matrica = gauss_nuliranje_matrice($matrica);\n\n\t$matrica = jordan_nuliranje_matrice($matrica);\n\n\n\t// -----------------------------------------------------------------------------------------//\n\n\n\t//------------------------ Formiranje konacnih formula za odgovarajuce intervale -----------//\n\n\t$niz_koeficijenata_sa_vrednostima = niz_koeficijenata_sa_vrednostima($matrica);\n\t$abc_grupe = abc_grupe($niz_koeficijenata_sa_vrednostima);\n\t// var_dump($abc_grupe);\n\t// var_dump($niz_koeficijenata_sa_vrednostima);\n\t$formule = formiraj_string_formula_sa_intervalima($niz_koeficijenata_sa_vrednostima);\n\n\t// ispisi formule\n\tfor($form = 1; $form <= count($formule); $form++)\n\t{\n\t\t$formula_str = $formule[$form];\n\t\t$interval_levi = $niz_intervali[$form - 1][0];\n\t\t$interval_desni = $niz_intervali[$form - 1][1];\n\t\techo \"Interval {$form}. je [{$interval_levi}, {$interval_desni}], a formula: {$formula_str} \" . \"<br>\";\n\t}\n\techo \"<br>\";\n\t// -----------------------------------------------------------------------------------------//\n\n\n\t// ------------------------------------Interpolacija----------------------------------------//\n\t$niz_interpoliranih_tacaka = array();\n\tif(!empty($niz_tacke))\n\t{\n\t\tfor($x = 0; $x < count($niz_tacke); $x++)\n\t\t{\n\t\t\t// kriva\n\t\t\t$kr = u_kom_intervalu_je_input($niz_intervali, $niz_tacke[$x]) + 1; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\t\t\t// Pn(x)\t=\t\t\t x * x * An + x * Bn + Cn \n\t\t\t$vrednost_y = ( $niz_tacke[$x] * $niz_tacke[$x] * $abc_grupe[$kr][0] ) + ( $niz_tacke[$x] * $abc_grupe[$kr][1] ) + $abc_grupe[$kr][2];\n\t\t\t$niz_interpoliranih_tacaka[] = array($niz_tacke[$x], $vrednost_y);\n\n\t\t\t// $prvi = $niz_intervali[$u_kom_intervalu_je_input][0];\n\t\t\t// $drugi = $niz_intervali[$u_kom_intervalu_je_input][1];\n\t\t\t// $t = $niz_tacke[$x];\n\t\t\t// echo \"{$x}. tacka - {$t} - je u intervalu: {$prvi}, {$drugi}\" . \"<br>\";\n\t\t}\n\t}\n\n\t// -----------------------------------------------------------------------------------------//\n\n\treturn array($matrica, $niz_interpoliranih_tacaka);\n\t\n}",
"private function verificaRemover() {\n if (isset($_POST['removerCat'])) {\n return $this->model->removerCategoria($this->idCategoria);\n }\n return 0;\n }",
"public function eliminaReserva($cod) {\n // 1ro actualizamos la existencia de los productos adicionando lo que no se ha vendido\n $modelocantidad = $this->db->query(\"SELECT p.modelo,(d.cantidad+p.existencia) as existencia FROM producto p,detalle_venta d WHERE p.modelo LIKE d.modelo AND d.cod_venta LIKE '\" . $cod . \"';\")->result_array(); //obtenemos los datos del detalle\n if (sizeof($modelocantidad) > 0) {\n //actualizamos la existencia en producto\n $this->db->update_batch('producto', $modelocantidad, 'modelo');\n if ($this->db->affected_rows() > 0) {\n //3ro eliminamos el detalle de venta de la venta\n $this->db->query(\"delete from detalle_venta where cod_venta like '\" . $cod . \"'\");\n if ($this->db->affected_rows() > 0) {\n //eliminamos los datos de la venta\n $this->db->query(\"delete from venta where cod_venta like '\" . $cod . \"'\");\n if ($this->db->affected_rows() > 0) {\n return \"Exito! Se ha eliminado la reserva de\"; //el nombre se muestra en jquery\n } else {\n return \"Error: No se ha eliminado la reserva de\";\n }\n } else {\n return \"Error: No se ha eliminado el Detalle de la venta de\";\n }\n } else {\n return \"Error: No se ha actualizado la existencia de productos\";\n }\n } else {\n return \"No se tiene registro del detalle de la venta de\";\n }\n }",
"public function resumo() {\n $resultado = array(\n 'matriz' => $this->getTabuleiro(),\n 'dimensao' => $this->dimensao, \n 'palavras' => $this->quantidadePalavras,\n 'inseridos' => 0,\n 'falhas' => 0);\n $inseridos = 0;\n foreach ($this->palavras as $palavra) {\n array_push($resultado, $palavra->resumo());\n if ($palavra->direcao != INDEFINIDO) {\n $inseridos++;\n }\n }\n $resultado['inseridos'] = $inseridos;\n $resultado['falhas'] = $resultado['palavras'] - $inseridos;\n return $resultado;\n }",
"function del_barrio ($idbarrios) {\n // $idbarrios --> Identificador del barrio que se va a eliminar\n // Primero borramos las actividades y por lo tanto, primero las imagenes y los documentos de las actividades \n \n // Borramos las imagenes\n//OJO ??? // No la borramos del HD por si acaso\n $sql = \"SELECT idactividades FROM actividades WHERE idbarrio='\" . $idbarrios.\"'\";\n $resultado = $this -> db -> query($sql);\n foreach ($resutado->result() as $row) {\n $sql_borra_imagen = \"DELETE FROM imagenes WHERE idactividad ='\" . $row->idactividades.\"'\";\n $resultado_borrado = $this -> db -> query($sql_borra_imagen);\n } \n \n // Borramos los documentos\n //OJO ??? // No la borramos del HD por si acaso\n $sql = \"SELECT idactividades FROM actividades WHERE idbarrio='\" . $idbarrios.\"'\";\n $resultado = $this -> db -> query($sql);\n foreach ($resutado->result() as $row) {\n $sql_borra_documento = \"DELETE FROM documentos WHERE idactividad ='\" . $row->idactividades.\"'\";\n $resultado_borrado = $this -> db -> query($sql_borra_documento);\n } \n \n\n // Ahora borramos las actividades\n $sql = \"DELETE FROM actividades WHERE idbarrio='\" . $idbarrios.\"'\";\n $resultado = $this -> db -> query($sql);\n\n // Y por ultimo el barrio\n $sql = \"DELETE FROM barrios WHERE idbarrios='\" . $idbarrios.\"'\";\n $resultado = $this -> db -> query($sql);\n }",
"protected function deleteChildren() {}",
"public function remove()\n \t{\n \t\tforeach( $this->pages as $page ) {\n\n \t\t\t$page->update( ['menu_id' => null] );\n\n \t\t}\n\n \t\treturn $this->delete();\n \t}",
"function reset() {\n\t\t$this->recursive = -1;\n\t\t$nodes = array_keys($this->Node->find('list', array(\n\t\t\t'conditions' => array('Node.id >' => 0),\n\t\t\t'order' => 'id',\n\t\t\t'recursive' => -1\n\t\t)));\n\t\tset_time_limit (max(count($nodes) / 10, 30));\n\t\t$this->unbindModel(array('belongsTo' => array('Node')), false);\n\t\t$order = 'Revision.id DESC';\n\t\t$fields = array('id');\n\t\tforeach ($nodes as $id) {\n\t\t\t$langs = $this->find('list', array(\n\t\t\t\t'fields' => array('lang', 'lang'),\n\t\t\t\t'conditions' => array('node_id' => $id)\n\t\t\t));\n\t\t\tforeach ($langs as $lang) {\n\t\t\t\t$conditions = array(\n\t\t\t\t\t'node_id' => $id,\n\t\t\t\t\t'lang' => $lang,\n\t\t\t\t\t'NOT' => array('status' => 'rejected')\n\t\t\t\t);\n\t\t\t\t$count = $this->find('count', compact('conditions'));\n\t\t\t\tif (!$count) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions['Revision.status'] = 'current';\n\t\t\t\tif ($this->find('count', compact('conditions')) === 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions['Revision.status'] = 'previous';\n\t\t\t\t$last = $this->find('first', compact('conditions', 'order', 'fields'));\n\t\t\t\tif (!$last) {\n\t\t\t\t\tunset($conditions['Revision.status']);\n\t\t\t\t\t$last = $this->find('first', compact('conditions', 'order', 'fields'));\n\t\t\t\t}\n\t\t\t\t$this->updateAll(array('status' => '\"current\"'), array('Revision.id' => $last['Revision']['id']));\n\t\t\t\t$conditions['Revision.status'] = 'current';\n\t\t\t\t$conditions['NOT'] = array('Revision.id' => $last['Revision']['id']);\n\t\t\t\t$this->updateAll(array('Revision.status' => '\"previous\"'), $conditions);\n\t\t\t}\n\t\t}\n\t}",
"public function quitarplus($cantidad);",
"public function countPrevSiblings();",
"function eliminar($objeto){\n\t\t$sql=\"\tUPDATE\n\t\t\t\t\tcom_recetas\n\t\t\t\tSET\n\t\t\t\t\tstatus = 2\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'].\";\n\n\t\t\t\tUPDATE\n\t\t\t\t\tapp_productos\n\t\t\t\tSET\n\t\t\t\t\tstatus = 0\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'].\";\n\n\t\t\t\tUPDATE\n\t\t\t\t\tapp_producto_material\n\t\t\t\tSET\n\t\t\t\t\tstatus = 0\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto = \".$objeto['id'].\";\";\n\t\t// return $sql;\n\t\t$result = $this->dataTransact($sql);\n\n\t\treturn $result;\n\t}",
"function deleteUnsaveNode()\n {\n //vymaze az po 2 hodinach ak sa nezmeni stav\n $list = $this->getFluent()->where(\"status = 'not_in_system' AND add_date < ( NOW() - 60*2 )\")->fetchAll();\n\n if (!empty($list)) {\n\n foreach ($list as $l) {\n\n $this->delete($l['id_node']);\n\n $module_name = $this->context->getService('ModuleContainer')->fetch($l['id_type_module'])->service_name;\n\n $this->context->getService($module_name)->delete($l['id_node']);\n }\n }\n }",
"function deletedrvs($val1,$val2)\t// elimina la identificacion\n\t{\n $obj_Gurpo=new Conexion();\n $query=\"delete from derivacion where id_exp=$val1 and id_drv=$val2\";\n\t\t\t$obj_Gurpo->consulta($query); // ejecuta la consulta para borrar la identificacion\n\t\t\treturn '<div id=\"mensaje\"><p/><h4>Se elimino la derivación con exito</h4></div>'; // retorna todos los registros afectados\n\n }",
"public function EliminarDetallesCompras()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\t\t$sql = \" select * from detallecompras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t$sql4 = \"select * from compras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t$subtotalivasic = $paea[0][\"subtotalivasic\"];\n\t\t$subtotalivanoc = $paea[0][\"subtotalivanoc\"];\n\t\t$iva = $paea[0][\"ivac\"]/100;\n\t\t$descuento = $paea[0][\"descuentoc\"]/100;\n\t\t$totalivac = $paea[0][\"totalivac\"];\n\t\t$totaldescuentoc = $paea[0][\"totaldescuentoc\"];\n\n\t$sql3 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'SI'\";\n $stmt = $this->dbh->prepare($sql3);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($rowp = $stmt->fetch())\n {\n $p[] = $rowp;\n }\n $importeivasi = ($rowp[\"importe\"]== \"\" ? \"0\" : $rowp[\"importe\"]);\n\n$sql5 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'NO'\";\n $stmt = $this->dbh->prepare($sql5);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($roww = $stmt->fetch())\n {\n $pw[] = $roww;\n }\n $importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\n if(base64_decode($_GET[\"ivaproductoc\"])==\"SI\"){\t\n\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivasic = ?, \"\n\t\t\t .\" totalivac = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentoc);\n\t\t$stmt->bindParam(4, $total);\n\t\t$stmt->bindParam(5, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanoc+$totaliva,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\n\t\t\n\t\t } else {\n\t\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivanoc = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentoc);\n\t\t$stmt->bindParam(3, $total);\n\t\t$stmt->bindParam(4, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasic+$totalivac,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\t\t\n\t\t }\t\t\t\t\t\n\n\t\theader(\"Location: detallescompras?mesage=2\");\n\t\texit;\n\n\t\t}\n\t\telse\n\t\t{\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from compras where codcompra = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$codcompra = base64_decode($_GET[\"codcompra\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t\theader(\"Location: detallescompras?mesage=2\");\n\t\t\texit;\n\t\t}\n\t}\n\telse\n\t{\n\t\theader(\"Location: detallescompras?mesage=3\");\n\t\texit;\n\t}\n}",
"private function suprimirByRecibo()\r\n\t\t{\r\n\t\t\t$result = false;\r\n\t\t\tif ( $this->_recibo > 0 ) {\r\n\t\t\t\t$arregloCondicion = [\r\n\t\t\t\t\t'recibo' => $this->_recibo,\r\n\t\t\t\t];\r\n\t\t\t\t$result = self::suprimir($arregloCondicion);\r\n\t\t\t}\r\n\t\t\treturn $result;\r\n\t\t}",
"function del_magic($id){\n if($id) { // *\n if ($id == $this->stop) { // if this comment is last and oldest\n $query = \"DELETE FROM comments WHERE ID=\".$id; // kill him witch special honors\n $this->my->query($query);\n } else {\n $query = \"SELECT PARENT_ID FROM comments WHERE ID=\".$id;\n try {\n $q = $this->my->query($query);\n $row = $q->fetch_assoc();\n $next_id = $row['PARENT_ID']; // dont forget to store ID of next victim\n $query = \"DELETE FROM comments WHERE ID=\".$id; // *\n $this->my->query($query); // kill\n $this->del_magic($next_id); // continue massacre\n } catch (mysqli_sql_exception $e) {\n echo $e;\n }\n }\n }\n }",
"public function decr(int $num)\n {\n\n if ($this->useTreeMap) {\n $count = $this->map[$num] ?? null;\n if ($count == 1) {\n unset($this->map[$num]);\n } else {\n $this->map[$num] = $count - 1;\n }\n // Fall back to simple arrays once we touch zero again\n if (count($this->map) == 0) {\n $this->useTreeMap = false;\n $this->upto = 0;\n }\n return;\n }\n\n for ($i = 0; $i < $this->upto; $i++) {\n if ($this->values[$i] == $num) {\n $this->counts[$i]--;\n if ($this->counts[$i] == 0) {\n $limit = $this->upto - 1;\n while ($i < $limit) {\n $this->values[$i] = $this->values[$i + 1];\n $this->counts[$i] = $this->counts[$i + 1];\n $i++;\n }\n $this->upto = $limit;\n }\n return;\n }\n }\n// assert false;\n if (true) {\n throw new \\AssertionError('FALSE'); //HAHA\n }\n }",
"function delete_recurso($proy_id,$ptofecg_id,$ffofet_id,$nro){\n $fase = $this->model_faseetapa->get_id_fase($proy_id);\n $lista_fases_gestion=$this->model_faseetapa->list_fases_gestiones($fase[0]['id']);\n foreach ($lista_fases_gestion as $row){\n // echo \"pfec id \".$row['pfec_id'].\" - \".$row['g_id'].\"<br>\";\n $this->db->where('ptofecg_id', $row['ptofecg_id']);\n $this->db->where('nro', $nro);\n $this->db->delete('_ffofet');\n }\n\n // $this->model_audi->store_audi('_ffofet',3,$ptofecg_id); \n\n $this->session->set_flashdata('success','SE ELIMINO CORRECTAMENTE EL RECURSO');\n redirect(site_url(\"admin\") . '/proy/ver_techo_ptto/'.$proy_id.'/'.$ptofecg_id.'/true');\n }",
"public function recurActi($id){\r\n\t\t$stmt = $this->db->prepare(\"SELECT recurso FROM resources_activity WHERE actividad=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t\t$recursos_acti = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$recur_NoActi = array();\r\n\t\t$arrayAux = array();\r\n\t\tif(!empty($recursos_acti)){\r\n\t\t\tforeach($recursos_acti as $rec){\r\n\t\t\t\t$stmt = $this->db->prepare(\"SELECT * FROM resources WHERE id=?\");\r\n\t\t\t\t$stmt->execute(array($rec[\"recurso\"]));\r\n\t\t\t\t$recs = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t\t\tforeach($recs as $r){\r\n\t\t\t\t\tarray_push($arrayAux, new Resource($r[\"id\"], $r[\"nombre\"], $r[\"aforo\"]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\tforeach($recursos_acti as $recurso_acti){\r\n\t\t\tif(empty($recurso_acti))\r\n\t\t\t\t$stmt = $this->db->prepare(\"SELECT * FROM resources\");\r\n\t\t\telse {\r\n\t\t\t\t$stmt = $this->db->prepare(\"SELECT * FROM resources WHERE id!=?\");\r\n\t\t\t\t$stmt->execute(array($recurso_acti[\"recurso\"]));\r\n\t\t\t}\r\n\t\t\t$recurs = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t\tforeach($recurs as $recur){\r\n\t\t\t\tif(!in_array( new Resource($recur[\"id\"], $recur[\"nombre\"], $recur[\"aforo\"]), $recur_NoActi))\r\n\t\t\t\t\tif(!in_array(\tnew Resource($recur[\"id\"], $recur[\"nombre\"], $recur[\"aforo\"]), $arrayAux))\r\n\t\t\t\t\t\tarray_push($recur_NoActi, new Resource($recur[\"id\"], $recur[\"nombre\"], $recur[\"aforo\"]));\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\r\n\t\t$stmt = $this->db->query(\"SELECT * FROM resources\");\r\n\t\t$recs = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\tforeach ($recs as $rec) {\r\n\t\t\tarray_push($recur_NoActi, new Resource($rec[\"id\"], $rec[\"nombre\"], $rec[\"aforo\"]));\r\n\t\t}\r\n\t}\r\n\t\treturn $recur_NoActi;\r\n\t}",
"function removeProcessoPronto(){\n\tunset($_SESSION['fila'][0]);\n\n\t/*REORGANIZA O ARRAY DE PROCESSOS PRONTOS*/\n\t$_SESSION['fila'] = array_values($_SESSION['fila']);\n}",
"protected function getTotalPartsToRemove()\n {\n // Init\n $ret = 0;\n\n // Get the total to remove\n $sql = \"SELECT count(*) AS total\n FROM parts AS p\n LEFT JOIN binaries AS b ON (b.ID = p.binaryID)\n WHERE b.ID IS NULL\";\n if( is_numeric( $this->settings['limit'] ) && 0 < $this->settings['limit'] )\n {\n $sql .= sprintf( ' AND p.dateadded < \"%s\" - INTERVAL %s HOUR', $this->settings['now'], $this->settings['limit'] );\n }\n \n $result = $this->db->queryOneRow( $sql );\n if( is_array($result) && array_key_exists('total', $result) )\n {\n $ret = (int)$result['total'];\n }\n\n // Return\n return $ret;\n }",
"public function removeFindThisAnywhere()\n\t{\n\t\tif(isset($this->masterArray[$this->ref_wildCard]))\n\t\t{\n\t\t\tunset($this->masterArray[$this->ref_wildCard]);\n\t\t}\n\t}",
"public function EliminarDetallesVentasPedidosProductos()\n{\t\t\n\tself::SetNames();\n\t$sql = \" select * from detalleventas where codventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num > 1)\n\t{\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n\n\n\t\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = $row[\"preciocompra\"];\n\t\t$importeiva = $row[\"importe\"];\n\t\t$importe2iva = $row[\"importe2\"];\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($rov = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $rov;\n\t\t\t}\n\t\t$preciocompra = $rov[\"preciocompra\"];\n\t\t$importe = $rov[\"importe\"];\n\t\t$importe2 = $rov[\"importe2\"];\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" totalpago2= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotalivasive);\n\t\t$stmt->bindParam(2, $subtotalivanove);\n\t\t$stmt->bindParam(3, $totaliva);\n\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t$stmt->bindParam(5, $total);\n\t\t$stmt->bindParam(6, $total2);\n\t\t$stmt->bindParam(7, $codventa);\n\t\t\n\t\t$subtotalivasive= rount($importeiva,2);\n\t\t$subtotalivanove= rount($importe,2);\n $totaliva= rount($subtotalivasive*$iva,2);\n\t\t$tot= rount($subtotalivasive+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t$total2= rount($preciocompra,2);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\n\t\t\t\t\t\tunset($_SESSION[\"CarritoVentas\"]);\n\n\t?>\n\t\t<script type='text/javascript' language='javascript'>\n\t alert('EL PEDIDO DE PRODUCTOS FUE ELIMINADOS, \\nDE LA MESA EXITOSAMENTE') \n </script> \n\t\t<?php \n\t\t\texit;\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t\t$stmt->execute();\n\n\t\t }\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\t\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$codventa = base64_decode($_GET[\"codventa\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t\t$stmt->execute();\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t\t$sql = \" update mesas set \"\n\t\t\t.\" statusmesa = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codmesa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusmesa);\n\t\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t\t$statusmesa = strip_tags('0');\n\t\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n?>\n\t\t<script type='text/javascript' language='javascript'>\n\t alert('LOS PEDIDOS DE PRODUCTOS HAN SIDO ELIMINADOS, \\nDE LA MESA EXITOSAMENTE') \n </script> \n\t\t<?php \n\t\texit;\n\t}\n}",
"public function EliminarPromociones($ids)\n {\n $resultado = array();\n $em = $this->getDoctrine()->getManager();\n\n if ($ids != \"\") {\n $ids = explode(',', $ids);\n $cant_total = 0;\n $cant_eliminada = 0;\n foreach ($ids as $promocion_id) {\n if ($promocion_id != \"\") {\n $cant_total++;\n $entity = $this->getDoctrine()->getRepository('IcanBundle:Promocion')\n ->find($promocion_id);\n if ($entity != null) {\n\n //Eliminar foto\n $foto_eliminar = $entity->getImagen();\n if ($foto_eliminar != \"\") {\n $dir = 'uploads/promociones/';\n if (is_file($dir . $foto_eliminar)) {\n unlink($dir . $foto_eliminar);\n //unlink($dir . \"portada-\" . $foto_eliminar);\n //unlink($dir . \"thumb-\" . $foto_eliminar);\n }\n }\n\n // Quitar descuento a los productos relacionados\n $productos = $this->getDoctrine()->getRepository('IcanBundle:Producto')\n ->ListarProductosDePromocion($promocion_id);\n foreach ($productos as $producto) {\n $producto->setPrecioEspecial(null);\n $producto->setPromocion(null);\n $producto->setPorciento(NULL);\n }\n\n $em->remove($entity);\n $cant_eliminada++;\n\n }\n }\n }\n }\n $em->flush();\n if ($cant_eliminada == 0) {\n $resultado['success'] = false;\n $resultado['error'] = \"No se pudo eliminar los promociones, porque tienen cotizaciones asociadas\";\n } else {\n $resultado['success'] = true;\n\n $mensaje = ($cant_eliminada == $cant_total) ? \"La operación se ha realizado correctamente\" : \"La operación se ha realizado correctamente. Pero atención no se pudo eliminar todos los promociones asociados porque tienen cotizaciones asociadas\";\n $resultado['message'] = $mensaje;\n }\n return $resultado;\n }",
"public function recursos()\n {\n return $this->hasMany(Recurs::class, 'tipus_recurs_id');\n }",
"function wbf_projet_localisations_supprimer_callback($form, &$form_state){\r\n if ($form_state['loc_nums'] > 1) {\r\n $form_state['loc_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"public function EliminarMovimientoCajas()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t$sql = \"select montoinicial, ingresos, egresos from arqueocaja where codcaja = '\".base64_decode($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\t$inicial = $row['montoinicial'];\n\t$ingreso = $row['ingresos'];\n\t$egreso = $row['egresos'];\n\nif(base64_decode($_GET[\"tipomovimientocaja\"])==\"INGRESO\"){\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $ingresos);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$entro = base64_decode($_GET[\"montomovimientocaja\"]);\n\t\t$ingresos = rount($ingreso-$entro,2);\n\t\t$codcaja = base64_decode($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\n} else {\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" egresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $egresos);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$salio = base64_decode($_GET[\"montomovimientocaja\"]);\n\t\t$egresos = rount($egreso-$salio,2);\n\t\t$codcaja = base64_decode($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n }\n\n\t\t$sql = \" delete from movimientoscajas where codmovimientocaja = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codmovimientocaja);\n\t\t$codmovimientocaja = base64_decode($_GET[\"codmovimientocaja\"]);\n\t\t$stmt->execute();\n\n\t\theader(\"Location: movimientoscajas?mesage=1\");\n\t\texit;\n\n\t} else {\n\n\t\theader(\"Location: movimientoscajas?mesage=2\");\n\t\texit;\n\t} \n}",
"public function test()\n {\n // $children = $this->get_childs([396]);//408 648\n $children = $this->get_childs([397]);\n // $children = $this->get_childs([398]);\n // $children = $this->get_childs([401]);\n // $children = $this->get_childs([402]);#\n // $children = $this->get_childs([403]);\n // $children = $this->get_childs([406]);\n \t// $children = $this->get_childs([407]);\n dump($this->childs);\n dump($this->childs_data);die;\n \t$num = 0;\n Db::startTrans();\n try {\n foreach ($children as $key => $value) {\n // $num += count($value);\n if($value){\n db('user_position')->where(['uid'=>['in',$value]])->delete();\n foreach ($this->childs_data[$key] as $k => $v) {\n $this->position($v['id'],$v['pid']);\n }\n }\n }\n Db::commit(); \n } catch (\\Exception $e) {\n throw new \\Exception($e);\n Db::rollback();\n }\n \n \t\n // dump($num);\n dump('success');\n }",
"public function reversal()\n {\n }",
"public function eliminaPedido($codpedido) {\n $sql = \"SELECT elementoPedido_elementoPedido_id\n FROM tieneElemento\n WHERE pedido_pedido_id = $codpedido\";\n $result = $this->bd->query($sql);\n $numfilas = $result->num_rows;\n /* Elimino las asociaciones del pedido con sus elementos */\n $sql2 = \"DELETE FROM tieneElemento\n WHERE pedido_pedido_id = $codpedido\";\n $result2 = $this->bd->query($sql2);\n /* Elimino los elementos del pedido, con sus elementos de cola y asociaciones */\n for($i=0; $i<$numfilas ; $i++) {\n $row = $result->fetch_assoc();\n $cod = $row[\"elementoPedido_elementoPedido_id\"];\n $sql3 = \"DELETE FROM asociaPlato\n WHERE elementoColaCocina_elementoPedido_elementoPedido_id = $cod\";\n $sql4 = \"DELETE FROM asociaBebida\n WHERE elementoColaBar_elementoPedido_elementoPedido_id = $cod\";\n $sql5 = \"DELETE FROM elementoColaCocina\n WHERE elementoPedido_elementoPedido_id = $cod\";\n $sql6 = \"DELETE FROM elementoColaBar\n WHERE elementoPedido_elementoPedido_id = $cod\";\n $sql7 = \"DELETE FROM elementoPedido\n WHERE elementoPedido_id = $cod\";\n $result3 = $this->bd->query($sql3);\n $result4 = $this->bd->query($sql4);\n $result5 = $this->bd->query($sql5);\n $result6 = $this->bd->query($sql6);\n $result7 = $this->bd->query($sql7);\n }\n /* Elimino el pedido y */\n $sql8 = \"DELETE FROM facturaPedido\n WHERE pedido_pedido_id = $codpedido\";\n// $sql9 = \"DELETE FROM pedido\n// WHERE pedido_id = $codpedido\";\n\n $result8 = $this->bd->query($sql8);\n// $result9 = $this->bd->query($sql9);\n }",
"function eliminarImagenSusQ($campo, $tabla, $idAsignacion)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/fotoSustanciasQuimicas/$nombreImagen\");\n echo \"OK\";\n }\n\n }",
"function projet_localisations_supprimer_callback($form, &$form_state){\r\n if ($form_state['loc_nums'] > 1) {\r\n $form_state['loc_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}",
"function tree_delete_rec($id) {\n global $CFG, $DB;\n\n $deleted = array();\n if (empty($id)) return $deleted; \n\n // echo \"deleting $id<br/>\";\n // getting all subnodes to delete if is tree.\n if ($istree) {\n $sql = \"\n SELECT \n id\n FROM \n {{$table}cognitivefactory_opdata}\n WHERE\n operatorid = 'hierarchize' AND\n itemdest = {$id}\n \";\n // deleting subnodes if any\n if ($subs = $DB->get_record_sql($sql)) {\n foreach ($subs as $aSub) {\n $deleted = array_merge($deleted, tree_delete_rec($aSub->id));\n }\n }\n }\n // deleting current node\n $DB->delete_records('cognitivefactory_opdata', array('id' => $id)); \n $deleted[] = $id;\n return $deleted;\n}",
"function eliminaRuta()\r\n\t{\r\n\t\t$query = \"DELETE FROM \" . self::TABLA . \" WHERE IdRuta = \".$this->IdRuta.\";\";\r\n\t\treturn parent::eliminaRegistro( $query);\r\n\t}",
"public function DeleteNotasImagenes() {\n\t\t\t$this->objNotasImagenes->Delete();\n\t\t}",
"function eliminarImagenArreglo($campo, $tabla, $llavePrimaria, $campoLlave)\n {\n $data=$this->analisisRiesgo->getNombreImagenTabla($campo, $tabla, $llavePrimaria, $campoLlave);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagenTabla($borrar, $tabla, $llavePrimaria, $campoLlave);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$campo/$nombreImagen\");\n echo \"OK\";\n }\n\n }",
"function removeProcessoPronto(){\n\tunset($_SESSION['processosProntos'][0]);\n\n\t/*REORGANIZA O ARRAY DE PROCESSOS PRONTOS*/\n\t$_SESSION['processosProntos'] = array_values($_SESSION['processosProntos']);\n}",
"public static function eliminarDocumentoCascada($idDocumento)\n {\n //Se iterra la lista y se busca si el lugar esta en otro documento y si está se borra solo la referencia\n //Si no se busca en la tabla obraLugar si hay un registro existente se elimina solo la referencia\n //si no se busca en la tabla LugarEtnia si hay registros se elimina la referencia si no se elimina solo el lugar\n //too hard :´v\n\n\n $documentoLugares= DocumentoLugar::where('fk_doc', $idDocumento)->get();\n\n foreach ($documentoLugares as $documentoLugar) {\n\n $auxNumDocumentoLugares=DocumentoLugar::where('fk_lugar',$documentoLugar->fk_lugar)->count();\n\n if($auxNumDocumentoLugares!=0){\n if($auxNumDocumentoLugares==1){\n\n $auxDocumentoLugar= DocumentoLugar::where('fk_lugar', $documentoLugar->fk_lugar)->first();\n $numObraLugar=ObraLugar::where('fk_lugar',$auxDocumentoLugar->fk_lugar)->count();\n\n if($numObraLugar==0){\n\n $numLugarEtnia=LugarEtnia::where('fk_lugar', $auxDocumentoLugar->fk_lugar)->count();\n\n if($numLugarEtnia==0){\n\n DocumentoLugar::where('fk_lugar', $documentoLugar->fk_lugar)->delete();\n Lugar::where('id_lugar', $documentoLugar->fk_lugar)->delete();\n return;\n }\n }\n DocumentoLugar::where('fk_lugar', $documentoLugar->fk_lugar)->delete();\n }else{\n DocumentoLugar::where('fk_lugar', $documentoLugar->fk_lugar)\n ->where('fk_doc', $idDocumento)\n ->delete();\n }\n }\n }\n }",
"function calcularReferencia(&$num){\n $num++;\n}",
"private function removeFilmsSinFuncionesDePeliculaxgenero(){\n \n $query = \n \"DELETE pg\n FROM peliculaxgenero pg\n LEFT JOIN funciones f\n ON pg.id_pelicula = f.id_pelicula\n WHERE f.id_pelicula IS NULL\";\n try{\n $this->connection = Connection::GetInstance();\n $this->connection->ExecuteNonQuery($query);\n\n } catch (Exception $ex){ \n throw $ex;\n }\n }",
"function eliminarDirectorio($directorio){\n foreach(glob($directorio . \"/*\") as $archivos_carpeta){\n if (is_dir($archivos_carpeta)){\n eliminarDirectorio($archivos_carpeta);\n }\n else{\n unlink($archivos_carpeta);\n }\n }\n rmdir($directorio);\n}",
"public function deleteNode()\n {\n \n $arra_sub_tree=$this->getSubTree($this->int_my_position);\n \n $this->setPositionToParent();\n \n foreach($arra_sub_tree as $node)\n { \n $index=$this->getIndexById($node['my_id']);\n $this->arra_node_to_delete[]=$node['my_id'];\n unset($this->arra_tree[$index]);\n }\n\n }",
"function SprWymiar($macierz){\n\t\t\t$wymiar=1;\n\t\t\twhile(isset($macierz[$wymiar][1])){\n\t\t\t\t$wymiar++;\n\t\t\t}\n\t\t\treturn $wymiar-1; \n\t\t}",
"public function detalle_proyecto($id){\n $contVisita = Proyecto::find($id);\n $contVisita->visitas =$contVisita->visitas+1;\n $contVisita->save();\n $proyecto=DB::table('proyectos')->join('estados','proyectos.estado_id','estados.id')\n ->join('ciudades','proyectos.ciudad_id','ciudades.id')\n ->select('proyectos.*','estados.nombre as nombre_estado','ciudades.nombre as nombre_ciudad')\n ->where('proyectos.id',$id)\n ->first();\n\n $imagenes=MediaProyecto::where('proyecto_id',$id)->get();\n\n $inmueblesProyectos=InmuebleProyecto::join('tipoinmuebleproyectos','inmuebleproyectos.tipoinmueble_id','tipoinmuebleproyectos.id')\n ->where('proyecto_id',$id)\n ->select('inmuebleproyectos.*','tipoinmuebleproyectos.nombre')\n ->get();\n\n $proyectos=DB::table('proyectos')->Join('mediaproyectos','proyectos.id','mediaproyectos.proyecto_id')\n ->join('ciudades','proyectos.ciudad_id','ciudades.id')\n ->select('mediaproyectos.nombre as nombre_imagen','mediaproyectos.proyecto_id','mediaproyectos.id as id_imagen','proyectos.*','ciudades.nombre as nombre_ciudad')\n ->where('mediaproyectos.vista',1)\n ->where('destacado',1)\n ->inRandomOrder()\n ->get()\n ->take(3);\n\n $inmuebles=DB::table('medias')->Join('propiedades','medias.propiedad_id','propiedades.id')\n ->join('tipoinmueble','propiedades.tipo_inmueble','tipoinmueble.id')\n ->join('ciudades','propiedades.ciudad_id','ciudades.id')\n ->select('medias.nombre as nombre_imagen','medias.propiedad_id','medias.id as id_imagen','propiedades.*','ciudades.nombre as nombreCiudad','tipoinmueble.nombre as nombreInmueble')\n ->where('medias.vista',1)\n ->where('propiedades.estatus',1)\n ->inRandomOrder()\n ->get()\n ->take(3);\n return view('detalle_proyecto',compact('proyectos','inmuebles','proyecto','imagenes','inmueblesProyectos'));\n }",
"public function supprimerPersonne($nump){\n $requete = $this->db->prepare(\n \"DELETE from personne where per_num='$nump';\");\n\n $retour=$requete->execute();\n return $retour;\n }",
"protected function pruning()\n {\n $this->pizzas()->detach();\n }",
"public function EliminarProductos($ids)\n {\n $resultado = array();\n $em = $this->getDoctrine()->getManager();\n\n if ($ids != \"\") {\n $ids = explode(',', $ids);\n $cant_total = 0;\n $cant_eliminada = 0;\n foreach ($ids as $producto_id) {\n if ($producto_id != \"\") {\n $cant_total++;\n $entity = $this->getDoctrine()->getRepository('IcanBundle:Producto')\n ->find($producto_id);\n if ($entity != null) {\n\n //Cotizaciones\n $cotizaciones = $this->getDoctrine()->getRepository('IcanBundle:CotizacionProducto')\n ->ListarCotizaciones($producto_id);\n if (count($cotizaciones) == 0) {\n //Eliminar foto\n $foto_eliminar = $entity->getImagen();\n if ($foto_eliminar != \"\") {\n $dir = 'uploads/productos/';\n if (is_file($dir . $foto_eliminar)) {\n unlink($dir . $foto_eliminar);\n //unlink($dir . \"portada-\" . $foto_eliminar);\n //unlink($dir . \"thumb-\" . $foto_eliminar);\n }\n }\n //Eliminar ficha\n $ficha_eliminar = $entity->getFicha();\n if ($ficha_eliminar != \"\") {\n $dir = 'uploads/productos/';\n if (is_file($dir . $ficha_eliminar)) {\n unlink($dir . $ficha_eliminar);\n }\n }\n\n //Eliminar las imagenes\n $productoimagenes = $this->getDoctrine()->getRepository('IcanBundle:ProductoImagen')\n ->ListarImagenes($producto_id);\n foreach ($productoimagenes as $productoimagen) {\n //Eliminar foto\n $foto_eliminar = $productoimagen->getImagen();\n if ($foto_eliminar != \"\") {\n $dir = 'uploads/productos/';\n if (is_file($dir . $foto_eliminar)) {\n unlink($dir . $foto_eliminar);\n //unlink($dir . \"portada-\" . $foto_eliminar);\n //unlink($dir . \"thumb-\" . $foto_eliminar);\n }\n }\n $em->remove($productoimagen);\n }\n\n //Eliminar los productos relacionados\n $relacionados = $this->getDoctrine()->getRepository('IcanBundle:ProductoRelacion')\n ->ListarRelacionados($producto_id);\n foreach ($relacionados as $relacionado) {\n $em->remove($relacionado);\n }\n\n //Eliminar los productos relacionados\n $productorelacionados = $this->getDoctrine()->getRepository('IcanBundle:ProductoRelacion')\n ->ListarProductosRelacionado($producto_id);\n foreach ($productorelacionados as $relacionado) {\n $em->remove($relacionado);\n }\n\n //Eliminar vistas\n $producto_views = $this->getDoctrine()->getRepository('IcanBundle:ProductoView')\n ->ListarViewsDeProducto($producto_id);\n foreach ($producto_views as $producto_view) {\n $em->remove($producto_view);\n }\n\n //Eliminar descuentos\n $descuentos = $this->getDoctrine()->getRepository('IcanBundle:DescuentoProducto')\n ->ListarDescuentos($producto_id);\n foreach ($descuentos as $descuento) {\n $em->remove($descuento);\n }\n\n $em->remove($entity);\n $cant_eliminada++;\n }\n\n }\n }\n }\n }\n $em->flush();\n if ($cant_eliminada == 0) {\n $resultado['success'] = false;\n $resultado['error'] = \"No se pudo eliminar los productos, porque tienen cotizaciones asociadas\";\n } else {\n $resultado['success'] = true;\n\n $mensaje = ($cant_eliminada == $cant_total) ? \"La operación se ha realizado correctamente\" : \"La operación se ha realizado correctamente. Pero atención no se pudo eliminar todos los productos asociados porque tienen cotizaciones asociadas\";\n $resultado['message'] = $mensaje;\n }\n return $resultado;\n }",
"function eliminarImagenCarpeta($campo, $tabla, $idAsignacion, $carpeta)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$carpeta/$nombreImagen\");\n echo \"OK\";\n }\n\n }",
"function prepare_remito($id_remito,&$filas)\r\n{\r\n while ($filas['cantidad']--)\r\n {\r\n\t$filas[$filas['cantidad']]['id_remito']=$id_remito;\r\n \t$filas[$filas['cantidad']]['descripcion']=\"'\".$filas[$filas['cantidad']]['descripcion'].\"'\";\r\n \tunset($filas[$filas['cantidad']]['subtotal']);\r\n }\r\n unset($filas['cantidad']);\r\n}",
"private function delSubs($id){\n\t\t$db = Zend_Registry::get('db');\n\t\t$select = $db->select()\n\t\t\t\t\t->from('pages')\n\t\t\t\t\t->where('parent_id = ?',$id);\n\t\t$results = $db->fetchAll($select);\n\t\tif($results){\n\t\t\t$db->delete('pages',array(\n\t\t\t\t'id = ?' => $results[id],\n\t\t\t));\n\t\t\t$db->delete('routes',array(\n\t\t\t\t'type = ?' => 'content',\n\t\t\t\t'seg_id = ?' => $results[id],\n\t\t\t));\n\t\t\t// recurse through possible child items\n\t\t\t$this->delSubs($results[id]);\n\t\t}\n\t}"
]
| [
"0.5558317",
"0.5500583",
"0.5479156",
"0.54692215",
"0.54652953",
"0.5464383",
"0.54543257",
"0.54412895",
"0.53822464",
"0.5377312",
"0.53453803",
"0.53442895",
"0.5320968",
"0.5309001",
"0.5304291",
"0.5300011",
"0.52915996",
"0.5243063",
"0.5228395",
"0.52139413",
"0.5208639",
"0.52045673",
"0.5185795",
"0.51686305",
"0.5151952",
"0.51493424",
"0.5140663",
"0.51031244",
"0.5093912",
"0.507491",
"0.50520176",
"0.50454026",
"0.5021629",
"0.5015476",
"0.5015189",
"0.5006399",
"0.50014025",
"0.49892548",
"0.4969076",
"0.49607462",
"0.49601623",
"0.49517056",
"0.49467072",
"0.4945373",
"0.4938498",
"0.49384218",
"0.4932971",
"0.4931762",
"0.49236786",
"0.4920985",
"0.49204233",
"0.49150413",
"0.4913932",
"0.48985314",
"0.48918268",
"0.4888003",
"0.48873842",
"0.48793972",
"0.4873748",
"0.48729864",
"0.48726505",
"0.48705947",
"0.4865979",
"0.48637193",
"0.485704",
"0.48539022",
"0.48389685",
"0.4838079",
"0.48078057",
"0.48013827",
"0.47943595",
"0.4790921",
"0.47885817",
"0.47871032",
"0.47860244",
"0.47833627",
"0.478293",
"0.47690958",
"0.47631356",
"0.47605863",
"0.47596934",
"0.47587207",
"0.47569713",
"0.4756702",
"0.475454",
"0.47534147",
"0.47525653",
"0.47455487",
"0.4741996",
"0.47418872",
"0.47410938",
"0.4736616",
"0.47355378",
"0.47288185",
"0.4725459",
"0.47246248",
"0.47199953",
"0.47122744",
"0.47088298",
"0.4707175",
"0.47040725"
]
| 0.0 | -1 |
Seed the application's database. | public function run()
{
// $this->call(UsersTableSeeder::class);
$this->call([
DepartmentsTableSeeder::class,
CitiesTableSeeder::class,
AddressesTableSeeder::class,
BranchOfficesTableSeeder::class,
RolesTableSeeder::class,
UsersTableSeeder::class,
MovementsTableSeeder::class,
BoxStatesTableSeeder::class,
ProductsTableSeeder::class,
BoxesTableSeeder::class,
InventoriesTableSeeder::class,
TransferStatesTableSeeder::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 |
Retrieves the request object | public function getProfiler()
{
if (null === $this->_profiler)
{
$options = $this->getOptions();
// Force these options to be set - don't rely on the defaults!
if (!isset($options['active']))
{
throw new Glitch_Exception('Undefined log option: "active"');
}
$enabled = (boolean)$options['active'];
// enable or disable the profiler by ratio
if (isset($options['ratio']))
{
$ratio = intval($options['ratio']);
if (($ratio >= 0 && $ratio <= 100) && $enabled)
{
$enabled = (rand(0, 100) > (100 - $ratio));
}
}
// load the profiler instance
$this->_profiler = Glitch_Application_Profiler::factory($enabled);
// Ensure the front controller is initialized
$this->_bootstrap->bootstrap('FrontController');
// push the profiler on the plugin stack to time the dispatch process
$front = $this->_bootstrap->getResource('FrontController');
$front->registerPlugin(new Glitch_Controller_Plugin_Profiler(), 2);
// Allow application-wide access
Zend_Registry::set(self::REGISTRY_KEY, $this->_profiler);
}
return $this->_profiler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function obtainRequest() {\n return Request::createFromGlobals();\n }",
"public function get_request()\n\t{\n\t\treturn $this->request;\n\t}",
"public function get_request()\n\t{\n\t\treturn $this->request;\n\t}",
"protected function getRequest() {\n\t\treturn $this->request;\n\t}",
"protected function getRequest()\n {\n return $this->request;\n }",
"protected function getRequest()\n {\n return $this->request;\n }",
"protected function getRequest()\n {\n return $this->request;\n }",
"protected function getRequest() {\n return $this->request;\n }",
"public function getRequest()\n {\n if (is_null($this->_request)) {\n $this->_request = new Request();\n }\n return $this->_request;\n }",
"public function getRequest()\n {\n return $this->_request;\n }",
"public function getRequest()\n {\n return $this->_request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest() {\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->request;\n }",
"public function getRequest() {\n return $this->request;\n }",
"public function getRequest() {\n return $this->_request;\n }",
"function getRequest() {\n return $this->request;\n }",
"public function getRequest() {\n return $this->request;\n }",
"function getRequest() {\n\t\treturn $this->Request;\n\t}",
"protected function _request() {\n\t\treturn $this->_container->request;\n\t}",
"public function getRequest()\n {\n return $this->get('request');\n }",
"public function getRequest()\n {\n return $this->get('request');\n }",
"public function getRequest()\n {\n return $this->get('request');\n }",
"public function getRequest()\n {\n return $this->get('request');\n }",
"private function getRequest()\n {\n $controller = $this->getController();\n return $controller->getRequest();\n }",
"public function getRequest(): Request\n {\n return $this->request;\n }",
"public function getRequest(): Request\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->requestFactory->getRequest();\n }",
"function getRequest() {\n\t\treturn $this->m_request;\n\t}",
"public function getRequest() {\n return $this->Request;\n }",
"public function getRequest(){\n \n return $this->request;\n \n }",
"public function getRequest()\n {\n return static::app()->request;\n }",
"protected function getRequest()\n {\n return $this->req;\n }",
"public function request()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getRequest()\n {\n return $this->getService('request');\n }",
"public function request()\n {\n return $this->request;\n }",
"public function request()\n {\n return $this->request;\n }",
"public function getRequest()\n {\n return isset($this->request) ? $this->request : null;\n }",
"public function request()\r\n {\r\n return $this->request;\r\n }",
"public function getRequest()\n {\n assert(null != $this->request, 'Request must not be null');\n\n return $this->request;\n }",
"public function getRequest()\n {\n return $this->data->request;\n }",
"public function getRequest(): Request|\\Symfony\\Component\\HttpFoundation\\Request\n {\n return $this->request ?: Request::createFromGlobals();\n }",
"private function getRequest()\n {\n if ($this->request === null) {\n $this->request = $this->container->get('request_stack')->getCurrentRequest();\n }\n return $this->request;\n }",
"public static function request() {\n\t\tif (!isset(self::$_request)) {\n\t\t\tself::$_request=new \\GO\\Base\\Request();\n\t\t}\n\t\treturn self::$_request;\n\t}",
"public function getRequest()\n {\n return $this->req;\n }",
"public function getRequest()\n {\n return $this->get(self::_REQUEST);\n }",
"public function getRequest(): Request\n {\n return Model::getRequest();\n }",
"public function getRequest()\r\n {\r\n return $this->_controller->getApplication()->getRequest();\r\n }",
"public function getRequest()\n {\n if (! $this->request) {\n $this->request = \\Zend_Controller_Front::getInstance()->getRequest();\n }\n return $this->request;\n }",
"public function getRequest()\n\t{\n\t\treturn $this->getComponent('request');\n\t}",
"public function getRequest()\n {\n return $this->getComponent('request');\n }",
"public function getReq()\n\t{\n\t\treturn $this->_request;\n\t}",
"public function getRequest() {\n return parent::getRequest();\n }",
"protected function getRequest()\n {\n return app(Request::class);\n }",
"public function &request() : \\Amvisie\\Core\\HttpRequest\n {\n return $this->request;\n }",
"public function get_request()\n {\n $request = new midgardmvc_core_request();\n $request->set_method($this->appserver_context['env']['REQUEST_METHOD']);\n if (isset($this->appserver_context['env']['HTTP_X_HTTP_METHOD_OVERRIDE']))\n {\n $request->set_method($this->appserver_context['env']['HTTP_X_HTTP_METHOD_OVERRIDE']);\n }\n\n // Parse URL into components (Mjolnir doesn't do this for us)\n $url_components = parse_url(\"http://{$this->appserver_context['env']['HTTP_HOST']}{$this->appserver_context['env']['REQUEST_URI']}\");\n\n // Handle GET parameters\n if (!empty($url_components['query']))\n {\n $get_parameters = array();\n parse_str($url_components['query'], $get_parameters);\n $request->set_query($get_parameters);\n }\n\n $request->resolve_node($url_components['path']);\n\n return $request;\n }",
"public function request()\n {\n if (empty($this->request)) {\n $this->request = app()->request;\n }\n\n return $this->request;\n }",
"private function _request()\n {\n if ($this->_request) {\n return $this->_request;\n }\n $this->_request = Zend_Controller_Front::getInstance()->getRequest();\n return $this->_request;\n }",
"public function getRequest() {\n\t\treturn $this->getFrontcontroller()->getRequest();\n\t}",
"protected function _getRequest() {\n\t\treturn new Request;\n\t}",
"public function getRequest() {\r\n\t\treturn $this->context->getState('request');\r\n\t}",
"function getRequest()\n {\n return $this->current_request;\n }",
"public function getRequest()\n {\n return \\Cloud::app()->getFrontController()->getRequest();\n }",
"function request(): Request\n\t{\n\t\tstatic $request;\n\n\t\tif($request === null)\n\t\t{\n\t\t\t$request = Application::instance()->getContainer()->get(Request::class);\n\t\t}\n\n\t\treturn $request;\n\t}",
"public function request()\n {\n return $this->context->getRequest();\n }",
"protected function getRequest(): RequestInterface\n {\n return $this->request;\n }",
"public function getRequestInstance(){\n\t\treturn ControllerRequest::getInstance();\n\t}",
"function getRequest()\n {\n if ( !$this->_request )\n {\n if ( method_exists( $this, '_getRequest' ) )\n {\n $object = $this->_getRequest();\n if ( $object instanceof \\Hotlink\\Framework\\Model\\Api\\Request )\n {\n $this->setRequest( $object );\n }\n }\n if ( !$this->_request )\n {\n //$request = Mage::getModel('hotlink_framework/api_request');\n $request = $this->interactionApiRequestFactory->create();\n $this->setRequest( $request );\n }\n }\n return $this->_request;\n }",
"public function getRequest()\n\t{\n\t\treturn $this->compose('Request', 'Http\\Requests');\n\t}",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();"
]
| [
"0.85305035",
"0.8464723",
"0.8464723",
"0.8422853",
"0.84197474",
"0.84197474",
"0.84197474",
"0.83883363",
"0.8377325",
"0.83313894",
"0.83313894",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83143693",
"0.83065367",
"0.83025503",
"0.83025503",
"0.83025503",
"0.83018863",
"0.83018863",
"0.82839376",
"0.8281351",
"0.82766765",
"0.8267378",
"0.8264949",
"0.824604",
"0.8242335",
"0.8242335",
"0.8242335",
"0.8242335",
"0.8216288",
"0.8160113",
"0.8160113",
"0.81518626",
"0.815167",
"0.8150234",
"0.8136991",
"0.8126016",
"0.812279",
"0.8114715",
"0.8100486",
"0.8088918",
"0.8088918",
"0.80858314",
"0.8084656",
"0.8071686",
"0.80578345",
"0.8046006",
"0.8041235",
"0.8036707",
"0.80322427",
"0.79884684",
"0.798057",
"0.7967834",
"0.7967629",
"0.7956474",
"0.79501283",
"0.79204947",
"0.792014",
"0.78735965",
"0.7873158",
"0.78385574",
"0.7838258",
"0.7829159",
"0.78141963",
"0.7811468",
"0.7806815",
"0.7786422",
"0.7758924",
"0.77510273",
"0.7702173",
"0.76937264",
"0.769341",
"0.7692661",
"0.7669649",
"0.766105",
"0.766105",
"0.766105",
"0.766105",
"0.766105",
"0.766105",
"0.766105",
"0.766105"
]
| 0.0 | -1 |
$children = $this>get_childs([394]);//84 130 | public function test()
{
// $children = $this->get_childs([396]);//408 648
$children = $this->get_childs([397]);
// $children = $this->get_childs([398]);
// $children = $this->get_childs([401]);
// $children = $this->get_childs([402]);#
// $children = $this->get_childs([403]);
// $children = $this->get_childs([406]);
// $children = $this->get_childs([407]);
dump($this->childs);
dump($this->childs_data);die;
$num = 0;
Db::startTrans();
try {
foreach ($children as $key => $value) {
// $num += count($value);
if($value){
db('user_position')->where(['uid'=>['in',$value]])->delete();
foreach ($this->childs_data[$key] as $k => $v) {
$this->position($v['id'],$v['pid']);
}
}
}
Db::commit();
} catch (\Exception $e) {
throw new \Exception($e);
Db::rollback();
}
// dump($num);
dump('success');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_children();",
"public function getChildren(): array;",
"public function getChilds();",
"public function getChildren()\n {\n }",
"public function getChildren()\n {\n }",
"public function getChildren(): ?array;",
"function getChilds($id = NULL);",
"public function get_children() {\n\t\treturn $this->children;\n\t}",
"public function getChildren() {}",
"public function getChildren() {}",
"public function getChildren() {}",
"public function getChildNodes() {}",
"public function getChildNodes() {}",
"function get_children($args = '', $output = \\OBJECT)\n {\n }",
"function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}",
"public function children (){\n\t\treturn array();\n\t}",
"public function children()\r\n\t{\r\n\t\treturn $this->children;\r\n\t}",
"public function getChildren()\n {\n return $this->children;\n }",
"function getChildNodes() ;",
"public function get_children() : array\n {\n return $this->children;\n }",
"abstract protected function getCurrentChildren(): array ;",
"public function getChildren() \n {\n return $this->children;\n }",
"public function getNumberChildren();",
"public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildren();",
"public function getChildNodes();",
"public function findChildren()\n {\n return self::where('code_parrent',$this->id)->get();\n }",
"abstract protected function getNewChildren(): array ;",
"public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}",
"public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}",
"public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}",
"public function getChildElements() {}",
"public function children($id);",
"public function getChildren() {\n\t\treturn $this->children;\n\t}",
"public function getChildren() {\n\t\treturn $this->children;\n\t}",
"public function getChildren() {\n\t\treturn $this->_children;\n\t}",
"public function children() {\n return $this->descendants(1);\n }",
"public function getChilds()\n {\n return $this->childs;\n }",
"public function children()\n {\n return (array) $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->children;\n }",
"public function getChildren()\n {\n return $this->_children;\n }",
"function test_get_children()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Just see if empty nodes are recognized\r\n\t\t$nids = $this->_setup_root_nodes(3);\r\n\t\tforeach($nids AS $rix => $nid)\r\n\t\t{\r\n\t\t\t$this->assertFalse($this->_tree->get_children($nid), 'getChildren returned value for empty rootnode');\r\n\t\t} \r\n\t\t// Now build a little tree to test\r\n\t\t$relation_tree = $this->_create_sub_node($rnc, $depth, $npl);\r\n\r\n\t\t$rootnodes = $this->_tree->get_root_nodes();\r\n\t\t$exp_cct = 0;\r\n\t\t$cct = 0;\r\n\t\tforeach($rootnodes AS $rid => $rootnode)\r\n\t\t{ \r\n\t\t\t// Traverse the tree and verify it against the relationTree\r\n\t\t\t$cct = $cct + $this->_traverse_children($rootnode, $relation_tree, true); \r\n\t\t\t// Calc the expected number of children from lft-rgt\r\n\t\t\t$exp_cct = $exp_cct + floor(($rootnode['r'] - $rootnode['l']) / 2);\r\n\t\t} \r\n\t\t// Test if all created nodes got returned\r\n\t\t$this->assertEqual($exp_cct, $cct, 'Total node count returned is wrong');\r\n\t\treturn true;\r\n\t}",
"public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}",
"public function GetChildren() {\n\t\treturn $this->Children;\n\t}",
"public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }",
"public function iterateChildren();",
"public function getChilds() {\n return $this->__childs;\n }",
"function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function getChildrenIds(){\n if ($this->myChildrenType===null) $this->myChildrenIds = null;\n else $this->myChildrenIds = $this->_db->getChildrenIds($this->myId);\n }",
"#[ReturnTypeWillChange]\n public function getChildren()\n {\n return new self($this->iterator->getChildren(), $this->excluded);\n }",
"public function getChildren()\n\t{\n\t\t$children = $this->current()->getChildren();\n\n\t\t// Using ref as per PHP source\n\t\tif (empty($this->ref))\n\t\t{\n\t\t\t$this->ref = new \\ReflectionClass($this);\n\t\t}\n\n\t\treturn $this->ref->newInstance($children);\n\t}",
"public function getChildrenQuery();",
"final public function getChildren() {\n\t\treturn array();\n\t}",
"function get_children() {\n\t\t\n\t\tif (!is_array($this->children)) :\n\t\t\n\t\t\t$this->children = array();\n\t\t\t\n\t\t\tif ($this->is_type('variable')) $child_post_type = 'product_variation'; else $child_post_type = 'product';\n\t\t\n\t\t\tif ( $children_products =& get_children( 'post_parent='.$this->id.'&post_type='.$child_post_type.'&orderby=menu_order&order=ASC' ) ) :\n\n\t\t\t\tif ($children_products) foreach ($children_products as $child) :\n\t\t\t\t\t\n\t\t\t\t\tif ($this->is_type('variable')) :\n\t\t\t\t\t\t$child->product = &new woocommerce_product_variation( $child->ID );\n\t\t\t\t\telse :\n\t\t\t\t\t\t$child->product = &new woocommerce_product( $child->ID );\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\tendforeach;\n\t\t\t\t$this->children = (array) $children_products;\n\t\t\tendif;\n\t\t\t\n\t\tendif;\n\t\t\n\t\treturn $this->children;\n\t}",
"function & getChilds() {\r\n // Load the data\r\n if (empty ($this->_childs)) {\r\n $database = $this->_db;\r\n /* retrieve values */\r\n $query = 'SELECT * FROM #__custom_properties_values' . ' WHERE parent_id = ' . $this->_id . ' ORDER BY ordering ';\r\n\r\n $database->setQuery($query);\r\n $this->_childs = $database->loadObjectList();\r\n }\r\n return $this->_childs;\r\n }",
"public function getChildren () {\n return $this->current ();\n }",
"#[Pure] public function get_children_number(): int\n {\n return $this -> children -> size();\n }",
"public function getDescendants();",
"public function countChildren();",
"public function getChildren(): array\n {\n return $this->children->toArray();\n }",
"function getChildrenIdArray($sourceArr, $id) {\r\n\t$arrChidrens [] = $id;\r\n\t//findChildrens( $sourceArr, $id, &$arrChidrens );\r\n\treturn $arrChidrens;\r\n}",
"public function getChildren(): array {\n return iterator_to_array(clone $this->children);\n }",
"public function myChildren()\n {\n return File::get()->filter(\"ParentID\", $this->ID);\n }",
"public function getChildren() {\n\t\t$children = $this->categoryRepository->findAllChildren($this);\n\t\treturn $children;\n\t}",
"public function children()\n {\n return $this->hasMany(self::class, 'parent_id', 'id');\n }",
"function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }",
"public function grandChildren() {\n return $this->children()->children();\n }",
"public function getChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $children[] = new self((int) $result->getValue('category_id'), $this->clang_id);\n $result->next();\n }\n return $children;\n }",
"public function children(){\n return $this->hasMany(self::class, 'parent_id');\n }",
"public function getChildren(): Collection\n {\n return $this->children;\n }",
"public function getChildren(): Collection\n {\n return $this->children;\n }",
"public function childrenRecursive()\n\t\t{\n\t\t\treturn $this->children()->with('childrenRecursive');\n\t\t}",
"public function hasChildren()\n {\n }",
"public function hasChildren()\n {\n }",
"public function children()\n {\n return $this->hasMany(static::class, 'parent_id')->orderBy('name', 'asc');\n }",
"function get_children($id)\n\t{\n\t\trequire_lang('catalogues');\n\t\trequire_code('catalogues');\n\t\trequire_code('catalogues2');\n\n\t\t$child=1;\n\n\t\t// If the node is not a root node then get the name of the node\n\t\t$name=$GLOBALS['SITE_DB']->query_value_null_ok('catalogue_categories','c_name',array('id'=>intval($id)));\n\n\t\t$pagelinks=get_catalogue_entries_tree($name,NULL,NULL,NULL,NULL,NULL,false);\n\n\t\tif(count($pagelinks)>0)\n\t\t{\n\t\t\tfor($i=0;$i<count($pagelinks);$i++)\n\t\t\t{\n\t\t\t\tif($pagelinks[$i]['id']==$id)\n\t\t\t\t{\n\t\t\t\t\t$child=$pagelinks[$i]['child_count'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $child;\n\t}",
"private function getChildList(){\n\t\tif ($this->_childList == null) {\n\t\t\t$this->_childList = $this->getStructureNode()->getChildren();\n\t\t\t$this->_childList = $this->_childList->sort(array(\n\t\t\t\tnew SortRule($this->_childList->exprMember('title'))));\n\t\t}\n\t\treturn $this->_childList;\n\t}",
"public function childrens()\n {\n return $this->hasMany(self::class, 'parent_id');\n }",
"public function childrenRecursive()\n {\n return $this->children()->with('childrenRecursive');\n }",
"public function childrenRecursive()\n {\n return $this->children()->with('childrenRecursive');\n }",
"public function children() {\n\t\treturn $this->fieldset_children;\n\t}",
"function hierarchize_get_childs($brainstormid, $userid=null, $groupid=0, $excludemyself=false, $fatherid=0){\r\n global $CFG;\r\n\r\n $accessClause = brainstorm_get_accessclauses($userid, $groupid, $excludemyself);\r\n\r\n $fatherClause = ($fatherid != 0) ? \" AND od.itemdest = $fatherid \" : ' AND (od.itemdest IS NULL OR od.itemdest = 0) ';\r\n\r\n $sql = \"\r\n SELECT\r\n r.id,\r\n r.response,\r\n od.itemdest,\r\n od.intvalue,\r\n od.userid,\r\n od.groupid,\r\n od.id as odid\r\n FROM\r\n {$CFG->prefix}brainstorm_responses as r,\r\n {$CFG->prefix}brainstorm_operatordata as od\r\n WHERE\r\n r.id = od.itemsource AND\r\n operatorid = 'hierarchize' AND\r\n r.brainstormid = {$brainstormid}\r\n {$accessClause}\r\n {$fatherClause}\r\n ORDER BY\r\n od.intvalue,\r\n od.userid\r\n \";\r\n // echo $sql;\r\n if (!$records = get_records_sql($sql)){\r\n return array();\r\n }\r\n return $records;\r\n}",
"function get_page_children($page_id, $pages)\n {\n }",
"public function Children()\n {\n return $this->childrenOfSection('');\n }",
"public function children() {\n\t\treturn $this->hasMany(Forum::getSectionClass(), \"parent_id\")->orderBy(\"weight\", \"desc\");\n\t}",
"function get_category_children($id, $before = '/', $after = '', $visited = array())\n {\n }"
]
| [
"0.8283616",
"0.78083897",
"0.7633877",
"0.74938095",
"0.74938095",
"0.7493341",
"0.74382377",
"0.74187165",
"0.74113244",
"0.74113244",
"0.74113244",
"0.74008316",
"0.7399284",
"0.73761237",
"0.7325657",
"0.7321895",
"0.7245882",
"0.71882087",
"0.7186037",
"0.7182147",
"0.7143631",
"0.71400625",
"0.71366674",
"0.70890737",
"0.7084155",
"0.7084155",
"0.7084155",
"0.7084155",
"0.7084155",
"0.7084155",
"0.7084155",
"0.7084155",
"0.7084155",
"0.7047318",
"0.70188856",
"0.70133364",
"0.70079446",
"0.7000858",
"0.7000858",
"0.6986748",
"0.6952587",
"0.6944976",
"0.6944976",
"0.6928466",
"0.6921637",
"0.69167143",
"0.6903407",
"0.6891848",
"0.6891848",
"0.6891848",
"0.6891848",
"0.6891848",
"0.6891848",
"0.6891848",
"0.6891848",
"0.6883368",
"0.6858428",
"0.6766703",
"0.67566556",
"0.67528963",
"0.6750816",
"0.67420155",
"0.6735115",
"0.67127985",
"0.6696364",
"0.66754156",
"0.66713053",
"0.6639384",
"0.66069233",
"0.6604156",
"0.65989745",
"0.65953547",
"0.6533744",
"0.65228987",
"0.651302",
"0.6498627",
"0.64959216",
"0.64776576",
"0.64582825",
"0.64463145",
"0.6445515",
"0.6433736",
"0.6428988",
"0.64178044",
"0.6401842",
"0.6401842",
"0.6395661",
"0.639431",
"0.639431",
"0.63936645",
"0.6378276",
"0.63767934",
"0.6375001",
"0.63707095",
"0.63707095",
"0.6367056",
"0.6347833",
"0.634177",
"0.6331794",
"0.6329279",
"0.6300019"
]
| 0.0 | -1 |
Get count of input properties | public function getInputPropertiesCount(): int {
return $this->inputPropertiesCount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function count()\n {\n // NOTE: Cannot use \\COUNT_RECURSIVE because that counts the arrays\n // as well as their contents. We want a count only of Properties.\n $count = 0;\n foreach ($this->data as $key=>$values)\n {\n if (is_array($this->data[$key]))\n $count += count($values);\n else\n $count += 1;\n }\n return $count;\n }",
"public function properties($_this, bool $disposeArrays = true): int\n {\n $count = 0;\n\n $reflector = new \\ReflectionClass($_this);\n foreach ($reflector->getProperties() as $property) {\n if ($this->property($_this, $property, $disposeArrays)) {\n $count++;\n }\n }\n\n return $count;\n }",
"public function inputcount(){\n \treturn ser_inputcount();\n }",
"public function count()\r\n {\r\n return count($this->attributes);\r\n }",
"public function _pseudo_numberOfFields() {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->parameters);\n }",
"public function getAttributeCount();",
"public function getFieldCount() {}",
"public function setInputPropertiesCount(int $inputPropertiesCount): Statistics {\n\t\t$this->inputPropertiesCount = $inputPropertiesCount;\n\n\t\treturn $this;\n\t}",
"public abstract function field_count();",
"abstract public function getNumFields();",
"public function countKeys();",
"public function countOwnAttributes()\n {\n return $this->getAttributes(false, false)->count();\n }",
"public function count()\n {\n return count($this->fields);\n }",
"public function count()\n {\n return count($this->fields);\n }",
"function count() {\n\t\treturn count($this->variable);\n\t}",
"public function count() {\n\t\treturn count($this->validators);\n\t}",
"public static function getAllPropertiesCount($userid) {\n\t\t$count = self::getPropertiesOfUser ( $userid );\n\t\tif ($count)\n\t\treturn count ( $count );\n\t\telse\n\t\treturn 0;\n\n\t}",
"public function numInputs()\n {\n return count($this->inputs);\n }",
"public function count()\n {\n return count($this->valueOf());\n }",
"public function count()\n {\n return $this->getValue()->count();\n }",
"public function count()\n {\n return count($this->supportedValues);\n }",
"public function numOfFields();",
"public function numberOfFields();",
"public function count ( )\n {\n return count($this->_values);\n }",
"public function count() {\n\t\treturn count($this->values);\n\t}",
"public function getPropertyValuesCount(string $symbol): int {\n\t\treturn $this->properties[$symbol]['count'] ?? 0;\n\t}",
"public function count()\n\t{\n\t\treturn count($this->values);\n\t}",
"public function getParamsCount()\n {\n return $this->count(self::_PARAMS);\n }",
"public function getParamsCount()\n {\n return $this->count(self::_PARAMS);\n }",
"public function count()\n {\n return count($this->rules);\n }",
"public function numFields();",
"public function count()\r\n {\r\n return count($this->_values);\r\n }",
"function tidy_config_count(tidy $object) {}",
"public function count() {\n return count($this->cast);\n }",
"public function getRepeatedObjFieldCount()\n {\n return $this->count(self::REPEATED_OBJ_FIELD);\n }",
"public function getValueCount()\n {\n return $this->count(self::VALUE);\n }",
"public function count(): int {\n return count($this->toArray());\n }",
"public abstract function GetFieldCount();",
"public function count()\n\t{\n\t\treturn count($this->getListByKey());\n\t}",
"public function getNumFields()\n {\n return count($this->fields);\n }",
"public function count()\n {\n return count($this->_annotations);\n }",
"public function countValues($resource, $property, $type = null, $lang = null)\n {\n return count($this->all($resource, $property, $type, $lang));\n }",
"public function count()\n {\n return count($this->activeValue);\n }",
"public function getMaxProperties(): int\n {\n return $this->maxProperties;\n }",
"function count() {\n return count($this->data);\n }",
"function statistics_extended_groups_property_count($property){\r\n\tglobal $CONFIG;\r\n\t$properties = $CONFIG->group;\r\n\t$labels = array();\r\n\t$totals = array();\r\n\tif(array_key_exists($property,$properties)){\r\n\t\tlist($type,$values) = $properties[$property];\r\n\t\tswitch($type){\r\n\t\t\tcase \"checkboxes\":\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tforeach($values as $label=>$value){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"organizational_unit\":\r\n\t\t\t\t$query = \"SELECT string FROM {$CONFIG->dbprefix}metastrings WHERE id IN \";\r\n\t\t\t\t$query.=\"(SELECT value_id FROM {$CONFIG->dbprefix}metadata WHERE name_id=\";\r\n\t\t\t\t$query.=\"(SELECT id FROM {$CONFIG->dbprefix}metastrings WHERE string='{$property}'))\";\r\n\t\t\t\t$categories = get_data($query);\r\n\t\t\t\tif(!empty($categories)){\r\n\t\t\t\t\tforeach($categories as $category){\r\n\t\t\t\t\t\t$category = $category->string;\r\n\t\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$category);\r\n\t\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t\tlist($section,$department,$unit) = explode(\"||\",$category);\r\n\r\n\t\t\t\t\t\t$labels[$section]=$section;\r\n\t\t\t\t\t\t$totals[$section]+=$total;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"status\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\t\t\t\t$values = array(\"preparation\"=>\"groups:extras:status:preparation\",\r\n\t\t\t\t\t\t\t\t\"active\"=>\"groups:extras:status:active\",\r\n\t\t\t\t\t\t\t\t\"inactive\"=>\"groups:extras:status:inactive\",\r\n\t\t\t\t\t\t\t\t\"closed\"=>\"groups:extras:status:closed\");\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$label;\r\n\t\t\t\t\t$totals[$label]=(int)$total;\r\n\t\t\t\t}\r\n\t\t\t\t$totals[\"groups:extras:status:active\"]=$all_groups-$totals[\"groups:extras:status:inactive\"]-$totals[\"groups:extras:status:closed\"];\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\tswitch($property){\r\n\t\t\tcase \"content_privacy\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>\"no\");\r\n\t\t\t\t$count_no = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\r\n\t\t\t\t// How content_privacy is a new feature it is no available for all groups\r\n\t\t\t\t$labels[]=\"yes\";\r\n\t\t\t\t$totals[\"yes\"]=$all_groups - $count_no;\r\n\t\t\t\t$labels[]=\"no\";\r\n\t\t\t\t$totals[\"no\"]=$count_no;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"membership\":\r\n\t\t\t\t$values = array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public'));\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn array($labels,$totals);\r\n}",
"function readComponentCount() { return $this->components->count(); }",
"public function size() {\n return n(count($this->value()));\n }",
"public function getParamsIntCount()\n {\n return $this->count(self::PARAMS_INT);\n }",
"public function count() {\n return count($this->components);\n }",
"function count() {\n\t\treturn count($this->data);\n\t}",
"function get_object_count()\r\n {\r\n return $this->get_browser()->count_profile_publications($this->get_condition());\r\n }",
"public function getValueSetRequirementsCount()\n {\n return $this->count(self::VALUE_SET_REQUIREMENTS);\n }",
"public function countAttributes($entry)\n\t{\n\t\treturn count($this->getEntry($entry, array()));\n\t}",
"public function count() {\r\n return count($this->objects);\r\n }",
"public function count(){\n return $this->_count;\n }",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count(): int\n {\n return count( $this->toArray() );\n }",
"function count()\n\t{\n\t\treturn $this->count;\n\t}",
"public function subpropertyJoinCountTest() {}",
"public function count() {\n \n return $this->getLength();\n }",
"public function count() {\n\t\treturn count($this->data);\n\t}",
"public function getMinProperties(): int\n {\n return $this->minProperties;\n }",
"public function countOptions(): int\n {\n return count($this->_options);\n }",
"public function count() {\n\t\treturn count($this->getData());\n\t}",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"public function count() { \r\n\t\t\treturn $this->namedNodeMap->length;\r\n\t\t}",
"public function count() {\r\n return count($this->data);\r\n }",
"public function count ( )\n {\n if(!isset($this->data))\n {\n return 0;\n }\n if(is_array($this->data))\n {\n return count($this->data);\n }\n return 1;\n }",
"public function getMappingCount()\n {\n return $this->count(self::mapping);\n }",
"public function _count();",
"public function count()\n {\n return $this->length;\n }",
"public function count()\n {\n return count($this->defaultVariables);\n }",
"public function count()\n {\n return count($this->steps);\n }",
"public function count()\n\t{\n\t\treturn $this->getParentObject()->count();\n\t}"
]
| [
"0.7007909",
"0.669605",
"0.65430117",
"0.65057874",
"0.6478403",
"0.6420247",
"0.6396833",
"0.63872707",
"0.63808155",
"0.6369911",
"0.6354525",
"0.63425577",
"0.6318666",
"0.63177484",
"0.63177484",
"0.6304486",
"0.6262141",
"0.62448406",
"0.624305",
"0.62381953",
"0.622719",
"0.6217228",
"0.6212757",
"0.6201265",
"0.61706734",
"0.61675906",
"0.6160207",
"0.61306864",
"0.6124071",
"0.6124071",
"0.61181885",
"0.61135125",
"0.61012954",
"0.60187525",
"0.5993524",
"0.5987715",
"0.5976812",
"0.59685975",
"0.5961758",
"0.59600776",
"0.59501535",
"0.59285784",
"0.591617",
"0.5906696",
"0.5904086",
"0.5899587",
"0.58992606",
"0.58982927",
"0.5893176",
"0.5892596",
"0.5869953",
"0.58690935",
"0.5855096",
"0.58530223",
"0.5824192",
"0.58172905",
"0.5816441",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5810039",
"0.5801239",
"0.5800089",
"0.5796521",
"0.5793057",
"0.5790752",
"0.57845414",
"0.57834876",
"0.5778997",
"0.5776565",
"0.5776565",
"0.5776565",
"0.5776565",
"0.57762355",
"0.57738787",
"0.5767546",
"0.5766546",
"0.5765303",
"0.57651156",
"0.57617116",
"0.5758879",
"0.5755747"
]
| 0.8468918 | 0 |
Set count of input properties | public function setInputPropertiesCount(int $inputPropertiesCount): Statistics {
$this->inputPropertiesCount = $inputPropertiesCount;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getInputPropertiesCount(): int {\n\t\treturn $this->inputPropertiesCount;\n\t}",
"protected function setCount($count) {\r\n $this->count = $count;\r\n }",
"private function _setCount($count)\n\t{\n\t\t$this->_count = $count;\n\t}",
"function setCount( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Count = $value;\n setType( $this->Count, \"integer\" );\n }",
"public function setCount($countIn) {$listCount = $countIn;}",
"public function setCount(int $count)\n {\n $this->count = $count;\n }",
"public function setCount($count)\n {\n $this->count = $count;\n }",
"public function setCount($count)\n {\n $this->count = $count;\n }",
"public function setCount(int $count): void\n {\n $this->count = $count;\n }",
"public function updatePropertyIndex ()\n {\n $new_properties_table = array();\n\n foreach ( $this as $declaration ) {\n\n $name = $declaration->property;\n\n if ( isset( $new_properties_table[ $name ] ) ) {\n $new_properties_table[ $name ]++;\n }\n else {\n $new_properties_table[ $name ] = 1;\n }\n }\n $this->properties = $new_properties_table;\n }",
"public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"function set_num_items($num){\n $this -> num_of_items = $num;\n }",
"static public function setTotalCount( $count )\n\t{\n\t\tself::$count = $count;\n\t}",
"public function setNumberOfRequiredParameters(int $number): void;",
"public function __construct($count)\n {\n $this->count = $count;\n }",
"public function set_props($args)\n {\n }",
"public function setProperties($properties)\n {\n\n }",
"function setMultiple($properties) {\n foreach ($properties as $property => $value) {\n $this->set($property, $value);\n }\n }",
"protected function resetProperties() {}",
"public function __construct()\n {\n\n $this->count = 10;\n }",
"private function countLength() {\n\n $this->_length = strlen($this->_value);\n }",
"public function setType(string $count) {\n $this->type = $count;\n }",
"public function setCount($iCount)\n\t{\n\t\t$this->aParameters['count'] = $iCount;\n\t}",
"public function set_copies($count){\n $this->copies=$count;\n }",
"public function setCount(int $count) : self\n {\n $this->count = $count;\n return $this;\n }",
"protected function _setCount()\n\t{\n\t\t$cacheKey = 'toolbar_count_' . $this->getSubject()->model->alias . '_user_' . AuthComponent::user('id');\n\n\t\tif (($count = Cache::read($cacheKey, 'trash_settings')) === false) {\n\t\t\t$Filter = $this->_listener('Trash')->initTrashFilter();\n\n\t\t\t// lets attach all listeners that changes output (this should be made more dry)\n\t\t\t// check if VisualisationListener is used in current Crud\n\t\t\tif ($this->_crud()->config('listeners.Visualisation') !== null) {\n\t\t\t\t$this->_listener('Visualisation')->attachListener($Filter);\n\t\t\t}\n\n\t\t\t$this->_listener('Trash')->attachListener($Filter);\n\n\t\t\t$count = $Filter->filter('count');\n\t\t\tunset($Filter);\n\n\t\t\tCache::write($cacheKey, $count, 'trash_settings');\n\t\t}\n\t\t\n\t\t$this->_count = $count;\n\t}",
"function CountOptionalFields()\n {\n $count = 0;\n for ($i = 1; $i <= 20; $i++) {\n $field = 'optional_field_' . $i;\n if ($this->fields->$field->is_enabled) {\n $count = $i;\n }\n }\n\n $this->max_optional_fields = $count;\n }",
"public function setCount($count)\n {\n $this->Count = $count;\n return $this;\n }",
"private function setNumResults()\n\t{\n\t\t$this->numResults = (int) count($this->data);\n\t}",
"public function properties($_this, bool $disposeArrays = true): int\n {\n $count = 0;\n\n $reflector = new \\ReflectionClass($_this);\n foreach ($reflector->getProperties() as $property) {\n if ($this->property($_this, $property, $disposeArrays)) {\n $count++;\n }\n }\n\n return $count;\n }",
"function resetProperties()\n {\n $this->fullremyears = 0;\n $this->fullremmonths = 0;\n $this->fullremdays = 0;\n $this->fullremhours = 0;\n $this->fullremminutes = 0;\n $this->fullremseconds = 0;\n $this->years = 0;\n $this->months = 0;\n $this->days = 0;\n $this->hours = 0;\n $this->minutes = 0;\n $this->seconds = 0;\n }",
"private function setNumberOfPages(): void\n {\n $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page);\n }",
"protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }",
"public function setCount($count)\n {\n $this->count = $count;\n return $this;\n }",
"function tidy_config_count(tidy $object) {}",
"public function SetNumPages()\n\t\t{\n\t\t\t$this->_pricenumpages = ceil($this->GetNumProducts() / GetConfig('CategoryProductsPerPage'));\n\t\t}",
"public function initProps()\n {\n foreach ($this->cmds as $key => $parseValues) {\n $this->props[$key] = false;\n }\n\n foreach ($this->flags as $key => $parseValues) {\n $this->props[$key] = false;\n }\n }",
"public function setProperties(array $properties);",
"public function setNumberOfOptionalParameters(int $number): void;",
"public function setColumnCount( $count )\n {\n $this->columnsCount = (int) $count;\n }",
"public function setProductItemCounts($val)\n {\n $this->_propDict[\"productItemCounts\"] = $val;\n return $this;\n }",
"private function parseProperties(): void\n {\n $properties = $this->extractProperties();\n\n foreach ($properties as $property)\n {\n if ($property['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($property['docblock']['doc_line_start'],\n $property['docblock']['doc_line_end'],\n $property['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertProperty($this->clsId,\n $docId,\n $property['name'],\n Cast::toManInt($property['is_static']),\n $property['visibility'],\n $property['value'],\n $property['start'],\n $property['end']);\n }\n }",
"public function setTotalItemCount($count)\n\t{\n\t\tif (is_numeric($count)) {\n\t\t\t$this->_totalItemCount = (int)$count;\n\t\t}\n\t}",
"function setProperty() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $properties = func_get_arg(0);\n if (is_array($properties)) {\n foreach($properties as $key => $val) {\n if ( ! isset($this->component_property[$key])) {\n $message = '[' . $this->CI->ciwy->library_name . '] '. $key . ' is not a '.$this->component_name .' Property.';\n log_message('error', $message);\n show_error($message);\n } else {\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $val;\n }\n }\n }\n }",
"public function reSetMembersCount()\n\t{\n\t\tif($this->getInheritanceType() == InheritanceType::INHERIT)\n\t\t{\n\t\t\t$this->setMembersCount($this->getInheritParent()->getMembersCount());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$criteria = KalturaCriteria::create(categoryKuserPeer::OM_CLASS);\n\t\t\t$criteria->addAnd(categoryKuserPeer::CATEGORY_ID, $this->getId(), Criteria::EQUAL);\n\t\t\t$criteria->addAnd(categoryKuserPeer::STATUS, CategoryKuserStatus::ACTIVE, Criteria::EQUAL);\n\t\t\t$this->setMembersCount(categoryKuserPeer::doCount($criteria));\n\t\t}\n\t}",
"public function setPropertyValuesCount(string $symbol, int $propertyValuesCount): Statistics {\n\t\t$this->addProperty($symbol);\n\t\t$this->properties[$symbol]['count'] = $propertyValuesCount;\n\n\t\treturn $this;\n\t}",
"public function setProperties($properties)\r\n {\r\n if (!empty($properties)) {\r\n foreach ($properties as $key => $val) {\r\n $this->$key = $val;\r\n }\r\n }\r\n }",
"public function setCountQuery(SelectQueryInterface $query) {\n $this->customCountQuery = $query;\n }",
"public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}",
"private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }",
"public function setState( array $properties )\n {\n foreach ( $properties as $name => $value )\n {\n $this->properties[$name] = $value;\n }\n }",
"protected function set_total_count( $count ) {\n\t\taffiliate_wp()->utils->data->write( \"{$this->batch_id}_total_count\", $count );\n\t}",
"private function api_set_properties( $properties ) {\n\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// identify user first\n\t\t$this->set_named_identity( null );\n\n\t\t// remove blank properties\n\t\tif( isset( $properties[''] ) ) {\n\t\t\tunset( $properties[''] );\n\t\t}\n\n\t\t// record the properties\n\t\t$this->get_api()->set( $properties );\n\t}",
"public function count()\t{\n\t\t$this->stringBase = preg_replace('/:fields/', 'count(*)', $this->stringBase);\n\t\treturn $this;\n\t}",
"public function setSettingCount(?int $value): void {\n $this->getBackingStore()->set('settingCount', $value);\n }",
"public function setInputProperty($key, $value);",
"function initializeImageProperties()\n\t{\n\t\tlist($this->width, $this->height, $iType, $this->htmlattributes) = getimagesize($this->sFileLocation);\n\n\t\tif (($this->width < 1) || ($this->height < 1)) {\n\t\t\t$this->printError('invalid imagesize');\n\t\t}\n\n\t\t$this->setImageOrientation();\n\t\t$this->setImageType($iType);\n\t}",
"public function count()\n {\n // NOTE: Cannot use \\COUNT_RECURSIVE because that counts the arrays\n // as well as their contents. We want a count only of Properties.\n $count = 0;\n foreach ($this->data as $key=>$values)\n {\n if (is_array($this->data[$key]))\n $count += count($values);\n else\n $count += 1;\n }\n return $count;\n }",
"public function setCount(int $count): SpellcheckInterface\n {\n return $this->setOption('count', $count);\n }",
"public function subpropertyJoinCountTest() {}",
"abstract protected function properties();",
"public function setMemberCount($newValue) {\r\n $this->cached_member_count = $newValue;\r\n }",
"public function setCountTo(?array $countTo): InfoboxInterface;",
"public function setProperties(array $data)\n {\n $this->properties = $data;\n }",
"function __construct() {\n self::$_count++;\n }",
"public function setProperties(array $properties) \n\t{\n\t\tforeach ($properties as $name => $value) {\n\t\t\t$this->set($name, $value);\n\t\t}\n\t}",
"public function setCount($value)\n {\n return $this->set('Count', $value);\n }",
"public function setCount($value)\n {\n return $this->set('Count', $value);\n }",
"public function set_attributes()\n {\n $this->id = 0;\n $this->set_process();\n $this->set_decomposition();\n $this->set_technique();\n $this->set_applicability();\n $this->set_input();\n $this->set_output();\n $this->set_validation();\n $this->set_quality();\n $this->score = 0;\n $this->matchScore = 0;\n $this->misMatch = \"\";\n }",
"public function setCount($count)\n {\n $this->vkarg_count = $count;\n\n return $this;\n }",
"public function setCount($count)\n {\n $this->vkarg_count = $count;\n\n return $this;\n }",
"public function setCount($count)\n {\n $this->count = $count;\n\n return $this;\n }",
"public function inputcount(){\n \treturn ser_inputcount();\n }",
"public function setTotalCount($totalCount);",
"public function testConfigCount()\n {\n $this->specify(\n \"Returns the count of properties set in the config\",\n function () {\n $config = new Config([\n \"controllersDir\" => \"../x/y/z\",\n \"modelsDir\" => \"../x/y/z\",\n ]);\n\n expect(count($config))->equals(2);\n expect($config->count())->equals(2);\n }\n );\n }",
"public function setWordCount($count)\r\n\t\t{\r\n\t\t\t$this->_word_count = $count;\r\n\t\t}",
"function properties()\n {\n }",
"function MyMod_Paging_NPages_Set()\n {\n if ($this->NumberOfItems>$this->NItemsPerPage)\n {\n $this->MyMod_Paging_N=intval($this->NumberOfItems/$this->NItemsPerPage);\n $res=$this->NumberOfItems % $this->NItemsPerPage;\n if ($res>0) { $this->MyMod_Paging_N++; }\n }\n elseif ($this->NumberOfItems>0)\n {\n $this->MyMod_Paging_N=1;\n }\n else\n {\n $this->MyMod_Paging_N=0;\n }\n }",
"public static function __set_state(array $properties);",
"public function getFieldCount() {}",
"static public function __hx__paramsCount () {\n\t\treturn [\n\t\t\t'Noise' => 0,\n\t\t];\n\t}",
"public function flushProperties()\n\t{\n\t\t$this->properties = array();\n\t}",
"public function testSetNbPoints() {\n\n $obj = new Employes();\n\n $obj->setNbPoints(10);\n $this->assertEquals(10, $obj->getNbPoints());\n }",
"public function setNumberOfHMetrics($value) {}",
"public function getMaxProperties(): int\n {\n return $this->maxProperties;\n }",
"public function set_props($object_type, $args)\n {\n }",
"public function _pseudo_numberOfFields() {\n return count($this->data);\n }",
"function updateProperties($mutations);",
"protected function setCounts(DomNode $node)\n {\n foreach ($this->counts as $level => $count) {\n if ($level == $node->nodeName) {\n $this->counts[$level] ++;\n }\n if ($level > $node->nodeName) {\n $this->counts[$level] = 0;\n }\n }\n }",
"public function fill(array $properties)\n {\n foreach($properties as $arg => $value) {\n $this->setPublicProperty($arg, $value);\n }\n }",
"public static function setFieldsInRow(int $count = 4): void\n {\n self::$fieldsInRow = in_array($count, [4, 6]) ? $count : 4;\n }",
"public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}",
"function resetCountAdded()\n {\n\t$this->start_count_vehicles = 0;\n\t$this->stop_count_vehicles = 0;\n\n\t$this->count_added_by_level = array();\n\t$this->start_count_added_by_level = array();\n\t$this->stop_count_added_by_level = array();\n\tforeach ($this->getSchema()->getLevels() as $level)\n\t{\n\t $this->count_added_by_level[$level] = 0;\n\t $this->start_count_added_by_level[$level] = 0;\n\t $this->stop_count_added_by_level[$level] = 0;\n\t}\n }",
"public function __construct( ) {\n foreach( $_REQUEST as $property=>$value){\n $this->$property = $value;\n }\n \n }",
"private function init_properties( array $properties ) {\n\t\t// recursively filter null values\n\t\t$this->properties = Arrays::filter_recursive( $properties );\n\t\t// collect all attributes properties for this element\n\t\t$this->collect_attributes();\n\t}",
"function __construct( $props = [] ) {\n $this->studiesToRamRatio = 1000;\n $this->ramToStudiesRatioMB = 500;\n $this->ram1GbPerHourCost = 0.00553;\n $this->storageUsePerStudyInMb = 10;\n $this->storage1GbPerMonthCost = 0.10;\n\n // Set property value if given\n foreach( $props as $name => $value ) :\n if( property_exists ( $this, $name) ) :\n $this->$name = $value;\n endif;\n endforeach;\n\n $this->ramPerStudyCostIn1Day = $this->computeRamPerStudyCostIn1Day();\n \n }",
"public function _setNumberOfControls($numberOfControls) {\n\t\t$this->_numberOfControls = $numberOfControls;\n\t}",
"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}",
"function setRecordsPerPage($count) {\n $this->records_per_page = $count;\n}"
]
| [
"0.69694656",
"0.63010234",
"0.6175127",
"0.6174276",
"0.61213934",
"0.61034715",
"0.60968995",
"0.60968995",
"0.6071019",
"0.6047256",
"0.58441746",
"0.56193525",
"0.55897",
"0.5579232",
"0.55421305",
"0.5539122",
"0.55199695",
"0.54553664",
"0.5443289",
"0.54192597",
"0.5370466",
"0.5362045",
"0.5337144",
"0.53290033",
"0.5299671",
"0.5260943",
"0.5259296",
"0.52121234",
"0.52105105",
"0.51881355",
"0.5186372",
"0.518289",
"0.5173181",
"0.5160537",
"0.513322",
"0.51281905",
"0.5126713",
"0.51158684",
"0.5115694",
"0.5100908",
"0.5092542",
"0.50902396",
"0.50876",
"0.505432",
"0.50411737",
"0.50177294",
"0.50140554",
"0.50107306",
"0.50092936",
"0.5007588",
"0.5004705",
"0.50009185",
"0.49951118",
"0.49939084",
"0.49922308",
"0.4988951",
"0.49609768",
"0.49606973",
"0.49537274",
"0.4953483",
"0.49498388",
"0.49495715",
"0.49450934",
"0.4940769",
"0.49320403",
"0.4923203",
"0.4921232",
"0.49179992",
"0.49179992",
"0.49169886",
"0.49106622",
"0.49106622",
"0.49076468",
"0.4903122",
"0.49022615",
"0.4898753",
"0.48974025",
"0.48901144",
"0.48850155",
"0.48848587",
"0.48846683",
"0.4881069",
"0.48685497",
"0.48640212",
"0.48606932",
"0.48561132",
"0.48520985",
"0.48508853",
"0.48471177",
"0.4843043",
"0.48389506",
"0.48359016",
"0.4834219",
"0.4827582",
"0.48272997",
"0.48266453",
"0.48237818",
"0.48197907",
"0.48184645",
"0.48150635"
]
| 0.7085941 | 0 |
Get count of values under a property | public function getPropertyValuesCount(string $symbol): int {
return $this->properties[$symbol]['count'] ?? 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function count()\n {\n // NOTE: Cannot use \\COUNT_RECURSIVE because that counts the arrays\n // as well as their contents. We want a count only of Properties.\n $count = 0;\n foreach ($this->data as $key=>$values)\n {\n if (is_array($this->data[$key]))\n $count += count($values);\n else\n $count += 1;\n }\n return $count;\n }",
"public function count()\n {\n return count($this->valueOf());\n }",
"public function count()\n {\n return $this->getValue()->count();\n }",
"public function __get($property)\n\t{\n\t\tswitch ($property)\n\t\t{\n\t\t\tcase 'children_count': return count($this->children);\n\t\t\tcase 'descendents': return $this->get_descendents();\n\t\t\tcase 'descendents_count': return $this->get_descendents_count();\n\t\t}\n\n\t\treturn $this->record->$property;\n\t}",
"function statistics_extended_groups_property_count($property){\r\n\tglobal $CONFIG;\r\n\t$properties = $CONFIG->group;\r\n\t$labels = array();\r\n\t$totals = array();\r\n\tif(array_key_exists($property,$properties)){\r\n\t\tlist($type,$values) = $properties[$property];\r\n\t\tswitch($type){\r\n\t\t\tcase \"checkboxes\":\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tforeach($values as $label=>$value){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"organizational_unit\":\r\n\t\t\t\t$query = \"SELECT string FROM {$CONFIG->dbprefix}metastrings WHERE id IN \";\r\n\t\t\t\t$query.=\"(SELECT value_id FROM {$CONFIG->dbprefix}metadata WHERE name_id=\";\r\n\t\t\t\t$query.=\"(SELECT id FROM {$CONFIG->dbprefix}metastrings WHERE string='{$property}'))\";\r\n\t\t\t\t$categories = get_data($query);\r\n\t\t\t\tif(!empty($categories)){\r\n\t\t\t\t\tforeach($categories as $category){\r\n\t\t\t\t\t\t$category = $category->string;\r\n\t\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$category);\r\n\t\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t\tlist($section,$department,$unit) = explode(\"||\",$category);\r\n\r\n\t\t\t\t\t\t$labels[$section]=$section;\r\n\t\t\t\t\t\t$totals[$section]+=$total;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"status\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\t\t\t\t$values = array(\"preparation\"=>\"groups:extras:status:preparation\",\r\n\t\t\t\t\t\t\t\t\"active\"=>\"groups:extras:status:active\",\r\n\t\t\t\t\t\t\t\t\"inactive\"=>\"groups:extras:status:inactive\",\r\n\t\t\t\t\t\t\t\t\"closed\"=>\"groups:extras:status:closed\");\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$label;\r\n\t\t\t\t\t$totals[$label]=(int)$total;\r\n\t\t\t\t}\r\n\t\t\t\t$totals[\"groups:extras:status:active\"]=$all_groups-$totals[\"groups:extras:status:inactive\"]-$totals[\"groups:extras:status:closed\"];\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\tswitch($property){\r\n\t\t\tcase \"content_privacy\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>\"no\");\r\n\t\t\t\t$count_no = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\r\n\t\t\t\t// How content_privacy is a new feature it is no available for all groups\r\n\t\t\t\t$labels[]=\"yes\";\r\n\t\t\t\t$totals[\"yes\"]=$all_groups - $count_no;\r\n\t\t\t\t$labels[]=\"no\";\r\n\t\t\t\t$totals[\"no\"]=$count_no;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"membership\":\r\n\t\t\t\t$values = array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public'));\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn array($labels,$totals);\r\n}",
"public function getValueCount()\n {\n return $this->count(self::VALUE);\n }",
"public function countValue($value);",
"public function count() {\n\t\treturn count($this->values);\n\t}",
"public function countValues($resource, $property, $type = null, $lang = null)\n {\n return count($this->all($resource, $property, $type, $lang));\n }",
"public function count ( )\n {\n return count($this->_values);\n }",
"public function count()\r\n {\r\n return count($this->_values);\r\n }",
"public function count()\n\t{\n\t\treturn count($this->values);\n\t}",
"public function __get($property)\n {\n switch ($property) {\n case 'columns':\n return $this->getColumnCount();\n case 'rows':\n return $this->getRowCount();\n default:\n return null;\n }\n }",
"public function count()\n\t{\n\t\treturn count($this->getListByKey());\n\t}",
"public function properties($_this, bool $disposeArrays = true): int\n {\n $count = 0;\n\n $reflector = new \\ReflectionClass($_this);\n foreach ($reflector->getProperties() as $property) {\n if ($this->property($_this, $property, $disposeArrays)) {\n $count++;\n }\n }\n\n return $count;\n }",
"public function subpropertyJoinCountTest() {}",
"function count() {\n\t\treturn count($this->variable);\n\t}",
"public function count(): int {\n return count($this->toArray());\n }",
"public abstract function get_counts();",
"function count() {\n return count($this->data);\n }",
"public function count() {\n\t\treturn count($this->getData());\n\t}",
"public function length(PropertyValueInterface $propertyValue);",
"public function count()\n\t{\n\t\treturn $this->getParentObject()->count();\n\t}",
"public function countUsersByProperty($attribute = null, $value = null)\n {\n\n \\Log::info ( \"===== count query begin\" );\n $query = $this->model;\n\n if ( isset( $attribute ) && isset( $value ) ) {\n\n $query = $query->where ( $attribute, $value );\n }\n\n $count = $query->count ();\n \\Log::info ( \"===== count query end\" );\n\n return $count;\n }",
"function count() {\n\t\treturn count($this->data);\n\t}",
"public function count()\r\n {\r\n return count($this->data);\r\n }",
"public function countKeys();",
"public function count() {\n\t\treturn count($this->data);\n\t}",
"public function count(): int\n {\n return count( $this->toArray() );\n }",
"public function count() {\r\n return count($this->data);\r\n }",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();",
"public function count()\n {\n return count($this->countable);\n }",
"#[\\ReturnTypeWillChange]\n public function count() {\n return count($this->all());\n }",
"public function count()\n {\n return count( $this->data );\n }",
"public function count()\n {\n return count($this->activeValue);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count() {\n return count($this->cast);\n }",
"public function count(): int\n {\n // TODO: Implement count() method.\n return count($this->toArray());\n }",
"public function count() {\r\n return count($this->objects);\r\n }",
"public abstract function field_count();",
"public static function getAllPropertiesCount($userid) {\n\t\t$count = self::getPropertiesOfUser ( $userid );\n\t\tif ($count)\n\t\treturn count ( $count );\n\t\telse\n\t\treturn 0;\n\n\t}",
"#[\\ReturnTypeWillChange]\n public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function getAttributeCount();",
"public function count() {\n return count($this->_data);\n }",
"public function count() {\n\t\treturn count($this->_data);\n\t}",
"function get_object_count()\r\n {\r\n return $this->get_browser()->count_profile_publications($this->get_condition());\r\n }",
"public function count() {\n\t\treturn count($this->_aSet);\n\t}",
"public function count() {\n\t\t// return $this->_count;\n\t\treturn count($this->_data);\n\t}",
"public function getFieldCount() {}",
"function count()\n {\n $retval = 0;\n $key = $this->object->get_primary_key_column();\n $results = $this->object->run_query(\"SELECT COUNT(`{$key}`) AS `{$key}` FROM `{$this->object->get_table_name()}`\");\n if ($results && isset($results[0]->{$key})) {\n $retval = (int) $results[0]->{$key};\n }\n return $retval;\n }",
"public function totalCount();",
"public function totalCount();",
"public function _count();",
"public function count() {\n\t\treturn count($this->_dataobjects);\n\t}",
"public function count() {\r\n if (is_null($this->objectcount)) {\r\n $this->fetchData();\r\n }\r\n return $this->objectcount;\r\n }",
"public function count() {\n\t\treturn count($this->array);\n\t}",
"public function count()\n {\n return count($this->_data);\n }",
"public static function count();",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"public function count()\n {\n return $this->client->count($this->compile())['count'];\n }",
"public function size() {\n return n(count($this->value()));\n }",
"public function getCountsList(){\n return $this->_get(6);\n }",
"public function getInputPropertiesCount(): int {\n\t\treturn $this->inputPropertiesCount;\n\t}",
"public function count() { return $this->_m_count; }"
]
| [
"0.7564415",
"0.70154315",
"0.696972",
"0.6822689",
"0.6812978",
"0.67410296",
"0.6739003",
"0.6716774",
"0.67053413",
"0.6686603",
"0.6660184",
"0.66534156",
"0.6595503",
"0.65755075",
"0.6545256",
"0.65203416",
"0.6485497",
"0.6483832",
"0.64135927",
"0.6359969",
"0.6321753",
"0.63167214",
"0.6308972",
"0.63010746",
"0.62980443",
"0.62969774",
"0.6295707",
"0.62836295",
"0.6281945",
"0.627291",
"0.62707114",
"0.62707114",
"0.62707114",
"0.626331",
"0.62619734",
"0.626078",
"0.62578475",
"0.62565994",
"0.62565994",
"0.62565994",
"0.62565994",
"0.62565994",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.62564015",
"0.6255841",
"0.6248407",
"0.6247443",
"0.62430197",
"0.6233075",
"0.62234014",
"0.62160856",
"0.62160856",
"0.62160856",
"0.62160856",
"0.62160856",
"0.6200627",
"0.6194678",
"0.61938244",
"0.61767095",
"0.6160704",
"0.61525655",
"0.61466485",
"0.6141605",
"0.613744",
"0.613744",
"0.61367524",
"0.6135191",
"0.613429",
"0.61064667",
"0.609214",
"0.60910976",
"0.60685885",
"0.60685885",
"0.60685885",
"0.60685885",
"0.6066403",
"0.6064995",
"0.60611296",
"0.60589725",
"0.60571647"
]
| 0.6998376 | 2 |
Set count of values under a property | public function setPropertyValuesCount(string $symbol, int $propertyValuesCount): Statistics {
$this->addProperty($symbol);
$this->properties[$symbol]['count'] = $propertyValuesCount;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setCount( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Count = $value;\n setType( $this->Count, \"integer\" );\n }",
"public function updatePropertyIndex ()\n {\n $new_properties_table = array();\n\n foreach ( $this as $declaration ) {\n\n $name = $declaration->property;\n\n if ( isset( $new_properties_table[ $name ] ) ) {\n $new_properties_table[ $name ]++;\n }\n else {\n $new_properties_table[ $name ] = 1;\n }\n }\n $this->properties = $new_properties_table;\n }",
"public function setCount($countIn) {$listCount = $countIn;}",
"protected function setCount($count) {\r\n $this->count = $count;\r\n }",
"private function _setCount($count)\n\t{\n\t\t$this->_count = $count;\n\t}",
"public function subpropertyJoinCountTest() {}",
"public function setProductItemCounts($val)\n {\n $this->_propDict[\"productItemCounts\"] = $val;\n return $this;\n }",
"public function setCount($value)\n {\n return $this->set('Count', $value);\n }",
"public function setCount($value)\n {\n return $this->set('Count', $value);\n }",
"public function setCount(int $count)\n {\n $this->count = $count;\n }",
"public function setCount($count)\n {\n $this->count = $count;\n }",
"public function setCount($count)\n {\n $this->count = $count;\n }",
"public function setMemberCount($newValue) {\r\n $this->cached_member_count = $newValue;\r\n }",
"public function setCount(int $count): void\n {\n $this->count = $count;\n }",
"public function setCount($value) {\n return $this->set(self::COUNT, $value);\n }",
"function statistics_extended_groups_property_count($property){\r\n\tglobal $CONFIG;\r\n\t$properties = $CONFIG->group;\r\n\t$labels = array();\r\n\t$totals = array();\r\n\tif(array_key_exists($property,$properties)){\r\n\t\tlist($type,$values) = $properties[$property];\r\n\t\tswitch($type){\r\n\t\t\tcase \"checkboxes\":\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tforeach($values as $label=>$value){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"organizational_unit\":\r\n\t\t\t\t$query = \"SELECT string FROM {$CONFIG->dbprefix}metastrings WHERE id IN \";\r\n\t\t\t\t$query.=\"(SELECT value_id FROM {$CONFIG->dbprefix}metadata WHERE name_id=\";\r\n\t\t\t\t$query.=\"(SELECT id FROM {$CONFIG->dbprefix}metastrings WHERE string='{$property}'))\";\r\n\t\t\t\t$categories = get_data($query);\r\n\t\t\t\tif(!empty($categories)){\r\n\t\t\t\t\tforeach($categories as $category){\r\n\t\t\t\t\t\t$category = $category->string;\r\n\t\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$category);\r\n\t\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t\tlist($section,$department,$unit) = explode(\"||\",$category);\r\n\r\n\t\t\t\t\t\t$labels[$section]=$section;\r\n\t\t\t\t\t\t$totals[$section]+=$total;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"status\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\t\t\t\t$values = array(\"preparation\"=>\"groups:extras:status:preparation\",\r\n\t\t\t\t\t\t\t\t\"active\"=>\"groups:extras:status:active\",\r\n\t\t\t\t\t\t\t\t\"inactive\"=>\"groups:extras:status:inactive\",\r\n\t\t\t\t\t\t\t\t\"closed\"=>\"groups:extras:status:closed\");\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$label;\r\n\t\t\t\t\t$totals[$label]=(int)$total;\r\n\t\t\t\t}\r\n\t\t\t\t$totals[\"groups:extras:status:active\"]=$all_groups-$totals[\"groups:extras:status:inactive\"]-$totals[\"groups:extras:status:closed\"];\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\tswitch($property){\r\n\t\t\tcase \"content_privacy\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>\"no\");\r\n\t\t\t\t$count_no = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\r\n\t\t\t\t// How content_privacy is a new feature it is no available for all groups\r\n\t\t\t\t$labels[]=\"yes\";\r\n\t\t\t\t$totals[\"yes\"]=$all_groups - $count_no;\r\n\t\t\t\t$labels[]=\"no\";\r\n\t\t\t\t$totals[\"no\"]=$count_no;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"membership\":\r\n\t\t\t\t$values = array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public'));\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn array($labels,$totals);\r\n}",
"public function setCount($value)\n {\n return $this->set(self::COUNT, $value);\n }",
"public function countValue($value);",
"public function setInsightCounts($val)\n {\n $this->_propDict[\"insightCounts\"] = $val;\n return $this;\n }",
"public function setCount(int $value): Get\n {\n $this->count = $value;\n return $this;\n }",
"protected function setCounts(DomNode $node)\n {\n foreach ($this->counts as $level => $count) {\n if ($level == $node->nodeName) {\n $this->counts[$level] ++;\n }\n if ($level > $node->nodeName) {\n $this->counts[$level] = 0;\n }\n }\n }",
"public function count()\n {\n // NOTE: Cannot use \\COUNT_RECURSIVE because that counts the arrays\n // as well as their contents. We want a count only of Properties.\n $count = 0;\n foreach ($this->data as $key=>$values)\n {\n if (is_array($this->data[$key]))\n $count += count($values);\n else\n $count += 1;\n }\n return $count;\n }",
"public function setCount(int $value): GetAllComments\n {\n $this->count = $value;\n return $this;\n }",
"static public function setTotalCount( $count )\n\t{\n\t\tself::$count = $count;\n\t}",
"public function getPropertyValuesCount(string $symbol): int {\n\t\treturn $this->properties[$symbol]['count'] ?? 0;\n\t}",
"public function setMemberCnt($value)\n {\n return $this->set(self::_MEMBER_CNT, $value);\n }",
"public function setSettingCount(?int $value): void {\n $this->getBackingStore()->set('settingCount', $value);\n }",
"public function setCountHits(?int $value): void {\n $this->getBackingStore()->set('countHits', $value);\n }",
"public function setCount(int $value): GetTopics\n {\n $this->count = $value;\n return $this;\n }",
"public function setItemCount($val)\n {\n $this->_propDict[\"itemCount\"] = $val;\n return $this;\n }",
"public function setInputPropertiesCount(int $inputPropertiesCount): Statistics {\n\t\t$this->inputPropertiesCount = $inputPropertiesCount;\n\n\t\treturn $this;\n\t}",
"protected function _setCount()\n\t{\n\t\t$cacheKey = 'toolbar_count_' . $this->getSubject()->model->alias . '_user_' . AuthComponent::user('id');\n\n\t\tif (($count = Cache::read($cacheKey, 'trash_settings')) === false) {\n\t\t\t$Filter = $this->_listener('Trash')->initTrashFilter();\n\n\t\t\t// lets attach all listeners that changes output (this should be made more dry)\n\t\t\t// check if VisualisationListener is used in current Crud\n\t\t\tif ($this->_crud()->config('listeners.Visualisation') !== null) {\n\t\t\t\t$this->_listener('Visualisation')->attachListener($Filter);\n\t\t\t}\n\n\t\t\t$this->_listener('Trash')->attachListener($Filter);\n\n\t\t\t$count = $Filter->filter('count');\n\t\t\tunset($Filter);\n\n\t\t\tCache::write($cacheKey, $count, 'trash_settings');\n\t\t}\n\t\t\n\t\t$this->_count = $count;\n\t}",
"public function __set($property, $value) {}",
"public function subpropertyInMultipleLeftJoinCountTest() {}",
"function set_num_items($num){\n $this -> num_of_items = $num;\n }",
"public function reSetMembersCount()\n\t{\n\t\tif($this->getInheritanceType() == InheritanceType::INHERIT)\n\t\t{\n\t\t\t$this->setMembersCount($this->getInheritParent()->getMembersCount());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$criteria = KalturaCriteria::create(categoryKuserPeer::OM_CLASS);\n\t\t\t$criteria->addAnd(categoryKuserPeer::CATEGORY_ID, $this->getId(), Criteria::EQUAL);\n\t\t\t$criteria->addAnd(categoryKuserPeer::STATUS, CategoryKuserStatus::ACTIVE, Criteria::EQUAL);\n\t\t\t$this->setMembersCount(categoryKuserPeer::doCount($criteria));\n\t\t}\n\t}",
"public function setCount(int $value): GetComments\n {\n $this->count = $value;\n return $this;\n }",
"public function length(PropertyValueInterface $propertyValue);",
"public function subpropertyJoinSameTableCountTest() {}",
"public function setCount(int $count) : self\n {\n $this->count = $count;\n return $this;\n }",
"public function properties($_this, bool $disposeArrays = true): int\n {\n $count = 0;\n\n $reflector = new \\ReflectionClass($_this);\n foreach ($reflector->getProperties() as $property) {\n if ($this->property($_this, $property, $disposeArrays)) {\n $count++;\n }\n }\n\n return $count;\n }",
"public function reSetEntriesCount()\n\t{\n\t\t$criteria = KalturaCriteria::create(categoryEntryPeer::OM_CLASS);\n\t\t$criteria->addAnd(categoryEntryPeer::CATEGORY_FULL_IDS, $this->getFullIds() . '%', Criteria::LIKE);\n\t\t$count = categoryEntryPeer::doCount($criteria);\n\n\t\t$this->setEntriesCount($count);\n\t}",
"public function setCountImported($val)\n {\n $this->_propDict[\"countImported\"] = $val;\n return $this;\n }",
"public function setCount($count)\n {\n $this->Count = $count;\n return $this;\n }",
"public function addCounts( $value){\n return $this->_add(6, $value);\n }",
"public function count(): static\n {\n return $this->withProperty('isCount', true);\n }",
"public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }",
"public function setCount($count)\n {\n $this->count = $count;\n return $this;\n }",
"function update_view_count($table, $set_field, $where_field, $where_value)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"UPDATE $table SET $set_field = $set_field + 1 WHERE $where_field = $where_value\";\n\n\t\tif ( !$db->sql_query($sql) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, \"Could Not Update Count\", '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}",
"public function countValues($resource, $property, $type = null, $lang = null)\n {\n return count($this->all($resource, $property, $type, $lang));\n }",
"function tidy_config_count(tidy $object) {}",
"function count(){}",
"public function setCount(int $value): GetSuggestions\n {\n $this->count = $value;\n return $this;\n }",
"public function set($property, $value);",
"public function count()\n {\n return $this->getValue()->count();\n }",
"public function bumpField($key,$count = 1){\n \n $val = $this->getField($key,0);\n $val += $count;\n $this->setField($key,$val);\n return $val;\n \n }",
"public function setCountHosts(?int $value): void {\n $this->getBackingStore()->set('countHosts', $value);\n }",
"public function setTotalCount($totalCount);",
"public function setCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->writeOneof(1, $var);\n\n return $this;\n }",
"function setPostViews($postID) {\r\n $count_key = 'post_views_count';\r\n $count = get_post_meta($postID, $count_key, true);\r\n if($count==''){\r\n add_post_meta($postID, $count_key, '1');\r\n }else{\r\n $count++;\r\n update_post_meta($postID, $count_key, $count);\r\n }\r\n}",
"public function getInputPropertiesCount(): int {\n\t\treturn $this->inputPropertiesCount;\n\t}",
"public function count()\n {\n return count($this->valueOf());\n }",
"private function countLength() {\n\n $this->_length = strlen($this->_value);\n }",
"function __set($property, $value) {\n global $DB;\n if(is_array($value) && @$this->TYPE[$property] === 'CSV') $value = join(',',$value);\n if(!isset($this->DATA[$property])\n || $this->DATA[$property] !== $value) {\n $DB->config->update(array('value' => $value), array('property' => $property, 'section' => $this->NAME), true);\n $this->DATA[$property] = $value;\n }\n }",
"public function count()\t{\n\t\t$this->stringBase = preg_replace('/:fields/', 'count(*)', $this->stringBase);\n\t\treturn $this;\n\t}",
"abstract protected function propertySet($name, $value);",
"private function setNumResults()\n\t{\n\t\t$this->numResults = (int) count($this->data);\n\t}",
"public function set_many(array $keyvaluearray) {\n $count = 0;\n foreach ($keyvaluearray as $pair) {\n if ($this->set($pair['key'], $pair['value'])) {\n $count++;\n }\n }\n return $count;\n }",
"public function setCachedCount($query, $count)\n {\n $hash = $this->hash($query);\n $this->cachedCounts[$hash] = $count;\n }",
"function setMultiple($properties) {\n foreach ($properties as $property => $value) {\n $this->set($property, $value);\n }\n }",
"public function setItemCount($value)\n {\n return $this->set(self::_ITEM_COUNT, $value);\n }",
"public function setCountEntitledForProvisioning($val)\n {\n $this->_propDict[\"countEntitledForProvisioning\"] = $val;\n return $this;\n }",
"public function setCount(int $value): SearchConversations\n {\n $this->count = $value;\n return $this;\n }",
"function setPostViews($postID) {\n $countKey = 'post_views_count';\n $count = get_post_meta($postID, $countKey, true);\n // die(var_dump($count));\n if($count==''){\n $count = 0;\n delete_post_meta($postID, $countKey);\n add_post_meta($postID, $countKey, '0');\n }else{\n $count++;\n update_post_meta($postID, $countKey, $count);\n }\n}",
"public function count(): int\n {\n $arr = $this->all();\n $this->items = (fn(): Generator => yield from $arr)();\n\n return count($arr);\n }",
"public function setNumberOfHMetrics($value) {}",
"public function testCount()\n\t{\n\t\t$this->assertEquals(3, count($this->instance));\n\t}",
"private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }",
"function set_property(){\n }",
"public function setCountQuery(SelectQueryInterface $query) {\n $this->customCountQuery = $query;\n }",
"function setPostViews($postID) {\n $count_key = 'post_views_count';\n $count = get_post_meta($postID, $count_key, true);\n if($count==''){\n $count = 0;\n delete_post_meta($postID, $count_key);\n add_post_meta($postID, $count_key, '0');\n }else{\n $count++;\n update_post_meta($postID, $count_key, $count);\n }\n}",
"function setPostViews($postID) {\n $count_key = 'post_views_count';\n $count = get_post_meta($postID, $count_key, true);\n if($count==''){\n $count = 0;\n delete_post_meta($postID, $count_key);\n add_post_meta($postID, $count_key, '0');\n }else{\n $count++;\n update_post_meta($postID, $count_key, $count);\n }\n}",
"function setPostViews($postID) {\n $count_key = 'post_views_count';\n $count = get_post_meta($postID, $count_key, true);\n if($count==''){\n $count = 0;\n delete_post_meta($postID, $count_key);\n add_post_meta($postID, $count_key, '0');\n }else{\n $count++;\n update_post_meta($postID, $count_key, $count);\n }\n}",
"public function _count();",
"public function setCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->count = $var;\n\n return $this;\n }",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"public function getValueSetProvisionsCount()\n {\n return $this->count(self::VALUE_SET_PROVISIONS);\n }",
"function wpb_set_post_views($postID) {\n $count_key = 'wpb_post_views_count';\n $count = get_post_meta($postID, $count_key, true);\n if($count==''){\n $count = 0;\n delete_post_meta($postID, $count_key);\n add_post_meta($postID, $count_key, '0');\n }else{\n $count++;\n update_post_meta($postID, $count_key, $count);\n }\n}",
"function wpb_set_post_views( $postID ) {\n $count_key = 'wpb_post_views_count';\n $count = get_post_meta( $postID, $count_key, true );\n\n if( $count=='' ){\n $count = 0;\n delete_post_meta( $postID, $count_key );\n add_post_meta( $postID, $count_key, '0' );\n }else{\n $count++;\n update_post_meta( $postID, $count_key, $count );\n }\n}",
"function assign_subordinate_count($employee) {\n\t$count = 0;\n\t//Get subordinate employees of current employee\n\t$employees = $employee->getSubordinates();\n\t//Add to count\n\t$count += count($employees);\n\t//Recursively add all subordinate employees number of employees to current employees count\n\tforeach($employees AS $emp) {\n\t\t$count += assign_subordinate_count($emp);\n\t}\n\t//Update number of subordinate employees for this employee\n\t$employee->setNumSubordinates($count);\n\t//Destroy the subordinates attribute so returned data will be flat array/chop off multidimensional array\n\t$employee->destroySubordinates();\n\treturn $count;\n}",
"public function setCount(int $count): SpellcheckInterface\n {\n return $this->setOption('count', $count);\n }",
"function resetCountAdded()\n {\n\t$this->start_count_vehicles = 0;\n\t$this->stop_count_vehicles = 0;\n\n\t$this->count_added_by_level = array();\n\t$this->start_count_added_by_level = array();\n\t$this->stop_count_added_by_level = array();\n\tforeach ($this->getSchema()->getLevels() as $level)\n\t{\n\t $this->count_added_by_level[$level] = 0;\n\t $this->start_count_added_by_level[$level] = 0;\n\t $this->stop_count_added_by_level[$level] = 0;\n\t}\n }",
"public function setCountEscrowed($val)\n {\n $this->_propDict[\"countEscrowed\"] = $val;\n return $this;\n }",
"public function getValueCount()\n {\n return $this->count(self::VALUE);\n }",
"#[\\ReturnTypeWillChange]\n public function count()\n {\n }",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"public function count(){\n return $this->_count;\n }"
]
| [
"0.6968318",
"0.66536176",
"0.6243073",
"0.6178101",
"0.609588",
"0.60792136",
"0.6075399",
"0.5988172",
"0.5988172",
"0.5975077",
"0.5959402",
"0.5959402",
"0.59071386",
"0.5903008",
"0.5847948",
"0.5809786",
"0.579252",
"0.57305956",
"0.5716023",
"0.5715569",
"0.56998",
"0.5699319",
"0.56513005",
"0.5604944",
"0.55971104",
"0.5587607",
"0.55829114",
"0.5560974",
"0.5555863",
"0.5548235",
"0.55302525",
"0.5501265",
"0.5479841",
"0.54754573",
"0.54347014",
"0.54152256",
"0.54023",
"0.53928155",
"0.5381577",
"0.5370486",
"0.5351447",
"0.53502584",
"0.53108495",
"0.5305497",
"0.529399",
"0.52802074",
"0.5272594",
"0.5261248",
"0.5259707",
"0.52412593",
"0.5236338",
"0.52258277",
"0.5224343",
"0.5221786",
"0.52215725",
"0.5218237",
"0.52088135",
"0.51943034",
"0.5179585",
"0.51768106",
"0.5170702",
"0.51607144",
"0.51572174",
"0.515717",
"0.5155836",
"0.5155274",
"0.5154115",
"0.51450413",
"0.5144488",
"0.5130897",
"0.5124844",
"0.511969",
"0.51146877",
"0.5112371",
"0.5112218",
"0.51060444",
"0.51045126",
"0.5099704",
"0.5098178",
"0.5093937",
"0.5092299",
"0.5092299",
"0.5092299",
"0.5092164",
"0.50892144",
"0.5078921",
"0.50756073",
"0.50737715",
"0.50653917",
"0.5063216",
"0.5062293",
"0.5058298",
"0.50541973",
"0.50539726",
"0.50538343",
"0.5049508",
"0.5049508",
"0.5049508",
"0.5049508",
"0.50426775"
]
| 0.6198212 | 3 |
Add a property to statistics array, with zero values (if not set) | public function addProperty(string $symbol): Statistics {
if (!array_key_exists($symbol, $this->properties)) {
$this->properties[$symbol] = [
'count' => 0,
'inserts' => 0,
'updates' => 0,
'no_changes' => 0,
'min_time' => null,
'max_time' => null
];
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setZeroPointsToNull() {\n\t\tforeach ($this->Data as $series => $data) {\n\t\t\t$this->Data[$series]['data'] = array_map(\"PLOT__setZeroToNullMapper\", $data['data']);\n\t\t}\n\t}",
"static public function getEmptyUsageTypeTotals() {\n\t\treturn array(\n\t\t\t'usagev' => 0,\n\t\t\t'cost' => 0,\n\t\t\t'count' => 0,\n\t\t);\n\t}",
"public function updatePropertyIndex ()\n {\n $new_properties_table = array();\n\n foreach ( $this as $declaration ) {\n\n $name = $declaration->property;\n\n if ( isset( $new_properties_table[ $name ] ) ) {\n $new_properties_table[ $name ]++;\n }\n else {\n $new_properties_table[ $name ] = 1;\n }\n }\n $this->properties = $new_properties_table;\n }",
"function resetCountAdded()\n {\n\t$this->start_count_vehicles = 0;\n\t$this->stop_count_vehicles = 0;\n\n\t$this->count_added_by_level = array();\n\t$this->start_count_added_by_level = array();\n\t$this->stop_count_added_by_level = array();\n\tforeach ($this->getSchema()->getLevels() as $level)\n\t{\n\t $this->count_added_by_level[$level] = 0;\n\t $this->start_count_added_by_level[$level] = 0;\n\t $this->stop_count_added_by_level[$level] = 0;\n\t}\n }",
"public function clear(): void\n {\n $this->collectionStatsById = [];\n $this->proxyStatsByClass = [];\n }",
"public function unsetPercentage(): void\n {\n $this->percentage = [];\n }",
"function addStatistic ($array) {\n\t\t$stat = new Statistic();\n\t\t$res_array = $stat->createStatistics($array);\n\t\t$insert = array(\n\t\t\t\t\"name\" => $res_array['res_name'],\n\t\t\t\t\"parent_id\" => $res_array['parent_id'],\n\t\t\t\t\"size\" => filesize(DATA.$res_array['location']),\n\t\t\t\t\"description\" => \"Statistic creation\",\n\t\t\t\t\"resource_type\" => \"statistic\",\n\t\t\t\t\"source_type\" => '',\n\t\t\t\t'user_id' => $_SESSION['user_id'],\n\t\t\t\t'validation' => 'true',\n\t\t\t\t'location' => $res_array['location']\n\t\t\t);\n\t\t$db_result = $this->insertResource($insert);\n\t\tif($db_result == true){\n\t\t\treturn array ('error' => false, 'message' => 'Statistics have been successfully created');\n\t\t} else {\n\t\t\treturn array ('error' => true, 'message' => 'There was an issue with creating your statistics please check with your administrator');\n\t\t}\n\t}",
"public function setRawStatistics(array $statistics): void\n {\n $this->statistics = $statistics;\n }",
"protected function resetMetrics()\n {\n $this->metrics = ['gauges' => [], 'counters' => []];\n }",
"public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }",
"public function offsetSet($offset, $value) { if (is_null($offset)) { $this->profile[] = $value; } else { $this->profile[$offset] = $value; }}",
"public function offsetSet($offset, $value) { if (is_null($offset)) { $this->profile[] = $value; } else { $this->profile[$offset] = $value; }}",
"public static function __clearSetArray(){\r\n self::$_units = array();\r\n self::$_totalGrade = array();\r\n self::$_totalUnitsFail = array();\r\n self::$_totalUnitsPass = array();\r\n self::$_remarks = array();\r\n }",
"public function setPropertyNoChanges(string $symbol, int $value): Statistics {\n\t\t$this->addProperty($symbol);\n\t\t$this->properties[$symbol]['no_changes'] = $value;\n\n\t\treturn $this;\n\t}",
"public function AddStatistics($EventName) {\n\n $this->Stats[$EventName]= ($this->Stats[$EventName] ?? 0) + 1;\n }",
"function fluff_array($array) {\r\n foreach ($array as $key => $value) {\r\n if (($array[$key] == NULL) || (empty($array[$key]) && \r\n\t (isset($array[$key]) && ($array[$key] != 0)))) {\r\n\t\t\r\n $array[$key] = 'N/A'; \r\n }\r\n }\r\n return $array;\r\n}",
"function setMissingDirectionBuckets($speedDirectionHistogram, $directionStep)\r\n{\r\n foreach ($speedDirectionHistogram as $speedbucket => $directionHistogramForSpeed)\r\n {\r\n foreach (getDirectionsArray($directionStep) as $direction)\r\n {\r\n if (!isset($speedDirectionHistogram[$speedbucket][$direction]))\r\n {\r\n $speedDirectionHistogram[$speedbucket][$direction] = 0;\r\n }\r\n }\r\n }\r\n return $speedDirectionHistogram;\r\n}",
"public function clearStats()\r\n {\r\n $this->stats = array();\r\n\r\n return $this;\r\n }",
"protected function _calculateSectionTotals(&$results, $property) {\n\t\t$results['sectionTotals'][$property] = array(\n\t\t\t'elementCount' => 0,\n\t\t\t'score' => 0,\n\t\t\t'average' => 0,\n\t\t);\n\t\tif ($this->_contentObjectCount != 0) {\n\t\t\t$results['sectionTotals'][$property] = array(\n\t\t\t\t'elementCount' => $this->_contentObjectCount,\n\t\t\t\t'score' => $this->_contentScore,\n\t\t\t\t'average' => $this->_contentScore / $this->_contentObjectCount,\n\t\t\t);\n\t\t}\n\t\t$this->_totalElements += $this->_contentObjectCount;\n\t\t$this->_finalScore += $this->_contentScore;\n\t}",
"protected function _add($property, $value): void {\n if (property_exists($this, $property)) {\n $this->{$property}[] = $value;\n } else {\n $this->_properties[$property][] = $value;\n }\n }",
"Public Function AddToTotal($Stats)\n\t{\n\t\tforeach($this->Total as $Key=>$Value)\n\t\t{\n\t\t\t$this->Total->{$Key} += $Stats->{$Key};\n\t\t}\n\t}",
"public function addStatFinalize();",
"public function addColumn(Property $property);",
"public function randomMemberNOZero();",
"public function testGetEmpty()\n {\n $this->assertArrayEmpty($this->get_reflection_property_value('get'));\n }",
"public function add($property, $value)\n\t{\n\t\tif ('_' == substr($property, 0, 1))\n\t\t{\n\t\t\t$this->setError(\"Can't access private properties\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (property_exists(__CLASS__, $property) || property_exists(__CLASS__, '_auxs_' . $property))\n\t\t{\n\t\t\t$this->setError(\"Can't add value(s) to non-array property.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!property_exists(__CLASS__, '_auxv_' . $property))\n\t\t{\n\t\t\t$this->setError(\"Unknown property: $property\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($value))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!is_array($value))\n\t\t{\n\t\t\t$value = array($value);\n\t\t}\n\n\t\t$property = '_auxv_' . $property;\n\n\t\tforeach ($value as $v)\n\t\t{\n\t\t\t$v = strval($v);\n\n\t\t\tif (!in_array($v, $this->$property))\n\t\t\t{\n\t\t\t\tarray_push($this->$property, $v);\n\t\t\t}\n\t\t}\n\n\t\tsort($this->$property);\n\n\t\treturn true;\n\t}",
"public function addProperty(Entities\\Devices\\Properties\\Property $property): void\n\t{\n\t\tif (!$this->properties->contains($property)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->properties->add($property);\n\t\t}\n\t}",
"function __isset($property){\n return isset($this->DATA[$property]);\n }",
"public function getStats() : ?array;",
"public function testNoArrayMetaAccess()\n\t{\n\t\t$bean = R::dispense( 'bean' );\n\t\t$bean->setMeta( 'greet', 'hello' );\n\t\tasrt( isset( $bean['greet'] ), FALSE );\n\t\tasrt( isset( $bean['__info']['greet'] ), FALSE );\n\t\tasrt( isset( $bean['__info'] ), FALSE );\n\t\tasrt( isset( $bean['meta'] ), FALSE );\n\t\tasrt( count( $bean ), 1 );\n\t}",
"public function addPropertyValues(Property $property) {\r\n foreach ($property->getPropertyValues() as $propertyValue) {\r\n $property->addPropertyValue($propertyValue);\r\n }\r\n }",
"protected function fillEmptyPercents()\n {\n for ($percent = 1; $percent <= 100; $percent++) {\n if (isset ($this->list[$percent])) {\n continue;\n }\n $this->list[$percent] = $this->list[($percent - 1)] ?? 0;\n }\n }",
"public function testPValueCalculationThrowsOnEmptyScoreCollection(): void\n {\n $this->expectException(StatisticsCalculationException::class);\n\n $helper = new StatisticsHelper();\n\n $helper->pValue([], 2);\n }",
"public function __set($property, $value) {\n\t\tif (array_key_exists($property, $this->_allowedColumns)) {\n\t\t\t$this->_valueArray[$property] = $value;\n\t\t} else {\n\t\t\tthrow new L8M_Exception('Property does not exist: ' . $property);\n\t\t}\n\t}",
"public function __construct()\n {\n parent::__construct();\n\n $this->result = [\n 'count' => 0,\n 'sum' => 0,\n 'create' => 0,\n 'update' => 0,\n 'missing_advertiser',\n 'missing_sum' => 0\n ];\n }",
"public function testGetMetricOrDefault(): void\n {\n $this->collection->setResult($this->timeResult);\n $this->assertEquals(100, $this->collection->getMetricOrDefault('UnknownClass', 'barbar', 100));\n }",
"function statistics_extended_groups_property_count($property){\r\n\tglobal $CONFIG;\r\n\t$properties = $CONFIG->group;\r\n\t$labels = array();\r\n\t$totals = array();\r\n\tif(array_key_exists($property,$properties)){\r\n\t\tlist($type,$values) = $properties[$property];\r\n\t\tswitch($type){\r\n\t\t\tcase \"checkboxes\":\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tforeach($values as $label=>$value){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"organizational_unit\":\r\n\t\t\t\t$query = \"SELECT string FROM {$CONFIG->dbprefix}metastrings WHERE id IN \";\r\n\t\t\t\t$query.=\"(SELECT value_id FROM {$CONFIG->dbprefix}metadata WHERE name_id=\";\r\n\t\t\t\t$query.=\"(SELECT id FROM {$CONFIG->dbprefix}metastrings WHERE string='{$property}'))\";\r\n\t\t\t\t$categories = get_data($query);\r\n\t\t\t\tif(!empty($categories)){\r\n\t\t\t\t\tforeach($categories as $category){\r\n\t\t\t\t\t\t$category = $category->string;\r\n\t\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$category);\r\n\t\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t\tlist($section,$department,$unit) = explode(\"||\",$category);\r\n\r\n\t\t\t\t\t\t$labels[$section]=$section;\r\n\t\t\t\t\t\t$totals[$section]+=$total;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"status\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\t\t\t\t$values = array(\"preparation\"=>\"groups:extras:status:preparation\",\r\n\t\t\t\t\t\t\t\t\"active\"=>\"groups:extras:status:active\",\r\n\t\t\t\t\t\t\t\t\"inactive\"=>\"groups:extras:status:inactive\",\r\n\t\t\t\t\t\t\t\t\"closed\"=>\"groups:extras:status:closed\");\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$label;\r\n\t\t\t\t\t$totals[$label]=(int)$total;\r\n\t\t\t\t}\r\n\t\t\t\t$totals[\"groups:extras:status:active\"]=$all_groups-$totals[\"groups:extras:status:inactive\"]-$totals[\"groups:extras:status:closed\"];\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\tswitch($property){\r\n\t\t\tcase \"content_privacy\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>\"no\");\r\n\t\t\t\t$count_no = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\r\n\t\t\t\t// How content_privacy is a new feature it is no available for all groups\r\n\t\t\t\t$labels[]=\"yes\";\r\n\t\t\t\t$totals[\"yes\"]=$all_groups - $count_no;\r\n\t\t\t\t$labels[]=\"no\";\r\n\t\t\t\t$totals[\"no\"]=$count_no;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"membership\":\r\n\t\t\t\t$values = array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public'));\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn array($labels,$totals);\r\n}",
"protected function init()\n {\n $this->totais = [\n 'liquidados' => 0,\n 'entradas' => 0,\n 'baixados' => 0,\n 'protestados' => 0,\n 'erros' => 0,\n 'alterados' => 0,\n ];\n }",
"public static function stats(): array;",
"public function reset()\n {\n $this->values[self::_DAMAGES] = array();\n }",
"protected function init()\n {\n $this->totais = [\n 'liquidados' => 0,\n 'entradas' => 0,\n 'baixados' => 0,\n 'protestados' => 0,\n 'erros' => 0,\n 'alterados' => 0,\n ];\n }",
"public function generateEmptyObjectArray($num = 1)\n {\n $item = ObjectUtil::createEmptyObject ($this->_objType);\n if ($item) {\n $data = array();\n for ($i = 0; $i < $num; $i++) {\n $data[] = $item;\n }\n $this->_objData = $data;\n } \n\n return $this->_objData;\n }",
"public function getMetrics(): array;",
"private function writeProperty($zval, $property, $value)\n {\n if (!is_object($zval[self::VALUE])) {\n throw new NoSuchPropertyException(sprintf('Cannot write property \"%s\" to an array. Maybe you should write the property path as \"[%s]\" instead?', $property, $property));\n }\n\n $object = $zval[self::VALUE];\n $access = $this->getWriteAccessInfo(get_class($object), $property, $value);\n\n if (self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]) {\n $object->{$access[self::ACCESS_NAME]}($value);\n } elseif (self::ACCESS_TYPE_PROPERTY === $access[self::ACCESS_TYPE]) {\n $object->{$access[self::ACCESS_NAME]} = $value;\n } elseif (self::ACCESS_TYPE_ADDER_AND_REMOVER === $access[self::ACCESS_TYPE]) {\n $this->writeCollection($zval, $property, $value, $access[self::ACCESS_ADDER], $access[self::ACCESS_REMOVER]);\n } elseif (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property)) {\n // Needed to support \\stdClass instances. We need to explicitly\n // exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if\n // a *protected* property was found on the class, property_exists()\n // returns true, consequently the following line will result in a\n // fatal error.\n\n $object->$property = $value;\n } elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {\n $object->{$access[self::ACCESS_NAME]}($value);\n } else {\n throw new NoSuchPropertyException($access[self::ACCESS_NAME]);\n }\n }",
"public function reset()\n {\n foreach (self::AvailableCoins as $aCoin) {\n \t $sProperty = $aCoin['name'];\n $this->$sProperty = 0;\n }\n }",
"function addData($column, $value)\n {\n $this->addColumns($column);\n $this->data[$this->series]['data'][$column] = $value * 1.0;\n }",
"function noZero()\n {\n static::remove(0);\n return $this;\n }",
"public function reset()\n {\n $this->values[self::_SUMMARY] = array();\n $this->values[self::_SELF_RANKING] = null;\n $this->values[self::_SELF_SUMMARY] = null;\n }",
"public function __set($property, $value) {}",
"public function stdWrap_ifEmptyDeterminesEmptyValuesDataProvider() {}",
"private function setPointsInternal(array $points) {\n foreach (self::point_properties as $property) {\n if (is_numeric($points[$property])) {\n $this->$property = floatval($points[$property]);\n }\n else {\n throw new \\InvalidArgumentException('Graded version point values must be numeric');\n }\n }\n }",
"public function __get($property)\n {\n switch ($property) {\n case 'columns':\n return $this->getColumnCount();\n case 'rows':\n return $this->getRowCount();\n default:\n return null;\n }\n }",
"public function testCreateObjectNoArgumentsMin()\n {\n $histogram = new \\Aisa\\Dice\\Histogram();\n $this->assertInstanceOf(\"\\Aisa\\Dice\\Histogram\", $histogram);\n $dice = new \\Aisa\\Dice\\DiceHistogram();\n $histogram->injectData($dice);\n $res = $histogram->min;\n $exp = 1;\n $this->assertEquals($exp, $res);\n }",
"function add($object){if(is_array($this->arrayObj))\n \n {$tmp = count($this->arrayObj);$this->arrayObj[$tmp]=$object;\n\n }else{$this->arrayObj[0]=$object;}\n }",
"function add($object){if(is_array($this->arrayObj))\n \n {$tmp = count($this->arrayObj);$this->arrayObj[$tmp]=$object;\n\n }else{$this->arrayObj[0]=$object;}\n }",
"function resetProperties()\n {\n $this->fullremyears = 0;\n $this->fullremmonths = 0;\n $this->fullremdays = 0;\n $this->fullremhours = 0;\n $this->fullremminutes = 0;\n $this->fullremseconds = 0;\n $this->years = 0;\n $this->months = 0;\n $this->days = 0;\n $this->hours = 0;\n $this->minutes = 0;\n $this->seconds = 0;\n }",
"public function isEmpty(string $property): bool {\n if (property_exists($this, $property)) {\n return !is_numeric($this->$property) && empty($this->$property);\n } else {\n return !array_key_exists($property, $this->_properties)\n || !is_numeric($this->_properties[$property]) && empty($this->_properties[$property]);\n }\n }",
"Public Function GetAggregateStats()\n\t{\n\t\t$Temp = $this->GetAllAdwordsStats();\n\t\t$this->AdwordsTotal = $Temp;\n\t\t$this->AddToTotal($Temp);\n\t\t\n\t\t$Temp = $this->GetAllYahooStats();\n\t\t$this->YahooTotal = $Temp;\n\t\t$this->AddToTotal($Temp);\n\t\t\n\t\t$Temp = $this->GetAllMSNStats();\n\t\t$this->MSNTotal = $Temp;\n\t\t$this->AddToTotal($Temp);\n\t}",
"public function __set($property, $value)\n {\n $this->data[$property] = $value;\n }",
"public function __construct( $stats, $unit = '', $title = '' )\n\t{\n\t\t// Check $stats structure and get $value_total property\n\t\t$stats_validation = true;\n\t\t$value_total = 0;\n\t\treset($stats);\n\t\tforeach($stats as $name => $value)\n\t\t{\n\t\t\tif (!preg_match('~^([0-9]+)(\\.([0-9]+))?$~', $value))\n\t\t\t{\n\t\t\t\t$stats_validation = false;\n\t\t\t\techo '<p style=\"color:red;\">Error occured in <b>'.__CLASS__.'</b> class : invalid <i>$stats</i> parameter in '.__METHOD__.'.</p>';\n\t\t\t}\n\t\t\t$value_total += $value;\n\t\t}\n\n\t\t// Get $statistics property\n\t\tif ($stats_validation)\n\t\t{\n\t\t\t$this->value_total = $value_total;\n\n\t\t\t$percent_max = 0;\n\t\t\t$statistics = array();\n\t\t\t$i = 0;\n\t\t\treset($stats);\n\t\t\tforeach($stats as $name => $value)\n\t\t\t{\n\t\t\t\t$statistics[$i]['name' ] = $name;\n\t\t\t\t$statistics[$i]['value'] = $value;\n\n\t\t\t\tif ($this->value_total != 0)\n\t\t\t\t{\n\t\t\t\t\t$statistics[$i]['percent'] = sprintf('%.1f', $value/$this->value_total*100);\n\t\t\t\t} else {\n\t\t\t\t\t$statistics[$i]['percent'] = 0;\n\t\t\t\t}\n\n\t\t\t\tif ($statistics[$i]['percent'] > $percent_max)\n\t\t\t\t{\n\t\t\t\t\t$percent_max = $statistics[$i]['percent'];\n\t\t\t\t}\n\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$this->statistics = $statistics;\n\t\t\t$this->percent_max = $percent_max;\n\t\t}\n\n\t\t// Set others properties\n\t\t$this->unit = $unit;\n\t\t$this->title = $title;\n\t}",
"function addData($name, $value, $colour)\n {\n $value *= 1.0; // Make sure it's a number\n\n if ($value < 0) {\n return;\n }\n\n $this->data[] = array\n (\n 'name' => $name,\n 'value' => $value,\n 'colour' => $this->hexcol($colour),\n );\n\n $this->total += $value;\n }",
"function __set($property, $value) {\n global $DB;\n if(is_array($value) && @$this->TYPE[$property] === 'CSV') $value = join(',',$value);\n if(!isset($this->DATA[$property])\n || $this->DATA[$property] !== $value) {\n $DB->config->update(array('value' => $value), array('property' => $property, 'section' => $this->NAME), true);\n $this->DATA[$property] = $value;\n }\n }",
"public function applyDefaultValues()\n {\n $this->montacargas_baja = 0;\n }",
"private function _fillUpArrayWithZeroes(array $array, $supposedLength, $type): array {\n if(count($array) !== $supposedLength) {\n switch($type) {\n case 'warehouse':\n $arrayPusher = ['level' => 0, 'fillAmount' => 0];\n break;\n case 'mineSummary':\n $arrayPusher = ['perHour' => 0, 'amountOfMines' => 0];\n break;\n default:\n $arrayPusher = 0;\n break;\n }\n\n for($i = 0; $i < $supposedLength; ++$i) {\n if(!$array[$i]) {\n $array[$i] = $arrayPusher;\n }\n }\n }\n\n return $array;\n }",
"public function defaultStatistics(array $array)\n {\n $mean = self::mean($array);\n $variance = self::variance($array, $mean);\n\n return array(\n 'min' => min($array),\n 'max' => max($array),\n 'mean' => $mean,\n 'variance' => $variance,\n 'std_dev' => sqrt($variance),\n );\n }",
"public function populatableProperties() : array;",
"public function canAppendAnObjectAndUnsetAnOffset()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $this->object->append($object0);\n $this->assertTrue(isset($this->object[0]));\n unset($this->object[0]);\n $this->assertFalse(isset($this->object[0]));\n }",
"public function __isset($property) {}",
"private function init_properties( array $properties ) {\n\t\t// recursively filter null values\n\t\t$this->properties = Arrays::filter_recursive( $properties );\n\t\t// collect all attributes properties for this element\n\t\t$this->collect_attributes();\n\t}",
"public function testSetTotalHAnal() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setTotalHAnal(10.092018);\n $this->assertEquals(10.092018, $obj->getTotalHAnal());\n }",
"public function getRawStats()\n\t{\n\t\t$this->team = factory(Team::class)->create();\n\t\t$this->event = factory(Event::class)->create(['owner_id' => $this->team->id]);\n\t\tfactory(TeamMember::class, 2)->create(['team_id' => $this->team->id, 'user_id' => 0]);\n\n\t\t$this->data = [\n\t\t\t'event'\t=> $this->event,\n\t\t\t'meta'\t=> ['test' => 123],\n\t\t\t'stats'\t=> [\n\t\t\t\t['id' => 0, 'member_id' => 1, 'gs' => true, 'pts' => 12, 'ast' => 6, 'reb' => 8],\n\t\t\t\t['id' => 0, 'member_id' => 2, 'gs' => false, 'pts' => 42, 'ast' => 2, 'reb' => 3],\n\t\t\t],\n\t\t];\n\t}",
"public function reset()\n {\n $this->values[self::_HEROES] = array();\n }",
"public function testAverageCalculationThrowsOnEmptyCollection(): void\n {\n $this->expectException(StatisticsCalculationException::class);\n\n $helper = new StatisticsHelper();\n\n $helper->average([]);\n\n }",
"public function testDrawingIsEmptyArrayWhenNotSet()\n {\n $sweepstake = new \\Entities\\Sweepstake;\n $this->assertSame([], $sweepstake->getDrawing());\n }",
"public function __set($property, $value) {\n if (class_exists('\\Sleepy\\Hook')) {\n $this->data[$property] = Hook::addFilter($this->clean_class() . '_set_' . $property, $value);\n $this->data[$property] = Hook::addFilter($this->clean_class() . '_set_property', $value);\n } else {\n $this->data[$property] = $value;\n }\n }",
"function __set($property, $value)\n {\n\n if( $value != null )\n $this->fields[$property] = $value;\n }",
"private function clearTotals()\n {\n $this->totalAmount = 0;\n $this->frequentRenterPoints = 0;\n }",
"public function summary(array $array);",
"public function appendAffectedObjectProperty(PropertyInterface $property)\n {\n $this->affectedObjectProperties[] = $property;\n }",
"public function setProperty($property, $value = null);",
"public function __isset($property){\n echo isset($this->$property);\n }",
"function get_ax_data( $attr, $ax_obj, $count=0 )\n {\n return (empty($ax_obj) || empty($ax_obj->data[$attr]))\n ? null : $ax_obj->data[$attr][$count];\n }",
"public function addStat($statData);",
"private function init()\n {\n if (!isset($this->memory[$this->m])) {\n $this->memory[$this->m] = 0;\n }\n }",
"public function testRegisterValuesWeightZero()\n {\n $this->expectException(InvalidArgumentException::class);\n\n $this->generator->registerValues(['test' => 0]);\n }",
"private function basicReport()\n {\n $basic = new \\stdClass();\n foreach ($this->report as $key => $value)\n {\n $basic->$key = count($value);\n }\n\n return $basic;\n }",
"public function testWhenNoInputIsSentToTheConstructorThenInitializeUsingAnEmptyArray()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 1';\n\n $element2 = new \\stdClass();\n $element2->Name = 'EL 2';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $elements = \\PHPUnit_Framework_Assert::readAttribute($Collection, 'elements');\n $this->assertEquals(array(), $elements);\n\n $Collection->add($element1);\n\n $elements = \\PHPUnit_Framework_Assert::readAttribute($Collection, 'elements');\n $this->assertEquals(array($element1), $elements);\n\n $Collection->add($element2);\n $elements = \\PHPUnit_Framework_Assert::readAttribute($Collection, 'elements');\n $this->assertEquals(array($element1, $element2), $elements);\n }",
"public function zeroize()\n {\n for ($i = $this->count() - 1; $i >= 0; --$i) {\n $this->offsetSet($i, 0);\n }\n }",
"public function getSaleStatisticsProperty()\n {\n $minSale = 0;\n $maxSale = 0;\n $total = 0;\n $first = true;\n\n foreach ($this->sales as $sale) {\n $amount = $sale['amount'];\n if ($first) {\n $minSale = $amount;\n $maxSale = $amount;\n $first = false;\n } else {\n $minSale = $minSale <= $amount ? $minSale : $amount;\n $maxSale = $maxSale >= $amount ? $maxSale : $amount;\n }\n $total += $amount;\n }\n\n return [\n 'min' => $minSale,\n 'max' => $maxSale,\n 'total' => $total\n ];\n }",
"public function setInsights(array $insights = []): static;",
"private static function _blankWeightArray($len) {\n\t\t$out = array();\n\t\tfor($i = 0; $i < $len; $i++)\n\t\t\t$out[] = 50;\n\t\treturn $out;\n\t}",
"public function __invoke(array &$event)\n {\n if ( ! $this->threshold($event['level'])) {\n return;\n }\n\n $event['meta']['memory_peak_usage'] = $this->get_peak_usage();\n $event['meta']['memory_usage'] = $this->get_usage;\n $event['meta']['memory_limit'] = $this->get_limit();\n }",
"public function __isset($property)\n\t{\n\t\treturn isset($this->_data[$property]);\n\t}",
"public function push($value): IProperty;",
"private function initializeSubtotals()\n {\n if (!isset($this->data->subtotals)) {\n $this->data->subtotals = new stdClass();\n }\n }",
"public function __set( $member, $value ){\n\n $this->array_values[ $member ] = $value;\n\n }",
"public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n }",
"public function updateHistogram(array $data): void\n {\n }",
"public function getPropertyNoChanges(string $symbol): int {\n\t\treturn $this->properties[$symbol]['no_changes'] ?? 0;\n\t}",
"public function fill(array $properties)\n {\n foreach($properties as $arg => $value) {\n $this->setPublicProperty($arg, $value);\n }\n }"
]
| [
"0.52870363",
"0.5065834",
"0.5030454",
"0.486759",
"0.4836987",
"0.4834065",
"0.47823757",
"0.4754218",
"0.47481906",
"0.47355983",
"0.47288385",
"0.47288385",
"0.4704716",
"0.46996903",
"0.46959913",
"0.46909767",
"0.46666545",
"0.46648955",
"0.465883",
"0.46441808",
"0.46416783",
"0.4640327",
"0.46235472",
"0.45868045",
"0.45320198",
"0.45160705",
"0.45039994",
"0.44635794",
"0.4461955",
"0.4457588",
"0.4417189",
"0.44149187",
"0.44128063",
"0.4403655",
"0.4381277",
"0.43758374",
"0.43717328",
"0.4357415",
"0.43527725",
"0.43008295",
"0.43004864",
"0.42920583",
"0.42888147",
"0.42878607",
"0.4287492",
"0.42775777",
"0.42767963",
"0.4263701",
"0.4263503",
"0.42602167",
"0.4251365",
"0.42482767",
"0.42470723",
"0.42458728",
"0.42458728",
"0.42443833",
"0.42416292",
"0.42411336",
"0.423897",
"0.42344838",
"0.42339033",
"0.42246035",
"0.42225903",
"0.4218112",
"0.4217309",
"0.4210378",
"0.42040882",
"0.42036125",
"0.42033547",
"0.41891506",
"0.41859457",
"0.41799062",
"0.4179306",
"0.41765884",
"0.41733596",
"0.41676092",
"0.4158251",
"0.4154709",
"0.41534024",
"0.41529512",
"0.41457516",
"0.41416115",
"0.41408902",
"0.41291738",
"0.41201982",
"0.41193902",
"0.41151488",
"0.4115096",
"0.41134936",
"0.4112758",
"0.41114473",
"0.4108134",
"0.4107097",
"0.41038036",
"0.4101583",
"0.41001862",
"0.4097108",
"0.40953282",
"0.40919098",
"0.40879282"
]
| 0.5939334 | 0 |
Get symbols of properties | public function getProperties(): array {
return array_keys($this->properties);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPropertyNames();",
"function _getProperties() ;",
"public function getProperties();",
"public function getProperties();",
"public function getProperties();",
"public function getProperties();",
"public function properties() {\n return array_keys($this->propertyDefs());\n }",
"public static function getPropertyNames() {\n\t\treturn self::$PROPERTY_NAMES;\n\t}",
"public static function getPropertyNames() {\n\t\treturn self::$PROPERTY_NAMES;\n\t}",
"public static function getPropertyNames() {\n\t\treturn self::$PROPERTY_NAMES;\n\t}",
"public static function getPropertyKeys()\n {\n return array('id', 'title', 'pic');\n }",
"public function getProperties() {}",
"public function getProperties() {}",
"public function getProperties() {}",
"public function getProperties() {}",
"public function getProperties()\n {\n return $this->_propDict;\n }",
"public function getProperties()\n {\n return $this->_propDict;\n }",
"public function properties() : array\n {\n return array_keys($this->_properties);\n }",
"public function symbols() : array;",
"public function getProperties(): array;",
"public function getProperties(): array;",
"public function getProperties() {\n return array_keys($this->_properties);\n }",
"public function getPropertyKeys()\n {\n return ['type', 'min', 'max', 'equals', 'value'];\n }",
"public function _getProperties() {}",
"public static function getProperties() : array {\r\n return self::$properties;\r\n }",
"public function getProperties() : array;",
"public function getProperties(): array\n {\n return array_keys(get_object_vars($this));\n }",
"protected function property_map() { return array(); }",
"function properties()\n {\n }",
"public function getProperties()\n {\n return array_keys($this->toArray());\n }",
"abstract public function getProperties();",
"public static function _getPropertyNames(): array\n {\n return [\n ];\n }",
"public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getSymbolAllowableValues();\n if (!in_array($this->container['symbol'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'symbol', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }",
"abstract protected function getProperties();",
"public function properties() { }",
"function displayProperties ()\n {\n foreach ($this as $key => $property)\n {\n echo $key . ':' . $property . '<br>';\n }\n }",
"public static function getProperties()\n {\n return static::$properties;\n }",
"public function getPropertyNames() {\n return $this->propertyNames;\n }",
"private function extractProperties(): array\n {\n $tokens = $this->tokens->findFirstCurlyParenthesizedBlock();\n $tokens = $tokens->withoutBlocks();\n\n preg_match_all('/(?<docblock>T_DOC_COMMENT )?(?<qualifiers>(T_VAR |T_PUBLIC |T_PROTECTED |T_PRIVATE |T_STATIC ))+(?<type>T_STRING )?(?<name>T_VARIABLE )(= (?<value>(?:(?!; ).)+))?; /',\n $tokens->asString(),\n $matches,\n PREG_OFFSET_CAPTURE | PREG_SET_ORDER);\n\n $properties = [];\n foreach ($matches as $match)\n {\n $propertyTokens = TokenMatchHelper::codeBlock($match, $tokens, $this->tokens);\n $lines = $propertyTokens->lines();\n\n $properties[] = ['docblock' => TokenMatchHelper::docblockDetails($match, $tokens),\n 'type' => TokenMatchHelper::code('type', $match, $tokens),\n 'visibility' => TokenMatchHelper::visibility($match),\n 'is_static' => TokenMatchHelper::isStatic($match),\n 'name' => TokenMatchHelper::code('name', $match, $tokens),\n 'value' => TokenMatchHelper::code('value', $match, $tokens),\n 'start' => $lines['start'],\n 'end' => $lines['end'],\n 'tokens' => $propertyTokens];\n }\n\n return $properties;\n }",
"public static function _getPropertyNames(): array\n {\n return [\n 'name',\n ];\n }",
"abstract protected function getToStringProperties();",
"public static function _getPropertyNames(): array\n {\n return [\n 'url',\n ];\n }",
"protected function properties()\n {\n return [\n 'mount_point' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__DRIVE_DRIVELETTER',\n C__PROPERTY__INFO__DESCRIPTION => 'Driveletter'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__driveletter'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_LETTER'\n ]\n ]\n ),\n 'title' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__TITLE',\n C__PROPERTY__INFO__DESCRIPTION => 'Title'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__title'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_TITLE'\n ]\n ]\n ),\n 'system_drive' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__DRIVE__SYSTEM_DRIVE',\n C__PROPERTY__INFO__DESCRIPTION => 'System drive'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__system_drive'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__DRIVE__SYSTEM_DRIVE',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => serialize(get_smarty_arr_YES_NO()),\n 'p_bDbFieldNN' => 1\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__LIST => false\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'get_yes_or_no'\n ]\n ]\n ]\n ),\n 'filesystem' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog_plus(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'isys_filesystem_type',\n C__PROPERTY__INFO__DESCRIPTION => 'Filesystem'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__isys_filesystem_type__id',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_filesystem_type',\n 'isys_filesystem_type__id',\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_FILESYSTEM',\n C__PROPERTY__UI__PARAMS => [\n 'p_strTable' => 'isys_filesystem_type'\n ]\n ]\n ]\n ),\n 'capacity' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::float(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB_CATG__MEMORY_CAPACITY',\n C__PROPERTY__INFO__DESCRIPTION => 'Capacity'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__capacity'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_CAPACITY',\n C__PROPERTY__UI__PARAMS => [\n 'p_strClass' => 'input-dual-large'\n ]\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'convert',\n ['memory']\n ],\n C__PROPERTY__FORMAT__UNIT => 'unit',\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'unit' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATG__MEMORY_UNIT',\n C__PROPERTY__INFO__DESCRIPTION => 'Unit'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__isys_memory_unit__id',\n C__PROPERTY__DATA__FIELD_ALIAS => 'capacity_unit',\n C__PROPERTY__DATA__TABLE_ALIAS => 'c_unit',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_memory_unit',\n 'isys_memory_unit__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_UNIT',\n C__PROPERTY__UI__PARAMS => [\n 'p_strTable' => 'isys_memory_unit',\n 'p_strClass' => 'input-dual-small',\n 'p_bInfoIconSpacer' => 0\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'serial' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__SERIAL',\n C__PROPERTY__INFO__DESCRIPTION => 'Serial number'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__serial'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_SERIAL'\n ]\n ]\n ),\n 'assigned_raid' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATD_DRIVE_TYPE__RAID_GROUP',\n C__PROPERTY__INFO__DESCRIPTION => 'Software RAID group'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__id__raid_pool',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catg_raid_list',\n 'isys_catg_raid_list__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_RAIDGROUP',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => new isys_callback(\n [\n 'isys_cmdb_dao_category_g_drive',\n 'callback_property_assigned_raid'\n ]\n )\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__REPORT => true,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__LIST => false\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'get_reference_value'\n ]\n ]\n ]\n ),\n 'drive_type' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::int(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__TYPE',\n C__PROPERTY__INFO__DESCRIPTION => 'Typ'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__isys_catd_drive_type__id',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catd_drive_type',\n 'isys_catd_drive_type__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_TYPE'\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__VIRTUAL => true\n ]\n ]\n ),\n 'device' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATD__DRIVE_DEVICE',\n C__PROPERTY__INFO__DESCRIPTION => 'On device'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__isys_catg_stor_list__id',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catg_stor_list',\n 'isys_catg_stor_list__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_DEVICE',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => new isys_callback(\n [\n 'isys_cmdb_dao_category_g_drive',\n 'callback_property_devices'\n ]\n )\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false,\n C__PROPERTY__PROVIDES__VIRTUAL => true\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'get_reference_value'\n ]\n ]\n ]\n ),\n 'raid' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATD__DRIVE_DEVICE',\n C__PROPERTY__INFO__DESCRIPTION => 'On device Raid-Array'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__isys_catg_raid_list__id',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catg_raid_list',\n 'isys_catg_raid_list__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_DEVICE',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => new isys_callback(\n [\n 'isys_cmdb_dao_category_g_drive',\n 'callback_property_devices'\n ]\n )\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false,\n C__PROPERTY__PROVIDES__VIRTUAL => true\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'get_reference_value'\n ]\n ]\n ]\n ),\n 'ldev' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATD__DRIVE_DEVICE',\n C__PROPERTY__INFO__DESCRIPTION => 'On device Logical devices (Client)'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__isys_catg_ldevclient_list__id',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catg_ldevclient_list',\n 'isys_catg_ldevclient_list__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATD__DRIVE_DEVICE',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => new isys_callback(\n [\n 'isys_cmdb_dao_category_g_drive',\n 'callback_property_devices'\n ]\n )\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false,\n C__PROPERTY__PROVIDES__VIRTUAL => true\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'get_reference_value'\n ]\n ]\n ]\n ),\n 'category_const' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__OBJTYPE__CONST',\n C__PROPERTY__INFO__DESCRIPTION => 'Constant'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__const'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CATG__DRIVE__CATEGORY_CONST'\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false,\n C__PROPERTY__PROVIDES__VIRTUAL => true\n ]\n ]\n ),\n 'free_space' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::float(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__DRIVE__FREE_SPACE',\n C__PROPERTY__INFO__DESCRIPTION => 'Free space'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__free_space'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CATG__DRIVE__FREE_SPACE',\n C__PROPERTY__UI__PARAMS => [\n 'p_strClass' => 'input-dual-large'\n ]\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'convert',\n ['memory']\n ],\n C__PROPERTY__FORMAT__UNIT => 'free_space_unit',\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'free_space_unit' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATG__MEMORY_UNIT',\n C__PROPERTY__INFO__DESCRIPTION => 'Unit'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__free_space__isys_memory_unit__id',\n C__PROPERTY__DATA__FIELD_ALIAS => 'free_space_unit',\n C__PROPERTY__DATA__TABLE_ALIAS => 'fs_unit',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_memory_unit',\n 'isys_memory_unit__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CATG__DRIVE__FREE_SPACE_UNIT',\n C__PROPERTY__UI__PARAMS => [\n 'p_strTable' => 'isys_memory_unit',\n 'p_strClass' => 'input-dual-small',\n 'p_bInfoIconSpacer' => 0\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'used_space' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::float(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__DRIVE__USED_SPACE',\n C__PROPERTY__INFO__DESCRIPTION => 'Free space'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__used_space'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CATG__DRIVE__USED_SPACE',\n C__PROPERTY__UI__PARAMS => [\n 'p_strClass' => 'input-dual-large'\n ]\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'convert',\n ['memory']\n ],\n C__PROPERTY__FORMAT__UNIT => 'used_space_unit',\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'used_space_unit' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATG__MEMORY_UNIT',\n C__PROPERTY__INFO__DESCRIPTION => 'Unit'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__used_space__isys_memory_unit__id',\n C__PROPERTY__DATA__FIELD_ALIAS => 'used_space_unit',\n C__PROPERTY__DATA__TABLE_ALIAS => 'us_unit',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_memory_unit',\n 'isys_memory_unit__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CATG__DRIVE__USED_SPACE_UNIT',\n C__PROPERTY__UI__PARAMS => [\n 'p_strTable' => 'isys_memory_unit',\n 'p_strClass' => 'input-dual-small',\n 'p_bInfoIconSpacer' => 0\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'description' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::commentary(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__LOGBOOK__DESCRIPTION',\n C__PROPERTY__INFO__DESCRIPTION => 'Description'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_drive_list__description'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CAT__COMMENTARY_' . C__CMDB__CATEGORY__TYPE_GLOBAL . C__CATG__DRIVE\n ]\n ]\n )\n ];\n }",
"public static function getProperties()\n\t\t{\n\t\t\treturn self::$properties;\n\t\t}",
"public function getPropertyNames() {\n // {PropertyName(property-name, property-type),}\n $nameSet = array();\n foreach ($this->tree->getPropertyNames() as $name) {\n $nameSet[] = new Mobi_Mtld_DA_PropertyName(\n substr($name, 1),\n self::getPropertyTypeAsByte($name[0])\n );\n }\n return $nameSet;\n }",
"public static function _getPropertyNames(): array\n {\n return [\n 'traveler',\n 'watcher',\n 'distance',\n ];\n }",
"function getProperties($properties);",
"public function getPropertiesList() : array;",
"function get_properties()\r\n {\r\n return $this->properties;\r\n }",
"public function properties()\n\t{\n\t\treturn $this->properties;\n\t}",
"public function get_properties(): array {\n\t\t$properties = array();\n\n\t\tforeach ( $this->properties as $key => $property ) {\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$properties = array_merge( $properties, $property->get_properties() );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$properties[ $key ] = $property;\n\t\t}\n\n\t\treturn $properties;\n\t}",
"public function getPropertyNamesAsStrings() {\n return $this->propertyStringNames;\n }",
"abstract protected function properties();",
"public function getProperties(): array\n {\n return $this->properties;\n }",
"public static function getProperties()\n {\n return [\n 'Type' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],\n 'Name' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'ABN' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'BSB' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'AccountNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'AccountName' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'ElectronicServiceAddress' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'SuperFundID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'EmployerNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'SPIN' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n ];\n }",
"abstract public function getJsProperties();",
"public function populatableProperties() : array;",
"public function getSymbol()\n\t{\n\t\treturn $this->symbol; \n\n\t}",
"public static function getProperties()\n {\n return [\n 'Description' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Note' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Code' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Billable' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Quantity' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'UnitCost' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'UnitPrice' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'Amount' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'AmountTax' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'AmountIncludingTax' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n ];\n }",
"abstract protected function get_properties();",
"public function getProperties(): array\n {\n $properties = $this->properties;\n\n $typeRequiredProperties = $this->type->getRequiredProperties();\n\n if ($typeRequiredProperties) {\n $properties = array_intersect_key(\n $properties,\n array_flip(array_merge($this->requiredProperties, $typeRequiredProperties))\n );\n }\n\n // Append the control information prefix to the metadata keys\n $requestedODataVersion = (string) $this->type->getVersion();\n\n $result = [];\n\n foreach ($properties as $key => $value) {\n if (version_compare('4.0', $requestedODataVersion, '=')) {\n $result[$this->prefix.'@odata.'.$key] = $value;\n } else {\n $result[$this->prefix.'@'.$key] = $value;\n }\n }\n\n return $result;\n }",
"public function get_properties()\r\n\t{\r\n\t\treturn get_object_vars($this);\r\n\t}",
"public function getCustomProperties(): array\n {\n return array_keys($this->customProperties);\n }",
"public function getProperties()\n {\n return $this->getProperty();\n }",
"protected function dynamic_properties()\n {\n return [\n '_address_range' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__ADDRESS_RANGE',\n C__PROPERTY__INFO__DESCRIPTION => 'Address range'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address_range'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_address_with_suffix' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__ADDRESS_WITH_SUFFIX',\n C__PROPERTY__INFO__DESCRIPTION => 'Net address with suffix'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address_with_suffix'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_address' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Net address'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ],\n '_free_addresses' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__NETWORK__ASS_IP',\n C__PROPERTY__INFO__DESCRIPTION => 'Assigned addresses and free addresses'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_free_addresses'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_netmask' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATP__IP__SUBNETMASK',\n C__PROPERTY__INFO__DESCRIPTION => 'Subnetmask'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_netmask'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ],\n '_layer2_assignments' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__LAYER2_NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Layer-2-net assignments'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_layer2_assignment'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ]\n ];\n }",
"public function visibleProperties()\n {\n return array_keys($this->_properties);\n }",
"public function getExposedProperties(): array;",
"public function getProperties()\r\n\t{\r\n\t\treturn $this->_properties;\r\n\t}",
"public function getPropertySyntax()\n\t{\n\t\treturn $this->root->getParser()->propertySyntax;\n\t}",
"public function getSymbol()\n {\n return $this->symbol;\n }",
"public function getSymbol()\n {\n return $this->symbol;\n }",
"public function getSymbol()\n\t{\n\t\treturn $this->symbol;\n\t}",
"public function getProperty2Name() {}",
"public function getProperties(): PropertyCollection;",
"public function dynamic_properties()\n {\n return [\n '_capacity' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB_CATG__MEMORY_CAPACITY',\n C__PROPERTY__INFO__DESCRIPTION => 'Capacity'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_capacity'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ],\n '_free_space' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__DRIVE__FREE_SPACE',\n C__PROPERTY__INFO__DESCRIPTION => 'Free space'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_free_space'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ],\n '_used_space' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__DRIVE__USED_SPACE',\n C__PROPERTY__INFO__DESCRIPTION => 'Used space'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_used_space'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ]\n ];\n }",
"public function properties()\r\n {\r\n $props = $this->class->getProperties();\r\n \r\n sort( $props );\r\n \r\n foreach ( $props as $key => $property )\r\n {\r\n // Only show public properties, because Reflection can't get the private ones\n if ( $property->isPublic() )\r\n {\r\n $props[$key] = new Docs_Property( $this->class->name, $property->name );\r\n }\r\n else\r\n {\r\n unset( $props[$key] );\r\n }\r\n }\r\n \r\n return $props;\r\n }",
"public function getSymbol() {\r\n\t\treturn($this->_symbol);\r\n\t}",
"public function getProperties()\n\t{\n\t\treturn $this->_properties;\n\t}",
"public function getProperties()\n {\n return get_object_vars($this);\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getProperties()\n {\n return $this->properties;\n }",
"public function getAllProperties(): array\n {\n return get_object_vars($this);\n }",
"public function getProperties() {\n\t\treturn $this->_properties;\n\t}",
"public function getProperties() {\n if (is_array($this->_props)) {\n return $this->_props;\n } else {\n return array();\n }\n }",
"public function __debugInfo()\n {\n $properties = $this->_properties;\n foreach ($this->_virtual as $field) {\n $properties[$field] = $this->$field;\n }\n\n return $properties;\n }",
"public function inspect()\n\t\t{\n\t\t\t$reflector = new \\ReflectionObject($this);\n\t\t\t$properties = $reflector->getProperties();\n\t\t\t$methods = $reflector->getMethods();\n\t\t\t$name = $reflector->getName();\n\n\t\t\treturn [\n\t\t\t\t$name => [\n\t\t\t\t\t'properties' => $properties,\n\t\t\t\t\t'methods' => $methods\n\t\t\t\t]\n\t\t\t];\n\t\t}",
"public static function getPropertyTitles(): array\n {\n return [\n 'date' => 'Refers to the trading day',\n 'volume' => 'Refers to single counted shares matched from executions on IEX',\n 'routedVolume' => 'Refers to single counted shares matched from executions on IEX',\n 'marketShare' => 'Refers to IEX’s percentage of total US Equity market volume',\n 'litVolume' => 'Refers to the number of lit shares traded on IEX (single-counted)',\n ];\n }",
"public static function getSymbol(): string\n {\n return static::symbol;\n }",
"public function Properties($visible=true){\r\n $reflection=new ReflectionClass($this);\r\n $properties=$reflection->getProperties();\r\n $result=array();\r\n if($visible){\r\n foreach ($properties as $property) {\r\n $result[$property->getName()]=$property->getValue($this);\r\n }\r\n }\r\n else{\r\n foreach ($properties as $property) {\r\n $result[]=$property->getName();\r\n }\r\n }\r\n return $result;\r\n }",
"protected function properties()\n {\n return [\n 'connected_object' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::object_browser(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__SHARE_ACCESS__ASSIGNED_OBJECT',\n C__PROPERTY__INFO__DESCRIPTION => 'Title'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_its_components_list__isys_connection__id',\n C__PROPERTY__DATA__RELATION_TYPE => C__RELATION_TYPE__IT_SERVICE_COMPONENT,\n C__PROPERTY__DATA__RELATION_HANDLER => new isys_callback(\n [\n 'isys_cmdb_dao_category_g_it_service_components',\n 'callback_property_relation_handler'\n ], [\n 'isys_cmdb_dao_category_g_it_service_components',\n true\n ]\n ),\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_connection',\n 'isys_connection__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CATG__IT_SERVICE_COMPONENTS__CONNECTED_OBJECT',\n C__PROPERTY__UI__PARAMS => [\n 'groupFilter' => 'C__OBJTYPE_GROUP__INFRASTRUCTURE',\n 'multiselection' => true\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => true,\n C__PROPERTY__PROVIDES__LIST => false\n ],\n C__PROPERTY__CHECK => [\n C__PROPERTY__CHECK__MANDATORY => false\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'connection'\n ]\n ]\n ]\n ),\n 'objtype' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::int(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__REPORT__FORM__OBJECT_TYPE',\n C__PROPERTY__INFO__DESCRIPTION => 'Object type'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__isys_obj_type__id',\n C__PROPERTY__DATA__FIELD_ALIAS => 'itsc_type',\n C__PROPERTY__DATA__TABLE_ALIAS => 'itsc',\n\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CATG__IT_SERVICE_COMPONENTS__OBJTYPE'\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__IMPORT => false,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false,\n C__PROPERTY__PROVIDES__VALIDATION => false,\n C__PROPERTY__PROVIDES__EXPORT => true\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'obj_type'\n ]\n ]\n ]\n )\n ];\n }"
]
| [
"0.64675045",
"0.6432386",
"0.6422827",
"0.6422827",
"0.6422827",
"0.6422827",
"0.6393749",
"0.636204",
"0.636204",
"0.636204",
"0.62743264",
"0.6243123",
"0.62414974",
"0.62414974",
"0.62414974",
"0.6221932",
"0.6221932",
"0.6214996",
"0.61813945",
"0.617852",
"0.617852",
"0.616562",
"0.61641043",
"0.6158038",
"0.6136814",
"0.61209106",
"0.6118009",
"0.61141324",
"0.6077641",
"0.6075513",
"0.6045985",
"0.60454106",
"0.6034178",
"0.5973628",
"0.59562755",
"0.59548265",
"0.59454054",
"0.5935887",
"0.5926313",
"0.59022224",
"0.5894074",
"0.588831",
"0.5887552",
"0.5843795",
"0.5840069",
"0.5819744",
"0.5811926",
"0.5787326",
"0.5767034",
"0.5763133",
"0.57546484",
"0.5751489",
"0.57469326",
"0.5743658",
"0.5740873",
"0.5727267",
"0.57267964",
"0.57263726",
"0.572619",
"0.5719781",
"0.5685721",
"0.56842643",
"0.5680225",
"0.5659117",
"0.56459534",
"0.563647",
"0.56276554",
"0.56270546",
"0.56233877",
"0.5621848",
"0.5621848",
"0.5615731",
"0.55867463",
"0.55795157",
"0.55674404",
"0.5560163",
"0.5544717",
"0.5539147",
"0.5536465",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.553387",
"0.5521954",
"0.55216223",
"0.5511588",
"0.55095685",
"0.548718",
"0.5485166",
"0.54645747",
"0.54395854",
"0.5434181"
]
| 0.6161109 | 23 |
Add a result to statistics, and check if it's already in results. | public function addResult(string $symbol, $value, array $selectData): Statistics {
$this->addProperty($symbol);
if (empty($selectData)) {
//No existing data with time, it is an insert
$this->properties[$symbol]['inserts'] ++;
} else {
$latest = reset($selectData);
if ($latest && (float) $latest['value'] != (float) $value) {
//Has an existing data, but the value is changed, it is an update
$this->properties[$symbol]['updates'] ++;
} else {
//Has an existing data, but value is the same, it is unchanged
$this->properties[$symbol]['no_changes'] ++;
}
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addResult($result) {\n //Adds a result to the results array\n $this->results[] = $result;\n }",
"public function add_result(array $request, $result) {\n $this->__results[] = array('action' => $request['action'],\n 'method' => $request['method'],\n 'tid' => $request['tid'],\n 'type' => $request['type'],\n 'result' => $result);\n return (true);\n }",
"public function hasResults();",
"public function addResult($file, Blerby_TestRunner_Result $result)\r\n {\r\n $this->aResults[$file][] = $result;\r\n }",
"public function add(ResultInterface $result): void\n {\n $this->results[] = $result;\n }",
"public function isHasResults();",
"public function checkIfAnalyzerResultDataExist($result): bool;",
"function add_activity_result($result) {\n\t\t$this->_activity_result[] = $result;\n\t}",
"public function add_analysable_results(array $results): bool {\n\n $any = false;\n\n // Process all provided time splitting methods.\n foreach ($results as $timesplittingid => $result) {\n if (!empty($result->result)) {\n $this->filesbytimesplitting[$timesplittingid][] = $result->result;\n $any = true;\n }\n }\n\n if (empty($any)) {\n return false;\n }\n return true;\n }",
"public function canAddToResult();",
"public function hasResult();",
"public function hasResult();",
"public function hasResult();",
"public function hasResults() {\n\t\treturn $this->count() >= 1;\n\t}",
"protected function addResults($newValues)\n {\n $this->results[] = $newValues;\n }",
"public function testAddResult(): void\n {\n $this->collection->setResult($this->timeResult);\n $this->assertEquals(\n $this->timeResult,\n $this->collection->getResult(TimeResult::class)\n );\n }",
"public function addResult(SearchResult $result)\n {\n $this->results[] = $result;\n return $this;\n }",
"public function hasResult(){\n return $this->_has(2);\n }",
"private function getResult(): void\n {\n $matches = $this->getNeedlesResult();\n foreach ($matches as $n_key => $match) {\n if (isset($match['matching_filters'])) {\n $match_count = count($match['matching_filters']);\n if ($match_count === 1) { // Save Matches\n $match = $this->getReturnValues($match);\n $match = $this->getLayerData($match);\n unset($match['matching_filters']);\n $this->SearchResult->matches[$n_key] = $match;\n continue;\n } elseif ($match_count > 1) { // Save Indecisive\n $result = [];\n $matching_filters = $match['matching_filters'];\n unset($match['matching_filters']);\n foreach ($matching_filters as $filter) {\n $result[] = $this->getReturnValues($match, $filter['filter_id']);\n }\n $match[$this->config->prefix . 'matching_filters'] = $result;\n $this->SearchResult->indecisive_matches[$n_key] = $match;\n continue;\n }\n }\n // Save no matches\n $this->SearchResult->no_matches[$n_key] = $match;\n }\n }",
"function addResult($result_title, $result_description, $result_picture, $memberID){\n\t\trequire('quizrooDB.php');\n\t\t\n\t\t// check if is member\n\t\tif($this->isOwner($memberID)){\n\t\t\t// Insert the result\n\t\t\t$insertSQL = sprintf(\"INSERT INTO q_results(`result_title`, `result_description`, `result_picture`, `fk_quiz_id`) VALUES (%s, %s, %s, %d)\",\n\t\t\t\t\t\t\t htmlentities(GetSQLValueString($result_title, \"text\")),\n\t\t\t\t\t\t\t htmlentities(GetSQLValueString($result_description, \"text\")),\n\t\t\t\t\t\t\t GetSQLValueString($result_picture, \"text\"),\n\t\t\t\t\t\t\t GetSQLValueString($this->quiz_id, \"int\"));\n\t\t\tmysql_query($insertSQL, $quizroo) or die(mysql_error());\n\t\t\t\n\t\t\t// find the result id\n\t\t\t$querySQL = \"SELECT LAST_INSERT_ID() AS insertID\";\n\t\t\t$resultID = mysql_query($querySQL, $quizroo) or die(mysql_error());\n\t\t\t$row_resultID = mysql_fetch_assoc($resultID);\n\t\t\tmysql_free_result($resultID);\n\t\t\t\n\t\t\treturn $row_resultID['insertID'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"final public function hasResults()\n {\n return boolval($this->results);\n }",
"function AddResults($rid){\n\t\n\tglobal $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players;\n\tglobal $db_admin,$db_admin_contact,$db_country,$db_league_seasons_rounds_results_players,$db_league_teams;\n\tglobal $url_flags;\n\t\n \t// CHECK PRIVILEGIES\n\tif ($_GET['action'] == \"results_add\" || $_GET['action'] == \"results_show\"){\n\t\tif (CheckPriv(\"groups_league_season_add\") <> 1) { echo _NOTENOUGHPRIV;exit;}\n\t} else {\n\t\techo _NOTENOUGHPRIV;exit;\n\t}\n\t\n\t$res_rounds = mysql_query(\"SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id, c.country_shortname,c.country_name \n\tFROM $db_league_seasons_rounds_results_players AS lsrrp \n\tJOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=\".(float)$rid.\" \n\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\tLEFT JOIN $db_admin_contact AS ac ON ac.aid=a.admin_id \n\tLEFT JOIN $db_country AS c ON c.country_id=ac.admin_contact_country \n\tWHERE lsrrp.league_season_round_result_player_round_id=\".(float)$rid.\" \n\tORDER BY lsrrp.league_season_round_result_player_place ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\n\tswitch ($_GET['action']){\n\t\tcase \"results_add\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\";\n\t\t\t$team = \"\";\n\t\t\t$table_width = \"857\";\n\t\t\t\n\t\t\techo Menu();\n\t\t\t\n\t\tbreak;\n\t\tcase \"results_show\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$flag = \"\t\t<td width=\\\"20\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._CMN_COUNTRY.\"</td>\\n\";\n\t\t\t$nick = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t\t$team = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\t$table_width = \"600\";\n\t\tbreak;\n\t\tdefault:\n\t\t\techo \"\";\n\t}\n\t$ar_round = mysql_fetch_array($res_round);\n\t$league_name = stripslashes($ar_round['league_league_name']);\n\t$season_id = $ar_round['league_season_round_season_id'];\n\t$season_name = stripslashes($ar_round['league_season_name']);\n\t$round_num = $ar_round['league_season_round_num'];\n\t\n\techo \"<table width=\\\"\".$table_width.\"\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\techo \"\t<tr>\\n\";\n\techo \"\t\t<td colspan=\\\"3\\\" align=\\\"left\\\">\";\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<h5 style=\\\"margin:20px 0px 0px 0px;\\\">\".$league_name.\" > <a href=\\\"modul_league.php?action=rounds&sid=\".$season_id.\"&project=\".$_SESSION['project'].\"\\\" target=\\\"_self\\\">\".$season_name.\"</a> > \"._LEAGUE_SEASON_ROUND.\" \".$round_num.\"</h5>\";}\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<form action=\\\"sys_save.php?action=results_add&rid=\".$rid.\"sid=\".$season_id.\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\">\";}\n\techo \"\t\t</td>\\n\";\n\techo \"\t</tr>\\n\";\n\techo \"\t<tr style=\\\"background-color:#dce3f1;\\\">\\n\";\n\techo \"\t\t<td width=\\\"50\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\\n\";\n\techo \"\t\t<td align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\\n\";\n\techo $flag;\n\techo $nick;\n\techo \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_GUID.\"</td>\\n\";\n\techo $team;\n\techo \"\t</tr>\\n\";\n\tswitch ($_GET['action']){\n\t\tcase \"results_add\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_round['league_season_round_classified'] >= $i){\n\t\t\t\t$ar_rounds = mysql_fetch_array($res_rounds);\n\t\t\t\tif ($ar_rounds['league_season_round_result_player_player_id']){ $guid = $ar_rounds['league_season_round_allowed_player_guid'].\" (PID \".$ar_rounds['league_season_round_result_player_player_id'].\")\";} else {$guid =\"\";}\n\t\t\t\techo \"<tr align=\\\"left\\\" valign=\\\"top\\\" onmouseover=\\\"this.style.backgroundColor='FFDEDF'\\\" onmouseout=\\\"this.style.backgroundColor='FFFFFF'\\\" style=\\\"background-color: #FFFFFF;\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"round_player_num\\\" value=\\\"\".$i.\"\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"round_player_data[\".$i.\"_place]\\\" value=\\\"\".$i.\"\\\">\";\n\t\t\t\techo \"\t\t\".$i.\"\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\";\n\t\t\t\techo \"\t\t<input name=\\\"round_player_data[\".$i.\"_points]\\\" size=\\\"5\\\" value=\\\"\".$ar_rounds['league_season_round_result_player_points'].\"\\\">\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"text\\\" name=\\\"round_player_data[\".$i.\"_player_guid]\\\" size=\\\"25\\\" value=\\\"\".$guid.\"\\\" autocomplete=\\\"off\\\" onkeyup=\\\"ajax_showOptions(this,'getAllowedPlayerGuidByLetters=1&rid=\".$rid.\"&project=\".$_SESSION['project'].\"',event)\\\">\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\techo \"\t<tr align=\\\"left\\\" valign=\\\"top\\\">\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" colspan=\\\"3\\\"><br />\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"round\\\" value=\\\"\".$round_num.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"rid\\\" value=\\\"\".$rid.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$season_id.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_SEASON_ROUND_RESULTS_SAVE.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t\t \tif ($ar_rounds){echo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"results_mode\\\" value=\\\"edit\\\">\\n\";}\n\t\t\techo \"\t\t\t</form>\\n\";\n\t\t\techo \"\t\t</td>\\n\";\n\t\t\techo \"\t</tr>\\n\";\n\t\tbreak;\n\t\tcase \"results_show\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\techo \"\t<tr \"; if ($i % 2 == 0){echo \"class=\\\"suda\\\"\";} else {echo \"class=\\\"licha\\\"\";} echo \">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t \t\t\techo \"\t<td valign=\\\"top\\\"><img src=\\\"\".$url_flags.$ar_rounds['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_rounds['country_name']).\"\\\" title=\\\"\".stripslashes($ar_rounds['country_name']).\"\\\" /></td>\";\n\t \t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['admin_nick'].\"</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\".$ar_rounds['league_season_round_allowed_player_guid'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tdefault;\n\t\t\techo \"\";\n\t}\n\techo \"</table>\\n\";\n}",
"function check_results($result) {\n\tif((!$result) || (mysql_num_rows($result) < '1')) {\n\t\t$num_results = '0';\n\t} else $num_results = mysql_num_rows($result);\n\treturn array($result,$num_results);\n}",
"private function addToResults($listToAdd)\n {\n $listToAdd = $listToAdd->limit($this->maximumNumberOfResults - $this->resultArrayPos);\n foreach ($listToAdd as $page) {\n if (!in_array($page->ID, $this->resultArray)) {\n ++$this->resultArrayPos;\n $this->resultArray[$this->resultArrayPos] = $page->ID;\n if ($this->resultArrayPos > $this->maximumNumberOfResults) {\n return true;\n }\n }\n }\n\n return false;\n }",
"public function hasResult($name)\n {\n return isset($this->results[$name]);\n }",
"function setResults ($result) {\n\t\t$this->_results = $result;\n\t}",
"function addCache( $results ) {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"INSERT INTO $this->cacheTable (post_id,cached_result) VALUES (\" . $this->db->escape( $this->postID ) . \", '\" . $this->db->escape( $results ). \"')\";\n\t\t\n\t\t$results = $this->db->query( $sql );\n\t\n\t\tif ( !$results )\n\t\t\treturn false;\n\t \n\t\treturn true;\n\t}",
"public function storeResults(array $results) {\n foreach ($results as $result) {\n $result->check()->storeResult($result);\n }\n }",
"function setResult($function, $result)\n {\n $this->m_results[$function] = $result;\n }",
"public function hasResult()\n\t{\n\t\treturn isset($this->result);\n\t}",
"function testResultAdd() {\n \n $result = $this->CI->player->memcacheInstance->flush();\n\n $query = $this->CI->db->query('SET FOREIGN_KEY_CHECKS=0;');\n $query = $this->CI->db->query('TRUNCATE SportGameResults;');\n $query = $this->CI->db->query('SET FOREIGN_KEY_CHECKS=1;');\n\n // check parlay schedule id\n $parlayCard = $this->CI->db->query('SELECT *\n FROM SportParlayCards c\n WHERE\n NOT c.id IS NULL AND\n NOT EXISTS(\n SELECT NULL\n FROM SportGameResults r\n WHERE c.sportScheduleId = r.sportScheduleId\n )\n LIMIT 1')->result();\n\n if( sizeof($parlayCard) > 0 ) {\n\n $data = array(\n 'sportScheduleId' => $parlayCard[0]->sportScheduleId,\n 'parlayCardId' => $parlayCard[0]->parlayCardId,\n 'score1' => 12,\n 'score2' => 20,\n );\n\n // To verify add result is invalid\n // ===============================\n // To verify parlayCardId Invalid\n $idInvalid = array('', null, 0, -1);\n\n foreach ($idInvalid as $value) {\n\n $parlayCardIdInvalid = $data;\n $parlayCardIdInvalid['parlayCardId'] = $value;\n $testResultSecond = $this->parlayresult->add( $parlayCardIdInvalid );\n\n if( is_array($testResultSecond) && isset($testResultSecond['message']) ) {\n\n if( !empty($value) ) {\n\n $this->assertContains( $testResultSecond['message'][0], 'The parlay Card Id field must contain a number greater than 0.', 'To verify parlayCardId is invalid' );\n } else {\n\n $this->assertContains( $testResultSecond['message'][0], 'The parlay Card Id field is required.', 'To verify parlayCardId is invalid' );\n }\n\n }\n }\n // To verify sportScheduleId Invalid\n $idInvalid = array('', null, 0, -1);\n foreach ($idInvalid as $value) {\n\n $sportScheduleIdInvalid = $data;\n $sportScheduleIdInvalid['sportScheduleId'] = $value;\n $testResultThird = $this->parlayresult->add( $sportScheduleIdInvalid );\n\n if( is_array($testResultThird) && isset($testResultThird['message']) ) {\n\n if( !empty($value) ) {\n\n $this->assertContains( $testResultThird['message'][0], 'The sport Schedule Id field must contain a number greater than 0.', 'To verify sportScheduleId is invalid' );\n } else {\n\n $this->assertContains( $testResultThird['message'][0], 'The sport Schedule Id field is required.', 'To verify sportScheduleId is invalid' );\n }\n\n }\n }\n\n // To verify add result is valid\n // ===============================\n $testResult = $this->parlayresult->add( $data );\n\n if ( is_object($testResult) ) {\n\n // To verify parlayCardId return must be equal parlayCardId input\n $this->assertEquals((int)$testResult->parlayCardId, (int)$data['parlayCardId'], 'To verify parlayCardId return must be equal parlayCardId input');\n\n // To verify sportScheduleId return must be equal sportScheduleId input\n $this->assertEquals((int)$testResult->sportScheduleId, (int)$data['sportScheduleId'], 'To verify sportScheduleId return must be equal sportScheduleId input');\n\n // To verify score1 return must be equal score1 input\n $this->assertEquals((int)$testResult->score1, (int)$data['score1'], 'To verify score1 return must be equal score1 input');\n\n // To verify score2 return must be equal score2 input\n $this->assertEquals((int)$testResult->score2, (int)$data['score2'], 'To verify score2 return must be equal score2 input');\n\n } else {\n\n $this->assertTrue( FALSE, \"Can't verify add result dailyshow in case valid.\");\n }\n\n } else {\n\n $this->assertTrue( FALSE, \"Can't verify add result dailyshow. Schedule is'nt exist.\");\n\n }\n\n }",
"public function addResult(Result $result): self\n {\n $handler = $result->getHandlerName();\n $this->results[$handler][] = $result;\n\n return $this;\n }",
"abstract protected function setresults();",
"public function hasResults()\n {\n return $this->matches && $this->matches->exists();\n }",
"public function append_result($result_append) {\n\t\t$this->_result .= $result_append;\n\t}",
"public function hasResults() {\n return 0 < count($this->getResults());\n }",
"public function store_result() {}",
"public function has_results()\n\t{\n\t\treturn (bool) $this->total_results();\n\t}",
"public function hasResult(): bool\n {\n return ! is_null($this->result);\n }",
"public function addResult(string $string) : void;",
"public function addTestResult(Streamwide_PHPUnit_Runner_TestCaseResult $testCaseResult)\n {\n $this->_results[] = $testCaseResult;\n \n $status = $testCaseResult->getStatus();\n $class = $testCaseResult->getTestCase()->getClass();\n $index = count($this->_results) - 1;\n \n $this->_statusIndex[$status][$class][] = $testCaseResult;\n $this->_classIndex[$class][$status][] = $testCaseResult;\n }",
"public function has_result()\n\t{\n\t\treturn !empty($this->result);\n\t}",
"private function processResults($results, $individualGenreResults) {\n\t\t$resultIndex = 0;\n\t\t$tweetCount = 0;\n\t\tforeach((array) $results as $result) {\n\t\t\t// only do new results that haven't been previously tweeted\n\t\t\t// probably don't need this check anymore, but keeping it as extra safety\n\t\t\tif(!isset( $this->usedSerialNumbers[intval($result->serialNumber)] )) {\n\t\t\t\tif($resultIndex != 0 && $this->realTweets) {\n\t\t\t\t\tsleep(self::DELAY_BETWEEN_TWEETS);\n\t\t\t\t\tif($resultIndex % 5 == 0) sleep(self::DELAY_BETWEEN_TWEETS); //add extra delay to avoid ban\n\t\t\t\t}\n\t\t\t\t$bookResult = new BookQueryResult($result);\n\t\t\t\t$bookResult->genreTagList = self::createGenreListForResult($result, $individualGenreResults);\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t$this->tweetNotice($bookResult);\n\t\t\t\t\t$this->usedSerialNumbers[] = intval($result->serialNumber);\n\t\t\t\t\tfile_put_contents($this->usedSerialNumbersFileName, $result->serialNumber.\"\\n\", FILE_APPEND);\n\t\t\t\t\t$tweetCount++;\n\t\t\t\t} catch (TwitterException $e) {\n\t\t\t\t\techo 'Error: ' . $e->getMessage();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t$resultIndex++;\n\t\t}\n\t\techo \"\\nSuccessfully tweeted \".$tweetCount.\" of \".count($results).\" new records found.\\n\";\n\t}",
"private function processResult($result, $data){\n\t\t\tswitch(strtolower($result['action'])){\n\t\t\t\tcase 'display':\n\t\t\t\t\t$this->processDisplayAction($result, $data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'result':\n\t\t\t\t\t$this->addToResultSet($result, $data);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t//Nothing happens here.\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn (bool) true;\n\t\t}",
"public function addResult(RaceResultItem $result)\n {\n if ($result->getParticipation()->getId() != $this->participation->getId()) {\n throw new \\Exception('Invalid player');\n }\n\n $this->pos_abs[] = $result->getPosAbs();\n $this->pos_rel[] = $result->getPosRel();\n $this->pts_abs[] = $result->getPtsAbs();\n $this->pts_rel[] = $result->getPtsRel();\n }",
"public function hasResults(...$args): bool\n {\n return $this->hasJson('results', ...$args);\n }",
"public function addResult($command, $status, $message)\n {\n $this->results[] = array('command' => $command, 'status' => $status, 'message' => $message);\n return $this;\n }",
"private function resCalc(&$result){\n if ($result == false)\n $result = $this->result;\n else {\n if (gettype($result) != 'resource')\n $result = $this->query($result);\n }\n }",
"public function addToCache($sThisResultName,$aResult)\n {\n $nCLU = $this->m_oContext->getLastUpdateTimestamp();\n if(!isset($this->m_aRuntimeResultCache[$nCLU]))\n {\n //Remove any existing keys since they are old now.\n $this->m_aRuntimeResultCache = array();\n \n //Create cache key for this.\n $this->m_aRuntimeResultCache[$nCLU] = array();\n }\n $this->m_aRuntimeResultCache[$nCLU][$sThisResultName] = $aResult;\n }",
"private function pushResult($element) {\n array_push($this->records, $element);\n\t}",
"private function addResultMessage() {\n $result = $this->importer->getResult();\n $array_column = array_column($result, 'status');\n $count = array_count_values($array_column);\n\n $this->messenger->addMessage($this->t('Created: @count', [\n '@count' => isset($count['create']) ? $count['create'] : 0,\n ]));\n\n $this->messenger->addMessage($this->t('Updated: @count', [\n '@count' => isset($count['update']) ? $count['update'] : 0,\n ]));\n\n $this->messenger->addMessage($this->t('Skipped: @count', [\n '@count' => isset($count['skip']) ? $count['skip'] : 0,\n ]));\n\n return $this;\n }",
"public function addNoResultsCheck()\n {\n $this->isResultCheck = false;\n return $this;\n }",
"public function has_results()\r\n {\r\n \t$tbl_stats = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);\r\n\t\t$sql = 'SELECT count(exe_id) AS number FROM '.$tbl_stats\r\n\t\t\t\t.\" WHERE exe_cours_id = '\".$this->get_course_code().\"'\"\r\n\t\t\t\t.' AND exe_exo_id = '.$this->get_ref_id();\r\n \t$result = api_sql_query($sql, __FILE__, __LINE__);\r\n\t\t$number=mysql_fetch_row($result);\r\n\t\treturn ($number[0] != 0);\r\n }",
"public function hit()\n {\n if($this->exists){\n $stats = $this->popularityStats()->first();\n if( empty( $stats ) ){\n //associates a new Stats instance for this instance\n $stats = new Stats();\n $this->popularityStats()->save($stats);\n }\n return $stats->updateStats();\n }\n return false;\n }",
"public function hit()\n {\n if($this->exists){\n $stats = $this->popularityStats()->first();\n if( empty( $stats ) ){\n //associates a new Stats instance for this instance\n $stats = new Stats();\n $this->popularityStats()->save($stats);\n }\n return $stats->updateStats();\n }\n return false; \n }",
"public function hasResult()\n {\n return Claroline::getDatabase()->query( \"\n SELECT\n user_id\n FROM\n `{$this->tbl['examination_score']}`\n WHERE\n user_id = \" . Claroline::getDatabase()->escape( $this->userId )\n )->numRows();\n }",
"function onSyncResultNumberCheck($result) {\n\tglobal $DBH, $tracking_numbers, $wa;\n\t// Set whatsapp users verified=true\n\tforeach ($result->existing as $number) {\n\t\t$number = explode(\"@\", $number)[0];\n\t\t$update = $DBH->prepare('UPDATE accounts\n\t\t\t\t\t\t\t\t\t\tSET \"verified\" = true WHERE \"id\" = :number;');\n\t\t$update->execute(array(':number' => $number));\n\t\t// Add user to the current tracking system\n\t\tarray_push($tracking_numbers, $number);\n\t\t// Add call for event listener\n\t\t$wa->SendPresenceSubscription($number);\n\t\techo ' -[verified] Added verified '.$number.' to the tracking system.'.\"\\n\";\n\t\tcheckLastSeen($number);\n\t\tcheckProfilePicture($number);\n\t}\n\t// Set non-whatsapp users inactive\n\tforeach ($result->nonExisting as $number) {\n\t\t$number = explode(\"@\", $number)[0];\n\t\t$update = $DBH->prepare('UPDATE accounts\n\t\t\t\t\t\t\t\t\t\tSET \"active\" = false WHERE \"id\" = :number;');\n\t\t$update->execute(array(':number' => $number));\n\t}\n}",
"private function evaluateThisResult($result, $data){\n\t\t\t//Test to make sure this result has everything we need.\n\n\t\t\tif(array_key_exists('action', $result)){\n\t\t\t\treturn (bool) $this->processResult($result, $data);\n\t\t\t} else {\n\t\t\t\treturn (bool) false;\n\t\t\t}\n\t\t}",
"private function addCachedResults($cover_file, array $results) {\n if ($this->cachedResults == null) {\n $this->cachedResults = array();\n }\n $this->cachedResults[(string)$cover_file] = $results;\n }",
"function displayResults($result){\n\t\n\t\t// Récupération des résultats\n\t\tglobal $resultMovieId;\n\t\t\n\t\t$rows = $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t\n\t\tforeach ($rows as $row) {\t\t\n\t\n\t\t\tif(!in_array($row['idmovie'], $resultMovieId)){\n\t\t\t\n\t\t\t\t$movieId = $row['idmovie'];\n\t\t\t\t$englishTitle = $row['enTitle'];\n\t\t\t\t$originalTitle = $row['originalTitle'];\n\t\t\t\t$director = $row['director'];\n\t\t\t\t$region = $row['regionName'];\t\t\t\n\t\t\t\t$year = $row['releaseDate'];\t\n\t\t\t\t\t\n\t\t\t\tinsertResult('<***>',$movieId, $originalTitle, $englishTitle, $director, $region, $year);\n\t\t\t\n\t\t\t\tarray_push($resultMovieId, $movieId);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t$nb_lignes = $result->rowCount();\n\t\t$result->closeCursor();\t\n\t\treturn $nb_lignes;\n\t\n\t}",
"function has_results() {\n\t\treturn ($this->QueryID && $this->record_count() !== 0);\n\t}",
"public function merge($result_to_merge){\n \t// If result to merge is valid do nothing - everything is ok with it, there is no messages\n if($result_to_merge->is_valid()) return;\n\n // Set current result is valid flag.\n $this->set_valid($result_to_merge->is_valid());\n\n // Append messages from result to merge\n $this->messages = $this->messages + $result_to_merge->get_messages();\n }",
"private function saveResult()\n {\n if ($this->schedule) {\n $this->schedule->fill([\n 'result_state' => 1,\n 'finished' => 1,\n 'running' => 0,\n 'result_message' => $this->successMessage,\n ]);\n $this->schedule->save();\n }\n }",
"protected function mergeResults($newValues)\n {\n $this->results = array_merge($this->results, $newValues);\n }",
"public function addToItemResults(\\StructType\\ItemResult $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\ItemResult) {\n throw new \\InvalidArgumentException(sprintf('The ItemResults property can only contain items of \\StructType\\ItemResult, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->ItemResults[] = $item;\n return $this;\n }",
"protected function load_results() {\n\t\t// No item loaded yet\n\t\tif ( empty( $this->item['id'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Join-query to retrieve vote results\n\t\t$results = ThumbsUp_Database::db()->arrayQuery(\"\n\t\t\tSELECT\n\t\t\t\tCOUNT(1) AS total_votes,\n\t\t\t\tSUM(v.rating) AS positive_votes,\n\t\t\t\tMAX(v.date) AS last_vote_date\n\t\t\tFROM items i\n\t\t\tJOIN votes v ON i.id = v.item_id\n\t\t\tWHERE i.id = {$this->item['id']}\n\t\t\tGROUP BY i.id\", SQLITE_ASSOC);\n\n\t\t// Nobody voted on this item yet\n\t\tif ( empty( $results ) ) {\n\t\t\t// Initialize result array manually\n\t\t\t$this->item['results'] = array(\n\t\t\t\t'total_votes' => 0,\n\t\t\t\t'positive_votes' => 0,\n\t\t\t\t'votes_balance' => 0,\n\t\t\t\t'negative_votes' => 0,\n\t\t\t\t'positive_percentage' => 0,\n\t\t\t\t'negative_percentage' => 0,\n\t\t\t\t'last_vote_date' => null,\n\t\t\t);\n\n\t\t\t// We're done\n\t\t\treturn true;\n\t\t}\n\n\t\t// Load the results into the class\n\t\t$this->item['results'] = current( $results );\n\n\t\t// Add our own extra result data, calculated by PHP instead of SQL\n\t\t$this->item['results']['negative_votes'] = $this->item['results']['total_votes'] - $this->item['results']['positive_votes'];\n\t\t$this->item['results']['votes_balance'] = $this->item['results']['positive_votes'] - $this->item['results']['negative_votes'];\n\t\t$this->item['results']['positive_percentage'] = $this->item['results']['positive_votes'] / $this->item['results']['total_votes'] * 100;\n\t\t$this->item['results']['negative_percentage'] = 100 - $this->item['results']['positive_percentage'];\n\n\t\treturn true;\n\t}",
"function removeResult($result_id, $memberID){\n\t\trequire('quizrooDB.php');\n\t\t\n\t\t// owner check\n\t\tif($this->isOwner($memberID)){\n\t\t\t// delete the result and also check if this results actually belongs to this quiz\n\t\t\t$insertSQL = sprintf(\"DELETE FROM q_results WHERE `result_id` = %d AND `result_id` IN(%s)\", GetSQLValueString($result_id, \"int\"), $this->getResults());\n\t\t\tmysql_query($insertSQL, $quizroo) or die(mysql_error());\t\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function addGroupResults(Group $group) {\n\t\t$this->groupResults[$group->getId()] = [\n\t\t\t'group' => $group,\n\t\t\t'points' => 0,\n\t\t\t'score' => 0,\n\t\t\t'wins' => 0,\n\t\t\t'draws' => 0,\n\t\t\t'losses' => 0,\n\t\t\t'second' => 0,\n\t\t\t'third' => 0\n\t\t];\n\t\treturn $this;\n\t}",
"public function addStatisticsUpdatesTheCurrentStatisticsRow(): void\n {\n $user = UserHelper::newUser();\n $expectedUserStatistics = new UserStatistics();\n $expectedUserStatistics->created_at = Carbon::today();\n $expectedUserStatistics->user_id = $user->id;\n $expectedUserStatistics->memorized_questions = 3;\n $expectedUserStatistics->save();\n $this->assertFalse($expectedUserStatistics->created_at < Carbon::today());\n\n UserStatistics::incrementForUser($user->id, 13);\n $expectedUserStatistics = UserStatistics::find($expectedUserStatistics->id);\n $this->assertEquals(1, $user->statistics()->count());\n $this->assertEquals(13, $expectedUserStatistics->memorized_questions);\n }",
"private function addResult($group, $check, $status = 0, $description = '')\n {\n $checks = $this->system_checks;\n $checks[$group][] = array(\n 'check' => $this->__($check),\n 'status' => $status,\n 'description' => $this->__($description),\n );\n\n $this->system_checks = $checks;\n return;\n }",
"public function exportResultData() {\n \n // get rounds\n $rounds = $this->object->getRounds();\n \n // Check if rounds exist, write a message if not\n if (count($rounds) > 0) { \n $this->exportResults();\n } else {\n ilUtil::sendFailure($this->txt(\"results_export_failure\"), true);\n }\n \n $this->ctrl->redirect($this, 'showResults');\n }",
"private function getNewResults($results) {\n \t$newResults = [];\n \tforeach ($results as $result) {\n \t\tif(!isset( $this->usedSerialNumbers[intval($result->serialNumber)] )) {\n \t\t\t$newResults[] = $result;\n \t\t}\n \t}\n \treturn $newResults;\n }",
"protected function addResults($crawler, &$results, &$selector, &$attr) {\n // We do not want to use a selector to find the result. Using \"html\" as selector produces a result that does not\n // contain the html tag, it shows the children of the html element. However, we want to show the html tag as\n // well, since it might provide valuable information in some cases.\n $results[] = Utils::getNodeHTML($crawler);\n }",
"public function republishResult($resultId, $result = [])\n {\n // doesn't exist? it's already been deleted as far as we're concerned\n if (null === ($_result = JobResult::byResultId($resultId)->first())) {\n return false !== $this->publishResult($resultId, $result);\n }\n\n return $_result->update(['result_text' => $result]);\n }",
"public function hasResults($r)\r\n {\r\n return ($this->numResults($r) > 0 ? true : false);\r\n }",
"public function registerCache(TranslationResults $translationResults): bool\r\n {\r\n $public_id = Hashing::translateCachePublicId(\r\n $translationResults->Source,\r\n $translationResults->Target,\r\n $translationResults->Input\r\n );\r\n\r\n $public_id = $this->coffeeHouse->getDatabase()->real_escape_string($public_id);\r\n $source = $this->coffeeHouse->getDatabase()->real_escape_string($translationResults->Source);\r\n $target = $this->coffeeHouse->getDatabase()->real_escape_string($translationResults->Target);\r\n $processing_engine = $this->coffeeHouse->getDatabase()->real_escape_string($translationResults->ProcessingEngine);\r\n $input = $this->coffeeHouse->getDatabase()->real_escape_string(urlencode($translationResults->Input));\r\n $output = $this->coffeeHouse->getDatabase()->real_escape_string(urlencode($translationResults->Output));\r\n $created_timestamp = (int)time();\r\n $last_updated_timestamp = (int)time();\r\n\r\n $Query = QueryBuilder::insert_into(\"translate_cache\", array(\r\n \"public_id\" => $public_id,\r\n \"source\" => $source,\r\n \"target\" => $target,\r\n \"processing_engine\" => $processing_engine,\r\n \"input\" => $input,\r\n \"output\" => $output,\r\n \"created_timestamp\" => $created_timestamp,\r\n \"last_updated_timestamp\" => $last_updated_timestamp\r\n ));\r\n\r\n $QueryResults = $this->coffeeHouse->getDatabase()->query($Query);\r\n\r\n if($QueryResults)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n throw new DatabaseException($this->coffeeHouse->getDatabase()->error);\r\n }\r\n }",
"public function loadResult(array $result)\n {\n $changed = false;\n\n foreach (['revenue', 'shipping', 'margin', 'orders', 'items', 'average', 'details'] as $property) {\n if (!isset($result[$property])) {\n continue;\n }\n\n if ($this->{$property} != $result[$property]) {\n $this->{$property} = $result[$property];\n $changed = true;\n }\n }\n\n return $changed;\n }",
"public function setResults($results){\n $this->results = $results;\n }",
"function updateResult($result_title, $result_description, $result_picture, $result_id, $memberID){\n\t\trequire('quizrooDB.php');\n\t\t\n\t\t// check if is member\n\t\tif($this->isOwner($memberID)){\n\t\t\t// Insert the result\n\t\t\t$insertSQL = sprintf(\"UPDATE q_results SET `result_title` = %s, `result_description` = %s, `result_picture` = %s WHERE `result_id` = %d\",\n\t\t\t\t\t\t\t htmlentities(GetSQLValueString($result_title, \"text\")),\n\t\t\t\t\t\t\t htmlentities(GetSQLValueString($result_description, \"text\")),\n\t\t\t\t\t\t\t GetSQLValueString($result_picture, \"text\"),\n\t\t\t\t\t\t\t GetSQLValueString($result_id, \"int\"));\n\t\t\tmysql_query($insertSQL, $quizroo) or die(mysql_error());\n\t\t\t\n\t\t\treturn $result_id;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function writeResult($result, bool $newResult) {\r\n if ($result == false) {\r\n return $result;\r\n }\r\n\r\n return $newResult;\r\n }",
"public function getTotalResults();",
"private function checkComplete($result) {\n\t\tif ($result[$this->alias]['minutes'] >= $result[$this->alias]['total_length']) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"protected function setResult(Result $result): void\n {\n $this->result = $result;\n }",
"protected function insertUserIDifMatchExists($result, $user)\n {\n $match = new Match();\n $match->exchangeArray($result->current());\n\n $sql = new Sql($this->dbAdapter);\n $update = $sql->update('tblmatch');\n\n $update->where(array('matchID = ?' => $match->getID()));\n \n //Updates User1 or User2 depending on which is empty\n if($match->getUser1())\n {\n $update->set(array('User2' => $user->getID(),\n 'User2ELO' => $user->getELO())); \n }\n else\n {\n $update->set(array('User1' => $user->getID(),\n 'User1ELO' => $user->getELO()));\n } \n $stmt = $sql->prepareStatementForSqlObject($update);\n $stmt->execute();\n //return updated Match\n return $this->getMatch($match->getID());\n }",
"private static function areAllOperationsSuccessful (array $result) : bool {\n return HashMap::from($result)\n ->all(function ($key, $value) {\n return $value === true; // can be true or Memcached::RES_*\n });\n }",
"public function addQueryStat($label, DOMQuery $query,\n array $options = array()) {\n $this->addTransformStat($label, $query->count(), $options);\n }",
"protected function set_result($result) {\r\n\t\t$this->result = $result;\r\n\t}",
"public function addResults(ResourceInterface ...$resources) {\n\t\t$this->results = array_merge($this->results, $resources);\n\t}",
"public function theResponseIsStored($name)\n {\n $this->storedResult[$name] = $this->getGuzzleResult();\n }",
"public function isBufferedResultsEnabled(): bool;",
"protected function addOutput($result, $title, $version) {\n\t\t$this->output[] = array(\n\t\t\t'title' => $title,\n\t\t\t'result' => $result,\n\t\t\t'version' => $version,\n\t\t\t'microtime' => microtime(TRUE),\n\t\t);\n\t}",
"private function getConjoinedResult(): void\n {\n $tot_match = 0;\n $tot_indecisive = 0;\n $tot_no_match = 0;\n $matches = $this->getNeedlesResult();\n foreach ($matches as $n_key => $match) {\n if (isset($match['matching_filters'])) {\n $match[$this->config->prefix . 'filter_match_count'] = count($match['matching_filters']);\n } else {\n $match[$this->config->prefix . 'filter_match_count'] = 0;\n }\n if ($match[$this->config->prefix . 'filter_match_count'] === 1) {\n $tot_match++;\n $match = $this->getReturnValues($match);\n $match = $this->getLayerData($match);\n unset($match['matching_filters']);\n } elseif ($match[$this->config->prefix . 'filter_match_count'] > 1) {\n unset($match['matching_filters']);\n $tot_indecisive++;\n } else {\n $tot_no_match++;\n }\n $this->SearchResult->matches[$n_key] = $match;\n }\n $this->SearchResult->total_matches = $tot_match;\n $this->SearchResult->total_indecisive_matches = $tot_indecisive;\n $this->SearchResult->total_no_matches = $tot_no_match;\n }",
"private function processResults($results) {\n\n if( $results['error'] != '' || isset($results['matches']) !== TRUE )\n {\n return FALSE;\n }\n\n $processed = array();\n\n //Only grab the important data\n foreach( $results['matches'] as $match )\n {\n $processed[] = $match['attrs'];\n }\n return $processed;\n }",
"function mr_do_upsert_results() {\n\t# TODO: make the nonce check work.\n\t# check_admin_referrer(\"upsert_results\", \"mr_upsert_results_nonce\");\n\n\t$input = $_FILES[\"results_file\"][\"tmp_name\"];\n\t$contest_scores = 0;\n\t$handle = fopen($input, \"r\");\n\twhile( !feof($handle)) {\n\t\tfgets($handle);\n\t\t$contest_scores++;\n\t}\n\techo $contest_scores;\n}",
"public function for_search_result() {\n\t\t$indexable = $this->repository->find_for_system_page( 'search-result' );\n\n\t\tif ( ! $indexable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->build_meta( $this->context_memoizer->get( $indexable, 'Search_Result_Page' ) );\n\t}",
"public function setResult($result)\n\t{\n\t\t$this->result = $result;\n\t}",
"private function calcResult(): void {\n\t\tswitch($this->rndOperator) {\n\t\t\tcase self::PLUS:\n\t\t\t\t$this->result = $this->rndNumber1 + $this->rndNumber2;\n\t\t\t\tbreak;\n\t\t\tcase self::MINUS:\n\t\t\t\t// Avoid negative results\n\t\t\t\tif($this->rndNumber1 < $this->rndNumber2) {\n\t\t\t\t\t$tmp = $this->rndNumber1;\n\t\t\t\t\t$this->rndNumber1 = $this->rndNumber2;\n\t\t\t\t\t$this->rndNumber2 = $tmp;\n\t\t\t\t}\n\n\t\t\t\t$this->result = $this->rndNumber1 - $this->rndNumber2;\n\t\t\t\tbreak;\n\t\t\tcase self::MULTIPLE:\n\t\t\tdefault:\n\t\t\t\t$this->result = $this->rndNumber1 * $this->rndNumber2;\n\t\t}\n\t}",
"public function setResult($result = null) {\r\n $this->_result = $result;\r\n }",
"private static function store_result( $result ) {\n\t\tupdate_option( 'nerdpress_cloudflare_notice', $result );\n\t}",
"private function setResult() {\n $result = 0;\n foreach ($this->process AS $key => $value) {\n $total = $value['pivot'] * $value['adj']['result'];\n if($key == 0) {\n $result = $result + $total;\n }\n elseif($key == 1) {\n $result = $result - $total;\n }\n else {\n if($key % 2 == 0) {\n $result = $result + $total;\n }\n else {\n $result = $result - $total;\n }\n }\n }\n unset($key, $value, $total);\n return $result;\n }"
]
| [
"0.7315046",
"0.6854962",
"0.6416045",
"0.63070464",
"0.6294768",
"0.6276677",
"0.61963415",
"0.6160663",
"0.6101135",
"0.60274774",
"0.5936604",
"0.5936604",
"0.5936604",
"0.59099334",
"0.5903742",
"0.58621377",
"0.5779909",
"0.57689583",
"0.5701495",
"0.56993455",
"0.56578547",
"0.56558716",
"0.5601442",
"0.55925024",
"0.55671203",
"0.5551124",
"0.5532296",
"0.5532171",
"0.55231214",
"0.5505116",
"0.54412675",
"0.54311067",
"0.5405674",
"0.53939646",
"0.53826606",
"0.5372182",
"0.53282547",
"0.5312301",
"0.53106946",
"0.52870536",
"0.5282629",
"0.5269072",
"0.52571696",
"0.52511317",
"0.5223642",
"0.5190036",
"0.5182286",
"0.51766735",
"0.5173855",
"0.5170684",
"0.5164381",
"0.5142395",
"0.5138655",
"0.51347935",
"0.51297367",
"0.5113533",
"0.5108555",
"0.51060534",
"0.5105544",
"0.50884986",
"0.5062131",
"0.5047413",
"0.503122",
"0.50155693",
"0.50095254",
"0.5004386",
"0.4996656",
"0.4996347",
"0.4990887",
"0.4980725",
"0.4972321",
"0.49697274",
"0.4965096",
"0.4959357",
"0.49386072",
"0.4928715",
"0.49219507",
"0.4913442",
"0.48978025",
"0.4897117",
"0.48916593",
"0.48832333",
"0.4873085",
"0.48595768",
"0.4854725",
"0.4850291",
"0.48481742",
"0.48373803",
"0.48330283",
"0.48296666",
"0.4825641",
"0.48105758",
"0.4799624",
"0.479007",
"0.4778107",
"0.47623995",
"0.47517982",
"0.47387558",
"0.4731553",
"0.47253808"
]
| 0.56730926 | 20 |
Get inserts of a property | public function getPropertyInserts(string $symbol): int {
return $this->properties[$symbol]['inserts'] ?? 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_inserts() {\n\t\t $attributes = $this->quoted_attributes();\n\n\t\t $inserts = array();\n\t\t foreach($attributes as $key => $value) {\n\t\t\t if(!in_array($key, $this->primary_keys) || ($value != \"''\")) {\n\t\t\t\t $inserts[$key] = $value;\n\t\t\t }\n\t\t }\n\t\t return $inserts;\n\t }",
"function i18n_get_inserts() {\n\t\t\t$attributes = $this->i18n_quoted_attributes();\n\n\t\t\t$inserts = array();\n\t\t\tforeach($attributes as $locale => $fields) {\n\t\t\t\tforeach($fields as $key => $value) {\n\t\t\t\t\t$inserts[$locale][$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $inserts;\n\t\t}",
"public function insertedRecords()\n {\n return $this->insertedIds;\n }",
"public function getInsertTagValue(string $value, string $property, array $elements): string;",
"public function getAddDefaultsExplicitlyOnInsert();",
"public function getInsertion()\n {\n return $this->insertion;\n }",
"public function getInsert()\n {\n return $this->readOneof(1);\n }",
"public function getInsert(): string;",
"private function getPropertyList($entity) {\n $property_list = array();\n $item_fields = array();\n\n try {\n $item_fields = $this->getListFromDB('information_schema.columns', array('table_name' => $entity ), null);\n /*$statement = \"select column_name, column_key from information_schema.columns where table_name = ':entity'\"; */\n /* find fields */\n /* Key = column_key; Field = column_name in DESCRIBE entity equivalent*/\n foreach ($item_fields as $field) {\n if ($field->COLUMN_KEY == 'PRI') {\n\t$property_list[] = 'id';\n }\n else if ($field->COLUMN_KEY == 'MUL') {\n\t$id_field = $field->COLUMN_NAME;\n\t$subentity = str_replace('_id', '', $id_field);\n\t/* get all subentities */\n\n\t$subentity_list = $this->getListFromDB($subentity);\n\t$property_list[] = array($subentity => $subentity_list);\n }\n else {\n\t$property_list[] = $field->COLUMN_NAME;\n }\n }\n }\n catch(Exception $e){\n return $this->handle_errors($e);\n /*$this->error = '<pre>ERROR: ' . $e->getMessage() . '</pre>';*/\n }\n\n return $property_list;\n}",
"protected function getValuesForDatabase() : array {\n\t\t$values = array();\n\t\tforeach ($this->propertyMap as $propertyName => $dbBinding) {\n\t\t\t$value = $this->{$propertyName};\n\t\t\t$value = $this->onBeforeSave($value, $propertyName);\n\n\t\t\t$values[$dbBinding] = $value;\n\t\t}\n\n\t\treturn $values;\n\t}",
"public function get_insert()\n {\n $pairs = !empty($this->multiset) ? $this->multiset: array($this->set);\n\n $vals = array();\n $keys = null;\n foreach ($pairs as $row)\n {\n $keys = array_keys($row);\n $vals[] = join(', ', self::prepare($row));\n }\n $keys = join(', ', $keys);\n $vals = join('), (', $vals);\n $table = self::quote_name($this->table);\n return \"insert into $table ($keys) values ($vals)\";\n }",
"protected function created()\n {\n $result = [];\n\n foreach ($this->after as $key => $value) {\n $result[] = [\n 'key' => $key,\n 'value' => $value,\n 'type' => empty($value) ? 'equal' : 'insert',\n ];\n }\n\n return $result;\n }",
"public function insert()\n {\n if (!$this->insertPreProcess()) {\n return false;\n }\n\n $res = true;\n foreach ($this->_objData as $k => $v) {\n $res = $res && DBUtil::insertObject($this->_objData[$k], $this->_objType, $this->_objField);\n }\n\n if ($res) {\n $this->insertPostProcess();\n return $this->_objData;\n }\n\n return false;\n }",
"public function getScheduledDocumentInsertions()\n {\n return $this->documentInsertions;\n }",
"public function insertDataProvider()\n {\n return ['column with identity field' => [['id' => 1, 'column1' => 10, 'column2' => 20]]];\n }",
"public function getAllForInsertUpdate()\n {\n $data = [];\n foreach ($this->_values as $key => $value) {\n if ($key === '_id' || $key === '_rev') {\n continue;\n }\n\n if ($key === '_key' && $value === null) {\n // key value not yet set\n continue;\n }\n $data[$key] = $value;\n }\n if ($this->_key !== null) {\n $data['_key'] = $this->_key;\n }\n\n return $data;\n }",
"public static function getPropertyKeys()\n {\n return array('id', 'title', 'pic');\n }",
"public function getAddedObjects() {}",
"public function getIdentityProperties() : array\n {\n if ($this->identityProperties === null) {\n throw new \\LogicException(sprintf('No identity properties have been set for class %s.', $this->getClassName()));\n }\n\n foreach ($this->identityProperties as $identityProperty) {\n if (! in_array($identityProperty, $this->getPersistentProperties())) {\n throw new \\LogicException(sprintf('Identity property $%s in class %s is not persistent.', $identityProperty, $this->getClassName()));\n }\n }\n\n return $this->identityProperties;\n }",
"public function getInsertOrUpdate()\n {\n return $this->readOneof(3);\n }",
"public function getProperties(): PropertyCollection;",
"function getPropertyAnnotations(\\ReflectionProperty $property);",
"protected static function insertGetIdTs()\n {\n return self::timestampValues(__FUNCTION__, [\"insertGetId\", \"created_at\", \"created_by\"]);\n }",
"protected function property_map() { return array(); }",
"private function values($appendPrimaryKey = true) {\r\n\t\t$c = get_called_class();\r\n\r\n\t\t$return = array();\r\n\t\tforeach ($c::getRequirements() as $column => $details) {\r\n\t\t\tif($c::$primaryKey != $column) {\r\n\t\t\t\t$property = substr($column,1,strlen($column)-2);\r\n\t\t\t\tif(in_array($property, array('creationDate','updateDate'))) {\r\n\t\t\t\t\t$return[] = $this->$property->format('Y-m-d H:i:s');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$return[] = $this->$property;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($appendPrimaryKey) {\r\n\t\t\t$return[] = $this->{substr($c::$primaryKey,1,strlen($c::$primaryKey)-2)}; }\r\n\t\treturn $return;\r\n\t}",
"private function createParamArray()\n {\n $data = [];\n /** @var Property $property */\n foreach($this->properties as $name => $property)\n {\n if ($property->initialized() && !$property->isReadOnly())\n {\n $data[$property->name()] = $property->preparedForDb();\n }\n }\n return $data;\n }",
"public function all_property_values()\n {\n return $this->property_values();\n }",
"public function getPropertyRelatedClasses(): array;",
"public abstract function getInsert(Table $table, $item = array());",
"public function generateArray()\n {\n return $this->getProperties();\n }",
"protected function properties(){\n\t\t$properties = array();\n\t\tforeach(static::$db_table_fields as $db_field){\n\t\t\tif(property_exists($this,$db_field)){\n\t\t\t$properties[$db_field]= $this->$db_field;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $properties;\t\n\t}",
"public function get_properties(): array {\n\t\t$properties = array();\n\n\t\tforeach ( $this->properties as $key => $property ) {\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$properties = array_merge( $properties, $property->get_properties() );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$properties[ $key ] = $property;\n\t\t}\n\n\t\treturn $properties;\n\t}",
"public function properties()\n {\n // Fetch all properties existing in the database\n $properties = Property::all();\n\n // return list of properties;\n return $properties;\n\n }",
"public function getProperties() {\n $modifiable_properties = [];\n $fields = $this->getFields();\n foreach (Framework::instance()->entityProperties($this->getEntity()) as $property => $info) {\n if (!in_array($property, array_keys($fields)) && $this->filter($property)) {\n $this->addModifier($modifiable_properties, 'property', $property);\n }\n }\n return $modifiable_properties;\n }",
"public function getPropertiesList() : array;",
"public function getStoredProperties($class)\n\t{\n\t\t$properties = $class->getProperties([T_EXTENDS, T_USE]);\n\t\tforeach ($properties as $key => $property) {\n\t\t\tif ($property->getAnnotation(Store_Annotation::ANNOTATION) != Store_Annotation::JSON) {\n\t\t\t\t$type = $property->getType();\n\t\t\t\tif (\n\t\t\t\t\t$property->isStatic()\n\t\t\t\t\t|| ($type->isMultiple() && !$type->getElementType()->isBasic())\n\t\t\t\t\t|| $property->getAnnotation('component')->value\n\t\t\t\t) {\n\t\t\t\t\tunset($properties[$key]);\n\t\t\t\t}\n\t\t\t\telseif ($type->isClass()) {\n\t\t\t\t\t$properties[$property->name] = new Column(\n\t\t\t\t\t\t'id_' . $property->getAnnotation('storage')->value\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $properties;\n\t}",
"protected function properties(){\n //return get_object_vars($this);\n $properties = array();\n //foreach(self::$db_table_fields as $db_field){\n foreach(static::$db_table_fields as $db_field){\n if(property_exists($this, $db_field)){\n \n $properties[$db_field] = $this->$db_field;\n }\n }\n return $properties;\n\n }",
"public function persisted() {\n $results = array();\n foreach ( $this->proxies as $id => $proxy ) {\n if ( $proxy->___repose_isPersisted() ) $results[] = $proxy;\n }\n return $results;\n }",
"public function insert()\n {\n return new QueryProxy('insert', $this);\n }",
"public function properties() {\n return array_keys($this->propertyDefs());\n }",
"function pluck(array $objects, $property) {\r\n\t$properties = array();\r\n\t\r\n\tforeach ($objects as $object) {\r\n\t\t$properties[] = $object->{$property};\r\n\t}\r\n\t\r\n\treturn $properties;\r\n}",
"public function toArray() : array\n {\n $result = [];\n foreach ($this->visibleProperties() as $property) {\n $value = $this->$property;\n if (is_array($value) or $value instanceof Collection) {\n foreach ($value as $k => $v) {\n if ($v instanceof Entity) {\n $result[$property][$k] = $v->toArray();\n }\n }\n continue;\n }\n if ($value instanceof Entity) {\n $value = $value->toArray();\n }\n $result[$property] = $value;\n }\n\n return $result;\n }",
"public function properties() : array\n {\n return array_keys($this->_properties);\n }",
"public function populatableProperties() : array;",
"public function insert()\n\t{\n\t\t$sql_array = array();\n\t\tforeach ($this->object_config as $name => $null)\n\t\t{\n\t\t\t$sql_array[$name] = $this->validate_property($this->$name, $this->object_config[$name]);\n\t\t}\n\n\t\t$sql = 'INSERT INTO ' . $this->sql_table . ' ' . $this->db->sql_build_array('INSERT', $sql_array);\n\t\t$this->db->sql_query($sql);\n\n\t\tif ($id = $this->db->sql_nextid())\n\t\t{\n\t\t\t$this->{$this->sql_id_field} = $id;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function getProperties(): array;",
"public function getProperties(): array;",
"public function insert() : string\n {\n if (empty($this->newProperties)) {\n $this->fillProperties();\n }\n\n $params = [];\n $columns = [];\n\n foreach ($this->newProperties as $key => $value) {\n if ($key === 'id') {\n continue;\n }\n\n $params[\":{$key}\"] = $value;\n $columns[] = \"`{$key}`\";\n }\n\n $columns = implode(', ', $columns);\n $placeholders = implode(', ', array_keys($params));\n $tableName = static::getTableName();\n\n $sql = sprintf(\n \"INSERT INTO `%s` (%s) VALUES (%s)\",\n $tableName,\n $columns,\n $placeholders\n );\n\n $stmt = static::getConn()->prepare($sql);\n $stmt->execute($params);\n\n $info = $stmt->errorInfo();\n if ($info[0] !== \\PDO::ERR_NONE) {\n die('We have : ' . $info[2]);\n }\n\n return static::getLastInsertId();\n }",
"public function property_assign_details()\n\t{\n\t\t\t$strSql = \"SELECT DISTINCT(user_id) FROM \".TBL_ASSIGN_PROPERTY;\n\t\t\t$this->objSet = $this->objDatabase->dbQuery($strSql);\n\t\t\treturn $this->objSet;\n\t}",
"function getInsertId() {\r\n return $this->m_insertId;\r\n }",
"private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }",
"public function getInjectProperties() {}",
"protected function properties(){\n\n // Here we are making an array, we are looping through the table to see if the fields in the table exist, if so. It is being stored into array \n $properties = array();\n foreach (static::$table_users_field as $users_field) {\n if(property_exists($this,$users_field)){\n $properties[$users_field] = $this->$users_field;\n }\n }\n\n return $properties;\n }",
"function getPrimaryKeys() {\n \treturn $this->db->getPrimaryKeys($this->table);\n }",
"public function getProperties()\n {\n return array_keys($this->toArray());\n }",
"public function getInsertId()\n {\n return $this->insertId;\n }",
"public function getPropertyNames();",
"public function get_PersistentProperty( $property = 'all' ) {\n\t\t\t$persistentData = array_reduce( $this->dbFields, array( $this, 'mapPropertyToField' ) );\n\n\t\t\treturn ( ( $property === 'all' ) ? $persistentData : ( isset( $persistentData[ $property ] ) ? $persistentData[ $property ] : null ) );\n\t\t}",
"public function getProperties(): array {\n\t\treturn array_keys($this->properties);\n\t}",
"public function push($value): IProperty;",
"public function getIdProperty();",
"protected function properties()\n {\n // return get_object_vars($this);\n\n $properties = array();\n foreach (self::$db_table_fields as $db_field) {\n if (property_exists($this, $db_field)) {\n $properties[$db_field] = $this->$db_field;\n }\n }\n\n return $properties;\n }",
"protected function properties()\n {\n // return get_object_vars($this);\n\n $properties = array();\n foreach (self::$db_table_fields as $db_field) {\n if (property_exists($this, $db_field)) {\n $properties[$db_field] = $this->$db_field;\n }\n }\n\n return $properties;\n }",
"public function toArray()\n {\n $result = [];\n foreach (array_keys($this->_properties) as $property) {\n $value = $this->get($property);\n if (is_array($value)) {\n $result[$property] = [];\n foreach ($value as $k => $entity) {\n $result[$property][$k] = $entity;\n }\n } else {\n $result[$property] = $value;\n }\n }\n\n return $result;\n }",
"public function propertyInfo() {\n return entity_get_property_info($this->entityType);\n }",
"public function insert() {\n $query = \"INSERT INTO {$this->Table} SET \";\n if($this->Fields) {\n foreach ($this->Fields as $key => $item) {\n if($item['ignore'] != true && $this->$key != \"\" && $this->$key !== null) {\n if($first === false) $query .= \", \";\n $query .= $key.\" = '\".$this->escape($this->$key).\"'\";\n $first = false;\n }\n }\n }\n $result = $this->query($query);\n $this->clear();\n return $result;\n }",
"public function testSave_Insert()\n\t{\n\t\t$this->object->Save();\n\n\t\t$someObject = new object();\n\t\t$objectList = $someObject->GetList(array(array(\"objectId\", \">\", 0)));\n\t\t$this->assertEquals(1, sizeof($objectList));\n\t}",
"public function getProperties() {\n return array_keys($this->_properties);\n }",
"public function getTSPropertyArray()\n {\n return $this->tsPropertyArray;\n }",
"public function setKeysFromInserted()\n\t{\n\t\t$keys = $this->database->getNewKeys();\n\n\t\t$this->data = Arr::mergeDeep($this->data, $keys);\n\n\t\t$this->key = $keys[$this->primaryKey] ?? null;\n\t}",
"public function insertGetId()\n {\n return $this->lastId;\n }",
"public function insertGetId()\n {\n return $this->lastId;\n }",
"private function getCreatedSet() {\n \n $new_array = array ();\n \n foreach ( $this->getSet() as $key => $value ) {\n $new_array[] = \"$key = $value\";\n }\n \n return \"SET \" . implode( \", \", $new_array );\n \n }",
"public function getIdFromProperty($_property);",
"public function getMutationsList(){\n return $this->_get(3);\n }",
"public function getProperties(): Collection\n {\n return collection($this->reflectionObject->getImmediateProperties())->map(function (ReflectionProperty $property) {\n return new PropertyEntity($property);\n });\n }",
"public function testInsertValidProperty() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//grab dah data from mySQL and check that the fields match our expectations\n\t\t$pdoProperty = Property::getPropertyByPropertyId($this->getPDO(), $property->getPropertyId());\n\t\t$this->assertEquals($numRows +1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE);\n\t}",
"function get_properties()\r\n {\r\n return $this->properties;\r\n }",
"function getInsertId(){\r\n\t\treturn $this->m_insertId;\r\n\t}",
"final public function getInsertId() {\n return $this->_getInsertId();\n }",
"public function getCreatedObjects()\n {\n if (array_key_exists(\"createdObjects\", $this->_propDict)) {\n return $this->_propDict[\"createdObjects\"];\n } else {\n return null;\n }\n }",
"public function getMutationsList(){\n return $this->_get(2);\n }",
"public static function getIDProperties()\n {\n return static::$ids;\n }",
"public function getGeneratedIds() {}",
"protected function getSaveData(): array\n {\n foreach ( $this->columns as $columnName => $column ) { //Get DB input array\n $propertyName = $this->getColumnPropertyName( $columnName );\n $propertyValue = $this->$propertyName;\n if ( !empty( $this->changed[$propertyName] ) ) {\n\n if ( !empty( $column['refresh_after_update'] ) ) {\n $this->redirectAfterUpdate = true;\n }\n\n if ( $propertyValue instanceof self ) {\n $data[$columnName] = $propertyValue->id;\n } else {\n $data[$columnName] = $propertyValue;\n }\n }\n }\n return $data ?? [];\n }",
"public function insert()\n\t{\n\t\treturn $this->getModel()->insert($this);\n\t}",
"public function getPrimaryKeyValues() {\n\t\treturn array(\n\t\t\tself::FIELD_ID=>$this->getId());\n\t}",
"public function getPropertyKeys()\n {\n return ['type', 'min', 'max', 'equals', 'value'];\n }",
"public function getExposedProperties(): array;",
"public function getTrueMutationsList(){\n return $this->_get(4);\n }",
"public function testGetAllProperties() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//grab data from MySQL and check expectations\n\t\t$results = Property::getAllProperties($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"GoGitters\\\\ApciMap\\\\Property\", $results);\n\n\t\t//grab the property from the array and validate it\n\t\t$pdoProperty = $results[0];\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE);\n\t}",
"public function propertyIdent()\n {\n return $this->propertyIdent;\n }",
"private function insert($class)\n {\n $insert = array();\n if (Orm::$use_guids) {\n # TODO\n # generate guid\n }\n\n # TODO: parental relationships??????\n\n $properties = self::getProperties($class);\n SSql::query(sprintf(\"INSERT INTO %s (%s) VALUES (%s)\",\n self::classToDbName($class),\n implode(', ', array_map(array($this, 'sqlKey'), $properties)),\n implode(', ', array_map(array($this, 'sqlValue'), $properties))),\n self::getSSqlName($this->setup_name)\n );\n # WORKING_ON\n\n if (!Orm::$use_guids) {\n # TODO\n # get id from db\n }\n }",
"public function get()\n {\n $values = (array) $this->parts['values'];\n\n $keys = ' (' . implode(', ', array_keys($values)) . ')';\n\n $values = ' VALUES (' . implode(', ', $values) . ')';\n\n return 'INSERT INTO ' . $this->table() . $keys . $values;\n }",
"public function getProperties(): array\n {\n return $this->properties;\n }",
"private function getValuesToSave(): array\n\t{\n\t\t$forSave = [];\n\t\t$tableName = $this->getTableName();\n\t\tif (!$this->getId()) {\n\t\t\t$forSave[$this->getTableName()] = [\n\t\t\t\t'sortorderid' => $this->getNextSeq(),\n\t\t\t\t'presence' => $this->presence,\n\t\t\t];\n\t\t}\n\t\t$fields = $this->getId() ? array_keys($this->changes) : $this->getWritableFields();\n\t\tforeach ($fields as $name) {\n\t\t\t$itemPropertyModel = $this->getFieldInstanceByName($name);\n\t\t\tif ($itemPropertyModel && isset($this->{$name}) && ($this->getId() || (!$this->getId() && '' !== $this->{$name}))) {\n\t\t\t\t$this->validateValue($name, $this->{$name});\n\t\t\t\t$forSave[$itemPropertyModel->getTableName()][$itemPropertyModel->getColumnName()] = $this->{$name};\n\t\t\t} elseif (isset($this->{$name}) && ($this->getId() || (!$this->getId() && '' !== $this->{$name}))) {\n\t\t\t\t$this->validateValue($name, $this->{$name});\n\t\t\t\t$forSave[$tableName][$name] = $this->{$name};\n\t\t\t}\n\t\t}\n\n\t\treturn $forSave;\n\t}",
"private function detectFromGetters(ReflectionProperty $property): array\n {\n // Using Getters.\n $class = $property->getDeclaringClass();\n $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);\n\n foreach ($methods as $method) {\n // get only methods that have 0 parameter and start with 'get'\n if ($method->getNumberOfParameters() === 0 &&\n strpos($method->getName(), 'get') !== false &&\n stripos($method->getName(), $property->getName()) !== false) {\n $returnType = $method->getReturnType();\n if (!$returnType) {\n return [];\n }\n\n $types = [$returnType->getName()];\n if ($returnType->allowsNull()) {\n $types[] = 'null';\n }\n\n return $types;\n }\n }\n\n return [];\n }",
"public function toArray()\n {\n $data = array();\n\n collect($this->touchedBySetter)\n ->each(function ($property) use (&$data): void {\n $data[$property] = $this->{$property};\n });\n\n return $data;\n }",
"public function getAddedObjects() {\n\t\treturn $this->addedObjects;\n\t}",
"public function __debugInfo()\n {\n $properties = $this->_properties;\n foreach ($this->_virtual as $field) {\n $properties[$field] = $this->$field;\n }\n\n return $properties;\n }"
]
| [
"0.6278516",
"0.57707626",
"0.567348",
"0.5540615",
"0.5527308",
"0.55164456",
"0.5515338",
"0.53407073",
"0.5270581",
"0.5242606",
"0.520509",
"0.51501244",
"0.5049884",
"0.5047991",
"0.49884465",
"0.49817464",
"0.4980011",
"0.49276045",
"0.4909031",
"0.48920676",
"0.48669666",
"0.48643085",
"0.48524624",
"0.4835591",
"0.4827615",
"0.48154154",
"0.48013043",
"0.4796239",
"0.4779059",
"0.47673342",
"0.47495988",
"0.4746876",
"0.47419116",
"0.47395638",
"0.4739263",
"0.4721789",
"0.46986634",
"0.46892118",
"0.4674694",
"0.4665812",
"0.46656916",
"0.46632183",
"0.4651953",
"0.46419403",
"0.4640397",
"0.46385717",
"0.46385717",
"0.46274534",
"0.46272758",
"0.46254683",
"0.46199155",
"0.4613958",
"0.46066976",
"0.45983303",
"0.45868337",
"0.45781568",
"0.45725828",
"0.45719427",
"0.45679924",
"0.45646164",
"0.4561076",
"0.45602265",
"0.45602265",
"0.45560655",
"0.45542535",
"0.45531172",
"0.45483154",
"0.45482066",
"0.45452276",
"0.45444018",
"0.45397714",
"0.45397714",
"0.45395166",
"0.45359197",
"0.45348322",
"0.45336214",
"0.45328692",
"0.4527297",
"0.45263177",
"0.45260885",
"0.45138595",
"0.45123324",
"0.45117426",
"0.45112863",
"0.45078036",
"0.45058215",
"0.44917715",
"0.4486027",
"0.44810188",
"0.44781497",
"0.44775864",
"0.447194",
"0.44699055",
"0.44653082",
"0.44638726",
"0.44588947",
"0.445682",
"0.44542524",
"0.4454051",
"0.44485915"
]
| 0.62569225 | 1 |
Set inserts of a property | public function setPropertyInserts(string $symbol, int $value): Statistics {
$this->addProperty($symbol);
$this->properties[$symbol]['inserts'] = $value;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __set($property, $value) {}",
"public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }",
"public function dset($property,$value){\n $this->$property = $value;\n $table = $this->table;\n $id = $this->id; \n LAIKA_Database::update($table, $property, $value, \"id = $id\");\n }",
"function set_property(){\n }",
"function set_properties_by_id () {\n\t\t$stm = DB::$pdo->prepare(\"select * from `generated_object` where `id`=:id\");\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t\t$res = $stm->fetch();\n\n\t\t$this->set_properties_by_array($res);\n\t}",
"public function set($property, $value);",
"public function push($value): IProperty;",
"function setProperty($property,$value=null){\n\t\t/*\n\t\t * This function is useful to call right after adding the filed:\n\t\t *\n\t\t * $this->addField('line','login')->setProperty('not null');\n\t\t */\n\t\treturn $this->setFieldProperty($this->last_field,$property,$value);\n\t}",
"function __set($property, $value)\n {\n if($property == \"id\")\n {\n $this->id = $value;\n }\n else\n {\n return call_user_func_array(array($this, \"setAttribute\"), array($property, $value));\n }\n }",
"function __set($property, $value) {\n global $DB;\n if(is_array($value) && @$this->TYPE[$property] === 'CSV') $value = join(',',$value);\n if(!isset($this->DATA[$property])\n || $this->DATA[$property] !== $value) {\n $DB->config->update(array('value' => $value), array('property' => $property, 'section' => $this->NAME), true);\n $this->DATA[$property] = $value;\n }\n }",
"abstract protected function propertySet($name, $value);",
"public function testInsertValidProperty() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//grab dah data from mySQL and check that the fields match our expectations\n\t\t$pdoProperty = Property::getPropertyByPropertyId($this->getPDO(), $property->getPropertyId());\n\t\t$this->assertEquals($numRows +1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE);\n\t}",
"public function __set($property, $value){\n\t\t$this->_connect();\n\t\tif($this->_dumpLock==false){\n\t\t\tif(isset($this->$property)==false){\n\t\t\t\tthrow new ActiveRecordException(\"La propiedad '$property' no existe en la entidad '\".get_class($this).\"'\");\n\t\t\t}\n\t\t}\n\t\t$this->$property = $value;\n\t}",
"public function set(string $property, $value);",
"function __set($property, $value) {\n global $USER, $DB;\n if(in_array($property, array('title', 'header'))) {\n return ($this->{'_'.$property} = $value);\n } elseif($property == 'content') {\n return ($this->$property = $value);\n } else {\n return parent::__set($property, $value);\n }\n }",
"public function updatePropertyIndex ()\n {\n $new_properties_table = array();\n\n foreach ( $this as $declaration ) {\n\n $name = $declaration->property;\n\n if ( isset( $new_properties_table[ $name ] ) ) {\n $new_properties_table[ $name ]++;\n }\n else {\n $new_properties_table[ $name ] = 1;\n }\n }\n $this->properties = $new_properties_table;\n }",
"function __set($property, $value)\n {\n $this->setValue($value);\n }",
"private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }",
"public function __set($property, $value) {\n\t\tswitch($property) {\n\t\t\tcase 'key':\n\t\t\t\t$this->key = $value;\n\t\t\t\tbreak;\n\n case 'after':\n $this->after = strtotime($value);\n break;\n\n case 'cards':\n $this->cards = $value;\n break;\n\n\t\t\tdefault:\n\t\t\t\tparent::__set($property, $value);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function __set($a_sProperty, $a_sValue) \n {\n // convert property name\n $sMethod = 'set'.$this->_propertyNameConverter($a_sProperty);\n if (method_exists($this, $sMethod)) {\n $this->{\"$sMethod\"}(mysql_real_escape_string($a_sValue));\n }\n }",
"function setMultiple($properties) {\n foreach ($properties as $property => $value) {\n $this->set($property, $value);\n }\n }",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"function __set($prop, $val)\n {\n if (isset($this->$prop)) $this->$prop = $val;\n elseif (isset($this->_fk[$prop])) $this->_data[$prop] = $val->id;\n elseif (isset($this->_cols[$prop])) $this->_data[$prop] = $val;\n else throw new Exception(sprintf('Property \"%s\" not available', $prop));\n }",
"public function setInsertion($value)\n {\n $this->insertion = $value;\n }",
"protected function _add($property, $value): void {\n if (property_exists($this, $property)) {\n $this->{$property}[] = $value;\n } else {\n $this->_properties[$property][] = $value;\n }\n }",
"function __set($property, $value)\n {\n\n if( $value != null )\n $this->fields[$property] = $value;\n }",
"public function addPropertyValues(Property $property) {\r\n foreach ($property->getPropertyValues() as $propertyValue) {\r\n $property->addPropertyValue($propertyValue);\r\n }\r\n }",
"public function __set($property, $value) {\n\t\tif (strpos($property, 'source') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\t$this->bean->source = $value;\n\t\t\t} else {\n\t\t\t\t$sourceInstance = $this->getSourceInstance();\n\t\t\t\tif ($sourceInstance !== null) {\n\t\t\t\t\t$sourceInstance->$property = $value;\n\t\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (strpos($property, 'remote') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\t$this->bean->target = $value;\n\t\t\t} else {\n\t\t\t\t$targetInstance = $this->getTargetInstance();\n\t\t\t\tif ($targetInstance !== null) {\n\t\t\t\t\t$targetInstance->$property = $value;\n\t\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Temporary properties are kept in the object, and not written to the database.\n\t\t} elseif (strpos($property, 'temp') === 0) {\n\t\t\t$property = lcfirst(substr($property, 4));\n\t\t\t$this->tempProperties[$property] = $value;\n\t\t} elseif (isset($this->bean->$property)) {\n\t\t\t$this->bean->$property = $value;\n\t\t} elseif (!isset($this->properties[$property]) || $this->properties[$property] !== $value) {\n\t\t\t$this->properties[$property] = $value;\n\t\t\t$this->bean->setMeta('tainted', true);\n\t\t}\n\t}",
"public function __set($property, $value) {\r\n\t\tswitch($property) {\r\n\t\t\tcase 'view':\r\n\t\t\t\t$this->view = $value;\r\n\t\t\t\t$this->install($this->view);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'script':\r\n\t\t\t\t$this->script .= $value;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n PropertyHelper::Error($property);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"private function parseProperties(): void\n {\n $properties = $this->extractProperties();\n\n foreach ($properties as $property)\n {\n if ($property['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($property['docblock']['doc_line_start'],\n $property['docblock']['doc_line_end'],\n $property['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertProperty($this->clsId,\n $docId,\n $property['name'],\n Cast::toManInt($property['is_static']),\n $property['visibility'],\n $property['value'],\n $property['start'],\n $property['end']);\n }\n }",
"protected static function setPropertyHash($property)\n {\n DB::insert(\n \"INSERT INTO `sync_hash` (property_id, hash) VALUES (?,?)\",\n [$property['id'], md5(json_encode($property))]\n );\n }",
"public function addColumn(Property $property);",
"public function __set($property, $value) {\n\t\tif (array_key_exists($property, $this->_allowedColumns)) {\n\t\t\t$this->_valueArray[$property] = $value;\n\t\t} else {\n\t\t\tthrow new L8M_Exception('Property does not exist: ' . $property);\n\t\t}\n\t}",
"public function set($property, $value = null) {\r\n if (!is_array($property)) {\r\n $property = array($property => $value);\r\n }\r\n foreach ($property as $field => $val) {\r\n if(method_exists($this, $method = 'set_'.$field)){\r\n $property[$field] = $this->$method($val);\r\n $value = null;\r\n }\r\n elseif(method_exists($this, $field)){\r\n $this->relationships[$field] = $val;\r\n }\r\n }\r\n $result = $this->orm->set($property, $value);\r\n return $result;\r\n }",
"public function addProperty($key, $value);",
"function assignIfIsset($object, $property, $array, $key)\n{\n if (array_key_exists($key, $array)) {\n $object->$property = $array[$key];\n }\n}",
"public function __set($property, $value) {\n if (isset($this->translation[$property])) {\n $property = $this->translation[$property];\n }\n $this->_magicProperties[$property] = $value;\n }",
"public function update() {\n\t\t// When loaded, fully sync the property array.\n\t\tif ($this->loadedSettings !== false) {\n\t\t\t$properties = array();\n\t\t\t$ownProperties = $this->bean->ownProperty;\n\t\t\tforeach ($this->properties as $k => $v) {\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($ownProperties as $property) {\n\t\t\t\t\tif ($property->name === $k) {\n\t\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t$properties[] = $property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found) {\n\t\t\t\t\t$property = R::dispense('property');\n\t\t\t\t\t$property->name = $k;\n\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->bean->ownProperty = $properties;\n\t\t\t// When loaded, only add and modify properties, but do not delete any\n\t\t} elseif (!empty($this->properties)) {\n\t\t\t$ownProperties = $this->bean->ownProperty;\n\t\t\tforeach ($this->properties as $k => $v) {\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($ownProperties as $property) {\n\t\t\t\t\tif ($property->name === $k) {\n\t\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t$this->bean->ownProperty[$property->id] = $property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found) {\n\t\t\t\t\t$property = R::dispense('property');\n\t\t\t\t\t$property->name = $k;\n\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t$this->bean->ownProperty[] = $property;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function __set( $property, $value ) {\n\t\t\tif ( property_exists( $this, $property ) ) {\n\n\t\t\t\t// Latitude hard-wired callback\n\t\t\t\t//\n\t\t\t\tif ( $property === 'latitude' ) {\n\t\t\t\t\t$this->set_LatLong( $value , null );\n\n\t\t\t\t// Longitude hard-wired callback\n\t\t\t\t//\n\t\t\t\t} elseif ( $property === 'longitude' ) {\n\t\t\t\t\t$this->set_LatLong( null , $value );\n\n\t\t\t\t// All other standard properties\n\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t$this->$property = $value;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Extended Data, allow property as long as it does not conflict\n\t\t\t// with a built-in property.\n\t\t\t//\n\t\t\tif ( ! property_exists( $this, $property ) ) {\n\t\t\t\tif ( $this->slplus->database->is_Extended() &&\n\t\t\t\t\t$this->slplus->database->extension->has_field( $property )\n\t\t\t\t) {\n\t\t\t\t\t$this->exdata[ $property ] = $value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->temporary[ $property ] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}",
"public function __set($property, $value) {\n if (class_exists('\\Sleepy\\Hook')) {\n $this->data[$property] = Hook::addFilter($this->clean_class() . '_set_' . $property, $value);\n $this->data[$property] = Hook::addFilter($this->clean_class() . '_set_property', $value);\n } else {\n $this->data[$property] = $value;\n }\n }",
"public function __set($property, $value) {\r\n $param = '_' . $property;\r\n $this->$param = $value;\r\n }",
"function &__set($property, $value)\n {\n $retval = $this->_stdObject->{$property} = $value;\n return $retval;\n }",
"public function property(&$class, $property);",
"public function __set($property, $value)\n {\n // convert from Phalcon\\Mvc\\Model\\Resultset\\Simple\n if ($value instanceof \\Phalcon\\Mvc\\Model\\ResultSetInterface)\n {\n // converts resultset into array instead\n // note: you would think you could do $value->toArray() but that converts everything to an array, not just the outer part\n // just track the result sets that we have to convert if in the event we are setting the resultset to the property\n // need to do it this way for performance, filter is too slow\n // this gets triggered for every field for every fetch query (but only when using model relationships aliases\n// $this->fixResultSets[$property] = true;\n //\n $value = $value->filter(function($r) {\n return $r;\n });\n } else\n {\n unset($this->fixResultSets[$property]);\n }\n parent::__set($property, $value);\n }",
"public function set($value): IProperty;",
"abstract public function set();",
"public function testIncrementalSet()\n {\n $method = $this->builder_reflection->getMethod('sql_set');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('set');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array( array('column1' => 'value1')));\n $method->invokeArgs($this->builder, array( array('column2' => 'value2')));\n\n $string = 'SET column1 = value1, column2 = value2';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }",
"function createProperty();",
"public function __set($prop, $valor){\n\t\tif( !property_exists($this, $prop))\t{\n\t\t\tthrow new exception(\"la propiedad $prop no existe\"); \t\t\t\n\t\t}\t\t\n\t\t$this->$prop = $valor;\n\t\t//$this->(\"set\".ucfirst($prop))($valor);\n\t\t\n\t}",
"public function __set($property, $value)\n {\n $this->data[$property] = $value;\n }",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"public function __set($property, $value) {\n if ( isset($this->$property)) {\n $this->$property = $value;\n }\n else\n {\n die(\"$value nao existe\");\n }\n }",
"public function setProperty($property, $value)\n\t{\n\t\tglobal $mysql;\n\t\t$property = real_escape_string($property);\n\t\t$value = real_escape_string($value);\n\t\t\n\t\treturn $mysql->query(\"UPDATE laptops SET `\".$property.\"` = '\".$value.\"' WHERE `id` = \".$this->getID());\n\t}",
"function __set($name, $value){\n //var_dump($value);\n\n $this->_properties[$name] = $value;\n }",
"public function __set($property, $value){\n $this->$property = $value;\n }",
"public function addProperty(Entities\\Devices\\Properties\\Property $property): void\n\t{\n\t\tif (!$this->properties->contains($property)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->properties->add($property);\n\t\t}\n\t}",
"public function appendAffectedObjectProperty(PropertyInterface $property)\n {\n $this->affectedObjectProperties[] = $property;\n }",
"public function __set($prop, $val) {\n\t\t$this->props[$prop] = $val;\n }",
"abstract function setUserProfileProperty($user, $property_name, $property);",
"protected function save($property) {\n\t\t/** @var \\Interfaces\\Shared\\Database $database */\n\t\t$database = $this->dependence_objects['database'];\n\t\tif ($property) {\n\t\t\t$connection = $database->getConnection();\n\t\t\t$connection->exec('UPDATE config SET '.$property.' = \\''.$connection->escapeString($this->$property).'\\'');\n\t\t\t$this->initialize();\n\t\t}\n\t}",
"public function setPropertyBehavior() {\n $this->isInPropertyBehavior= TRUE;\n }",
"public function setProperties($properties)\n {\n\n }",
"public function setProperty(string $property = '', $value = null): void\n {\n if ( !isset( $value ) || $value === null ) {\n return;\n }\n\n if ( !array_key_exists( $property, $this->columns ) ) {\n return;\n }\n\n $propertyType = $this->columns[$property]['type'] ?? 'id';\n $propertyName = $this->getColumnPropertyName( $property );\n\n if ( method_exists( $this, $propertyName ) ) {\n $value = $this->cleanInput( $value, $propertyType );\n\n if ( $value !== null ) {\n $this->$propertyName = $value;\n }\n }\n }",
"public function getInsertTagValue(string $value, string $property, array $elements): string;",
"public function __set($propertyName, $propertyValue){\n \t$this->properties[$propertyName] = $propertyValue;\n }",
"public function __set($property, $value)\n\t{\n\t\tif (property_exists($this, $property))\n\t\t{\n\t\t\t$this->$property = $value;\n\t\t}\n\t\telse echo \"error\";\n\t}",
"public function add_declaration($property, $value)\n {\n }",
"function set($property, $value) {\n $this->{$property} = $value;\n }",
"function insertValue($cont,$sel,$prop,$val){\n $pattern = '/('.preg_quote($sel).'\\s*\\{[\\w\\s:\\-;\\(\\)#]*)}/xi';\n return preg_replace($pattern, '$1 ' . $prop . \" : \" . $val .\";\\n}\",$cont);\n}",
"protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }",
"public function __set($property, $value) {\r\n $this->set($property, $value);\r\n }",
"public function __set($property, $value) \n {\n \tif (property_exists($this, $property)) {\n \t\t$this->$property = $value;\n \t}\n }",
"public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}",
"public function __set($prop, $value)\n {\n // verifica se existe mtodo set_<propriedade>\n $metodo = 'set' . ucwords($prop);\n if (method_exists($this, $metodo)) {\n call_user_func(array($this, $metodo), $value);\n } else {\n if ($value === NULL) {\n unset($this->data[$prop]);\n } else {\n $this->data[$prop] = $value;\n }\n }\n }",
"public function setKeysFromInserted()\n\t{\n\t\t$keys = $this->database->getNewKeys();\n\n\t\t$this->data = Arr::mergeDeep($this->data, $keys);\n\n\t\t$this->key = $keys[$this->primaryKey] ?? null;\n\t}",
"public function offsetSet($offset, $value)\n\t{\n\t\t$this->properties[$offset] = $value;\n\t}",
"function offsetSet($offset, $value) {\n $property = defined('static::$DOMAIN_PROPERTY') ? static::$DOMAIN_PROPERTY : 'data';\n if(!isset($this->{$property})) {\n $this->{$property} = [];\n }\n \n if (is_null($offset)) {\n $offset = 0;\n if (!empty($this->{$property})) {\n $keys = \\preg_grep( '#^(0|([1-9][0-9]*))$#', \\array_keys($this->{$property}));\n if (!empty($keys)) {\n $offset = \\max($keys) + 1;\n }\n }\n }\n\n $this->{$property}[$offset] = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"protected function makeProperty( Property $property ) {\n\t\t$store = WikibaseRepo::getDefaultInstance()->getEntityStore();\n\n\t\t$store->saveEntity( $property, 'testing', $GLOBALS['wgUser'], EDIT_NEW );\n\t\treturn $property;\n\t}",
"public function setOriginalDocumentProperty($oid, $property, $value)\n {\n $this->originalDocumentData[$oid][$property] = $value;\n }",
"public function setOriginalEntityProperty($oid, $property, $value)\n {\n if (!array_key_exists($oid, $this->originalEntityData)) {\n $this->originalEntityData[$oid] = new \\stdClass();\n }\n\n $this->originalEntityData[$oid]->$property = $value;\n }",
"function __set($strProperty, $strValue)\r\n\t{\r\n\t\t$this->_arrWhere[$strProperty] = $strValue;\r\n\t}",
"protected function setInStorage($property, $value)\n {\n $data = $this->getStorage();\n $data[$property] = $value;\n $this->setStorage($data);\n }",
"public function __set($property, $value){\n \n if(property_exists($this, $property))\n $this->$property = $value;\n else\n $this->errors[] = \"Failed to set $property to $value!\";\n }",
"public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }",
"public function __set($name, $value) {\n if (ctype_alnum($name) && (ctype_digit($name[0]) == FALSE)) {\n $this->$name = $this->db->quote($value);\n $this->properties[$name] = $value;\n }\n }",
"function updateProperties($mutations);",
"public function getAddDefaultsExplicitlyOnInsert();",
"public function __set($property, $value)\n {\n $info = build_properties_hint(reflect_properties($this));\n warning('Property \"'.$property.'\" doesn\\'t exist in a '.get_class($this).' object', $info);\n $this->$property = $value; // Add the property to the object. (PHP's default behavior)\n }",
"public static function convertFromDB($property, $value)\n {\n return '------';\n }",
"public function setProperty($key, $value);",
"public function propertySet($varname, $value)\n {\n $value = base64_encode($value);\n $this->run(\"property_set -i {id} -n \\${$varname} -- {$value}\");\n }",
"public function __set($prop, $value)\n {\n $this->assignee[$prop] = $value;\n }",
"public function insertAt($index,$item)\n\t{\n\t\tif(!is_string($item)) // string is possible if property tag is used. we simply ignore it in this case\n\t\t\tparent::insertAt($index,$item); // this will generate an exception in parent implementation\n\t}",
"function _s($prop,$val) {\r\n\r\n return $this->$prop=$val;\r\n }",
"protected function setProperties($array) {\n\t\tforeach (array_keys($this->data) as $field) {\n\t\t\t$this->data[$field]['value'] = $array[$field];\n\t\t}\n\t\treturn True;\n\t}"
]
| [
"0.6291218",
"0.60449094",
"0.59364027",
"0.5888564",
"0.5883306",
"0.58817345",
"0.57742125",
"0.57349676",
"0.56952554",
"0.56462663",
"0.5642962",
"0.56420106",
"0.5639016",
"0.56226194",
"0.56224376",
"0.55696857",
"0.5563069",
"0.5514735",
"0.54805523",
"0.5472381",
"0.54722714",
"0.5440282",
"0.54296696",
"0.54251647",
"0.53994274",
"0.5388601",
"0.53836155",
"0.5380753",
"0.5377537",
"0.53766257",
"0.5363895",
"0.5361356",
"0.53535557",
"0.5348851",
"0.5344697",
"0.53366774",
"0.53173506",
"0.5315697",
"0.5299546",
"0.5299098",
"0.5297496",
"0.52930516",
"0.52739555",
"0.5270326",
"0.52392423",
"0.5238929",
"0.52293277",
"0.5226209",
"0.5218991",
"0.52137196",
"0.5211244",
"0.52084875",
"0.5203343",
"0.5184325",
"0.5179113",
"0.51740885",
"0.5164352",
"0.5158629",
"0.5158211",
"0.5148704",
"0.51484835",
"0.5135202",
"0.5130823",
"0.51071304",
"0.5103902",
"0.50986254",
"0.5093808",
"0.5089589",
"0.5086428",
"0.5081667",
"0.5080482",
"0.50793654",
"0.50783193",
"0.5070542",
"0.50653857",
"0.5059268",
"0.5058218",
"0.5055159",
"0.5055159",
"0.5055159",
"0.5055159",
"0.5055159",
"0.5050685",
"0.5041191",
"0.5029644",
"0.5028829",
"0.5019285",
"0.50163287",
"0.5012786",
"0.50035506",
"0.50004",
"0.49981067",
"0.49897093",
"0.4985424",
"0.49814293",
"0.49772847",
"0.49766904",
"0.49637628",
"0.4960233",
"0.4950215"
]
| 0.5101505 | 65 |
Get updates of a property | public function getPropertyUpdates(string $symbol): int {
return $this->properties[$symbol]['updates'] ?? 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUpdatedProperties() {}",
"public function getUpdated();",
"public function getUpdated();",
"public function getToUpdate()\n\t{\n\t\t$tToUpdate = array();\n\t\tif ($this->_tPropertyToUpdate) {\n\t\t\tforeach ($this->_tPropertyToUpdate as $sVar) {\n\t\t\t\t$tToUpdate[$sVar] = $this->_tProperty[$sVar];\n\t\t\t}\n\t\t}\n\t\treturn $tToUpdate;\n\t}",
"public function update() {\n\t\t// When loaded, fully sync the property array.\n\t\tif ($this->loadedSettings !== false) {\n\t\t\t$properties = array();\n\t\t\t$ownProperties = $this->bean->ownProperty;\n\t\t\tforeach ($this->properties as $k => $v) {\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($ownProperties as $property) {\n\t\t\t\t\tif ($property->name === $k) {\n\t\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t$properties[] = $property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found) {\n\t\t\t\t\t$property = R::dispense('property');\n\t\t\t\t\t$property->name = $k;\n\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->bean->ownProperty = $properties;\n\t\t\t// When loaded, only add and modify properties, but do not delete any\n\t\t} elseif (!empty($this->properties)) {\n\t\t\t$ownProperties = $this->bean->ownProperty;\n\t\t\tforeach ($this->properties as $k => $v) {\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($ownProperties as $property) {\n\t\t\t\t\tif ($property->name === $k) {\n\t\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t$this->bean->ownProperty[$property->id] = $property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found) {\n\t\t\t\t\t$property = R::dispense('property');\n\t\t\t\t\t$property->name = $k;\n\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t$this->bean->ownProperty[] = $property;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function updateProperties($mutations);",
"public function getUpdates()\n {\n return $this->updates;\n }",
"public function getUpdates() {\n return $this->updates;\n }",
"abstract protected function getAllUpdates();",
"protected function listUpdates() {}",
"public function getUpdateValues(): array;",
"function changed_properties() {\r\n \t$changed = array();\r\n \tforeach($this->_frozen_properties as $var => $val) {\r\n \t\tif ($this->$var != $this->_frozen_properties[$var])// This property has changed:\r\n \t\t\t$changed[$var] = $val;\r\n \t}\r\n \treturn $changed;\r\n }",
"public function get($property);",
"public function getModified() {}",
"public function __get($property) {}",
"public function getModified();",
"public function __get($prop) {}",
"public function getChanges();",
"public function getChanges();",
"public function update() {\n global $db;\n $this->_preupdate();\n $sql_set = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_set .= \"`\".addslashes($key).\"`=\";\n $sql_set .= \"?,\";\n $data[] = $value;\n }\n $sql_set = substr($sql_set, 0, -1);\n\n $query = \"UPDATE {$this->table} SET $sql_set WHERE \".$this->id_field.\"=?;\";\n $data[] = $this->{'get'.$this->id_field}();\n\n $result = $db->query($query,$data);\n $this->_postupdate($result);\n return $result;\n }",
"public function getProperty();",
"public function fetchUpdates()\n\t{\n\t}",
"function get_updates() {\n\t\t\treturn $this->quoted_attributes(array_diff_key($this->get_attributes(), array_combine($this->primary_keys, $this->primary_keys)));\n\t\t}",
"function get_properties()\r\n {\r\n return $this->properties;\r\n }",
"public function props_changed()\n\t{\n\t\treturn $this->props_changed;\n\t}",
"public function update(array $data) {\n return $this->updateRequest(\n \"/application/shops/{$this->shop_id}/listings/{$this->listing_id}/properties/{$this->property_id}\",\n $data\n );\n }",
"public function getUpdates() {\n\t\treturn AddonManager::getUpdates($this);\n\t}",
"function prop($prop)\n {\n \treturn $this->get_property($prop);\n }",
"abstract protected function propertyGet($name);",
"public function __get($property) {\n if (isset($this->data[$property])) {\n if (class_exists('\\Sleepy\\Hook')) {\n $output = Hook::addFilter($this->clean_class() . '_get_' . $property, $this->data[$property]);\n $output = Hook::addFilter($this->clean_class() . '_get_property', $output);\n return $output;\n\n } else {\n return $this->data[$property];\n }\n }\n }",
"public function getUpdate()\n {\n return $this->readOneof(2);\n }",
"public function stateUpdate(){\n return $this->update;\n }",
"public function getUpdated()\n {\n return $this->getState()->getUpdated();\n }",
"function __get($property)\n {\n return $this->value;\n }",
"function _getProperties() ;",
"public function updated($property)\n {\n $this->validateOnly($property);\n }",
"public function getOnUpdate(): string;",
"public function getFieldsWithUpdate()\n {\n return array_filter($this->fieldChanges, function ($fieldChange) {\n return $fieldChange->hasChange();\n });\n }",
"public function getUpdated() \n\t{\n\t\treturn $this->updated;\n\t}",
"public function property($key) { }",
"public function getChange();",
"public function isUpdated() {}",
"function getProperties($properties);",
"public function getUpdateList()\n {\n return $this->updateList;\n }",
"public function updatePropertyIndex ()\n {\n $new_properties_table = array();\n\n foreach ( $this as $declaration ) {\n\n $name = $declaration->property;\n\n if ( isset( $new_properties_table[ $name ] ) ) {\n $new_properties_table[ $name ]++;\n }\n else {\n $new_properties_table[ $name ] = 1;\n }\n }\n $this->properties = $new_properties_table;\n }",
"public function getModified()\n {\n return $this->systemProperties->getModified();\n }",
"public function getProperties(): PropertyCollection;",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }",
"protected function update( $data = array() )\n {\n foreach ( $data as $property => $value ) {\n if ( property_exists( get_called_class(), $property ) ) {\n $this->$property = $value;\n }\n }\n }",
"public function handlePropertyValueUpdates()\n {\n $locales = [];\n if (class_exists(Locale::class)) {\n $locales = Locale::listLocales()->where('is_enabled', true)->all();\n }\n\n $formData = array_wrap(post('PropertyValues', []));\n if (count($formData) < 1) {\n PropertyValue::where('product_id', $this->id)->whereNull('variant_id')->delete();\n }\n\n $properties = Property::whereIn('id', array_keys($formData))->get();\n $propertyValues = PropertyValue::where('product_id', $this->id)->whereNull('variant_id')->get();\n\n foreach ($formData as $id => $value) {\n $property = $properties->find($id);\n\n $pv = $propertyValues->where('property_id', $id)->first()\n ?? new PropertyValue([\n 'product_id' => $this->id,\n 'property_id' => $id,\n ]);\n\n $pv->value = $value;\n foreach ($locales as $locale) {\n $transValue = post(\n sprintf('RLTranslate.%s.PropertyValues.%d', $locale->code, $id),\n post(sprintf('PropertyValues.%d', $id)) // fallback\n );\n $transValue = $this->handleTranslatedPropertyValue(\n $property,\n $pv,\n $value,\n $transValue,\n $locale->code\n );\n $pv->setAttributeTranslated('value', $transValue, $locale->code);\n }\n\n // If the value became empty delete it.\n if (($value === null || $value === '') && $pv->exists) {\n $pv->delete();\n } else {\n $pv->save();\n }\n\n // Transfer any deferred media\n if ($property->type === 'image') {\n $media = DeferredBinding::where('master_type', PropertyValue::class)\n ->where('master_field', 'image')\n ->where('session_key', post('_session_key'))\n ->get();\n\n foreach ($media as $m) {\n $slave = $m->slave_type::find($m->slave_id);\n $slave->field = 'image';\n $slave->attachment_type = PropertyValue::class;\n $slave->attachment_id = $pv->id;\n $slave->save();\n $m->delete();\n }\n }\n }\n }",
"public function getProperties(array &$properties);",
"function getChanged() {\n return $this->changed;\n }",
"public function hasUpdates();",
"public function getupdatedproperties($type) {\n\n // Dont filter for now\n $type = '';\n\n // Filter by type\n if ( $type != '' ) {\n foreach ( $this->data as $k => $property ) {\n if ( $property['strChangeLog'] !== $type ) {\n unset($this->data[$k]);\n }\n }\n }\n\n return $this->data;\n }",
"public function forUpdate($set = TRUE);",
"public function update(Request $request, Property $property)\n {\n //\n }",
"public function update(Request $request, Property $property)\n {\n //\n }",
"public function update(Request $request, Property $property)\n {\n //\n }",
"public function getProperties()\n {\n return $this->getProperty();\n }",
"abstract protected function get_properties();",
"public function getUpdates()\n {\n if (array_key_exists(\"updates\", $this->_propDict)) {\n if (is_a($this->_propDict[\"updates\"], \"\\Beta\\Microsoft\\Graph\\Model\\AdminWindowsUpdates\") || is_null($this->_propDict[\"updates\"])) {\n return $this->_propDict[\"updates\"];\n } else {\n $this->_propDict[\"updates\"] = new AdminWindowsUpdates($this->_propDict[\"updates\"]);\n return $this->_propDict[\"updates\"];\n }\n }\n return null;\n }",
"public function setUpdates($val)\n {\n $this->_propDict[\"updates\"] = $val;\n return $this;\n }",
"function propPatch($path, PropPatch $propPatch);",
"public function getProperty($key);",
"public function get_properties(): array {\n\t\t$properties = array();\n\n\t\tforeach ( $this->properties as $key => $property ) {\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$properties = array_merge( $properties, $property->get_properties() );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$properties[ $key ] = $property;\n\t\t}\n\n\t\treturn $properties;\n\t}",
"public function getProperties() {}",
"private function getWriteAccessInfo($class, $property, $value)\n {\n $key = $class.'::'.$property;\n\n if (isset($this->writePropertyCache[$key])) {\n $access = $this->writePropertyCache[$key];\n } else {\n $access = array();\n\n $reflClass = new \\ReflectionClass($class);\n $access[self::ACCESS_HAS_PROPERTY] = $reflClass->hasProperty($property);\n $camelized = $this->camelize($property);\n $singulars = (array) StringUtil::singularify($camelized);\n\n if (is_array($value) || $value instanceof \\Traversable) {\n $methods = $this->findAdderAndRemover($reflClass, $singulars);\n\n if (null !== $methods) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_ADDER_AND_REMOVER;\n $access[self::ACCESS_ADDER] = $methods[0];\n $access[self::ACCESS_REMOVER] = $methods[1];\n }\n }\n\n if (!isset($access[self::ACCESS_TYPE])) {\n $setter = 'set'.$camelized;\n $getsetter = lcfirst($camelized); // jQuery style, e.g. read: last(), write: last($item)\n\n if ($this->isMethodAccessible($reflClass, $setter, 1)) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;\n $access[self::ACCESS_NAME] = $setter;\n } elseif ($this->isMethodAccessible($reflClass, $getsetter, 1)) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;\n $access[self::ACCESS_NAME] = $getsetter;\n } elseif ($this->isMethodAccessible($reflClass, '__set', 2)) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;\n $access[self::ACCESS_NAME] = $property;\n } elseif ($access[self::ACCESS_HAS_PROPERTY] && $reflClass->getProperty($property)->isPublic()) {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;\n $access[self::ACCESS_NAME] = $property;\n } elseif ($this->magicCall && $this->isMethodAccessible($reflClass, '__call', 2)) {\n // we call the getter and hope the __call do the job\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_MAGIC;\n $access[self::ACCESS_NAME] = $setter;\n } else {\n $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_NOT_FOUND;\n $access[self::ACCESS_NAME] = sprintf(\n 'Neither the property \"%s\" nor one of the methods %s\"%s()\", \"%s()\", '.\n '\"__set()\" or \"__call()\" exist and have public access in class \"%s\".',\n $property,\n implode('', array_map(function ($singular) {\n return '\"add'.$singular.'()\"/\"remove'.$singular.'()\", ';\n }, $singulars)),\n $setter,\n $getsetter,\n $reflClass->name\n );\n }\n }\n\n $this->writePropertyCache[$key] = $access;\n }\n\n return $access;\n }",
"public function getProperties() {}",
"public function getProperties() {}",
"public function getProperties() {}",
"public function getScheduledCollectionUpdates()\n {\n return $this->collectionUpdates;\n }",
"public function __get($property){\n /*if(method_exists($this,'get'.ucfirst($property))){\n\n }*/\n return $this->$property;\n }",
"public function getProperties(): array\n {\n return $this->getParam('properties');\n }",
"public function getProperties(): array;",
"public function getProperties(): array;",
"public function changed ()\n\t{\n\t\treturn new Vector($this->changed_properties);\n\t}",
"public function modified(string $property = null)\n {\n if ($property === null) {\n return array_keys($this->_modified);\n }\n\n return isset($this->_modified[$property]);\n }",
"public function getChanged()\n {\n return $this->entity->getChanged();\n }",
"public function getChangedFields() {}",
"function __get($strProperty)\r\n\t{\r\n\t\treturn $this->_arrWhere[$strProperty];\r\n\t}",
"public function getExposedProperties(): array;",
"protected function getPropertyValue() {}",
"public function getDataUpdate()\n {\n return $this->data_update;\n }",
"private function getConnectionPropertiesToUpdate(array $properties) : array\r\n {\r\n // the key/values to set in the database; this function is aimed to\r\n // make it easier to set specific connection properties and specific\r\n // keys within the connection info\r\n\r\n // get a current list of connection properties\r\n $connection_properties_current = $this->get();\r\n $connection_info_current = $connection_properties_current['connection_info'];\r\n\r\n // handle special case of parent_eid (input is parent_eid, but return type\r\n // in properties is an object with the key of 'parent')\r\n if (isset($connection_properties_current['parent']['eid']))\r\n {\r\n $connection_properties_current['parent_eid'] = $connection_properties_current['parent']['eid'];\r\n unset($connection_properties_current['parent']);\r\n }\r\n\r\n // iterate through the connection properties, and if they are specified\r\n // then include them in the connection properties to update\r\n $connection_properties_to_update = array();\r\n foreach ($properties as $key => $value)\r\n {\r\n // if we don't have a connection property, move on\r\n if (array_key_exists($key, $connection_properties_current) === false)\r\n continue;\r\n\r\n if ($key !== 'connection_info')\r\n {\r\n // if we're not on the connection object, simply update the value\r\n $connection_properties_to_update[$key] = $value;\r\n }\r\n else\r\n {\r\n // if we're changing the connection_info, update the specific\r\n // values in this that are specified\r\n\r\n if (!is_array($value))\r\n continue;\r\n\r\n $connection_info_updated = $connection_info_current; // initialize with entire set of values since we get one write for the whole payload\r\n foreach ($value as $connection_info_to_update_key => $connection_info_to_update_value)\r\n {\r\n $connection_info_updated[$connection_info_to_update_key] = $connection_info_to_update_value;\r\n }\r\n\r\n $connection_properties_to_update[$key] = $connection_info_updated;\r\n }\r\n }\r\n\r\n return $connection_properties_to_update;\r\n }",
"public static function getters();",
"public function getProperties() {\n $modifiable_properties = [];\n $fields = $this->getFields();\n foreach (Framework::instance()->entityProperties($this->getEntity()) as $property => $info) {\n if (!in_array($property, array_keys($fields)) && $this->filter($property)) {\n $this->addModifier($modifiable_properties, 'property', $property);\n }\n }\n return $modifiable_properties;\n }",
"abstract protected function getProperties();",
"abstract public function getProperties();",
"public function getRulesForUpdate()\r\n\t{\r\n\t \treturn $this->rules_for_update ? $this->rules_for_update : array();\r\n\t}",
"public function update($value) {\n return $this->setProperty('update', $value);\n }",
"public function update($value) {\n return $this->setProperty('update', $value);\n }"
]
| [
"0.7551272",
"0.659621",
"0.659621",
"0.65571415",
"0.6396408",
"0.6108296",
"0.6102405",
"0.601847",
"0.59154516",
"0.58949554",
"0.5802927",
"0.57525146",
"0.5750751",
"0.57413334",
"0.5680265",
"0.5665476",
"0.5648385",
"0.55694485",
"0.55694485",
"0.5529395",
"0.552567",
"0.5514049",
"0.55097365",
"0.5492753",
"0.5492304",
"0.54884595",
"0.54814804",
"0.5474864",
"0.5473372",
"0.5433317",
"0.54196423",
"0.5405218",
"0.5398372",
"0.53904575",
"0.5389118",
"0.53813356",
"0.538088",
"0.53736234",
"0.53655493",
"0.5362337",
"0.5346754",
"0.5334568",
"0.5331504",
"0.533089",
"0.53270805",
"0.5317115",
"0.5314315",
"0.53091234",
"0.53091234",
"0.53091234",
"0.53091234",
"0.53091234",
"0.53091234",
"0.53091234",
"0.53091234",
"0.53091234",
"0.5308006",
"0.5306341",
"0.53053004",
"0.5290459",
"0.52821165",
"0.52774477",
"0.52764523",
"0.5272527",
"0.52723897",
"0.52723897",
"0.52723897",
"0.52455276",
"0.5223327",
"0.52183014",
"0.52133733",
"0.5201552",
"0.5196258",
"0.51878226",
"0.5182952",
"0.5182079",
"0.5181661",
"0.5181661",
"0.5181661",
"0.51808697",
"0.51734084",
"0.51720595",
"0.5166973",
"0.5166973",
"0.5163395",
"0.51609516",
"0.5160661",
"0.5159598",
"0.5151949",
"0.5147739",
"0.5146343",
"0.51332045",
"0.5132021",
"0.51288116",
"0.5123046",
"0.512112",
"0.5120624",
"0.51174456",
"0.51143277",
"0.51143277"
]
| 0.5860024 | 10 |
Set updates of a property | public function setPropertyUpdates(string $symbol, int $value): Statistics {
$this->addProperty($symbol);
$this->properties[$symbol]['updates'] = $value;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __set($property, $value) {}",
"public function set($property, $value);",
"function set_property(){\n }",
"public function update() {\n\t\t// When loaded, fully sync the property array.\n\t\tif ($this->loadedSettings !== false) {\n\t\t\t$properties = array();\n\t\t\t$ownProperties = $this->bean->ownProperty;\n\t\t\tforeach ($this->properties as $k => $v) {\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($ownProperties as $property) {\n\t\t\t\t\tif ($property->name === $k) {\n\t\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t$properties[] = $property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found) {\n\t\t\t\t\t$property = R::dispense('property');\n\t\t\t\t\t$property->name = $k;\n\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->bean->ownProperty = $properties;\n\t\t\t// When loaded, only add and modify properties, but do not delete any\n\t\t} elseif (!empty($this->properties)) {\n\t\t\t$ownProperties = $this->bean->ownProperty;\n\t\t\tforeach ($this->properties as $k => $v) {\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($ownProperties as $property) {\n\t\t\t\t\tif ($property->name === $k) {\n\t\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t$this->bean->ownProperty[$property->id] = $property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found) {\n\t\t\t\t\t$property = R::dispense('property');\n\t\t\t\t\t$property->name = $k;\n\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t$this->bean->ownProperty[] = $property;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function dset($property,$value){\n $this->$property = $value;\n $table = $this->table;\n $id = $this->id; \n LAIKA_Database::update($table, $property, $value, \"id = $id\");\n }",
"abstract protected function propertySet($name, $value);",
"public function set(string $property, $value);",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"public function __set($property, $value)\n {\n switch ($property) {\n\n case 'name':\n if(!empty($value) && is_string($value)) {\n $this->name = $value;\n $this->changed = true;\n break;\n } else {\n echo 'Wrong type of property, it should be string';\n break;\n }\n \n case 'status':\n if(!empty($value) && is_int($value)) {\n $this->status = $value;\n $this->changed = true;\n break;\n } else {\n echo 'Wrong type of property, it should be integer';\n break;\n }\n \n }\n }",
"function updateProperties($mutations);",
"public function setProperty($key, $value);",
"public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }",
"public function __set( $property, $value ) {\n\t\t\tif ( property_exists( $this, $property ) ) {\n\n\t\t\t\t// Latitude hard-wired callback\n\t\t\t\t//\n\t\t\t\tif ( $property === 'latitude' ) {\n\t\t\t\t\t$this->set_LatLong( $value , null );\n\n\t\t\t\t// Longitude hard-wired callback\n\t\t\t\t//\n\t\t\t\t} elseif ( $property === 'longitude' ) {\n\t\t\t\t\t$this->set_LatLong( null , $value );\n\n\t\t\t\t// All other standard properties\n\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t$this->$property = $value;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Extended Data, allow property as long as it does not conflict\n\t\t\t// with a built-in property.\n\t\t\t//\n\t\t\tif ( ! property_exists( $this, $property ) ) {\n\t\t\t\tif ( $this->slplus->database->is_Extended() &&\n\t\t\t\t\t$this->slplus->database->extension->has_field( $property )\n\t\t\t\t) {\n\t\t\t\t\t$this->exdata[ $property ] = $value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->temporary[ $property ] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}",
"public function __set($property, $value){\n $this->$property = $value;\n }",
"public function __set($prop, $val) {\n\t\t$this->props[$prop] = $val;\n }",
"function __set($property, $value)\n {\n $this->setValue($value);\n }",
"public function __set($property, $value) {\r\n $param = '_' . $property;\r\n $this->$param = $value;\r\n }",
"public function __set($property, $value) {\n if (class_exists('\\Sleepy\\Hook')) {\n $this->data[$property] = Hook::addFilter($this->clean_class() . '_set_' . $property, $value);\n $this->data[$property] = Hook::addFilter($this->clean_class() . '_set_property', $value);\n } else {\n $this->data[$property] = $value;\n }\n }",
"function set($property, $value) {\n $this->{$property} = $value;\n }",
"function _setProp($key, $value)\n {\n $this->_props[$key] = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value){\n \n if(property_exists($this, $property))\n $this->$property = $value;\n else\n $this->errors[] = \"Failed to set $property to $value!\";\n }",
"public function forUpdate($set = TRUE);",
"public function __set($property, $value) \n {\n \tif (property_exists($this, $property)) {\n \t\t$this->$property = $value;\n \t}\n }",
"public function __set($property, $value) {\n\t\tswitch($property) {\n\t\t\tcase 'key':\n\t\t\t\t$this->key = $value;\n\t\t\t\tbreak;\n\n case 'after':\n $this->after = strtotime($value);\n break;\n\n case 'cards':\n $this->cards = $value;\n break;\n\n\t\t\tdefault:\n\t\t\t\tparent::__set($property, $value);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function __set($name, $value)\n {\n $this->_updates->$name = $value;\n }",
"public function __set($property, $value) {\n\t\tif (strpos($property, 'source') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\t$this->bean->source = $value;\n\t\t\t} else {\n\t\t\t\t$sourceInstance = $this->getSourceInstance();\n\t\t\t\tif ($sourceInstance !== null) {\n\t\t\t\t\t$sourceInstance->$property = $value;\n\t\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (strpos($property, 'remote') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\t$this->bean->target = $value;\n\t\t\t} else {\n\t\t\t\t$targetInstance = $this->getTargetInstance();\n\t\t\t\tif ($targetInstance !== null) {\n\t\t\t\t\t$targetInstance->$property = $value;\n\t\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Temporary properties are kept in the object, and not written to the database.\n\t\t} elseif (strpos($property, 'temp') === 0) {\n\t\t\t$property = lcfirst(substr($property, 4));\n\t\t\t$this->tempProperties[$property] = $value;\n\t\t} elseif (isset($this->bean->$property)) {\n\t\t\t$this->bean->$property = $value;\n\t\t} elseif (!isset($this->properties[$property]) || $this->properties[$property] !== $value) {\n\t\t\t$this->properties[$property] = $value;\n\t\t\t$this->bean->setMeta('tainted', true);\n\t\t}\n\t}",
"private function update(array $data)\n {\n foreach ($data as $property => $value) {\n if (property_exists($this, $property)) {\n $this->$property = $value;\n }\n }\n }",
"public function __set($property, $value)\n\t{\n\t\tif (property_exists($this, $property))\n\t\t{\n\t\t\t$this->$property = $value;\n\t\t}\n\t\telse echo \"error\";\n\t}",
"function __set($name, $value){\n //var_dump($value);\n\n $this->_properties[$name] = $value;\n }",
"protected function set_prop( $prop, $value ) {\n\n\t\tif ( 'switch_data' == $prop ) {\n\t\t\t$prop = 'subscription_switch_data';\n\t\t}\n\n\t\t$this->$prop = $value;\n\n\t\t// The requires manual renewal prop uses boolean values but it stored as a string\n\t\tif ( 'requires_manual_renewal' === $prop ) {\n\t\t\tif ( false === $value || '' === $value ) {\n\t\t\t\t$value = 'false';\n\t\t\t} else {\n\t\t\t\t$value = 'true';\n\t\t\t}\n\t\t}\n\n\t\tupdate_post_meta( $this->get_id(), '_' . $prop, $value );\n\t}",
"public function __set($prop, $value)\n {\n // verifica se existe mtodo set_<propriedade>\n $metodo = 'set' . ucwords($prop);\n if (method_exists($this, $metodo)) {\n call_user_func(array($this, $metodo), $value);\n } else {\n if ($value === NULL) {\n unset($this->data[$prop]);\n } else {\n $this->data[$prop] = $value;\n }\n }\n }",
"protected function update( $data = array() )\n {\n foreach ( $data as $property => $value ) {\n if ( property_exists( get_called_class(), $property ) ) {\n $this->$property = $value;\n }\n }\n }",
"function __set($property, $value)\n {\n if($property == \"id\")\n {\n $this->id = $value;\n }\n else\n {\n return call_user_func_array(array($this, \"setAttribute\"), array($property, $value));\n }\n }",
"public function __set($property, $value = null) {\r\n\t\t$previous = parent::set($property, $value);\r\n\t\t\r\n\t\t// updating deprecated attributes based on property name\r\n\t\tif(array_key_exists($property, self::$deprecatedAttribs)) {\r\n\t\t\t$oldAttrib = self::$deprecatedAttribs[$property];\r\n\t\t\t$this->$oldAttrib = $value;\r\n\t\t}\r\n\r\n\t\t// updating aggregated attributes\r\n\t\tif(array_key_exists($property, get_object_vars($this->jLanguageTable))) {\r\n\t\t\t$this->jLanguageTable->set($property, $value);\r\n\t\t} \r\n\t\tif(array_key_exists($property, get_object_vars($this->jfLanguageExt))) {\r\n\t\t\t$this->jfLanguageExt->set($property, $value);\r\n\t\t}\r\n\t\t\r\n\t\treturn $previous;\r\n\t}",
"public function setProperty(string $key, $value): self;",
"public function __set($property, $value) {\r\n\t\tswitch($property) {\r\n\t\t\tcase 'view':\r\n\t\t\t\t$this->view = $value;\r\n\t\t\t\t$this->install($this->view);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'script':\r\n\t\t\t\t$this->script .= $value;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n PropertyHelper::Error($property);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"function setMultiple($properties) {\n foreach ($properties as $property => $value) {\n $this->set($property, $value);\n }\n }",
"public function __set($property, $value)\n {\n $this->resource->{$property} = $value;\n }",
"public function set($value): IProperty;",
"function &__set($property, $value)\n {\n $retval = $this->_stdObject->{$property} = $value;\n return $retval;\n }",
"public function __set($prop, $value)\n {\n $this->assignee[$prop] = $value;\n }",
"public function setProperty($property, $value = null);",
"public function __set($property, $value)\n {\n $this->data[$property] = $value;\n }",
"public function __set($property, $value) {\r\n $this->set($property, $value);\r\n }",
"public function updated($property)\n {\n $this->validateOnly($property);\n }",
"public function __set($property, $value) {\n if (isset($this->translation[$property])) {\n $property = $this->translation[$property];\n }\n $this->_magicProperties[$property] = $value;\n }",
"public function __set($prop, $valor){\n\t\tif( !property_exists($this, $prop))\t{\n\t\t\tthrow new exception(\"la propiedad $prop no existe\"); \t\t\t\n\t\t}\t\t\n\t\t$this->$prop = $valor;\n\t\t//$this->(\"set\".ucfirst($prop))($valor);\n\t\t\n\t}",
"function __set($property, $value) {\n global $DB;\n if(is_array($value) && @$this->TYPE[$property] === 'CSV') $value = join(',',$value);\n if(!isset($this->DATA[$property])\n || $this->DATA[$property] !== $value) {\n $DB->config->update(array('value' => $value), array('property' => $property, 'section' => $this->NAME), true);\n $this->DATA[$property] = $value;\n }\n }",
"public function setProperty($property, $value)\n\t{\n\t\tglobal $mysql;\n\t\t$property = real_escape_string($property);\n\t\t$value = real_escape_string($value);\n\t\t\n\t\treturn $mysql->query(\"UPDATE laptops SET `\".$property.\"` = '\".$value.\"' WHERE `id` = \".$this->getID());\n\t}",
"private function __set($name, $value)\n {\n// \tprint(\"Property set for [$name]<br/>\");\n if (method_exists($this, ($method = 'set_'.$name)))\n {\n $this->$method($value);\n }\n }",
"public function __set($property, $value) {\n\t\t$object = $this->get_base_object();\n\t\t$object->$property = $value;\n\t\t$this->set_cached_property($property, $value);\n\t}",
"public function setInputProperty($key, $value);",
"public function __set($property, $value)\n\t{\n\t\t$this->$property = $value;\n\t}",
"public function __set($property, $value)\n\t{\n\t\t$this->$property = $value;\n\t}",
"function _s($prop,$val) {\r\n\r\n return $this->$prop=$val;\r\n }",
"public function __set($property, $value) {\n if ( isset($this->$property)) {\n $this->$property = $value;\n }\n else\n {\n die(\"$value nao existe\");\n }\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $info = build_properties_hint(reflect_properties($this));\n warning('Property \"'.$property.'\" doesn\\'t exist in a '.get_class($this).' object', $info);\n $this->$property = $value; // Add the property to the object. (PHP's default behavior)\n }",
"public function setUpdates($val)\n {\n $this->_propDict[\"updates\"] = $val;\n return $this;\n }",
"public function __set($name, $value){\r\n echo \"You are trying to direct set property \".$name.\" to value \".$value.\" and thats not possible use set\".$name.\"(\\$value) method.\";\r\n echo \"<br/> At line \".__LINE__.\" in file \".__FILE__;\r\n }",
"public function setProperties($properties)\n {\n\n }",
"protected static function setter($node, $property, $value, $subProperty = false)\n {\n\n //if there is a sub-property and there is only one, replace it\n if ($subProperty && isset($node->$property->$subProperty) && count($node->$property->$subProperty) === 1) {\n $node->$property->$subProperty = $value;\n } elseif (property_exists($node, $property)) {\n $node->$property = $value;\n }\n }",
"public function setState( array $properties )\n {\n foreach ( $properties as $name => $value )\n {\n $this->properties[$name] = $value;\n }\n }",
"public function __set($name, $value) {\n // almacenamos los valores atribuidos\n // el array properties\n $this->properties[$name] = $value;\n }",
"public function __set( $property, $value ) {\n\t\tif ( property_exists( $this, $property ) ) {\n\t\t\t$this->$property = $value;\n\t\t}\n\t}",
"public function __set($property, $value){\n\t\tif (property_exists($this, $property)) {\n\t \treturn $this->$property = $value;\n\t }\n\t}",
"public function __set($property, $value) {\n\t\tswitch($property) {\n\t\t\tcase 'question':\n\t\t\t\t$this->question = $value;\n\t\t\t\tbreak;\n\n\t\t\tcase 'rubric':\n\t\t\t\t$this->rubric = $value;\n\t\t\t\tbreak;\n\n\t\t\tcase 'answer':\n\t\t\t\t$this->answer = $value;\n\t\t\t\tbreak;\n\n\t\t\tcase 'more':\n\t\t\t\t$this->more = $value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$trace = debug_backtrace();\n\t\t\t\ttrigger_error(\n\t\t\t\t\t'Undefined property ' . $property .\n\t\t\t\t\t' in ' . $trace[0]['file'] .\n\t\t\t\t\t' on line ' . $trace[0]['line'],\n\t\t\t\t\tE_USER_NOTICE);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function __set($propertyName, $propertyValue){\n \t$this->properties[$propertyName] = $propertyValue;\n }",
"function __set($prop, $val)\n {\n if (isset($this->$prop)) $this->$prop = $val;\n elseif (isset($this->_fk[$prop])) $this->_data[$prop] = $val->id;\n elseif (isset($this->_cols[$prop])) $this->_data[$prop] = $val;\n else throw new Exception(sprintf('Property \"%s\" not available', $prop));\n }",
"function assignIfIsset($object, $property, $array, $key)\n{\n if (array_key_exists($key, $array)) {\n $object->$property = $array[$key];\n }\n}",
"function __set($property, $value)\n {\n\n if( $value != null )\n $this->fields[$property] = $value;\n }",
"function setProperty($property,$value=null){\n\t\t/*\n\t\t * This function is useful to call right after adding the filed:\n\t\t *\n\t\t * $this->addField('line','login')->setProperty('not null');\n\t\t */\n\t\treturn $this->setFieldProperty($this->last_field,$property,$value);\n\t}",
"function setValues($array){\r\n\t\tforeach($array as $key => $val)\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t}",
"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}",
"public function setProperty(?string $value): void {\n $this->getBackingStore()->set('property', $value);\n }",
"public function __set($property, $value)\n\t{\n\t\t$setter = '__volatile_set_' . $property;\n\n\t\tif (method_exists($this, $setter))\n\t\t{\n\t\t\treturn $this->$setter($value);\n\t\t}\n\n\t\t/*\n\t\t$setter = $this->find_method_callback($setter);\n\n\t\tif ($setter)\n\t\t{\n\t\t\treturn $this->$property = call_user_func($setter, $this, $property, $value);\n\t\t}\n\t\t*/\n\n\t\t$setter = '__set_' . $property;\n\n\t\tif (method_exists($this, $setter))\n\t\t{\n\t\t\treturn $this->$property = $this->$setter($value);\n\t\t}\n\n\t\t/*\n\t\t$setter = $this->find_method_callback($setter);\n\n\t\tif ($setter)\n\t\t{\n\t\t\treturn $this->$property = call_user_func($setter, $this, $property, $value);\n\t\t}\n\t\t*/\n\n\t\t$properties = get_object_vars($this);\n\n\t\tif (array_key_exists($property, $properties))\n\t\t{\n\t\t\tthrow new Exception\\PropertyNotWritable(array($property, $this));\n\t\t}\n\n\t\t$this->$property = $value;\n\t}",
"public function updatePropertyIndex ()\n {\n $new_properties_table = array();\n\n foreach ( $this as $declaration ) {\n\n $name = $declaration->property;\n\n if ( isset( $new_properties_table[ $name ] ) ) {\n $new_properties_table[ $name ]++;\n }\n else {\n $new_properties_table[ $name ] = 1;\n }\n }\n $this->properties = $new_properties_table;\n }",
"public function __set($property, $value)\n {\n $protected = array( 'repository' );\n if(!in_array($property, $protected))\n $this->$property = $value;\n }",
"public function setProperty($property)\n\t{\n\t\t$this->property = $property;\n\t}",
"public function setProperty($property)\n\t{\n\t\t$this->property = $property;\n\t}",
"public function __set($property, $value)\n {\n $this->set($property, $value);\n }",
"public function __set( $property, $value ) {\n\t if ( property_exists( $this, $property ) ) {\n\t\t switch ( $property ) {\n\t\t\t case 'next_event':\n\t\t\t\t $this->$property = $value;\n\t\t\t\t break;\n\t\t }\n\t\t return $this;\n\t }\n }",
"public function property(&$class, $property);",
"abstract function setUserProfileProperty($user, $property_name, $property);",
"public function __set ($psProperty, $pmValue)\n\t{\n\t\t$this->set($psProperty, $pmValue);\n\t}",
"private function _set($name, $value) {\n $methodName = 'set' . ucfirst($name);\n if(method_exists($this, $methodName)) {\n $this->$methodName($value);\n } else {\n $property = $name;\n $this->$property = $value;\n }\n }",
"function __set($property, $value) {\n global $USER, $DB;\n if(in_array($property, array('title', 'header'))) {\n return ($this->{'_'.$property} = $value);\n } elseif($property == 'content') {\n return ($this->$property = $value);\n } else {\n return parent::__set($property, $value);\n }\n }",
"public function testSetProperties() {\n\t\t$this->CurrentConditions->update(\n\t\t\t.70,\n\t\t\t.33,\n\t\t\t.34\n\t\t);\n\n\t\t$reflection = new ReflectionClass($this->CurrentConditions);\n\t\t$reflectionTemperature = $reflection->getProperty('temperature');\n\t\t$reflectionTemperature->setAccessible(TRUE);\n\t\t$reflectionHumidity = $reflection->getProperty('humidity');\n\t\t$reflectionHumidity->setAccessible(TRUE);\n\n\t\t$this->assertSame(\n\t\t\t$reflectionTemperature->getValue($this->CurrentConditions),\n\t\t\t.70\n\t\t);\n\t\t$this->assertSame(\n\t\t\t$reflectionHumidity->getValue($this->CurrentConditions),\n\t\t\t.33\n\t\t);\n\t}",
"public function setDocProp($prop,$val){\n\t\t$this->doc_prop[$prop] = $val;\n\t}",
"public function setModified($value) {}",
"public function __set($key, $value) {\n if (method_exists($this, 'set_'.$key)) {\n $this->{'set_'.$key}($value);\n }\n $this->properties->{$key} = $value;\n }",
"public function set($property, $value)\n {\n \\Closure::bind(\n function () use ($property, $value) { $this->$property = $value; },\n $this->target,\n $this->target\n )->__invoke();\n }"
]
| [
"0.7104884",
"0.6988728",
"0.6971728",
"0.67247564",
"0.672023",
"0.67154163",
"0.6627799",
"0.65791273",
"0.6576679",
"0.6559313",
"0.65455437",
"0.6513085",
"0.64694124",
"0.64105785",
"0.63817745",
"0.63753945",
"0.6335228",
"0.63304687",
"0.631793",
"0.63086957",
"0.63005924",
"0.63005924",
"0.63005924",
"0.63005924",
"0.63005924",
"0.629864",
"0.62885225",
"0.62825423",
"0.6257309",
"0.6252723",
"0.6244669",
"0.62376904",
"0.62258446",
"0.62237406",
"0.62110704",
"0.62098694",
"0.62084246",
"0.6207759",
"0.62059766",
"0.61973506",
"0.61958283",
"0.61658263",
"0.61456555",
"0.61439437",
"0.6126222",
"0.61085165",
"0.60968626",
"0.6095511",
"0.6084519",
"0.60831314",
"0.60725915",
"0.6069772",
"0.6067731",
"0.6067466",
"0.60341215",
"0.60314465",
"0.6010151",
"0.600976",
"0.600976",
"0.60063046",
"0.60046655",
"0.60042983",
"0.60042983",
"0.60042983",
"0.60042983",
"0.60042983",
"0.60016465",
"0.5994006",
"0.5990923",
"0.5987966",
"0.59857833",
"0.5983144",
"0.59818834",
"0.5976406",
"0.5968565",
"0.5968335",
"0.596423",
"0.59282887",
"0.59243757",
"0.5922254",
"0.59170604",
"0.590504",
"0.58940893",
"0.58847654",
"0.5883652",
"0.58811486",
"0.586683",
"0.5866317",
"0.5866317",
"0.58638895",
"0.5861482",
"0.5852038",
"0.5850534",
"0.5829796",
"0.58202857",
"0.581464",
"0.58082366",
"0.58066255",
"0.58044994",
"0.5798309",
"0.5794495"
]
| 0.0 | -1 |
Get nochanges of a property | public function getPropertyNoChanges(string $symbol): int {
return $this->properties[$symbol]['no_changes'] ?? 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPropertiesModifiedWithoutBlackListContext(): array\n {\n return $this->getPropertyChecker()->getPropertiesModifiedWithoutBlackListContext($this->initial, $this->current);\n }",
"public function getUndefinedProperties()\n {\n return new \\CallbackFilterIterator($this, function ($current) {\n \\assert($current instanceof Property);\n return (VCard::isSpecified($current->getName()) === false);\n });\n }",
"public function setPropertyNoChanges(string $symbol, int $value): Statistics {\n\t\t$this->addProperty($symbol);\n\t\t$this->properties[$symbol]['no_changes'] = $value;\n\n\t\treturn $this;\n\t}",
"function changed_properties() {\r\n \t$changed = array();\r\n \tforeach($this->_frozen_properties as $var => $val) {\r\n \t\tif ($this->$var != $this->_frozen_properties[$var])// This property has changed:\r\n \t\t\t$changed[$var] = $val;\r\n \t}\r\n \treturn $changed;\r\n }",
"public function getDisallowedStates($property)\n\t{\n\t\treturn array();\n\t}",
"public function modified(string $property = null)\n {\n if ($property === null) {\n return array_keys($this->_modified);\n }\n\n return isset($this->_modified[$property]);\n }",
"public function notFlag($not = null)\n {\n if(null === $not)\n {\n return $this->property('not');\n }\n return $this->property('not', (bool) $not);\n }",
"public function isNotChanged()\n {\n return empty(array_diff_assoc($this->items, $this->clone));\n }",
"public static function doesNotHaveProperty($prop)\n {\n return self::logicalNot(self::hasProperty($prop));\n }",
"public function getNotDeleted()\n {\n return $this->createQueryBuilder()->field('deletedAt')->equals(null)->getQuery()->execute();\n }",
"public function skipProperties() {}",
"public function getIgnoreItemsOnUpdate(): array;",
"public function getOrphaned() {\r\n\t\t\r\n\t\t$query = \"SELECT * FROM $this->att WHERE $this->att.event_id = 0\";\r\n\t\t\t\t\r\n\t\treturn $this->executeQuery($query);\r\n\t}",
"public function getNoPropertiesFoundText()\n {\n return $this->noPropertiesFoundText;\n }",
"public function GetNoValidate () {\n\t\treturn $this->noValidate;\n\t}",
"public function isNot()\n {\n return $this->not;\n }",
"public function isNot()\n {\n return $this->not;\n }",
"public function getProperties() {\n $modifiable_properties = [];\n $fields = $this->getFields();\n foreach (Framework::instance()->entityProperties($this->getEntity()) as $property => $info) {\n if (!in_array($property, array_keys($fields)) && $this->filter($property)) {\n $this->addModifier($modifiable_properties, 'property', $property);\n }\n }\n return $modifiable_properties;\n }",
"public function getNotPoked()\n {\n return $this->select('status_id', 'status_author')\n ->where('author_poked', '=', '0')\n ->get();\n }",
"public static function getNotSubscribedProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'not-subscribed');\n\n\t}",
"public function listInvalidProperties();",
"function hook_openid_connect_user_properties_to_skip_alter(array &$properties_to_skip) {\n}",
"function getChanged() {\n return $this->changed;\n }",
"public function getIsNot()\n {\n return $this->is_not;\n }",
"public function shouldSkipProperty(PropertyMetadata $property, Context $context): bool;",
"public function _getCleanProperties() {}",
"public function testIsTransientFalse()\n {\n $reflectedProperty = new PropertyReflection('TRex\\Reflection\\resources\\Bar', 'bar');\n $this->assertFalse($reflectedProperty->isTransient());\n }",
"public function getNewsNotCheck()\n {\n $news = $this->_model->where('news_is_check', '=', '0')->get();\n\n return $news;\n }",
"public function offsetUnset ($key)\n\t{\n\t\t$this->changed_properties->push($key);\n\n\t\treturn parent::offsetUnset($key);\n\t}",
"public function getNoCopy() : ?bool\n {\n return $this->noCopy;\n }",
"protected function _getReadonlyProperties()\n {\n return array();\n }",
"public function getChanged()\n {\n return $this->entity->getChanged();\n }",
"public function getNotApplied(): array\n {\n return $this->notApplied;\n }",
"public function removeProperty($property) {\n foreach (array_keys($this->optionalProperties, $property) as $key) {\n unset($this->optionalProperties[$key]);\n }\n return $this->optionalProperties;\n }",
"public function props_changed()\n\t{\n\t\treturn $this->props_changed;\n\t}",
"public function hasChanged() { return $this->changed; }",
"public function prunable()\n {\n return static::where(static::UPDATED_AT, '<=', now()->subWeek());\n }",
"public function withoutValue();",
"public function get_nonces()\n {\n }",
"public function listInvalidProperties() {\n\n $invalidProperties = [];\n\n /*\n * Any needed validation goes here. If a property requires no validation\n * (e.g. it's OK for it to be empty) then it may be omitted.\n */\n\n return $invalidProperties;\n }",
"public function getNoTimeframes()\n {\n return $this->noTimeframes;\n }",
"public function getSkipped();",
"public function dirty() {\n $results = array();\n foreach ( $this->proxies as $id => $proxy ) {\n if ( $proxy->___repose_isDirty() ) $results[] = $proxy;\n }\n return $results;\n }",
"public function populatableProperties() : array;",
"public function getUnpublish() {\n return $this->changeFilter('unpublish');\n }",
"public function getChanged()\n {\n return $this->_changed;\n }",
"public function getChanged()\n {\n return $this->changed;\n }",
"public function testIsValidSuccessWithoutHasDataChanges()\n {\n $this->_object->expects($this->once())->method('hasDataChanges')->will($this->returnValue(false));\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $validator->setReadOnlyProperties(['attr1']);\n $this->assertTrue($validator->isValid($this->_object));\n }",
"public function getupdatedproperties($type) {\n\n // Dont filter for now\n $type = '';\n\n // Filter by type\n if ( $type != '' ) {\n foreach ( $this->data as $k => $property ) {\n if ( $property['strChangeLog'] !== $type ) {\n unset($this->data[$k]);\n }\n }\n }\n\n return $this->data;\n }",
"public function __unset($property) {\n switch ($property) {\n case 'message':\n return $this->message = null;\n case 'code':\n case 'full_message':\n case 'is_info':\n case 'is_success':\n case 'is_redirect':\n case 'is_error':\n case 'is_client_error':\n case 'is_server_error':\n case 'response':\n throw new Core_ReadOnlyPropertyException($property);\n default:\n throw new Core_MissingPropertyException($property);\n }\n }",
"public function getChanges();",
"public function getChanges();",
"private function visibleProperties() : array\n {\n $properties = array_keys($this->_properties);\n $properties = array_merge($properties, $this->_virtual);\n\n return array_diff($properties, $this->_hidden);\n }",
"public function getDirty();",
"public function getIgnored() : bool\n {\n return $this->ignored;\n }",
"public function listInvalidProperties()\n {\n return [];\n }",
"public function getChanged() {\n return $this->changed;\n }",
"public function changed ()\n\t{\n\t\treturn new Vector($this->changed_properties);\n\t}",
"protected function getFilterProperty()\n {\n return null;\n }",
"public function getFalseMutationsList(){\n return $this->_get(5);\n }",
"public function getUncommittedEvents();",
"public function __get($property)\n\t{\n\t\tif (isset($this->_fields[$property]))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t}",
"public function getChange();",
"public function readOnly()\n {\n return !$this->_allowModifications;\n }",
"public function detectChanges()\n {\n return [];\n }",
"public function __get($propertyName) {\n return \"No value \" . $propertyName;\n }",
"public function getInvisible()\n\t{\n\t\treturn $this->invisible;\n\t}",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }",
"public function getUpdatedProperties() {}",
"public function getHasChanged()\r\n {\r\n return $this->_hasChanged;\r\n }",
"public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }",
"public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }",
"public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }",
"public function testNotOwnedProperty(): void\n {\n $property = $this->getMockBuilder(Property::class)->disableOriginalConstructor()->getMock();\n $property->method('property')->willReturn('test_prop');\n $grouping = new Grouping([], [$property]);\n\n $prop = $grouping->property('test_prop2');\n $this->assertNull($prop);\n }",
"public function __get($property)\n {\n $info = build_properties_hint(reflect_properties($this));\n warning('Property \"'.$property.'\" doesn\\'t exist in a '.get_class($this).' object', $info);\n }",
"public function not() {\n\t\t$this->not = '!';\n\t\treturn $this;\n\t}",
"public function _isDirty($propertyName = null)\n {\n return $this->getIgnoreDirty() ? false : parent::_isDirty($propertyName);\n }",
"public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }",
"public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }",
"public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }",
"public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }",
"public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }",
"public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }",
"public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }",
"public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }",
"public static function getNoCache(): bool {\n return self::$noCache;\n }",
"public function listInvalidProperties() {\n\t\treturn array();\n\t}"
]
| [
"0.62467295",
"0.58478093",
"0.5832986",
"0.5807109",
"0.57783693",
"0.56642246",
"0.5602593",
"0.54877394",
"0.54808307",
"0.54648346",
"0.5458783",
"0.5337754",
"0.5307575",
"0.5293435",
"0.52502185",
"0.5210285",
"0.5210285",
"0.5196043",
"0.5180238",
"0.51751673",
"0.5165255",
"0.5163201",
"0.51454085",
"0.5130736",
"0.5125197",
"0.5107415",
"0.5103291",
"0.50917315",
"0.5078819",
"0.50617456",
"0.50547534",
"0.5042788",
"0.5040047",
"0.50262815",
"0.5019526",
"0.5008964",
"0.50007385",
"0.5000665",
"0.49997178",
"0.49986982",
"0.49982294",
"0.49979597",
"0.4997806",
"0.4994005",
"0.4993947",
"0.49902123",
"0.49826187",
"0.49776042",
"0.497559",
"0.4965053",
"0.49542752",
"0.49542752",
"0.4947269",
"0.49336383",
"0.49313307",
"0.49267986",
"0.49259973",
"0.49251467",
"0.491592",
"0.49067527",
"0.49042895",
"0.49042004",
"0.48999792",
"0.48995787",
"0.48826894",
"0.48796594",
"0.4879281",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.4879069",
"0.48733145",
"0.48720908",
"0.487115",
"0.487115",
"0.487115",
"0.48690507",
"0.4851401",
"0.4840565",
"0.4825491",
"0.48213702",
"0.48213702",
"0.48213702",
"0.48213702",
"0.48213702",
"0.48213702",
"0.48052382",
"0.48052382",
"0.4804997",
"0.4803424"
]
| 0.6896646 | 0 |
Set nochanges of a property | public function setPropertyNoChanges(string $symbol, int $value): Statistics {
$this->addProperty($symbol);
$this->properties[$symbol]['no_changes'] = $value;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUnmodified()\n {\n\t$this->modified= false;\n }",
"public function markUnchanged();",
"public function unsetProperty()\n\t{\n\t\t$this -> tableName = '';\n\t\t$this -> databaseName = '';\n\t\t$this -> arrNewData = array();\n\t\t$this -> arrOldData = array();\n\t}",
"public function setPropertyBehavior() {\n $this->isInPropertyBehavior= TRUE;\n }",
"public function markAsNotDirty()\n {\n foreach ($this->getDirty() as $key) {\n $this->setDirty($key, false);\n }\n }",
"public function __set($property, $value) {}",
"public function testIsValidSuccessWithoutHasDataChanges()\n {\n $this->_object->expects($this->once())->method('hasDataChanges')->will($this->returnValue(false));\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $validator->setReadOnlyProperties(['attr1']);\n $this->assertTrue($validator->isValid($this->_object));\n }",
"public function setProperty($property, $value = null);",
"public function getPropertyNoChanges(string $symbol): int {\n\t\treturn $this->properties[$symbol]['no_changes'] ?? 0;\n\t}",
"function hook_openid_connect_user_properties_to_skip_alter(array &$properties_to_skip) {\n}",
"public function clearChangedState()\n {\n\n $this->_changed = false;\n\n }",
"public function __unset($prop)\r\n {\r\n unset($this->wrappedObj->$prop);\r\n }",
"public function __unset($property)\n {\n $this->unsetProperty($property);\n }",
"protected function resetProperties() {}",
"public function __unset($property) {\n\t\tif (strpos($property, 'source') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\tunset($this->bean->source);\n\t\t\t} else {\n\t\t\t\tunset($this->source->$property);\n\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t}\n\t\t} elseif (strpos($property, 'remote') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\tunset($this->bean->target);\n\t\t\t} else {\n\t\t\t\tunset($this->remote->$property);\n\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t}\n\t\t\t//Temporary properties are kept in the object, and not written to the database.\n\t\t} elseif (strpos($property, 'temp') === 0) {\n\t\t\t$property = lcfirst(substr($property, 4));\n\t\t\tunset($this->tempProperties[$property]);\n\t\t} else {\n\t\t\tif (isset($this->properties[$property])) {\n\t\t\t\tif ($this->loadedProperties === false) {\n\t\t\t\t\t$this->loadProperties();\n\t\t\t\t}\n\t\t\t\tunset($this->properties[$property]);\n\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t}\n\t\t\tif (isset($this->bean->$property)) {\n\t\t\t\tunset($this->bean->$property);\n\t\t\t}\n\t\t}\n\t}",
"function setNoModify($no_modify) {\n $this->fields['no_modify'] = $no_modify;\n return $this;\n }",
"public function setReadOnly()\n {\n $this->_allowModifications = false;\n foreach ($this->_data as $key => $value) {\n if ($value instanceof Zend_Config) {\n $value->setReadOnly();\n }\n }\n }",
"public function setNoSave()\n {\n $this->no_save = true;\n\n return $this;\n }",
"function setNotCreated() \n {\n $this->setValueByFieldName( 'statevar_isCreated', 0 );\n $this->updateDBTable();\n }",
"abstract protected function propertyUnset($name);",
"public function clearProperties();",
"function resetModified() { $this->_modified = 0; }",
"function resetModified() { $this->_modified = 0; }",
"public function setNoEffectAttribute($value)\n {\n $this->attributes['no_effect'] = $this->makeCollection($value);\n }",
"public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }",
"public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }",
"public function skipProperties() {}",
"function set_property(){\n }",
"public function disable() {\n\t\t$this->update(TRUE);\n\t}",
"public function reset()\n {\n foreach (self::AvailableCoins as $aCoin) {\n \t $sProperty = $aCoin['name'];\n $this->$sProperty = 0;\n }\n }",
"public function updated($property)\n {\n $this->validateOnly($property);\n }",
"public static function clear($prop) {\n if (isset(self::$props[$prop])) {\n unset(self::$props[$prop]);\n }\n }",
"function setProperty($property,$value=null){\n\t\t/*\n\t\t * This function is useful to call right after adding the filed:\n\t\t *\n\t\t * $this->addField('line','login')->setProperty('not null');\n\t\t */\n\t\treturn $this->setFieldProperty($this->last_field,$property,$value);\n\t}",
"public function resetDirty()\n {\n $this->dirty = false;\n $this->dirtyOne = false;\n $this->dirtyMany = false;\n }",
"public function setIsSelectableIfPropVal(Property $property) {\r\n if ($property->getPropertyValues()->count()) {\r\n $property->setIsSelectable(1);\r\n }\r\n }",
"public static function setExcludeNoFollowLinks($newValue)\r\n {\r\n self::$_excludeNoFollowLinks = $newValue;\r\n }",
"public function __unset(string $property)\n {\n $this->unset($property);\n }",
"public function __set($name, $value)\n {\n // Don't allow to set attributes\n }",
"public final function setImmutable()\n {\n $this->isImmutable = true;\n }",
"public static function setUnlocked()\n {\n self::$locked = false;\n }",
"function __set($property, $value)\n {\n\n if( $value != null )\n $this->fields[$property] = $value;\n }",
"public function shouldSkipProperty(PropertyMetadata $property, Context $context): bool;",
"public function setChanged()\n {\n\n $this->_changed = true;\n\n }",
"public function __set($property, $value)\n {\n switch ($property) {\n\n case 'name':\n if(!empty($value) && is_string($value)) {\n $this->name = $value;\n $this->changed = true;\n break;\n } else {\n echo 'Wrong type of property, it should be string';\n break;\n }\n \n case 'status':\n if(!empty($value) && is_int($value)) {\n $this->status = $value;\n $this->changed = true;\n break;\n } else {\n echo 'Wrong type of property, it should be integer';\n break;\n }\n \n }\n }",
"public function resetShopifyProperty($propertyName, $value) {\n if (is_null($value)) {\n $this->unsetShopifyProperty($propertyName);\n } else if ($this->existsShopifyProperty($propertyName)) {\n $this->setShopifyProperty($propertyName, $value);\n }\n }",
"public function __unset($property) {\n switch ($property) {\n case 'message':\n return $this->message = null;\n case 'code':\n case 'full_message':\n case 'is_info':\n case 'is_success':\n case 'is_redirect':\n case 'is_error':\n case 'is_client_error':\n case 'is_server_error':\n case 'response':\n throw new Core_ReadOnlyPropertyException($property);\n default:\n throw new Core_MissingPropertyException($property);\n }\n }",
"public function allowAllPropertiesExcept() {}",
"public function testSetInvalidProperty() {\n $permission = new GroupPermission();\n $permission->set('invalid property', 'a value');\n }",
"public function remove($property);",
"public function setReadOnly ()\n {\n $this->resetNeedsSaving();\n $this->readOnly = true;\n }",
"function __set($property, $value)\n {\n $this->setValue($value);\n }",
"private function accessor_wakeup(): void\n {\n $properties = get_object_vars($this);\n\n foreach ($properties as $property => $value) {\n if (\n $this->has_method(static::accessor_format(\n $property,\n HasAccessor::ACCESSOR_TYPE_GETTER,\n HasAccessor::ACCESSOR_IS_LAZY\n ))\n ) {\n unset($this->$property);\n }\n }\n }",
"public function resetIsDirty()\r\n\t{\r\n\t\t$this->changelog = array();\r\n\t}",
"function setNoCopy($no_copy) {\n $this->fields['no_copy'] = $no_copy;\n return $this;\n }",
"public function offsetUnset ($key)\n\t{\n\t\t$this->changed_properties->push($key);\n\n\t\treturn parent::offsetUnset($key);\n\t}",
"public function testNotOwnedProperty(): void\n {\n $property = $this->getMockBuilder(Property::class)->disableOriginalConstructor()->getMock();\n $property->method('property')->willReturn('test_prop');\n $grouping = new Grouping([], [$property]);\n\n $prop = $grouping->property('test_prop2');\n $this->assertNull($prop);\n }",
"public function set($property, $value);",
"public function noOverwrites(bool $noOverwrites): self\n {\n $new = clone $this;\n $new->noOverwrites = $noOverwrites;\n\n return $new;\n }",
"protected function setNonPublicProperty($obj, $property, $value)\n {\n if (!is_object($obj) || !is_string($property)) {\n return;\n }\n $ref = new \\ReflectionProperty(get_class($obj), $property);\n $ref->setAccessible(true);\n\n $ref->setValue($obj, $value);\n }",
"public function flushProperties()\n\t{\n\t\t$this->properties = array();\n\t}",
"public function testIsValidSuccessWithoutInvokedSetter()\n {\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $this->assertTrue($validator->isValid($this->_object));\n }",
"public function setIgnoreVersionDetection(?bool $value): void {\n $this->getBackingStore()->set('ignoreVersionDetection', $value);\n }",
"public function __set($prop, $val) {\n\t\t$this->props[$prop] = $val;\n }",
"public function __set($property, $value) {\r\n $this->set($property, $value);\r\n }",
"public function allowOverwrite($setting = true) {\n\t\t$this->allow_overwrite = $setting;\n\t}",
"protected static function setter($node, $property, $value, $subProperty = false)\n {\n\n //if there is a sub-property and there is only one, replace it\n if ($subProperty && isset($node->$property->$subProperty) && count($node->$property->$subProperty) === 1) {\n $node->$property->$subProperty = $value;\n } elseif (property_exists($node, $property)) {\n $node->$property = $value;\n }\n }",
"private function nuke()\n {\n \\lib\\Model\\ModelCache::clear($this);\n $this->__new=true;\n $this->__fields=array();\n $this->__isDirty=false;\n $this->__dirtyFields=array();\n }",
"public function testSetNotForPaymentDisabledFields()\n {\n $this->slipData->setWithReferenceNumber(false);\n $this->slipData->setWithBankingCustomerId(false);\n\n $this->slipData->setNotForPayment(true);\n }",
"public function setUnaltered()\n {\n $this->alteredColumns = [];\n }",
"public function setInactive()\r\n {\r\n $this->active = false;\r\n }",
"public function setModified($value) {}",
"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 noCommit($flag = true) {\n\t\t$this->noCommit = (boolean) $flag;\n\t\treturn $this;\n\t}",
"public function __set($property, $value)\n {\n $protected = array( 'repository' );\n if(!in_array($property, $protected))\n $this->$property = $value;\n }",
"abstract public function NonQuery($sql, $blnWarnNoChanges);",
"public function notFlag($not = null)\n {\n if(null === $not)\n {\n return $this->property('not');\n }\n return $this->property('not', (bool) $not);\n }",
"function setRemoved( $value )\n {\n $this->Removed = $value;\n }",
"public function setNoCopy(?bool $noCopy) : self\n {\n $this->noCopy = $noCopy;\n return $this;\n }",
"public function setNe($x) { $this->ne = $x; }",
"public function enforceOnWrite() { return true; }",
"public function _isDirty() {}",
"public function __set($property, $value){\n\t\t$this->_connect();\n\t\tif($this->_dumpLock==false){\n\t\t\tif(isset($this->$property)==false){\n\t\t\t\tthrow new ActiveRecordException(\"La propiedad '$property' no existe en la entidad '\".get_class($this).\"'\");\n\t\t\t}\n\t\t}\n\t\t$this->$property = $value;\n\t}",
"public function __set($property, $value = null) {\r\n\t\t$previous = parent::set($property, $value);\r\n\t\t\r\n\t\t// updating deprecated attributes based on property name\r\n\t\tif(array_key_exists($property, self::$deprecatedAttribs)) {\r\n\t\t\t$oldAttrib = self::$deprecatedAttribs[$property];\r\n\t\t\t$this->$oldAttrib = $value;\r\n\t\t}\r\n\r\n\t\t// updating aggregated attributes\r\n\t\tif(array_key_exists($property, get_object_vars($this->jLanguageTable))) {\r\n\t\t\t$this->jLanguageTable->set($property, $value);\r\n\t\t} \r\n\t\tif(array_key_exists($property, get_object_vars($this->jfLanguageExt))) {\r\n\t\t\t$this->jfLanguageExt->set($property, $value);\r\n\t\t}\r\n\t\t\r\n\t\treturn $previous;\r\n\t}",
"public function __set($prop, $value)\n {\n // verifica se existe mtodo set_<propriedade>\n $metodo = 'set' . ucwords($prop);\n if (method_exists($this, $metodo)) {\n call_user_func(array($this, $metodo), $value);\n } else {\n if ($value === NULL) {\n unset($this->data[$prop]);\n } else {\n $this->data[$prop] = $value;\n }\n }\n }",
"public function not() {\n\t\t$this->not = '!';\n\t\treturn $this;\n\t}",
"public function setToNull($propertyName)\n {\n $this->$propertyName = Zood_Entity_Null::getInstance();\n return $this;\n }",
"public function __set($property, $value) \n {\n \tif (property_exists($this, $property)) {\n \t\t$this->$property = $value;\n \t}\n }",
"public function testIsTransientFalse()\n {\n $reflectedProperty = new PropertyReflection('TRex\\Reflection\\resources\\Bar', 'bar');\n $this->assertFalse($reflectedProperty->isTransient());\n }",
"function _isDirty() ;",
"public function setQuietly($key, $value) {\n\t\t$track = $this->trackChanges(); \n\t\t$this->setTrackChanges(false);\n\t\t$this->set($key, $value);\n\t\tif($track) $this->setTrackChanges(true);\n\t\treturn $this;\n\t}",
"public function unset(): void\n\t{\n\t\t$this->_value = $this->_allowNull ? null : self::setType('', gettype($this->_value));\n\t}",
"public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }",
"function deactivate_property($var)\r\n{\r\n list($dbconn) = lnDBGetConn();\r\n $lntable = lnDBGetTables();\r\n\r\n if (!empty($var['property'])) {\r\n $column = &$lntable['user_property_column'];\r\n\r\n $result = $dbconn->Execute(\"UPDATE $lntable[user_property] SET $column[prop_weight]=0\r\n WHERE $column[prop_id]='\" . $var['property'] . \"'\");\r\n if ($dbconn->ErrorNo() <> 0) {\r\n echo $dbconn->ErrorNo() . \"Deactivate User Property 1\" . $dbconn->ErrorMsg() . \"<br>\";\r\n error_log ($dbconn->ErrorNo() . \"Deactivate User Property 1: \" . $dbconn->ErrorMsg() . \"<br>\");\r\n return;\r\n } \r\n $result = $dbconn->Execute(\"UPDATE $lntable[user_property] SET $column[prop_weight]=$column[prop_weight]-1\r\n WHERE $column[prop_weight]>'\" . $var['weight'] . \"'\");\r\n\r\n if ($dbconn->ErrorNo() <> 0) {\r\n echo $dbconn->ErrorNo() . \"Deactivate User Property 2: \" . $dbconn->ErrorMsg() . \"<br>\";\r\n error_log ($dbconn->ErrorNo() . \"Deactivate User Property 2: \" . $dbconn->ErrorMsg() . \"<br>\");\r\n return;\r\n } \r\n } \r\n lnRedirect(\"index.php?mod=User&file=userdyconfig\");\r\n}",
"public function __unset($name)\n\t{\n\t\tif(method_exists($this,$setter='set'.$name))\n\t\t\t$this->$setter(null);\n\t\telse if(method_exists($this,$jssetter='setjs'.$name))\n\t\t\t$this->$jssetter(null);\n\t\telse if(strncasecmp($name,'on',2)===0&&method_exists($this,$name))\n\t\t\t$this->_e[strtolower($name)]->clear();\n\t\telse if(strncasecmp($name,'fx',2)===0)\n\t\t\t$this->getEventHandlers($name)->remove(array($this, $name));\n\t\telse if($this->_m!==null&&$this->_m->getCount()>0&&$this->_behaviorsenabled)\n\t\t{\n\t\t\tif(isset($this->_m[$name]))\n\t\t\t\t$this->detachBehavior($name);\n\t\t\telse {\n\t\t\t\t$unset=0;\n\t\t\t\tforeach($this->_m->toArray() as $behavior)\n\t\t\t\t{\n\t\t\t\t\tif((!($behavior instanceof IBehavior)||$behavior->getEnabled())) {\n\t\t\t\t\t\tunset($behavior->$name);\n\t\t\t\t\t\t$unset++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!$unset&&method_exists($this,'get'.$name))\n\t\t\t\t\tthrow new TInvalidOperationException('component_property_readonly',get_class($this),$name);\n\t\t\t}\n\t\t} else if(method_exists($this,'get'.$name))\n\t\t\tthrow new TInvalidOperationException('component_property_readonly',get_class($this),$name);\n\t}",
"public function allowProperties() {}",
"abstract protected function propertySet($name, $value);",
"public function setNoPropertiesFoundText($text)\n {\n $this->noPropertiesFoundText = $text;\n }",
"public function setNotApplied(int $key)\n {\n if (!isset($this->revs[$key])) {\n return;\n }\n\n $name = $this->revs[$key]->getIdentity();\n\n if (array_key_exists($name, $this->notApplied)) {\n return;\n }\n\n $this->notApplied[$name] = $key;\n ksort($this->notApplied);\n\n if (array_key_exists($name, $this->applied)) {\n unset($this->applied[$name]);\n }\n }",
"public static function setNoCache(bool $bool): void {\n self::$noCache = $bool;\n }",
"public function setNoRotateFlag($noRotate = true) {}"
]
| [
"0.6820881",
"0.6042616",
"0.596763",
"0.5962582",
"0.5842844",
"0.577264",
"0.5688139",
"0.56433225",
"0.56290525",
"0.55965495",
"0.5585845",
"0.55123645",
"0.5504243",
"0.5494844",
"0.5438382",
"0.54343486",
"0.54327285",
"0.5413522",
"0.54126614",
"0.53848726",
"0.5378537",
"0.53781545",
"0.53781545",
"0.5376681",
"0.53623736",
"0.53623736",
"0.53610784",
"0.53515106",
"0.5321575",
"0.53195894",
"0.5303369",
"0.5294836",
"0.5286677",
"0.5271433",
"0.5258885",
"0.52572376",
"0.52371293",
"0.5187661",
"0.5183624",
"0.5162878",
"0.51503843",
"0.5142282",
"0.5129145",
"0.51268595",
"0.5126616",
"0.50982803",
"0.50970876",
"0.5086649",
"0.5077268",
"0.5073235",
"0.5067098",
"0.5056261",
"0.5049284",
"0.50463223",
"0.503946",
"0.5034511",
"0.50282574",
"0.50223655",
"0.5011755",
"0.50095457",
"0.50067",
"0.50027084",
"0.49970645",
"0.4985518",
"0.49818704",
"0.49721873",
"0.4972062",
"0.49714372",
"0.4968888",
"0.4967187",
"0.4967004",
"0.49537858",
"0.4936396",
"0.49313223",
"0.49280775",
"0.49237785",
"0.49232894",
"0.49221393",
"0.4916037",
"0.49147668",
"0.4901241",
"0.48929274",
"0.488931",
"0.48858276",
"0.48828018",
"0.48767468",
"0.48761913",
"0.48722622",
"0.48695084",
"0.48600438",
"0.48519784",
"0.4848772",
"0.48334265",
"0.4830292",
"0.4821046",
"0.48199767",
"0.48189595",
"0.4816429",
"0.4808949",
"0.48082414"
]
| 0.6320207 | 1 |
Get min time of a property | public function getPropertyMinTime(string $symbol): ?DateTime {
return $this->properties[$symbol]['min_time'] ?? null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetStartTime_Min()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_start_after;\n }",
"public function getMin() {\n return $this->min;\n }",
"public function get_time_min() {\n return sprintf( '%02d', (int) edd_get_option( 'edd_commissions_payout_schedule_time_min', '' ) );\n }",
"public function getMinTimeBetweenClaimsMs()\n {\n return $this->min_time_between_claims_ms;\n }",
"public function getPropertyMinTimeFormatted(string $symbol): ?string {\n\t\treturn $this->getPropertyMinTime($symbol) ? $this->getPropertyMinTime($symbol)->format('c') : null;\n\t}",
"function min() { return $this->min; }",
"public function getMin();",
"public function getMin()\n {\n return $this->_fMin;\n }",
"function getMinute()\r\n {\r\n return $this->minuto;\r\n }",
"function getMin() { return $this->readMinValue(); }",
"public function getMin()\n {\n return $this->_minValue;\n }",
"public function getStart()\n {\n return $this->start_time;\n }",
"public function setPropertyMinTime(string $symbol, ?DateTime $time): Statistics {\n\t\t$this->addProperty($symbol);\n\t\t$this->properties[$symbol]['min_time'] = $time;\n\n\t\treturn $this;\n\t}",
"public function setMinTime($value)\n {\n return $this->set('MinTime', $value);\n }",
"function get_minute()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"minutes\"];\n }",
"public function getStartTime() {\n return $this->get(self::STARTTIME);\n }",
"public function getStartTime()\n {\n return $this->get(self::_START_TIME);\n }",
"public function getStartTime()\n {\n return $this->get(self::_START_TIME);\n }",
"public function pretransfertime() {\n return $this->info['pretransfer_time'];\n }",
"public function getTimeStart() {\n return $this->time_start;\n }",
"public function getStartTime()\n {\n return $this->get(self::START_TIME);\n }",
"public function getMinute()\n {\n return $this->minute;\n }",
"public function min($value) {\n return $this->setProperty('min', $value);\n }",
"public function min($value) {\n return $this->setProperty('min', $value);\n }",
"public function starttime() {\n return $this->info['starttransfer_time'];\n }",
"public function GetStartTime_Max()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_start_before;\n }",
"public function getStartTime()\n {\n return $this->getData('start_time', 0);\n }",
"public function getMinimum()\n {\n return $this->minimum;\n }",
"public function GetDuration_Min()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_min_duration;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function min(): ?DateTime {\n\t\t$min = $this->attribute(\"min\");\n\n\t\tif(!is_string($min)) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\t$min = new DateTime($min);\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\tAppLog::error(\"invalid minimum time\", __FILE__, __LINE__, __FUNCTION__);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $min;\n\t}",
"public function getDateTimeObjectStart();",
"public function getTime_start()\n {\n return $this->time_start;\n }",
"function start_time($start_time=null)\n {\n if (isset($start_time)) $this->start_time = $start_time;\n return $this->start_time;\n }",
"public function getMinimum() {\r\n return $this->minimumvalue;\r\n }",
"public function getMinProperties(): int\n {\n return $this->minProperties;\n }",
"private function min()\n {\n return Carbon::create(1, 1, 1, 0, 0, 0);\n }",
"function get_event_start_time($post_id){\n\t\treturn get_post_meta($post_id, '_start_time', true);\t\t\n\t}",
"public function getFromTime() {\n return $this->get(self::FROM_TIME);\n }",
"public function getBeginTime()\n {\n return $this->get(self::_BEGIN_TIME);\n }",
"public function getStartTime() {\r\n\t\treturn $this->startTime;\r\n\t}",
"public function getStartTime()\n {\n return $this->start;\n }",
"public function get_time() {\n return $this->_time;\n }",
"public function getMin() {\n\t\t\treturn \"<p>Min: \".$this->min.\"</p>\";\n\t\t}",
"public function getStartTime()\n {\n return $this->startTime;\n }",
"public function getStartTime()\n {\n return $this->startTime;\n }",
"public function getStartTime()\n {\n return $this->startTime;\n }",
"public static function getStartTime(): float\n {\n return self::$startTimer;\n }",
"public static function min($attribute = null);",
"public static function get_min_value() {\n return self::MIN_VALUE;\n }",
"public function timeLowLow();",
"#[Property('time')]\n\tprotected function getTime(): Time|string {\n\t\treturn new Time($this);\n\t}",
"public function get_score_min()\n\t{\n\t\treturn $this->score_min;\n\t}",
"public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-W01');\n\t}",
"public function getMinValue();",
"public function getMinValue();",
"function getStartTime($event) {\n $timer = Filter::get(Timer::timers(), $event);\n if (!empty($timer)) {\n return Filter::get($timer, 'start');\n }\n return null;\n }",
"public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }",
"public function getBestTime() {\r\n\t\t$min = array();\r\n\t\tforeach ($this->races as $race) {\r\n\t\t\t$min[] = $race->getBestTime();\r\n\t\t}\r\n\t\treturn min($min);\r\n\t}",
"public function getMinValue()\n {\n return $this->get('MinValue');\n }",
"public function getMin(): float;",
"public function getLoadProcessStartTime()\n {\n global $timestart;\n if ( empty( $timestart ) )\n return '';\n\n return @gmdate( $this->getPluginTimeFormat(), $timestart );\n }",
"public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-01');\n\t}",
"public function getStartTime() {\n return $startTime;\n }",
"public function getStartTime();",
"public function getStartTime();",
"public function getStartTime();",
"public function getStartTime();",
"public function getStartAtMin(): ?string\n {\n return $this->startAtMin;\n }",
"function GetStartTimestamp () {\n return $this->hunt_start_timestamp;\n }",
"public function getTskTimeStart()\n {\n return $this->tsk_time_start;\n }",
"public function getMin()\r\n {\r\n if (count($this->aNotes) === 0) {\r\n return 0;\r\n }\r\n $fMin = $this->aNotes[0];\r\n foreach ($this->aNotes as $fNote) {\r\n if ($fNote < $fMin) {\r\n $fMin = $fNote;\r\n }\r\n }\r\n return $fMin;\r\n }",
"function minute()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n $value = ( $value - $second ) / 60;\r\n\r\n $minute = $value % 60;\r\n\r\n return $minute;\r\n }",
"public function getStartTimestamp() {}",
"public function getAutomaticMinimum() {\r\n return $this->automaticMinimum;\r\n }",
"function __get( $property ) {\n\n // Standard Properties\n\t //\n\t if ( property_exists( $this , $property ) ) {\n\n\t if ( ( $property === 'next_event' ) && empty( $this->next_event) ) {\n\t $this->next_event = wp_next_scheduled( $this->slug );\n\t\t }\n\t\t return $this->$property;\n\n\t // On the fly formatting.\n\t\t//\n\t } else {\n\t switch ( $property ) {\n\t\t\t case 'next_event_text':\n\t\t\t return $this->format_time( $this->__get( 'next_event') );\n\t\t\t case 'next_event_time_to_text':\n\t\t\t\t return $this->time_to_next_event( $this->__get( 'next_event') );\n\t\t }\n\t }\n\n\t return null;\n }",
"public function getMinute(): string\n {\n return $this->toLocalizedString('m');\n }",
"public function startTime() {\n return intval($this['started']);\n }",
"public function getStartTime() {\n\t\t$gentime = explode(' ',microtime());\n\t\t$gentime = $gentime[1] + $gentime[0];\n\t\treturn $gentime;\n\t}",
"public function get_starttime()\n {\n }",
"function getMinValue() { return $this->readMinValue(); }",
"public function getTiming()\n {\n return $this->timing;\n }",
"function getMinValue() { return $this->readMinValue(); }",
"public function getTime()\n {\n return $this->get(self::TIME);\n }",
"public function getStartDateTime()\n {\n if (array_key_exists(\"startDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"startDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"startDateTime\"])) {\n return $this->_propDict[\"startDateTime\"];\n } else {\n $this->_propDict[\"startDateTime\"] = new \\DateTime($this->_propDict[\"startDateTime\"]);\n return $this->_propDict[\"startDateTime\"];\n }\n }\n return null;\n }",
"public function getMinNumber()\n {\n return $this->minNumber;\n }",
"public static function getTimeFromStart()\n {\n return sprintf('%.0f', (microtime(true) - dm::getStartTime()) * 1000);\n }",
"public function min(): Option;",
"public function getTime()\n {\n return $this->get(self::_TIME);\n }",
"public function getTime()\n {\n return $this->get(self::_TIME);\n }",
"public function getTime()\n {\n return $this->get(self::_TIME);\n }",
"function timecheck ($time) {\n $min = 0;\n if($time->h >= 1) {\n $min += 60*$time->h;\n }\n $min += $time->i;\n if($min == 0) {\n return \"Passage en cours...\";\n } else {\n return $min.\" min\";\n }\n \n\n}"
]
| [
"0.6548248",
"0.6503345",
"0.64378196",
"0.6423479",
"0.6419791",
"0.63652563",
"0.6330352",
"0.62629944",
"0.62625235",
"0.619732",
"0.6173724",
"0.61076087",
"0.6037332",
"0.6036049",
"0.60360193",
"0.602544",
"0.5999574",
"0.5999574",
"0.59944093",
"0.59905094",
"0.59782207",
"0.59562904",
"0.5951659",
"0.5951659",
"0.5951045",
"0.5949871",
"0.5944184",
"0.59240186",
"0.5902673",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.5854238",
"0.5842864",
"0.5825765",
"0.5823873",
"0.5814624",
"0.58113366",
"0.58023435",
"0.57822824",
"0.5781236",
"0.57776797",
"0.57769907",
"0.5739511",
"0.57266057",
"0.5720476",
"0.57034636",
"0.57034636",
"0.57034636",
"0.5694081",
"0.5664389",
"0.56622696",
"0.5656924",
"0.5656261",
"0.5654214",
"0.56458426",
"0.56453156",
"0.56453156",
"0.56356335",
"0.56349987",
"0.5622583",
"0.56097513",
"0.5607007",
"0.5601725",
"0.5589507",
"0.55842465",
"0.55661404",
"0.55661404",
"0.55661404",
"0.55661404",
"0.55566573",
"0.5535704",
"0.55295897",
"0.55281645",
"0.5509128",
"0.55070794",
"0.5499908",
"0.54896545",
"0.5484926",
"0.5480763",
"0.54775876",
"0.54708004",
"0.5457205",
"0.54565656",
"0.54523754",
"0.54413015",
"0.5440264",
"0.54324704",
"0.54322237",
"0.54283166",
"0.5381764",
"0.53805226",
"0.53805226",
"0.53753215"
]
| 0.69581014 | 0 |
Get min time of a property | public function getPropertyMinTimeFormatted(string $symbol): ?string {
return $this->getPropertyMinTime($symbol) ? $this->getPropertyMinTime($symbol)->format('c') : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPropertyMinTime(string $symbol): ?DateTime {\n\t\treturn $this->properties[$symbol]['min_time'] ?? null;\n\t}",
"public function GetStartTime_Min()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_start_after;\n }",
"public function getMin() {\n return $this->min;\n }",
"public function get_time_min() {\n return sprintf( '%02d', (int) edd_get_option( 'edd_commissions_payout_schedule_time_min', '' ) );\n }",
"public function getMinTimeBetweenClaimsMs()\n {\n return $this->min_time_between_claims_ms;\n }",
"function min() { return $this->min; }",
"public function getMin();",
"public function getMin()\n {\n return $this->_fMin;\n }",
"function getMinute()\r\n {\r\n return $this->minuto;\r\n }",
"function getMin() { return $this->readMinValue(); }",
"public function getMin()\n {\n return $this->_minValue;\n }",
"public function getStart()\n {\n return $this->start_time;\n }",
"public function setPropertyMinTime(string $symbol, ?DateTime $time): Statistics {\n\t\t$this->addProperty($symbol);\n\t\t$this->properties[$symbol]['min_time'] = $time;\n\n\t\treturn $this;\n\t}",
"public function setMinTime($value)\n {\n return $this->set('MinTime', $value);\n }",
"function get_minute()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"minutes\"];\n }",
"public function getStartTime() {\n return $this->get(self::STARTTIME);\n }",
"public function getStartTime()\n {\n return $this->get(self::_START_TIME);\n }",
"public function getStartTime()\n {\n return $this->get(self::_START_TIME);\n }",
"public function pretransfertime() {\n return $this->info['pretransfer_time'];\n }",
"public function getTimeStart() {\n return $this->time_start;\n }",
"public function getStartTime()\n {\n return $this->get(self::START_TIME);\n }",
"public function getMinute()\n {\n return $this->minute;\n }",
"public function min($value) {\n return $this->setProperty('min', $value);\n }",
"public function min($value) {\n return $this->setProperty('min', $value);\n }",
"public function starttime() {\n return $this->info['starttransfer_time'];\n }",
"public function GetStartTime_Max()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_start_before;\n }",
"public function getStartTime()\n {\n return $this->getData('start_time', 0);\n }",
"public function getMinimum()\n {\n return $this->minimum;\n }",
"public function GetDuration_Min()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_min_duration;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function getStartTime()\n {\n return $this->start_time;\n }",
"public function min(): ?DateTime {\n\t\t$min = $this->attribute(\"min\");\n\n\t\tif(!is_string($min)) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\t$min = new DateTime($min);\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\tAppLog::error(\"invalid minimum time\", __FILE__, __LINE__, __FUNCTION__);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $min;\n\t}",
"public function getDateTimeObjectStart();",
"public function getTime_start()\n {\n return $this->time_start;\n }",
"function start_time($start_time=null)\n {\n if (isset($start_time)) $this->start_time = $start_time;\n return $this->start_time;\n }",
"public function getMinimum() {\r\n return $this->minimumvalue;\r\n }",
"public function getMinProperties(): int\n {\n return $this->minProperties;\n }",
"private function min()\n {\n return Carbon::create(1, 1, 1, 0, 0, 0);\n }",
"function get_event_start_time($post_id){\n\t\treturn get_post_meta($post_id, '_start_time', true);\t\t\n\t}",
"public function getFromTime() {\n return $this->get(self::FROM_TIME);\n }",
"public function getBeginTime()\n {\n return $this->get(self::_BEGIN_TIME);\n }",
"public function getStartTime() {\r\n\t\treturn $this->startTime;\r\n\t}",
"public function getStartTime()\n {\n return $this->start;\n }",
"public function get_time() {\n return $this->_time;\n }",
"public function getMin() {\n\t\t\treturn \"<p>Min: \".$this->min.\"</p>\";\n\t\t}",
"public function getStartTime()\n {\n return $this->startTime;\n }",
"public function getStartTime()\n {\n return $this->startTime;\n }",
"public function getStartTime()\n {\n return $this->startTime;\n }",
"public static function getStartTime(): float\n {\n return self::$startTimer;\n }",
"public static function min($attribute = null);",
"public static function get_min_value() {\n return self::MIN_VALUE;\n }",
"public function timeLowLow();",
"#[Property('time')]\n\tprotected function getTime(): Time|string {\n\t\treturn new Time($this);\n\t}",
"public function get_score_min()\n\t{\n\t\treturn $this->score_min;\n\t}",
"public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-W01');\n\t}",
"public function getMinValue();",
"public function getMinValue();",
"function getStartTime($event) {\n $timer = Filter::get(Timer::timers(), $event);\n if (!empty($timer)) {\n return Filter::get($timer, 'start');\n }\n return null;\n }",
"public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }",
"public function getBestTime() {\r\n\t\t$min = array();\r\n\t\tforeach ($this->races as $race) {\r\n\t\t\t$min[] = $race->getBestTime();\r\n\t\t}\r\n\t\treturn min($min);\r\n\t}",
"public function getMinValue()\n {\n return $this->get('MinValue');\n }",
"public function getMin(): float;",
"public function getLoadProcessStartTime()\n {\n global $timestart;\n if ( empty( $timestart ) )\n return '';\n\n return @gmdate( $this->getPluginTimeFormat(), $timestart );\n }",
"public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-01');\n\t}",
"public function getStartTime() {\n return $startTime;\n }",
"public function getStartTime();",
"public function getStartTime();",
"public function getStartTime();",
"public function getStartTime();",
"public function getStartAtMin(): ?string\n {\n return $this->startAtMin;\n }",
"function GetStartTimestamp () {\n return $this->hunt_start_timestamp;\n }",
"public function getTskTimeStart()\n {\n return $this->tsk_time_start;\n }",
"public function getMin()\r\n {\r\n if (count($this->aNotes) === 0) {\r\n return 0;\r\n }\r\n $fMin = $this->aNotes[0];\r\n foreach ($this->aNotes as $fNote) {\r\n if ($fNote < $fMin) {\r\n $fMin = $fNote;\r\n }\r\n }\r\n return $fMin;\r\n }",
"function minute()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n $value = ( $value - $second ) / 60;\r\n\r\n $minute = $value % 60;\r\n\r\n return $minute;\r\n }",
"public function getStartTimestamp() {}",
"public function getAutomaticMinimum() {\r\n return $this->automaticMinimum;\r\n }",
"function __get( $property ) {\n\n // Standard Properties\n\t //\n\t if ( property_exists( $this , $property ) ) {\n\n\t if ( ( $property === 'next_event' ) && empty( $this->next_event) ) {\n\t $this->next_event = wp_next_scheduled( $this->slug );\n\t\t }\n\t\t return $this->$property;\n\n\t // On the fly formatting.\n\t\t//\n\t } else {\n\t switch ( $property ) {\n\t\t\t case 'next_event_text':\n\t\t\t return $this->format_time( $this->__get( 'next_event') );\n\t\t\t case 'next_event_time_to_text':\n\t\t\t\t return $this->time_to_next_event( $this->__get( 'next_event') );\n\t\t }\n\t }\n\n\t return null;\n }",
"public function getMinute(): string\n {\n return $this->toLocalizedString('m');\n }",
"public function startTime() {\n return intval($this['started']);\n }",
"public function getStartTime() {\n\t\t$gentime = explode(' ',microtime());\n\t\t$gentime = $gentime[1] + $gentime[0];\n\t\treturn $gentime;\n\t}",
"public function get_starttime()\n {\n }",
"function getMinValue() { return $this->readMinValue(); }",
"public function getTiming()\n {\n return $this->timing;\n }",
"function getMinValue() { return $this->readMinValue(); }",
"public function getTime()\n {\n return $this->get(self::TIME);\n }",
"public function getStartDateTime()\n {\n if (array_key_exists(\"startDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"startDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"startDateTime\"])) {\n return $this->_propDict[\"startDateTime\"];\n } else {\n $this->_propDict[\"startDateTime\"] = new \\DateTime($this->_propDict[\"startDateTime\"]);\n return $this->_propDict[\"startDateTime\"];\n }\n }\n return null;\n }",
"public function getMinNumber()\n {\n return $this->minNumber;\n }",
"public static function getTimeFromStart()\n {\n return sprintf('%.0f', (microtime(true) - dm::getStartTime()) * 1000);\n }",
"public function min(): Option;",
"public function getTime()\n {\n return $this->get(self::_TIME);\n }",
"public function getTime()\n {\n return $this->get(self::_TIME);\n }",
"public function getTime()\n {\n return $this->get(self::_TIME);\n }",
"function timecheck ($time) {\n $min = 0;\n if($time->h >= 1) {\n $min += 60*$time->h;\n }\n $min += $time->i;\n if($min == 0) {\n return \"Passage en cours...\";\n } else {\n return $min.\" min\";\n }\n \n\n}"
]
| [
"0.69581014",
"0.6548248",
"0.6503345",
"0.64378196",
"0.6423479",
"0.63652563",
"0.6330352",
"0.62629944",
"0.62625235",
"0.619732",
"0.6173724",
"0.61076087",
"0.6037332",
"0.6036049",
"0.60360193",
"0.602544",
"0.5999574",
"0.5999574",
"0.59944093",
"0.59905094",
"0.59782207",
"0.59562904",
"0.5951659",
"0.5951659",
"0.5951045",
"0.5949871",
"0.5944184",
"0.59240186",
"0.5902673",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.58888113",
"0.5854238",
"0.5842864",
"0.5825765",
"0.5823873",
"0.5814624",
"0.58113366",
"0.58023435",
"0.57822824",
"0.5781236",
"0.57776797",
"0.57769907",
"0.5739511",
"0.57266057",
"0.5720476",
"0.57034636",
"0.57034636",
"0.57034636",
"0.5694081",
"0.5664389",
"0.56622696",
"0.5656924",
"0.5656261",
"0.5654214",
"0.56458426",
"0.56453156",
"0.56453156",
"0.56356335",
"0.56349987",
"0.5622583",
"0.56097513",
"0.5607007",
"0.5601725",
"0.5589507",
"0.55842465",
"0.55661404",
"0.55661404",
"0.55661404",
"0.55661404",
"0.55566573",
"0.5535704",
"0.55295897",
"0.55281645",
"0.5509128",
"0.55070794",
"0.5499908",
"0.54896545",
"0.5484926",
"0.5480763",
"0.54775876",
"0.54708004",
"0.5457205",
"0.54565656",
"0.54523754",
"0.54413015",
"0.5440264",
"0.54324704",
"0.54322237",
"0.54283166",
"0.5381764",
"0.53805226",
"0.53805226",
"0.53753215"
]
| 0.6419791 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.