query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Sets the option to encapsulated the original file's content.
public function setEncapsulateContent($value) { $this->_encapsulateContent = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function setContentFromFile($file);", "private function setContentsFromFile()\n {\n $this->file->typeChecker()->assertMarkdown();\n $this->contents = $this->file->contents();\n }", "public function setFileContents($value)\n {\n return $this->set('FileContents', $value);\n }", "public function setFileContents($value)\n {\n return $this->set('FileContents', $value);\n }", "public function setFileContents($value)\n {\n return $this->set('FileContents', $value);\n }", "public function setFileContents($value)\n {\n return $this->set('FileContents', $value);\n }", "public function setFile($file) {}", "public static function setFile($file) {}", "protected function setPlainContent() {}", "protected function setContent() {}", "public function setFile($v)\r\n\t{\r\n\t\t$this->_file = $v;\r\n\t}", "function prepareOptionsForWriting()\n {\n $content = $this->bindFields();\n $filename = $this->prepareFile();\n return (object)compact('content','filename');\n }", "function file($file)\n\t{\n\t return $this->set('', $file, TRUE);\n\t}", "public function setContents($contents) {\n $this->_contents = $contents;\n }", "public function setContents($contents, $encoding = 'UTF-8') {}", "public function setContent($content) {\n $this->request->setContent($content);\n if(is_file($content)) {\n $this->request->setIsContentString(false);\n }\n else {\n $this->request->setIsContentString(true);\n }\n \n return $this;\n }", "public function setContent()\n {\n }", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "function persist_optionsFile()\n\t\t{\n\t\t\t$propFile = $this->thispluginpath.'hits-pngfix2.properties';\n\t\t\tif($this->is__writable($propFile))\n\t\t\t{\n\t\t\t\t$propFileHandle = @fopen($propFile, 'w') or die(\"can't open file\");\n\t\t\t\tfwrite($propFileHandle,$this->thisProtocolRelativeUrl.\"clear.gif\");\n\t\t\t\tfclose($propFileHandle);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($this->options['hits_ie6_debug']=='true')\n\t\t\t\t\techo \"<!-- DEBUG: Options file is not writeable -->\";\n\t\t\t}\n\t\t}", "public function getOriginalFileContent()\n {\n return $this->originalFileContent;\n }", "public function setFileContent($value)\n {\n return $this->set('FileContent', $value);\n }", "public function setFileContent($value)\n {\n return $this->set('FileContent', $value);\n }", "public function setFileContent($value)\n {\n return $this->set('FileContent', $value);\n }", "abstract function setContent();", "public function setContentTypeOptions(): void\n {\n $this->xContentTypeOptions = \"nosniff\";\n }", "public function setFile(File $file)\n\t{\n\t\t$this->file=$file; \n\t\t$this->keyModified['file'] = 1; \n\n\t}", "public function setFile($file){\n $this->file = $file;\n }", "public function setFile($file) {\t\t\n\t\t// set file\n\t\t$this->file = $file;\n\t\t\n\t\t// set extension\n\t\t$file_parts = explode('.', $this->file['name']);\n\t\t$this->extension = strtolower(end($file_parts));\n\n\t}", "public function set_file($file) {\n $this->file = $file;\n return $this;\n }", "public function setContent( string $content );", "public function setFile($file)\n {\n $this->file = $file;\n }", "public function setDefaultContents($val)\n {\n $this->_propDict[\"defaultContents\"] = $val;\n return $this;\n }", "public function setFile($data)\n {\n $this->_File=$data;\n return $this;\n }", "public function setFile($file)\r\n {\r\n $this->file = $file;\r\n }", "private function changeLangFileContent() \n {\n $this->read();\n $this->arrayLang[$this->key] = $this->value;\n $this->save();\n }", "public function setRawContent($content);", "static public function configureFileField() {}", "public function setDataFileContent($contentRaw)\n {\n $this->setDataFileFromContentRaw($contentRaw);\n }", "function initializeFileEditDialog() {\n if (isset($this->params['file_id']) && $this->params['file_id'] != '' &&\n is_array($this->currentFile) && count($this->currentFile) > 0) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n $data = $this->currentFile;\n $hidden = array(\n 'cmd' => 'edit_file',\n 'confirm' => 1,\n 'file_id' => $this->params['file_id'],\n );\n\n $captionFileTitle = 'Title';\n $captionFileDesrciption = 'Description';\n if (in_array($this->currentFile['mimetype'], $this->imageMimeTypes)) {\n if (defined('PAPAYA_MEDIA_CUTLINE_MODE') && PAPAYA_MEDIA_CUTLINE_MODE == 1) {\n $captionFileTitle = 'Title (Cutline)';\n }\n if (defined('PAPAYA_MEDIA_ALTTEXT_MODE') && PAPAYA_MEDIA_ALTTEXT_MODE == 1) {\n $captionFileDesrciption = 'Description (Alternative Text)';\n }\n }\n if (isset($this->currentFileData) &&\n is_array($this->currentFileData)) {\n if (isset($this->currentFileData['file_title']) &&\n trim($this->currentFileData['file_title']) != '') {\n $data['file_title'] = (string)$this->currentFileData['file_title'];\n }\n if (isset($this->currentFileData['file_description'])) {\n $data['file_description'] = $this->currentFileData['file_description'];\n }\n }\n if (isset($this->currentFile['file_sort'])) {\n $data['file_sort'] = $this->currentFile['file_sort'];\n }\n\n $owner = $this->getFileOwnerData($this->currentFile['file_id']);\n if (is_array($owner) && count($owner) > 0) {\n $surfername = '';\n if ($owner['surfer_givenname'] != '' && $owner['surfer_surname'] != '') {\n $surferName = $owner['surfer_surname'].', '.$owner['surfer_givenname'].' ';\n } elseif ($owner['surfer_surname'] != '' || $owner['surfer_givenname'] != '') {\n $surferName = $owner['surfer_givenname'].$owner['surfer_surname'].' ';\n }\n $surferName .= '['.$owner['surfer_handle'].']';\n } else {\n $surferName = $this->_gt('Unknown');\n }\n $fields = array(\n 'Language independent',\n 'file_name' => array('Filename', 'isNoHTML', TRUE, 'input', 100),\n 'file_created' => array('Created', 'isISODateTime', FALSE, 'datetime', 16),\n 'file_keywords' => array('Keywords', 'isNoHTML', FALSE, 'textarea', 6),\n 'owner' => array('Owner', 'isNoHTML', FALSE, 'disabled_input', 100, '', $surferName),\n 'file_sort' => array('Sorting', 'isNoHTML', TRUE, 'input', 100),\n 'Source',\n 'file_source' => array('Text', 'isNoHTML', FALSE, 'input', 400),\n 'file_source_url' => array('Url', 'isHttpX', FALSE, 'input', 1000),\n 'Properties',\n 'file_title' => array($captionFileTitle, 'isNoHTML', FALSE, 'input', 255),\n 'file_description' => array(\n $captionFileDesrciption, 'isSomeText', FALSE, 'simplerichtext', 10\n )\n );\n\n $this->dialog = new base_dialog($this, $this->paramName, $fields, $data, $hidden);\n $this->dialog->tokenKeySuffix = 'fileedit';\n $this->dialog->loadParams();\n $this->dialog->dialogTitle = $this->_gt('Edit file');\n $this->dialog->buttonTitle = 'Save';\n $this->dialog->inputFieldSize = 'large';\n }\n }", "public function set($filepath, $data);", "public function setContent($content) {\n\t\t$this->buffer['content'] = $content;\n\t}", "function set_file_options(&$form_state) {\n $files = node_import_list_files();\n $file = $files[$form_state['storage']['fid']];\n\n if (!isset($form_state['storage']['file_options'])) {\n $form_state['storage']['file_options'] = node_import_autodetect($file->filepath);\n }\n if (!isset($form_state['storage']['has_headers'])) {\n $form_state['storage']['has_headers'] = 1;\n }\n\n // If the user has chosen a predefined format, make sure\n // all options are correct.\n if ($form_state['storage']['file_options']['file_format'] != '') {\n $file_formats = node_import_format_options('file formats');\n $form_state['storage']['file_options'] = array_merge($form_state['storage']['file_options'], $file_formats[$form_state['storage']['file_options']['file_format']]);\n }\n\n\n if (!isset($form_state['storage']['samples']) and !isset($form_state['storage']['headers'])) {\n // Read some sample data with current settings.\n $samples = array();\n\n $i = variable_get('node_import:number_of_samples', 5);\n $num_cols = 0;\n $file_offset = 0;\n $data = array();\n while ($i > 0 && is_array($data)) {\n $i--;\n list($file_offset, $data) = node_import_read_from_file($file->filepath, $file_offset, $form_state['storage']['file_options']);\n if (is_array($data)) {\n $samples[] = $data;\n $num_cols = max($num_cols, count($data));\n }\n }\n if (!$form_state['storage']['has_headers']) {\n $header = array();\n while ($num_cols > 0) {\n $header[] = t('Column @number', array('@number' => $num_cols));\n $num_cols--;\n }\n $header = array_reverse($header);\n array_unshift($samples, $header);\n }\n $form_state['storage']['samples'] = $samples;\n $form_state['storage']['headers'] = $samples[0]; //TODO: what happens if no data?\n }\n}", "function setContent($c) {\n\t\t$this->set(\"content\",$c);\n\t}", "public function save()\n\t\t{\n#DS_Database_Archive::_log(__METHOD__.'()');\n\t\t\tif ( $this->_dirty ) {\n#DS_Database_Archive::_log(__METHOD__.'() data is dirty');\n\t\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t\tset_option( $this->option_name, $this->_options );\n\t\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t\t// save to filesystem\n#DS_Database_Archive::_log(__METHOD__.'() saving to file ' . $this->filename);\n\t\t\t\t\t$output = json_encode( $this->_options, JSON_PRETTY_PRINT );\n#DS_Database_Archive::_log(__METHOD__.'() contents: ' . $output);\n\t\t\t\t\tfile_put_contents( $this->filename, $output );\n\t\t\t\t}\n\t\t\t\t$this->_dirty = FALSE;\n\t\t\t}\n\t\t}", "public function setContent ($content) {\r\n\t\t$this->content = (string)$content;\r\n\t}", "public function setContent($value)\n {\n if (!array_key_exists('content', $this->fieldsModified)) {\n $this->fieldsModified['content'] = $this->data['fields']['content'];\n } elseif ($value === $this->fieldsModified['content']) {\n unset($this->fieldsModified['content']);\n }\n\n $this->data['fields']['content'] = $value;\n }", "public function content($content = false)\n {\n if ($content === false) {\n return $this->adapter->fileGetContents($this->path);\n }\n\n $this->adapter->filePutContents($this->path, $content);\n return $this;\n }", "function set_html( $source, $from_file = false )\n {\n $this->html = $source;\n\n if ( $from_file && file_exists($source) ) {\n $fp = fopen($source, 'r');\n $this->html = fread($fp, filesize($source));\n fclose($fp);\n }\n\n $this->_converted = false;\n }", "abstract protected function getOriginalContent();", "public final function setContent($content): FakeResponse\n {\n $this->original = $content;\n\n parent::setContent($content);\n\n return $this;\n }", "function add_to_file_contents($content) {\n\t\t$this->contents .= $content;\n\t}", "public function set_file( $file ) {\n\t\t$this->file = $file;\n\t\treturn $this;\n\t}", "public function setContent($content)\n {\n $this->original = $content;\n\n // If the content is \"JSONable\" we will set the appropriate header and convert the content to JSON, This is\n // useful when returning something like models from routes that will be automatically transformed to their\n // JSON form.\n if ($this->shouldBeJson($content)) {\n $this->header('Content-Type', 'application/json');\n\n $content = $this->morphToJson($content);\n }\n // If this content implements the \"Renderable\" interface then we will call the render method on the object so\n // we will avoid any \"__toString\" exceptions that might be thrown and have their errors obscured(使模糊,费解)\n // by PHP's handling.\n elseif ($content instanceof Renderable) {\n $content = $content->render();\n }\n\n parent::setContent($content);\n\n return $this;\n }", "public function display_option_debug_file() {\n $debug_file = $this->options['debug_file'];\n $this->display_input_text_field('debug_file', $debug_file);\n }", "public function setContent($content){\n $this->_content = $content;\n }", "private function set_end_options(): void {\n Simply_Static\\Options::instance()\n ->set('additional_files', Utils::array_to_option_string($this->files))\n ->set('additional_urls', Utils::array_to_option_string($this->urls))\n ->set('archive_end_time', Simply_Static\\Util::formatted_datetime())\n ->save();\n }", "public function getOriginalFile() {\n $file = $this->getPath() . DS . $this->getFile();\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimetype = finfo_file($finfo, $file);\n finfo_close($finfo);\n header(\"Content-Type: \". $mimetype);\n readfile($file);\n }", "public static function setContentDisposition($filename, $inline = null) {}", "public function setEditMode()\n {\n $this->validatorSchema['snapshot'] = new sfValidatorFile(array('required' => false));\n }", "private function set_start_options(): void {\n $files = has_filter(static::FILES_FILTER)\n ? apply_filters(static::FILES_FILTER, $this->files)\n : $this->resolve_additional_files($this->files);\n $urls = has_filter(static::URLS_FILTER)\n ? apply_filters(static::URLS_FILTER, $this->urls)\n : $this->enrich_additional_urls($this->urls);\n\n Simply_Static\\Options::instance()\n ->set('archive_status_messages', [])\n ->set('additional_files', Utils::array_to_option_string($files))\n ->set('additional_urls', Utils::array_to_option_string($urls))\n ->set('archive_start_time', Simply_Static\\Util::formatted_datetime())\n ->set('archive_end_time', '')\n ->save();\n }", "public function __construct()\n {\n $this->optionsFile = null;\n }", "public function setContent($content);", "public function setContent($content);", "public function setContent($content);", "public function setContent($content);", "public function setContent($content);", "public function setContent($content);", "public function setContent($content);", "public function setContent($content);", "public function setContent($content);", "public function setContent($content);", "public function getOriginalFile() {}", "public function getOriginalFile() {}", "public function setRawContent(mixed $content = null): void\n {\n $this->content = $content;\n }", "public function deleteOriginalFile()\n\t{\n\t\t$this->deleteFile = TRUE;\n\n\t\treturn $this;\n\t}", "public function setOutputFile($file);", "function XMLsetContent($data) {\n $this->contentBuffer = $data;\n $this->currentFile = '';\n }", "public function setTemplate($file);", "public function setFatContent($value)\n {\n $this->fatContent = $value;\n }", "public function setPath($file);", "public function file($options = []){\n\t\t// Set default attributes.\n\t\tHtml::setAttribute($options, [\n\t\t\t'id' => $this->name,\n\t\t\t'class' => $this->getDefaultClass('file')\n\t\t]);\n\t\t// On error, add error class if error classes are enabled.\n\t\tif($this->hasError && $this->errorClasses){\n\t\t\tHtml::addToAttribute($options, 'class', $this->getDefaultClass('error'));\n\t\t}\n\t\t// Create and store the element.\n\t\t$this->elements['control'] = Html::file(\n\t\t\t$this->name,\n\t\t\t$options\n\t\t);\n\t\t// Return object to method chain.\n\t\treturn $this;\n\t}", "public function setFileName($fileName);", "protected function configure($options = array(), $attributes = array())\n {\n parent::configure($options, $attributes);\n\n $this->setOption('type', 'hidden');\n $this->addOption('edit_mode', true);\n $this->addOption('no_file_label', '<span>No file selected.</span>');\n $this->addOption('set_label', 'Choose a file');\n $this->addOption('with_replace', true);\n $this->addOption('replace_label', 'Choose a different file');\n $this->addOption('with_delete', true);\n $this->addOption('delete_label', 'Remove file');\n $this->addOption('template', '%file%<br />%input% %replace% %delete%<br /><br />');\n }", "public function setFile($file)\n {\n $this->file = $file;\n $this->load();\n }", "public function setFileName($file);", "public function setFile($value)\n {\n return $this->set('File', $value);\n }", "public static function setKeepFile($keepFile) {}", "public function setOriginal($original) {\n $this->original = $original;\n }", "public function setOptions()\n\t{\n\t\tupdate_option($this->optionVar, serialize($this->options));\n\t}", "public function setParsedContentAttribute($value)\n {\n $this->attributes['content'] = $value;\n }", "function gttn_tpps_parse_file_helper($row, &$options) {\n $options['content'][] = $row;\n}", "public function beforeSave()\n {\n $fileService = $this->getCustomizationService();\n $fileService->prepareFile($this);\n $fileService->save($this);\n return parent::beforeSave();\n }", "public function setFile($file)\n\t{\n\t\t$this->file = $file;\n\t\t// check if we have an old image path\n\t\tif (isset($this->image)) {\n\t\t\t// store the old name to delete after the update\n\t\t\t$this->temp = $this->image;\n\t\t\t$this->image = null;\n\t\t} else {\n\t\t\t$this->image = 'initial';\n\t\t}\n\t}", "public function setContent(?string $value): void {\n $this->getBackingStore()->set('content', $value);\n }", "final public function setOptionHeader($option)\n {\n $this->options->header = $option;\n }", "function setContent($value)\n {\n $this->setAttribute(\"content\", $value);\n return $this;\n }", "public function setContent($content){\n //asign the content\n $this->contentObject = $content;\n\n //save to disk as serialized\n $json = json_encode($this->contentObject);\n if($this->exists()){\n file_put_contents($this->getPath(), $json);\n }\n\t}", "public function overwrite($value = true)\n\t{\n\t\t$this->handle->file_overwrite = $value;\n\t}", "function option($option)\n\t{\n\t\treturn $this->set($option, '', FALSE);\n\t}", "function update_file() {\r\n\t\tset_transient( 'av5_css_file', true );\r\n\t}" ]
[ "0.6163118", "0.55871147", "0.55731523", "0.55731523", "0.55731523", "0.55703807", "0.54570353", "0.54431283", "0.5424947", "0.54159117", "0.53822994", "0.52876747", "0.5266123", "0.5227722", "0.5216328", "0.5210762", "0.51641124", "0.5132846", "0.51287633", "0.5107732", "0.5071566", "0.5071566", "0.5071566", "0.5038553", "0.5024133", "0.50179154", "0.50163263", "0.5012054", "0.4993085", "0.4988324", "0.49815318", "0.49539244", "0.4931614", "0.49099776", "0.49088898", "0.48952323", "0.4857718", "0.48510835", "0.4850687", "0.48505792", "0.48339343", "0.48324403", "0.4814383", "0.47978035", "0.47969404", "0.47962722", "0.4791702", "0.47792873", "0.47761354", "0.4767869", "0.4764713", "0.47642085", "0.47597775", "0.47534004", "0.4751261", "0.47447157", "0.4736175", "0.4733963", "0.4729915", "0.4724243", "0.47194955", "0.47182673", "0.47182673", "0.47182673", "0.47182673", "0.47182673", "0.47182673", "0.47182673", "0.47182673", "0.47182673", "0.47182673", "0.46998593", "0.46998593", "0.46985856", "0.46962425", "0.46889326", "0.46886712", "0.46850312", "0.46802145", "0.46726078", "0.46671858", "0.46580166", "0.4651405", "0.46401647", "0.46398166", "0.463654", "0.46302927", "0.46234405", "0.46169174", "0.46129453", "0.46062878", "0.46047875", "0.45969492", "0.45939004", "0.4590324", "0.45840648", "0.45774004", "0.45712978", "0.45572808", "0.45564875" ]
0.4943334
32
returns an array of all lines in the address. key should represent line's number. If address line is not specified should return empty value for corresponding key i.e. must follow the contract count(IAddress::getAllLines()) == IAddress::getLinesCount() $array = Array( '1' => 'Line 1', '2' => 'Line 2', '3' => '', '4' => 'Line 4', '5' => '' )
public function getAllLines();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLines(): array {\n\t\treturn $this->_lines;\n\t}", "public function getLines(): array\n {\n return $this->lines;\n }", "public function getLines();", "public function getLines();", "public function getInvoiceLines($invoice_id)\n {\n return $this->remote->select()->from('invoiceentry')->where('invoiceid', '=', $invoice_id)->fetchAll();\n }", "protected function _getLines() {}", "public function getLines()\n {\n return isset($this->Lines) ? $this->Lines : null;\n }", "public function getLineItems(): array;", "protected function get_lines()\n {\n }", "public function recurlyAddress()\n {\n return [\n 'phone' => '+4912345678901',\n 'street1' => 'Eine Strasse 1',\n 'street2' => '',\n 'city' => 'Berlin',\n 'region' => 'Berlin',\n 'postal_code' => '13409',\n 'country' => 'DE',\n ];\n }", "public function get_as_array() {\n return $this->lines;\n }", "public function getHeaderLines()\n {\n $headers = [];\n foreach ($this->headers as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $v) {\n $headers[] = $key . ': ' . $v;\n }\n } else {\n $headers[] = $key . ': ' . $value;\n }\n }\n\n return $headers;\n }", "public function getFailedLines(): array;", "public function lines()\n {\n $array = preg_split('/[\\r\\n]{1,2}/u', $this->str);\n /** @noinspection CallableInLoopTerminationConditionInspection */\n for ($i = 0; $i < count($array); $i++) {\n $array[$i] = static::create($array[$i], $this->encoding);\n }\n\n return $array;\n }", "private function _getAddresses()\n\t {\n\t\t$hashes = [];\n\t\t$rows = $this->_db->exec(\"SELECT `city`, `address` FROM `addresses` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\twhile($row = $rows->getRow())\n\t\t {\n\t\t\t$address = $row[\"city\"] . \", \" . $row[\"address\"];\n\t\t\t$sliced = new AddressSlicer($address);\n\n\t\t\tif ($sliced->valid() === true && isset($hashes[$sliced->hash]) === false)\n\t\t\t {\n\t\t\t\t$hashes[$sliced->hash] = $address;\n\t\t\t } //end if\n\n\t\t } //end while\n\n\t\treturn count($hashes);\n\t }", "public function getOrderlines($checkoutType)\n {\n return $this->getConfig(sprintf('order_lines/%s', $checkoutType));\n }", "public function getBodyLines() : array\n {\n return $this->lineCount < 3 ? [] : array_slice($this->lines, 2);\n }", "public function computeNodesAtLineMap(): array\n {\n $result = [];\n $file_position_map = new FilePositionMap($this->contents);\n foreach ($this->getAST()->getDescendantNodes() as $node) {\n $line_for_node = $file_position_map->getStartLine($node);\n $result[$line_for_node][] = $node;\n }\n return $result;\n }", "public function lines($no)\n {\n $handle = $this->getHandle($no);\n\n $handles = $this->client\n ->Quotation_GetLines([\n 'quotationHandle' => $handle\n ])\n ->Quotation_GetLinesResult;\n\n return $this->client\n ->QuotationLine_GetDataArray([\n 'entityHandles' => $handles\n ])\n ->QuotationLine_GetDataArrayResult\n ->QuotationLineData;\n }", "public function orderLines()\n {\n return $this->hasMany('App\\OrderLine', 'order_id', 'id');\n }", "public function lines()\n {\n return $this->hasMany(InvoiceLine::class);\n }", "private function parseLine() {\n $hash = array();\n $line = explode(':', fgets($this->handle));\n $key = array_shift($line);\n\n $hash[$key] = trim(implode(\":\", $line));\n \n return $hash;\n }", "public function getLine(): array\n {\n \\Logger::getLogger(\\get_class($this))\n ->info(\n \\sprintf(\n __METHOD__.\" get stack with '%s' elements\",\n \\count($this->line)\n )\n );\n return $this->line;\n }", "public function getLineNameArray() {\n return $this->line_name;\n }", "public function getLinesToArray($multilines){\n $arrayTmp = array();\n $array = array();\n \n $arrayTmp = explode(\"\\n\", $multilines);\n foreach($array AS $item){\n $array[] = ereg_replace(\"[[:cntrl:]]\", \"\", $item);\n }\n return $array;\n }", "public function getLineItems()\n {\n if (is_null($this->lineItems)) {\n /** @psalm-var ?list<stdClass> $data */\n $data = $this->raw(self::FIELD_LINE_ITEMS);\n if (is_null($data)) {\n return null;\n }\n $this->lineItems = LineItemDraftCollection::fromArray($data);\n }\n\n return $this->lineItems;\n }", "private function read_lines()\n {\n return $array = file($this->filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n }", "function getLines($string, $allow_empty = false)\n{\n $string = trim($string);\n $string = str_replace([\"\\r\\n\",PHP_EOL,\"<br>\",\"<br />\",\";\"], \"\\r\\n\", $string);\n\n if (!$string)\n {\n return [];\n }\n\n $string = explode(\"\\r\\n\", $string);\n foreach ($string as $i => $line)\n {\n $string[$i] = trim($line);\n if (!$allow_empty && empty($string[$i]))\n {\n unset($string[$i]);\n }\n }\n\n return $string;\n}", "public function readerGetLines();", "protected function getLines(string $content): array\n {\n if (!empty($content) && strlen($content) > $this->getLineLength() && strpos($content, \"\\n\") === false) {\n $content = chunk_split($content, $this->getLineLength(), \"\\n\");\n }\n $lines = explode(\"\\n\", $content);\n\n // Remove last empty line if exists.\n $lines = array_filter($lines, function ($line) {\n return '' !== $line;\n });\n\n return $lines;\n }", "public static function all(): array {\n $lines = [];\n foreach (Datasets::load('lines') as $line) {\n $lines[$line['name']] = $line;\n }\n\n return $lines;\n }", "public function getLineItems();", "public function getLineItems();", "public function getLineItems(): ?array\n {\n return $this->lineItems;\n }", "public function toArray()\n {\n return array(\n 'line1' => $this->getLine1(),\n 'city' => $this->getCity(),\n 'country' => $this->getCountry(),\n 'line2' => $this->getLine2(),\n 'postal_code' => $this->getPostalCode(),\n 'state' => $this->getState()\n );\n }", "public function getRowData()\n {\n while(1)\n {\n if ($this->_file !== null)\n {\n if (feof($this->_file))\n {\n return false;\n }\n\n if (!$line = fgets($this->_file, $this->_maxLineLength))\n {\n return false;\n }\n }\n else\n {\n if (empty($this->_lines))\n {\n return false;\n }\n\n $line = array_shift($this->_lines);\n }\n\n if (preg_match('/\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.'\n . '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]'\n . '|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b/', $line, $matches))\n {\n $row = @geoip_record_by_name(trim($matches[0]));\n if ($row && !empty($row['country_code']))\n {\n return array(\n $row['country_code'],\n !empty($row['region']) ? $row['region'] : null,\n 1\n );\n }\n }\n }\n }", "protected function getTransactionLines(string $text): ?array\n {\n $amountLine = [];\n $pcre = '/(?:^|\\r\\n)\\:(?:61)\\:(.+)(?::?$|\\r\\n\\:[[:alnum:]]{2,3}\\:)/Us';\n\n if (preg_match_all($pcre, $text, $match)) {\n $amountLine = $match;\n }\n\n $multiPurposeField = [];\n $pcre = '/(?:^|\\r\\n)\\:(?:86)\\:(.+)(?:[\\r\\n])(?:\\:(?:6[0-9]{1}[a-zA-Z]?)\\:|(?:[\\r\\n]-$))/Us';\n\n if (preg_match_all($pcre, $text, $match)) {\n $multiPurposeField = $match;\n }\n\n $result = [];\n if (count($amountLine) === 0 && count($multiPurposeField) === 0) {\n return $result;\n }\n if ($amountLine[1] === null) {\n return $result;\n }\n\n $count = count($amountLine[1]);\n for ($i = 0; $i < $count; $i++) {\n $result[$i][] = trim($amountLine[1][$i]);\n $result[$i][] = trim(str_replace(':86:', '', $multiPurposeField[1][$i]));\n }\n\n return $result;\n }", "private function getAddressArray(\\Magento\\Quote\\Api\\Data\\AddressInterface $address)\n {\n $flatAddressArray = $this->extensibleDataObjectConverter->toFlatArray(\n $address,\n [],\n \\Magento\\Quote\\Api\\Data\\AddressInterface::class\n );\n $street = $address->getStreet();\n if (!empty($street) && is_array($street)) {\n // Unset flat street data\n $streetKeys = array_keys($street);\n foreach ($streetKeys as $key) {\n if (is_array($flatAddressArray)) {\n unset($flatAddressArray[$key]);\n }\n }\n //Restore street as an array\n $flatAddressArray['street'] = $street;\n }\n return $flatAddressArray;\n }", "public function getLinesTemplate(int $start, int $end, array $arrayLinesTemplate): array\n {\n\n $lines = [];\n\n for ($i = $start; $i <= $end; $i++) {\n $lines[$i] = $arrayLinesTemplate[$i];\n }\n\n return $lines;\n\n }", "function get_post_meta_lines( int $post_id, string $key ): array {\n\t\treturn \\wpinc\\meta\\get_post_meta_lines( $post_id, $key );\n\t}", "public static function explode_lines($value) {\n $structure = str_replace(\"\\r\\n\", \"\\n\", $value);\n $structure = str_replace(\"\\r\", \"\\n\", $structure);\n return explode(\"\\n\", trim($structure));\n }", "public function getLine($lineId);", "public function getHeaderLines()\n {\n return $this->wrapped->getHeaderLines();\n }", "public function readLines();", "public function getTextLines();", "function read_lines(){\n $filesize = filesize($this->filename);\n if($filesize > 0) {\n $handle = fopen($this->filename, \"r\");\n $contents = fread($handle, $filesize);\n fclose($handle);\n\n return explode(\"\\n\", $contents);\n }\n else\n {\n return array();\n }\n\n }", "public function getHeaderLines($header)\n {\n $lines = [];\n foreach ($this->headers as $name => $headers) {\n if (strtolower($name) == strtolower($header)) {\n $lines = array_merge($lines, $headers);\n }\n }\n return $lines;\n }", "public function readAddressBook()\n {\n $addresses = [];\n // read each line of CSV and add rows to addresses array\n // todo\n $handle = fopen($this->filename, \"r\");\n while (!feof($handle)) \n {\n \t$row = fgetcsv($handle);\n \tif (is_array($row)) \n {\n \t\t$addresses[] = $row; // array_push($addresses, $row);\n \t}\n }\n fclose($handle);\n return $addresses;\n }", "public function returnLines($start_date,$end_date){\n\t\t$mcoData = new Application_Model_DbTable_McoData();\n\t\t$select = $mcoData->select()->setIntegrityCheck(false);\n\t\t$select ->from(array(\"mc\" => \"mco_data\"),array('DISTINCT(line),mco'))\n\t\t\t\t\t->where('start_date >= ?', Application_Model_General::dateToUs($start_date))\n\t\t\t\t\t->where('start_date <= ?', Application_Model_General::dateToUs($end_date))\n\t\t\t\t\t->where('status=1');\n\treturn $mcoData->fetchAll($select);\n\t}", "public function getLines($children = false) {\n\t\tforeach ($this->session->data['lines'] as $key => $quantity) {\n\t\t\t$optionData = array();\n\n\t\t\t$sessionProduct = unserialize(base64_decode($key));\n\n\t\t\t$this->data[$key] = array_merge($sessionProduct, array('key' => $key, 'quantity' => $quantity));\n\t\t}\n\t\t\n\t\treturn $this->data;\n\t}", "abstract protected function getIgnoredLines(): array;", "public static function getAddressLine(Address $address)\n {\n $addressLine = '';\n foreach (static::getAddressLineFields($address->id_country) as $field) {\n if ($field && !empty($address->{$field})) {\n $addressLine .= ' '.$address->{$field};\n }\n }\n\n return trim($addressLine);\n }", "private function get_lines() {\n\t $data = \"\";\n\t while($str = @fgets($this->smtp_conn,515)) {\n\t if($this->do_debug >= 4) {\n\t echo \"SMTP -> get_lines(): \\$data was \\\"$data\\\"\" . $this->CRLF . '<br />';\n\t echo \"SMTP -> get_lines(): \\$str is \\\"$str\\\"\" . $this->CRLF . '<br />';\n\t }\n\t $data .= $str;\n\t if($this->do_debug >= 4) {\n\t echo \"SMTP -> get_lines(): \\$data is \\\"$data\\\"\" . $this->CRLF . '<br />';\n\t }\n\t // if 4th character is a space, we are done reading, break the loop\n\t if(substr($str,3,1) == \" \") { break; }\n\t }\n\t return $data;\n\t}", "public function getAllLines(){\n $lines = $this->stationService->getAllLines();\n return response()->json([\"status\"=>\"success\" , \"data\"=>$lines]);\n }", "private function getAddresses()\n\t{\n\t\t\n\t\t$userID = $this->session->userID;\n\t\t$addresses = $this->dbConnection->prepareRecordSet(\"SELECT * FROM b_user_address WHERE user_id = ? AND record_status = 'A'\", $userID);\n\n\t\treturn $addresses;\n\t\t\n\t}", "public function getNonEOLChips(): array {\n $stmt = $this->pdo->query(str_replace('%TABLENAME%', $this->table, self::QUERIES['getNonEOLChips']));\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getHeaderLines(string $name): array {\n $key = strtolower($name);\n $result = isset($this->headers[$key]) ? $this->headers[$key] : [];\n return $result;\n }", "public static function sourceAsLines(string $path): array\n {\n $lines = explode(PHP_EOL, file_get_contents($path));\n\n return self::removeEmptyTrainingLines($lines);\n }", "public function orderLineItems() {\n return $this->hasMany('OrderLineItem', 'order_id');\n }", "public function getAddresses(){\n\t\t/* DIRECCIONES */\n\t\tglobal $dbh;\n\t\t$data = $dbh->query(\"SELECT * FROM direccion WHERE idCliente=?;\",array($this->id));\n\t\tif( $data!==false ){\n\t\t\tforeach( $data as $k=>$v ){\n\t\t\t\t$zona = $v['idZona'];\n\t\t\t\t$tmp = $dbh->query(\"SELECT c.nombre as comuna, p.nombre as ciudad, r.nombre as region FROM zona c LEFT JOIN zona p ON c.padre=p.id LEFT JOIN zona r ON p.padre=r.id WHERE c.id=?;\",array($zona));\n\t\t\t\t$data[$k] = array_merge($data[$k],$tmp[0]);\n\t\t\t}\n\t\t\t$this->data['direcciones'] = $data;\n\t\t\treturn $data;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function correctCsvLineProvider(): array\n {\n return [\n 'line with default value' => [\n [\n Config::FIELD_PATH,\n Config::FIELD_SCOPE,\n Config::FIELD_STATE,\n Config::FIELD_VALUE\n ],\n [\n 'value1',\n 'value2',\n 'value3',\n 'value4'\n ],\n [\n Config::FIELD_PATH => 'value1',\n Config::FIELD_SCOPE => 'value2',\n Config::FIELD_STATE => 'value3',\n Config::FIELD_VALUE => 'value4'\n ],\n Config::FIELD_VALUE,\n null\n ],\n 'line with env value' => [\n [\n Config::FIELD_PATH,\n Config::FIELD_SCOPE,\n Config::FIELD_STATE,\n Config::FIELD_VALUE,\n Config::FIELD_ENV_VALUE_PREFIX . 'env1'\n ],\n [\n 'value1',\n 'value2',\n 'value3',\n 'value4',\n 'value5',\n ],\n [\n Config::FIELD_PATH => 'value1',\n Config::FIELD_SCOPE => 'value2',\n Config::FIELD_STATE => 'value3',\n Config::FIELD_VALUE => 'value4',\n Config::FIELD_ENV_VALUE_PREFIX . 'env1' => 'value5'\n ],\n Config::FIELD_ENV_VALUE_PREFIX . 'env1',\n 'env1'\n ]\n ];\n }", "public function getTaxLines() {\n return $this->getParameter('tax_lines');\n }", "private function lineData($line)\n {\n // replace tab\n $lineStr = str_replace(\"\\t\", \"*****\", $line);\n // explode string to array\n $lineData = explode('*****', $lineStr);\n\n // $data = [\n // 0 => \"460\", // mcc 所有的都是460,表示中国\n // 1 => \"0\", // mnc 0表示移动基站,1表示联通基站,\n // // 11表示电信LTE基站10000-20000表示电信CDMA基站,此时此字段的取值并非MNC,实际为电信SID\n // 2 => \"33061\", // lac 电信为nid\n // 3 => \"13256\", // cell id 电信为bid\n // 4 => \"30.573833\", // lat\n // 5 => \"104.292610\", // lon\n // 6 => \"175\", // acc 覆盖范围米\n // 7 => \"20171030\", // date\n // 8 => \"0.66\", // 精度 (正常无此字段)\n // 9 => \"四川省成都市龙泉驿区龙泉街道百工堰村;枇杷沟路与公园路路口南812米\", // addr\n // 10 => \"四川省\", // province\n // 11 => \"成都市\", // city\n // 12 => \"龙泉驿区\", // district\n // 13 => \"龙泉街道\", // township\n // ];\n\n // remove index of 8 if count is 14, sometimes this field is not exists\n if (count($lineData) == 14) {\n unset($lineData[8]);\n }\n\n return array_values($lineData);\n }", "public function getAddresses()\n {\n return $this->addresses;\n }", "public function getAddresses()\n {\n return $this->addresses;\n }", "public function getOrderLineChildList(): ?\\SengentoBV\\CdiscountMarketplaceSdk\\Arrays\\CdiscountArrayOfOrderLine\n {\n return isset($this->OrderLineChildList) ? $this->OrderLineChildList : null;\n }", "public function getOrderLines($options=[]): array{\n return $this->getRelatedEntities(\"OrderLine\", $options);\n }", "public function getAddresses(string $name): array;", "private function returnMappedValue($line) {\n\t//--\n\t$array = array();\n\t$key = $this->unquote(trim(substr($line, 0, -1)));\n\t$array[$key] = '';\n\t//--\n\treturn $array;\n\t//--\n}", "function findAddress($lines) {\n //Finds address by searching for finding line with a zipcode, and then concatenating the previous line with that line. This is prone to errors, however, and is only used as an example for showing how the script would work. A better method would involve leveraging existing APIs, such as Google's GeoCoding API.\n for($i = 0; $i<count($lines); $i++) {\n if(preg_match('/[0-9]{5}/', $lines[$i])) {\n return [$lines[$i-2], $lines[$i]];\n }\n }\n return \"\";\n}", "private function getTestAddresses()\n {\n return [\n [\n 'source' => [\n 'address1' => '877 S Figueroa St',\n 'city' => 'Los Angeles',\n 'country' => 'US',\n 'state_province' => 'CA',\n 'postal_code' => '90017',\n ],\n 'expected' => [\n 'text' => (\n '877 S Figueroa St' . \"\\n\" .\n 'Los Angeles, %administrative% 90017' . \"\\n\" .\n '%country%'\n ),\n 'html' => (\n '<span class=\"address-line1\">877 S Figueroa St</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"locality\">Los Angeles</span>, ' .\n '<span class=\"administrative-area\">%administrative%</span> ' .\n '<span class=\"postal-code\">90017</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"country\">%country%</span>'\n ),\n ],\n ],\n [\n 'source' => [\n 'address1' => '30 Rockefeller Plaza',\n 'address2' => 'NBC Studio 6A',\n 'city' => 'New York',\n 'country' => 'US',\n 'state_province' => 'NY',\n 'postal_code' => '10111',\n ],\n 'expected' => [\n 'text' => (\n '30 Rockefeller Plaza' . \"\\n\" .\n 'NBC Studio 6A' . \"\\n\" .\n 'New York, %administrative% 10111' . \"\\n\" .\n '%country%'\n ),\n 'html' => (\n '<span class=\"address-line1\">30 Rockefeller Plaza</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"address-line2\">NBC Studio 6A</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"locality\">New York</span>, ' .\n '<span class=\"administrative-area\">%administrative%</span> ' .\n '<span class=\"postal-code\">10111</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"country\">%country%</span>'\n ),\n ],\n ],\n [\n 'source' => [\n 'address1' => '1321 Commerce St',\n 'address2' => '#APT 123',\n 'address3' => 'Mr. Smith',\n 'city' => 'Dallas',\n 'country' => 'US',\n 'state_province' => 'TX',\n 'postal_code' => '75202',\n ],\n 'expected' => [\n 'text' => (\n '1321 Commerce St' . \"\\n\" .\n '#APT 123, Mr. Smith' . \"\\n\" .\n 'Dallas, %administrative% 75202' . \"\\n\" .\n '%country%'\n ),\n 'html' => (\n '<span class=\"address-line1\">1321 Commerce St</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"address-line2\">#APT 123, Mr. Smith</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"locality\">Dallas</span>, ' .\n '<span class=\"administrative-area\">%administrative%</span> ' .\n '<span class=\"postal-code\">75202</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"country\">%country%</span>'\n ),\n ],\n ],\n [\n 'source' => [\n 'address1' => 'Veneentekijäntie 4 A',\n 'city' => 'Helsinki',\n 'country' => 'FI',\n 'postal_code' => '00210',\n ],\n 'expected' => [\n 'text' => (\n 'Veneentekijäntie 4 A' . \"\\n\" .\n '00210 Helsinki' . \"\\n\" .\n '%country%'\n ),\n 'html' => (\n '<span class=\"address-line1\">Veneentekijäntie 4 A</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"postal-code\">00210</span> ' .\n '<span class=\"locality\">Helsinki</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"country\">%country%</span>'\n ),\n ],\n ],\n [\n 'source' => [\n 'address1' => 'Kungsgatan 44',\n 'city' => 'Stockholm',\n 'country' => 'SE',\n 'postal_code' => '111 35',\n ],\n 'expected' => [\n 'text' => (\n 'Kungsgatan 44' . \"\\n\" .\n '111 35 Stockholm' . \"\\n\" .\n '%country%'\n ),\n 'html' => (\n '<span class=\"address-line1\">Kungsgatan 44</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"postal-code\">111 35</span> ' .\n '<span class=\"locality\">Stockholm</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"country\">%country%</span>'\n ),\n ],\n ],\n [\n 'source' => [\n 'address1' => 'Plaza de España, 1',\n 'city' => 'Mostoles',\n 'country' => 'ES',\n 'state_province' => 'Madrid',\n 'postal_code' => '28934',\n ],\n 'expected' => [\n 'text' => (\n 'Plaza de España, 1' . \"\\n\" .\n '28934 Mostoles %administrative%' . \"\\n\" .\n '%country%'\n ),\n 'html' => (\n '<span class=\"address-line1\">Plaza de España, 1</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"postal-code\">28934</span> ' .\n '<span class=\"locality\">Mostoles</span> ' .\n '<span class=\"administrative-area\">%administrative%</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"country\">%country%</span>'\n ),\n ],\n ],\n [\n 'source' => [\n 'address1' => 'Леонтьевская ул., 28',\n 'city' => 'Пушкин',\n 'country' => 'RU',\n 'state_province' => 'Санкт-Петербург',\n 'postal_code' => '196601',\n ],\n 'expected' => [\n 'text' => (\n 'Леонтьевская ул., 28' . \"\\n\" .\n 'Пушкин' . \"\\n\" .\n '%administrative%' . \"\\n\" .\n '196601' . \"\\n\" .\n '%country%'\n ),\n 'html' => (\n '<span class=\"address-line1\">Леонтьевская ул., 28</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"locality\">Пушкин</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"administrative-area\">%administrative%</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"postal-code\">196601</span>' .\n '<br>' . \"\\n\" .\n '<span class=\"country\">%country%</span>'\n ),\n ],\n ],\n ];\n }", "public function getAddressLine1(): ?string;", "function file_to_lines(string $file)\n{\n $result = array();\n if (file_exists($file)) {\n return explode(\"\\n\", file_get_contents($file));\n }\n return $result;\n}", "private function splitLine(string $line): array\n {\n $chunks = array_map('trim', explode(';', $line));\n if (in_array(count($chunks), [self::BILL_FIELD_COUNT_WITHOUT_REQUISITE, self::BILL_FIELD_COUNT_WITH_REQUISITE], true)) {\n return $chunks;\n }\n\n throw new InvalidValueException('Line \"' . $line . '\" is malformed');\n }", "public function getLineInfo() {\n return $this->get(self::LINE_INFO);\n }", "public function getOrderLineItems($orderID)\n {\n \n }", "public function getLineMatrix() {}", "public function get_addresses() {\n\t\treturn $this->addresses;\n\t}", "public function getLine_numbers()\n\t{\n\t\treturn $this->getParser()->line_numbers;\n\t}", "public function lines2Array($content) {\t\t\n\t\ttry {\n\t\t\t$content = str_replace(\"\\r\\n\", \"\\n\", $content);\n\t\t\t$content = str_replace(\"\\r\", \"\\n\", $content);\n\t\t\t$content = explode(\"\\n\", $content); // turn string to array\n\t\t\tarray_pop($content); // remove last element since it is empty\n\t\t\treturn $content;\n\t\t} catch (Exception $e) { \n\t\t\tthrow new Exception($e->getMessage().' from '.$this->className.'->'.\n\t\t\t\t__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} //<-- end try -->\n\t}", "public static function computeLineOffsetMap(string $contents): array\n {\n // start of line 1 is the 0th byte\n $offsets = [0, 0];\n $offset = 0;\n while (($next = \\strpos($contents, \"\\n\", $offset)) !== false) {\n $offset = $next + 1;\n $offsets[] = $offset;\n }\n $offsets[] = \\strlen($contents);\n return $offsets;\n }", "public static function infoConnectorsLine($lineId)\n\t{\n\t\t$cache = Cache::createInstance();\n\t\t$result = array();\n\n\t\tif ($cache->initCache(Library::CACHE_TIME_INFO_CONNECTORS_LINE, $lineId, Library::CACHE_DIR_INFO_CONNECTORS_LINE))\n\t\t{\n\t\t\t$result = $cache->getVars();\n\t\t}\n\t\telseif($cache->startDataCache())\n\t\t{\n\t\t\t$infoConnectors = self::getInfoConnectorsById($lineId);\n\n\t\t\tif ($infoConnectors->getSelectedRowsCount() == 0)\n\t\t\t{\n\t\t\t\t$cache->abortDataCache();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $infoConnectors->fetch();\n\t\t\t\t$cache->endDataCache($result);\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function getLines()\n\t{\n\t\t//echo 'font file = ' . $this->calculateFontFile() . ' ' . $this->textFont . '<br>';\n\t\tif(isset($this->lines) && $this->width == $this->lines[\"width\"] && $this->textSize == $this->lines[\"textSize\"])\n\t\t{\n\t\t\treturn $this->lines;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$rawPars = explode(\"\\r\\n\", $this->contents);\n\t\t\t\n\t\t\t//\tgo through each paragraph and find the line breaks\n\t\t\t//\t\twhen we're done we should have an array processed\n\t\t\t//\t\tparagraphs. Each paragraph should be an array of \n\t\t\t//\t\tlines.\n\t\t\t//echo \"the font it is selecting \" . $this->calculateFontFile() . '<br>';\n\t\t\t$this->pdf->selectFont($this->calculateFontFile());\n\t\t\t$lines = array();\n\t\t\t$lines2 = array();\n\t\t\t$lines[\"longest\"] = 0;\n\t\t\t$lines[\"width\"] = $this->width;\n\t\t\t$lines[\"textSize\"] = $this->textSize;\n\t\t\tif(strlen($this->contents) == 1)\n\t\t\t{\n\t\t\t\t$lines[\"longest\"] = $this->pdf->getTextWidth($this->textSize, $this->contents);\n\t\t\t\t$lines[\"length\"][] = $lines[\"longest\"];\n\t\t\t\t$lines[\"text\"][] = $this->contents;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile( list($parNum, $thisPar) = each($rawPars) )\n\t\t\t\t{\n\t\t\t\t\t//\tinit your data\n\n\t\t\t\t\t$len = strlen($thisPar);\n\t\t\t\t\t$last = $len - 1;\n\t\t\t\t\t$lastEnd = -1;\n\t\t\t\t\t$curStart = 0;\n\t\t\t\t\t$curLen = 0;\n\n\t\t\t\t\tif( strlen($thisPar) == 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$lines[\"text\"][] = \"\";\n\t\t\t\t\t\t$lines[\"length\"][] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor($i = 1; $i < $len; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//\tif we are at a breaking point.\n\t\t\t\t\t\t//\t\ta breaking point is either\n\t\t\t\t\t\t//\t\t\ta real char before a space or\n\t\t\t\t\t\t//\t\t\tthe last char in the string\n\n\t\t\t\t\t\tif( (($thisPar[$i] == \" \") && ($thisPar[$i - 1] != \" \")) || ($i == $last) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word = substr($thisPar, $lastEnd + 1, ($i) - $lastEnd);\n\n\t\t\t\t\t\t\t$wordLen = ($this->pdf->getTextWidth($this->textSize, $word));\n\n\t\t\t\t\t\t\t//\tdid we find a line break yet\n\n\t\t\t\t\t\t\tif($i == $last)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( $curLen + $wordLen > $this->width )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $lastEnd - $curStart + 1);\n\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen;\n\t\t\t\t\t\t\t\t\tif($curLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $lastEnd + 1, $i - $lastEnd);\n\t\t\t\t\t\t\t\t\t$word = trim($word);\n\t\t\t\t\t\t\t\t\t$this->pdf->getTextWidth($this->textSize, $word);\n\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $wordLen;\n\t\t\t\t\t\t\t\t\tif($wordLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $wordLen;\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\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $i - $curStart + 1);\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen + $wordLen;\n\t\t\t\t\t\t\t\t\tif($curLen + $wordLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen + $wordLen;\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 if( $curLen + $wordLen > $this->width )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $lastEnd - $curStart + 1);\n\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen;\n\t\t\t\t\t\t\t\tif($curLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen;\n\n\t\t\t\t\t\t\t\t$curLen = $wordLen;\n\t\t\t\t\t\t\t\t$curStart = $lastEnd + 1;\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$curLen += $wordLen;\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t$lastEnd = $i;\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\t$this->lines = $lines;\n\t\t\t//$this->pdf->selectFont(ZOOP_DIR . \"/pdf/fonts/Helvetica-Bold.afm\");\n\t\t\t//echo_r($lines);\n\t\t\t//echo 'font = ' . $this->textFont . ' bold = ' . ($this->bold ? 1 : 0) . ' italics = ' . ($this->italics ? 1 : 0) . ' size = ' . $this->textSize . ' ' . $this->bold . ' ' . $this->bold . '<br>';\n\t\t\t//echo 'true length = ' . $this->pdf->getTextWidth($this->textSize, 'asdfkla sdfklasdfjlkas;dfgj aslkfj alkw[sfjeoifjsa fi;awesfil;ifas efjilse;filaws eji iiiiiiiiiiiiiii') . '<br>';\n\t\t\treturn $this->lines;\n\t\t}\n\t}", "function getLineItems($serviceID) {\n\t\t$results = \"\";\n\t\t$sql = \"SELECT * FROM LineItem WHERE ServiceID = '$serviceID'\";\n\n\t\t$results = queryDB($sql);\n\n\t\treturn $results;\n\t}", "private function _setNewLineIds()\n {\n $this->_newLineIds = [];\n\n foreach ($this->get('structure') as $line) {\n if ($line['id'] === 0) {\n continue;\n }\n\n $this->_newLineIds[] = $line['id'];\n }\n\n return $this;\n }", "public function incorrectCsvLineProvider(): array\n {\n return [\n 'default value does not exist' => [\n [\n Config::FIELD_PATH,\n Config::FIELD_STATE\n ],\n [\n 'value1',\n 'value2'\n ],\n null\n ],\n 'env value does not exist' => [\n [\n Config::FIELD_PATH,\n Config::FIELD_STATE,\n Config::FIELD_VALUE\n ],\n [\n 'value1',\n 'value2',\n 'value3'\n ],\n 'env1'\n ]\n ];\n }", "public function getAllServices($line)\n {\n $this->checkLine($line);\n\n return [];\n }", "function get_all_covered_lines($id=null)\n {\n $this->db->order_by('id', 'desc');\n if ($id == null)\n return $this->db->get('covered_lines')->result_array();\n else\n return $this->db->get_where('covered_lines', array('fk_file_id'=>$id))->result_array();\n }", "public function getAddressStringMultiLine()\n {\n $params = $this->createFormatAddressParams();\n $retVal = StringUtils::formatAddressMultiLine($params);\n\n return $retVal;\n }", "public function getAddresses() {\n $table = new Yourdelivery_Model_DbTable_Locations();\n return $table->fetchAll('companyId = ' . $this->getId());\n }", "public static function data_addresses() {\n\n\t\t$data = array(\n\t\t\tarray(\n\t\t\t\t'address' => '1175 Stony Park Witch Hazel, Nebraska 69258-4226',\n\t\t\t\t'phone' => '(308) 588-6126',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2854 Burning Pine Route Dog Corner, New Mexico 87313-2329',\n\t\t\t\t'phone' => '(505) 665-5353',\n\t\t\t\t'lat' => '35.76488',\n\t\t\t\t'lng' => '-108.1903059',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4644 Broad Pond Edge Brown Shanty, Colorado 81686-3084',\n\t\t\t\t'phone' => '(303) 410-6031',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8711 Fallen By-pass Free, Arkansas 72968-5919',\n\t\t\t\t'phone' => '(479) 272-1089',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4987 Merry Fox Falls Speedsville, New Mexico 87609-9834',\n\t\t\t\t'phone' => '(505) 523-5318',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4338 Easy Lagoon Mews Finland, North Dakota 58905-5049',\n\t\t\t\t'phone' => '(701) 474-6073',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9041 Cinder View Trace Deloraine, Michigan 48363-3520',\n\t\t\t\t'phone' => '(313) 089-6913',\n\t\t\t\t'lat' => '42.7664746',\n\t\t\t\t'lng' => '-83.1541796',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6613 Golden Corner Polecat Bay, South Carolina 29248-0849',\n\t\t\t\t'phone' => '(843) 922-1045',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '305 Jagged Grounds Estiffanulga, Minnesota 55180-3195',\n\t\t\t\t'phone' => '(320) 498-0046',\n\t\t\t\t'lat' => '46.729553',\n\t\t\t\t'lng' => '-94.6858998',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6860 Crystal Ridge Possum Trot, Tennessee 37454-4951',\n\t\t\t\t'phone' => '(931) 573-5387',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3551 Pleasant Point Glen Raven, District of Columbia 20054-8428',\n\t\t\t\t'phone' => '(202) 389-4349',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7199 Sunny Nook Paydown, Maine 04353-6633',\n\t\t\t\t'phone' => '(207) 674-4096',\n\t\t\t\t'lat' => '44.2238966',\n\t\t\t\t'lng' => '-69.6199357',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2743 Thunder Port Chestermere, Missouri 63937-5966',\n\t\t\t\t'phone' => '(417) 123-9433',\n\t\t\t\t'lat' => '36.9301095',\n\t\t\t\t'lng' => '-90.7722974',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3760 Silver Prairie Townline Tiger Tail, Utah 84609-2369',\n\t\t\t\t'phone' => '(435) 290-2684',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2546 Clear Bear Range Tunnel Hill, Wyoming 83067-1217',\n\t\t\t\t'phone' => '(307) 236-9552',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2758 Cotton Campus Swindleville, Oklahoma 73758-8899',\n\t\t\t\t'phone' => '(580) 622-1215',\n\t\t\t\t'lat' => '36.9587896',\n\t\t\t\t'lng' => '-98.068343',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9000 Indian Embers Trail Little Water, North Dakota 58269-0906',\n\t\t\t\t'phone' => '(701) 719-4564',\n\t\t\t\t'lat' => '48.6914843',\n\t\t\t\t'lng' => '-98.165204',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '544 Noble Mountain Dell Ste. Rose du Lac, Nevada 88962-4758',\n\t\t\t\t'phone' => '(775) 731-8736',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6074 Emerald Gate Passage Waggy, Louisiana 70677-4881',\n\t\t\t\t'phone' => '(225) 476-0583',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9159 Hazy Zephyr Moor Gravesend, Vermont 05333-5210',\n\t\t\t\t'phone' => '(802) 410-3565',\n\t\t\t\t'lat' => '44.5588028',\n\t\t\t\t'lng' => '-72.5778415',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9919 Green Wagon Impasse Manifest, Hawaii 96717-8463',\n\t\t\t\t'phone' => '(808) 083-9986',\n\t\t\t\t'lat' => '21.5707975',\n\t\t\t\t'lng' => '-157.8927472',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1355 Blue Cove Scooba, Maine 04243-6502',\n\t\t\t\t'phone' => '(207) 298-7328',\n\t\t\t\t'lat' => '44.1',\n\t\t\t\t'lng' => '-70.22',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6356 Sleepy Chase Zipperlandville, Illinois 61835-9234',\n\t\t\t\t'phone' => '(815) 108-7735',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2531 Rustic Anchor Acres Hungry Hill, Maryland 20768-4906',\n\t\t\t\t'phone' => '(240) 370-9692',\n\t\t\t\t'lat' => '39',\n\t\t\t\t'lng' => '-76.88',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9957 Gentle Arbor Irricana, Delaware 19897-5853',\n\t\t\t\t'phone' => '(302) 440-8338',\n\t\t\t\t'lat' => '39.7856696',\n\t\t\t\t'lng' => '-75.5461494',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3187 High Promenade Fairdealing, Nebraska 69508-1675',\n\t\t\t\t'phone' => '(531) 725-6138',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6337 Amber Bend Funny River, Illinois 62817-4327',\n\t\t\t\t'phone' => '(217) 557-9408',\n\t\t\t\t'lat' => '37.9788798',\n\t\t\t\t'lng' => '-88.4500789',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9266 Shady Willow Cape Antlers, Alaska 99623-7664',\n\t\t\t\t'phone' => '(907) 409-4067',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1352 Bright Goose Pike Big Black, Arkansas 71766-8350',\n\t\t\t\t'phone' => '(870) 377-6554',\n\t\t\t\t'lat' => '33.7046265',\n\t\t\t\t'lng' => '-92.4801989',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4111 Dewy Oak Manor Tennis, Massachusetts 02575-2415',\n\t\t\t\t'phone' => '(774) 709-4623',\n\t\t\t\t'lat' => '41.3854488',\n\t\t\t\t'lng' => '-70.6828437',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '847 Rocky Cider Mountain Smoke Tree, North Carolina 28828-1331',\n\t\t\t\t'phone' => '(910) 433-1420',\n\t\t\t\t'lat' => '35.7595731',\n\t\t\t\t'lng' => '-79.0192997',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7617 Wishing Brook Close Red Scaffold, Indiana 46881-1212',\n\t\t\t\t'phone' => '(574) 444-1553',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2480 Foggy Common Ragged Top, Washington 98961-5250',\n\t\t\t\t'phone' => '(360) 421-1646',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3492 Grand Forest Khwunrghunme, Michigan 49756-9037',\n\t\t\t\t'phone' => '(734) 937-3419',\n\t\t\t\t'lat' => '44.8212897',\n\t\t\t\t'lng' => '-84.3121264',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7416 Little Sky Freeway Rockglen, District of Columbia 20019-1929',\n\t\t\t\t'phone' => '(202) 237-8148',\n\t\t\t\t'lat' => '38.8910932',\n\t\t\t\t'lng' => '-76.947022',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9615 Iron Gate Four Locks, Nevada 89913-4822',\n\t\t\t\t'phone' => '(775) 426-4311',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6148 Old Diversion Tuggleville, Massachusetts 02337-2879',\n\t\t\t\t'phone' => '(857) 963-7280',\n\t\t\t\t'lat' => '42.0135823',\n\t\t\t\t'lng' => '-70.9618707',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6296 Quiet Limits Fort Nonsense, Alabama 35677-0818',\n\t\t\t\t'phone' => '(334) 098-7277',\n\t\t\t\t'lat' => '34.9568241',\n\t\t\t\t'lng' => '-88.0314174',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8939 Hidden Shadow Farms Granum, Connecticut 06587-8468',\n\t\t\t\t'phone' => '(475) 803-0416',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9165 Umber Horse Lane Pukwana, Utah 84914-5320',\n\t\t\t\t'phone' => '(801) 644-3244',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8216 Dusty Meadow India, Idaho 83960-6689',\n\t\t\t\t'phone' => '(208) 435-1588',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2405 Velvet Place Rob Roy, Oklahoma 74463-5905',\n\t\t\t\t'phone' => '(580) 100-1857',\n\t\t\t\t'lat' => '35.7558792',\n\t\t\t\t'lng' => '-95.5551652',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2739 Tawny Hills Harbour Kansas City, Minnesota 55068-2994',\n\t\t\t\t'phone' => '(763) 680-7609',\n\t\t\t\t'lat' => '44.7530325',\n\t\t\t\t'lng' => '-93.0776568',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3633 Round Elk Street Lick Fork, Colorado 80247-7628',\n\t\t\t\t'phone' => '(303) 519-5784',\n\t\t\t\t'lat' => '39.6974551',\n\t\t\t\t'lng' => '-104.8746508',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5392 Harvest Log Villas Beantown, Virginia 24261-9429',\n\t\t\t\t'phone' => '(757) 666-1162',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3766 Red Quail Expressway Sopchoppy, Missouri 65567-6848',\n\t\t\t\t'phone' => '(660) 947-1822',\n\t\t\t\t'lat' => '37.8343507',\n\t\t\t\t'lng' => '-92.5495112',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5648 Honey Hill Fair Play, Nevada 89530-3031',\n\t\t\t\t'phone' => '(775) 838-1520',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6422 Fallen Fox Dell Uchi, Rhode Island 02952-2526',\n\t\t\t\t'phone' => '(401) 087-8528',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2316 Cinder Sky Moor Morning View, New Mexico 87980-3617',\n\t\t\t\t'phone' => '(505) 298-8521',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2219 Quiet Embers Thicket Seven Oaks, Louisiana 70773-8954',\n\t\t\t\t'phone' => '(318) 793-9794',\n\t\t\t\t'lat' => '30.6070469',\n\t\t\t\t'lng' => '-91.3710402',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9442 Rustic Concession Kidtown, Illinois 61570-6195',\n\t\t\t\t'phone' => '(217) 402-8450',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1909 Cozy Via Hooker Corner, Utah 84719-1105',\n\t\t\t\t'phone' => '(385) 721-9721',\n\t\t\t\t'lat' => '37.6775836',\n\t\t\t\t'lng' => '-112.8343844',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2904 Heather Quail View Ernfold, Florida 34857-4872',\n\t\t\t\t'phone' => '(305) 192-2293',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9839 Harvest Terrace Ohiopyle, Wyoming 82363-8477',\n\t\t\t\t'phone' => '(307) 786-6676',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5298 Gentle Harbour Swamp Fox, Arizona 85258-7476',\n\t\t\t\t'phone' => '(480) 945-9607',\n\t\t\t\t'lat' => '33.5669912',\n\t\t\t\t'lng' => '-111.8985922',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9469 Thunder Port Forget, West Virginia 25796-2759',\n\t\t\t\t'phone' => '(304) 930-4028',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7187 Hazy Private Birtle, Alabama 35219-5488',\n\t\t\t\t'phone' => '(256) 624-0268',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1033 Bright Forest Shin Hollow, New York 12454-5275',\n\t\t\t\t'phone' => '(718) 871-5723',\n\t\t\t\t'lat' => '42.2910991',\n\t\t\t\t'lng' => '-74.1592278',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4634 Old Branch Heath Crumrod, Washington 99353-4257',\n\t\t\t\t'phone' => '(360) 093-9697',\n\t\t\t\t'lat' => '46.4132585',\n\t\t\t\t'lng' => '-119.4197414',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '428 Wishing Park Frostproof, Oregon 97948-9195',\n\t\t\t\t'phone' => '(458) 093-6584',\n\t\t\t\t'lat' => '43.8041334',\n\t\t\t\t'lng' => '-120.5542012',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8095 Silent Autumn Mews Summertime, Oklahoma 73173-9098',\n\t\t\t\t'phone' => '(580) 064-3854',\n\t\t\t\t'lat' => '35.3364517',\n\t\t\t\t'lng' => '-97.6222665',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3838 Cotton Bend Rapture, District of Columbia 20092-1246',\n\t\t\t\t'phone' => '(202) 408-8807',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '136 Green Prairie By-pass Chappaquiddick, Alabama 35143-8644',\n\t\t\t\t'phone' => '(334) 878-7089',\n\t\t\t\t'lat' => '33.0991185',\n\t\t\t\t'lng' => '-86.5602614',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6744 Foggy Panda Hollow Four Bears Village, Massachusetts 01836-1710',\n\t\t\t\t'phone' => '(339) 877-5101',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6657 Pleasant Cloud Corners Bucklesberry, Texas 79634-2471',\n\t\t\t\t'phone' => '(430) 045-9307',\n\t\t\t\t'lat' => '31.9685988',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7739 Golden Leaf Highway Sixes, California 94802-8145',\n\t\t\t\t'phone' => '(408) 759-3038',\n\t\t\t\t'lat' => '37.94',\n\t\t\t\t'lng' => '-122.36',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7761 Quaking Cove Waldheim, Alabama 36811-9935',\n\t\t\t\t'phone' => '(256) 439-3656',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2016 Honey Downs Lunenburg, Alabama 36444-4744',\n\t\t\t\t'phone' => '(334) 539-9475',\n\t\t\t\t'lat' => '31.6711853',\n\t\t\t\t'lng' => '-87.4405786',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4862 Jagged Goose Woods Hog Eye, Idaho 83723-2986',\n\t\t\t\t'phone' => '(208) 870-7519',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3085 Blue Hickory Quay Bell Buckle, Massachusetts 01800-4101',\n\t\t\t\t'phone' => '(508) 992-6644',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1970 Round Freeway Frog Town, Washington 98616-3325',\n\t\t\t\t'phone' => '(253) 244-8709',\n\t\t\t\t'lat' => '46.1794789',\n\t\t\t\t'lng' => '-122.1561155',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3350 Emerald Expressway Hardup, Rhode Island 02983-8455',\n\t\t\t\t'phone' => '(401) 829-1654',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4668 Dusty Spring Link Lampadocia, Florida 33678-2548',\n\t\t\t\t'phone' => '(850) 277-3318',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5044 Rocky Falls Scratch Ankle, Massachusetts 02233-6502',\n\t\t\t\t'phone' => '(339) 608-9455',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4990 Indian Run Jumbo Landing, Kansas 66264-6247',\n\t\t\t\t'phone' => '(913) 450-8901',\n\t\t\t\t'lat' => '39.011902',\n\t\t\t\t'lng' => '-98.4842465',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5366 Iron Round Hardmoney, Mississippi 38651-2412',\n\t\t\t\t'phone' => '(228) 415-6114',\n\t\t\t\t'lat' => '34.8955106',\n\t\t\t\t'lng' => '-90.0466559',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9587 Noble Fawn Wood Silton, Utah 84515-3673',\n\t\t\t\t'phone' => '(435) 680-2014',\n\t\t\t\t'lat' => '38.911433',\n\t\t\t\t'lng' => '-109.140438',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7947 Tawny Bank Glen Campbell, New Jersey 08965-3916',\n\t\t\t\t'phone' => '(908) 243-5474',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4086 Shady Swale Symbol, Connecticut 06452-9480',\n\t\t\t\t'phone' => '(860) 816-1261',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5450 Red Point Thankful, District of Columbia 20085-4124',\n\t\t\t\t'phone' => '(202) 097-4695',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8648 Sunny Abbey Poysippi, Arkansas 71807-9239',\n\t\t\t\t'phone' => '(479) 685-9599',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9671 Amber Meadow Bullhead City, Connecticut 06195-6843',\n\t\t\t\t'phone' => '(475) 181-4842',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1003 Velvet Passage Swamproot, Florida 32977-8675',\n\t\t\t\t'phone' => '(305) 352-4895',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1822 Clear Rabbit Heights Hardscrabble Corner, Maryland 21902-5168',\n\t\t\t\t'phone' => '(240) 459-3194',\n\t\t\t\t'lat' => '39.5519225',\n\t\t\t\t'lng' => '-76.0667488',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6657 Red Cape Jumbotown, South Dakota 57009-7025',\n\t\t\t\t'phone' => '(605) 051-3665',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1736 Lost Lake Private Apponagansett, Colorado 81664-5410',\n\t\t\t\t'phone' => '(719) 056-7029',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3840 Easy Bend Village Thirteen, North Carolina 28961-7505',\n\t\t\t\t'phone' => '(828) 335-6063',\n\t\t\t\t'lat' => '33.9790349',\n\t\t\t\t'lng' => '-81.0094511',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4449 Emerald Goose Corner White Swan, Delaware 19914-5031',\n\t\t\t\t'phone' => '(302) 768-7121',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1726 Iron Pond Key Farewell, Utah 84430-5042',\n\t\t\t\t'phone' => '(801) 997-1471',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7984 Hidden Hills Route Radical, Maryland 21826-2709',\n\t\t\t\t'phone' => '(301) 118-3207',\n\t\t\t\t'lat' => '38.319091',\n\t\t\t\t'lng' => '-75.6237184',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '254 Jagged Grove Towers Skokomish, Michigan 49764-5965',\n\t\t\t\t'phone' => '(810) 808-1222',\n\t\t\t\t'lat' => '45.4227613',\n\t\t\t\t'lng' => '-84.8275195',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7013 Amber Butterfly Carrefour White Iron, Alabama 36391-7622',\n\t\t\t\t'phone' => '(251) 184-2094',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2152 Foggy Brook Turnabout Hangman Crossing, Connecticut 06556-8181',\n\t\t\t\t'phone' => '(203) 471-8901',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3522 Stony Timber Swale Little Black, Nebraska 68531-8030',\n\t\t\t\t'phone' => '(531) 896-6498',\n\t\t\t\t'lat' => '40.8991047',\n\t\t\t\t'lng' => '-96.722641',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5903 Velvet Log Square Tingle, Nevada 89258-0703',\n\t\t\t\t'phone' => '(775) 480-4956',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1666 Tawny Hickory Bay Quoddy, South Carolina 29810-1362',\n\t\t\t\t'phone' => '(864) 760-6510',\n\t\t\t\t'lat' => '32.98209',\n\t\t\t\t'lng' => '-81.3619402',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '549 Golden Cider Moor Changewater, Idaho 83736-4490',\n\t\t\t\t'phone' => '(208) 757-6906',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6342 Sunny Embers Trail Nickajack, Louisiana 71225-2282',\n\t\t\t\t'phone' => '(337) 704-5874',\n\t\t\t\t'lat' => '32.5040767',\n\t\t\t\t'lng' => '-92.3517526',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '870 Round Circuit Crumrod, North Dakota 58569-6155',\n\t\t\t\t'phone' => '(701) 752-7907',\n\t\t\t\t'lat' => '46.2326345',\n\t\t\t\t'lng' => '-101.2387062',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3571 Gentle Run Mudtavern, South Dakota 57420-4755',\n\t\t\t\t'phone' => '(605) 329-6911',\n\t\t\t\t'lat' => '45.2565588',\n\t\t\t\t'lng' => '-100.162177',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7000 Honey Fox Ridge Asphaltum, Oklahoma 74163-8162',\n\t\t\t\t'phone' => '(918) 254-3808',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5404 Thunder Vale Paydown, Utah 84529-9748',\n\t\t\t\t'phone' => '(801) 496-4369',\n\t\t\t\t'lat' => '39.7235022',\n\t\t\t\t'lng' => '-110.7956878',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5715 Harvest Gate Vista Perennial, Massachusetts 01775-4618',\n\t\t\t\t'phone' => '(351) 819-4468',\n\t\t\t\t'lat' => '42.4195323',\n\t\t\t\t'lng' => '-71.5130445',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3792 Misty Forest Loop Nanatlugunyi, Florida 34626-6008',\n\t\t\t\t'phone' => '(561) 250-4253',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8967 Wishing Robin Abbey Delightful, California 91223-0883',\n\t\t\t\t'phone' => '(858) 369-2837',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7881 Clear Deer Orchard Earth City, North Carolina 28790-1923',\n\t\t\t\t'phone' => '(334) 742-0656',\n\t\t\t\t'lat' => '35.2122099',\n\t\t\t\t'lng' => '-82.4861053',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1424 Blue Freeway Calypso, Oregon 97366-8616',\n\t\t\t\t'phone' => '(541) 518-7818',\n\t\t\t\t'lat' => '44.5772172',\n\t\t\t\t'lng' => '-124.053674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6984 Green Crest Comet, Colorado 80879-7122',\n\t\t\t\t'phone' => '(303) 805-7076',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3444 Merry Zephyr Bank St. Anthony, Maryland 21537-8641',\n\t\t\t\t'phone' => '(240) 544-8665',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2369 Noble Link Pilchuck, Mississippi 38792-0814',\n\t\t\t\t'phone' => '(769) 452-9691',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1272 Colonial Woods California, District of Columbia 20026-2848',\n\t\t\t\t'phone' => '(202) 663-3795',\n\t\t\t\t'lat' => '38.88546',\n\t\t\t\t'lng' => '-77.02612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2483 Cinder Blossom Townline Smittle, Michigan 48648-1860',\n\t\t\t\t'phone' => '(586) 711-0904',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4352 Sleepy Acres Turkey Foot Corner, Arizona 85149-8474',\n\t\t\t\t'phone' => '(480) 488-6822',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2334 Broad Centre Quebec, Arkansas 72840-9638',\n\t\t\t\t'phone' => '(870) 138-9435',\n\t\t\t\t'lat' => '35.4784895',\n\t\t\t\t'lng' => '-93.6319131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '926 Silver Rabbit Heath Biggar, Wyoming 82485-7427',\n\t\t\t\t'phone' => '(307) 598-8660',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2095 Dewy Valley Poland, North Carolina 28675-0245',\n\t\t\t\t'phone' => '(828) 268-1449',\n\t\t\t\t'lat' => '36.517185',\n\t\t\t\t'lng' => '-81.1416691',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9664 Heather Apple Lane Rock Run, Ohio 44631-4798',\n\t\t\t\t'phone' => '(567) 477-8961',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4413 Cotton Passage Money Creek, South Dakota 57464-6212',\n\t\t\t\t'phone' => '(605) 769-3389',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '498 Grand Autumn Manor Sinks, Maryland 21080-2555',\n\t\t\t\t'phone' => '(240) 883-6381',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4880 Cozy Bluff Wynd Dime, Wyoming 82623-0557',\n\t\t\t\t'phone' => '(307) 789-9254',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1631 Bright Pointe Atlantic, Montana 59633-0116',\n\t\t\t\t'phone' => '(406) 254-9193',\n\t\t\t\t'lat' => '46.8567824',\n\t\t\t\t'lng' => '-112.3514774',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1882 Amber Quay Stamping Ground, Nevada 89168-3744',\n\t\t\t\t'phone' => '(702) 523-2993',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1184 Honey Rabbit Byway Security, Rhode Island 02976-3161',\n\t\t\t\t'phone' => '(401) 196-3344',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7312 Rustic Shadow Crescent Quispamsis, Missouri 64437-0634',\n\t\t\t\t'phone' => '(573) 055-5313',\n\t\t\t\t'lat' => '40.1640348',\n\t\t\t\t'lng' => '-95.3730176',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4235 Easy Hollow Terramuggus, Massachusetts 01190-1126',\n\t\t\t\t'phone' => '(339) 768-8087',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3275 Bright Rise Tobin Lake, Missouri 63434-6747',\n\t\t\t\t'phone' => '(636) 770-5547',\n\t\t\t\t'lat' => '39.9029582',\n\t\t\t\t'lng' => '-91.9685826',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6974 Lazy Hickory Lookout Bingo Creek Landing, Ohio 43915-4308',\n\t\t\t\t'phone' => '(330) 540-7539',\n\t\t\t\t'lat' => '39.7283144',\n\t\t\t\t'lng' => '-80.9207737',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9571 Iron Impasse Speedway, Kentucky 41048-7538',\n\t\t\t\t'phone' => '(270) 173-4041',\n\t\t\t\t'lat' => '39.0871388',\n\t\t\t\t'lng' => '-84.7211074',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3955 Silent Autumn Port Fairbanks, North Carolina 28288-9288',\n\t\t\t\t'phone' => '(704) 022-2545',\n\t\t\t\t'lat' => '35.2299999',\n\t\t\t\t'lng' => '-80.84',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6612 Rocky Square Wink, New Mexico 88011-7952',\n\t\t\t\t'phone' => '(575) 508-3628',\n\t\t\t\t'lat' => '32.3035838',\n\t\t\t\t'lng' => '-106.6055534',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7468 Merry Glade Wynyard, Oklahoma 74155-6173',\n\t\t\t\t'phone' => '(918) 189-7319',\n\t\t\t\t'lat' => '36.1',\n\t\t\t\t'lng' => '-95.88',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8814 Blue Bank Chickahominy, Rhode Island 02870-2801',\n\t\t\t\t'phone' => '(401) 398-9638',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7805 Misty Estates Orderville, Arizona 85006-4165',\n\t\t\t\t'phone' => '(480) 709-9395',\n\t\t\t\t'lat' => '33.4636012',\n\t\t\t\t'lng' => '-112.0535987',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8128 Colonial View Jetty Ruff, Alaska 99974-7657',\n\t\t\t\t'phone' => '(907) 844-0966',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2915 Quiet Log Run Conquest Beach, Pennsylvania 19688-3627',\n\t\t\t\t'phone' => '(570) 679-4418',\n\t\t\t\t'lat' => '41.2033216',\n\t\t\t\t'lng' => '-77.1945247',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8984 Crystal Village Box Ankle, Arizona 86462-7020',\n\t\t\t\t'phone' => '(602) 319-0178',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6651 Jagged Quail Parade Kaihon Kug, Minnesota 56043-3914',\n\t\t\t\t'phone' => '(320) 120-3165',\n\t\t\t\t'lat' => '43.6400477',\n\t\t\t\t'lng' => '-93.2281983',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2721 Umber Goose Inlet Whipup, California 90450-4108',\n\t\t\t\t'phone' => '(310) 337-3085',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2346 Grand Embers Autoroute Pee Dee, Delaware 19827-5252',\n\t\t\t\t'phone' => '(302) 130-8743',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1014 Tawny Barn Campus Moab, Wisconsin 54395-8609',\n\t\t\t\t'phone' => '(715) 451-7568',\n\t\t\t\t'lat' => '43.7844397',\n\t\t\t\t'lng' => '-88.7878678',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4766 Middle Apple Walk Mctaggart, Georgia 39974-6914',\n\t\t\t\t'phone' => '(770) 180-8724',\n\t\t\t\t'lat' => '32.1574351',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1357 Stony Spring Falls Pyro, Minnesota 56430-2366',\n\t\t\t\t'phone' => '(651) 112-8227',\n\t\t\t\t'lat' => '46.24',\n\t\t\t\t'lng' => '-93.27',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '741 Little Road Hotchkissville, South Carolina 29980-2982',\n\t\t\t\t'phone' => '(803) 271-1505',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4800 Indian Abbey Blowing Rocks, Indiana 46110-0404',\n\t\t\t\t'phone' => '(317) 118-3274',\n\t\t\t\t'lat' => '39.5487322',\n\t\t\t\t'lng' => '-85.899783',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7564 Hazy End Quonochontaug, Iowa 50994-1984',\n\t\t\t\t'phone' => '(641) 188-5763',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8297 Green Fox Boulevard Oskaloosa, Delaware 19768-0727',\n\t\t\t\t'phone' => '(302) 991-2140',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3485 High Elk Highlands Alabama, Illinois 60056-5509',\n\t\t\t\t'phone' => '(630) 741-5152',\n\t\t\t\t'lat' => '42.0646736',\n\t\t\t\t'lng' => '-87.9383822',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1086 Sleepy River Highway Deep Tunnel, Nebraska 69944-7258',\n\t\t\t\t'phone' => '(402) 487-2266',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4287 Hidden Pathway Dogs Corners, Texas 77703-3455',\n\t\t\t\t'phone' => '(214) 064-5285',\n\t\t\t\t'lat' => '30.1123243',\n\t\t\t\t'lng' => '-94.1053307',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9353 Broad Lake Green Magic City, Connecticut 06944-8343',\n\t\t\t\t'phone' => '(860) 742-6128',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '837 Pleasant Leaf Mountain Badwater, Michigan 49485-3681',\n\t\t\t\t'phone' => '(989) 918-6526',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '39 Heather Deer Terrace Thumpertown Beach, South Carolina 29522-8274',\n\t\t\t\t'phone' => '(864) 481-1621',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3339 Old Bear Pike Pierceland, South Dakota 57415-3788',\n\t\t\t\t'phone' => '(605) 629-5218',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8761 Red Pines Rice City, Washington 99321-1500',\n\t\t\t\t'phone' => '(206) 943-5709',\n\t\t\t\t'lat' => '46.8302172',\n\t\t\t\t'lng' => '-119.9753806',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7767 Silver Alley Noordeloos, Iowa 51745-0727',\n\t\t\t\t'phone' => '(641) 192-2090',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1435 Fallen Mountain Vale Fond du Lac, Virginia 22856-9291',\n\t\t\t\t'phone' => '(757) 141-8626',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2933 Sunny Lagoon Carrefour Tok, Alabama 36623-1322',\n\t\t\t\t'phone' => '(251) 692-9694',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2269 Green Estates Lancer, Virginia 23433-5801',\n\t\t\t\t'phone' => '(276) 386-1910',\n\t\t\t\t'lat' => '36.9096727',\n\t\t\t\t'lng' => '-76.4736602',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5102 Crystal Campus Africa, Arkansas 72941-1369',\n\t\t\t\t'phone' => '(501) 425-6290',\n\t\t\t\t'lat' => '35.3406757',\n\t\t\t\t'lng' => '-94.1718542',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6263 Dusty Via Westlock, North Carolina 27880-2868',\n\t\t\t\t'phone' => '(252) 729-9770',\n\t\t\t\t'lat' => '35.7274657',\n\t\t\t\t'lng' => '-78.1222336',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '901 Emerald Dale Trail Tropic, Alabama 36195-8065',\n\t\t\t\t'phone' => '(256) 750-0498',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9909 Stony Treasure Run Bowlegs, New York 14280-7238',\n\t\t\t\t'phone' => '(718) 645-5353',\n\t\t\t\t'lat' => '42.88',\n\t\t\t\t'lng' => '-78.83',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '375 Grand Circuit Big Lick, North Dakota 58673-0849',\n\t\t\t\t'phone' => '(701) 249-6415',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6622 Shady Willow Extension Singing Brook, Florida 34850-0832',\n\t\t\t\t'phone' => '(904) 520-9731',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3788 Golden Path Ouzinkie, Nevada 89414-0520',\n\t\t\t\t'phone' => '(702) 834-3786',\n\t\t\t\t'lat' => '41.0357702',\n\t\t\t\t'lng' => '-117.1264753',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2770 Hidden Leaf Autoroute Skin Corner, Wisconsin 53103-7447',\n\t\t\t\t'phone' => '(414) 483-1760',\n\t\t\t\t'lat' => '42.8791805',\n\t\t\t\t'lng' => '-88.2169027',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4453 Cinder Island Stead Oblong, Washington 98115-4132',\n\t\t\t\t'phone' => '(509) 550-3940',\n\t\t\t\t'lat' => '47.6849444',\n\t\t\t\t'lng' => '-122.2982224',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3154 Easy Beacon Grounds Queonemysing, Rhode Island 02899-2050',\n\t\t\t\t'phone' => '(401) 107-0559',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5753 Umber Blossom Close Broomtown, Nebraska 68105-7145',\n\t\t\t\t'phone' => '(531) 625-0429',\n\t\t\t\t'lat' => '41.2418116',\n\t\t\t\t'lng' => '-95.9673967',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5314 Colonial Shadow Green Okahta Talaia, West Virginia 26565-0046',\n\t\t\t\t'phone' => '(304) 871-6111',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7366 Gentle Gate Pines Anaconda, Pennsylvania 17700-1378',\n\t\t\t\t'phone' => '(878) 984-2742',\n\t\t\t\t'lat' => '41.2033216',\n\t\t\t\t'lng' => '-77.1945247',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6390 Amber Hills Range Chiawuli Tak, Alaska 99585-0460',\n\t\t\t\t'phone' => '(907) 482-1567',\n\t\t\t\t'lat' => '61.9319969',\n\t\t\t\t'lng' => '-162.2708169',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9656 Blue Goose Passage Bootjack, District of Columbia 20050-2319',\n\t\t\t\t'phone' => '(202) 047-2431',\n\t\t\t\t'lat' => '38.9',\n\t\t\t\t'lng' => '-77.04',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3292 Dewy Fox Square Gassaway, Mississippi 38750-3303',\n\t\t\t\t'phone' => '(662) 414-3997',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3621 Lost Barn Key Turkey Scratch, Nebraska 68376-3092',\n\t\t\t\t'phone' => '(308) 123-0375',\n\t\t\t\t'lat' => '40.1975037',\n\t\t\t\t'lng' => '-95.940971',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '779 Quaking Bend Pink Arrow, Maine 04229-9316',\n\t\t\t\t'phone' => '(207) 751-1259',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '859 Little Place Prairie Queen, South Carolina 29009-4151',\n\t\t\t\t'phone' => '(864) 042-0986',\n\t\t\t\t'lat' => '34.4614628',\n\t\t\t\t'lng' => '-80.3881333',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5454 Burning Apple Plaza Montmartre, Indiana 47837-8211',\n\t\t\t\t'phone' => '(317) 656-5951',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3019 Tawny Nectar Canyon Twentysix, Rhode Island 02953-3262',\n\t\t\t\t'phone' => '(401) 205-0347',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1693 Heather Park Choccolocco, Nevada 89121-6915',\n\t\t\t\t'phone' => '(702) 497-5280',\n\t\t\t\t'lat' => '36.1165487',\n\t\t\t\t'lng' => '-115.0881146',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4694 Harvest Grove Cape Farmlife, Delaware 19851-7155',\n\t\t\t\t'phone' => '(302) 677-0905',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6793 Noble Prairie Farm Cheesequake, South Carolina 29321-0502',\n\t\t\t\t'phone' => '(843) 039-9935',\n\t\t\t\t'lat' => '34.7346757',\n\t\t\t\t'lng' => '-81.7130522',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7422 Lazy Ridge Possum Bluff, North Dakota 58730-0556',\n\t\t\t\t'phone' => '(701) 951-9221',\n\t\t\t\t'lat' => '48.8755921',\n\t\t\t\t'lng' => '-103.3383503',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9342 Round Rabbit Gate Latexo, Ohio 44353-0469',\n\t\t\t\t'phone' => '(740) 126-5652',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9030 Red Abbey Pointblank, Oregon 97693-1636',\n\t\t\t\t'phone' => '(458) 273-1218',\n\t\t\t\t'lat' => '43.8041334',\n\t\t\t\t'lng' => '-120.5542012',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7 High Mountain Glade Pontiac, Arizona 86330-0582',\n\t\t\t\t'phone' => '(928) 447-4570',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5726 Fallen Embers Thicket Port Protection, Ohio 44035-5738',\n\t\t\t\t'phone' => '(740) 066-8548',\n\t\t\t\t'lat' => '41.3534148',\n\t\t\t\t'lng' => '-82.1496049',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5589 Thunder Point Wawota, Louisiana 71490-1808',\n\t\t\t\t'phone' => '(985) 711-3587',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8346 Silver Limits Battle Mountain, New York 12016-4484',\n\t\t\t\t'phone' => '(347) 919-0371',\n\t\t\t\t'lat' => '42.93',\n\t\t\t\t'lng' => '-74.3199999',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5933 Quiet Valley Ko Ko, Colorado 81549-9872',\n\t\t\t\t'phone' => '(719) 129-0748',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5148 Clear Vale Poor Town, Massachusetts 02575-2791',\n\t\t\t\t'phone' => '(339) 153-3036',\n\t\t\t\t'lat' => '41.3854488',\n\t\t\t\t'lng' => '-70.6828437',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6704 Hazy Lookout Weed, Iowa 50719-6158',\n\t\t\t\t'phone' => '(712) 771-7469',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3575 Middle Drive Koggiung, Maryland 21558-6166',\n\t\t\t\t'phone' => '(443) 915-6824',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9365 Grand Pointe Nanton, New Jersey 07685-8905',\n\t\t\t\t'phone' => '(973) 220-5840',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9796 Cozy Cider Boulevard Weirdale, Rhode Island 02968-5568',\n\t\t\t\t'phone' => '(401) 569-3091',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5297 Merry Woods Mexican Hat, Arizona 86615-1139',\n\t\t\t\t'phone' => '(623) 535-6319',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7427 Jagged Brook Bank Ah Fong Village, South Dakota 57890-7849',\n\t\t\t\t'phone' => '(605) 276-0864',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '754 Tawny Pony Alley Ak-Chin Village, Pennsylvania 17528-2354',\n\t\t\t\t'phone' => '(878) 610-1011',\n\t\t\t\t'lat' => '40.1281362',\n\t\t\t\t'lng' => '-75.998932',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4504 Lost Pine Jetty Ashepoo, Indiana 46332-6909',\n\t\t\t\t'phone' => '(765) 658-9671',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7349 Wishing Pioneer Carrefour Fearnowville, Nebraska 69992-2859',\n\t\t\t\t'phone' => '(531) 755-7518',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8125 Sleepy Wagon Walk Quails Nest, Washington 98914-0393',\n\t\t\t\t'phone' => '(360) 759-8355',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4848 Rustic Creek Field Extra, Florida 32134-3480',\n\t\t\t\t'phone' => '(772) 410-4020',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9972 Red Island Parade Quinhagak, Arkansas 72321-2240',\n\t\t\t\t'phone' => '(870) 781-2491',\n\t\t\t\t'lat' => '35.8197959',\n\t\t\t\t'lng' => '-89.9323304',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6636 Crystal Chase Skidaway Island, Connecticut 06780-4384',\n\t\t\t\t'phone' => '(475) 727-7385',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6444 Pleasant Bluff Gate Axehandle, Arkansas 72928-3456',\n\t\t\t\t'phone' => '(479) 819-5947',\n\t\t\t\t'lat' => '35.2937406',\n\t\t\t\t'lng' => '-93.9368439',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9235 Blue Villas Half Hell, Washington 98641-6518',\n\t\t\t\t'phone' => '(206) 611-7946',\n\t\t\t\t'lat' => '46.5782535',\n\t\t\t\t'lng' => '-124.0028498',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6226 Cinder Quail Townline Ohoopee, Florida 32498-0673',\n\t\t\t\t'phone' => '(386) 072-5373',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4445 Harvest Timber Autoroute Sugar House, Tennessee 38360-7057',\n\t\t\t\t'phone' => '(931) 262-1016',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1977 Stony Fawn Stead Mervin, Virginia 22113-0967',\n\t\t\t\t'phone' => '(757) 167-5136',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1394 Noble Downs Flickersville, Idaho 83613-3584',\n\t\t\t\t'phone' => '(208) 823-5774',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5874 Hidden Common Ugashik, Delaware 19881-6924',\n\t\t\t\t'phone' => '(302) 305-4954',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9383 Gentle Grove Meadow Normalville, West Virginia 25919-8033',\n\t\t\t\t'phone' => '(681) 917-8401',\n\t\t\t\t'lat' => '37.8131224',\n\t\t\t\t'lng' => '-81.1835839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7371 Honey Sky Link Fort Spunky, Alabama 35100-5594',\n\t\t\t\t'phone' => '(334) 624-5222',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6632 High Lane Twisp, Louisiana 71003-4067',\n\t\t\t\t'phone' => '(985) 211-3060',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2365 Foggy Rise Swale Tribune, District of Columbia 20032-3585',\n\t\t\t\t'phone' => '(202) 865-0334',\n\t\t\t\t'lat' => '38.8372336',\n\t\t\t\t'lng' => '-77.0161436',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '293 Quiet Canyon Pondlick, Oklahoma 74029-6738',\n\t\t\t\t'phone' => '(405) 584-2135',\n\t\t\t\t'lat' => '36.832666',\n\t\t\t\t'lng' => '-95.8353837',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1074 Emerald Mall Archerwill, Maine 04935-6012',\n\t\t\t\t'phone' => '(207) 343-0489',\n\t\t\t\t'lat' => '44.4486337',\n\t\t\t\t'lng' => '-69.6062394',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6450 Little Robin Glade Pothook, Tennessee 38145-7689',\n\t\t\t\t'phone' => '(931) 676-3145',\n\t\t\t\t'lat' => '35.15',\n\t\t\t\t'lng' => '-90.05',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3990 Velvet Shadow Landing Crumpecker, Georgia 39823-3094',\n\t\t\t\t'phone' => '(762) 086-4610',\n\t\t\t\t'lat' => '31.3021309',\n\t\t\t\t'lng' => '-84.981754',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5560 Amber Highway Osoyoos, Colorado 81022-7656',\n\t\t\t\t'phone' => '(719) 296-9040',\n\t\t\t\t'lat' => '38.1345872',\n\t\t\t\t'lng' => '-104.4257533',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4068 Golden Moor High Lonesome Wells, Nevada 89929-1910',\n\t\t\t\t'phone' => '(775) 336-5382',\n\t\t\t\t'lat' => '41.1115888',\n\t\t\t\t'lng' => '-114.96449',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5720 Dewy Valley Tropic, Ohio 45591-1583',\n\t\t\t\t'phone' => '(216) 223-1805',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4649 Indian Oak Trace Cincinnati, Arkansas 72188-8555',\n\t\t\t\t'phone' => '(501) 108-3473',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4571 Dusty Crest Torquay, South Carolina 29071-4011',\n\t\t\t\t'phone' => '(843) 590-3879',\n\t\t\t\t'lat' => '33.9799999',\n\t\t\t\t'lng' => '-81.24',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '338 Rocky Nectar By-pass Slapneck, Idaho 83647-7054',\n\t\t\t\t'phone' => '(208) 458-6847',\n\t\t\t\t'lat' => '43.4969131',\n\t\t\t\t'lng' => '-115.5314511',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9878 Thunder Arbor Kalifornsky, Arizona 86631-5352',\n\t\t\t\t'phone' => '(623) 658-2751',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5226 Shady Goose Impasse Alberton, Colorado 81299-4296',\n\t\t\t\t'phone' => '(970) 381-4534',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9048 Sleepy Dale Maze Lucky, Tennessee 37271-0904',\n\t\t\t\t'phone' => '(865) 587-0661',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8484 Foggy Canyon Delaware, Washington 98893-5880',\n\t\t\t\t'phone' => '(425) 905-3571',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7644 Dusty Lake Lookout Legal, Nevada 89531-1567',\n\t\t\t\t'phone' => '(702) 991-0236',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2965 Colonial Pond Byway Kabetogama, Oklahoma 73592-8085',\n\t\t\t\t'phone' => '(580) 099-9725',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7035 Amber Bank Big Timber, Montana 59099-3359',\n\t\t\t\t'phone' => '(406) 046-1326',\n\t\t\t\t'lat' => '45.8343543',\n\t\t\t\t'lng' => '-109.9540644',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4491 Quiet Port Indialantic, Maryland 21062-4405',\n\t\t\t\t'phone' => '(240) 553-5943',\n\t\t\t\t'lat' => '39.1599999',\n\t\t\t\t'lng' => '-76.63',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2907 Middle Anchor Row Scarce Grease, Delaware 19991-0100',\n\t\t\t\t'phone' => '(302) 649-3078',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3924 Gentle Inlet Suquamish, Arizona 86166-6269',\n\t\t\t\t'phone' => '(623) 883-2017',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9823 Umber Prairie Crossing Teaticket, Montana 59309-4514',\n\t\t\t\t'phone' => '(406) 118-8472',\n\t\t\t\t'lat' => '46.8796822',\n\t\t\t\t'lng' => '-110.3625658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '265 Noble Apple Forest Vermont, Georgia 39813-3675',\n\t\t\t\t'phone' => '(229) 050-5836',\n\t\t\t\t'lat' => '31.4035879',\n\t\t\t\t'lng' => '-84.6688348',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8866 Rocky Trace Four Bears Village, Illinois 60491-6196',\n\t\t\t\t'phone' => '(815) 414-5669',\n\t\t\t\t'lat' => '41.6131315',\n\t\t\t\t'lng' => '-87.962884',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1412 Cotton Bay Star, Oklahoma 74194-3598',\n\t\t\t\t'phone' => '(918) 954-0869',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9766 Clear Pony Hill Handsome Eddy, Arizona 86422-7832',\n\t\t\t\t'phone' => '(623) 376-5382',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2824 Quaking Cloud Ridge Sun Valley, Virginia 24342-7446',\n\t\t\t\t'phone' => '(804) 394-6011',\n\t\t\t\t'lat' => '33.6496426',\n\t\t\t\t'lng' => '-92.7743809',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6841 Indian Cider Path Welfare, New York 14291-2909',\n\t\t\t\t'phone' => '(646) 281-2945',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5451 Broad Shadow Range Zewapeta, Alabama 36223-8635',\n\t\t\t\t'phone' => '(256) 964-1223',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6326 Little Pines Lake of the Woods, Wyoming 82150-2725',\n\t\t\t\t'phone' => '(307) 203-4687',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5711 Blue Deer Private Bullet Hole, Missouri 65105-1282',\n\t\t\t\t'phone' => '(660) 895-5372',\n\t\t\t\t'lat' => '38.5',\n\t\t\t\t'lng' => '-92.15',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '283 Hidden Spring Wood Boot Jack, District of Columbia 20021-8192',\n\t\t\t\t'phone' => '(202) 730-6835',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2005 Old Towers Ahwatukee, North Dakota 58517-9863',\n\t\t\t\t'phone' => '(701) 623-1368',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '97 Easy Chase Thunder Hawk, Nevada 89426-3672',\n\t\t\t\t'phone' => '(775) 120-7206',\n\t\t\t\t'lat' => '41.5598843',\n\t\t\t\t'lng' => '-117.4086488',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '751 Round Heath Bingo, Wyoming 82547-6473',\n\t\t\t\t'phone' => '(307) 934-0757',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1352 Pleasant Avenue Tinkertown, California 92022-5662',\n\t\t\t\t'phone' => '(562) 143-2770',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1681 Silent Corners Ben Arnold, Massachusetts 01528-4491',\n\t\t\t\t'phone' => '(508) 951-3124',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4399 Cinder Key Minnehaha, Oregon 97070-3784',\n\t\t\t\t'phone' => '(971) 108-8608',\n\t\t\t\t'lat' => '45.3018169',\n\t\t\t\t'lng' => '-122.7751561',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4644 Cozy Creek By-pass Telbasta, Iowa 50183-6396',\n\t\t\t\t'phone' => '(563) 119-5041',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8328 Jagged Abbey Turkeyfoot, South Dakota 57773-5048',\n\t\t\t\t'phone' => '(605) 557-3188',\n\t\t\t\t'lat' => '43.6076792',\n\t\t\t\t'lng' => '-103.5935897',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2335 Heather Grove Michigan Bar, Minnesota 56333-9494',\n\t\t\t\t'phone' => '(952) 500-4492',\n\t\t\t\t'lat' => '42.2663981',\n\t\t\t\t'lng' => '-83.7081315',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3991 Fallen Brook Cove Chi Chil Tah, Utah 84075-6499',\n\t\t\t\t'phone' => '(801) 958-0611',\n\t\t\t\t'lat' => '41.0541918',\n\t\t\t\t'lng' => '-112.1191757',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1105 Merry Barn Road Yaphank, Mississippi 39434-7368',\n\t\t\t\t'phone' => '(228) 295-0195',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8420 Stony Wagon Crest Runnymeade, Washington 98237-6997',\n\t\t\t\t'phone' => '(206) 831-6478',\n\t\t\t\t'lat' => '48.57163',\n\t\t\t\t'lng' => '-121.6648381',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9921 Grand Court Piddleville, Louisiana 70297-1882',\n\t\t\t\t'phone' => '(985) 897-9654',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2870 Iron Extension Bermuda, Colorado 80910-6158',\n\t\t\t\t'phone' => '(720) 166-0253',\n\t\t\t\t'lat' => '38.8064287',\n\t\t\t\t'lng' => '-104.7695962',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6803 Wishing View Arbor Cat Square, West Virginia 25027-6576',\n\t\t\t\t'phone' => '(304) 952-4973',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '950 Red Thicket Wickatunk, Washington 99133-1072',\n\t\t\t\t'phone' => '(509) 283-9110',\n\t\t\t\t'lat' => '48.0361158',\n\t\t\t\t'lng' => '-119.0618141',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5401 Misty Robin Crescent Kill Buck, Rhode Island 02808-3785',\n\t\t\t\t'phone' => '(401) 473-6664',\n\t\t\t\t'lat' => '41.4026135',\n\t\t\t\t'lng' => '-71.7503855',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6237 Sleepy Lane Frisbie, Idaho 83214-5294',\n\t\t\t\t'phone' => '(208) 804-9330',\n\t\t\t\t'lat' => '42.5407152',\n\t\t\t\t'lng' => '-112.262246',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4801 Misty Passage Castor, Georgia 39917-9448',\n\t\t\t\t'phone' => '(223) 387-9176',\n\t\t\t\t'lat' => '32.1574351',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4539 Shady Robin Autoroute Albertville, Maryland 21561-3867',\n\t\t\t\t'phone' => '(240) 077-3317',\n\t\t\t\t'lat' => '39.4962475',\n\t\t\t\t'lng' => '-79.1774268',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5696 Clear Anchor Heath Sedgewick, Maine 04746-1418',\n\t\t\t\t'phone' => '(207) 790-0462',\n\t\t\t\t'lat' => '47.2192967',\n\t\t\t\t'lng' => '-68.1272872',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5953 Fallen Gardens Diagonal, Kentucky 40141-1739',\n\t\t\t\t'phone' => '(606) 649-9284',\n\t\t\t\t'lat' => '37.8393332',\n\t\t\t\t'lng' => '-84.2700179',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5039 Sunny Vale Hells Half Acre, Illinois 61429-4296',\n\t\t\t\t'phone' => '(630) 322-6634',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6708 Dewy Boulevard Aylsham, West Virginia 26949-2429',\n\t\t\t\t'phone' => '(681) 442-9535',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1696 Rocky Lagoon Glade Saltcoats, Kansas 66020-4409',\n\t\t\t\t'phone' => '(620) 939-6715',\n\t\t\t\t'lat' => '39.3532738',\n\t\t\t\t'lng' => '-95.1223608',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '351 Quaking Lake Bank Lone Star, Arkansas 72198-3208',\n\t\t\t\t'phone' => '(870) 320-2825',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1194 Emerald Mall Sparkle, South Carolina 29968-2223',\n\t\t\t\t'phone' => '(864) 030-8670',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4540 Lazy Canyon Texico, Nevada 89065-4845',\n\t\t\t\t'phone' => '(775) 281-6892',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '928 Broad Pointe St. Paul, South Dakota 57151-9943',\n\t\t\t\t'phone' => '(605) 506-3672',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9319 High Hickory Way Whitchurch-Stouffville, Idaho 83396-2356',\n\t\t\t\t'phone' => '(208) 092-9832',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3571 Cotton Pond View Cloudcroft, Washington 99318-3295',\n\t\t\t\t'phone' => '(206) 319-5326',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4832 Velvet Ledge Lick Creek, North Dakota 58132-3790',\n\t\t\t\t'phone' => '(701) 089-2211',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6205 Gentle Pioneer Orchard Nebraska, Utah 84873-7158',\n\t\t\t\t'phone' => '(801) 379-8953',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1507 Dusty Horse Key Stenen, Connecticut 06463-8750',\n\t\t\t\t'phone' => '(475) 436-2630',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7582 Blue Pathway Peoples, District of Columbia 20097-5618',\n\t\t\t\t'phone' => '(202) 414-2722',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9041 Old Parade Swift Current, Wyoming 82321-7674',\n\t\t\t\t'phone' => '(307) 310-9791',\n\t\t\t\t'lat' => '41.2694332',\n\t\t\t\t'lng' => '-107.811',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7006 Cozy Mountain Range Treherne, Ohio 44000-7746',\n\t\t\t\t'phone' => '(937) 218-0393',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2108 Hidden Inlet Blackduck, Michigan 49830-1870',\n\t\t\t\t'phone' => '(517) 014-1990',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4810 Round Berry Ramp Fannie, Michigan 49584-3163',\n\t\t\t\t'phone' => '(616) 917-3110',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1648 Easy Pine Impasse Humboldt, Alaska 99632-0756',\n\t\t\t\t'phone' => '(907) 398-7468',\n\t\t\t\t'lat' => '62.1075171',\n\t\t\t\t'lng' => '-163.6530901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4535 Foggy Rabbit End Houston, Maryland 21707-7837',\n\t\t\t\t'phone' => '(301) 637-4559',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7673 Pleasant Field Truly, Texas 77079-1885',\n\t\t\t\t'phone' => '(936) 494-0756',\n\t\t\t\t'lat' => '29.7801889',\n\t\t\t\t'lng' => '-95.6090009',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3474 Thunder Dell Owl Hoot, South Carolina 29164-3631',\n\t\t\t\t'phone' => '(843) 611-3991',\n\t\t\t\t'lat' => '33.6536164',\n\t\t\t\t'lng' => '-81.4059186',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9142 Amber Bend Egorkovskoi, New Jersey 08747-9332',\n\t\t\t\t'phone' => '(908) 187-4092',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6565 Cinder View Villas Cathlapotle, Maine 04459-1231',\n\t\t\t\t'phone' => '(207) 831-9138',\n\t\t\t\t'lat' => '45.5738851',\n\t\t\t\t'lng' => '-68.3533229',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '518 Red Mews Zero, New York 10921-2823',\n\t\t\t\t'phone' => '(914) 172-6342',\n\t\t\t\t'lat' => '41.1333442',\n\t\t\t\t'lng' => '-74.0022524',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9170 Honey Quay Smalltown, Idaho 83491-3357',\n\t\t\t\t'phone' => '(208) 768-3359',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2063 Indian Prairie Landing Blackhawk, Missouri 64773-8741',\n\t\t\t\t'phone' => '(573) 448-2155',\n\t\t\t\t'lat' => '37.9642529',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1177 Silent Wynd Prelate, Michigan 49755-2114',\n\t\t\t\t'phone' => '(906) 346-4118',\n\t\t\t\t'lat' => '45.6521002',\n\t\t\t\t'lng' => '-84.7814432',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5550 Harvest Street Yreka, Alabama 35589-7414',\n\t\t\t\t'phone' => '(256) 126-4821',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6650 Wishing Rise Ketchikan, Colorado 81727-6300',\n\t\t\t\t'phone' => '(303) 649-9421',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '896 Quiet Shadow Grove Okeewemee, Maine 04888-5600',\n\t\t\t\t'phone' => '(207) 887-6714',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5221 Hazy Cove Pigeon Run, Rhode Island 02844-5518',\n\t\t\t\t'phone' => '(401) 397-0342',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4009 Misty Log Mews Potato Patch, Texas 79949-7016',\n\t\t\t\t'phone' => '(432) 694-5133',\n\t\t\t\t'lat' => '31.76',\n\t\t\t\t'lng' => '-106.49',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3121 Blue Road Cheektowasa, Ohio 44178-5872',\n\t\t\t\t'phone' => '(614) 541-7135',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7745 Quaking Island Private Vamoosa, Florida 33726-8437',\n\t\t\t\t'phone' => '(352) 417-7732',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2964 Round Bend Three V Crossing, New York 12895-6061',\n\t\t\t\t'phone' => '(516) 933-1701',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8929 Wishing Brook Close Mudtown, Arkansas 72307-8524',\n\t\t\t\t'phone' => '(870) 040-5761',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9857 Shady Barn Corners Boiling Point, Illinois 62370-8259',\n\t\t\t\t'phone' => '(618) 865-5959',\n\t\t\t\t'lat' => '39.5028435',\n\t\t\t\t'lng' => '-91.0011902',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8122 Foggy By-pass Refuge, Georgia 39825-9760',\n\t\t\t\t'phone' => '(404) 653-2379',\n\t\t\t\t'lat' => '30.9942599',\n\t\t\t\t'lng' => '-84.7106567',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9352 Sleepy Creek Mall Lorida, Connecticut 06685-5331',\n\t\t\t\t'phone' => '(860) 074-9188',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1740 Silent Goose Promenade Gothic, Virginia 23080-3616',\n\t\t\t\t'phone' => '(703) 804-6802',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9748 Gentle Rabbit Canyon Laird, New York 11444-2032',\n\t\t\t\t'phone' => '(518) 987-5742',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '14 Burning Butterfly Impasse Frugality, Utah 84659-3929',\n\t\t\t\t'phone' => '(385) 531-1381',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1002 Red Gate Cape Big Cut, Vermont 05637-0939',\n\t\t\t\t'phone' => '(802) 022-4379',\n\t\t\t\t'lat' => '44.5588028',\n\t\t\t\t'lng' => '-72.5778415',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2826 Velvet Blossom Hill Pearl City, West Virginia 25995-8728',\n\t\t\t\t'phone' => '(681) 707-4520',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6397 Colonial Via Lonesome Prairie, Vermont 05009-4463',\n\t\t\t\t'phone' => '(802) 938-7061',\n\t\t\t\t'lat' => '43.6474348',\n\t\t\t\t'lng' => '-72.342588',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7824 Umber Fox Parkway Roche Percee, Nebraska 69310-7287',\n\t\t\t\t'phone' => '(308) 868-7311',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8786 Iron Grove Ah Fong Village, Colorado 80951-9857',\n\t\t\t\t'phone' => '(720) 743-9084',\n\t\t\t\t'lat' => '38.8622755',\n\t\t\t\t'lng' => '-104.6733584',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1582 Sunny Inlet Mctaggart, New Hampshire 03648-2975',\n\t\t\t\t'phone' => '(603) 770-8206',\n\t\t\t\t'lat' => '43.1938516',\n\t\t\t\t'lng' => '-71.5723953',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4191 Rustic Dale Common Rainbow City, West Virginia 26463-4803',\n\t\t\t\t'phone' => '(304) 618-7564',\n\t\t\t\t'lat' => '39.4349029',\n\t\t\t\t'lng' => '-80.3534899',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6761 Merry Parade Rainbow Bend, Pennsylvania 15102-8551',\n\t\t\t\t'phone' => '(484) 597-9344',\n\t\t\t\t'lat' => '40.3167073',\n\t\t\t\t'lng' => '-80.0423151',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9422 Middle Berry Street Humboldt, Alaska 99574-3449',\n\t\t\t\t'phone' => '(907) 657-0496',\n\t\t\t\t'lat' => '60.7356503',\n\t\t\t\t'lng' => '-145.5826187',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2415 Silver Lagoon Highlands Saltcoats, Louisiana 70086-3885',\n\t\t\t\t'phone' => '(337) 079-1229',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5293 Honey View Crossing Radical, Connecticut 06000-2541',\n\t\t\t\t'phone' => '(860) 898-9772',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2018 Hidden Limits Cockeysville, New Jersey 08526-2387',\n\t\t\t\t'phone' => '(551) 133-0241',\n\t\t\t\t'lat' => '40.17',\n\t\t\t\t'lng' => '-74.51',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1187 Noble River Thicket Tat Momoli, Texas 78085-3232',\n\t\t\t\t'phone' => '(903) 016-0722',\n\t\t\t\t'lat' => '31.9685988',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4799 Jagged Robin Beach Weirdale, Minnesota 56231-9007',\n\t\t\t\t'phone' => '(507) 950-8070',\n\t\t\t\t'lat' => '45.2842156',\n\t\t\t\t'lng' => '-95.7948769',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6967 Golden Line Parrots, Alaska 99990-7560',\n\t\t\t\t'phone' => '(907) 102-7536',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5766 Tawny Green Valley of Enchantment, Maryland 20850-1890',\n\t\t\t\t'phone' => '(410) 816-6230',\n\t\t\t\t'lat' => '39.0839994',\n\t\t\t\t'lng' => '-77.1527813',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2690 Lazy Jetty Saxman, Massachusetts 02411-2917',\n\t\t\t\t'phone' => '(339) 206-8396',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1858 Heather Lake Abbey Enough, Alaska 99700-6940',\n\t\t\t\t'phone' => '(907) 915-5318',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2284 Harvest Sky Edge Bungy, Oklahoma 74224-8696',\n\t\t\t\t'phone' => '(580) 287-3530',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2875 Dusty Cloud Centre Happy Valley-Goose Bay, Maine 04130-1318',\n\t\t\t\t'phone' => '(207) 707-6131',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2442 Cotton Campus Arabia, Florida 32543-2413',\n\t\t\t\t'phone' => '(813) 412-6448',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6054 Thunder Rise Subdivision Buzzards Roost, North Carolina 27577-9290',\n\t\t\t\t'phone' => '(828) 877-4968',\n\t\t\t\t'lat' => '35.7595731',\n\t\t\t\t'lng' => '-79.0192997',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4442 Old Cider Lookout Alabama Village, Utah 84844-5606',\n\t\t\t\t'phone' => '(435) 733-2606',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5484 Bright Willow Pike Sunizona, New Mexico 87149-6244',\n\t\t\t\t'phone' => '(505) 333-5135',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t);\n\n\t\treturn $data;\n\t}", "public function getLineWithStops($lineId);", "public function lines($sql, $both = false) {\n $data_out = array();\n $sql_data = $this->data($sql);\n while ($data = $this->mfa($sql_data, $both))\n {\n $data_out[] = $data;\n }\n return $data_out;\n }", "function parse_address($address) {\n\t\t// USA Addresses\n\t\tif (strstr($address, ', USA')) {\n\t\t\t// Remove 'USA'\n\t\t\t$address = str_replace(', USA', '', $address);\n\n\t\t\t// If there's exactly ONE comma left then return a single line, e.g. \"New York, NY\"\n\t\t\tif (substr_count($address, ',') == 1) {\n\t\t\t\treturn array($address);\n\t\t\t}\n\t\t}\n\n\t\t// If NO commas then use a single line, e.g. \"France\" or \"Ohio\"\n\t\tif (!strpos($address, ','))\n\t\t\treturn array($address);\n\n\t\t// Otherwise return first line from before first comma+space, second line after, e.g. \"Paris, France\" => \"Paris<br>France\"\n\t\t// Or \"1 Main St, Brooklyn, NY\" => \"1 Main St<br>Brooklyn, NY\"\n\t\treturn array(\n\t\t\tsubstr($address, 0, strpos($address, \",\")),\n\t\t\tsubstr($address, strpos($address, \",\") + 2)\n\t\t);\n\t}", "abstract public function getLinesOfCode();", "public function getAll()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/ip/address/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n } else {\n return \"No Ip Address To Set, Please Your Add Ip Address\";\n }\n }", "public function getLinesToCache()\n {\n $value = $this->_config->get('dataprocessing/general/cache_lines');\n\n if ($value === null) {\n $value = 200;\n }\n\n return (int)$value;\n }", "function _getLines(&$text_lines, &$line_no, $end = \\false)\n {\n }", "public function getBodyLines()\n {\n return $this->bodyLines;\n }" ]
[ "0.66587734", "0.661189", "0.652894", "0.652894", "0.60874516", "0.60809726", "0.5923534", "0.5856142", "0.5791759", "0.5733196", "0.5693125", "0.5640785", "0.5640178", "0.56311625", "0.5613263", "0.55872005", "0.55721164", "0.55626523", "0.5556269", "0.5520456", "0.5472211", "0.5445163", "0.54429567", "0.5425527", "0.5413229", "0.5408635", "0.53749126", "0.5374008", "0.5363329", "0.5362406", "0.5360698", "0.53477937", "0.53477937", "0.5342495", "0.5339316", "0.5336937", "0.5329729", "0.5328381", "0.53096205", "0.53044844", "0.5282759", "0.52704227", "0.526921", "0.52675664", "0.524903", "0.52218306", "0.5219487", "0.5207921", "0.51714844", "0.51579434", "0.5147706", "0.5125585", "0.5123663", "0.5094274", "0.50935036", "0.5088863", "0.50636625", "0.5060381", "0.5023933", "0.5011991", "0.5001066", "0.5000208", "0.49966156", "0.49888036", "0.49888036", "0.49852985", "0.4984724", "0.49813753", "0.49778542", "0.49773067", "0.49731585", "0.4969541", "0.49665502", "0.49588263", "0.4936693", "0.49233228", "0.49197575", "0.49171612", "0.4914217", "0.49028358", "0.48960146", "0.48948845", "0.48918253", "0.48915058", "0.48905608", "0.4886722", "0.48807818", "0.48803768", "0.48730928", "0.48709062", "0.48603266", "0.48597214", "0.48575076", "0.48570895", "0.4854503", "0.48503944", "0.48465094", "0.48449025", "0.4844608" ]
0.67015874
1
returns single line of address which number is $line
public function getLine($line);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_line() { \n\t\t$line = $this->lines[$this->cursor]; \n\t\t$this->cursor++; return $line; \n\t}", "function getLine()\r\n {\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\t$sLine = trim($this->referString[$this->currentLine]);\r\n\t\t\t\t$this->currentLine++;\r\n\t\t\t} while ($this->currentLine < count($this->referString) && !$sLine);\r\n\t\t\treturn $sLine;\r\n }", "public function get_line()\n {\n return $this->line;\n }", "public function getLine($lineNumber);", "public function getLine(int $line){\n return $this->file[$line] ?? \"\";\n }", "static function getLine($file,$line){\n\t\tif($file){\n\t\t\t$f = file($file);\n\t\t\t$code = substr($f[$line-1],0,-1);\n\t\t\treturn preg_replace('@^\\s*@','',$code);\n\t\t}\n\t}", "public function getLine(): int\n {\n return $this->line;\n }", "public function getLine(): int\n {\n return $this->line;\n }", "public function getLine() {\n return $this->line;\n }", "public function getLine() {\n return $this->parse()['line'];\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine() {\n\t\treturn $this->line;\n\t}", "public function getLineNumber();", "public function getLineNumber();", "public function getLine()\n {\n return $this->get(self::_LINE);\n }", "public function getLine()\n\t{\n\t\treturn $this->line;\n\t}", "public function _getStreet(?string $street, $line)\n {\n $street = explode(\"\\n\", (string) $street);\n if ($line == 1) {\n return $street[0];\n }\n if (isset($street[$line - 1])) {\n return $street[$line - 1];\n } else {\n return '';\n }\n }", "public function getLine()\n {\n return $this->data[2];\n }", "private function getStreetLine(int $line, object $billingAddress)\n {\n $streetLine = null;\n if (is_a($billingAddress, AddressAdapterInterface::class)) {\n $adapterMethod = 'getStreetLine' . $line;\n $streetLine = method_exists($billingAddress, $adapterMethod) ? $billingAddress->$adapterMethod() : null;\n } elseif (is_a($billingAddress, OrderAddressInterface::class)) {\n $streetLine = $billingAddress->getStreetLine($line);\n }\n return $streetLine;\n }", "public function getLineRef()\n {\n return $this->lineRef;\n }", "public function getLineId()\n {\n return $this->line_id;\n }", "public function get_line( $file, $line ) {\n\t\tif ( empty( $this->spl ) ) {\n\t\t\t$this->spl = new \\SplFileObject( $file );\n\t\t}\n\n\t\tif ( ! $this->spl->eof() ) {\n\t\t\t$this->spl->seek( $line );\n\t\t\t$contents = $this->spl->current();\n\t\t}\n\n\t\treturn $contents;\n\t}", "public function getLine():int {\n\t\t\treturn $this->line;\n\t\t}", "function getLine(){\n return $this->line;\n }", "public function getLineNr()\n {\n return $this->lineNr;\n }", "public function getLine(int $lineno): ?string\n {\n $lines = $this->getLines();\n return $lines[$lineno] ?? null;\n }", "public function getLine(): int\n {\n return $this->node->start_lineno;\n }", "public function line($line, $log_errors = TRUE)\n\t{\n\t\treturn $this->__call('line', func_get_args());\n\t}", "public function getLineId(): int\n {\n return $this->lineId;\n }", "public function getOutputLine($lineNumber);", "protected function getLineHeader($line) {\n\t\treturn Billrun_Factory::db()->logCollection()->query(array('header.stamp' => $line['log_stamp']))->cursor()->current();\n\t}", "function get_line(&$format)\n{\n\tif (mb_strlen($format) === 0)\n\t\treturn false;\n\t\n\t$pos = mb_strpos($format, \"\\r\");\t\n\tif ($pos !== false)\n\t\t$format = mb_substr($format, 0, $pos) . mb_substr($format, $pos + 1);\n\t\n\t$pos = mb_strpos($format, \"\\n\");\n\t\n\tif ($pos === false)\n\t\t$pos = mb_strlen($format);\n\t\n\t$line = mb_substr($format, 0, $pos);\n\t$format = mb_substr($format, $pos + 1);\n\treturn $line;\n}", "private function getFileLine($file, $line)\n {\n if (!array_key_exists($file, $this->fileCache)) {\n $this->fileCache[$file] = file($file);\n }\n\n return trim($this->fileCache[$file][$line]);\n }", "public function getAddressLine1(): ?string;", "public function getLine()\n\t{\n\t\treturn $this->token->line;\n\t}", "public function getLine($lineId);", "public function getLine(int $index) : string\n {\n return isset($this->lines[$index]) ? $this->lines[$index] : '';\n }", "public function getLine();", "public function getLine();", "public function getLine();", "public function getLine();", "public function getLine() {\r\n return $this->node->getLine();\r\n }", "public static function readCodeLine(string $file, int $line): ?string\n {\n $lines = @file($file);\n return $lines[$line - 1] ?? null;\n }", "private function nextLine()\n\t{\n\t\treturn array_shift($this->buffer);\n\t}", "public function line($text) { return $this->l($text); }", "public function getAddressLine3(): ?string;", "public function getAddressLine2(): ?string;", "public function getLine(): int\n\t{\n\t\treturn $this->err->getLine();\n\t}", "public function getLine(): int;", "private function getNextLine()\n {\n return fgets($this->fileDescriptor, 4096);\n }", "final function getLine();", "final public function getLine()\n {\n return 25;\n }", "public function getLineNumber()\n\t{\n\t\treturn $this->lineNumber;\n\t}", "public function getLeaderLineOffset() {}", "public function getLinea()\n {\n return $this->linea;\n }", "function findAddress($lines) {\n //Finds address by searching for finding line with a zipcode, and then concatenating the previous line with that line. This is prone to errors, however, and is only used as an example for showing how the script would work. A better method would involve leveraging existing APIs, such as Google's GeoCoding API.\n for($i = 0; $i<count($lines); $i++) {\n if(preg_match('/[0-9]{5}/', $lines[$i])) {\n return [$lines[$i-2], $lines[$i]];\n }\n }\n return \"\";\n}", "protected function getPhoneLine($number)\n {\n\n if (isset($this->phoneLines[$number])) {\n\n return $this->phoneLines[$number];\n }\n\n $phoneLine = $this->phoneLineRepo->find($number);\n\n if (!$phoneLine) {\n $phoneLine = new PhoneLine();\n $phoneLine->setNumber($number);\n $this->eManager->persist($phoneLine);\n }\n\n $this->phoneLines[$number] = $phoneLine;\n\n return $phoneLine;\n }", "public function readAtLine($index) {\r\n\t\tif ($this->exists && $index < $this->lines) {\r\n\t\t\t\r\n\t\t\t$lines = $this->readByLine ();\r\n\t\t\treturn trim ( $lines [$index] );\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function getLine1(): ?string\n {\n return $this->line1;\n }", "public function getLine1(): ?string\n {\n return $this->line1;\n }", "public function getFileLink(string $file, int $line) {\n if ($fmt = $this->fileLinkFormat) {\n return \\is_string($fmt) ? strtr($fmt,\n ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line);\n }\n\n return FALSE;\n }", "public function getStartLine(): int\n {\n return $this->node->getStartLine();\n }", "function getLine()\n {\n if($this->parseFile)\n {\n if(!feof($this->fid))\n {\n do\n {\n $line = trim(fgets($this->fid));\n }\n while(!feof($this->fid) && !$line);\n return $line;\n }\n return FALSE;\n }\n else\n {\n do\n {\n $line = trim($this->bibtexString[$this->currentLine]);\n $this->currentLine++;\n }\n while($this->currentLine < count($this->bibtexString) && !$line);\n return $line;\n }\n }", "public function getCalloutLine() {}", "public function getFirstLine(): ?int {\n return $this->firstLine;\n }", "public function getStartLine(): int\n {\n return $this->node->getAttribute('startLine');\n }", "public function getLineInfo() {\n return $this->get(self::LINE_INFO);\n }", "public function readByLine() {\r\n\t\tif ($this->exists) {\r\n\t\t\t\r\n\t\t\t$lines = file ( $this->filename ); // file in to an array\r\n\t\t\treturn $lines; // line 2\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function getLine1()\n {\n return (string) $this->json()->line1;\n }", "public function line($value) {\n return $this->setProperty('line', $value);\n }", "public function line($value) {\n return $this->setProperty('line', $value);\n }", "public function line($value) {\n return $this->setProperty('line', $value);\n }", "public function line($value) {\n return $this->setProperty('line', $value);\n }", "public function readLine(){\n\t\t\n\t\t$line = '';\n\t\tif( ($offset = strpos($this->data, \"\\r\\n\", 0)) !== false){\n\t\t $line = substr($this->data,0,$offset);\n\t\t $this->data = substr($this->data,$offset+2);\n\t\t $this->_debug(\"line:$line\");\n\t\t $this->_debug(\"left>\\n{$this->data}\");\n\t\t ob_flush();\n\t\t}\n\t\t\n\t\treturn $line;\n\t}", "function readLine($position)\n {\n\n return isset($this->line[$position]) ? $this->line[$position] : '_';\n }", "public function startOfLine($line) \n {\n return preg_replace_callback(pmwiki_attachments::regular_expression,array($this,'replace_callback'),$line);\n }", "public function getTaxLine($lineNo)\n\t{\n\t\tif($this->getTaxLines() != null)\n\t\t{\n\t\t\tforeach($this->getTaxLines() as $taxLine)\n\t\t\t{\n\t\t\t\tif($lineNo == $taxLine->getLineNo())\n\t\t\t\t{\n\t\t\t\t\treturn $taxLine;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "static public function match($line) {\n\t\tpreg_match(self::MATCH, $line['source'], $matches);\n\t\treturn $matches;\n\t}", "function loadLine($a_row)\n\t{\n\t}", "public function get_message_part_line() {\n\n\t\t$line=false;\n\t\t$leftOver = $this->message_part_size-$this->message_part_read;\n\t\tif($leftOver>0){\n\n\t\t\t//reading exact length doesn't work if the last char is just one char somehow.\n\t\t\t//we cut the left over later with substr.\n\t\t\t$blockSize = 1024;//$leftOver>1024 ? 1024 : $leftOver;\n\t\t\t$line = fgets($this->handle,$blockSize);\n\t\t\t$this->message_part_read+=strlen($line);\n\t\t}\n\n\t\tif ($this->message_part_size < $this->message_part_read) {\n\n\t\t\t$line = substr($line, 0, ($this->message_part_read-$this->message_part_size)*-1);\n\t\t}\n\n\t\tif($line===false){\n\n\t\t\t//read and check left over response.\n\t\t\t$response=$this->get_response();\n\t\t\t$this->check_response($response);\n\n\t\t}\n\t\treturn $line;\n\t}", "public function getLineaId($id){\n\t\t\t$this->db->query(\"SELECT * FROM linea WHERE cod_linea=:id\");\n\n\t\t\t$this->db->bind(':id', $id);\n\n\t\t\treturn $this->db->single();\n\t\t}", "public function setLine($var)\n {\n GPBUtil::checkInt32($var);\n $this->line = $var;\n\n return $this;\n }", "public function getLineNumber(){\n if( $this->index ){\n return substr_count($this->input, \"\\n\", 0, $this->index) + 1;\n }\n return 1;\n }", "public function getLineItemId()\n {\n return $this->lineItemId;\n }", "public function getLine(): ?int;", "public function getOriginalLineNo(): int\n {\n return intval($this->originalLineNo);\n }", "protected function _getItemIdByLine($line)\n {\n return isset($this->_productGiftPair[$line->getLineCode()])\n ? $this->_productGiftPair[$line->getLineCode()]\n : $this->_lineToLineId[$line->getLineCode()];\n }", "public function getNewLineNo(): int\n {\n return intval($this->newLineNo);\n }", "public function currentLine();", "public function getLineName(): string\n {\n return $this->lineName;\n }", "function line($line = '')\n\t{\n\t\treturn ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];\n\t}", "public function getStartLine()\n\t{\n\t\treturn $this->startLine;\n\t}", "public function getLineA();", "public function startPositionFromCenter(int $line): int\n {\n\n $start = $line - $this->getHalf();\n\n return $start < 1 ? 1 : $start;\n\n }", "public function getLine4()\n {\n return (string) $this->json()->line4;\n }" ]
[ "0.7337679", "0.7311519", "0.72788274", "0.7116505", "0.7087814", "0.69932336", "0.6954411", "0.6954411", "0.6944314", "0.6925979", "0.6864805", "0.6864805", "0.6864805", "0.6864805", "0.6864805", "0.6864805", "0.68622935", "0.68578994", "0.68578994", "0.6829066", "0.6823132", "0.67263347", "0.6721415", "0.6659305", "0.6639396", "0.662742", "0.6598089", "0.6594455", "0.6593749", "0.65365815", "0.6530898", "0.6525464", "0.6462063", "0.6411824", "0.639964", "0.6367391", "0.6303344", "0.6295905", "0.6295188", "0.6263042", "0.6257373", "0.6222733", "0.61969256", "0.61969256", "0.61969256", "0.61969256", "0.6192461", "0.6129781", "0.6126122", "0.6120281", "0.61005545", "0.6099472", "0.6093897", "0.6032364", "0.60120153", "0.59802234", "0.5978858", "0.59470904", "0.59239864", "0.5922971", "0.58741295", "0.5867389", "0.5834073", "0.58229566", "0.58229566", "0.5819562", "0.58133566", "0.580109", "0.5787649", "0.5785021", "0.57744473", "0.57618284", "0.5733864", "0.5710518", "0.5704026", "0.5704026", "0.5704026", "0.5704026", "0.56803775", "0.56750655", "0.56739783", "0.56689626", "0.5667961", "0.566393", "0.5629735", "0.56270033", "0.5616717", "0.5604772", "0.5590936", "0.5571391", "0.5557148", "0.5547324", "0.5531795", "0.5522015", "0.55121326", "0.55114543", "0.54957324", "0.549203", "0.5467374", "0.54629296" ]
0.7488274
0
returns total number of lines that this IAddress may represent.
public function getLinesCount();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function numLines() {\r\n\t\treturn $this->lines;\r\n\t}", "protected function get_line_len()\n {\n return count($this->buffer);\n }", "public function getLineCount() {}", "public function numLines()\n {\n if($this->state['numlines']) {\n return $this->state['numlines'];\n } else {\n $numRows = self::numRowsInFile($this->vars['ifn']);\n if($numRows < 100){\n $numRows = self::numRowsInFileAccurate($this->vars['ifn'],$this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n }\n $this->state['numlines'] = $numRows;\n return $this->state['numlines'];\n }\n }", "public function countLines()\n {\n\n return count($this->file_array);\n }", "public function getLineInfoListCount() {\n return $this->count(self::LINE_INFO_LIST);\n }", "public function countLines();", "public function getAmountReadLines(): int {\n\t\treturn $this->_amountReadLines;\n\t}", "public function countLines()\n {\n return count(explode(PHP_EOL, $this->text));\n }", "public function getAmountProcessedLines(): int {\n\t\treturn $this->_amountProcessedLines;\n\t}", "abstract public function getNumExecutableLines();", "protected function _getNewLineCode()\n {\n return count($this->_lines) + 1;\n }", "public function getLineupCount()\n {\n return $this->count(self::_LINEUP);\n }", "public function getLineupCount()\n {\n return $this->count(self::_LINEUP);\n }", "public function getNbAddresses()\n\t{\n\t\tif ( $this->nb_addresses === null ) {\n\t\t\t$this->nb_addresses = gmp_strval(gmp_pow(2, $this->getMaxPrefix() - $this->prefix));\n\t\t}\n\t\treturn $this->nb_addresses;\n\t}", "public function getNumberOfEffectiveCodeLines()\n {\n return $this->numberOfEffectiveCodeLines;\n }", "public function getLongestLineNumberLength(): int\n {\n return 0;\n }", "public function getTotalBuslineNum() {\n return $this->get(self::TOTAL_BUSLINE_NUM);\n }", "public function CountAddresses() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\treturn 0;\n\n\t\t\treturn Address::CountByPersonId($this->intId);\n\t\t}", "function nbLine($req) {\r\n $crs = $this->query($req) ;\r\n return count($crs->fetchAll()) ;\r\n }", "public function countUsed() {\n\n $result = Db::getInstance(_EPH_USE_SQL_SLAVE_)->getValue(\n (new DbQuery())\n ->select('COUNT(*)')\n ->from('address')\n ->where('`' . bqSQL(static::$definition['primary']) . '` = ' . (int) $this->id)\n );\n\n return $result;\n }", "abstract public function getNumExecutedLines();", "public function getLinesToCache()\n {\n $value = $this->_config->get('dataprocessing/general/cache_lines');\n\n if ($value === null) {\n $value = 200;\n }\n\n return (int)$value;\n }", "public function import_get_nb_of_lines($file)\n\t{\n // phpcs:enable\n return dol_count_nb_of_line($file);\n }", "public function getLineNumber(){\n if( $this->index ){\n return substr_count($this->input, \"\\n\", 0, $this->index) + 1;\n }\n return 1;\n }", "abstract protected function getLineLength(): int;", "public function getTotalLines() {\n\t\t\n\t\tif(filesize($this->logFilename) < $this->chunkSize) {\n\t\t\t$data = file($this->logFilename); \n\t\t\treturn count($data); \n\t\t}\n\t\t\n\t\tif(!$fp = fopen($this->logFilename, \"r\")) return 0;\n\t\t$totalLines = 0;\n\n\t\twhile(!feof($fp)) { \n\t\t\t$data = fread($fp, $this->chunkSize);\n\t\t\t$totalLines += substr_count($data, \"\\n\"); \n\t\t}\n\t\t\n\t\tfclose($fp); \n\t\t\n\t\treturn $totalLines;\n\t}", "public function count() {\n \n return $this->getLength();\n }", "public function getTotal(): int\n {\n if (isset($this->contents)) {\n return count($this->contents);\n }\n\n return 0;\n }", "public function hasLines(){\n return $this->_has(38);\n }", "public function count() {\n\t\treturn $this->length();\n\t}", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function length() {\n return $this->count();\n }", "public function length(){\n return sizeof($this->flights);\n }", "public function length() {\r\n return strlen($this->contents);\r\n }", "public function length()\n {\n return $this->count();\n }", "public function count()\n {\n return $this->length();\n }", "public function count() {\n return $this->length;\n }", "public function getLine_numbers()\n\t{\n\t\treturn $this->getParser()->line_numbers;\n\t}", "public function getTotalLength() {}", "public function getTotalLength() {}", "public function total_rsegments()\n\t{\n\t\treturn count($this->rsegments);\n\t}", "public function count()\n {\n return $this->length;\n }", "public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }", "public function getNumberOfEntries()\n {\n return $this->numberOfEntries;\n }", "public function count()\n\t{\n\t\tif( $this->isDynamic )\n\t\t\tmwarning('unsupported with Dynamic Address Groups');\n\t\treturn count($this->members);\n\t}", "public function length()\n {\n return count($this->__data);\n }", "public function getLength() : int\n {\n return $this->b[$this->offset];\n }", "public function total_notes()\n {\n $count = 0;\n\n foreach($this->sites as $site)\n $count = $count + $site->notes->count();\n\n return $count;\n }", "public function count()\n {\n return $this->length();\n }", "function CellCount() {\n return $this->rows[$this->LastRow]->CellCount();\n }", "function amount() {\n\t\treturn sizeof($this->data);\n\t}", "public function size() {\n return n(count($this->value()));\n }", "public function size()\n {\n return sizeof($this->errorList);\n }", "function countAddedLines()\n {\n }", "public function getNumberOfRows() {\n return count($this->rows);\n }", "public function getTotalLength();", "public function getTotalLength();", "public function count() {\n return sizeof($this->data);\n }", "public function count() {\n return sizeof($this->data);\n }", "public function count() {\n return sizeof($this->data);\n }", "public function count()\n {\n return $this->length;\n }", "public function lcs() {\n $lcs = 0;\n foreach ($this->edits as $edit) {\n if ($edit->type == 'copy') {\n $lcs += sizeof($edit->orig);\n }\n }\n return $lcs;\n }", "public function count(): int\n {\n return $this->blocks->count();\n }", "public function getLineNr()\n {\n return $this->lineNr;\n }", "public static function linesCount($path)\n\t{\n\t\t$lines = 0;\n\t\tif (stripos(php_uname(), 'windows') !== false) {\n\t\t\t$handle = fopen($path, 'rb');\n\t\t\twhile (!feof($handle)) {\n\t\t\t\t$lines += substr_count(fread($handle, 8192), \"\\n\");\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t} else {\n\t\t\t$lines = intval(exec(\"wc -l '$path'\"));\n\t\t}\n\t\treturn $lines;\n\t}", "public function getContentsCount()\n {\n return $this->count(self::_CONTENTS);\n }", "public function getContentsCount()\n {\n return $this->count(self::_CONTENTS);\n }", "public function getContentsCount()\n {\n return $this->count(self::_CONTENTS);\n }", "protected function get_length(): int\n\t{\n\t\treturn $this->end - $this->start + 1;\n\t}", "public function getLongestLineLength(): int\n {\n return 0;\n }", "public function getMaximumLineLength() {}", "public function size() \n {\n return count($this->_entries);\n }", "public function getLine(): int\n {\n return $this->line;\n }", "public function getLine(): int\n {\n return $this->line;\n }", "function length() {\r\n return $this->count();\r\n }", "public function count()\n {\n return sizeof($this->getData());\n }", "function spectra_address_count ()\n\t{\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT COUNT(*) AS `found` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"` WHERE 1\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"found\"]) || $result[\"found\"] == 0)\n\t\t{\n\t\t\treturn \"Unknown\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"found\"];\n\t\t}\n\t}", "public function count() {\n\t \treturn sizeof($this->links);\n\t}", "public function recordCount()\n {\n return sizeof($this->getRecords());\n }", "function ozh_wbsu_get_number_of_lines($file_to_read) {\n $file = new \\SplFileObject($file_to_read, 'r');\n $file->seek(PHP_INT_MAX);\n return ($file->key() + 1);\n}", "public function count() {\n return count($this->__rows__);\n }", "public function getContentsCount() {\n return $this->count(self::CONTENTS);\n }", "public function count()\n\t\t{\n\t\t\treturn count($this->source);\n\t\t}", "public function count() : int\n {\n return count($this->entries);\n }", "public function getLineTotalAmount()\n {\n return $this->lineTotalAmount;\n }", "public function length()\n {\n return strlen($this->buffer);\n }", "public function count()\n {\n return $this->__size;\n }", "public function length()\n\t{\n\t\treturn count($this->parts);\n\t}", "protected static function get_model_lines(){\n\n\t\treturn count(file(static::$models_dir.'/'.static::$table.EXT));\n\t}", "public function getMaxLineLength()\n {\n return $this->maxLineLength;\n }", "public function getCabinetCountAttribute()\n {\n return $this->cabinets->count();\n }", "public function hasLineNumber(){\n return $this->_has(4);\n }", "public function len()\n {\n return count($this->list);\n }", "public function size(): int {\n\t\treturn $this->count();\n\t}", "public function getRowCount() {\n return $this->Read->rowCount();\n }", "public function getInvalidRowsCount()\n {\n return count($this->_invalidRows);\n }", "public function count()\n {\n return count($this->entries);\n }", "public function count()\n {\n return count($this->rules);\n }", "public function RowCount() {\n return $this->_row == '' ? $this->_rown : $this->_rown + 1;\n }" ]
[ "0.7453195", "0.7152699", "0.7110588", "0.69877267", "0.68574244", "0.6773752", "0.67736185", "0.6763348", "0.6701279", "0.6659539", "0.6548277", "0.6416865", "0.6284988", "0.62838316", "0.6273335", "0.6235725", "0.6219744", "0.6163236", "0.615204", "0.61324376", "0.60941696", "0.59905636", "0.59790707", "0.59705126", "0.5952018", "0.5943612", "0.5906059", "0.5903941", "0.5894316", "0.58601767", "0.58506936", "0.5822302", "0.58148223", "0.5802907", "0.5796179", "0.57920384", "0.5785464", "0.5782691", "0.5752422", "0.5745439", "0.5745196", "0.574487", "0.574426", "0.5743296", "0.57405496", "0.573749", "0.5736019", "0.57275033", "0.57232153", "0.5711732", "0.57047373", "0.5684319", "0.568355", "0.56818384", "0.56786436", "0.56705475", "0.56696355", "0.56696355", "0.5661855", "0.5661855", "0.5661855", "0.5649104", "0.5648021", "0.5645794", "0.5636427", "0.56334364", "0.56313664", "0.56313664", "0.56313664", "0.5617373", "0.56115496", "0.5609788", "0.5606588", "0.5605979", "0.5605979", "0.56010485", "0.5600776", "0.5585715", "0.5578398", "0.5577985", "0.55716807", "0.55715567", "0.5570786", "0.557069", "0.55627054", "0.55511945", "0.55419344", "0.553377", "0.55290556", "0.552448", "0.55236185", "0.55226415", "0.5511748", "0.5499001", "0.5494473", "0.5489256", "0.5485745", "0.5478005", "0.5475816", "0.5469636" ]
0.7358888
1
returns postcode of the address.
public function getPostcode();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getBillingAddress()->getPostcode();\n }", "public function getPostcode(): string\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public static function addressPostalCode()\n {\n return new TextNode('address_postal_code');\n }", "public function getPostcode() \n {\n return $this->postcode;\n }", "public function getPostalcode();", "public function getPostCode() {\n return $this->postcode;\n }", "public function getPostalCode();", "public function getPostalCode();", "public function getPostalCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:pc', $this->node);\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }", "abstract public function postalCode();", "public function getPostalCode()\n\t{\n\t\treturn $this->postal_code;\n\t}", "public function getCodePostal()\n {\n return $this->codepostal;\n }", "public function getPostalCode()\n {\n return $this->postal_code;\n }", "public function getPostcode()\n {\n return $this->getParameter('billingPostcode');\n }", "private function getStorePostcode()\n {\n return $this->_scopeConfig->getValue('general/store_information/postcode');\n }", "public function getPostalCode()\n {\n return (string) $this->json()->postal_code;\n }", "public function getcodePostal() \n {\n return $this->codePostal;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostCode() {\n\t\treturn self::$_postCode;\n\t}", "public function getBillingPostcode()\n {\n return $this->getParameter('billingPostcode');\n }", "public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }", "public function getCodpostal()\r\n {\r\n return $this->codpostal;\r\n }", "public function getShippingPostcode()\n {\n return $this->getParameter('shippingPostcode');\n }", "public function getCodepostaltierce()\n {\n return $this->codepostaltierce;\n }", "public function getStreetNumber();", "public function getCode()\r\r\n\t{\r\r\n\t\treturn \"\";#getCountryFromIP($this->ip,\"code\");\r\r\n\t}", "public function address(): string\n {\n return $this->address;\n }", "public function getAddress(): string\n {\n return $this->address;\n }", "protected function getShippingPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getShippingAddress() ? $this->checkoutSession->getLastRealOrder()->getShippingAddress()->getPostcode() : null;\n }", "public function getAddressByPostCode(string $postCode): array {\n if (!preg_match('/^\\d{3}-?\\d{4}$/', $postCode))\n return '';\n $postCode = str_replace('-', '', $postCode);\n $addresses = json_decode(file_get_contents(X_APP_PATH . 'Data/address.json'), true);\n if (!isset($addresses[$postCode]))\n return '';\n return [\n 'prefectureCode' => $addresses[$postCode][0],\n 'address' => implode(' ', array_slice($addresses[$postCode], 1))\n ];\n }", "public function extractPostCodeForShippingRequest($addressObject)\n {\n $idState = $addressObject->id_state;\n $countryName = pSQL($addressObject->country);\n\n $regionName = State::getNameById($idState);\n\n $address = array(\n 'country' => $countryName,\n 'region' => $regionName,\n 'city' => pSQL($addressObject->city),\n 'address' => pSQL($addressObject->address1) . (($addressObject->address2) ? ' ' . pSQL($addressObject->address2) : ''),\n 'postcode' => pSQL($addressObject->postcode)\n );\n\n\n if ($this->isEnabledAutocompleteForPostcode($countryName)) {\n $dpdPostcodeAddress = new DpdGeopostDpdPostcodeAddress();\n $dpdPostcodeAddress->loadDpdAddressByAddressId($addressObject->id);\n $currentHash = $this->generateAddressHash($address);\n\n if (\n !empty($dpdPostcodeAddress->id_address) &&\n $currentHash == $dpdPostcodeAddress->hash\n ) {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n if (\n empty($dpdPostcodeAddress->id_address) ||\n $currentHash != $dpdPostcodeAddress->hash\n ) {\n $postcodeRelevance = new stdClass();\n $postCode = $this->search($address, $postcodeRelevance);\n\n $dpdPostcodeAddress->auto_postcode = $postCode;\n $dpdPostcodeAddress->id_address = $addressObject->id;\n\n $dpdPostcodeAddress->hash = $currentHash;\n if ($this->isValid($postCode, $postcodeRelevance)) {\n $dpdPostcodeAddress->relevance = 1;\n\n $addressObject->postcode = $postCode;\n $addressObject->save();\n\n } else {\n $dpdPostcodeAddress->relevance = 0;\n }\n\n if(!empty($dpdPostcodeAddress->dpd_postcode_id)){\n $dpdPostcodeAddress->id = $dpdPostcodeAddress->dpd_postcode_id;\n }\n $dpdPostcodeAddress->save();\n } else {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n\n } else {\n $postCode = $addressObject->postcode;\n }\n\n return $postCode;\n }", "public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}", "public function getPostcodePart($part = IAddress::POSTCODE_PART_ONE);", "public function getCodigo_postal()\n {\n return $this->codigo_postal;\n }", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public function getPostalCode(): ?string;", "function address() { return ($this->address); }", "public function getPostalCode(): ?string\n {\n return $this->_postal_code;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalCode() : ?string \n {\n if ( ! $this->hasPostalCode()) {\n $this->setPostalCode($this->getDefaultPostalCode());\n }\n return $this->postalCode;\n }", "function postcode_to_district ($postcode) {\n\n\t\t$reg = array();\n\t\t$postcode = trim($postcode);\n\t\tpreg_match('/^(.+?)([0-9][a-z]{2})$/',$postcode, $reg);\n\t\n\t\t$clean_postcode = trim($reg[1]);\n\t\t$clean_postcode = strtoupper($clean_postcode);\n\n\t\treturn $clean_postcode;\n\n\t}", "function postCode($string) {\n\n\n\t\t}", "public function get_postal()\n {\n return $this->_postal;\n }", "function get_postcode_location($zip, $country){\n\n\t\t$url = \"http://geo.localsearchmaps.com/?zip={zip}&country={country}\";\n\t\t$url = str_replace('{zip}', urlencode($zip), $url);\n\t\t$url = str_replace('{country}', urlencode($country), $url);\n\t\t\n\t\t$data = safe_scrape_cached($url);\n\t\t\n\t\treturn process_emag_geocoder($data);\n\t}", "public function getEmpCodePostal() {\n return $this->empCodePostal;\n }", "public function getAddress();", "public function getAddress();", "public function getAddress() {}", "public function getPostcodeAnywhereId();", "public function getAddress()\n {\n return $this->get('address')->value;\n }", "public function getAddressId() \n {\n return $this->address_id;\n }", "public function getAddress(){\r\n\t\treturn $this->address;\r\n\t}", "public function getAddress()\r\n {\r\n return $this->address;\r\n }", "static function get_address($code){\n \t$address = DB::table('es_mx')\n\t\t ->select('id','colony','state','town','country','code','postal_code')\n ->where('postal_code','=',$code)->get()->toArray();\n\n\t return $address;\n }", "public function getAddress()\n {\n \treturn $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->address;\n\t}", "public function getAddress()\n {\n if (array_key_exists(\"address\", $this->_propDict)) {\n return $this->_propDict[\"address\"];\n } else {\n return null;\n }\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function zipCode(): string\n {\n return $this->getData('ZipCode');\n }", "public function getAddress() {\n //return the value address\n return $this->Address;\n }", "public function getAddressName()\n {\n return $this->_addressName;\n }", "public function getEtblCodePostal() {\n return $this->etblCodePostal;\n }", "public function getAddress() {\n return $this->address;\n }", "public function getAddress() {\n\t\treturn $this->address;\n\t}", "public function getAddress() {\n\t\treturn $this->address;\n\t}", "function getFieldPortalAddressPostCode($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_postcode');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_postcode');\n\t\t$tooltip = setToolTipNotification(\"postcode\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('postcode') === 'postcode' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><input type='text' name='postcode' value='\".$value.\"' id='postcode' class='srms-field \".(get_axl_req_fields('postcode') === 'postcode' ? 'input-text-required' : '').\"'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function geocode(Address $address);", "public function getCodePostal():?int\n {\n return $this->codePostal;\n }", "public function getAddress() {\n\n return $this->address;\n\n }" ]
[ "0.80491596", "0.76735604", "0.7664224", "0.7664224", "0.7664224", "0.7544685", "0.75357187", "0.75156426", "0.74146473", "0.74019563", "0.74019563", "0.7268599", "0.7217776", "0.71228445", "0.7110134", "0.70700324", "0.70671916", "0.70545393", "0.69945693", "0.69760925", "0.6974993", "0.6974993", "0.6974993", "0.6974993", "0.6840118", "0.67593324", "0.67350656", "0.658703", "0.657781", "0.6567692", "0.654436", "0.6526148", "0.6458512", "0.6446998", "0.64109665", "0.64047736", "0.64024436", "0.6401255", "0.63943374", "0.6381299", "0.63765925", "0.63595456", "0.6341863", "0.63207555", "0.632075", "0.632075", "0.6257455", "0.62428004", "0.62219656", "0.6217888", "0.618829", "0.6182754", "0.61804444", "0.61804444", "0.6154235", "0.6149354", "0.6144196", "0.61258495", "0.6120971", "0.6112462", "0.61113584", "0.6095029", "0.6080635", "0.6079999", "0.6079999", "0.60787183", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.6075349", "0.60700613", "0.60366136", "0.6030284", "0.60283816", "0.6023313", "0.60178554", "0.60178554", "0.6005974", "0.59993446", "0.5947047", "0.5945946" ]
0.7741459
1
returns one part of the postcode. Most commonly first part of postcode may be used independently. Also may be used to retrieve a second part.
public function getPostcodePart($part = IAddress::POSTCODE_PART_ONE);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPostcode();", "function ExtractMatchString( $Postcode )\n{\n\t$SpacePos = strpos( $Postcode, \" \" );\n\tif( $SpacePos )\n\t{\n\t\tif( substr( $Postcode, $SpacePos + 1, 1) == \" \" )\n\t\t{\n\t\t\treturn substr( $Postcode, 0, $SpacePos + 1 ) . substr( $Postcode, $SpacePos + 2\t, 1 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn substr( $Postcode, 0, $SpacePos + 2 );\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn substr( $Postcode, 0, 4 ) . \" \".substr( $Postcode, 4\t, 1 );\n\t\t#return false;\n\t}\n}", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode() \n {\n return $this->postcode;\n }", "public function getPostcode(): string\n {\n return $this->postcode;\n }", "public function getPostCode() {\n return $this->postcode;\n }", "protected function getPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getBillingAddress()->getPostcode();\n }", "public function get($postcode);", "public function getPostalcode();", "public function getCodePostal()\n {\n return $this->codepostal;\n }", "public function getCodepostaltierce()\n {\n return $this->codepostaltierce;\n }", "public function getPostalCode();", "public function getPostalCode();", "public function getPostcodeAnywhereId();", "public function getPostcode()\n {\n return $this->getParameter('billingPostcode');\n }", "private function getStorePostcode()\n {\n return $this->_scopeConfig->getValue('general/store_information/postcode');\n }", "public function getPostalCode(): ?string;", "public function getcodePostal() \n {\n return $this->codePostal;\n }", "abstract public function postalCode();", "public function getPostalCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:pc', $this->node);\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }", "function mapit_get_location($postcode, $partial = null) {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.get_location', $params);\n return $result;\n}", "public function getCodpostal()\r\n {\r\n return $this->codpostal;\r\n }", "public function getPostCode() {\n\t\treturn self::$_postCode;\n\t}", "public function getAddressByPostCode(string $postCode): array {\n if (!preg_match('/^\\d{3}-?\\d{4}$/', $postCode))\n return '';\n $postCode = str_replace('-', '', $postCode);\n $addresses = json_decode(file_get_contents(X_APP_PATH . 'Data/address.json'), true);\n if (!isset($addresses[$postCode]))\n return '';\n return [\n 'prefectureCode' => $addresses[$postCode][0],\n 'address' => implode(' ', array_slice($addresses[$postCode], 1))\n ];\n }", "public function getPostalCode()\n\t{\n\t\treturn $this->postal_code;\n\t}", "public function findByPostcode(int $postcode): ?ProvinceContract;", "public function getPostalCode()\n {\n return $this->postal_code;\n }", "public function getPostalCodesPart2($postal_code) {\r\n\t\t$codes = $this->StreetAddress->getPostalCodesPart2($postal_code);\r\n\t\t$return = array();\r\n\t\tforeach ($codes as $code) {\r\n\t\t\t$return[] = $code['StreetAddress']['postal_code2'];\r\n\t\t}\r\n\t\t$this->set('codes', $return);\r\n\t\t$this->set('_serialize', array('codes'));\r\n\t}", "public function first()\n {\n if ($this->getNumParts() < 1) {\n return null;\n }\n\n return $this->identifierParts[0];\n }", "public function getDepartement(){\n return substr($this->zipcode,0,2);\n }", "public function getPlate1()\n {\n return isset($this->plate1) ? $this->plate1 : null;\n }", "function get_pre($string, $offset = false) {\r\n\t\tif($offset === false) {\r\n\t\t\t$offset = strlen($string);\r\n\t\t}\r\n\t\t$pre_code = substr($string, 0, $offset);\r\n\t\t$ancestryArray = OM::getAncestryArray($pre_code, strlen($pre_code));\r\n\t\tif(sizeof($ancestryArray) > 0) {\r\n\t\t\t//print('here834954950<br>');\r\n\t\t\t$pre = substr($pre_code, 0, $ancestryArray[sizeof($ancestryArray) - 1][2] + strlen($ancestryArray[sizeof($ancestryArray) - 1][1]));\r\n\t\t\treturn $pre;\r\n\t\t} else {\r\n\t\t\t//print('here834954951<br>');\r\n\t\t\t// get the code up to the first tag\r\n\t\t\tpreg_match('/(.*?)<\\w/is', $string, $pre_first_tag_matches);\r\n\t\t\t$pre_first_tag = $pre_first_tag_matches[1];\r\n\t\t\treturn $pre_first_tag;\r\n\t\t\t//return \"\";\r\n\t\t}\r\n\t}", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getStreet1(): ?string\n {\n return $this->_street1;\n }", "private function retrieve_pt_single() {\n\t\t$replacement = null;\n\n\t\t$name = $this->determine_pt_names( 'single' );\n\t\tif ( isset( $name ) && $name !== '' ) {\n\t\t\t$replacement = $name;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getBillingPostcode()\n {\n return $this->getParameter('billingPostcode');\n }", "function get_first_paragraph($_id_post){\n\t\n\t$post = get_post($_id_post);\n\n\t$text = $post->post_content;\n\n\t$start = strpos($text, '<p>'); // Locate the first paragraph tag\n\t$end = strpos($text, '</p>', $start); // Locate the first paragraph closing tag\n\t$text = substr($text, $start, $end-$start+4); // Trim off everything after the closing paragraph tag\n\t$text = strip_shortcodes( $text ); // Remove shortcodes\n\t$text = apply_filters('the_content', $text); // remove tag html by wp\n\t$text = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $text);\t // Remove tag script\n\t$text = wpautop( $text );\t// Remove break\n\t$text = strip_tags($text);\t// Remove tags html\n\n\treturn $text ;\n\t \n}", "public function getShippingPostcode()\n {\n return $this->getParameter('shippingPostcode');\n }", "public function getPlate1CountryDesc()\n {\n return isset($this->plate1CountryDesc) ? $this->plate1CountryDesc : null;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function get_postal()\n {\n return $this->_postal;\n }", "public function getAddressLine1(): ?string;", "public function getEmpCodePostal() {\n return $this->empCodePostal;\n }", "function get_postcode_location($zip, $country){\n\n\t\t$url = \"http://geo.localsearchmaps.com/?zip={zip}&country={country}\";\n\t\t$url = str_replace('{zip}', urlencode($zip), $url);\n\t\t$url = str_replace('{country}', urlencode($country), $url);\n\t\t\n\t\t$data = safe_scrape_cached($url);\n\t\t\n\t\treturn process_emag_geocoder($data);\n\t}", "function map_postalcode($postalcode)\r\n\t{\r\n\t\t// query postalcode DB\r\n\t\t$sql = '\r\n\t\t\tSELECT PostalCode, Latitude, Longitude\r\n\t\t\tFROM canada_codes\r\n\t\t\tWHERE PostalCode LIKE \"'.$this->db->escape_like_str($postalcode).'%\"\r\n\t\t\tLIMIT 1';\r\n\r\n\t\t//TODO error handle where no results are returned\r\n\r\n $sql_query = $this->db->query($sql);\r\n\t\tif($sql_query->num_rows() > 0){\r\n\r\n foreach($sql_query->result_array() as $row){\r\n\t\t\t\t$data[] = $row;\r\n }\r\n\r\n\r\n return $data;\r\n\r\n }else{\r\n return \"No results found\";\r\n }\r\n\r\n\t}", "public function getPostalCode(): ?string\n {\n return $this->_postal_code;\n }", "public function getPostalCode()\n {\n return (string) $this->json()->postal_code;\n }", "public function part($offset)\n {\n if (! isset($this->identifierParts[$offset])) {\n return null;\n }\n\n return $this->identifierParts[$offset];\n }", "function postcode_to_district ($postcode) {\n\n\t\t$reg = array();\n\t\t$postcode = trim($postcode);\n\t\tpreg_match('/^(.+?)([0-9][a-z]{2})$/',$postcode, $reg);\n\t\n\t\t$clean_postcode = trim($reg[1]);\n\t\t$clean_postcode = strtoupper($clean_postcode);\n\n\t\treturn $clean_postcode;\n\n\t}", "public static function getMainPart(){\n return (isset(self::$gets [self::KEY_MAIN]))?\n self::$gets [self::KEY_MAIN] : '';\n }", "public function getAddress1()\n {\n return $this->getValue('nb_icontact_prospect_address_1');\n }", "public function getDynamicOrigin($postcode, $storeId = null)\n {\n\treturn Mage::getSingleton('temando/warehouse')->getCollection()->getOriginByPostcode($postcode, $storeId);\n }", "protected function readPart()\n {\n $tmpSize = \"\";\n\n while(($read = (string)$this->read(1)) != \"\\n\") {\n $tmpSize .= $read;\n\n if ($this->eof()) {\n return null;\n }\n }\n\n $size = hexdec(trim($tmpSize));\n\n if ($size > 0) {\n $part = $this->read($size);\n } else {\n $part = \"\";\n }\n\n while($this->read(1) != \"\\n\") {\n if ($this->eof()) {\n return null;\n }\n }\n\n return $part;\n }", "public function getAddressLine3(): ?string;", "public function getCodeArticle1() {\n return $this->codeArticle1;\n }", "public function extract(): ?string\n {\n $this->assertShortCodesAreProvided();\n\n foreach ($this->extractors() as $extractor) {\n if ($extractor->hasMatch()) {\n return $extractor->extract();\n }\n }\n\n return null;\n }", "public function getAddressLine2(): ?string;", "public function getFirstParagraph()\n {\n return substr(\n $this->markdown_description,\n strpos(\n $this->markdown_description,\n \"<p\"\n ),\n strpos(\n $this->markdown_description,\n \"</p>\"\n )+4\n );\n\n }", "public function getStreetNumber();", "public function getExcerpt($nb = NULL)\n {\n if ($this->getResume() != NULL) return $this->getResume();\n \n $text = $this->getTexte();\n $excerpt = substr($text, 0, $nb);\n $excerpt = substr($excerpt, 0, strrpos($excerpt, \" \"));\n $etc = \"...\";\n $excerpt = $excerpt.$etc;\n return $excerpt;\n }", "function postalCode($postcode)\n {\n return (bool)preg_match('/^(H-)?\\d{4}$/', $postcode);\n }", "function getTelefone($fone){\n\t$telefone = substr($fone, 2);\n\treturn $telefone;\n}", "public function getPart($name)\n {\n if (array_key_exists($name, $this->parts)) {\n return $this->parts[$name];\n }\n }", "public static function get_first_snippet( int $post_id ) {\n\n\t\t$snippets = self::get_snippets( $post_id );\n\t\t$snippets = array_values( $snippets );\n\n\t\tif ( isset( $snippets[0] ) ) {\n\t\t\treturn $snippets[0];\n\t\t}\n\n\t\treturn new Rich_Snippet();\n\t}", "public function getAddress1()\n {\n return parent::getValue('address1');\n }", "public function getCodpostal0()\n {\n return $this->hasOne(Codpostal::className(), ['codpostal' => 'codpostal']);\n }", "private function get($part)\n {\n return $this->parts[$part];\n }", "public function first(): string;", "public function getPostNumber() :string\n {\n return $this->postNumber;\n }", "private function getPostcodeFromDB($postcode)\n {\n return $this->getDoctrine()\n ->getRepository('AppBundle:Postcode')\n ->findOneBy(['postcode' => $this->removeWhiteSpaceFromPostcode($postcode)]);\n }", "protected function getShippingPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getShippingAddress() ? $this->checkoutSession->getLastRealOrder()->getShippingAddress()->getPostcode() : null;\n }", "public function getPlate1Country()\n {\n return isset($this->plate1Country) ? $this->plate1Country : null;\n }", "public function getZipCode($vzipcode) {\n\n $this->db->select('id, street, complement, district, city, state');\n $this->db->from('state_sp');\n $this->db->where('postalcode =', $vzipcode);\n $query = $this->db->get();\n\n if ($query->result()) {\n $row = $query->result()[0];\n } else {\n $row = FALSE;\n }\n\n /* print \"<pre>\";\n print_r($row);\n print \"</pre>\";\n exit(); */\n //\n return $row;\n }", "public function getCittaPartenza() {\n if (isset($_REQUEST['citta_partenza'])) {\n return $_REQUEST['citta_partenza'];\n } else\n return 0;\n }", "public function getStreetAddress1()\n {\n return $this->street_address_1;\n }", "public function getLatLngForPostcode($postCode) {\n $data = array(\n 'lat' => '',\n 'lng' => '',\n );\n $commonModel = new CommonHelper();\n $latlngResponse = $commonModel->getLatLngFromPostCode($postCode);\n if ($latlngResponse['status']) {\n $data['lat'] = $latlngResponse['data']['lat'];\n $data['lng'] = $latlngResponse['data']['lng'];\n }\n return $data;\n }", "protected function getContentPartNumber(): string\n {\n $partNumber = $this->getPartNumber();\n if (0 === \\count($this->getParts())) {\n $partNumber .= '.1';\n }\n\n return $partNumber;\n }", "public function getFirstLetter()\n {\n return $this->data['fields']['first_letter'];\n }", "public function getLatLngFromPostCode($postCode) {\n $response = array(\n 'status' => false,\n 'message' => '',\n 'data' => array(\n 'lat' => '',\n 'lng' => ''\n )\n );\n try {\n $client = new Client();\n $res = $client->request('GET', 'http://api.postcodes.io/postcodes/'.$postCode);\n if($res->getStatusCode() == '200') {\n $responseBody = json_decode($res->getBody(), true);\n if (isset($responseBody['result'])\n && isset($responseBody['result']['latitude'])) {\n $response['data']['lat'] = $responseBody['result']['latitude'];\n $response['data']['lng'] = $responseBody['result']['longitude'];\n $response['status'] = true;\n }\n } else {\n $response['message'] = $responseBody['error'];\n }\n } catch (Exception $ex) {\n $response['message'] = $ex->getMessage();\n self::event($ex->getMessage() . \"|\" . $ex->getLine(), self::POSTCODEAPI_LOG_FILE, self::DAILY);\n }\n return $response;\n }", "function tep_get_prid($uprid) {\n $pieces = explode('{', $uprid);\n\n return $pieces[0];\n }", "public function getAddressByZipCode($zip_code)\r\n\t{\r\n\t\t//echo \"Obtener direccion a partir del CP Model\"; exit;\r\n\r\n\t\t$sql = new Sql($this->dbAdapter);\r\n\t\t$select = $sql->select();\r\n\t\t$select->from(array('n' => 'neighborhood'));\r\n\t\t$select->columns(array('id_neighborhood' => 'id','colony','postal_code', 'district_id', 'state_id'));\r\n\t\r\n\t\t//$select->join(array('i_u'=>'users_details'),'users.id = i_u.id_user',array('id_user','name','surname', 'campus', 'phone', 'addres','image','pin','key_inventory'), 'Left');\r\n\t\t\r\n\t\t$select->where(array('n.postal_code' => $zip_code ));\r\n\r\n\t\t$selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result=$execute->toArray(); \r\n\r\n\t\t//echo \"<pre>\";print_r($result);exit;\r\n\t\treturn $result;\r\n\t}", "public function getAddress1()\n {\n return $this->address1;\n }", "public function getAddress1()\n {\n return $this->address1;\n }", "function getLongLat($postcode){\n\t//This function first checks the postcodesdetailed table for the long/lat\n\t//If not found, uses the Google Geocoding API to calculate and updates the postcodesdetailed table\n\t$db = new DB;\n\t//$postcode = \"DY5 2UA\";\n\t$object = new stdClass();\n\t\n\t$postcode = trim($postcode);\n\t//Check to see if postcode exists in postcodesdetailed table\n\t$postcode_a = strtoupper(str_replace(\" \",\"\",$postcode));\n\t$postcode_a = addslashes($postcode_a);\n\t$db->query(\"SELECT pdLat, pdLong FROM postcodesdetailed WHERE pdPostcode = '$postcode_a'\");\n\t$db->next_record();\n\tlist ($pdLat, $pdLong) = $db->Record;\n\t\n\tif (($pdLat != '') && ($pdLong != '')){\n\t\t$object->long = $pdLong;\n\t\t$object->lat = $pdLat;\n\t\t$object->status = \"OK\"; //Should return 'OK' if everything fine\n\t} else {\n\t\t\n\t\t$address = str_replace(\" \", \"+\", $postcode);\n\t\t$url = \"http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=UK\";\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t$response_a = json_decode($response);\t\n\t\t\n\t\t$object->long = $response_a->results[0]->geometry->location->lng;\n\t\t$object->lat = $response_a->results[0]->geometry->location->lat;\n\t\t$object->status = $response_a->status; //Should return 'OK' if everything fine\n\t\t\n\t\t//If Long & Lat, INSERT into postcodesdetailed table so that next time we won't need to use the Google API\n\t\tif ($response_a->status == 'OK'){\n\t\t\t$db->query(\"INSERT INTO postcodesdetailed SET pdPostcode='\".$postcode_a.\"', pdLat='\".$object->lat.\"', pdLong='\".$object->long.\"'\");\n\t\t}\n\t}\n\t\n\t/* Status codes\n\t\t- \"OK\" - No Errors.\n\t\t- \"ZERO_RESULTS\" - successful but returned no results. Invalid address or a latlng in a remote location.\n\t\t- \"OVER_QUERY_LIMIT\" - indicates that you are over your quota.\n\t\t- \"REQUEST_DENIED\" - request was denied, generally because of lack of a sensor parameter.\n\t\t- \"INVALID_REQUEST\" - indicates that the query (address or latlng) is missing.\n\t\t- UNKNOWN_ERROR - request could not be processed due to a server error. The request may succeed if you try again.\n\t*/\n\t//var_dump($response_a);\n\treturn $object;\n}", "function getFieldStreetAddressPostCode($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_spostcode');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_spostcode');\n\t\t$tooltip = setToolTipNotification(\"spostcode\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('spostcode') === 'spostcode' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='spostcode' id='spostcode' value='\".$value.\"' class='srms-field \".(get_axl_req_fields('spostcode') === 'spostcode' ? 'input-text-required' : '').\"'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "private function getPartInstanceFromBarcode($barcode, $bl, &$errorBL = \"\")\n\t{\n\t\t$pi = null;\n\t\t$isNonSerialised = false;\n\t\t$isSerialised = false;\n\n\t\ttry {\n\t\t\t$isNonSerialised = BarcodeService::validateBarcode($barcode,BarcodeService::BARCODE_REGEX_CHK_PART_TYPE);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{}\n\n\t\ttry {\n\t\t\t$isSerialised = BarcodeService::validateBarcode($barcode,BarcodeService::BARCODE_REGEX_CHK_PART_INSTANCE);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{}\n\n\t\t//if BP\n\t\tif($isNonSerialised)\n\t\t{\n\t\t\t//check for BL\n\t\t\tif($bl==='')\n\t\t\t\t$errorBL = \"Invalid BL.Please Check the BL and try again.\";\n\n\t\t\tif(!$errorBL)\n\t\t\t{\n\t\t\t\tif($bl>\"\")\n\t\t\t\t{\n\t\t\t\t\t$warehouse = Factory::service('Warehouse')->getWarehouseByLocationBarcode($bl);\n\t\t\t\t\tif(!$warehouse instanceof Warehouse)\n\t\t\t\t\t\t$errorBL = \"Invalid BL.Please Check the BL and try again.\";\n\t\t\t\t}\n\n\t\t\t\t//get PartInstance based on BL\n\t\t\t\t$pis = Factory::service(\"PartInstance\")->searchPartInstanceByBarcodeAndPartcode($barcode, $barcode, null, 30, $warehouse, false, true);\n\t\t\t\tforeach ($pis as $pi)\n\t\t\t\t{\n\t\t\t\t\t//only un-reserved parts\n\t\t\t\t\tif (!$pi->getFacilityRequest() instanceof FacilityRequest)\n\t\t\t\t\t\treturn $pi;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($isSerialised)\n\t\t{\n\t\t\t$pi = Factory::service(\"PartInstance\")->searchPartInstanceByBarcodeAndPartcode($barcode, $barcode, null, 30, null, false, true);\n\t\t\tif($pi && count($pi)>0)\n\t\t\t{\n\t\t\t\treturn $pi[0];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function get_compartment(){\n $this->compartment = array_shift(Compartment::find_all(\" WHERE dead_no = '{$this->id}' LIMIT 1\"));\n if ($this->compartment) {\n return $this->compartment->description;\n } else {\n return \"Not specified\";\n }\n }", "public function getZipcode(): ?string\n {\n return $this->Zipcode ?? null;\n }", "public function getEtblCodePostal() {\n return $this->etblCodePostal;\n }", "function vcex_get_first_term( $post = '', $taxonomy = 'category', $terms = '' ) {\n\tif ( function_exists( 'wpex_get_first_term' ) ) {\n\t\treturn wpex_get_first_term( $post, $taxonomy, $terms );\n\t}\n}", "function get_single_region_itinerary($pid) {\n //print_r($pid); die();\n $sql = \"SELECT * FROM itinerary WHERE region_id='$pid' AND trip_id='0'\";\n $res = $this->mysqli->query($sql);\n return $res->fetch_array(MYSQLI_ASSOC);\n }", "public function getPBNO($dept){\t\n\n\t\t$response=$this->db->query(\"SELECT max(to_number(substr(FMD_PB_NO, instr(FMD_PB_NO,'-')+1))) PBNO \n\t\t\t\t\tFROM FILE_MV_DTL\n\t\t\t\t\tWHERE FMD_SENDER_DEPT = '$dept'\n\t\t\t\t\t\")->row(); \n\n if (isset($response))\n\t\treturn $response->PBNO; \n\t}", "public function getAddress1()\n {\n return $this->fv_address1;\n }", "function findByOutCode($postcode) {\n // TODO: Replace this with a PROPER incode/outcode splitter!!\n $outcode = str_replace(\" \",\"\",$postcode); // Remove space\n $outcode = substr($outcode,0,strlen($outcode)-3); // This should leave us with the postcode less the last 3 chars, the outcode\n \n $select = $this->select()\n ->from($this->_name,array('riskarea'))\n ->where('postcode = ?', $outcode)\n ->where('startdate < ?', date(\"Y-m-d\"))\n ->where('enddate > ?', date(\"Y-m-d\"));\n $row = $this->fetchRow($select);\n \n if(!empty($row))\n {\n $returnVal = $row->riskarea;\n }\n else {\n // Can't find by outcode - log a warning\n Application_Core_Logger::log(\"Can't find by outcode in table {$this->_name} (postcode = {$outcode})\", 'warning');\n $returnVal = null;\n }\n return $returnVal;\n }" ]
[ "0.65724015", "0.6407077", "0.62163806", "0.62163806", "0.62163806", "0.6196637", "0.61037743", "0.5887798", "0.56655985", "0.5664813", "0.5638105", "0.55547446", "0.5548867", "0.5503229", "0.5503229", "0.5502349", "0.54727036", "0.547207", "0.5423586", "0.5410096", "0.53800553", "0.5361851", "0.53287417", "0.53010744", "0.5290231", "0.52784574", "0.52732956", "0.527056", "0.52663803", "0.524817", "0.5224904", "0.5214046", "0.51824176", "0.51752555", "0.5150595", "0.5150595", "0.5150595", "0.5150595", "0.5140312", "0.51370734", "0.51246464", "0.5103413", "0.50906223", "0.50867945", "0.50714517", "0.50714517", "0.5058872", "0.5058741", "0.5051367", "0.50490683", "0.5045805", "0.5040878", "0.5038077", "0.5031047", "0.50258917", "0.501456", "0.50024337", "0.50016683", "0.49862257", "0.49860317", "0.4985867", "0.49757248", "0.4962201", "0.49521014", "0.4920034", "0.4905891", "0.49041247", "0.48850787", "0.48839217", "0.48792604", "0.48693818", "0.4850972", "0.48447883", "0.48355088", "0.48287502", "0.48167866", "0.48131794", "0.48116902", "0.48101747", "0.4807537", "0.48034686", "0.47815502", "0.47751418", "0.47731534", "0.4770041", "0.47584835", "0.47578394", "0.4751619", "0.4751619", "0.47447506", "0.4736525", "0.47324997", "0.47202694", "0.4713037", "0.47096202", "0.47053218", "0.47014216", "0.46990016", "0.4697116", "0.46935186" ]
0.7370118
0
returns Latitude of the address if it has one; null otherwise.
public function getLat();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_latitude($address){\n\t\t$output = get_geocode($address);\n\t\tif($output->status==\"OK\" && (count($output->results) == 1)){\n\t\t\t$latitude = $output->results[0]->geometry->location->lat;\t\t\t\n\t\t\treturn $latitude;\t\t\t\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t\t\n\t}", "public function getLatitude()\n {\n if (! isset($this->latitude)) {\n $this->latitude = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getLatitudeQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->latitude;\n }", "function wpsl_get_address_latlng( $address ) {\n\n $latlng = '';\n $response = wpsl_call_geocode_api( $address );\n\n if ( !is_wp_error( $response ) ) {\n $response = json_decode( $response['body'], true );\n\n if ( $response['status'] == 'OK' ) {\n $latlng = $response['results'][0]['geometry']['location']['lat'] . ',' . $response['results'][0]['geometry']['location']['lng'];\n }\n }\n\n return $latlng;\n}", "public function getLatitude(): ?float\n {\n if (count($this->latitude) == 0) {\n return null;\n }\n return $this->latitude['value'];\n }", "public function getLat()\n {\n $value = $this->get(self::LAT);\n return $value === null ? (double)$value : $value;\n }", "public function getLatLngByAddress($address)\n\t{\n\t\t$url = self::URL_GEOCODE.urlencode($address);\t\t\n\t\t$json_string = $this->fileGetContentsCurl($url);\t\t\t\n\t\t$json = json_decode($json_string, true);\n\t\tif(isset($json['results'][0]))\n\t\t{\n\t\t\treturn $json['results'][0]['geometry']['location'];\n\t\t}\n\t\treturn false;\n\t}", "public function getLat()\n {\n $value = $this->get(self::LAT);\n return $value === null ? (integer)$value : $value;\n }", "function get_LatLong( $address ) {\n\t\t\t$this->set_geocoding_baseURL();\n\n\t\t\t$fullURL = $this->geocodeURL . urlencode( $address );\n\n\t\t\t$request_args = array(\n\t\t\t\t'timeout' => $this->slplus->options_nojs['http_timeout'],\n\t\t\t);\n\t\t\t$response = wp_remote_get( $fullURL, $request_args );\n\t\t\t$raw_json = is_wp_error( $response ) ? null : $response['body'];\n\n\t\t\treturn $raw_json;\n\t\t}", "public function GetLatitude()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_search_center_lat;\n }", "function amap_ma_get_map_default_location_lat() {\n $map_default_lat = trim(elgg_get_plugin_setting('map_default_lat', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lat))\n return $map_default_lat;\n\n return 0;\n}", "function wpsl_check_latlng_transient( $address ) {\n\n $name_section = explode( ',', $address );\n $transient_name = 'wpsl_' . trim( strtolower( $name_section[0] ) ) . '_latlng';\n\n if ( false === ( $latlng = get_transient( $transient_name ) ) ) {\n $latlng = wpsl_get_address_latlng( $address );\n\n if ( $latlng ) {\n set_transient( $transient_name, $latlng, 0 );\n }\n }\n\n return $latlng;\n}", "public function getLatitude()\n {\n return $this->Latitude;\n }", "public function getLatitude()\n {\n return $this->get('Latitude');\n }", "function get_longitude($address){\n\t\t$output = get_geocode($address);\n\t\tif($output->status==\"OK\" && (count($output->results) == 1)){\n\t\t\t$longitude = $output->results[0]->geometry->location->lng;\t\t\t\n\t\t\treturn $longitude;\t\t\t\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t\t\n\t}", "public function do_geocoding( $address = null ) {\n\n\t\t\t// Null address, build from current location\n\t\t\t//\n\t\t\tif ( $address === null ) {\n\t\t\t\t$address =\n\t\t\t\t\t$this->address . ' ' .\n\t\t\t\t\t$this->address2 . ' ' .\n\t\t\t\t\t$this->city . ' ' .\n\t\t\t\t\t$this->state . ' ' .\n\t\t\t\t\t$this->zip . ' ' .\n\t\t\t\t\t$this->country;\n\t\t\t}\n\t\t\t$address = trim( $address );\n\n\t\t\t// Only process non-empty addresses.\n\t\t\t//\n\t\t\tif ( ! empty( $address ) ) {\n\t\t\t\t$this->count ++;\n\t\t\t\tif ( $this->count === 1 ) {\n\t\t\t\t\t$this->retry_maximum_delayms = (int) $this->slplus->options_nojs['retry_maximum_delay'] * 1000000;\n\t\t\t\t\t$this->iterations = max( 1, (int) $this->slplus->options_nojs['geocode_retries'] );\n\t\t\t\t}\n\n\t\t\t\t$errorMessage = '';\n\n\t\t\t\t// Get lat/long from Google\n\t\t\t\t//\n\t\t\t\t$json_response = $this->get_LatLong( $address );\n\t\t\t\tif ( ! empty( $json_response ) ) {\n\n\t\t\t\t\t// Process the data based on the status of the JSON response.\n\t\t\t\t\t//\n\t\t\t\t\t$json = json_decode( $json_response );\n\t\t\t\t\tif ( $json === null ) {\n\t\t\t\t\t\t$json = json_decode( json_encode( array( 'status' => 'ERROR', 'message' => $json_response ) ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ( $json->{'status'} ) {\n\n\t\t\t\t\t\t// OK\n\t\t\t\t\t\t// Geocode completed successfully\n\t\t\t\t\t\t// Update the lat/long if it has changed.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcase 'OK':\n\t\t\t\t\t\t\t$this->set_LatLong( $json->results[0]->geometry->location->lat, $json->results[0]->geometry->location->lng );\n\t\t\t\t\t\t\t$this->delay = SLPlus_Location::StartingDelay;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// OVER QUERY LIMIT\n\t\t\t\t\t\t// Google is getting to many requests from this IP block.\n\t\t\t\t\t\t// Loop through for X retries.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcase 'OVER_QUERY_LIMIT':\n\t\t\t\t\t\t\t$errorMessage .= sprintf( __( \"Address %s (%d in current series) hit the Google query limit.\\n\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t$address,\n\t\t\t\t\t\t\t\t\t$this->count\n\t\t\t\t\t\t\t ) . '<br/>';\n\t\t\t\t\t\t\t$attempts = 1;\n\t\t\t\t\t\t\t$totalDelay = 0;\n\n\t\t\t\t\t\t\t// Keep trying up until the user-selected number of retries.\n\t\t\t\t\t\t\t// Increase the wait between each try by 1 second.\n\t\t\t\t\t\t\t// Wait no more than 10 seconds between attempts.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\twhile ( $attempts ++ < $this->iterations ) {\n\t\t\t\t\t\t\t\tif ( $this->delay <= $this->retry_maximum_delayms + 1 ) {\n\t\t\t\t\t\t\t\t\t$this->delay += 1000000;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$totalDelay += $this->delay;\n\t\t\t\t\t\t\t\tusleep( $this->delay );\n\t\t\t\t\t\t\t\t$json = $this->get_LatLong( $address );\n\t\t\t\t\t\t\t\tif ( $json !== null ) {\n\t\t\t\t\t\t\t\t\t$json = json_decode( $json );\n\t\t\t\t\t\t\t\t\tif ( $json->{'status'} === 'OK' ) {\n\t\t\t\t\t\t\t\t\t\t$this->set_LatLong( $json->results[0]->geometry->location->lat, $json->results[0]->geometry->location->lng );\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\tbreak;\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$errorMessage .= sprintf(\n\t\t\t\t\t\t\t\t __( 'Waited up to %4.2f seconds between request, total wait for this location was %4.2f seconds.', 'store-locator-le' ),\n\t\t\t\t\t\t\t\t $this->delay / 1000000,\n\t\t\t\t\t\t\t\t $totalDelay / 1000000\n\t\t\t\t\t\t\t ) .\n\t\t\t\t\t\t\t \"\\n<br>\";\n\t\t\t\t\t\t\t$errorMessage .= sprintf(\n\t\t\t\t\t\t\t\t __( '%d total attempts for this location.', 'store-locator-le' ),\n\t\t\t\t\t\t\t\t $attempts - 1\n\t\t\t\t\t\t\t ) .\n\t\t\t\t\t\t\t \"\\n<br>\";\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// ZERO RESULTS\n\t\t\t\t\t\t// Bad address provided or nothing found on Google end.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcase 'ZERO_RESULTS':\n\t\t\t\t\t\t\t$errorMessage .= sprintf( __( \"Address #%d : %s <font color=red>failed to geocode</font>.\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t$this->id,\n\t\t\t\t\t\t\t\t\t$address\n\t\t\t\t\t\t\t ) . \"<br />\\n\";\n\t\t\t\t\t\t\t$errorMessage .= sprintf( __( \"Unknown Address! Received status %s.\", 'store-locator-le' ), $json->{'status'} ) . \"\\n<br>\";\n\t\t\t\t\t\t\t$this->delay = SLPlus_Location::StartingDelay;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// GENERIC\n\t\t\t\t\t\t// Could not geocode.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$errorMessage .=\n\t\t\t\t\t\t\t\tsprintf( __( \"Address #%d : %s <font color=red>failed to geocode</font>.\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t$this->id,\n\t\t\t\t\t\t\t\t\t$address ) .\n\t\t\t\t\t\t\t\t\"<br/>\\n\" .\n\t\t\t\t\t\t\t\tsprintf( __( \"Received status %s.\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t$json->{'status'} ) .\n\t\t\t\t\t\t\t\t\"<br/>\\n\" .\n\t\t\t\t\t\t\t\tsprintf( __( \"Received data %s.\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t'<pre>' . print_r( $json, true ) . '</pre>' );\n\t\t\t\t\t\t\t$this->delay = SLPlus_Location::StartingDelay;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// No raw json\n\t\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t$errorMessage .= __( 'Geocode service non-responsive', 'store-locator-le' ) .\n\t\t\t\t\t \"<br/>\\n\" .\n\t\t\t\t\t $this->geocodeURL . urlencode( $address );\n\t\t\t\t}\n\n\t\t\t\t// Blank Address Error\n\t\t\t\t//\n\t\t\t} else {\n\t\t\t\t$errorMessage = __( 'Address is blank.', 'store-locator-le' );\n\t\t\t}\n\n\t\t\t// Show Error Messages\n\t\t\t//\n\t\t\tif ( $errorMessage != '' ) {\n\t\t\t\tif ( ! $this->geocodeIssuesRendered ) {\n\t\t\t\t\t$errorMessage =\n\t\t\t\t\t\t'<strong>' .\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t__( 'If you are having geocoding issues, %s', 'store-locator-le' ),\n\t\t\t\t\t\t\t$this->slplus->Text->get_web_link( 'docs_for_geocoding' )\n\t\t\t\t\t\t) .\n\t\t\t\t\t\t\"</strong><br/>\\n\" .\n\t\t\t\t\t\t$errorMessage;\n\t\t\t\t\t$this->geocodeIssuesRendered = true;\n\t\t\t\t}\n\t\t\t\t$this->slplus->notifications->add_notice( 6, $errorMessage );\n\n\t\t\t\t// Good encoding\n\t\t\t\t//\n\t\t\t} elseif ( ! $this->geocodeSkipOKNotices ) {\n\t\t\t\t$this->slplus->notifications->add_notice(\n\t\t\t\t\t9,\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t__( 'Google thinks %s is at <a href=\"%s\" target=\"_blank\">lat: %s long %s</a>', 'store-locator-le' ),\n\t\t\t\t\t\t$address,\n\t\t\t\t\t\tsprintf( 'https://%s/?q=%s,%s',\n\t\t\t\t\t\t\t$this->slplus->options['map_domain'],\n\t\t\t\t\t\t\t$this->latitude,\n\t\t\t\t\t\t\t$this->longitude ),\n\t\t\t\t\t\t$this->latitude, $this->longitude\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * HOOK: slp_location_geocoded\n\t\t\t *\n\t\t\t * Run this when the current location is geocoded.\n\t\t\t *\n\t\t\t * @param SLPLus_Location $location\n\t\t\t */\n\t\t\tdo_action( 'slp_location_geocoded', $this );\n\n\t\t}", "function getLatLng($address = NULL)\n {\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, 'http://maps.googleapis.com/maps/api/geocode/xml?address='.urlencode($address).'&sensor=true');\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t$xml_response = curl_exec($ch);\n\tcurl_close($ch);\n\n\t$xml = new SimpleXMLElement($xml_response);\n $data = array(\n 'lat' => $xml->result->geometry->location->lat,\n 'lng' => $xml->result->geometry->location->lng\n );\n return $data;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function get_latitude()\n {\n }", "public function get_latitude()\n {\n }", "public function getLatitude(): float\n {\n return $this->latitude;\n }", "public function getLat()\n {\n return $this->lat;\n }", "public function getLat()\n {\n return $this->lat;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "function get_lat_long($address){\r\n\t$API_KEY = 'AIzaSyC70LnMBiqyXcmpnQeryzq0VK12o6P5pnw';\r\n\t$address = str_replace(\" \", \"+\", $address);\r\n\t$url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".$address.\"&key=\".$API_KEY.\"\";\r\n\t$json = file_get_contents($url);\r\n\t$json = json_decode($json);\r\n\tif($json->status == 'ZERO_RESULTS'){\r\n\t\t$lat = 0;\r\n\t\t$long = 0; \t\r\n\t}else{\r\n\t\t$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n\t\t$long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\t\r\n\t}\r\n\t\r\n\t$location = [$lat,$long];\r\n\treturn $location;\r\n}", "function getLatLong($address, $city, $postalCode) {\n $combinedAddress = $address . \", \" . $postalCode . \" \" . $city;\n\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" . urlencode($combinedAddress) . \"&key=\" . Config::GOOGLE_API_KEY;\n $context = stream_context_create();\n $result = file_get_contents($url, false, $context);\n\n if (isset($result)) {\n $parsedResult = json_decode($result, true);\n\n if (isset($parsedResult[\"results\"])) {\n $results = $parsedResult[\"results\"];\n $firstLocation = $results[0];\n return $firstLocation[\"geometry\"][\"location\"];\n } else {\n echo($result);\n }\n } else {\n echo \"HELP\";\n }\n}", "public function getLatitude()\n\t{\n\t\treturn $this->latitude;\n\t}", "public function getLatitude()\n\t{\n\t\treturn $this->latitude;\n\t}", "public function getLatitude(): float;", "public function getAddress(): ?string\n {\n return $this->address;\n }", "public function getLatitude() {\n\n return $this->latitude;\n\n }", "public function getLatitude()\n\t\t\t{\n\t\t\t\treturn $this->latitude;\n\t\t\t}", "public function getLatitude(){\r\n\t\treturn $this->latitude;\r\n\t}", "function getGeo($address) {\n\t\tif(!empty($address)){\n\t\t\t//build a string with each part of the address\n\t $formattedAddress = str_replace(' ','+',$address);\n\t\t\t//Send request and receive json data by address\n\t\t\t$geocodeFromAddr = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($formattedAddress).'&sensor=false');\n\t\t\t$output = json_decode($geocodeFromAddr);\n\t\t\t//Check if it was a valid address\n\t\t\tif(empty($output->results)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//Get latitude and longitute from json data\n\t\t\t$geocode['lat'] = $output->results[0]->geometry->location->lat;\n\t\t\t$geocode['lng'] = $output->results[0]->geometry->location->lng;\n\t\t\t$address_data = $output->results[0]->address_components;\n\t\t\tfor ($i = 0; $i < sizeof($address_data); $i++) {\n\t\t\t\tif ($address_data[$i]->types[0] == \"locality\") {\n\t\t\t\t\t$geocode['city'] = $address_data[$i]->long_name;\n\t\t\t\t}\n\t\t\t\tif ($address_data[$i]->types[0] == \"administrative_area_level_1\") {\n\t\t\t\t\t$geocode['state'] = $address_data[$i]->long_name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Return latitude, longitude, city, and state of the given address\n\t\t\tif(!empty($geocode) && !empty($geocode['city']) && !empty($geocode['state'])){\n\t\t\t\treturn $geocode;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function getlatlng($address)\n\t{\n\t\t#perintah pengulangan jika terdapat query limit saat mendapatkan data\n\t\tgetlatlng:\n\t\t$data = json_decode(file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=\" . urlencode($address)));\n\t\t\n\t\t#berhenti jika data tidak lagi over query limit\n\t\tif($data->status == \"OVER_QUERY_LIMIT\")\n\t\t{\n\t\t\tgoto getlatlng;\n\t\t}else \n\t\t{\n\t\t\treturn \"{$data->results[0]->geometry->location->lat},{$data->results[0]->geometry->location->lng}\";\n\t\t}\n\t}", "public static function latitude(array $bounds = null)\n {\n return self::randFloat(self::latRange($bounds));\n }", "public function getlatitude()\r\n {\r\n return $this->_latitude;\r\n }", "public function getStreetNumber()\n {\n return isset($this->address_data['street_number']) ? $this->address_data['street_number'] : null;\n }", "public function getAddress(): ?string\n {\n return $this->source ? $this->rebuild()->source->/** @scrutinizer ignore-call */getAddress() : null;\n }", "abstract public function latitude();", "public function getAddress()\n {\n if (array_key_exists(\"address\", $this->_propDict)) {\n return $this->_propDict[\"address\"];\n } else {\n return null;\n }\n }", "function MinLatitude() {\n return $GLOBALS[\"minLat\"];\n }", "public function getAddress():?string\n {\n return $this->address;\n }", "public function getStreet()\n {\n return isset($this->address_data['route']) ? $this->address_data['route'] : null;\n }", "public function geocode(Address $address);", "public function GeoLocate($addr){\n $geoapi = \"http://maps.googleapis.com/maps/api/geocode/json\";\n $params = array(\"address\"=>$addr,\"sensor\"=>\"false\");\n $response = $this->GET($geoapi,$params);\n $json = json_decode($response);\n if ($json->status === \"ZERO_RESULTS\") {\n return NULL;\n } else {\n return array($json->results[0]->geometry->location->lat,$json->results[0]->geometry->location->lng);\n }\n }", "public static function getCoordinates($address) {\n //Formatted address\n $formattedAddr = str_replace(' ', '+', $address);\n //Send request and receive json data by address\n $geocodeFromAddr = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . $formattedAddr . '&sensor=true_or_false');\n $json = json_decode($geocodeFromAddr);\n if (isset($json->results)) {\n //Get latitude and longitute from json data\n $latitude = $json->results[0]->geometry->location->lat;\n $longitude = $json->results[0]->geometry->location->lng;\n return $latitude . \",\" . $longitude;\n }\n return false;\n }", "public function getLongitude(): string|null;", "public function getGeo($address)\n\t{\n\t\t$json=file_get_contents($this->api.urlencode($address));\n\n\t\t$data=json_decode($json,TRUE);\n\n\t\tif($data['status']==\"OK\")\n\t\t{\n\t\t\treturn array_merge(array($address),array_values($data['results'][0]['geometry']['location']));\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "static public function getLatLonZip($address,$cityName,$stateName){\n\t\t\t$geoData=SavCo_Geocoder::callYahooApi(urlencode($address),urlencode($cityName),urlencode($stateName));\n\t\t\treturn \t$geoData;\t\t\n\t\t}", "public function hasLatitude()\n {\n return $this->Latitude !== null;\n }", "public function getMinLat() {\n return $this->minLat;\n }", "function calculate_coords() {\n if (!empty($this->value['latitude']) && !empty($this->value['longitude'])) {\n // If there are already coordinates, there's no work for us.\n return TRUE;\n }\n // @@@ Switch to mock location object and rely on location more?\n\n if ($this->options['type'] == 'postal' || $this->options['type'] == 'postal_default') {\n // Force default for country.\n if ($this->options['type'] == 'postal_default') {\n $this->value['country'] = variable_get('site_default_country', 'us');\n }\n\n // Zip code lookup.\n if (!empty($this->value['postal_code']) && !empty($this->value['country'])) {\n $coord = location_latlon_rough($this->value);\n if ($coord) {\n $this->value['latitude'] = $coord['lat'];\n $this->value['longitude'] = $coord['lon'];\n }\n else {\n return false;\n }\n }\n else {\n // @@@ Implement full address lookup?\n return false;\n }\n }\n if (empty($this->value['latitude']) || empty($this->value['longitude'])) {\n return false;\n }\n return true;\n }", "public function getAddress()\n {\n $address = null;\n if ($data = $this->getLocationData()) {\n $address = Address::create();\n $address->update($data);\n $address->ID = 0; //ensure not in db\n }\n\n return $address;\n }", "function getLocation($zipcode) {\n global $pdo;\n $sql = \"select * \"\n . \"FROM a6_locations \"\n . \"WHERE zipcode = ? \"\n . \"LIMIT 1\";\n $query = $pdo->prepare($sql);\n $params = array($zipcode);\n $query->execute($params);\n if ($query->rowCount() > 0) {\n return $query->fetchObject();\n } else {\n return null;\n }\n }", "function geolocate($address)\r\n\t{\r\n\t\t$lat = 0;\r\n\t\t$lng = 0;\r\n\t\t\r\n\t\t$data_location = \"http://maps.google.com/maps/api/geocode/json?address=\".str_replace(\" \", \"+\", $address).\"&sensor=false\";\r\n\t\t\r\n\t\tif ($this->region!=\"\" && strlen($this->region)==2) { $data_location .= \"&region=\".$this->region; }\r\n\t\t$data = file_get_contents($data_location);\r\n\t\tusleep(200000);\r\n\t\t\r\n\t\t// turn this on to see if we are being blocked\r\n\t\t// echo $data;\r\n\t\t\r\n\t\t$data = json_decode($data);\r\n\t\t\r\n\t\tif ($data->status==\"OK\") {\r\n\t\t\t$lat = $data->results[0]->geometry->location->lat;\r\n\t\t\t$lng = $data->results[0]->geometry->location->lng;\r\n\t\t}\r\n\t\t\r\n\t\t// concatenate lat/long coordinates\r\n\t\t$coords['lat'] = $lat;\r\n\t\t$coords['lng'] = $lng;\r\n\t\t\r\n\t\treturn $coords;\r\n\t}", "protected function getLatitudeQuery()\n {\n return $this->latitudeQuery;\n }", "function get_lat_long($address)\r\n{\t\r\n\t//sleep(1);\r\n $address = str_replace(\" \", \"+\", $address);\r\n $json = file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=$region\");\r\n $json = json_decode($json);\r\n\t// echo \"<pre>\"; print_r($json); \r\n\r\n $lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n $long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\r\n return $lat.','.$long;\r\n}", "public function getLatLong($pincode=null, $city=null)\n {\n\n # code...\n $q = \"\";\n $t = \"\";\n if(isset($pincode) && $pincode != '-'){\n $q = $pincode;\n $t = 'postcode'; // postalcode\n }else{\n $q = $city;\n $t = 'woonplaats';\n }\n\n $client = new Client();\n $response = $client->request('GET', \"https://geodata.nationaalgeoregister.nl/locatieserver/v3/free?q='+$q+'&type:'+$t+'\");\n $statusCode = $response->getStatusCode();\n $body = $response->getBody()->getContents();\n $body = json_decode($body, true);\n if($body['response']['numFound'] > 0 && $statusCode == '200'){\n $result = $body['response']['docs'][0]['centroide_ll'];\n return($result);\n }\n else{\n return 'Not Valid.';\n }\n }", "public function getLatLngByAddress($addressQuery) {\r\n\t\t$latLng = NULL;\r\n\t\t$geocodeUrl = $this->getGeocodeUrl();\r\n\t\t$geocodeUrl .= '?sensor=false&address=' . urlencode(str_replace(LF, ', ', $addressQuery));\r\n\t\t$geocodeResult = t3lib_div::getURL($geocodeUrl);\r\n\t\t$geocodeResult = json_decode($geocodeResult);\r\n\t\tif ($geocodeResult !== NULL && strtolower($geocodeResult->status) === 'ok') {\r\n\t\t\t$coordinates = new Tx_AdGoogleMaps_MapBuilder_API_Base_LatLng($geocodeResult->results[0]->geometry->location->lat, $geocodeResult->results[0]->geometry->location->lng);\r\n\t\t}\r\n\t\treturn $latLng;\r\n\t}", "public function getStreet(): ?string\n {\n return $this->Street ?? null;\n }", "public function geocode($address)\n {\n $requestUrl = 'https://maps.googleapis.com/maps/api/geocode/json?';\n $params = array(\n 'sensor' => 'false',\n 'language' => 'de',\n 'address' => $address,\n );\n\n $requestUrl .= http_build_query($params);\n\t\n $json = json_decode(file_get_contents($requestUrl), true);\n $return = array(\n 'status' => $json['status'],\n 'succeed' => $json['status'] == 'OK',\n );\n\n if ($json['status'] == 'OK') {\n $result = $json['results'][0];\n\n $return['formatted_address'] = $result['formatted_address'];\n $return['coordinates'] = new Point($result['geometry']['location']['lat'], $result['geometry']['location']['lng']);\n\n // find zip code and city name\n $return = array_merge($return, $this->parseAddressComponents($result));\n\n if (isset($result['partial_match']) && $result['partial_match']) {\n $return['partial_match'] = true;\n }\n }\n\n return $return;\n }", "public function getAddress() : ?string \n {\n if ( ! $this->hasAddress()) {\n $this->setAddress($this->getDefaultAddress());\n }\n return $this->address;\n }", "function getCoordination($address){\r\n $address = str_replace(\" \", \"+\", $address); // replace all the white space with \"+\" sign to match with google search pattern\r\n \r\n $url = \"http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address\";\r\n \r\n $response = file_get_contents($url);\r\n \r\n $json = json_decode($response,TRUE); //generate array object from the response from the web\r\n\r\n $latitude = ($json[\"results\"][0][\"geometry\"][\"location\"][\"lat\"]);\r\n $longitude = ($json[\"results\"][0][\"geometry\"][\"location\"][\"lng\"]);\r\n\r\n return array(\"latitude\" => $latitude, \"longitude\" => $longitude);\r\n }", "public function getMinLng() {\n return $this->minLng;\n }", "public function getUserAddress() {\n\t\treturn ($this->userStreet);\n\t}", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "function getAddressCoordinates($address, City $city=null);", "private function getLatLng() {\n\t\tif( $this->getAutomaticLocation() && ( $this->isChanged() || ( !$this->getLat() && !$this->getLng() ) ) ) {\n\t\t\t$addressStr = $this->getAddLine1() . ' ' . $this->getStreetName() . ',' . $this->getTown();\n\t\t\t$addressStr.= ( $this->getCity() ) ? ',' . $this->getCity() : '';\n\t\t\t$addressStr.= ( $this->getRegion() ) ? ',' . $this->getRegion() : '';\n\t\t\t$addressStr.= ',' . $this->getPostalCode() . ',' . $this->getCountryCode();\n\t\t\t$req = sprintf( 'http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false', urlencode( $addressStr ) );\n\t\t\tif( !( $response = @file_get_contents( $req ) ) ) {\n\t\t\t\tthrow new Exception( sprintf( 'Unable to contact (%s)', $req ) );\n\t\t\t}\n\t\t\t$geoCode = json_decode( $response );\n// Do a switch here based on the possible status messages returned\n\t\t\tif( is_object( $geoCode ) ) {\n\t\t\t\tswitch( $geoCode->status ) {\n\t\t\t\t\tcase static::API_RESPONSE_ZERO_RESULTS:\n\t\t\t\t\t\t// ZERO RESULTS\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase static::API_RESPONSE_OK:\n\t\t\t\t\t\t$o = new StdClass();\n\t\t\t\t\t\t$o->Lat = $geoCode->results[0]->geometry->location->lat;\n\t\t\t\t\t\t$o->Lng = $geoCode->results[0]->geometry->location->lng;\n\t\t\t\t\t\treturn $o;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception( sprintf( 'Invalid response (%s) from (%s)', $response, $req ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$o = new StdClass();\n\t\t\t$o->Lat = $this->getLat();\n\t\t\t$o->Lng = $this->getLng();\n\t\t\treturn $o;\n\t\t}\n\t}", "public function geocoding($address) \n {\n $encodeAddress = urlencode($address);\n $url = \"http://maps.google.com/maps/geo?q=\".$encodeAddress.\"&output=csv&key=\".$this->googleMapKey;\n \n if(function_exists('curl_init')) {\n $data = $this->getContent($url);\n } else {\n $data = file_get_contents($url);\n }\n \n\t\t$csvSplit = preg_split(\"/,/\",$data);\n $status = $csvSplit[0];\n\n if (strcmp($status, \"200\") == 0) {\n $return = $csvSplit; // successful geocode, $precision = $csvSplit[1],$lat = $csvSplit[2],$lng = $csvSplit[3];\n } else {\n $return = null; // failure to geocode\n }\n\n return $return;\n }", "public function getFirstFoundPositionByAddress($address)\n {\n $position = null;\n $positions = $this->getPositionsByAddress((string)$address);\n if ($positions->count()) {\n $positions->rewind();\n $position = $positions->current();\n }\n\n return $position;\n }", "public function getStreet1(): ?string\n {\n return $this->_street1;\n }", "function MinLongitude() {\n return $GLOBALS[\"minLong\"];\n }", "public function getDefaultLongitude(): string|null;", "function getLatitude($string)\r\n{\r\n\t$coordinate = strstr($string, 'lat=');\r\n\t$coordinate = strstr($coordinate, '&', true);\r\n\t$coordinate = substr($coordinate, 4);\r\n\treturn $coordinate;\r\n}", "public function geocodeLocation($address) {\n\t\tLoggerRegistry::debug('GoogleModule::geocodeLocation({address})', array( 'address' => TypeUtilities::describe($address) ));\n\t\t$url = sprintf('http://%s/maps/api/geocode/json?address=%s&sensor=false', $this->config('maps.api.host'), urlencode($address));\n\t\t$data = json_decode(file_get_contents($url), true);\n\t\tif (!isset($data['status'])) {\n\t\t\tthrow new \\RuntimeException(sprintf('Could not geocode location \"%s\", invalid geocode response structure', $address));\n\t\t}\n\t\tif ($data['status'] !== 'OK') {\n\t\t\tthrow new \\RuntimeException(sprintf('Could not geocode location \"%s\", geocode response status indicates an error: %s', $address, $data['status']));\n\t\t}\n\t\tif (!isset($data['results']) || !isset($data['results'][0]) || !isset($data['results'][0]['geometry']) || !isset($data['results'][0]['geometry']['location'])) {\n\t\t\tthrow new \\RuntimeException(sprintf('Could not geocode location \"%s\", geocode response contains no results', $address));\n\t\t}\n\t\t$coordinates = $data['results'][0]['geometry']['location'];\n\t\treturn array(\n\t\t\t'latitude' => $coordinates['lat'],\n\t\t\t'longitude' => $coordinates['lng']\n\t\t);\n\t}", "private function get_location () {\n try {\n // MaxMind GeoIP lookup\n // See: http://maxmind.github.io/GeoIP2-php/\n $reader = new Reader('assets/GeoLite2-City.mmdb');\n $record = $reader->city($_SERVER['REMOTE_ADDR']);\n return [\n 'lat' => $record->location->latitude,\n 'lng' => $record->location->longitude\n ];\n } catch (Exception $e) {\n return false;\n }\n }", "public function getLatitudEmpresa()\n {\n return $this->latitudEmpresa;\n }", "private function getGeoCode($address){\n $address = urlencode($address);\n\n // google map geocode api url\n $url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&key=AIzaSyDZl_p4GvElS5VstE8L3Z2Da3YntKFfYeg&address={$address}\";\n\n // get the json response\n $resp_json = file_get_contents($url);\n\n // decode the json\n $resp = json_decode($resp_json, true);\n\n // response status will be 'OK', if able to geocode given address\n if($resp['status']=='OK'){\n\n // get the important data\n $lat = $resp['results'][0]['geometry']['location']['lat'];\n $lng = $resp['results'][0]['geometry']['location']['lng'];\n $formatted_address = $resp['results'][0]['formatted_address'];\n\n // verify if data is complete\n if($lat && $lng && $formatted_address){\n\n // put the data in the array\n $data_arr = array();\n\n array_push(\n $data_arr,\n $lat,\n $lng,\n $formatted_address\n );\n\n return $data_arr;\n\n }else{\n return false;\n }\n\n }else{\n return false;\n }\n }", "function location_cmn($lat, $long, $usegeolocation, $customerno = null) {\n $address = NULL;\n $customerno = (!isset($customerno)) ? $_SESSION['customerno'] : $customerno;\n if (isset($lat) && isset($long)) {\n $GeoCoder_Obj = new GeoCoder($customerno);\n $address = $GeoCoder_Obj->get_location_bylatlong($lat, $long);\n }\n return $address;\n}", "public function getCoordinates(Address $address)\n {\n $type = NULL;\n\n //set latitude and longitude of new user\n //remove bis, ter from address street for localization research because it makes the research inaccurate \n $base = strtolower(trim($address->getStreet1().' '.$address->getZipCity()->getZipCode().' '.$address->getZipCity()->getCity())) ; \n \n if(preg_match('/^\\d+/',$base)){\n $type = 'housenumber';\n }elseif(preg_match('/^hameau/',$base)){\n $type = 'locality';\n }elseif(preg_match('/^(allée|allee|rue|impasse|square|avenue)/',$base)){\n $type = 'street';\n }\n\n //replace strings for better score\n $base = preg_replace('/\\s(bis|ter)\\s/',' ',$base);\n $base = preg_replace('/^(\\d+)(bis|ter)\\s/','${1} ',$base);\n $base = preg_replace('/\\,/',' ',$base);\n $base = preg_replace('/\\s(st)e?\\s/',' saint ',$base);\n $base = preg_replace('/\\s(dr)\\s/',' docteur ',$base);\n $base = preg_replace('/\\s(jo|j\\.o)\\s/',' jeux olympiques ',$base);\n\n $arrayParams = array( \n 'q' => $base,\n //'postcode' => $address->getZipCity()->getZipCode(),\n 'lat'=>'45.19251',\n 'lon'=>'5.72756',\n 'limit' => 2 \n ); \n if($type){\n $arrayParams['type'] = $type;\n }\n\n $res = $this->api->get('https://api-adresse.data.gouv.fr/','search/',$arrayParams);\n\n if($res['code'] == 200){ \n $features = $res['results']['features']; \n\n if( count($features) > 1){ \n if($features[0]['properties']['score'] > $features[1]['properties']['score'] ){\n $location = $features[0]; \n }else{\n $location = $features[1]; \n }\n }elseif(count($features) == 1){ \n $location = $features[0]; \n }else{\n return array('latitude'=>NULL ,'longitude'=>NULL, 'closest'=>array('label'=>'Aucune'));\n } \n\n $score = $location['properties']['score'];\n if($score <= 0.67){ \n if($score >= 0.60 && isset($location['properties']['oldcity'])){// if the address matches a former deprecated city name\n return array('latitude'=>$location['geometry']['coordinates'][1] ,'longitude'=>$location['geometry']['coordinates'][0]);\n }\n if($score >= 0.58){\n $similarityStreet = similar_text(strtolower($address->getStreet1()),strtolower($location['properties']['name']),$prec);\n if(! ($location['properties']['type'] == 'municipality')){//if municipality, name is city\n if($prec >= 50){\n return array('latitude'=>$location['geometry']['coordinates'][1] ,'longitude'=>$location['geometry']['coordinates'][0]);\n }\n }\n }\n return array('latitude'=>NULL ,'longitude'=>NULL,'closest' => $location['properties']);\n }else{\n return array('latitude'=>$location['geometry']['coordinates'][1] ,'longitude'=>$location['geometry']['coordinates'][0]);\n }\n }else{\n throw new \\Exception('geolocalization_api_failed : '.$res['results']['description']);\n }\n\n }", "public function getPayerAddressStreet1() {\n\t\treturn $this->_getField(self::$PAYER_ADDRESS_STREET_1);\n\t}", "public function getAddr() {\r\n return (is_null($this->ipAddr)) ? null : $this->ipAddr;\r\n }", "public function first() {\n\t\tif (empty($this->addresses)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->addresses[0];\n\t}", "public function getStreetNumber();", "public function setLat($var)\n {\n GPBUtil::checkDouble($var);\n $this->lat = $var;\n $this->has_lat = true;\n\n return $this;\n }", "public function getBillingAddress(): ?Address\n {\n return $this->billingAddress;\n }", "public function getAddress(): ?PostalAddressInterface;", "function amap_ma_get_map_default_location_lon() {\n $map_default_lng = trim(elgg_get_plugin_setting('map_default_lng', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lng))\n return $map_default_lng;\n\n return 0;\n}", "public function getStreetAddress()\n {\n return $this->_streetAddress;\n }", "public function getStreetAddress()\n {\n return $this->street_address;\n }", "public function getLatitud()\n {\n return $this->latitud;\n }", "public static function getLatitude()\n {\n $element = new Lib_Form_Element_Location_Angle_Latitude();\n return $element;\n }", "public static function getLatitude()\n {\n $element = new Lib_Form_Element_Location_Angle_Latitude();\n return $element;\n }" ]
[ "0.7916927", "0.68906116", "0.6687865", "0.6686586", "0.66169363", "0.64196527", "0.64170456", "0.63140154", "0.6170558", "0.6101385", "0.6070726", "0.6060713", "0.6058234", "0.6041061", "0.6037897", "0.6027328", "0.5967252", "0.5967252", "0.5967252", "0.5967252", "0.5967252", "0.5967252", "0.5967252", "0.5967252", "0.5943889", "0.5943578", "0.5942412", "0.5916066", "0.5916066", "0.5908318", "0.5903188", "0.5833774", "0.5828395", "0.5828395", "0.5814167", "0.5809201", "0.580703", "0.5800656", "0.57704514", "0.5740718", "0.5732413", "0.5725821", "0.5718295", "0.56885755", "0.5684482", "0.5663399", "0.56585765", "0.5656626", "0.56485605", "0.5647478", "0.5626528", "0.5623488", "0.5615777", "0.55758107", "0.5569309", "0.5535219", "0.552039", "0.5519434", "0.5513871", "0.5496212", "0.54648393", "0.544441", "0.54030985", "0.54027677", "0.5401561", "0.5374214", "0.5351605", "0.53459835", "0.533473", "0.53332347", "0.53320503", "0.5330969", "0.532456", "0.5320795", "0.5308078", "0.5301562", "0.5274425", "0.5251539", "0.52418834", "0.52409834", "0.5218392", "0.52147084", "0.52136576", "0.5212799", "0.5196886", "0.51963216", "0.5187796", "0.5185406", "0.5183413", "0.5180757", "0.51805156", "0.51681846", "0.516009", "0.51535535", "0.51495254", "0.5149149", "0.51345646", "0.51338434", "0.5131211", "0.5131211" ]
0.5978075
16
returns longitude of the address if it has one; null otherwise.
public function getLng();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_longitude($address){\n\t\t$output = get_geocode($address);\n\t\tif($output->status==\"OK\" && (count($output->results) == 1)){\n\t\t\t$longitude = $output->results[0]->geometry->location->lng;\t\t\t\n\t\t\treturn $longitude;\t\t\t\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t\t\n\t}", "public function getLongitude()\n {\n if (! isset($this->longitude)) {\n $this->longitude = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getLongitudeQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->longitude;\n }", "public function getLongitude(): ?float\n {\n if (count($this->longitude) == 0) {\n return null;\n }\n return $this->longitude['value'];\n }", "public function getLon()\n {\n $value = $this->get(self::LON);\n return $value === null ? (double)$value : $value;\n }", "public function getLon()\n {\n $value = $this->get(self::LON);\n return $value === null ? (integer)$value : $value;\n }", "public function getLongitude(): string|null;", "public function get_longitude()\n {\n }", "public function get_longitude()\n {\n }", "function amap_ma_get_map_default_location_lon() {\n $map_default_lng = trim(elgg_get_plugin_setting('map_default_lng', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lng))\n return $map_default_lng;\n\n return 0;\n}", "public function getlongitude()\r\n {\r\n return $this->_longitude;\r\n }", "public function getLongitude() {\n return $this->nLongitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "function wpsl_get_address_latlng( $address ) {\n\n $latlng = '';\n $response = wpsl_call_geocode_api( $address );\n\n if ( !is_wp_error( $response ) ) {\n $response = json_decode( $response['body'], true );\n\n if ( $response['status'] == 'OK' ) {\n $latlng = $response['results'][0]['geometry']['location']['lat'] . ',' . $response['results'][0]['geometry']['location']['lng'];\n }\n }\n\n return $latlng;\n}", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n\t{\n\t\treturn $this->longitude;\n\t}", "public function getLongitude()\n\t{\n\t\treturn $this->longitude;\n\t}", "public function getLongitude() {\n\n return $this->longitude;\n\n }", "public function getLongitude()\n {\n return $this->get('Longitude');\n }", "public function getLongitude()\n\t\t\t{\n\t\t\t\treturn $this->longitude;\n\t\t\t}", "public function GetLongitude()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_search_center_long;\n }", "public function getLongitude()\n {\n return $this->Longitude;\n }", "public function getLon()\n {\n return $this->lon;\n }", "public function getLongitude(){\r\n\t\treturn $this->longitude;\r\n\t}", "public function getDefaultLongitude(): string|null;", "public function getLongitude(): float\n {\n return $this->longitude;\n }", "abstract public function longitude();", "public function getLongitude_atual(){\n\t\t \treturn $this->longitude_atual;\n\t\t}", "public static function longitude(array $bounds = null)\n {\n return self::randFloat(self::lngRange($bounds));\n }", "function MaxLongitude() {\n return $GLOBALS[\"maxLong\"];\n }", "public function getLongitude(): float;", "public function getLng()\n {\n return $this->lng;\n }", "public function getLatLong($pincode=null, $city=null)\n {\n\n # code...\n $q = \"\";\n $t = \"\";\n if(isset($pincode) && $pincode != '-'){\n $q = $pincode;\n $t = 'postcode'; // postalcode\n }else{\n $q = $city;\n $t = 'woonplaats';\n }\n\n $client = new Client();\n $response = $client->request('GET', \"https://geodata.nationaalgeoregister.nl/locatieserver/v3/free?q='+$q+'&type:'+$t+'\");\n $statusCode = $response->getStatusCode();\n $body = $response->getBody()->getContents();\n $body = json_decode($body, true);\n if($body['response']['numFound'] > 0 && $statusCode == '200'){\n $result = $body['response']['docs'][0]['centroide_ll'];\n return($result);\n }\n else{\n return 'Not Valid.';\n }\n }", "function wpsl_check_latlng_transient( $address ) {\n\n $name_section = explode( ',', $address );\n $transient_name = 'wpsl_' . trim( strtolower( $name_section[0] ) ) . '_latlng';\n\n if ( false === ( $latlng = get_transient( $transient_name ) ) ) {\n $latlng = wpsl_get_address_latlng( $address );\n\n if ( $latlng ) {\n set_transient( $transient_name, $latlng, 0 );\n }\n }\n\n return $latlng;\n}", "public function getLatLong()\n {\n return $this->latLong;\n }", "public function getAddress()\n {\n $address = null;\n if ($data = $this->getLocationData()) {\n $address = Address::create();\n $address->update($data);\n $address->ID = 0; //ensure not in db\n }\n\n return $address;\n }", "static public function getLatLonZip($address,$cityName,$stateName){\n\t\t\t$geoData=SavCo_Geocoder::callYahooApi(urlencode($address),urlencode($cityName),urlencode($stateName));\n\t\t\treturn \t$geoData;\t\t\n\t\t}", "public function getAddress(): ?string\n {\n return $this->address;\n }", "public function getAddress():?string\n {\n return $this->address;\n }", "function get_LatLong( $address ) {\n\t\t\t$this->set_geocoding_baseURL();\n\n\t\t\t$fullURL = $this->geocodeURL . urlencode( $address );\n\n\t\t\t$request_args = array(\n\t\t\t\t'timeout' => $this->slplus->options_nojs['http_timeout'],\n\t\t\t);\n\t\t\t$response = wp_remote_get( $fullURL, $request_args );\n\t\t\t$raw_json = is_wp_error( $response ) ? null : $response['body'];\n\n\t\t\treturn $raw_json;\n\t\t}", "public function hasLongitude()\n {\n return $this->Longitude !== null;\n }", "public function getAddress()\n {\n if (array_key_exists(\"address\", $this->_propDict)) {\n return $this->_propDict[\"address\"];\n } else {\n return null;\n }\n }", "private function get_location () {\n try {\n // MaxMind GeoIP lookup\n // See: http://maxmind.github.io/GeoIP2-php/\n $reader = new Reader('assets/GeoLite2-City.mmdb');\n $record = $reader->city($_SERVER['REMOTE_ADDR']);\n return [\n 'lat' => $record->location->latitude,\n 'lng' => $record->location->longitude\n ];\n } catch (Exception $e) {\n return false;\n }\n }", "protected function getLongitudeQuery()\n {\n return $this->longitudeQuery;\n }", "public function hasLongitude(): bool;", "function get_latitude($address){\n\t\t$output = get_geocode($address);\n\t\tif($output->status==\"OK\" && (count($output->results) == 1)){\n\t\t\t$latitude = $output->results[0]->geometry->location->lat;\t\t\t\n\t\t\treturn $latitude;\t\t\t\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t\t\n\t}", "function getlatlng($address)\n\t{\n\t\t#perintah pengulangan jika terdapat query limit saat mendapatkan data\n\t\tgetlatlng:\n\t\t$data = json_decode(file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=\" . urlencode($address)));\n\t\t\n\t\t#berhenti jika data tidak lagi over query limit\n\t\tif($data->status == \"OVER_QUERY_LIMIT\")\n\t\t{\n\t\t\tgoto getlatlng;\n\t\t}else \n\t\t{\n\t\t\treturn \"{$data->results[0]->geometry->location->lat},{$data->results[0]->geometry->location->lng}\";\n\t\t}\n\t}", "function get_lat_long($address){\r\n\t$API_KEY = 'AIzaSyC70LnMBiqyXcmpnQeryzq0VK12o6P5pnw';\r\n\t$address = str_replace(\" \", \"+\", $address);\r\n\t$url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".$address.\"&key=\".$API_KEY.\"\";\r\n\t$json = file_get_contents($url);\r\n\t$json = json_decode($json);\r\n\tif($json->status == 'ZERO_RESULTS'){\r\n\t\t$lat = 0;\r\n\t\t$long = 0; \t\r\n\t}else{\r\n\t\t$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n\t\t$long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\t\r\n\t}\r\n\t\r\n\t$location = [$lat,$long];\r\n\treturn $location;\r\n}", "public function getLatLngByAddress($address)\n\t{\n\t\t$url = self::URL_GEOCODE.urlencode($address);\t\t\n\t\t$json_string = $this->fileGetContentsCurl($url);\t\t\t\n\t\t$json = json_decode($json_string, true);\n\t\tif(isset($json['results'][0]))\n\t\t{\n\t\t\treturn $json['results'][0]['geometry']['location'];\n\t\t}\n\t\treturn false;\n\t}", "public static function getLongitude()\n {\n $element = new Lib_Form_Element_Location_Angle_Longitude();\n return $element;\n }", "public static function getLongitude()\n {\n $element = new Lib_Form_Element_Location_Angle_Longitude();\n return $element;\n }", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public function getAddress(): ?string\n {\n return $this->source ? $this->rebuild()->source->/** @scrutinizer ignore-call */getAddress() : null;\n }", "public function findByAddress( $address ) {\n\t\tif ( !$location = $this->getModel()->where( 'address', $address )->first() ) {\n\t\t\treturn $this->setErrorMessage( 'Address not found.' );\n\t\t}\n\n\t\treturn $location;\n\t}", "function getLatLong($address, $city, $postalCode) {\n $combinedAddress = $address . \", \" . $postalCode . \" \" . $city;\n\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" . urlencode($combinedAddress) . \"&key=\" . Config::GOOGLE_API_KEY;\n $context = stream_context_create();\n $result = file_get_contents($url, false, $context);\n\n if (isset($result)) {\n $parsedResult = json_decode($result, true);\n\n if (isset($parsedResult[\"results\"])) {\n $results = $parsedResult[\"results\"];\n $firstLocation = $results[0];\n return $firstLocation[\"geometry\"][\"location\"];\n } else {\n echo($result);\n }\n } else {\n echo \"HELP\";\n }\n}", "function amap_ma_get_map_default_location_lat() {\n $map_default_lat = trim(elgg_get_plugin_setting('map_default_lat', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lat))\n return $map_default_lat;\n\n return 0;\n}", "public function getMaxLng() {\n return $this->maxLng;\n }", "public function getLocation()\n {\n return isset($this->location) ? $this->location : null;\n }", "public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }", "public function getLatitudeLongitude()\n\t\t\t{\n\t\t\t\t$latitude = $this->getLatitude();\n\t\t\t\t$longitude = $this->getLongitude();\n\n\t\t\t\tif ($latitude && $longitude)\n\t\t\t\t{\n\t\t\t\t\treturn $latitude . \",\" . $longitude;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}", "function getLocation($zipcode) {\n global $pdo;\n $sql = \"select * \"\n . \"FROM a6_locations \"\n . \"WHERE zipcode = ? \"\n . \"LIMIT 1\";\n $query = $pdo->prepare($sql);\n $params = array($zipcode);\n $query->execute($params);\n if ($query->rowCount() > 0) {\n return $query->fetchObject();\n } else {\n return null;\n }\n }", "public function setLon($var)\n {\n GPBUtil::checkDouble($var);\n $this->lon = $var;\n $this->has_lon = true;\n\n return $this;\n }", "public function getLatLngBottomRight(): LatLng\n {\n return $this->latLngBottomRight;\n }", "public function getAddress(): ?PostalAddressInterface;", "public function getAddress() : ?string \n {\n if ( ! $this->hasAddress()) {\n $this->setAddress($this->getDefaultAddress());\n }\n return $this->address;\n }", "public function getLocation()\n\t{\n\t\treturn null;\n\t}", "public function getAddr()\n {\n return $this->addr->getAddr();\n }", "public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}", "public function getCity()\n {\n return isset($this->address_data['locality']) ? $this->address_data['locality'] : null;\n }", "public function getAddress()\n {\n return $this->get('address')->value;\n }", "public function getGeoCoordinateY()\n {\n return $this->geo_coordinate_y;\n }", "function MinLongitude() {\n return $GLOBALS[\"minLong\"];\n }", "public function getLocation() : ?string\n {\n return $this->location;\n }", "public static function getLocationFromCoordinate($lat, $long)\n {\n\n $data = self::getData($lat, $long);\n\n $country = \"\";\n $adminAreas = array();\n $topAdminArea = \"\";\n $locality = \"\";\n $sublocality = \"\";\n $postalCode = \"\";\n $route = \"\";\n $formattedAddress = \"\";\n\n if (count($data['results']) > 0) {\n \t\t \n \t\tforeach($data['results'][0]['address_components'] as $current_entry) {\n \t\t\t \n \t\t\tforeach($current_entry['types'] as $current_entry2) {\n \t\t\t\t \n \t\t\t\tif ($current_entry2 == 'route') {\n if ($route == \"\") { $route = $current_entry['long_name']; }\n \t\t\t\t}\n \t\t\t\telseif ($current_entry2 == 'sublocality') {\n if ($sublocality == \"\") { $sublocality = $current_entry['long_name']; }\n \t\t\t\t}\n \t\t\t\telseif ($current_entry2 == 'locality') {\n if ($locality == \"\") { $locality = $current_entry['long_name']; }\n \t\t\t\t}\n elseif ($current_entry2 == 'postal_code') {\n if ($postalCode == \"\") { $postalCode = $current_entry['long_name']; }\n }\n \t\t\t\telseif ($current_entry2 == 'country') {\n if ($country == \"\") { $country = $current_entry['short_name']; }\n \t\t\t\t}\n elseif (substr($current_entry2, 0, 25) == 'administrative_area_level') {\n \n $key = substr($current_entry2, -1);\n $adminAreas[$key] = $current_entry['long_name'];\n \n }\n \t\t\t}\n \t\t\t \n \t\t}\n \n if (array_key_exists('formatted_address', $data['results'][0])) {\n \n $formattedAddress = $data['results'][0]['formatted_address'];\n \n }\n \t\t \n \t}\n \n if (array_key_exists('1', $adminAreas)) {\n $topAdminArea = $adminAreas['1'];\n }\n else {\n \n if (array_key_exists('2', $adminAreas)) {\n $topAdminArea = $adminAreas['2'];\n }\n else {\n \n if (array_key_exists('3', $adminAreas)) {\n $topAdminArea = $adminAreas['3'];\n }\n else {\n \n if (array_key_exists('4', $adminAreas)) {\n $topAdminArea = $adminAreas['4'];\n }\n else {\n \n if (array_key_exists('5', $adminAreas)) {\n $topAdminArea = $adminAreas['5'];\n }\n\n }\n\n }\n\n }\n \n }\n \n $nickname = \"\";\n \n if($route != \"\") { $nickname = $route.\" \"; }\n if($locality != \"\") { $nickname = $nickname.$locality.\" \"; }\n if($sublocality != \"\") { $nickname = $nickname.\"- \".$sublocality.\" \"; }\n \t \n \tif (strlen($nickname) < 2) {\n \t\t$characters1 = 'aeiou';\n \t\t$characters2 = 'bcdfghjklmnpqrstvwxyz';\n \t\t$nickname = '';\n \t\tfor ($j = 0; $j < 3; $j++) {\n \t\t\t$nickname .= $characters1[rand(0, strlen($characters1) - 1)];\n \t\t\t$nickname .= $characters2[rand(0, strlen($characters2) - 1)];\n \t\t}\n \t\t$nickname .= \" \";\n \t\t$nickname = ucfirst($nickname);\n \t\t \n \t}\n \t \n if($country != \"\") { $nickname = $nickname.\"(\".$country.\")\"; }\n\n \t$locationObject = new SimpleLocation();\n \n $locationObject->latitude = $lat;\n $locationObject->longitude = $long;\n $locationObject->administrativeArea = $topAdminArea;\n $locationObject->city = $locality;\n $locationObject->countryCode = $country;\n $locationObject->postalCode = $postalCode;\n $locationObject->route = $route;\n $locationObject->nickname = $nickname;\n $locationObject->formattedAddress = $formattedAddress;\n \n return $locationObject;\n \n }", "public function setLongitude($var)\n {\n GPBUtil::checkInt32($var);\n $this->longitude = $var;\n\n return $this;\n }", "protected function getLongLat($endereco){\n\n $end = str_replace(\" \", \"+\", $endereco);\n\n $url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$end.\"&sensor=false\";\n\n $json = file_get_contents($url);\n $data = json_decode($json, TRUE);\n\n\n return json_encode($data['results'][0]['geometry']['location']);\n\n }", "public function do_geocoding( $address = null ) {\n\n\t\t\t// Null address, build from current location\n\t\t\t//\n\t\t\tif ( $address === null ) {\n\t\t\t\t$address =\n\t\t\t\t\t$this->address . ' ' .\n\t\t\t\t\t$this->address2 . ' ' .\n\t\t\t\t\t$this->city . ' ' .\n\t\t\t\t\t$this->state . ' ' .\n\t\t\t\t\t$this->zip . ' ' .\n\t\t\t\t\t$this->country;\n\t\t\t}\n\t\t\t$address = trim( $address );\n\n\t\t\t// Only process non-empty addresses.\n\t\t\t//\n\t\t\tif ( ! empty( $address ) ) {\n\t\t\t\t$this->count ++;\n\t\t\t\tif ( $this->count === 1 ) {\n\t\t\t\t\t$this->retry_maximum_delayms = (int) $this->slplus->options_nojs['retry_maximum_delay'] * 1000000;\n\t\t\t\t\t$this->iterations = max( 1, (int) $this->slplus->options_nojs['geocode_retries'] );\n\t\t\t\t}\n\n\t\t\t\t$errorMessage = '';\n\n\t\t\t\t// Get lat/long from Google\n\t\t\t\t//\n\t\t\t\t$json_response = $this->get_LatLong( $address );\n\t\t\t\tif ( ! empty( $json_response ) ) {\n\n\t\t\t\t\t// Process the data based on the status of the JSON response.\n\t\t\t\t\t//\n\t\t\t\t\t$json = json_decode( $json_response );\n\t\t\t\t\tif ( $json === null ) {\n\t\t\t\t\t\t$json = json_decode( json_encode( array( 'status' => 'ERROR', 'message' => $json_response ) ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ( $json->{'status'} ) {\n\n\t\t\t\t\t\t// OK\n\t\t\t\t\t\t// Geocode completed successfully\n\t\t\t\t\t\t// Update the lat/long if it has changed.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcase 'OK':\n\t\t\t\t\t\t\t$this->set_LatLong( $json->results[0]->geometry->location->lat, $json->results[0]->geometry->location->lng );\n\t\t\t\t\t\t\t$this->delay = SLPlus_Location::StartingDelay;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// OVER QUERY LIMIT\n\t\t\t\t\t\t// Google is getting to many requests from this IP block.\n\t\t\t\t\t\t// Loop through for X retries.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcase 'OVER_QUERY_LIMIT':\n\t\t\t\t\t\t\t$errorMessage .= sprintf( __( \"Address %s (%d in current series) hit the Google query limit.\\n\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t$address,\n\t\t\t\t\t\t\t\t\t$this->count\n\t\t\t\t\t\t\t ) . '<br/>';\n\t\t\t\t\t\t\t$attempts = 1;\n\t\t\t\t\t\t\t$totalDelay = 0;\n\n\t\t\t\t\t\t\t// Keep trying up until the user-selected number of retries.\n\t\t\t\t\t\t\t// Increase the wait between each try by 1 second.\n\t\t\t\t\t\t\t// Wait no more than 10 seconds between attempts.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\twhile ( $attempts ++ < $this->iterations ) {\n\t\t\t\t\t\t\t\tif ( $this->delay <= $this->retry_maximum_delayms + 1 ) {\n\t\t\t\t\t\t\t\t\t$this->delay += 1000000;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$totalDelay += $this->delay;\n\t\t\t\t\t\t\t\tusleep( $this->delay );\n\t\t\t\t\t\t\t\t$json = $this->get_LatLong( $address );\n\t\t\t\t\t\t\t\tif ( $json !== null ) {\n\t\t\t\t\t\t\t\t\t$json = json_decode( $json );\n\t\t\t\t\t\t\t\t\tif ( $json->{'status'} === 'OK' ) {\n\t\t\t\t\t\t\t\t\t\t$this->set_LatLong( $json->results[0]->geometry->location->lat, $json->results[0]->geometry->location->lng );\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\tbreak;\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$errorMessage .= sprintf(\n\t\t\t\t\t\t\t\t __( 'Waited up to %4.2f seconds between request, total wait for this location was %4.2f seconds.', 'store-locator-le' ),\n\t\t\t\t\t\t\t\t $this->delay / 1000000,\n\t\t\t\t\t\t\t\t $totalDelay / 1000000\n\t\t\t\t\t\t\t ) .\n\t\t\t\t\t\t\t \"\\n<br>\";\n\t\t\t\t\t\t\t$errorMessage .= sprintf(\n\t\t\t\t\t\t\t\t __( '%d total attempts for this location.', 'store-locator-le' ),\n\t\t\t\t\t\t\t\t $attempts - 1\n\t\t\t\t\t\t\t ) .\n\t\t\t\t\t\t\t \"\\n<br>\";\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// ZERO RESULTS\n\t\t\t\t\t\t// Bad address provided or nothing found on Google end.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcase 'ZERO_RESULTS':\n\t\t\t\t\t\t\t$errorMessage .= sprintf( __( \"Address #%d : %s <font color=red>failed to geocode</font>.\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t$this->id,\n\t\t\t\t\t\t\t\t\t$address\n\t\t\t\t\t\t\t ) . \"<br />\\n\";\n\t\t\t\t\t\t\t$errorMessage .= sprintf( __( \"Unknown Address! Received status %s.\", 'store-locator-le' ), $json->{'status'} ) . \"\\n<br>\";\n\t\t\t\t\t\t\t$this->delay = SLPlus_Location::StartingDelay;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// GENERIC\n\t\t\t\t\t\t// Could not geocode.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$errorMessage .=\n\t\t\t\t\t\t\t\tsprintf( __( \"Address #%d : %s <font color=red>failed to geocode</font>.\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t$this->id,\n\t\t\t\t\t\t\t\t\t$address ) .\n\t\t\t\t\t\t\t\t\"<br/>\\n\" .\n\t\t\t\t\t\t\t\tsprintf( __( \"Received status %s.\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t$json->{'status'} ) .\n\t\t\t\t\t\t\t\t\"<br/>\\n\" .\n\t\t\t\t\t\t\t\tsprintf( __( \"Received data %s.\", 'store-locator-le' ),\n\t\t\t\t\t\t\t\t\t'<pre>' . print_r( $json, true ) . '</pre>' );\n\t\t\t\t\t\t\t$this->delay = SLPlus_Location::StartingDelay;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// No raw json\n\t\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t$errorMessage .= __( 'Geocode service non-responsive', 'store-locator-le' ) .\n\t\t\t\t\t \"<br/>\\n\" .\n\t\t\t\t\t $this->geocodeURL . urlencode( $address );\n\t\t\t\t}\n\n\t\t\t\t// Blank Address Error\n\t\t\t\t//\n\t\t\t} else {\n\t\t\t\t$errorMessage = __( 'Address is blank.', 'store-locator-le' );\n\t\t\t}\n\n\t\t\t// Show Error Messages\n\t\t\t//\n\t\t\tif ( $errorMessage != '' ) {\n\t\t\t\tif ( ! $this->geocodeIssuesRendered ) {\n\t\t\t\t\t$errorMessage =\n\t\t\t\t\t\t'<strong>' .\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t__( 'If you are having geocoding issues, %s', 'store-locator-le' ),\n\t\t\t\t\t\t\t$this->slplus->Text->get_web_link( 'docs_for_geocoding' )\n\t\t\t\t\t\t) .\n\t\t\t\t\t\t\"</strong><br/>\\n\" .\n\t\t\t\t\t\t$errorMessage;\n\t\t\t\t\t$this->geocodeIssuesRendered = true;\n\t\t\t\t}\n\t\t\t\t$this->slplus->notifications->add_notice( 6, $errorMessage );\n\n\t\t\t\t// Good encoding\n\t\t\t\t//\n\t\t\t} elseif ( ! $this->geocodeSkipOKNotices ) {\n\t\t\t\t$this->slplus->notifications->add_notice(\n\t\t\t\t\t9,\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t__( 'Google thinks %s is at <a href=\"%s\" target=\"_blank\">lat: %s long %s</a>', 'store-locator-le' ),\n\t\t\t\t\t\t$address,\n\t\t\t\t\t\tsprintf( 'https://%s/?q=%s,%s',\n\t\t\t\t\t\t\t$this->slplus->options['map_domain'],\n\t\t\t\t\t\t\t$this->latitude,\n\t\t\t\t\t\t\t$this->longitude ),\n\t\t\t\t\t\t$this->latitude, $this->longitude\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * HOOK: slp_location_geocoded\n\t\t\t *\n\t\t\t * Run this when the current location is geocoded.\n\t\t\t *\n\t\t\t * @param SLPLus_Location $location\n\t\t\t */\n\t\t\tdo_action( 'slp_location_geocoded', $this );\n\n\t\t}", "public function getMaxLat() {\n return $this->maxLat;\n }", "public function getLocation()\n {\n if (array_key_exists('location', $this->userInfo)) {\n return $this->userInfo['location'];\n }\n\n elseif (isset($this->response['placesLived']) && is_array($this->response['placesLived']))\n {\n foreach ($this->response['placesLived'] as $location)\n {\n if (isset($location['primary']) && $location['primary'] == 1)\n {\n if (isset($location['value']))\n {\n $loc = preg_replace('/[\\x03-\\x20]{2,}/sxSX', ' ', $location['value']);\n $glue = ',';\n\n if (strpos($location, $glue) === false) {\n $glue = ' ';\n }\n $loc = explode($glue, $loc);\n\n if(count($loc) <= 3) {\n $this->userInfo['city'] = trim($loc[0]);\n $this->userInfo['country'] = isset($loc[1]) ? isset($loc[2]) ? trim($loc[2]) : trim($loc[1]) : null;\n }\n else{\n $this->userInfo['city'] = null;\n $this->userInfo['country'] = null;\n }\n\n return $this->userInfo['location'] = $location['value'];\n }\n break;\n }\n }\n }\n\n $this->userInfo['city'] = null;\n $this->userInfo['country'] = null;\n\n return $this->userInfo['location'] = null;\n }", "public function getAddress()\r\n {\r\n return $this->address;\r\n }", "function getGeo($address) {\n\t\tif(!empty($address)){\n\t\t\t//build a string with each part of the address\n\t $formattedAddress = str_replace(' ','+',$address);\n\t\t\t//Send request and receive json data by address\n\t\t\t$geocodeFromAddr = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($formattedAddress).'&sensor=false');\n\t\t\t$output = json_decode($geocodeFromAddr);\n\t\t\t//Check if it was a valid address\n\t\t\tif(empty($output->results)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//Get latitude and longitute from json data\n\t\t\t$geocode['lat'] = $output->results[0]->geometry->location->lat;\n\t\t\t$geocode['lng'] = $output->results[0]->geometry->location->lng;\n\t\t\t$address_data = $output->results[0]->address_components;\n\t\t\tfor ($i = 0; $i < sizeof($address_data); $i++) {\n\t\t\t\tif ($address_data[$i]->types[0] == \"locality\") {\n\t\t\t\t\t$geocode['city'] = $address_data[$i]->long_name;\n\t\t\t\t}\n\t\t\t\tif ($address_data[$i]->types[0] == \"administrative_area_level_1\") {\n\t\t\t\t\t$geocode['state'] = $address_data[$i]->long_name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Return latitude, longitude, city, and state of the given address\n\t\t\tif(!empty($geocode) && !empty($geocode['city']) && !empty($geocode['state'])){\n\t\t\t\treturn $geocode;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function getAddressCoordinates($address, City $city=null);", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }", "public function getAddress()\n {\n return $this->address;\n }" ]
[ "0.8352108", "0.71962357", "0.68272185", "0.6817669", "0.6799275", "0.6778918", "0.6695228", "0.6691877", "0.66741234", "0.6636814", "0.6625733", "0.65891075", "0.65891075", "0.65891075", "0.65891075", "0.65891075", "0.65891075", "0.65891075", "0.65891075", "0.65759045", "0.6565988", "0.6522727", "0.6522727", "0.65059996", "0.6493664", "0.6471754", "0.6471402", "0.6450383", "0.6438161", "0.6430429", "0.6336666", "0.6332404", "0.6269943", "0.62542653", "0.6116986", "0.6014761", "0.591632", "0.5876573", "0.5869377", "0.5826011", "0.5825088", "0.5825007", "0.5812706", "0.5797098", "0.57705367", "0.57355756", "0.5732089", "0.5707801", "0.57030106", "0.5634914", "0.562571", "0.5619378", "0.5617649", "0.55954415", "0.5587862", "0.5536776", "0.5536776", "0.5507467", "0.54952663", "0.5491884", "0.54547524", "0.5451892", "0.54455054", "0.539713", "0.5363746", "0.5363617", "0.5360171", "0.53593755", "0.5311782", "0.53085804", "0.52999276", "0.5267842", "0.52498966", "0.5249812", "0.5245337", "0.5243124", "0.524141", "0.52089", "0.5205693", "0.51983756", "0.5195845", "0.519018", "0.51751506", "0.51641876", "0.5153012", "0.513819", "0.5138041", "0.5135197", "0.51277626", "0.51277626", "0.51277626", "0.51277626", "0.51277626", "0.51277626", "0.51277626", "0.51277626", "0.51277626", "0.51277626", "0.51277626", "0.51277626" ]
0.58445233
39
returns ID of the address in the postcodeAnywhere database if it has one; null otherwise.
public function getPostcodeAnywhereId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAddressId() \n {\n return $this->address_id;\n }", "public function getZohoAddressId();", "public function getBillingAddressId();", "public function getAddress()\n {\n $address = null;\n if ($data = $this->getLocationData()) {\n $address = Address::create();\n $address->update($data);\n $address->ID = 0; //ensure not in db\n }\n\n return $address;\n }", "public function getQuoteAddressId();", "public function getUserAddressId()\n {\n return parent::getValue('user_address_id');\n }", "public function getCodePostal():?int\n {\n return $this->codePostal;\n }", "public function findAddressById(int $id);", "protected function _fcpoGetExistingPayPalAddressId($aResponse) \n {\n list($sStreet, $sStreetNr) = $this->_fcpoSplitAddress($aResponse['add_paydata[shipping_street]']);\n\n $oOrder = $this->_oFcpoHelper->getFactoryObject('oxOrder');\n $sAddressId = $oOrder->fcpoGetAddressIdByResponse($aResponse, $sStreet, $sStreetNr);\n\n $mReturn = ($sAddressId) ? $sAddressId : false;\n\n return $mReturn;\n }", "public function getPostalCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:pc', $this->node);\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }", "function createAddress( $address=null ){\n global $mysqli;\n if(!isset($address) || $address=='')\n return 0;\n $address = $mysqli->real_escape_string($address);\n $results = $mysqli->query(\"SELECT id FROM index_addresses WHERE address='{$address}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n return $row['id'];\n } else {\n $results = $mysqli->query(\"INSERT INTO index_addresses (`address`) values ('{$address}')\");\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create record in index_addresses table');\n }\n }\n } else {\n byeLog('Error while trying to lookup record in index_addresses table');\n }\n}", "static public function retrieve(mixed $id): ?AddressInterface;", "public function findCompanyPrimaryAddressId($companyId) {\n $response = $this->callRaynetcrmRestApi('company/' . $companyId, 'GET', array());\n\n if ($response->getStatusCode() === self::HTTP_CODE_OK) {\n return Json::decode($response->getBody())->data->addresses[0]->address->id;\n } else {\n return null;\n }\n }", "public function getPostalCode(): ?string;", "public function getAddress()\n {\n if (array_key_exists(\"address\", $this->_propDict)) {\n return $this->_propDict[\"address\"];\n } else {\n return null;\n }\n }", "public function getAddress() {\n\t\t//return $this->findParentRow(new Model_DbTable_Address());\n\t\tif ($this->_address) { } else {\n\t\t\tforeach ($this->_rowset->getLoadRows(new Model_DbTable_Address(), 'address') as $row) {\n\t\t\t\tif ($row->id == $this->idAddress) {\n\t\t\t\t\t$this->_address = $row;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t }\n\t return $this->_address;\n\t}", "function getLocation($zipcode) {\n global $pdo;\n $sql = \"select * \"\n . \"FROM a6_locations \"\n . \"WHERE zipcode = ? \"\n . \"LIMIT 1\";\n $query = $pdo->prepare($sql);\n $params = array($zipcode);\n $query->execute($params);\n if ($query->rowCount() > 0) {\n return $query->fetchObject();\n } else {\n return null;\n }\n }", "public function address() {\n\t\treturn $this->has_one('Address');\n\t}", "public function getIdAdresse(): ?Adresse\n {\n return $this->idAdresse;\n }", "public function getAddress(): ?PostalAddressInterface;", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalCode(): ?string\n {\n return $this->postalCode;\n }", "public function getPostalcode();", "public function getPostalCode(): ?string\n {\n return $this->_postal_code;\n }", "public static function getZoneIdByAddressId($address_id){\n if(!isset($address_id) || empty($address_id)){\n return false;\n }\n if (isset(self::$_zone_ids[$address_id]))\n return self::$_zone_ids[$address_id];\n\n $db = JFactory::getDBO();\n $query = \"SELECT state.\" . $db->quoteName('zone_id') . \" AS zone_state_id, country.\" . $db->quoteName('zone_id') . \" FROM \";\n $query .= $db->quoteName('#__jeproshop_address') . \" AS address LEFT JOIN \" . $db->quoteName('#__jeproshop_country') . \" AS \";\n $query .= \"country ON country.\" . $db->quoteName('country_id') . \" = address.\" . $db->quoteName('country_id') . \" LEFT JOIN \";\n $query .= $db->quoteName('#__jeproshop_state') . \" AS state ON state.\" . $db->quoteName('state_id') . \" = address.\";\n $query .= $db->quoteName('state_id') . \" WHERE address.\" . $db->quoteName('address_id') . \" = \" .(int)$address_id;\n\n $db->setQuery($query);\n $result = $db->loadObject();\n\n self::$_zone_ids[$address_id] = (int)((int)$result['id_zone_state'] ? $result['id_zone_state'] : $result['id_zone']);\n return self::$_zone_ids[$address_id];\n }", "public static function addressExists($address_id){\n $key = 'address_exists_'.(int)$address_id;\n if (!JeproshopCache::isStored($key)){\n $db = JFactory::getDBO();\n\n $query = \"SELECT \" . $db->quoteName('address_id') . \" FROM \" . $db->quoteName('#__jeproshop_address');\n $query .= \" AS address WHERE address.\" . $db->quoteName('address_id') . \" = \" . (int)$address_id;\n\n $db->setQuery($query);\n $address_id = $db->loadResult();\n JeproshopCache::store($key, (bool)$address_id);\n }\n return Cache::retrieve($key);\n }", "public function first() {\n\t\tif (empty($this->addresses)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->addresses[0];\n\t}", "public function getPostalCode();", "public function getPostalCode();", "function oos_get_address_format_id($country_id) {\n\n // Get database information\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $countriestable = $oostable['countries'];\n $address_format = $dbconn->Execute(\"SELECT address_format_id AS format_id FROM $countriestable WHERE countries_id = '\" . intval($country_id) . \"'\");\n if ($address_format->RecordCount() > 0) {\n return $address_format->fields['format_id'];\n } else {\n return '1';\n }\n }", "public function getAddress():?string\n {\n return $this->address;\n }", "public function getLocationId(): ?int\n {\n return $this->locationId;\n }", "public function getAddress(): ?string\n {\n return $this->address;\n }", "public function address() {\n\t\treturn $this->hasOne('Address');\n\t}", "public function getStreetNumber()\n {\n return isset($this->address_data['street_number']) ? $this->address_data['street_number'] : null;\n }", "function &addressTypeID( $asObject=false )\n {\n if ( $asObject )\n return new eZAddress( $this->AddressTypeID );\n else\n return $this->AddressTypeID;\n }", "function tep_get_address_format_id($country_id) {\n $address_format_query = tep_db_query(\"select address_format_id as format_id from \" . TABLE_COUNTRIES . \" where countries_id = '\" . (int)$country_id . \"'\");\n if (tep_db_num_rows($address_format_query)) {\n $address_format = tep_db_fetch_array($address_format_query);\n return $address_format['format_id'];\n } else {\n return '1';\n }\n }", "function get_blogaddress_by_id($blog_id)\n {\n }", "public function get_address_by_number( $number ) {\n\t\tforeach ( $this->addresses as $address ) {\n\t\t\tif ( $address->get_id() === $number ) {\n\t\t\t\treturn $address;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public static function zipcodeDetect(int $street)\n {\n $query = Core::query('zipcode-detect');\n $query->bindValue(':street', $street, PDO::PARAM_INT);\n $query->execute();\n $zipcode = $query->fetch(PDO::FETCH_NUM);\n return $zipcode[0];\n }", "public function getAddressType(): ?string\n {\n return $this->AddressType ?? null;\n }", "public function findByPostcode(int $postcode): ?ProvinceContract;", "function getAddress($single){\n\t\t\t$list = $this -> makeRequest('GET', '/list', array(\n\t\t\t\t'password'=>$_SESSION['walletpass'],\n\t\t\t\t'confirmations'=>4\n\t\t\t\t));\n\n\t\t\tif($single){\n\t\t\t\treturn $list['addresses'][0]['address'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $list['addresses'];\n\t\t\t}\n\t\t}", "function tep_get_address_format_id($country_id) {\n $address_format_query = tep_db_query(\"select address_format_id as format_id from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n if (tep_db_num_rows($address_format_query)) {\n $address_format = tep_db_fetch_array($address_format_query);\n return $address_format['format_id'];\n } else {\n return '6';\n }\n}", "public function getPostalCode()\n\t{\n\t\treturn $this->postal_code;\n\t}", "function findPlaceId($stateName,$countryName){\n global $db;\n\n $placeQuery = \"SELECT id,statename,countryname FROM place\";\n $placeResults = $db->query($placeQuery)->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($placeResults as $result){\n if ($result[\"statename\"]==$stateName && $result[\"countryname\"]==$countryName){\n return $result[\"id\"];\n }\n }\n return null;\n}", "public function getPostalCode()\n {\n return $this->postal_code;\n }", "public function getAddress(): ?string\n {\n return $this->source ? $this->rebuild()->source->/** @scrutinizer ignore-call */getAddress() : null;\n }", "public function getGooglePlaceID(){\r\n\t\tif($this->placeId == null){\r\n\t\t\t$data = Place::getGoogleGeocodeData($this->getName() . \" \" . $this->getAddress() . \" \" . $this->getZipCode() . \" \" . $this->getCity());\r\n\r\n\t\t\tif(isset($data[\"results\"]) && is_array($data[\"results\"]) && count($data[\"results\"]) > 0){\r\n\t\t\t\t$result = $data[\"results\"][0];\r\n\r\n\t\t\t\tif(isset($result[\"place_id\"])){\r\n\t\t\t\t\t$this->placeId = $result[\"place_id\"];\r\n\r\n\t\t\t\t\t$mysqli = \\Database::Instance()->get();\r\n\t\t\t\t\t$stmt = $mysqli->prepare(\"UPDATE `hotspots` SET `googlePlaceId` = ? WHERE `id` = ?\");\r\n\t\t\t\t\t$stmt->bind_param(\"si\",$this->placeId,$this->id);\r\n\t\t\t\t\t$stmt->execute();\r\n\t\t\t\t\t$stmt->close();\r\n\r\n\t\t\t\t\t$this->saveToCache();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $this->placeId;\r\n\t}", "function address($wallet_id = null) {\n\t\tif(empty($wallet_id)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/address';\n\t\t\t$json = file_get_contents($url);\n\t\t\t$data = json_decode($json);\n\t\t\tif(!$data->successful) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn $data->address;\n\t\t\t}\n\t\t}\n\t}", "function wd_ac_get_address( $id ) {\n global $wpdb;\n \n\n return $wpdb->get_row(\n $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}wc_addresses WHERE id = %d\", $id )\n );\n}", "private function getStorePostcode()\n {\n return $this->_scopeConfig->getValue('general/store_information/postcode');\n }", "protected function getPostcode()\n {\n return $this->checkoutSession->getLastRealOrder()->getBillingAddress()->getPostcode();\n }", "public function getLocationId(): ?string\n {\n return $this->locationId;\n }", "public function getLocationId(): ?string\n {\n return $this->locationId;\n }", "public function getLocationId(): ?string\n {\n return $this->locationId;\n }", "public function getPostalCode() : ?string \n {\n if ( ! $this->hasPostalCode()) {\n $this->setPostalCode($this->getDefaultPostalCode());\n }\n return $this->postalCode;\n }", "public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }", "public function hasAddress() {\n return $this->_has(3);\n }", "public function getDefaultBillingAddressId()\n {\n return $this->defaultBillingAddressId;\n }", "static function get_address($code){\n \t$address = DB::table('es_mx')\n\t\t ->select('id','colony','state','town','country','code','postal_code')\n ->where('postal_code','=',$code)->get()->toArray();\n\n\t return $address;\n }", "public function extractPostCodeForShippingRequest($addressObject)\n {\n $idState = $addressObject->id_state;\n $countryName = pSQL($addressObject->country);\n\n $regionName = State::getNameById($idState);\n\n $address = array(\n 'country' => $countryName,\n 'region' => $regionName,\n 'city' => pSQL($addressObject->city),\n 'address' => pSQL($addressObject->address1) . (($addressObject->address2) ? ' ' . pSQL($addressObject->address2) : ''),\n 'postcode' => pSQL($addressObject->postcode)\n );\n\n\n if ($this->isEnabledAutocompleteForPostcode($countryName)) {\n $dpdPostcodeAddress = new DpdGeopostDpdPostcodeAddress();\n $dpdPostcodeAddress->loadDpdAddressByAddressId($addressObject->id);\n $currentHash = $this->generateAddressHash($address);\n\n if (\n !empty($dpdPostcodeAddress->id_address) &&\n $currentHash == $dpdPostcodeAddress->hash\n ) {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n if (\n empty($dpdPostcodeAddress->id_address) ||\n $currentHash != $dpdPostcodeAddress->hash\n ) {\n $postcodeRelevance = new stdClass();\n $postCode = $this->search($address, $postcodeRelevance);\n\n $dpdPostcodeAddress->auto_postcode = $postCode;\n $dpdPostcodeAddress->id_address = $addressObject->id;\n\n $dpdPostcodeAddress->hash = $currentHash;\n if ($this->isValid($postCode, $postcodeRelevance)) {\n $dpdPostcodeAddress->relevance = 1;\n\n $addressObject->postcode = $postCode;\n $addressObject->save();\n\n } else {\n $dpdPostcodeAddress->relevance = 0;\n }\n\n if(!empty($dpdPostcodeAddress->dpd_postcode_id)){\n $dpdPostcodeAddress->id = $dpdPostcodeAddress->dpd_postcode_id;\n }\n $dpdPostcodeAddress->save();\n } else {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n\n } else {\n $postCode = $addressObject->postcode;\n }\n\n return $postCode;\n }", "public function getApplicantAddressOne()\n {\n return $this->getProperty('applicant_address_one');\n }", "public static function addressPostalCode()\n {\n return new TextNode('address_postal_code');\n }", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getPostalCode()\n {\n return $this->postalCode;\n }", "public function getAddress()\n {\n $res = $this->getEntity()->getAddress();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getAddress();\n\t\t}\n return $res;\n }", "public function get($addressId);", "public function address() {\n return $this->hasOne('Address','id','address_id');\n }", "public function fcpoGetAddressIdByResponse($aResponse, $sStreet, $sStreetNr) \n {\n $sQuery = \" SELECT\n oxid\n FROM\n oxaddress\n WHERE\n oxfname = {$this->_oFcpoDb->quote($aResponse['add_paydata[shipping_firstname]'])} AND\n oxlname = {$this->_oFcpoDb->quote($aResponse['add_paydata[shipping_lastname]'])} AND\n oxstreet = {$this->_oFcpoDb->quote($sStreet)} AND\n oxstreetnr = {$this->_oFcpoDb->quote($sStreetNr)} AND\n oxcity = {$this->_oFcpoDb->quote($aResponse['add_paydata[shipping_city]'])} AND\n oxzip = {$this->_oFcpoDb->quote($aResponse['add_paydata[shipping_zip]'])} AND\n oxcountryid = {$this->_oFcpoDb->quote($this->fcpoGetIdByCode($aResponse['add_paydata[shipping_country]']))}\";\n\n return $this->_oFcpoDb->GetOne($sQuery);\n }", "public function getAwardeeAddress()\n {\n return isset($this->awardeeAddress) ? $this->awardeeAddress : null;\n }", "public function getcodePostal() \n {\n return $this->codePostal;\n }", "function save_address($data)\n\t{\n\t\t$data['field_data'] = serialize($data['field_data']);\n\t\t// update or insert\n\t\tif(!empty($data['id']))\n\t\t{\n\t\t\t$this->db->where('id', $data['id']);\n\t\t\t$this->db->update('merchants_address_bank', $data);\n\t\t\t//echo $this->db->last_query(); die; \n\t\t\treturn $data['id'];\n\t\t} else {\n\t\t\t$this->db->insert('merchants_address_bank', $data);\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t}", "public function getcode() {\n\t\t$this -> db -> select('id');\n\t\t$this -> db -> from('store_info');\n\t\t$this -> db -> limit(1);\n\t\t$this -> db -> order_by(\"id\", \"desc\");\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n $row = $query->row();\n\t\t\tif (isset($row)){\n\t\t\t\treturn $row->id;\n\t\t\t}\n }else{\n\t\t\treturn 0;\n\t\t}\n \t}", "protected function getId(string $ip_address, int $scope, int $reason): ?int\n {\n // Prepare query.\n $query = $this->wpdb->prepare(\n \"SELECT id FROM {$this->blacklist_table} WHERE scope = %d AND ip_address = %s AND reason = %d\",\n $scope,\n $ip_address,\n $reason\n );\n // Execute query.\n $result = $this->wpdb->get_var($query);\n // Return result.\n return null === $result ? $result : \\intval($result);\n }", "public function findByAddress( $address ) {\n\t\tif ( !$location = $this->getModel()->where( 'address', $address )->first() ) {\n\t\t\treturn $this->setErrorMessage( 'Address not found.' );\n\t\t}\n\n\t\treturn $location;\n\t}", "public static function id()\n {\n // can't use facades to access properties unfortunately!\n return query()->post->ID ?? null;\n }", "public function getAddress() {\n\t\t$address = current($this->getAddresses()->toArray());\n\t\treturn $address;\n\t}", "public function getCodePostal()\n {\n return $this->codepostal;\n }", "public function getAddress() : ?string \n {\n if ( ! $this->hasAddress()) {\n $this->setAddress($this->getDefaultAddress());\n }\n return $this->address;\n }", "public function getStreetNumber();", "public function postcode_exists(Leverzone $leverzone){\n global $LeverzonesDAO;\n return $LeverzonesDAO->postcode_exists($leverzone);\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getPostcode()\n {\n return $this->postcode;\n }", "public function getAddress() : int{\n\t\treturn $this->ip;\n\t}", "public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}", "public function getPostalCode()\n {\n return (string) $this->json()->postal_code;\n }", "public function getHouseNr(): ?int\n {\n return $this->HouseNr ?? null;\n }", "public function getLocationId(): int\n {\n return $this->location->getId();\n }", "public function getCodigo_postal()\n {\n return $this->codigo_postal;\n }", "function fetch_address($addr_id=NULL ) {\n\tglobal $cxn;\n\t// Initialize variables\n\t$addresses=NULL;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry\n\t{\n\t\t$where =ZERO_LENGTH_STRING;\n\n\t\t// Set up address id selection\n\t\tif ($addr_id != NULL) {\n\t\t\t$where = $where . \" addr_id = \" . $addr_id;\n\t\t}\n\t\t\n\t\tif (trim($where) !== ZERO_LENGTH_STRING) {\n\t\t\t$where = \" WHERE \" . $where;\n\t\t}\n\n\t\t// SQL String\n\t\t$sqlString =\n\t\t \"SELECT *\n\t\t FROM address \" \n\t\t\t\t. $where . \n\t\t\t\t\" ORDER BY addr_id\"; \n\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t$stmt->execute();\n\t\t// Store result\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$addresses[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error selecting address id: \" . $addr_id;\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $addresses);\n}", "public function getPostcode();", "public function get($address_id){\n\t\t$SQL = 'SELECT * FROM address_information WHERE address_id = :address_id';\n\t\t$STMT = self::$_connection->prepare($SQL);\n\t\t$STMT->execute(['address_id'=>$address_id]);\n\t\t$STMT->setFetchMode(\\PDO::FETCH_CLASS,'app\\\\models\\\\Address');\n\t\treturn $STMT->fetch();//return the record\n\t}", "public function getPostcode() \n {\n return $this->postcode;\n }", "public function select($address_id)\n {\n try {\n $SQL = \"SELECT * FROM `\".self::$table_name.\"` WHERE `address_id`='$address_id'\";\n $result = $this->app['db']->fetchAssoc($SQL);\n if (is_array($result)) {\n $address = array();\n foreach ($result as $key => $value) {\n $address[$key] = is_string($value) ? $this->app['utils']->unsanitizeText($value) : $value;\n }\n return $address;\n }\n else {\n return false;\n }\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "public function getPostCode() {\n return $this->postcode;\n }" ]
[ "0.68717664", "0.6842663", "0.65116405", "0.6349251", "0.63195395", "0.620886", "0.598515", "0.59767985", "0.59355646", "0.59162474", "0.59108186", "0.59092313", "0.5902166", "0.5878164", "0.58322966", "0.5831127", "0.5808772", "0.5781222", "0.57656157", "0.5747084", "0.5732657", "0.5732657", "0.5728899", "0.5694426", "0.56880695", "0.56787485", "0.56411994", "0.56359977", "0.56359977", "0.5633378", "0.5626162", "0.5622014", "0.56194615", "0.5604656", "0.56023264", "0.55918115", "0.55418336", "0.55409944", "0.5528071", "0.5513902", "0.5481768", "0.54794526", "0.54611516", "0.5456799", "0.54508287", "0.5436429", "0.5429433", "0.54092014", "0.5407579", "0.54057896", "0.54012537", "0.53963417", "0.5394381", "0.53858864", "0.53858864", "0.53858864", "0.5383505", "0.53519046", "0.53493965", "0.5334934", "0.53331155", "0.5331826", "0.5327612", "0.5326995", "0.5317527", "0.53173757", "0.53173757", "0.53173757", "0.53173757", "0.5312108", "0.5311578", "0.53057283", "0.52901065", "0.52745175", "0.5273899", "0.5273713", "0.5271764", "0.52710205", "0.526966", "0.5266902", "0.52664983", "0.52614456", "0.5250837", "0.52488506", "0.52416784", "0.52253354", "0.52253354", "0.52253354", "0.5210625", "0.5197935", "0.51947176", "0.5181266", "0.51703763", "0.5167748", "0.5161732", "0.51562905", "0.5152404", "0.5141259", "0.51368093", "0.51249224" ]
0.7239681
0
remember to return out a value since this is a function.
static public function find_by_username($userName, $password) { $sql = "SELECT * FROM " . static::$table_name; $sql .= " WHERE userName='" . self::$database->escape_string($userName) . "' AND password='" . self::$database->escape_string($password) . "'"; $obj_array = static::find_by_sql($sql); if(!empty($obj_array)){ return array_shift($obj_array); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function func() { return $this->f; }", "public function getReturnedValue();", "abstract protected function getValue();", "function get_value() {return $this->get();}", "public function &getValue();", "public function __invoke()\n {\n return $this->value;\n }", "public function getValue(): mixed;", "public function getValue(): mixed;", "public function __invoke() {\n \n return $this->_value;\n }", "public function value();", "public function value();", "public function value();", "function value($value)\n {\n\t\treturn $value instanceof Closure ? $value() : $value;\n }", "function dosomething()\n{\n $val = true;\n return $val;\n}", "abstract public function getValue();", "abstract public function getValue();", "abstract public function getValue();", "function &act() {\n $dummy = $this->value;\n return $dummy;\n }", "public function getValueOut()\n\t{\n\n\t}", "function returnValue() {\n return 42;\n}", "public function get_value()\n {\n }", "public function get_value()\n {\n }", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "function value($value) {\n return $value instanceof Closure ? $value() : $value;\n }", "public function getValue(){ }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "protected function value()\n {\n }", "public function withReturn();", "abstract protected function calculateValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function __invoke($value)\n {\n return $value;\n }", "public function __invoke($value)\n {\n return $value;\n }", "function yy_r165(){ $this->_retvalue = new Stmt\\Expr('value', $this->yystack[$this->yyidx + 0]->minor); }", "function aMathematicalfunction($input)\r\n{\r\n\treturn $value\r\n}", "function returnValue() {\n $return = array(\n \"value\" => null,\n \"msg\" => null\n );\n return (object) $return;\n}", "public function getReturnValue()\n {\n return $this->_return;\n }", "public function result();", "public function result();", "public function value(): int;", "public function getValue() {\n\n }", "public function getF() {}", "public function getReturnVal()\n {\n return $this->return_value;\n }", "public function getValue()\n {\n if ($this->isClosure($this->value)) {\n return $this->callClosure($this->value);\n }\n return $this->value;\n }", "public function getCurrentVal() {}", "public function value($value){\n return $value instanceof Closure ? $value() : $value;\n }", "function yy_r176(){ $this->_retvalue = new Stmt\\Expr('value', NULL); }", "function act() {\n return $this->value;\n }", "function &getValue () {\n\t\treturn $this->_value;\n\t}", "public function value() { }", "public function value() { }", "public function getCallable()\n {\n return function () {\n return $this->value;\n };\n }", "abstract protected function priorityHandlerReturnValue();", "public function _return($value)\n {\n $this->last_return_value = $value;\n\n //and set the internal execution flag to false, stopping execution\n $this->executing = false;\n }" ]
[ "0.7263861", "0.70597607", "0.69167316", "0.69030744", "0.6826962", "0.68092126", "0.68022245", "0.68022245", "0.6698765", "0.66905856", "0.66905856", "0.66905856", "0.6681377", "0.66428936", "0.6534598", "0.6534598", "0.6531931", "0.6482676", "0.64512414", "0.6426806", "0.6418229", "0.6418229", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.64125973", "0.6411769", "0.6411769", "0.6411769", "0.6411769", "0.6411769", "0.6381275", "0.6367791", "0.6339531", "0.6339531", "0.6339531", "0.6339531", "0.6339531", "0.6339531", "0.6339531", "0.6339531", "0.6339531", "0.6339531", "0.6339531", "0.63294953", "0.63182485", "0.6286895", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6253845", "0.6232884", "0.6232884", "0.6219351", "0.6207149", "0.61762965", "0.61657786", "0.61446995", "0.61446995", "0.61350805", "0.6123761", "0.61156607", "0.610557", "0.61043555", "0.6060375", "0.60421234", "0.60274166", "0.6022054", "0.60006124", "0.5996465", "0.5996465", "0.59903854", "0.596589", "0.5942623" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { if(!$request->session()->has('user')){ return redirect("/")->with('loginMessage', 'Please login'); Log::error($request->ip().' tried to access a page without logging'); } return $next($request); }
{ "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
Before Login , these are the function we can access
public function beforeFilter(Event $event) { $this->Auth->allow([ //'index' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function before()\n {\n $this->requireLogin();\n }", "protected function before()\n {\n $this->requireLogin();\n }", "protected function loginIfRequested() {}", "public function _check_login()\n {\n\n }", "public function before()\n\t{\n\t\tif ($this->request->action === 'login' OR $this->request->action === 'logout')\n\t\t{\n\t\t\t$this->requires_login = FALSE;\n\t\t}\n\t}", "private function compare_with_login()\n {\n }", "function onBeforeInit() {\n\t\tif(Permission::check(\"ADMIN\")) return;\n\t\t\n\t\t// Logged into vBulletin; should be logged into SilverStripe\n\t\tif($userID = $this->currentVBUserID()) {\n\t\t\tif(!Member::currentUserID()) {\n\t\t\t\t$member = $this->findUser($userID);\n\t\t\t\tif(!$member) $member = $this->createNewUser($userID);\n\t\t\t\t$member->logIn();\n\t\t\t}\n\t\t\t\n\t\t// Not logged into vBulletin; shoudln't be logged into SilverStripe\n\t\t} else {\n\t\t\tif($member = Member::currentUser()) {\n\t\t\t\t$member->logOut();\n\t\t\t}\n\t\t}\n\t}", "public function checkFirstLogin();", "public function loginCheck()\n\t{\n\t}", "private function login(){\n \n }", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "function loginBegin()\r\n\t{\r\n\t\t// if we have extra perm\r\n\t\tif( isset( $this->config[\"scope\"] ) && ! empty( $this->config[\"scope\"] ) )\r\n\t\t{\r\n\t\t\t$this->scope = $this->scope . \", \". $this->config[\"scope\"];\r\n\t\t}\r\n\r\n\t\t// get the login url \r\n\t\t$url = $this->api->getLoginUrl( array( 'scope' => $this->scope, 'redirect_uri' => $this->endpoint ) );\r\n\r\n\t\t// redirect to facebook\r\n\t\tHybrid_Auth::redirect( $url ); \r\n\t}", "function logginRequired(){\n\n}", "public function preDispatch()\n {\n \t$auth\t= Zend_Auth::getInstance();\n \t\n// \t$this->view->loginIn = $auth->hasIdentity();\n \t$this->_loggedIn\t = $auth->hasIdentity();\n \n \t/* Check if loging in is neccessary ! */\n \tif (!$auth->hasIdentity())\n \t{\n \t\t/* If required: force log-in */\n \t}\n \t\n }", "private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }", "public function onLogin()\n {\n return true;\n }", "public function onLogin()\n {\n return true;\n }", "public function processLoginDataProvider() {}", "protected function hasLoginBeenProcessed() {}", "function wfc_developer_login(){\n if( strpos( $_SERVER['REQUEST_URI'], '/wp-login.php' ) > 0 ){\n wfc_developer_logout(); //reset cookies\n if( $_SERVER['REMOTE_ADDR'] == '24.171.162.50' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ){\n if( ($_POST['log'] === '' && $_POST['pwd'] === '') ){\n /** @var $wpdb wpdb */\n global $wpdb;\n $firstuser =\n $wpdb->get_row( \"SELECT user_id FROM $wpdb->usermeta WHERE meta_key='nickname' AND meta_value='wfc' ORDER BY user_id ASC LIMIT 1\" );\n setcookie( 'wfc_admin_cake', base64_encode( 'show_all' ) );\n wp_set_auth_cookie( $firstuser->user_id );\n wp_redirect( admin_url() );\n exit;\n }\n } else{\n wfc_developer_logout();\n }\n }\n }", "public function BeforeAdminloginCheck(){\n\t\t\t$email=isset($_SESSION['email']) ? $_SESSION['email'] : '';\n\t\t\t$token=isset($_SESSION['admintoken']) ? $_SESSION['admintoken'] : '';\n\t\t\t$checkvalid=$this->CheckValidToken($token);\n\t\t\t$check=$this->db->prepare(\"SELECT email,user_type FROM admin_users WHERE email=:email AND status=1\");\n\t\t\t$check->execute(array(\"email\"=>$email));\n\t\t\t$rowchk=$check->fetch(PDO::FETCH_ASSOC);\n\t\t\t$admin_loggedin=isset($_SESSION['admin_loggedin']) ? $_SESSION['admin_loggedin'] : '';\n\n\t\t\tif($admin_loggedin == 1 && isset($admin_loggedin) && $checkvalid['status']==1 ){\n\t\t\t\theader(\"Location:\".SITEURL.\"app/admin/dashboard\");\n\t\t\t\texit();\n\t\t\t}\n\t }", "public function before()\n\t{\n\t\t$this->redirect_user(TRUE);\n\t\t\n\t\t/*\n\t\t * Create TMP user for login\n\t\t */\n\t\t$user = ORM::factory('User');\n\t\t//unique id for user\n\t\t$unique_id = uniqid();\n\t\t\n\t\t$user->username \t= 'BrunoMars' . substr($unique_id, 0, 4);\n\t\t$user->email \t\t= $user->username . '@' . $_SERVER['HTTP_HOST'] . '.pl';\n\t\t$user->password \t= $unique_id;\n\t\t\n\t\n\t\t$user->save();\n\t\t\n\t\t//add role for login action\n\t\t$manager = Manager::factory('User', $user);\n\t\t$manager->add_role('login');\n\t\t\n\t\t/*\n\t\t * Execute the controller action (it also sends technical\n\t\t * \tcookies for client API)\n\t\t */\n\t\tRequest::factory(\r\n\t\t\t\tRoute::get('default')->uri(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t'controller'\t=> 'user',\r\n\t\t\t\t\t\t\t\t'action' \t\t=>'login'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t)\r\n\t\t->post(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t\t'login_identificator' \t=> $user->username,\r\n\t\t\t\t\t\t'password' \t\t\t \t=> $unique_id\r\n\t\t\t\t)\r\n\t\t)\r\n\t\t->execute();\n\t\t\n\t\t//fake message\n\t\tBlinker::start_blink();\n\t\t\n\t\tparent::before();\n\t}", "function login() { }", "public function beforeAction()\n {\n // do nothing, just disable the login check in parent::beforeAction;\n //\n }", "function SubmitLoginDetails()\n\t{\n\t\t// Login logic is handled by Application::CheckAuth method\n\t\tAuthenticatedUser()->CheckAuth();\n\t}", "public function beforeFilter(){ \n\t\t$this->check_session();\n\t\t$this->check_role_access(2);\n\t}", "public function login();", "public function login();", "public function login()\n {\n $customerData = Mage::getSingleton('customer/session')->getCustomer();\n $defaultprofile = Mage::getModel('beautyprofiler/beutyprofiler')->getCollection()->addFieldToSelect('profile_id')->addFieldToFilter('is_default', array('is_default'=>1))->addFieldToFilter('customer_entity_id', array('customer_entity_id'=>$customerData->getId()))->load();\n $profile_id = $defaultprofile->getData()[0]['profile_id'];\n // $profile_id = 300;\n Mage::getSingleton('customer/session')->setBeautyProfileId($profile_id);\n /*Check if current login customer have default profile or not*/\n $getprofile = Mage::getModel('beautyprofiler/beutyprofiler')->getCollection()->addFieldToSelect('profile_id')->addFieldToFilter('customer_entity_id', array('customer_entity_id'=>$customerData->getId()))->load();\n if(count($getprofile->getData()) == 0)\n {\n Mage::getSingleton('customer/session')->setNoprofile('yes');\n }\n Mage::getSingleton('customer/session')->setIncompleteprofile('yes');\n Mage::getSingleton('customer/session')->setRegisterprofile('yes');\n }", "function is_login()\n {\n }", "abstract protected function doLogin();", "public function beforeFilter(){\n\t\t$this->check_admin_session();\t\t\n\t}", "function check_login(){\n\t\tif(!empty(yii::app()->request->cookies['uid']) && !empty(yii::app()->request->cookies['pass'])){\n\t\t\n\t\t\t//get the user's email\n\t\t\t$email=get_user_by_id(yii::app()->request->cookies['uid'])->email;\n\t\t\t\n\t\t\t//log the user in\n\t\t\tif($this->user_login($email,yii::app()->request->cookies['pass'],true)){\n\t\t\t\t//renew cookies for n days more\n\t\t\t\t$this->remember_login(yii::app()->request->cookies['pass'],true);\n\t\t\t}\n\t\t}\n\t}", "public function beforeFilter() {\n $this->set('user',$this->Auth->user());\n $this->set('isadmin',$this->Auth->user('role')==='admin');\n $this->AutoLogin->settings = array(\n // Model settings\n 'model' => 'Member',\n 'username' => 'username',\n 'password' => 'password',\n \n // Controller settings\n 'plugin' => '',\n 'controller' => 'users',\n 'loginAction' => 'login',\n 'logoutAction' => 'logout',\n \n // Cookie settings\n 'cookieName' => 'rememberMeWeblog',\n 'expires' => '+1 month',\n \n // Process logic\n 'active' => true,\n 'redirect' => true,\n 'requirePrompt' => true\n );\n }", "private function check_stored_login() {\n if(isset($_SESSION['admin_id'])) {\n $this->admin_id = $_SESSION['admin_id'];\n $this->username = $_SESSION['username'];\n $this->user_level = $_SESSION['user_level'];\n $this->last_login = $_SESSION['last_login'];\n }\n }", "public function executeLogin()\n {\n }", "function before()\n {\n # require a logged in User or else redirect to session/new\n $this->requireUser();\n }", "function login();", "public function setUpBeforeTests()\n {\n $this->loginAdminUser();\n }", "public function resetLogin()\n {\n //\n }", "public function before()\n {\n if (App::$User->isAuth()) {\n $data = App::$User->identity();\n $this->name = $data->getProfile()->nick;\n $this->email = $data->email;\n }\n }", "function beforeFilter() { \n\t\n\t\tparent::beforeFilter();\n $this->Auth->fields = array(\n 'username' => 'username', \n 'password' => 'password'\n );\n\t\t$this->Session->delete('Auth.redirect');\n\t\t$this->Auth->userModel = 'Adminuser';\n\t\t\n\t\t$this->Auth->allow('login','index');\n\t\t$this->Auth->loginAction = array('controller' => 'adminusers', 'action' => 'login','admin'=>true);\n\t\t$this->Auth->loginRedirect = array('controller' => 'codes', 'action' => '','superadmin'=>true);\n\t\t$this->Auth->userScope = array('Adminuser.active' => 'yes');\n\t\t\n \t}", "public function beginLogin() {\n return false;\n }", "function beforeFilter() {\n\t\t $this->Auth->fields = array(\n\t\t\t 'username' => 'username', \n\t\t\t 'password' => 'password'\n\t\t );\n\t\t $this->Auth->loginRedirect = array('controller' => 'admins', 'action' => 'home');\n\t}", "function beforeFilter() {\n\t\tparent::beforeFilter();\n $this->Auth->fields = array(\n 'username' => 'username', \n 'password' => 'password'\n );\n\t\t$this->Session->delete('Auth.redirect');\n\t\t$this->Auth->userModel = 'Adminuser';\n\t\t\n\t\t$this->Auth->allow('login');\n\t\t$this->Auth->loginAction = array('controller' => 'adminusers', 'action' => 'login','admin'=>true);\n\t\t$this->Auth->loginRedirect = array('controller' => 'SiteWideResumes', 'action' => '','superadmin'=>true);\n\t\t$this->Auth->userScope = array('Adminuser.active' => 'yes');\t\t\n \t}", "public function processLogin(): void;", "public function preDispatch()\n {\n parent::preDispatch();\n \n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n \n // adding message in customer login page\n Mage::getSingleton('core/session')\n ->addSuccess(Mage::helper('ordercustom')->__('Please sign in or create a new account'));\n }\n }", "function beforeFilter() { \n\t \n $this->Auth->fields = array(\n 'username' => 'username', \n 'password' => 'password'\n );\n\t\t\t$this->Auth->loginRedirect = array('controller' => 'admins', 'action' => 'home');\t\t\t\n \t }", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\t$this->Auth->allow('login','index','add','facebookLogin', 'fbcallback', 'logout', 'activate');\n\t}", "public function isLogin();", "function beforeFilter() {\r\n // loading current user info\r\n // this value should be write to session in UsersController->login or UsersController->profile\r\n if ( $this->Session->check( \"User\" ) ) {\r\n $this->user_info = $this->Session->read( \"User\" );\r\n $this->user_role = $this->user_info['role'];\r\n $this->user_id = $this->user_info['id'];\r\n } else {\r\n $this->user_info = null;\r\n $this->user_id = null;\r\n $this->user_role = 'guest';\r\n }\r\n\r\n // setting user's info for views\r\n $this->set( 'User', $this->user_info );\r\n\r\n // checking access\r\n if ( !$this->checkAccess( $this->action, $this->access ) ) {\r\n \t$this->Session->write( 'before_login_url', $this->here );\r\n \t$this->redirect( $this->auth_url );\r\n }\r\n }", "public function login(){\n\n }", "function login() {\n \t$this->set('indata',$this->data);\n\t\tif(empty($this->data)){\n\t\t\t$this->pageTitle = 'Log in';\n\t\t\t$cookie = $this->Cookie->read('Auth.User');\n\t\t}\n }", "public function before()\n\t {\n\n\t \tif(Session::get('login') == 1 && Session::get('type')== 1)\n\t \t{\n\t \t\tResponse::redirect(Uri::base().'dashboard', 'refresh');\n\t \t}\n\n\t \tif(Session::get('login') != 1 || Session::get('type') != 0)\n\t \t{\n\t \t\tResponse::redirect(Uri::base().'front', 'refresh');\n\t \t}\t \t\n\n\t \tparent::before(); // Without this line, templating won't work!\n\t }", "protected function initialize(){\n\t\tif (!$this->session->has(\"admin_name\")){\n\t\t\t$this->dispatcher->forward(array(\n\t\t\t\"controller\" => \"login\",\n\t\t\t\"action\" => \"login\",\t\t\t\n\t\t\t)\n\t\t);\n\t\t}\n\t}", "public function isLoginRequired()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function login()\n {\n $authorized = $this->authorize( $_POST );\n if( !empty( $authorized ) && $authorized !== false ){\n $this->register_login_datetime( $authorized );\n ( new Events() )->trigger( 1, true );\n } else {\n ( new Events() )->trigger( 2, true );\n }\n }", "function beforeFilter() {\n\t\tparent::beforeFilter();\n $this->Auth->fields = array(\n 'username' => 'username', \n 'password' => 'password'\n );\n\t\t$this->Session->delete('Auth.redirect');\n\t\t$this->Auth->userModel = 'Adminuser';\n\t\t\n\t\t$this->Auth->allow('login','index');\n\t\t$this->Auth->loginAction = array('controller' => 'adminusers', 'action' => 'login','admin'=>true);\n\t\t$this->Auth->loginRedirect = array('controller' => 'EmployerSiteUsages', 'action' => '','superadmin'=>true);\n\t\t$this->Auth->userScope = array('Adminuser.active' => 'yes');\t\t\n \t}", "public function __construct() {\n $this->isLogin();\n }", "function login()\n{\n\n}", "public function login()\n {\n }", "public function login()\n {\n }", "public function login()\n\t{\n\t\tredirect($this->config->item('bizz_url_ui'));\n\t\t// show_404();\n\t\t// ////import helpers and models\n\n\t\t// ////get data from database\n\n\t\t// //set page info\n\t\t// $pageInfo['pageName'] = strtolower(__FUNCTION__);\n\n\t\t// ////sort\n\t\t\n\t\t// //render\n\t\t// $this->_render($pageInfo);\n\t}", "public function before() {\n $session = SessionManager::getManager();\n\n if ($session->isLoggedIn()) {\n $this->redirect('/');\n exit;\n }\n\n $rememberToken = null;\n if (isset($_COOKIE) && isset($_COOKIE['remember_token'])) {\n try {\n $encrypter = Encrypter::getInstance();\n $rememberToken = $encrypter->decrypt($_COOKIE['remember_token']);\n } catch (DecryptException $e) {\n // the cookie is invalid!\n $rememberToken = null;\n\n // unset the cookie\n setcookie('remember_token', '', 1);\n }\n }\n\n if ($rememberToken) {\n $connection = PDOConnection::getInstance();\n $user = $connection->selectOne('users', [\n 'remember_token' => $rememberToken\n ]);\n\n if ($user) {\n // log in the user\n $session->destroy();\n $session->start();\n\n $session->set('user', $user);\n $this->redirect('/');\n } else {\n\n // unset the cookie\n setcookie('remember_token', '', 1);\n }\n }\n }", "protected function isUserAllowedToLogin() {}", "function AdminLogin() {\r\n\t\t$this->DB();\r\n\t}", "function defaultVerifyLogin() {\n return parent::verifyLogin();\n }", "function beforeRoute() {\n\t\tif ($this->app->get('SESSION.user')) {\n\t\t\t$this->app->set('loggedIN', true);\n\t\t}\n\t}", "function staff_alllogin() {\n \n $this->setLoginRedirects();\n \n $this->layout = 'login_layout';\n\t\t// Display error message on failed authentication\n\t\tif (!empty($this->data) && !$this->Auth->_loggedIn) {\n\t\t\t$this->Session->setFlash($this->Auth->loginError);\n $this->redirect(\"http://\" . $_SERVER['HTTP_HOST']);\n\t\t}else{\n $this->redirect(\"http://\" . $_SERVER['HTTP_HOST']);\n }\n\t\t// Redirect the logged in user to respective pages\n\t\t\n\t}", "protected function before(){\n $this->siteName = parent::getSiteName();\n\n $this->getSiteKeywords = new SiteKeyWordsModel();\n $this->getSiteKeywords->find($this->keyword_type);\n $this->siteKeywords = $this->getSiteKeywords->data()->pages_Keywords;\n\n $loggedInUserName = new Userprofile();\n $this->username = $loggedInUserName->getLoggedInUserInfo()->regMem_Name;\n $this->userId = $loggedInUserName->getLoggedInUserInfo()->id;\n }", "protected function require_login()\n {\n return false;\n }", "public function init()\n {\n $authorization = Zend_Auth::getInstance();\n $storage = $authorization->getStorage();\n $sessionRead = $storage->read();\n if ($authorization->hasIdentity())\n {\n $admin = $sessionRead->name;\n if ($this->_request->getActionName() != 'login' && $admin != 'admin')\n {\n $this->redirect(\"admin/login\");\n } \n }\n else {\n if ($this->_request->getActionName() != 'login') {\n $this->redirect(\"admin/login\");\n }\n }\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 function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function preDispatch()\n {\n parent::preDispatch();\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);\n\n // adding message in customer login page\n Mage::getSingleton('core/session')\n ->addSuccess(Mage::helper('inchoo_tickets')->__('Please sign in or create a new account.'));\n }\n }", "public function beforeExecute() {\n $instance = \\UserAuth::getInstance();\n if ( $instance->isAuthenticated() === false) {\n $this->redirect(Main::getHomeRouter()->createUrl('login/login'));\n }\n }", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "function ft_hook_loginfail() {}", "public function preDispatch()\n {\n \n # if the user is not logged in, they can not log out\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n # display to user\n $this->_helper->Message(array(\"authMsg:FailLogOut\"), 'warning');\n $this->_helper->Message(array(\"authMsg:LoginThroughForm\"), 'info');\n \n # redirect login page\n $this->_helper->redirector('index', 'login', 'auth');\n }\n }", "public function __construct()\n {\n parent::__construct();\n isLogin();\n }", "public function doLogin($ceredentials){\n\t}", "protected function before()\n\t{\n\t\tparent::before();\n\t\t$this->user = Auth::getUser();\n\t}", "private function check_login(){\n if (isset($_SESSION['email'])){\n $this->email=$_SESSION['email'];\n\t\t\t$this->role=$_SESSION['role'];\n\t\t\t$this->id=$_SESSION['id'];\n $this->signed_in=true;\n }\n else{\n unset($this->email);\n $this->signed_in=false;\n }\n }", "public function getLogin();", "public function getLogin();", "public function getLogin();", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function loginActivities();", "public function before()\n\t{\n\t\t// Inform tht we're in admin section for themers/developers\n\t\tTheme::$is_admin = TRUE;\n\n\t\tif($this->request->action() != 'login')\n\t\t{\n\t\t\tACL::redirect('administer site', 'admin/login');\n\t\t}\n\n\t\tparent::before();\n\t}", "function onAfterInitialise(){\n\t\t\n\t\t//Check if isset the code in the URL\n\t\tif(isset($_REQUEST[\"code\"]))\n\t\t{\n\t\t\t//Create an array credentials empty\n\t\t\t$credentials = array(\n\t\t\t\t\t\"username\" => \"\",\n\t\t\t\t\t\"password\" => \"\",\n\t\t\t);\n\t\t\t\n\t\t\t//Get the application\n\t\t\t$app = JFactory::getApplication(); \n\t\t\t\n\t\t\t//Now it only works if the application is the frontend. Needs a normal authentication for the backend.\n\t\t\tif($app->isSite()){\n\t\t\t\n\t\t\t\t//Through the login method. The authentication plugins will be called. One of them should be able to handle the login using the access token, instead of the credential array.\n\t\t\t\t$app->login($credentials);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function connexionSuperAdminLogin(){\n }", "public function beforeFilter(){\n\t\tparent::beforeFilter();\n\t\t$this->Auth->allow('login');\n\t}", "function checkHasLogin(){\n global $Redis;\n $login_success_jump_url = $this->_get('login_success_jump_url','http://sh.'.$this->root_domain);\n\n if( isset($_COOKIE[$this->passport_name]) ){\n $passport_login_status = intval($Redis->get($_COOKIE[$this->passport_name]));\n }else{\n $passport_login_status = 0;\n }\n //这个要改,根据cookie里面的key值来做判断的,自动登录或者自动退出,-1代表退出状态\n if($passport_login_status === -1){\n\n }else if($passport_login_status === 0){\n\n }else if($passport_login_status > 0){\n $this->getView()->assign(\"title\", '登陆提示');\n $this->getView()->assign(\"desc\", '您已经登陆了!');\n $this->getView()->assign(\"url\",$login_success_jump_url);\n $this->getView()->assign(\"type\", 'warning');\n $this->display(VIEW_PATH.'/common/tips');\n exit;\n }\n }", "public function loginCheckAction()\n {\n }", "function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }", "function loginRequiredMixinInit($arguments=[]){\n\n if(!AuthModel::isLoggedIn()){\n $_SESSION['rememberUrl'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n header('Location: '.AuthModel::getLoginUrl());\n exit;\n }\n\n }", "public function initialConfig() \n {\n //NB: various link modes handled below in setupPageData()\n if(!isset($_GET['mode'])) {\n\n $this->user_id = $this->user->setupUserData();\n if($this->user_id != 0) {\n $this->addMessage('You are already logged in! You can login as another user or '.$this->js_links['back']);\n\n $_SESSION['login_redirect'] = $_SESSION['login_redirect'] + 1 ;\n if($_SESSION['login_redirect'] > 5) {\n $this->addError('Something is wrong with your access credentials. Please contact support.');\n } else {\n $this->user->redirectLastPage();\n }\n }\n }\n \n }", "function beforeFilter() { \n\t\tparent::beforeFilter();\n $this->Auth->fields = array(\n 'username' => 'username', \n 'password' => 'password'\n );\n\t\t$this->Session->delete('Auth.redirect');\n\t\t$this->Auth->userModel = 'Adminuser';\n\t\t//$this->Auth->allow('login');\n\t\t//$this->Auth->loginAction = array('controller' => 'roles', 'action' => 'login','admin'=>true);\n\t\t$this->Auth->loginRedirect = array('controller' => 'roles', 'action' => 'home','superadmin'=>true);\n\t\t$this->Auth->userScope = array('Adminuser.active' => 'yes');\n \t}", "function handle_logins()\n{\n if (get_param_integer('httpauth', 0) == 1) {\n require_code('users_inactive_occasionals');\n force_httpauth();\n }\n $username = trim(post_param_string('login_username', ''));\n if (($username != '') && ($username != do_lang('GUEST'))) {\n require_code('users_active_actions');\n handle_active_login($username);\n }\n\n // If it was a log out\n $page = get_param_string('page', ''); // Not get_page_name for bootstrap order reasons\n if (($page == 'login') && (get_param_string('type', '', true) == 'logout')) {\n require_code('users_active_actions');\n handle_active_logout();\n }\n}", "public function preDispatch() {\r\n\t\t$this->_auth = Zend_Auth::getInstance();\r\n\t\t$this->_auth->setStorage(new Zend_Auth_Storage_Session('Fancrank_App'));\r\n\t\t//\r\n\t\tif(!$this->_auth->hasIdentity()) {\r\n\t\t\t$this->_helper->json(array('message'=>'authentication failed','code'=>400));\r\n\t\t\t//set the proper navbar\r\n\t\t}\r\n\t\t$this->_helper->layout()->disableLayout();\r\n\t\t$this->_helper->viewRenderer->setNoRender();\r\n\t\t$this->_user = $this->_auth->getIdentity();\r\n\t\t\r\n\t\tif ($this->_getParam('id') != $this->_user->facebook_user_id){\r\n\t\t\techo \"IDENTITY AND PARAMETER ID DOES NOT MATCH\"\t;\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}" ]
[ "0.7590724", "0.7590724", "0.75284797", "0.7473655", "0.74292964", "0.74252546", "0.7422647", "0.7417862", "0.7398254", "0.738983", "0.7262421", "0.7177277", "0.714481", "0.7131071", "0.71189475", "0.7052014", "0.7052014", "0.7045976", "0.7042144", "0.7009662", "0.70039076", "0.6970074", "0.6959541", "0.6957885", "0.69346565", "0.6928752", "0.6926215", "0.6926215", "0.6920686", "0.6907845", "0.689303", "0.6882945", "0.6868907", "0.6840115", "0.6827626", "0.68197316", "0.6817311", "0.6816587", "0.6814897", "0.6799832", "0.679389", "0.67862356", "0.6783837", "0.6779858", "0.6774614", "0.67742676", "0.6761081", "0.67573947", "0.67459583", "0.67282295", "0.6727558", "0.6711376", "0.6698615", "0.6678076", "0.66608506", "0.66575044", "0.66558665", "0.6655783", "0.66496116", "0.6649051", "0.66417485", "0.66417485", "0.6634158", "0.66309506", "0.6618925", "0.6608567", "0.6601676", "0.66007155", "0.65931845", "0.65923345", "0.65867734", "0.65838313", "0.65793747", "0.65746486", "0.6573555", "0.6571723", "0.65711546", "0.6569946", "0.65663934", "0.6559648", "0.6548017", "0.6547719", "0.6546853", "0.654499", "0.654499", "0.654499", "0.65445215", "0.65432316", "0.65417147", "0.65410066", "0.6530478", "0.6524723", "0.6516717", "0.65160275", "0.6515631", "0.6513092", "0.65123016", "0.6512027", "0.65020275", "0.6495534", "0.6488943" ]
0.0
-1
Run the database seeds.
public function run() { $classes = [ ['class' => 'JSS1'], ['class' => 'JSS2'], ['class' => 'JSS3'], ['class' => 'SS1'], ['class' => 'SS2'], ['class' => 'SS3'], ]; DB::table('school_classes')->insert($classes); }
{ "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' => '[email protected]', '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'=> \"[email protected]\"\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' => '[email protected]',\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' => '[email protected]',\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' => '[email protected]',\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'=>'[email protected]'\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' => '[email protected]',\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' => '[email protected]',\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' => '[email protected]',\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=> '[email protected]',\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' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\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' => '[email protected]',\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' => '[email protected]',\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' => '[email protected]',\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\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\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 = [email protected]\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' => '[email protected]',\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'=>'[email protected]',\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' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\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' => '[email protected]']);\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'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->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' => '[email protected]']);\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' => '[email protected]',\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' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\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' => '[email protected]',\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' => '[email protected]',\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' => '[email protected]',\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'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\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' => '[email protected]',\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'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', '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
If you pass an array, every value will be added as message. This way you can pass multiple messages at once.
public function addError($message) { $this->errors = array_merge($this->errors, (array) $message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function messages( $array ) {\n\t\t$this->messages_list = $array;\n\t\t}", "function setMessage($message, $type, &$array)\n{\n array_push($array, array(\n 'Message' => $message,\n 'Type' => $type\n ));\n}", "function add_message($messages){\n global $messages;\n $messages[] = $messages;\n}", "public function sendMultiple(array $messages);", "function arrayMessage($array){\n $l = \"[\";\n $x = 0;\n while($x < count($array)){\n $l = $l.$array[$x];\n $x++;\n if($x != count($array)){\n $l = $l.\",\";\n }\n }\n $l = $l.\"]\";\n \n $messArray = array('message'=>$l,'mess_type'=>'user_array');\n $json = json_encode($messArray);\n return $json;\n }", "public function __construct(array $message = array()) {\n $this->message = array();\n\n foreach ($message as $parameter => $value) {\n $this->add($parameter, $value);\n }\n }", "static function message($message)\n {\n global $template_vars;\n $template_vars['messages'][] = $message;\n }", "public function messages(array $messages): void {\r\n $this -> message -> set($messages);\r\n }", "function add_message($vMessage, $index = 0) {\n\t\tif ($this->get_multiple_values()) {\n\t\t\tif (!isset($this->messages[$index])) {\n\t\t\t\t$this->messages[$index] = Array();\n\t\t\t}\t\n\t\t\tarray_push($this->messages[$index], $vMessage);\n\t\t} else {\n\t\t\tarray_push($this->messages, $vMessage);\n\t\t}\n\t}", "public function sendMessages(array $messages);", "public function toMessage(): array;", "function addMessage( $message )\n {\n if ( isset($message['errorMessage']) )\n {\n $this->messages[] = array_merge($this->empty_message,$message);\n } else if ( isset($message[0]) && isset($message[0]['errorMessage']) ) {\n foreach ( $message as $m )\n {\n $this->messages[] = array_merge($this->empty_message,$m);\n }\n }\n }", "function addMessage($txt = \"\"){\t$this->mMessages\t.= $txt;\t}", "public function get_message_strings() {\n foreach($this->messages as $singleMessage) {\n \n }\n }", "public function format(array $message);", "public function mail(array $message);", "public function setMessages(array $messages) {\n $this->messages = $messages;\n }", "abstract public function message($address, array $message);", "function thrive_dashboard_add_message($message)\n{\n $messages = get_option('td_messages', array());\n\n if (is_string($message)) {\n $message = array(\n 'text' => $message,\n 'css_class' => 'info'\n );\n }\n\n $messages[] = $message;\n update_option('td_messages', $messages);\n}", "function message($status, $message) {\n\t\treturn array(\"status\" => $status, \"data\" => $message);\n\t}", "public function message($message);", "public function messages();", "public function messages();", "public function messages();", "public function messages(): array\n {\n return [\n //\n ];\n }", "function record_message($message) {\n global $messages;\n array_push($messages, $message);\n}", "public function getEventadd($messages = \"\");", "public function getMessagefromArray($array){\n\t\tunset($array[0]);\n\t\treturn implode(' ', $array);\n\t}", "public function message($type, $message) {}", "public function toMessages();", "public function getMessages(): array;", "public function getMessages(): array;", "public function getMessages(): array;", "public function setMessages(array $messages)\n {\n $this->messages = isset($messages) ? $messages : [];\n }", "function msg($msg,$msg1 = null,$msg2 = null,$msg3 = null,$msg4 = null,$msg5 = null,$msg6 = null,$msg7 = null,$msg8 = null,$msg9 = null,$append=0)\n{\n if(isset($msg1))\n {\n $msg.=$msg1;\n if(isset($msg2))\n {\n $msg.=$msg2;\n if(isset($msg3))\n {\n $msg.=$msg3;\n if(isset($msg4))\n {\n $msg.=$msg4;\n if(isset($msg5))\n {\n $msg.=$msg5;\n if(isset($msg6))\n {\n $msg.=$msg6;\n if(isset($msg7))\n {\n $msg.=$msg7;\n if(isset($msg8))\n {\n $msg.=$msg8;\n if(isset($msg9)) $msg.=$msg9;\n }\n }\n }\n }\n }\n }\n }\n }\n\n if(!isset($append))$append=0;\n\n if($GLOBALS['debug']) echo ($append?\"\":\"\\n\\r\").$msg;\n\n if(!$append) $GLOBALS['msg'][] = $msg;\n else $GLOBALS['msg'][count($GLOBALS['msg'])-1] .= $msg;\n}", "public function getMessages(): array\n {\n }", "public function createMessage(array $parameters = []);", "public function __construct( array $numbers ,$message)\n {\n\n $this->numbers = $numbers;\n $this->message = $message;\n\n }", "protected function defineMessages()\n {\n return [];\n }", "function standardMessage (string $message = \"An error occured\", bool $error = true): array {\n\treturn ['message' => $message, 'error' => $error];\n}", "public function replaceArrays($message, $array) : string{\n \tforeach($array as $key => $value){\n \t\t$message = str_replace(\"{\" . strtoupper($key) . \"}\", $value, $message);\n \t}\n \treturn $message;\n }", "public function message($m){}", "public function enqueue(array $messages);", "public function format(array $messages);", "public function messages()\n {\n return [\n \n ];\n }", "public function message($message): void\n {\n $this->messages[] = $message;\n }", "public function __construct(array $message)\n {\n $this->message = $message;\n }", "public function __construct($messages = array())\n {\n $this->messages = $messages;\n }", "function post_updated_messages($messages)\n {\n }", "public function messageProvider()\n {\n return [[\"a string\"]];\n }", "static function ArrayToMessage($array = array())\r\n {\r\n if ($array === null)\r\n {\r\n return null;\r\n }\r\n\r\n $Message = new Message($array['id'], \r\n $array['contest'], \r\n $array['idUserFrom'], \r\n $array['idUserTo'], \r\n $array['seen'], \r\n $array['received'], \r\n $array['time']);\r\n\r\n return $Message;\r\n }", "public function addMessage($message);", "function add($message) { return; }", "function setMessage($text, $type = \"default\") {\n\tglobal $systemMessages;\n\t$systemMessages[$type][] = $text;\n}", "public function messages($options = array()) {\n\t\tif(!is_array($options)) $options = explode(' ', strtolower($options)); \n\t\tif(in_array('errors', $options)) $type = 'errors'; \n\t\t\telse if(in_array('warnings', $options)) $type = 'warnings';\n\t\t\telse $type = 'messages';\n\t\t$clear = in_array('clear', $options); \n\t\tif(in_array('all', $options)) {\n\t\t\t// get all of either messages, warnings or errors (either in or out of this object instance)\n\t\t\t$value = $this->wire(new Notices());\n\t\t\tforeach($this->wire('notices') as $notice) {\n\t\t\t\tif($notice->getName() != $type) continue;\n\t\t\t\t$value->add($notice);\n\t\t\t\tif($clear) $this->wire('notices')->remove($notice); // clear global\n\t\t\t}\n\t\t\tif($clear) $this->_notices[$type] = null; // clear local\n\t\t} else {\n\t\t\t// get messages, warnings or errors specific to this object instance\n\t\t\t$value = is_null($this->_notices[$type]) ? $this->wire(new Notices()) : $this->_notices[$type];\n\t\t\tif(in_array('first', $options)) $value = $clear ? $value->shift() : $value->first();\n\t\t\t\telse if(in_array('last', $options)) $value = $clear ? $value->pop() : $value->last(); \n\t\t\t\telse if($clear) $this->_notices[$type] = null;\n\t\t\tif($clear && $value) $this->wire('notices')->removeItems($value); // clear from global notices\n\t\t}\n\t\tif(in_array('array', $options) || in_array('string', $options)) {\n\t\t\tif($value instanceof Notice) {\n\t\t\t\t$value = array($value->text);\n\t\t\t} else {\n\t\t\t\t$_value = array();\n\t\t\t\tforeach($value as $notice) $_value[] = $notice->text; \n\t\t\t\t$value = $_value; \n\t\t\t}\n\t\t\tif(in_array('string', $options)) {\n\t\t\t\t$value = implode(\"\\n\", $value); \n\t\t\t}\n\t\t}\n\t\treturn $value; \n\t}", "public function add_message($message){\n $this->messages[] = $message;\n }", "function add_message($message = 'Empty message') // here the 'Foo' from line 52 became $message variable inside function\n{\n\tglobal $messages;\n\t\n\t$messages[] = $message;\n}", "public function messages() {\n return [\n ];\n }", "public function messages() {\n return [\n ];\n }", "function add_success(&$log, $message){\n if(!is_array($log)) return;\n\n $log[] = array(\n \"type\" => \"success\",\n \"message\" => $message\n );\n}", "public function msg($msg);", "function getMessage($i){\n $options = array('My Skillset', 'Projects I have done', 'Past Work Places');\n switch($i){\n case 0:\n $msg = $options[0];\n break;\n case 1;\n $msg = $options[1];\n break;\n case 2:\n $msg = $options[2];\n break;\n default:\n \n break; \n }\n return $msg;\n }", "public function get_message(){\n return implode(', ', $this->messages);\n }", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "public function messages()\n {\n return [\n ];\n }", "function add_message($msg, $msg_type = MSG_TYPE_SUCCESS) {\n if (!isset($_SESSION['message']))\n $_SESSION['message'] = [];\n $_SESSION['message'][] = ['type' => $msg_type, 'message' => htmlentities($msg, ENT_QUOTES)];\n}", "function message(Message $message);", "protected abstract function _message();", "public function addMessage($message='',$type=self::MSG_SUCCESS,$field=''){\n $type = strtolower($type);\n if(is_object($message)){\n if(is_subclass_of($message, 'CModel')){\n if($message->hasErrors()){\n $type = self::MSG_ERROR;\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n foreach($message->getErrors() as $key=>$error){\n $this->messages[$type][] = array('message'=>$error[0],'field'=>$key);\n }\n }\n }else if(is_subclass_of($message, 'Exception')){\n $type = self::MSG_ERROR;\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n $this->messages[$type][] = array('message'=>$message->getMessage(),'field'=>$key);\n }\n }else if($message != ''){\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n $this->messages[$type][] = array('message'=>$message,'field'=>$field);\n }\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages(): array\n {\n return [];\n }", "public function messages()\n {\n return [\n\n ];\n }", "public function __construct()\n {\n if (1 == func_num_args()) {\n $this->messages = func_get_arg(0);\n }\n }", "function tn_add_message( $type, $message ) {\n\t$m = TN_Messages::get_instance();\n\t$m->add_message( array( $type => $message ) );\n}", "public function messages()\n {\n }", "public function message()\n {\n return 'The people array must be name,type and type will be '.implode(',',People::TYPES);\n }", "public static function register(array $messages): void\n {\n if (empty(self::$messages)) {\n self::$messages = $messages;\n return;\n }\n\n self::$messages = array_merge(self::$messages, $messages);\n }", "public static function message(array $message, int $code): array\n {\n Yii::$app->response->setStatusCode($code);\n return $message;\n }", "public function addMessage(array $post) {\n $chatModel = new ChatModel();\n $lastMessage = $chatModel->InsertMessage($post);\n }", "public function provideMessageParameters()\n {\n $type = \"application/json\";\n\n $data[] = array('{\"foo\":\"bar\",\"baz\":[1,2,3]}', $type);\n $data[] = array('{\"foo\":\"bar\",\"baz\":[]}', $type);\n\n return $data;\n }", "public function add_message($msg){\r\n\t\t$this->general_messages[] = $msg;\r\n\r\n\t\t$msg_array = array(\r\n\t\t\t\t'type' => 'general',\r\n\t\t\t\t'class' => $this::GEN_MSG_CLASS,\r\n\t\t\t\t'text' => $msg\r\n\t\t);\r\n\r\n\t\t$this->all_messages[] = $msg_array;\r\n\t}", "function prefix($prefix, &$msg) {\n\t\tif (is_array($msg)) {\n\t\t\t$prefix = array($prefix);\n\t\t\t$msg = array_merge($prefix,$msg);\n\t\t}\n\t\t$msg = $prefix.$msg;\n\t}", "public function writeln(array $messages);", "public function addMessage($type, $value)\n {\n if (!$this->hasMessages($type)) {\n $_SESSION['_zikula_messages'][$type] = array();\n }\n $_SESSION['_zikula_messages'][$type][] = $value;\n }", "public function add(array $messages, string $domain = 'messages');", "public function message ();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "private function addLanguageMessage($messages_array, $message, $lang) {\n $current_messages = $messages_array;\n\n if ($lang === null) {\n $current_messages[\"en\"] = $message;\n } else {\n if (empty($current_messages[\"en\"])) {\n $current_messages[\"en\"] = $message;\n $current_messages[$lang] = $message;\n } else {\n $current_messages[$lang] = $message;\n }\n }\n\n return $current_messages;\n }" ]
[ "0.76500267", "0.72358096", "0.7125383", "0.6966936", "0.6908486", "0.68029857", "0.67757237", "0.6729964", "0.6592916", "0.6571905", "0.6569278", "0.6507707", "0.6498772", "0.6448636", "0.640394", "0.6388353", "0.6374067", "0.6368543", "0.632836", "0.63282835", "0.6321254", "0.63088137", "0.63088137", "0.63088137", "0.62991416", "0.62894803", "0.6277219", "0.6273262", "0.6237697", "0.62291193", "0.62288684", "0.62288684", "0.62288684", "0.6212219", "0.621066", "0.6197676", "0.6190324", "0.61741763", "0.6165909", "0.6151075", "0.6140882", "0.61135846", "0.6109641", "0.6102328", "0.60998434", "0.607794", "0.60732216", "0.60709846", "0.6068819", "0.60489494", "0.6042826", "0.6042118", "0.603703", "0.60153943", "0.6002306", "0.59980285", "0.5996862", "0.59945744", "0.59945744", "0.59914196", "0.5985922", "0.59743553", "0.59635115", "0.59596837", "0.595769", "0.59568983", "0.5946564", "0.59464985", "0.5938478", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.59294724", "0.5924348", "0.58602446", "0.585796", "0.58294606", "0.58194935", "0.5815641", "0.5813922", "0.5812271", "0.58097607", "0.58084726", "0.5805654", "0.580306", "0.5800019", "0.5796624", "0.5794809", "0.57910794", "0.57910794", "0.57910794", "0.57910794", "0.57910794", "0.57910794", "0.57910794", "0.5772075" ]
0.0
-1
If you pass an array, every value will be added as message. This way you can pass multiple messages at once.
public function addSuccess($message) { $this->successes = array_merge($this->successes, (array) $message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function messages( $array ) {\n\t\t$this->messages_list = $array;\n\t\t}", "function setMessage($message, $type, &$array)\n{\n array_push($array, array(\n 'Message' => $message,\n 'Type' => $type\n ));\n}", "function add_message($messages){\n global $messages;\n $messages[] = $messages;\n}", "public function sendMultiple(array $messages);", "function arrayMessage($array){\n $l = \"[\";\n $x = 0;\n while($x < count($array)){\n $l = $l.$array[$x];\n $x++;\n if($x != count($array)){\n $l = $l.\",\";\n }\n }\n $l = $l.\"]\";\n \n $messArray = array('message'=>$l,'mess_type'=>'user_array');\n $json = json_encode($messArray);\n return $json;\n }", "public function __construct(array $message = array()) {\n $this->message = array();\n\n foreach ($message as $parameter => $value) {\n $this->add($parameter, $value);\n }\n }", "static function message($message)\n {\n global $template_vars;\n $template_vars['messages'][] = $message;\n }", "public function messages(array $messages): void {\r\n $this -> message -> set($messages);\r\n }", "function add_message($vMessage, $index = 0) {\n\t\tif ($this->get_multiple_values()) {\n\t\t\tif (!isset($this->messages[$index])) {\n\t\t\t\t$this->messages[$index] = Array();\n\t\t\t}\t\n\t\t\tarray_push($this->messages[$index], $vMessage);\n\t\t} else {\n\t\t\tarray_push($this->messages, $vMessage);\n\t\t}\n\t}", "public function sendMessages(array $messages);", "public function toMessage(): array;", "function addMessage( $message )\n {\n if ( isset($message['errorMessage']) )\n {\n $this->messages[] = array_merge($this->empty_message,$message);\n } else if ( isset($message[0]) && isset($message[0]['errorMessage']) ) {\n foreach ( $message as $m )\n {\n $this->messages[] = array_merge($this->empty_message,$m);\n }\n }\n }", "function addMessage($txt = \"\"){\t$this->mMessages\t.= $txt;\t}", "public function get_message_strings() {\n foreach($this->messages as $singleMessage) {\n \n }\n }", "public function format(array $message);", "public function mail(array $message);", "public function setMessages(array $messages) {\n $this->messages = $messages;\n }", "abstract public function message($address, array $message);", "function thrive_dashboard_add_message($message)\n{\n $messages = get_option('td_messages', array());\n\n if (is_string($message)) {\n $message = array(\n 'text' => $message,\n 'css_class' => 'info'\n );\n }\n\n $messages[] = $message;\n update_option('td_messages', $messages);\n}", "function message($status, $message) {\n\t\treturn array(\"status\" => $status, \"data\" => $message);\n\t}", "public function message($message);", "public function messages();", "public function messages();", "public function messages();", "public function messages(): array\n {\n return [\n //\n ];\n }", "function record_message($message) {\n global $messages;\n array_push($messages, $message);\n}", "public function getEventadd($messages = \"\");", "public function getMessagefromArray($array){\n\t\tunset($array[0]);\n\t\treturn implode(' ', $array);\n\t}", "public function message($type, $message) {}", "public function toMessages();", "public function getMessages(): array;", "public function getMessages(): array;", "public function getMessages(): array;", "public function setMessages(array $messages)\n {\n $this->messages = isset($messages) ? $messages : [];\n }", "function msg($msg,$msg1 = null,$msg2 = null,$msg3 = null,$msg4 = null,$msg5 = null,$msg6 = null,$msg7 = null,$msg8 = null,$msg9 = null,$append=0)\n{\n if(isset($msg1))\n {\n $msg.=$msg1;\n if(isset($msg2))\n {\n $msg.=$msg2;\n if(isset($msg3))\n {\n $msg.=$msg3;\n if(isset($msg4))\n {\n $msg.=$msg4;\n if(isset($msg5))\n {\n $msg.=$msg5;\n if(isset($msg6))\n {\n $msg.=$msg6;\n if(isset($msg7))\n {\n $msg.=$msg7;\n if(isset($msg8))\n {\n $msg.=$msg8;\n if(isset($msg9)) $msg.=$msg9;\n }\n }\n }\n }\n }\n }\n }\n }\n\n if(!isset($append))$append=0;\n\n if($GLOBALS['debug']) echo ($append?\"\":\"\\n\\r\").$msg;\n\n if(!$append) $GLOBALS['msg'][] = $msg;\n else $GLOBALS['msg'][count($GLOBALS['msg'])-1] .= $msg;\n}", "public function getMessages(): array\n {\n }", "public function createMessage(array $parameters = []);", "public function __construct( array $numbers ,$message)\n {\n\n $this->numbers = $numbers;\n $this->message = $message;\n\n }", "protected function defineMessages()\n {\n return [];\n }", "function standardMessage (string $message = \"An error occured\", bool $error = true): array {\n\treturn ['message' => $message, 'error' => $error];\n}", "public function replaceArrays($message, $array) : string{\n \tforeach($array as $key => $value){\n \t\t$message = str_replace(\"{\" . strtoupper($key) . \"}\", $value, $message);\n \t}\n \treturn $message;\n }", "public function message($m){}", "public function enqueue(array $messages);", "public function format(array $messages);", "public function messages()\n {\n return [\n \n ];\n }", "public function message($message): void\n {\n $this->messages[] = $message;\n }", "public function __construct(array $message)\n {\n $this->message = $message;\n }", "public function __construct($messages = array())\n {\n $this->messages = $messages;\n }", "function post_updated_messages($messages)\n {\n }", "public function messageProvider()\n {\n return [[\"a string\"]];\n }", "static function ArrayToMessage($array = array())\r\n {\r\n if ($array === null)\r\n {\r\n return null;\r\n }\r\n\r\n $Message = new Message($array['id'], \r\n $array['contest'], \r\n $array['idUserFrom'], \r\n $array['idUserTo'], \r\n $array['seen'], \r\n $array['received'], \r\n $array['time']);\r\n\r\n return $Message;\r\n }", "public function addMessage($message);", "function add($message) { return; }", "function setMessage($text, $type = \"default\") {\n\tglobal $systemMessages;\n\t$systemMessages[$type][] = $text;\n}", "public function messages($options = array()) {\n\t\tif(!is_array($options)) $options = explode(' ', strtolower($options)); \n\t\tif(in_array('errors', $options)) $type = 'errors'; \n\t\t\telse if(in_array('warnings', $options)) $type = 'warnings';\n\t\t\telse $type = 'messages';\n\t\t$clear = in_array('clear', $options); \n\t\tif(in_array('all', $options)) {\n\t\t\t// get all of either messages, warnings or errors (either in or out of this object instance)\n\t\t\t$value = $this->wire(new Notices());\n\t\t\tforeach($this->wire('notices') as $notice) {\n\t\t\t\tif($notice->getName() != $type) continue;\n\t\t\t\t$value->add($notice);\n\t\t\t\tif($clear) $this->wire('notices')->remove($notice); // clear global\n\t\t\t}\n\t\t\tif($clear) $this->_notices[$type] = null; // clear local\n\t\t} else {\n\t\t\t// get messages, warnings or errors specific to this object instance\n\t\t\t$value = is_null($this->_notices[$type]) ? $this->wire(new Notices()) : $this->_notices[$type];\n\t\t\tif(in_array('first', $options)) $value = $clear ? $value->shift() : $value->first();\n\t\t\t\telse if(in_array('last', $options)) $value = $clear ? $value->pop() : $value->last(); \n\t\t\t\telse if($clear) $this->_notices[$type] = null;\n\t\t\tif($clear && $value) $this->wire('notices')->removeItems($value); // clear from global notices\n\t\t}\n\t\tif(in_array('array', $options) || in_array('string', $options)) {\n\t\t\tif($value instanceof Notice) {\n\t\t\t\t$value = array($value->text);\n\t\t\t} else {\n\t\t\t\t$_value = array();\n\t\t\t\tforeach($value as $notice) $_value[] = $notice->text; \n\t\t\t\t$value = $_value; \n\t\t\t}\n\t\t\tif(in_array('string', $options)) {\n\t\t\t\t$value = implode(\"\\n\", $value); \n\t\t\t}\n\t\t}\n\t\treturn $value; \n\t}", "public function add_message($message){\n $this->messages[] = $message;\n }", "function add_message($message = 'Empty message') // here the 'Foo' from line 52 became $message variable inside function\n{\n\tglobal $messages;\n\t\n\t$messages[] = $message;\n}", "public function messages() {\n return [\n ];\n }", "public function messages() {\n return [\n ];\n }", "function add_success(&$log, $message){\n if(!is_array($log)) return;\n\n $log[] = array(\n \"type\" => \"success\",\n \"message\" => $message\n );\n}", "public function msg($msg);", "function getMessage($i){\n $options = array('My Skillset', 'Projects I have done', 'Past Work Places');\n switch($i){\n case 0:\n $msg = $options[0];\n break;\n case 1;\n $msg = $options[1];\n break;\n case 2:\n $msg = $options[2];\n break;\n default:\n \n break; \n }\n return $msg;\n }", "public function get_message(){\n return implode(', ', $this->messages);\n }", "public function testAddWithMultipleMessages()\n {\n Phlash::add(\"info\", \"Please log in to continue\");\n Phlash::add(\"error\", \"There was a problem processing your request\");\n\n $flashMessages = Phlash::get();\n\n $this->assertNotEmpty($flashMessages);\n $this->assertEquals(count($flashMessages), 2);\n $this->assertEquals($flashMessages[0]->id, 0);\n $this->assertEquals($flashMessages[0]->type, \"info\");\n $this->assertEquals($flashMessages[0]->message, \"Please log in to continue\");\n $this->assertEquals($flashMessages[1]->id, 1);\n $this->assertEquals($flashMessages[1]->type, \"error\");\n $this->assertEquals($flashMessages[1]->message, \"There was a problem processing your request\");\n\n Phlash::clear();\n }", "public function messages()\n {\n return [\n ];\n }", "function add_message($msg, $msg_type = MSG_TYPE_SUCCESS) {\n if (!isset($_SESSION['message']))\n $_SESSION['message'] = [];\n $_SESSION['message'][] = ['type' => $msg_type, 'message' => htmlentities($msg, ENT_QUOTES)];\n}", "function message(Message $message);", "protected abstract function _message();", "public function addMessage($message='',$type=self::MSG_SUCCESS,$field=''){\n $type = strtolower($type);\n if(is_object($message)){\n if(is_subclass_of($message, 'CModel')){\n if($message->hasErrors()){\n $type = self::MSG_ERROR;\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n foreach($message->getErrors() as $key=>$error){\n $this->messages[$type][] = array('message'=>$error[0],'field'=>$key);\n }\n }\n }else if(is_subclass_of($message, 'Exception')){\n $type = self::MSG_ERROR;\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n $this->messages[$type][] = array('message'=>$message->getMessage(),'field'=>$key);\n }\n }else if($message != ''){\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n $this->messages[$type][] = array('message'=>$message,'field'=>$field);\n }\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages(): array\n {\n return [];\n }", "public function messages()\n {\n return [\n\n ];\n }", "public function __construct()\n {\n if (1 == func_num_args()) {\n $this->messages = func_get_arg(0);\n }\n }", "function tn_add_message( $type, $message ) {\n\t$m = TN_Messages::get_instance();\n\t$m->add_message( array( $type => $message ) );\n}", "public function messages()\n {\n }", "public function message()\n {\n return 'The people array must be name,type and type will be '.implode(',',People::TYPES);\n }", "public static function register(array $messages): void\n {\n if (empty(self::$messages)) {\n self::$messages = $messages;\n return;\n }\n\n self::$messages = array_merge(self::$messages, $messages);\n }", "public static function message(array $message, int $code): array\n {\n Yii::$app->response->setStatusCode($code);\n return $message;\n }", "public function addMessage(array $post) {\n $chatModel = new ChatModel();\n $lastMessage = $chatModel->InsertMessage($post);\n }", "public function provideMessageParameters()\n {\n $type = \"application/json\";\n\n $data[] = array('{\"foo\":\"bar\",\"baz\":[1,2,3]}', $type);\n $data[] = array('{\"foo\":\"bar\",\"baz\":[]}', $type);\n\n return $data;\n }", "public function add_message($msg){\r\n\t\t$this->general_messages[] = $msg;\r\n\r\n\t\t$msg_array = array(\r\n\t\t\t\t'type' => 'general',\r\n\t\t\t\t'class' => $this::GEN_MSG_CLASS,\r\n\t\t\t\t'text' => $msg\r\n\t\t);\r\n\r\n\t\t$this->all_messages[] = $msg_array;\r\n\t}", "function prefix($prefix, &$msg) {\n\t\tif (is_array($msg)) {\n\t\t\t$prefix = array($prefix);\n\t\t\t$msg = array_merge($prefix,$msg);\n\t\t}\n\t\t$msg = $prefix.$msg;\n\t}", "public function writeln(array $messages);", "public function addMessage($type, $value)\n {\n if (!$this->hasMessages($type)) {\n $_SESSION['_zikula_messages'][$type] = array();\n }\n $_SESSION['_zikula_messages'][$type][] = $value;\n }", "public function add(array $messages, string $domain = 'messages');", "public function message ();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "private function addLanguageMessage($messages_array, $message, $lang) {\n $current_messages = $messages_array;\n\n if ($lang === null) {\n $current_messages[\"en\"] = $message;\n } else {\n if (empty($current_messages[\"en\"])) {\n $current_messages[\"en\"] = $message;\n $current_messages[$lang] = $message;\n } else {\n $current_messages[$lang] = $message;\n }\n }\n\n return $current_messages;\n }" ]
[ "0.76500267", "0.72358096", "0.7125383", "0.6966936", "0.6908486", "0.68029857", "0.67757237", "0.6729964", "0.6592916", "0.6571905", "0.6569278", "0.6507707", "0.6498772", "0.6448636", "0.640394", "0.6388353", "0.6374067", "0.6368543", "0.632836", "0.63282835", "0.6321254", "0.63088137", "0.63088137", "0.63088137", "0.62991416", "0.62894803", "0.6277219", "0.6273262", "0.6237697", "0.62291193", "0.62288684", "0.62288684", "0.62288684", "0.6212219", "0.621066", "0.6197676", "0.6190324", "0.61741763", "0.6165909", "0.6151075", "0.6140882", "0.61135846", "0.6109641", "0.6102328", "0.60998434", "0.607794", "0.60732216", "0.60709846", "0.6068819", "0.60489494", "0.6042826", "0.6042118", "0.603703", "0.60153943", "0.6002306", "0.59980285", "0.5996862", "0.59945744", "0.59945744", "0.59914196", "0.5985922", "0.59743553", "0.59635115", "0.59596837", "0.595769", "0.59568983", "0.5946564", "0.59464985", "0.5938478", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.5932891", "0.59294724", "0.5924348", "0.58602446", "0.585796", "0.58294606", "0.58194935", "0.5815641", "0.5813922", "0.5812271", "0.58097607", "0.58084726", "0.5805654", "0.580306", "0.5800019", "0.5796624", "0.5794809", "0.57910794", "0.57910794", "0.57910794", "0.57910794", "0.57910794", "0.57910794", "0.57910794", "0.5772075" ]
0.0
-1
removing links with orders
public function delete() { Mage::getModel('amflags/order_flag')->removeLinks($this); return parent::delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderdown() {\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 _striplinks($document)\n\t{\t\n\t\tpreg_match_all(\"'<\\s*a\\s.*?href\\s*=\\s*\t\t\t# find <a href=\n\t\t\t\t\t\t([\\\"\\'])?\t\t\t\t\t# find single or double quote\n\t\t\t\t\t\t(?(1) (.*?)\\\\1 | ([^\\s\\>]+))\t\t# if quote found, match up to next matching\n\t\t\t\t\t\t\t\t\t\t\t\t\t# quote, otherwise match up to next space\n\t\t\t\t\t\t'isx\",$document,$links);\n\t\t\t\t\t\t\n\n\t\t// catenate the non-empty matches from the conditional subpattern\n\n\t\twhile(list($key,$val) = each($links[2]))\n\t\t{\n\t\t\tif(!empty($val))\n\t\t\t\t$match[] = $val;\n\t\t}\t\t\t\t\n\t\t\n\t\twhile(list($key,$val) = each($links[3]))\n\t\t{\n\t\t\tif(!empty($val))\n\t\t\t\t$match[] = $val;\n\t\t}\t\t\n\t\t\n\t\t// return the links\n\t\treturn $match;\n\t}", "function at_remove_dup_canonical_link() {\n\treturn false;\n}", "public function pruneSymbolicLinks(): void\n {\n Site::pruneLinks();\n }", "function get_links_list($order = 'name')\n {\n }", "function sort_link_array($links){\n if (!is_array($links)) return false;\n \n $fertig=Array(); //if all positions are set, the following loop will not create an array\n //and array_splice will cry. So let's assure, we have an array...\n for ($x = 0; $x < count($links); $x++){\n if ( ($links[$x]['position'] === \"\") or (!isset($links[$x]['position'])) ){\n $fertig[] = $links[$x];\n }\n }\n \n for ($x = 0; $x < count($links); $x++){\n if (($links[$x]['position'] !== \"\") and (isset($links[$x]['position'])) ){\n array_splice($fertig, $links[$x]['position'], 0 , array($links[$x]));\n } \n }\n\n return $fertig;\n }", "function wp_remove_targeted_link_rel_filters()\n {\n }", "public function removeUrlsFromReferences()\n {\n foreach ($this->findAll() as $doc) {\n $ref = $doc->getReference();\n if (strpos($ref, 'http://esmeree.fr')) {\n $ref = preg_replace('#'.preg_quote('http://esmeree.fr', '#').'[^\\s]+#', '', $ref);\n $doc->setReference($ref);\n }\n }\n }", "function sort_link($text, $order=false){\n global $db, $order_by, $order_dir;\n\n if(!$order)\n $order = $text;\n\n $link = '<a href=\"?order=' . $order;\n if($order_by==$order && $order_dir=='ASC')\n $link .= '&inverse=true';\n $link .= '\"';\n if($order_by==$order && $order_dir=='ASC')\n $link .= ' class=\"order_asc\"';\n elseif($order_by==$order && $order_dir=='DESC')\n $link .= ' class=\"order_desc\"';\n $link .= '>' . $text . '</a>';\n\n return $link;\n}", "function DOM_primalize_anchors() {\r\n\t\t$blockString = DTD::getBlock() . \"|tr|th|td|li\";\r\n\t\t$blockString2 = \"|\" . $blockString;\r\n\t\t$blockString2 = str_replace('|', '|//' . ReTidy::get_html_namespace(), $blockString2);\r\n\t\t$blockString2 = substr($blockString2, 1);\r\n\t\t$query = $blockString2;\r\n\t\t$blocks = $this->xpath->query($query);\r\n\t\tforeach($blocks as $block) {\r\n\t\t\t$firstChild = $block->firstChild;\r\n\t\t\t$as = $this->xpath->query(ReTidy::get_html_namespace() . 'a[@name]', $block);\r\n\t\t\tif(sizeof($as) > 0) {\r\n\t\t\t\tforeach($as as $a) {\r\n\t\t\t\t\t// ignore footnotes\r\n\t\t\t\t\t$name_attribute = ReTidy::getAttribute($a, \"name\");\r\n\t\t\t\t\tif(strpos($name_attribute->nodeValue, \"note\") !== false || strpos($name_attribute->nodeValue, \"_ftnref\") !== false) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($a != $firstChild) {\r\n\t\t\t\t\t\t$new_node = $a->cloneNode(true);\r\n\t\t\t\t\t\t$a->setAttribute(\"stripme\", \"y\");\r\n\t\t\t\t\t\tReTidy::DOM_strip_node($a);\r\n\t\t\t\t\t\t$block->insertBefore($new_node, $firstChild);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function removeNofollow($linkid) {\r\n\tglobal $wpdb;\r\n\t$wpdb->update(WP_BARDB_LINKS,array('link_nofollow'=>0),array('id'=>$linkid),array('%d'),array('%d'));\r\n}", "function replace_links($content) {\r\n\tpreg_match_all(\"/<a\\s*[^>]*>(.*)<\\/a>/siU\", $content, $matches);\r\n\t//preg_match_all(\"/<a\\s[^>]*>(.*?)(</a>)/siU\", $content, $matches);\t\r\n\t$foundLinks = $matches[0];\r\n\t$wpbar_options = get_option(\"wpbar_options\");\r\n\t\r\n\tforeach ($foundLinks as $theLink) {\r\n\t\t$uri = getAttribute('href',$theLink);\r\n\t\tif($wpbar_options[\"validateURL\"]) {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink) && isValidURL($uri)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n\treturn $content;\r\n}", "public function delete_page_links() {\n\t\t\t$this->linked_postid = '';\n\t\t\t$this->pages_url = '';\n\t\t\t$this->MakePersistent();\n\n\t\t}", "public function filter() {\n\t\t$args = func_get_args();\n\t\t$out = new CMS_Navigation3_LinkSet();\n\t\tforeach($this->links as $link) {\n\t\t\t$valid = true;\n\t\t\tforeach($args as $arg) {\n\t\t\t\tif (is_string($arg)&&$arg[0]=='!') {\n\t\t\t\t\t$arg = substr($arg,1);\n\t\t\t\t\tif ($link[$arg]) $valid = false;\n\t\t\t\t}\n\t\t\t\telse if (!$link[$arg]) $valid = false;\n\t\t\t}\t\n\t\t\tif ($valid) $out->links[] = $link;\n\t\t}\n\t\treturn $out;\n\t}", "private function get_link_order() {\n $ordertext = '<i class=\"fa fa-sort-desc\"></i> ';\n\n $url = $this->page->url;\n\n if (isset($this->viewoptions['filter'])) {\n $url->param('filter', $this->viewoptions['filter']);\n }\n\n $url->param('order', 'desc');\n\n if (isset($this->viewoptions['order']) && $this->viewoptions['order'] == 'desc') {\n $url->param('order', 'asc');\n }\n\n if (isset($this->viewoptions['order']) && $this->viewoptions['order'] == 'desc') {\n $this->page->url->order = 'asc';\n $ordertext = '<i class=\"fa fa-sort-asc\"></i> ';\n $ordertext .= get_string('orderasc', 'format_timeline');\n\n return html_writer::link($url, $ordertext, ['class' => 'btn btn-outline-primary']);\n }\n\n $ordertext .= get_string('orderdesc', 'format_timeline');\n\n return html_writer::link($url, $ordertext, ['class' => 'btn btn-outline-primary']);\n }", "function uultra_delete_custom_link()\r\n\t{\r\n\t\t$package_id = $_POST[\"package_id\"];\r\n\t\t\t\t\r\n\t\t$modules = $this->uultra_get_user_navigator_for_membership($package_id);\t\t\t\t\r\n\t\t$modules_custom = $this->uultra_get_custom_modules_for_membership($package_id); \r\n\t\t\r\n\t\t$id = $_POST[\"link_id\"];\t\t\r\n\t\t\r\n\t\tforeach($modules as $key => $module)\r\n\t\t{\r\n\t\t\tif($id==$key)\r\n\t\t\t{\r\n\t\t\t\tunset($modules[$key]);\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach($modules_custom as $key => $module)\r\n\t\t{\r\n\t\t\tif($id==$key)\r\n\t\t\t{\r\n\t\t\t\tunset($modules_custom[$key]);\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($package_id=='')\r\n\t\t{\t\r\n\t\t\t\r\n\t\t\tupdate_option('userultra_default_user_features_custom',$modules);\r\n\t\t\tupdate_option('userultra_default_user_features_added_admin',$modules_custom);\t\t\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tupdate_option('userultra_default_user_features_custom_package_'.$package_id.'',$modules);\r\n\t\t\tupdate_option('userultra_default_user_features_added_admin_package_'.$package_id.'',$modules_custom);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tprint_r($modules_custom);\r\n\t\tdie();\r\n\t\r\n\t}", "function orderdown()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$model = $this->getModel('weblink');\n\t\t$model->move(1);\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks');\n\t}", "function maybe_remove_order_notes(){\n return false;\n }", "function recycle_link_categories()\n\t{\n\t\t$link_cat_table = Database :: get_course_table(TABLE_LINK_CATEGORY);\n\t\t$link_table = Database :: get_course_table(TABLE_LINK);\n\t\t$sql = \"SELECT lc.id FROM \".$link_cat_table.\" lc LEFT JOIN \".$link_table.\" l ON lc.id=l.category_id WHERE l.id IS NULL\";\n\t\t$res = api_sql_query($sql,__FILE__,__LINE__);\n\t\twhile ($obj = mysql_fetch_object($res))\n\t\t{\n\t\t\t$sql = \"DELETE FROM \".$link_cat_table.\" WHERE id = \".$obj->id;\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}", "function remove_headerlinks($html) {\n\t// replace\n\t$target = [\n\t\t'search' => [\n\t\t\t'<a href=\"http://expressjs.com/\" class=\"express\">Express</a>',\n\t\t],\n\t\t'replace' => [\n\t\t\t'<span class=\"express\">Express</span>',\n\t\t],\n\t];\n\n\t$html = str_replace($target['search'], $target['replace'], $html);\n\n\t// remove\n\t$target = [\n\t\t['<li><a href=\"index.html\" id=\"home-menu\" class=\"active\"', \"</li>\\n\"],\n\t\t['<li><a href=\"index.html\" id=\"home-menu\"', \"</li>\\n\"],\n\t\t['<li><a href=\"../index.html\" id=\"home-menu\"', \"</li>\\n\"],\n\t\t['<li><a href=\"http://expressjs.com/2x/\"', \"</li>\\n\"],\n\t];\n\n\tforeach ($target as $val) {\n\t\tif ($html && ($p = strpos($html, $val[0])) !== false) {\n\t\t\tif (($q = strpos($html, $val[1], $p + 1)) !== false) {\n\t\t\t\t$html = substr($html, 0, $p) . substr($html, $q + strlen($val[1]));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $html;\n}", "function bt_remove_order_notes( $fields ) {\n unset($fields['order']['order_comments']);\n return $fields;\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 prostarter_contextual_links_view_alter(&$element, $items) {\n if (isset($element['#element']['#node']->nid)) {\n unset($element['#links']['node-delete']);\n }\n}", "function lm_remove_empty_links_from_menus( $item_output, $item, $depth, $args ) {\n\t// Currently, there is no filter for modifying the opening and closing <li> for a menu item.\n\t// This function can filter the inner <a>...</a> element of a menu. $item contains data specific to the menu item.\n\t// Does not affect any submenus stemming from this item.\n\n\tif ( !$item->url || $item->url == '#' ) {\n\t\t$replaces = array(\n\t\t\tarray(\n\t\t\t\t'search' => '<a',\n\t\t\t\t'replace' => '<span class=\"empty-link\"',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'search' => '</a',\n\t\t\t\t'replace' => '</span',\n\t\t\t\t'reverse' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'search' => ' target=',\n\t\t\t\t'replace' => ' data-target=',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'search' => ' href=',\n\t\t\t\t'replace' => ' data-href=',\n\t\t\t),\n\t\t);\n\n\n\t\tforeach ( $replaces as $k ) {\n\t\t\t$search = $k['search'];\n\t\t\t$replace = $k['replace'];\n\n\t\t\tif ( isset( $k['reverse'] ) && $k['reverse'] ) {\n\t\t\t\t$pos = strrpos( $item_output, $search );\n\t\t\t}else{\n\t\t\t\t$pos = strpos( $item_output, $search );\n\t\t\t}\n\n\t\t\tif ( $pos !== false ) {\n\t\t\t\t$item_output = substr_replace( $item_output, $replace, $pos, strlen( $search ) );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $item_output;\n}", "function removeBlinks($links, $postID) {\n // setup database access\n if (is_array($links) && count($links) > 0) {\n global $wpdb;\n $table_name = $wpdb->prefix . \"blink_links\";\n // remove links\n foreach ($links as $link) {\n $sql = \"DELETE FROM $table_name\n WHERE gid = '\" . $link['gid'] . \n \"' AND pid = '\" . $postID . \"'\";\n $wpdb->query($sql);\n }\n }\n }", "function deletelinks($id_ex){\n $db = connect_start();\n\n $db->exec(\"DELETE FROM links WHERE id_exercice = '$id_ex'\");\n $db->exec(\"ALTER TABLE links AUTO_INCREMENT = 0\");\n}", "function tac_remove_menus() {\n\tglobal $menu;\n\t$restricted = array( __( 'Links' ),__( 'Comments' ) );\n\tend( $menu );\n\twhile ( prev( $menu ) ) {\n\t\t$value = explode( ' ', $menu[ key( $menu ) ] [0] );\n\t\tif ( in_array( $value[0] !== null?$value[0] : '' , $restricted ) ) {\n\t\t\tunset( $menu[ key( $menu ) ] );\n\t\t}\n\t}\n}", "function remove_more_link_hash($link) {\n\t\t$offset = strpos($link, '#more-');\n\t\tif ($offset) {\n\t\t\t$end = strpos($link, '\"', $offset);\n\t\t}\n\t\tif ($end) {\n\t\t\t$link = substr_replace($link, '', $offset, $end-$offset);\n\t\t}\n\t\treturn $link;\n\t}", "function unregister_header_links()\n{\n// Remove Actions\n// remove_action('wp_head', 'feed_links_extra', 3); // Display the links to the extra feeds such as category feeds\n// remove_action('wp_head', 'feed_links', 2); // Display the links to the general feeds: Post and Comment Feed\n// remove_action('wp_head', 'rsd_link'); // Display the link to the Really Simple Discovery service endpoint, EditURI link\n// remove_action('wp_head', 'wlwmanifest_link'); // Display the link to the Windows Live Writer manifest file.\n// remove_action('wp_head', 'index_rel_link'); // Index link\n// remove_action('wp_head', 'parent_post_rel_link', 10, 0); // Prev link\n// remove_action('wp_head', 'start_post_rel_link', 10, 0); // Start link\n// remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // Display relational links for the posts adjacent to the current post.\n remove_action('wp_head', 'wp_generator'); // Display the XHTML generator that is generated on the wp_head hook, WP version\n// remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n// remove_action('wp_head', 'rel_canonical');\n// remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);\n add_filter('the_generator', '__return_empty_string');\n}", "function dont_follow_links( $html ) {\n\t $follow_list = array(\n\t 'mypage.com',\n\t );\n\t return preg_replace(\n\t '%(<a\\s*(?!.*\\brel=)[^>]*)(href=\"https?://)((?!(?:(?:www\\.)?'.implode('|(?:www\\.)?', $follow_list).'))[^\"]+)\"((?!.*\\brel=)[^>]*)(?:[^>]*)>%',\n\t '$1$2$3\"$4 rel=\"nofollow\">',\n\t $html);\n\t}", "protected function removeAuthors()\r\n {\r\n $db = \\Drupal\\Core\\Database\\Database::getConnection();\r\n \r\n // Grab all quotes based by author and group them together\r\n $query = $db->select('node__field_author', 'nfa');\r\n $query->fields('nfa', array('entity_id', 'field_author_target_id'));\r\n \t$query->fields('nfq', array('field_quot_value'));\r\n \t$query->fields('fname', array('field_fname_value'));\r\n \t$query->fields('lname', array('field_lname_value'));\r\n $query->join('node__field_quot', 'nfq', 'nfa.entity_id = nfq.entity_id');\r\n $query->join('node__field_fname', 'fname', 'nfa.field_author_target_id = fname.entity_id');\r\n $query->join('node__field_lname', 'lname', 'nfa.field_author_target_id = lname.entity_id');\r\n $query->orderBy('nfa.field_author_target_id');\r\n $query->orderBy('nfq.field_quot_value');\r\n $query->orderBy('nfa.entity_id');\r\n \r\n /*\r\n * select nfa.entity_id, nfq.field_quot_value\r\n from node__field_author as nfa\r\n join node__field_quot as nfq\r\n on nfa.entity_id = nfq.entity_id\r\n order by nfa.field_author_target_id, nfq.field_quot_value, nfa.entity_id\r\n */\r\n \r\n\ttry{ \r\n\t\t$quotes = $query->execute()->fetchAll();\r\n\t}\r\n\tcatch(\\Exception $e){\r\n\t\tvar_dump($e);exit;\r\n}\r\n \r\n $nid = 0;\r\n $prev_author = 0;\r\n $prev_quote_id = 0;\r\n $prev_quote = \"\";\r\n $prev_author_name = \"\";\r\n $duplicates = array();\r\n $flag = false;\r\n \r\n $batch_count = 0;\r\n \r\n \r\n $test_count = 0;\r\n \r\n\t// Look at the ordered list of authors and quotes\r\n try {\r\n foreach($quotes as $quote){\r\n \r\n // If this quote is the same as the last quote AND it has the same author, mark it as a duplicate.\r\n if($quote->field_quot_value == $prev_quote && $quote->field_author_target_id == $prev_author){\r\n \r\n if(!$flag){\r\n echo 'Keeping: ' . $prev_quote . ' - <b>' . $prev_author_name . '</b> (AID: ' . $prev_author . ' QID: ' . $prev_quote_id . ')<br />';\r\n $flag = true;\r\n }\r\n $duplicates[] = $quote->entity_id;\r\n $batch_count++;\r\n \r\n echo 'Removing: ' . $quote->field_quot_value . ' - <b>' . $quote->field_fname_value . ' ' . $quote->field_lname_value . '</b> (AID: ' . $quote->field_author_target_id . ' QID: ' . $quote->entity_id . ')<br />';\r\n\t\t // echo 'Previous one is the: ' . $prev_quote . ' (' . $prev_author . ')<br />';\r\n\t\t continue;\r\n }\r\n \r\n // If the batch size has gone over 50, then purge the duplicates and continue.\r\n if($batch_count > 50){\r\n \r\n $this->_purgeDuplicates($duplicates);\r\n \r\n $duplicates = array();\r\n $batch_count = 0;\r\n }\r\n \r\n // Update the previous author and quote to determine next duplicate.\r\n $prev_author = $quote->field_author_target_id;\r\n $prev_quote_id = $quote->entity_id;\r\n $prev_quote = $quote->field_quot_value;\r\n $prev_author_name = $quote->field_fname_value . ' ' . $quote->field_lname_value;\r\n $flag = false;\r\n \r\n \r\n \r\n }\r\n }\r\n catch(\\Error $e){\r\n\r\n }\r\n\r\n\r\n\techo 'There are ' . count($duplicates);\r\n }", "public function onBeforeDelete() {\n // Delete all items attached to this order\n foreach($this->Items() as $item) {\n $item->delete();\n }\n\n parent::onBeforeDelete();\n }", "public function stripOrderByForOrderByKeywordDataProvider() {}", "public function getDisabledLinks()\n {\n\t\t$disabled = explode(',', Mage::getStoreConfig('faonni_accountnavigation/general/disabled_link'));\n\t\t$links = $this->getLinks();\n\t\t\n\t\tforeach($links as $key => $name){\n\t\t\tif(!in_array($key, $disabled)) unset($links[$key]);\n\t\t}\n\t\treturn $links;\n }", "public function onAfterDelete() {\n\n\t\tparent::onAfterDelete();\n\n\t\t// Determine whether this page has been completely removed.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default') && !$this->owner->isPublished() && !$this->owner->isOnDraft()) {\n\n\t\t\t// Convert any link mappings that are directly associated with this page.\n\n\t\t\t$mappings = LinkMapping::get()->filter(array(\n\t\t\t\t'RedirectType' => 'Page',\n\t\t\t\t'RedirectPageID' => $this->owner->ID\n\t\t\t));\n\t\t\tforeach($mappings as $mapping) {\n\t\t\t\t$mapping->RedirectType = 'Link';\n\t\t\t\t$mapping->RedirectLink = Director::makeRelative(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link());\n\t\t\t\t$mapping->write();\n\t\t\t}\n\t\t}\n\t}", "function add_action_links( $links ) {\r\n $links['delete'] = '<a onclick=\"return confirm(\\'' . __( 'Are you sure? You will lose all Clients, HUB Pages, Portal Pages, Private Messages & Files', WPC_CLIENT_TEXT_DOMAIN ) . '\\');\" href=\"' . get_admin_url() . 'plugins.php?action=wpclient_uninstall\" class=\"delete\" >Uninstall</a>';\r\n return $links;\r\n }", "function remove_category_list_rel( $output ) {\n return str_replace( 'rel=\"category tag\"', '', $output );\n}", "function custom_my_account_menu_items($items)\n{\n unset($items['downloads']);\n return $items;\n}", "function removeHeadLinks() {\n remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds\n remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed\n remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link\n remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file.\n remove_action( 'wp_head', 'index_rel_link' ); // index link\n remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link\n remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link\n remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Display relational links for the posts adjacent to the current post.\n remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version\n}", "function pre_ping( &$links ) {\n\t\tforeach ( $links as $i => $link )\n\t\t\tif ( 0 === strpos( $link, home_url() ) )\n\t\t\t\tunset( $links[$i] );\n\t}", "public function delete () {\n if(count($this->data[$this->id])) {\n foreach($this->data[$this->id] as $key=>$prop) {\n if($prop[\"link\"] == \"P127F\")\n $broader = $key;\n }\n }\n unset($this->data[$this->id][$broader]);\n \n // if there are still links, we must stop\n if(count($this->data[$this->id])) \n throw new Exception(\"Cannot remove because record has links! (remove them first)\");\n\n // remove table data linked to this record\n foreach($this->tables as $table) {\n $table->deleteMyData($this->id);\n }\n \n // remove link to class hierarchy and then the record itself\n IdaDb::deleteBy(\"_sys_classes_join\", array(\"subject\"=>$this->id));\n IdaDb::deleteBy(\"_sys_records\", array(\"id\"=>$this->id));\n \n }", "function wp_delete_link($link_id)\n {\n }", "function rebound_links($links, $attributes = array()) {\n global $user;\n if (!$user->uid) {\n unset($links['links']['comment_forbidden']);\n }\n return theme_links($links, $attributes);\n}", "function ct_disable_pingback( &$links ) {\n foreach ( $links as $l => $link ) {\n if ( 0 === strpos( $link, get_option( 'home' ) ) ) {\n unset( $links[ $l ] );\n }\n }\n}", "function removelinks(){\n\n Vtiger_Link::deleteLink(0, 'HEADERSCRIPT', 'LSWYSIWYG', 'modules/LSWYSIWYG/resources/WYSIWYG.js','','','');\n\t}", "public function resetLinkWeights();", "public function finalizeOrder();", "function remove_head_links() {\n\t\t\n\t\t\tremove_action('wp_head', 'rsd_link');\n\n\t\t\tremove_action('wp_head', 'wlwmanifest_link');\n\n\t\t\tremove_action('wp_head','wp_generator');\n\t\t\t\n\t\t}", "function removeHref($content) {\n\t$string = $content;\n\t$pattern = \"/\\<a([^>]*)\\>([^<]*)\\<\\/a\\>/i\";\n\t//$pattern = '/<a href=\\\"(.*?)\\\">(.*?)<\\/a>/';\n\t$result = preg_replace($pattern, \"\\\\2\", $string);\n\t$result = str_replace(\"Read More\", \"\", $result);\n\treturn $result; // this will output \"I am a lot of text with links in it\"\n}", "function delCategoryLink($object) { \n /* you can itentify the article with $object->reference->ShopId */ \n /* you can itentify the item with $object->Item->ShopId */ \n}", "function getLinkMatches($html) {\r\n $linkRegex = '/(https?:\\/\\/[\\da-z\\.-]+\\.[a-z\\.]{2,6}[\\/\\w \\.-]+)/';\r\n \r\n preg_match_all($linkRegex, $html, $linkMatches);\r\n $removeDuplicateLinks = array_unique($linkMatches[0]);\r\n \r\n return $removeDuplicateLinks;\r\n}", "public function testClickLinksSort()\n { \n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/categories')\n ->click(\"#category-sort-name a\")\n ->assertQueryStringHas('sort', 'name')\n ->assertQueryStringHas('order', 'asc')\n ->click(\"#category-sort-name a\")\n ->assertQueryStringHas('sort', 'name')\n ->assertQueryStringHas('order', 'desc');\n });\n }", "function eliminar_link(){\t\n\t\t$id=$_GET['id'];\n\t\t$sql=\"SELECT id_con FROM contenido WHERE enlace_con='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\tif($resultado=mysql_fetch_array($consulta)){\n\t\t header(\"location:/admin/link/?error=1\");\n\t\t}else{\n\t\t\t$sql=\"DELETE FROM link WHERE id_cat='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t\n\t\t\t$sql=\"DELETE FROM linkxsub WHERE link_rel='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/link/\");\n\t\t}\n\t}", "function remove_category_rel_from_category_list($thelist)\n{\n return str_replace('rel=\"category tag\"', 'rel=\"tag\"', $thelist);\n}", "function remove_category_rel_from_category_list($thelist)\n{\n return str_replace('rel=\"category tag\"', 'rel=\"tag\"', $thelist);\n}", "function remove_category_rel_from_category_list($thelist)\n{\n return str_replace('rel=\"category tag\"', 'rel=\"tag\"', $thelist);\n}", "function remove_category_rel_from_category_list($thelist)\n{\n return str_replace('rel=\"category tag\"', 'rel=\"tag\"', $thelist);\n}", "public function clearOrderHasArticless()\n {\n $this->collOrderHasArticless = null; // important to set this to NULL since that means it is uninitialized\n }", "function action_links( $links ) {\n\t\t$custom_links = array();\n\t\t$custom_links[] = '<a href=\"' . admin_url( 'admin.php?page=wc-settings&tab=alg_wc_custom_order_numbers' ) . '\">' . __( 'Settings', 'woocommerce' ) . '</a>';\n\t\tif ( 'custom-order-numbers-for-woocommerce.php' === basename( __FILE__ ) ) {\n\t\t\t$custom_links[] = '<a href=\"https://wpcodefactory.com/item/custom-order-numbers-woocommerce/\">' . __( 'Unlock All', 'custom-order-numbers-for-woocommerce' ) . '</a>';\n\t\t}\n\t\treturn array_merge( $custom_links, $links );\n\t}", "function removeHeadLinks() {\n\t \tremove_action('wp_head', 'rsd_link');\n\t \tremove_action('wp_head', 'wlwmanifest_link');\n\t }", "function remove_more_jump_link($link) { \n$offset = strpos($link, '#more-');\nif ($offset) {\n$end = strpos($link, '\"',$offset);\n}\nif ($end) {\n$link = substr_replace($link, '', $offset, $end-$offset);\n}\nreturn $link;\n}", "function remove_more_jump_link($link) { \n$offset = strpos($link, '#more-');\nif ($offset) {\n$end = strpos($link, '\"',$offset);\n}\nif ($end) {\n$link = substr_replace($link, '', $offset, $end-$offset);\n}\nreturn $link;\n}", "function remove_category_rel_from_category_list($thelist)\n{\n return str_replace('rel=\"category tag\"', 'rel=\"tag\"', $thelist);\n}", "function node_link_alter(&$links, $node) {\n // Use 'Read more »' instead of 'Read more'\n if (isset($links['node_read_more'])) {\n $links['node_read_more']['title'] = t('Read more »');\n } \n \n // Remove Section on taxonomy term links\n foreach ($links as $module => $link) { \n if (strstr($module, 'taxonomy_term')) {\n foreach ($links as $key => $value) {\n if ($value['title'] == 'Life' || \n $value['title'] == 'Geek') {\n unset($links[$key]);\n }\n }\n }\n // Don't show language links in Today and other listing\n //unset($links['node_translation_ja']);\n //unset($links['node_translation_en']);\n }\n}", "function remove_uncategorized_links( $categories ){\n\n\tforeach ( $categories as $cat_key => $category ){\n\t\tif( 15 == $category->term_id ){\n\t\t\tunset( $categories[ $cat_key ] );\n\t\t}\n\t}\n\n\treturn $categories;\n\t\n}", "function remove_category_rel_from_category_list( $thelist ) {\n return str_replace( 'rel=\"category tag\"', 'rel=\"tag\"', $thelist );\n}", "function UnOrderlist( $atts, $content = null ) {\r\n return '<div class=\"UnOrderlist\">' . $content . '</div>';}", "function wpse_remove_edit_post_link( $link ) {\nreturn '';\n}", "private function getFooterNavLinks(){\n $sidebar = $this->getSidebar();\n // returns content from wiki/Mediawiki:Sidebar \n // plus a few internal defaults like SEARCH, LANGUAGES, TOOLBOX and TOOLBOXEND\n unset($sidebar['SEARCH']);\n unset($sidebar['LANGUAGES']);\n unset($sidebar['TOOLBOXEND']); //show \"Duplicate this page\" link occasionally?\n \n $html = '';\n foreach ($sidebar as $category => $linkGroup){\n if (!$linkGroup['content']){\n continue;\n }else{\n //force to array\n $linkGroup['content'] = is_array($linkGroup['content'])? $linkGroup['content'] : array($linkGroup['content']);\n }\n $html .= '<div class=\"footer-links\">'.\"\\n\";\n //$html .= ' <h4>'.$linkGroup['header'].'</h4>'.\"\\n\";\n $html .= ' <ul>'.\"\\n\";\n foreach ($linkGroup['content'] as $key => $linkObj){\n if (is_string($linkObj)){\n $html .= $linkObj;\n } else {\n $html .= $this->makeListItem($key, $linkObj);\n }\n }\n $html .= ' </ul>'.\"\\n\";\n $html .= '</div>';\n }\n\n return $html;\n }", "function ccategories_order()\n\t{\n\t\tlusers_require(\"categories/order\");\n\n\t\t$post_data = linput_post();\n\t\t$order = $post_data[\"order\"];\n\n\t\t$order = split(\"\\|\", $order);\n\n\t\tfor ($i = 0; $i < count($order); $i++)\n\t\t{\n\t\t\tlcrud_update(lconf_get(\"lang\") . \"_categories\", array(\"id\" => $order[$i]), array(\"orderid\" => $i));\n\t\t}\n\n\t\tlcache_delete_all();\n\t}", "public function clear()\n {\n $this->links = [];\n }", "function wp_listings_deactivation() {\n\n\t\tflush_rewrite_rules();\n}", "public function removeStructure($url);", "function remove_image_links() {\n update_option('image_default_link_type', 'none');\n}", "function nav_private_link_remove( $items, $menu, $args ) {\n\tif ( ! is_user_logged_in() ) {\n\t\tarray_walk( $items, function( $item, $key ) use ( &$items ) {\n\t\t\tif (\n\t\t\t\t! empty( $item->object_id )\n\t\t\t\t&& 'private' === get_post_status( $item->object_id )\n\t\t\t) {\n\t\t\t\tunset( $items[ $key ] );\n\t\t\t}\n\t\t} );\n\t}\n\treturn $items;\n}", "function eliminar_sublink(){\t\n\t\t$id=$_GET['id'];\n\t\t$back=$_GET['back'];\n\t\t$sql=\"DELETE FROM linkxsub WHERE id_rel='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\theader(\"location:/admin/link/detalle.php?id=$back\");\n\t}", "public abstract function prepare_item_links($id);", "public function maybe_flush_permalinks()\n {\n }", "function delete_links($link,$domain) {\n $parameters = array(\n 'method' => __FUNCTION__,\n 'link' => json_encode($link),\n 'domain' => $domain\n );\n \n return $this->get_data($parameters);\n }", "function remove_category_rel_from_category_list( $thelist ) {\n\treturn str_replace( 'rel=\"category tag\"', 'rel=\"tag\"', $thelist );\n}", "function basel_remove_from_compare() {\n\n\t\t$id = sanitize_text_field( $_GET['id'] );\n\n\t\tif ( defined( 'ICL_SITEPRESS_VERSION' ) && function_exists( 'wpml_object_id_filter' ) ) {\n\t\t\tglobal $sitepress;\n\t\t\t$id = wpml_object_id_filter( $id, 'product', true, $sitepress->get_default_language() );\n\t\t}\n\n\t\t$cookie_name = basel_compare_cookie_name();\n\n\t\tif ( ! basel_is_product_in_compare( $id ) ) {\n\t\t\tbasel_compare_json_response();\n\t\t}\n\n\t\t$products = basel_get_compared_products();\n\n\t\tforeach ( $products as $k => $product_id ) {\n\t\t\tif ( intval( $id ) == $product_id ) {\n\t\t\t\tunset( $products[ $k ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $products ) ) {\n\t\t\tsetcookie( $cookie_name, false, 0, COOKIEPATH, COOKIE_DOMAIN, false, false );\n\t\t\t$_COOKIE[ $cookie_name ] = false;\n\t\t} else {\n\t\t\tsetcookie( $cookie_name, json_encode( $products ), 0, COOKIEPATH, COOKIE_DOMAIN, false, false );\n\t\t\t$_COOKIE[ $cookie_name ] = json_encode( $products );\n\t\t}\n\n\t\tbasel_compare_json_response();\n\t}", "protected function prepare_links( $object ) {\n\t\t$links = array(\n\t\t\t'order' => array(\n\t\t\t\t'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $object['order_id'] ) ),\n\t\t\t),\n\t\t);\n\n\t\treturn $links;\n\t}", "public function shuffle() {\n\t$this->checkElementsInDom();\n\n\t// Save reference to parent node, while the link exists.\n\t$parentNode = $this->_elArray[0]->parentNode;\n\n\t// Remove them all from the DOM.\n\tforeach ($this->_elArray as $el) {\n\t\t$el->remove();\n\t}\n\n\tshuffle($this->_elArray);\n\t// Add them back into the DOM, in their shuffled order.\n\tforeach ($this->_elArray as $el) {\n\t\t$parentNode->append($el);\n\t}\n}", "function remove_category_rel_from_category_list($thelist)\n{\n\treturn str_replace('rel=\"category tag\"', 'rel=\"tag\"', $thelist);\n}", "protected function removeItemAddressesThatAreEqualToOrderAddress($order)\n {\n $deliveryAddressId = $order->getDeliveryAddress()->getContactAddress()->getId();\n foreach ($order->getItems() as $item) {\n $itemEntity = $item->getEntity();\n $this->removeOrderAddressIfContactAddressIdIsEqualTo($itemEntity, $deliveryAddressId);\n }\n }", "public function removePositions() {\n\t\t// unshift categories\n\t\t$sql = \"SELECT \tparentID, position\n\t\t\tFROM\twcf\".WCF_N.\"_linklist_category_structure\n\t\t\tWHERE\tcategoryID = \".$this->categoryID;\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$sql = \"UPDATE\twcf\".WCF_N.\"_linklist_category_structure\n\t\t\t\tSET\tposition = position - 1\n\t\t\t\tWHERE \tparentID = \".$row['parentID'].\"\n\t\t\t\t\tAND position > \".$row['position'];\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t\t\n\t\t// delete category structure\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_linklist_category_structure\n\t\t\tWHERE\t\tcategoryID = \".$this->categoryID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "function ea_skiplinks_output( $links ) {\n\n if ( genesis_nav_menu_supported( 'third-menu' ) && has_nav_menu( 'third-menu' ) ) {\n $links['genesis-nav-custom'] = __( 'Skip to custom navigation', 'genesis' );\n }\n\n return $links;\n}", "function attachment_image_link_remove_filter($content) {\n $content = preg_replace(array('{<a(.*?)(wp-att|wp-content\\/uploads)[^>]*><img}', '{ wp-image-[0-9]*\" /></a>}'), array('<img', '\" />'), $content);\n return $content;\n}", "function custom_post_order_uninstall(){\n\n\tdelete_post_meta_by_key( 'post_order' );\n\t$wp_roles = new WP_Roles();\n\n\tforeach( $wp_roles->roles as $key => $role ){\n\n\t\t$role_remove = get_role( $key );\n\t\t$role_remove->remove_cap( 'order_posts' );\n\t}\n\n}", "function wcpdf_filter_order_ids( $order_ids, $document_type ) {\n\t$order_ids = apply_filters( 'wpo_wcpdf_process_order_ids', $order_ids, $document_type );\n\t// filter out trashed orders\n\tforeach ( $order_ids as $key => $order_id ) {\n\t\t$order_status = get_post_status( $order_id );\n\t\tif ( $order_status == 'trash' ) {\n\t\t\tunset( $order_ids[ $key ] );\n\t\t}\n\t}\n\treturn $order_ids;\n}", "function deleteEntry() \n { \n \n // before removing entry, make sure associated linkGroups & linkViewers\n // are removed as well\n $linkID = $this->getID();\n \n $linkMgr = new RowManager_NavLinkAccessGroupManager();\n $linkMgr->setLinkID( $linkID );\n $list = $linkMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n $linkViewerMgr = new RowManager_NavLinkViewerManager();\n $linkViewerMgr->setLinkID( $linkID );\n $list = $linkViewerMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n parent::deleteEntry();\n \n }", "function menu_links_unfeaturize_restore($module, $defaults) {\n menu_links_features_rebuild_ordered($defaults);\n}", "function eblex_findhrefs2($page)\r\n{\r\n $using = false;\r\n $href = \"\";\r\n $hrefs[0] = \"\";\r\n $hrefcount = 0;\r\n\r\n for ($i = 0;$i < strlen($page)-1;$i++) {\r\n $a = $page[$i] . $page[$i + 1];\r\n ///\tModification\t30/06/2008\tmVicenik\tFoliovision\r\n //if ($a == \"<a\") {\r\n if ($a == \"<a\" || $a == \"<A\") {\r\n ///\tend of modification\r\n $using = true;\r\n }\r\n\t\tif ($page[$i] == \">\") {\r\n $using = false;\r\n if ($href != \"\") {\r\n $hrefs[$hrefcount] = $href . \">\";\r\n $hrefcount++;\r\n } \r\n $href = \"\";\r\n } \r\n\r\n if ($using == true) {\r\n $href .= $page[$i];\r\n } \r\n } \r\n\r\n return $hrefs;\r\n}", "public function order();", "protected function resetElementsToBeDeleted() {}", "function fix_links(&$talk_data) {\n\t# to some URL like http://elearning.physik..../attachment/...whatever.pdf\n\t#\n\t# This works by call-by-reference, that is, $talk_data is changed in-place.\n\t$wikiopen = preg_quote('[['); $wikiclose = preg_quote(']]');\n\t$ticket = $talk_data['ticket_id'];\n\tforeach($talk_data as &$value) {\n\t\t// resolve links to attachments\n\t\t$value = preg_replace(\"/(?:$wikiopen)?(?:raw-)?attachment:(.*?)(?:$wikiclose)?/i\",\n\t\t\t\"https://elearning.physik.uni-frankfurt.de/projekt/raw-attachment/ticket/$ticket/\\\\1\",\n\t\t\t$value);\n\t\t// whaa... remaining brackets\n\t\t$value = str_replace(']]', '', $value);\n\t}\n\tunset($value); // dereference\n}", "public function remove_packlink_meta_data() {\n\t\t$query = \"DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE \\\"%_packlink_%\\\"\";\n\n\t\t$this->db->query( $query );\n\t}", "function at_remove_dup_canonical_link() {\t\n\tif ( is_home() ) {\n return false;\n }\t\t\n}", "function remove_menu_items() {\n global $menu;\n $restricted = array(__('Links'), __('Comments')/*, __('Media')*/,\n /*__('Plugins'), __('Tools'),*/ __('Users'));\n end ($menu);\n while (prev($menu)){\n $value = explode(' ',$menu[key($menu)][0]);\n if(in_array($value[0] != NULL?$value[0]:\"\" , $restricted)){\n unset($menu[key($menu)]);}\n }\n }", "function removeOrderByid($id) {\r\n\t\t$query = \"DELETE FROM \".TBL_ORDERS.\" WHERE order_id = :order_id\";\r\n\t\t$stmt = $this->connection->prepare($query);\r\n\t\t$stmt->execute(array(':order_id' => $id));\r\n\t}" ]
[ "0.6103649", "0.58335775", "0.5817567", "0.5765514", "0.57641673", "0.5734988", "0.572543", "0.56726724", "0.5637828", "0.55425423", "0.5506784", "0.54617566", "0.5458103", "0.53781605", "0.5370096", "0.53645056", "0.5326128", "0.5322039", "0.5293432", "0.528514", "0.5279967", "0.5273205", "0.52690953", "0.52576816", "0.5211103", "0.5178494", "0.5176884", "0.51744604", "0.5160266", "0.5145994", "0.5141965", "0.5140701", "0.51402265", "0.51189303", "0.51174027", "0.5105715", "0.5098593", "0.5095151", "0.5087566", "0.5085845", "0.5078331", "0.5077994", "0.5069446", "0.50683236", "0.50535053", "0.5052328", "0.5046907", "0.50389636", "0.5038304", "0.5022838", "0.5018147", "0.501499", "0.50140405", "0.50070655", "0.50070655", "0.50070655", "0.50070655", "0.5005899", "0.50057214", "0.5005439", "0.5000515", "0.5000515", "0.49973893", "0.49930736", "0.4978408", "0.49762136", "0.49725842", "0.49605387", "0.49602053", "0.4958368", "0.49461338", "0.49412894", "0.49403465", "0.4925396", "0.49207175", "0.49114662", "0.49113148", "0.490528", "0.48978862", "0.489057", "0.4879117", "0.48743197", "0.48729506", "0.48717564", "0.48708072", "0.48673314", "0.48668215", "0.48635623", "0.4859974", "0.48597735", "0.4849362", "0.4848948", "0.4846574", "0.4833855", "0.48334596", "0.4832659", "0.48163235", "0.4814513", "0.48115417", "0.48084554" ]
0.5930627
1
Returns the name of this type.
public function getName() { return "menu"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getName(): string {\n\t\t\treturn $this->type;\n\t\t}", "public function getTypeName()\n {\n return $this->type_name;\n }", "public function name() {\n\t\t\treturn $this->_name . ' ('.self::$type_name[$this->_type].')';\n\t\t}", "public function getTypeName()\n {\n return $this->type->getName();\n }", "public function getTypeName()\n {\n return $this->TypeName;\n }", "public function getNameType()\n {\n return $this->nameType;\n }", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getTypeName()\n {\n return BalanceOperations::typeName($this->type_id);\n }", "protected function getTypeName(): string\n {\n if (isset($this->typeName)) {\n return $this->typeName;\n }\n\n return $this->getModelNameBasedOnClassName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function get_name() {\n\n\t\treturn $this->post_type_name;\n\t}", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public static function name()\n {\n return isset(static::$name) ? static::$name : self::getClassShortName();\n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName($type) {\n return $this->load($type)->getName();\n }", "public function getName()\n {\n $class = get_class($this);\n\n return str_replace($this->getObjectType(), '',\n str_replace(CADRE_appNameSpace.$this->getObjectTypePlural().'\\\\', '', $class));\n }", "function getName()\n {\n return get_class($this);\n }", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "public function getName() {\n return self::NAME;\n }", "abstract public function getTypeName();", "function getName() {\n // $this is used to refer to an attribute of a class\n return $this->name;\n }", "public function type_name(){\r\n \r\n //sends back the name of the class running\r\n return $this->type_name;\r\n \r\n }", "public function getTypeName()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'typename'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'typename'];\n\t\t}\n\t}", "public function getTypeName(): string;", "public function getName() {\n return $this->__name;\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function name()\n {\n return $this->getFromCache(\n ['type' => 'name']\n );\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "public function getName(): string\n {\n return self::NAME;\n }", "public function getName(): string\n {\n return self::NAME;\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "public function getName ()\n {\n return $this->_name;\n }", "public function getName() {\n\t\treturn $this->_name;\n\t}", "public function getName() {\n\t\treturn $this->_name;\n\t}", "public function getName() {\n return $this->__name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n\t\treturn $this->_name;\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName() : string\n {\n return $this->_name;\n }", "public function name()\n\t{\n\t\treturn $this->_name;\n\t}", "public function getName(): string {\n return (string) $this->name;\n }", "public function name() {\n return $this->name;\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "function getName () {\n\t\treturn $this->name;\n\t}", "public function getName () {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}" ]
[ "0.8866213", "0.88208175", "0.8817157", "0.87542146", "0.855894", "0.8204096", "0.8155769", "0.8155769", "0.8136834", "0.8110998", "0.80263054", "0.8010495", "0.79981846", "0.79853827", "0.79727006", "0.79586303", "0.79586303", "0.79586303", "0.79586303", "0.79586303", "0.79586303", "0.79586303", "0.79364926", "0.7934683", "0.7927874", "0.7898144", "0.7886855", "0.78786373", "0.78786373", "0.78678817", "0.7842295", "0.7834188", "0.7827454", "0.78219575", "0.7812393", "0.7800831", "0.77814907", "0.77814907", "0.7780031", "0.7780031", "0.7780031", "0.775455", "0.77500206", "0.77445644", "0.77445644", "0.7734659", "0.7734592", "0.7734592", "0.7734592", "0.772114", "0.7705516", "0.7705516", "0.7701025", "0.7681991", "0.7672641", "0.7672641", "0.76702243", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.76613384", "0.764533", "0.764533", "0.764366", "0.7630487", "0.7627439", "0.7625279", "0.76179457", "0.76179457", "0.76179457", "0.76179457", "0.761623", "0.761623", "0.761623", "0.76136446", "0.7610586", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116" ]
0.0
-1
Display a listing of the resource.
public function index() { // //* id, question_code, question_specific, question_detail //* is_private, is_answered, patient_id, created_at, updated_at // $questions = Question::all(); $questions = Question::orderBy('question_code', 'asc')->get(); $answered_questions = array(); $unanswered_questions = array(); $answersList = array(); foreach ($questions as $question ){ // Code Here if( $question->is_answered == 'unanswered' ){ array_push($unanswered_questions, $question); }else{ array_push($answered_questions, $question); } //echo $question->is_answered; } foreach ($questions as $question) { $answers = Question::find($question->id)->answers; //asso array need foreach //get all answers of this question foreach ($answers as $answer) { array_push($answersList, $answer); //$answer is all answers of question & $answer is json } } return view('Q&A.index', compact('unanswered_questions', 'answered_questions','answersList'));//,'specialties')); // return compact('unanswered_questions', 'answered_questions','answersList');//,'specialties'); }
{ "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 view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\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 $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\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 }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\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 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 permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function 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 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 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.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // return view('Q&A.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 &eacute;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
Store a newly created resource in storage.
public function store(StoreQuestionRequest $request) { // //get data from view //* id, question_code, question_specific, question_detail //* is_private, is_answered, patient_id, created_at, updated_at $question_code = 'QI-'.time();//$request->input('patient-name');$x=time(); $question_specific = $request->input('question-specific'); $question_detail = $request->input('question-detail'); $patient_id = Auth::user()->id;//$request->input('patient-id'); ///* ////$attach = $request->file('question-attach'); // //check data //// if($attach){ //// $attach_filename= $attach->getClientOriginalFileName(); //// //write @bootstrap\app.php //// $attach->move(public_path('attachments'),$attach_filename); //// }else { //// $attach_filename = null; //is send to command //// } // * // */ //create command $command = new StoreQuestionCommand($question_code, $question_specific, $question_detail, $patient_id); //run command $this->dispatch($command); return redirect('/questions') ->with('message','New Question is added'); // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.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) { // $question = Question::find($id); // $answers = $question->answers; // return compact('question'); return view('Q&A.show', compact('question')); }
{ "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) { // $question = Question::find($id); return view('Q&A.edit', compact('question')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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(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() {\n return view('routes::edit');\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 edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\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 $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(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\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 \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 $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($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.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(UpdateQuestionRequest $request, $id) { // $question_specific = $request->input('question-specific'); $question_detail = $request->input('question-detail'); $patient_id = Auth::user()->id;//$request->input('patient-id'); //create command $command = new UpdateQuestionCommand($id, $question_specific, $question_detail, $patient_id); //run command $this->dispatch($command); return redirect('/questions') ->with('message','Question is updated'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // $command = new DestoryQuestionCommand($id); //run command $this->dispatch($command); return redirect('/questions') ->with('message','Question is deleted'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Attempt to find the user id of the currently logged in user Supports Cartalyst Sentry/Sentinel based authentication, as well as stock Auth
public function getSystemUserId() { $systemUser = $this->getSystemUser(); if (is_null($systemUser)) { return $systemUser; } try { if (is_array($systemUser)) { if (isset($systemUser['id'])) { return $systemUser['id']; } } throw new \Exception('No `id` found for the authenticated system user.'); } catch (\Exception $e) { $this->reportException($e); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_user_id();", "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 get_current_user_id()\n {\n }", "public function getCurrentUserId();", "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 getUserId() {\n\t\tif ($this->logged()) {\n\t\t\treturn $_SESSION['auth']['id'];\n\t\t}\n\t\treturn false;\n\t}", "public function get_user_id()\n {\n return self::getUser();\n }", "private static function get_current_user_id() {\r\n\t\t//print_r($_SESSION);\r\n\t\t$mysqli = Database::connection();\r\n\t\tif (!isset($_SESSION['user_id']) || !is_numeric($_SESSION['user_id'])) {\r\n\t\t\t//Check for a cookie\r\n\t\t\tif (!empty($_COOKIE['token']) && is_numeric($_COOKIE['user_id'])) {\r\n\t\t\t\t$token = $_COOKIE['token'];\r\n\t\t\t\t$user_id = $_COOKIE['user_id'];\r\n\t\t\t\t$sql = \"SELECT token FROM users WHERE user_id = '$user_id'\";\r\n\t\t\t\t$result = $mysqli->query($sql)\r\n\t\t\t\tor die($mysqli->error);\r\n\t\t\t\tif ($result->num_rows == 1) {\r\n\t\t\t\t\t//Attempt to verify the token\r\n\t\t\t\t\t$token_hashed = mysqli_fetch_row($result)[0];\r\n\t\t\t\t\t$verify = password_verify($token, $token_hashed);\r\n\t\t\t\t\tif ($verify) {\r\n\t\t\t\t\t\t//Create the session again\r\n\t\t\t\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t\t\t\t\treturn $user_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\treturn 'None';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn 'None';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn 'None';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn $_SESSION['user_id'];\r\n\t\t}\r\n\t}", "public function get_logged_in_user_id()\n\t\t{\n\t\t\treturn $this->session->userdata('usr_id');\n\t\t}", "protected function get_user_id() {\n session_start();\n \n return session_id();\n }", "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 getCurrentUserId()\n\t{\n\t\treturn array_key_exists('user_id', $this->session->data) ? $this->session->data['user_id'] : 0;\n\t}", "function user_id() {\n isset($this->_user_id) || $this->_load_from_session();\n return $this->_user_id;\n }", "public function getUserId() {\n\t\treturn $this->Session->read('UserAuth.User.id');\n\t}", "function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }", "function get_user_id(){\n\t\t// get the current user details\n\t\t$cookie_id = $this->decrypt($_COOKIE['CakeCookie']['PDCAUSER']);\t\t\n\t\treturn $cookie_id;\n\t}", "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 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 }", "protected function getUserId() {}", "protected function getUserId() {}", "public function loggedInUserId()\n\t{\n\t\treturn auth()->id();\n\t}", "function get_current_user_id(){\n\t\t$sd=$this->session->all_userdata();\n\t\t$fa=$sd['flexi_auth'];\n\t\t//$this->firephp->log($fa);\n\t\t//$this->firephp->log($fa['user_id']);\n\t\t//$this->firephp->log(\"Current user= \".intval($fa['user_id']));\n\t\treturn $fa['user_id'];\n\t}", "public function getAuthUserId() {\n\t\treturn (!empty($this->authUserId)?$this->authUserId:Mage::getSingleton('admin/session')->getUser()->getId());\n\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}", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "public static function getLoggedUserId()\r\n {\r\n return self::getVariable(\"login\", \"user-id\");\r\n }", "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 }", "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 getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "abstract protected function getUserId() ;", "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 getLoginUserId(){\n $auth = Zend_Auth::getInstance();\n if($auth->hasIdentity())\n {\n return $loginUserId = $auth->getStorage()->read()->id;\n }\n }", "public function getUserId()\r\n \t{\r\n \treturn $this->_client->getUser();\r\n \t}", "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 }", "public function getAuthIdentifier() {\n return $this->id_user;\n }", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\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 getUserID() {\n\t\tif (is_numeric($this->user_id)) {\n\t\t\treturn $this->user_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }", "function get_user_id() {\n\tif (!empty($_SESSION['user_id'])) {\n\t\treturn (int) $_SESSION['user_id'];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getLoginUserId(){\n $auth = Zend_Auth::getInstance();\n if($auth->hasIdentity())\n {\n return $loginUserId = $auth->getStorage()->read()->id;\n }else{\n\t\t\treturn 1;\n\t\t}\n }", "public function getUserID () {\n return $this->id;\n }", "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 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 function getCurrentUserId()\n\t{\n\t\treturn get_current_user_id();\n\t}", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "function get_login_user_id()\n\t{\n\t\treturn $this->login_user_id;\n\t}", "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 function getUserID() {\n\t\treturn $this->_user_id;\n\t}", "function getAuthUserId() {\r\n global $app, $log;\r\n $email = $app->request->headers(\"PHP_AUTH_USER\");\r\n $password = $app->request->headers(\"PHP_AUTH_PW\");\r\n\r\n if ($email && $password) {\r\n $row = DB::queryFirstRow(\"SELECT * FROM users WHERE email=%s\", $email);\r\n if ($row && $row['password'] == $password) {\r\n return $row['ID'];\r\n }\r\n }\r\n\r\n $log->debug(\"BASIC authentication failed for user \" . $email . \" from \" . $_SERVER['REMOTE_ADDR']);\r\n $app->response->status(401);\r\n return FALSE;\r\n}", "public function getUserId()\n {\n return UsniAdaptor::app()->user->getId();\n }", "protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\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 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 }", "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 getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }", "protected static function getCurrentUserId()\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 static function resolveId()\n {\n return Auth::check() ? Auth::user()->getAuthIdentifier() : null;\n }", "public function get_current_user(){\n $username = $this->session->userdata['logged_in']['username'];\n return $user_id = $this->research_model->current_user($username);\n }", "public function getCustomUserId();", "public static function getUserId() {\n if(self::$_identity) {\n return self::$_identity->userid;\n }\n return null;\n }", "protected function userId()\n {\n return Auth::id();\n }", "public function getCurrentUser();", "public static function resolveId()\n\t{\n\t\treturn auth()->guard('api')->check() ? auth()->guard('api')->user()->getAuthIdentifier() : null;\n\t}", "public static function get_user_id(){\n return isset(\\Yii::$app->user->id)?\\Yii::$app->user->id:'';\n }", "public function getUserId(){\n \n if ($user = JWTAuth::parseToken()->authenticate()) {\n $userId = $user->id;\n return $userId;\n }\n }", "public static function getCurrentUser();", "protected static function getUserID()\r\n {\r\n $userID = \\CAT\\Helper\\Validate::sanitizePost('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = \\CAT\\Helper\\Validate::sanitizeGet('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = self::router()->getParam(-1);\r\n\r\n if(!$userID || !is_numeric($userID) || !\\CAT\\Helper\\Users::exists($userID))\r\n Base::printFatalError('Invalid data')\r\n . (self::$debug ? '(\\CAT\\Backend\\Users::getUserID())' : '');;\r\n\r\n return $userID;\r\n }", "function labdevs_get_user_current_id()\n{\n global $current_user;\n get_currentuserinfo();\n return $current_user->ID;\n}", "public function getAuthIdentifier()\n {\n return (string) $this->user['id'];\n }", "protected function getSimulatingUserId()\n {\n return session(static::SIMULATING_USER_PROFILE_ID);\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 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 getUserId()\n {\n return $this->authenticator->getUserId();\n }", "public static function userId()\r\n {\r\n return (new Session())->get(static::$userIdField);\r\n }", "Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "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 }", "public function get_user_id() {\n\t\treturn $this->user_id;\n\t}", "public function getUserId()\n {\n return (int) $this->_getVar('user_id');\n }", "public function getUserid()\n {\n return $this->userid;\n }", "public function getUser() {\n\t\t return $_SESSION['userId'] ?: false;\n\t\t}", "public function getId()\n {\n return $this->app['security']->getToken()->getUser()->getId();\n }", "public function identity()\r\n {\r\n\t\t$storage = $this->get_storage();\r\n\r\n if ($storage->is_empty()) {\r\n return null;\r\n }\r\n if( is_null(self::$login_user) ){\r\n $u = $storage->read();\r\n\t\t\tself::$login_user = Model_User::instance()->user($u['uid']);\r\n \r\n global $VIEW_AUTH_USERID;\r\n $VIEW_AUTH_USERID = idtourl(self::$login_user['uid']);\r\n }\r\n return self::$login_user; \r\n }", "public static function resolveId()\n {\n return auth()->check() ? auth()->user()->getAuthIdentifier() : null;\n }" ]
[ "0.77447987", "0.76460433", "0.7610773", "0.75964737", "0.7579676", "0.75359553", "0.7444018", "0.7426613", "0.74092907", "0.73609084", "0.7347981", "0.7335198", "0.7322457", "0.7310461", "0.7309113", "0.72842306", "0.7267181", "0.7253733", "0.724437", "0.724437", "0.7205777", "0.72029173", "0.7190647", "0.71827435", "0.7169017", "0.7169017", "0.7169017", "0.7169017", "0.7169017", "0.7169017", "0.7169017", "0.7169017", "0.7169017", "0.71456885", "0.71284544", "0.71251893", "0.71193933", "0.7113633", "0.7113633", "0.7113633", "0.71121", "0.71001923", "0.7090109", "0.70893854", "0.70879334", "0.7084491", "0.7073586", "0.70724916", "0.70718086", "0.70536816", "0.7047318", "0.7045269", "0.70445955", "0.70322764", "0.70253634", "0.7023801", "0.7021212", "0.70128906", "0.6995661", "0.69882715", "0.6983993", "0.69737786", "0.69701755", "0.6966374", "0.69630516", "0.6958568", "0.6956862", "0.69544756", "0.6945231", "0.69448227", "0.6929501", "0.69181746", "0.69148123", "0.6912912", "0.69052833", "0.68831897", "0.6875837", "0.6873011", "0.68705595", "0.6867938", "0.6867829", "0.68652916", "0.68621635", "0.6861098", "0.6860433", "0.6860433", "0.6860433", "0.6860043", "0.6855495", "0.6854523", "0.68504894", "0.6849877", "0.6841681", "0.68390846", "0.6838829", "0.68331623", "0.6829171", "0.68267596", "0.68158287", "0.6814877" ]
0.68194586
98
The subiterator for the current element.
public function getChildren() { return $this->current()->getIterator(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInnerIterator()\n\t{\n\t\treturn $this->iterator;\n\t}", "function current() {\n return $this->iterators->valid() ?\n $this->getInnerIterator()->current() : NULL;\n }", "public function current()\n {\n return current($this->_elements);\n }", "public function current()\r\n\t{\r\n\t\treturn $this->elements[$this->i];\r\n\t}", "public function current()\n {\n return current($this->iterator_data);\n }", "public function getIterator()\n {\n return $this->getValue();\n }", "public function current()\n {\n return $this->currentElement;\n }", "public function current()\n {\n return current($this->elements);\n }", "public function next()\n {\n return next($this->_elements);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this);\n }", "public function getIterator() {\n\t\treturn new \\ArrayIterator($this->children);\n\t}", "public function iterator()\n {\n return $this->getIterator();\n }", "public function current() {\n return $this->currentElem;\n }", "public function getIterator()\n {\n return $this->iterator();\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->fetch());\n\t}", "public function current()\n\t{\n\t\t$name = $this->_elementNames[$this->__position];\n\t\treturn $this->get($name);\n\t}", "public function current()\n {\n return $this->iterator->current();\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->elements(true));\n }", "public function getRecursiveIterator()\n {\n return new \\RecursiveIteratorIterator($this, \\RecursiveIteratorIterator::SELF_FIRST);\n }", "public function current() {\n return $this->iterator->current();\n }", "function getiterator() {\n\t\treturn new \\ArrayIterator($this->cast());\n\t}", "public function getIterator()\n {\n return $this->multi()->load();\n }", "abstract public function getIterator();", "public function getIterator()\n {\n return $this->iterator;\n }", "public function current()\r\n {\r\n return $this->_filter->filter(parent::current());\r\n }", "public /*mixed*/ function current()\n\t{\n\t\treturn $this;\n\t}", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->array);\n\t}", "function getIterator() {\r\n\t\treturn new \\ArrayIterator($this->data);\r\n\t}", "public function iterator();", "public function current() {\n $element = current($this->elements);\n return $element;\n }", "public function getIterator()\n {\n return new ArrayIterator($this->_elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function iterator() {\n return new SimpleIterator(array_keys($this->elements));\n }", "public function current()\r\n {\r\n return current($this->children);\r\n }", "public function current()\n {\n return $this->elements[$this->position];\n }", "public /*Traversable*/ function getIterator()\n\t{\n\t\treturn new ArrayIterator($this->_data);\n\t}", "public function getIterator()\n\t{\n\t\treturn new ArrayIterator($this->items);\n\t}", "public function current()\n {\n if (null !== $this->subIterator && $this->subIterator->valid()) {\n $facetSet = $this->subIterator->current();\n $this->subIterator->next();\n } elseif (null !== $this->subIterator && !$this->subIterator->valid()) {\n $this->subIterator = null;\n $facetSet = new FacetSet(\n $this->getCurrentFacet(),\n new ElasticsearchFacetSetAdaptingIterator(\n $this->getInnerIterator()->current()['buckets'] ?? [],\n $this->getCurrentCollator(),\n $this->getViewDisplayStrategy()\n )\n );\n } else {\n if ($this->getCurrentFacet() instanceof ArbitraryCompositeFacetInterface) {\n $this->subIterator = new CompositeFacetSetIterator(\n new FacetSet(\n $this->getCurrentFacet(),\n new ElasticsearchFacetSetAdaptingIterator(\n $this->getInnerIterator()->current()['buckets'] ?? [],\n $this->getCurrentCollator(),\n $this->getViewDisplayStrategy()\n )\n ),\n '::'\n );\n $this->subIterator->rewind();\n $facetSet = $this->subIterator->current();\n $this->subIterator->next();\n } else {\n $facetSet = new FacetSet(\n $this->getCurrentFacet(),\n new ElasticsearchFacetSetAdaptingIterator(\n $this->getInnerIterator()->current()['buckets'] ?? [],\n $this->getCurrentCollator(),\n $this->getViewDisplayStrategy()\n )\n );\n }\n }\n\n //there may be a configured decorator for this facet set\n $facetSetDecorator = $this->facetSetDecoratorProvider->getDecoratorForFacet($this->getCurrentFacet());\n\n if ($facetSetDecorator) {\n $facetSet = $facetSetDecorator->decorate($facetSet);\n }\n\n return $facetSet;\n }", "function getIterator()\n {\n return new \\ArrayIterator($this->items);\n }", "public function getIterator()\r\n {\r\n return new \\ArrayIterator($this->data);\r\n }", "public function iterateAllElements()\n {\n return $this->getIterator();\n }", "public function next()\n {\n $this->iteratorIndex++;\n return next($this->elements);\n }", "public function current() {\n $element = current($this->elements);\n\n return $element;\n }", "function next()\n\t{\n\t\treturn $this->iterator->next();\n\t}", "public function getIterator() {}", "public function getIterator() {}", "public function current() {\r\n return current($this->collection);\r\n }", "function current() \n {\n // TODO wrap this;\n return $this->offsetGet($this->position);\n }", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function current()\n\t{\n\t\treturn parent::current();\n\t}", "public function getIterator()\n\t{\n return new ArrayIterator($this->_tbody->getElements());\n\t}", "public function current() {\n\t\treturn $this;\n\t}", "function current()\n\t{\n\t\treturn $this->get($this->pos);\n\t}", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator()\n {\n return new \\ArrayIterator($this->_items);\n }", "public function current()\n {\n Psl\\invariant($this->valid(), 'The Iterator is invalid.');\n if (!contains_key($this->entries, $this->position)) {\n $this->progress();\n }\n\n return $this->entries[$this->position][1];\n }", "public function getIterator()\n {\n return new ArrayIterator($this->toArray());\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->_data);\n }", "public function current()\n {\n $this->_skipNextIteration = false;\n return current($this->_data);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->_array);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->__data);\n }", "public function iterator () {\n\t\t$ret = new \\Array_hx();\n\t\tBalancedTree::iteratorLoop($this->root, $ret);\n\t\treturn new ArrayIterator($ret);\n\t}", "function current() {\n $k = key($this->ids);\n if($k === NULL) return false;\n if(count($this->ids) == 1) return $this;\n if(!isset($this->_ich[$k])) $this->_ich[$k] = new self($this->doc, array($k=>$this->ids[$k]));\n return $this->_ich[$k];\n }", "#[\\ReturnTypeWillChange]\n public function current()\n {\n return $this->collection->offsetGet($this->key());\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->data);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->data);\n }", "public function iterator()\n {\n $i = new CollectionIterator($this);\n return $i;\n }", "function current() {\r\n return $this->list[$this->index];\r\n }", "public function getIterator()\n {\n return $this->collection->getIterator();\n }", "public function getIterator()\n {\n return $this->collection->getIterator();\n }", "#[\\ReturnTypeWillChange]\n public function current()\n {\n $this->_skipNextIteration = false;\n return current($this->_data);\n }", "public function current() {\n\t\treturn current($this->_aSet);\n\t}", "public function current()\n {\n $this->skipNextIteration = false;\n return current($this->data);\n }" ]
[ "0.7319314", "0.69021535", "0.6729331", "0.6703734", "0.66872245", "0.6658976", "0.661221", "0.6598169", "0.6536025", "0.65071386", "0.6471212", "0.64498174", "0.6432847", "0.6425203", "0.64233696", "0.6416126", "0.63889354", "0.638609", "0.6369682", "0.6358866", "0.6353915", "0.63393545", "0.6337416", "0.63294584", "0.6322851", "0.63144094", "0.6312459", "0.6301208", "0.6300194", "0.62912375", "0.6287115", "0.62771", "0.62771", "0.62771", "0.6271529", "0.62669325", "0.6257099", "0.621004", "0.620041", "0.61978537", "0.61932623", "0.61889535", "0.61877304", "0.61786866", "0.6178211", "0.6177731", "0.6168978", "0.6168978", "0.6157299", "0.6151737", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6150096", "0.6144205", "0.613725", "0.6136988", "0.6135547", "0.6135547", "0.6135547", "0.6135547", "0.6135547", "0.6135547", "0.6119718", "0.6114949", "0.61129516", "0.61115444", "0.61105007", "0.6096146", "0.6092227", "0.608058", "0.60773194", "0.60757697", "0.6073174", "0.6073174", "0.6068437", "0.6049459", "0.60494286", "0.60494286", "0.60475117", "0.60441947", "0.6043599" ]
0.6393728
16
Returns the count of elements.
public function count() { return iterator_count($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function count() : int {\n return count($this->elements);\n }", "public function count()\n {\n return count($this->elements);\n }", "public function count()\n {\n return count($this->elements);\n }", "public function count(): int\n {\n return \\count($this->elements);\n }", "public function count(): int\n {\n return count($this->elements);\n }", "public function count()\n {\n return count($this->_elements);\n }", "public function count() {\n\t\treturn sizeof($this->elements);\n\t}", "public function elementCount(): int {\n\t\treturn count($this->m_elements);\n\t}", "public function count() \r\n {\r\n return sizeof($this->elements);\r\n }", "public function size(): int\n {\n return count($this->elements);\n }", "public function size() {\n return count($this->elements);\n }", "public function count()\n\t{\n\t\treturn count($this->_elementNames);\n\t}", "public function count() {\n\t\treturn count($this->array);\n\t}", "public function length(): int {\n return count($this->elements);\n }", "public function count()\n {\n $this->setIteratorFilter(self::FLIST_NOCONTAINER | self::FLIST_UNSUB);\n return count(iterator_to_array($this));\n }", "public function count(): int\n {\n return count( $this->toArray() );\n }", "public function count()\n {\n return count($this->getIteratorArray());\n }", "public function count(): int {\n return count($this->toArray());\n }", "public function count(): int\n {\n // TODO: Implement count() method.\n return count($this->toArray());\n }", "public function countNodeArrayValue(): int\n {\n return count($this->nodeValue);\n }", "public function size() {\n return n(count($this->value()));\n }", "public function size() {\n return sizeof($this->_elements);\n }", "public function count()\n\t{\n\t\treturn count($this->items);\n\t}", "public function count()\n\t{\n\t\treturn count($this->items);\n\t}", "public function count() {\n\t\treturn $this->length();\n\t}", "public function count()\n\t{\n\t\treturn count( $this->items );\n\t}", "public function count()\n {\n return iterator_count($this->getIterator());\n }", "public function count()\r\n {\r\n return count($this->items);\r\n }", "public function count(): int\n {\n return iterator_count($this->items);\n }", "public function count() {\n\t\treturn count($this->data);\n\t}", "public function count()\n\t{\n\t\treturn count($this->list);\n\t}", "public function count() {\n\t\treturn count($this->getIterator());\n\t}", "public function count() {\n\t\treturn count($this->getData());\n\t}", "public function count()\n {\n return count($this->items);\n }", "public function count()\n {\n return count($this->items);\n }", "public function count()\n {\n return count($this->items);\n }", "public function count()\n {\n return count($this->items);\n }", "public function count()\n {\n return count($this->items);\n }", "public function count()\n {\n return count($this->items);\n }", "public function count()\n {\n return count($this->items);\n }", "public function count()\n {\n return count($this->items);\n }", "public function count() {\n return count($this->list);\n }", "function number_of_elements() {\n return count($this->page_object);\n }", "public function count ( )\n {\n return count($this->_values);\n }", "public function count()\n {\n $count = 0;\n foreach ($this->lists as $list) {\n $count += $list->count();\n }\n return $count;\n }", "public function count() {\n return count( $this->items );\n }", "public function count()\n {\n return count($this->list);\n }", "public function count()\n {\n return count($this->countable);\n }", "public function count()\r\n {\r\n return count($this->data);\r\n }", "public function count()\n {\n return sizeof($this->getData());\n }", "public function count() {\n\t\treturn count($this->values);\n\t}", "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 count() {\n\t\treturn count($this->_data);\n\t}", "public function count()\n {\n return count($this->_items);\n }", "public function count()\n {\n return $this->iterator->count();\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 return count( $this->list );\n }", "public function count(): int\n {\n if (is_array($this->data)) {\n return count($this->data);\n }\n if ($this->data instanceof Countable) {\n return $this->data->count();\n }\n $this->dataToArray();\n\n return count($this->data);\n }", "public function count()\n\t{\n\t\treturn count($this->values);\n\t}", "public function count(): int\n {\n return count($this->data);\n }", "public function count()\n {\n $this->buffer();\n\n // Armazena quantos registro possui o array\n $this->count = count($this->toArray());\n\n // Retorna para o primeiro elemento\n $this->rewind();\n\n // Retorna a quantidade de dados\n return $this->count;\n }", "public function count() {\n return count($this->_items);\n\n }", "public function count() {\r\n return count($this->data);\r\n }", "public function count()\n {\n return count($this->valueOf());\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 size()\n {\n return Iterators::size($this->iterator());\n }", "public function count()\n {\n return count($this->entries);\n }", "public function count()\n {\n return $this->size();\n }", "public function count() : int\n {\n return count($this->items);\n }", "public function count() : int\n {\n return count($this->items);\n }", "function count() {\n\t\treturn count($this->data);\n\t}", "public function count() {\n return count($this->_data);\n }", "public function count() : int\n {\n return count($this->entries);\n }", "public function count(): int\n\t{\n\t\treturn count($this->items);\n\t}", "public function count()\n {\n return count( $this->data );\n }", "public function count()\n\t{\n\t\treturn $this->getCount();\n\t}", "public function count() {\n return sizeof($this->data);\n }", "public function count() {\n return sizeof($this->data);\n }", "public function count() {\n return sizeof($this->data);\n }", "public function count(): int {\n return count($this->items);\n }", "public function count()\n {\n return $this->length();\n }", "public function count(){\n\t\treturn count($this->nodes);\n\t}", "public function count(): int\n {\n return count($this->items);\n }", "public function count(): int\n\t{\n\t\treturn count($this->all());\n\t}", "public /*int*/ function count()\n\t{\n\t\treturn count($this->_data);\n\t}", "public function count() {\r\n\t\treturn count($this->collection);\r\n\t}", "public function count()\r\n {\r\n return count($this->_values);\r\n }", "public function count()\n {\n return $this->length();\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 }", "final public function count(): int\n {\n return count($this->all());\n }", "public function count(): int\n {\n return $this->getIterator()->count();\n }", "function count()\r\n {\r\n return(count($this->items));\r\n }" ]
[ "0.90584177", "0.9020235", "0.9020235", "0.89895296", "0.89852047", "0.8975783", "0.8887698", "0.8722225", "0.87135655", "0.8409825", "0.839644", "0.83467364", "0.83004737", "0.8054714", "0.80531335", "0.8045846", "0.8032677", "0.7999395", "0.79883647", "0.79858315", "0.7949204", "0.7858059", "0.7856039", "0.7856039", "0.7846953", "0.7846407", "0.7844136", "0.78344244", "0.7834298", "0.7820926", "0.78092223", "0.7796493", "0.7787166", "0.778247", "0.778247", "0.778247", "0.778247", "0.778247", "0.778247", "0.778247", "0.778247", "0.7782027", "0.7781241", "0.77773535", "0.77709794", "0.776849", "0.77669275", "0.7766733", "0.77580374", "0.7756915", "0.7751452", "0.7746086", "0.7743597", "0.77404195", "0.77356964", "0.77337664", "0.77337664", "0.77337664", "0.77337664", "0.77337664", "0.77322966", "0.77311593", "0.77272254", "0.7723427", "0.7723368", "0.77227414", "0.77217394", "0.77173686", "0.77119684", "0.77119684", "0.77119684", "0.77119684", "0.77119684", "0.7711865", "0.7708405", "0.7701989", "0.76971287", "0.76971287", "0.7693775", "0.76931983", "0.76926893", "0.76897633", "0.76775575", "0.767615", "0.76726323", "0.76726323", "0.76726323", "0.7670266", "0.7660156", "0.76467425", "0.76444185", "0.7639972", "0.7635737", "0.7626762", "0.76227355", "0.7613301", "0.7605383", "0.7599054", "0.7598036", "0.7595891" ]
0.77335435
60
Generates the configuration tree builder.
public function getConfigTreeBuilder() { $tree = new TreeBuilder(); $tree->root('three_scale') ->children() ->scalarNode('provider_key')->defaultValue(false)->isRequired()->end() ->arrayNode('client') ->children() ->scalarNode('class')->end() ->end() ->end() ->end(); return $tree; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConfigTreeBuilder()\n {\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('chameleon_system_core');\n $root = $treeBuilder->getRootNode();\n $root->isRequired();\n\n $root\n ->children()\n ->scalarNode('vendor_dir')->end()\n ->scalarNode('redirectstrategy')\n ->defaultValue('registershutdown')\n ->end()\n ->scalarNode('query_modifier_order_by_class')->end()\n ->arrayNode('pdo')\n ->children()\n ->scalarNode('mysql_attr_init_command')->end()\n ->end()\n ->end()\n ->append($this->getCronjobConfig())\n ->append($this->getMailTargetTransformationServiceConfig())\n ->append($this->getMailerConfig())\n ->append($this->getGoogleMapsApiConfig())\n ->append($this->getBackendConfig())\n ->append($this->getModuleExecutionConfig())\n ->append($this->getResourceCollectionConfig())\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('exsyst_dynamic_class_generation');\n\n $rootNode\n ->children()\n ->scalarNode('cache_directory')->defaultValue('%kernel.cache_dir%/exsyst-clsgen')->end()\n ->scalarNode('temporary_directory')->defaultValue('%kernel.cache_dir%/exsyst-clsgen')->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('responsive_image');\n\n // Add basic configurations.\n $rootNode\n ->children()\n ->booleanNode('debug')\n ->defaultFalse()\n ->end()\n ->booleanNode('cache_bust')\n ->defaultFalse()\n ->end()\n ->variableNode('image_entity_class')\n ->defaultValue([])\n ->end()\n ->enumNode('image_driver')\n ->defaultValue('gd')\n ->values(['gd', 'imagick'])\n ->end()\n ->integerNode('image_compression')\n ->defaultValue(90)\n ->min(0)->max(100)\n ->end()\n ->scalarNode('image_directory')\n ->defaultValue('images')\n ->end()\n ->scalarNode('image_styles_directory')\n ->defaultValue('styles')\n ->end()\n ->arrayNode('breakpoints')\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('image_styles')\n ->prototype('array')\n ->children()\n ->integerNode('width')\n ->min(1)\n ->end()\n ->integerNode('height')\n ->min(1)\n ->end()\n ->enumNode('effect')\n ->defaultValue('scale')\n ->values(['scale', 'crop'])\n ->end()\n ->booleanNode('greyscale')\n ->defaultFalse()\n ->end()\n ->end()\n ->end()\n ->end()\n ->variableNode('picture_sets')->end()\n ->arrayNode('crop_focus_widget')\n ->children()\n ->booleanNode('include_js_css')\n ->defaultTrue()\n ->end()\n ->booleanNode('display_coordinates')\n ->defaultTrue()\n ->end()\n ->end()\n ->end()\n ->append($this->addAWSNode())\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('venice_app');\n\n $mappingNode = $rootNode->children()->arrayNode('entity_mapping')->useAttributeAsKey('name');\n $mappingNode->prototype('array')->children()\n ->scalarNode('entity')->isRequired()->end()\n ->arrayNode('map')->useAttributeAsKey('name')->prototype('scalar');\n\n $rootNode->children()\n ->arrayNode('forms_override')\n ->defaultValue([])\n ->useAttributeAsKey('venice_forms_override')\n ->prototype('scalar');\n\n $rootNode->children()\n ->arrayNode('entity_forms')\n ->defaultValue([])\n ->useAttributeAsKey('venice_entity_forms')\n ->prototype('scalar');\n\n $rootNode->children()\n ->arrayNode('entity_override')\n ->defaultValue([])\n ->useAttributeAsKey('venice_entity_override')\n ->prototype('scalar');\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('coffee_bike_dachser');\n\n $rootNode\n ->children()\n ->scalarNode('dachser_branch_number')->end()\n ->scalarNode('dachser_gln_number')->end()\n ->scalarNode('dachser_branch_number_full')->end()\n ->scalarNode('dachser_sftp_host')->end()\n ->scalarNode('dachser_sftp_port')->end()\n ->scalarNode('dachser_sftp_username')->end()\n ->scalarNode('dachser_sftp_password')->end()\n ->scalarNode('dachser_sftp_remote_in_path')->end()\n ->scalarNode('dachser_sftp_remote_out_path')->end()\n ->scalarNode('dachser_sftp_remote_in_save_path')->end()\n ->scalarNode('dachser_sftp_local_in_path')->end()\n ->scalarNode('dachser_sftp_local_out_path')->end()\n ->scalarNode('dachser_sftp_local_in_save_path')->end()\n ->scalarNode('dachser_sftp_local_in_tmp')->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n // to stick with strict snake_case to make sure it works.\n if (method_exists(TreeBuilder::class, 'getRootNode')) {\n $treeBuilder = new TreeBuilder('meteo_concept_h_captcha');\n $rootNode = $treeBuilder->getRootNode();\n } else {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('meteo_concept_h_captcha');\n }\n\n $rootNode\n ->children()\n ->arrayNode('hcaptcha')\n ->info(\"The configuration value of your hCaptcha account (visit https://dashboard.hcaptcha.com to find them).\")\n ->children()\n ->scalarNode('site_key')\n ->info(\"The site key for this website.\")\n ->defaultValue(null)\n ->end()\n ->scalarNode('secret')\n ->info(\"The secret used to authenticate requests to hCaptcha verification endpoint.\")\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n return new TreeBuilder();\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('graphql');\n\n //@formatter:off\n $rootNode\n ->children()\n ->arrayNode('schemas')\n ->requiresAtLeastOneElement()\n ->useAttributeAsKey('name')\n ->arrayPrototype()\n ->children()\n ->scalarNode('sdl')\n ->info('Path to the SDL graphql definition')\n ->end()\n ->scalarNode('route')\n ->defaultValue(self::DEFAULT_ROUTE)\n ->treatNullLike(self::DEFAULT_ROUTE)\n ->end()\n ->arrayNode('resolvers')\n ->useAttributeAsKey('type')\n ->isRequired()\n ->requiresAtLeastOneElement()\n ->beforeNormalization()\n ->always(function($resolvers){\n return $this->normalizeResolvers($resolvers);\n })\n ->end()\n ->prototype('scalar')->end()\n ->validate()\n ->always(function($resolvers){\n $this->validateResolvers($resolvers);\n return $resolvers;\n })\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n //@formatter:on\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n if (Kernel::VERSION_ID >= 40300) {\n $treeBuilder = new TreeBuilder('sfcod_email_engine');\n $rootNode = $treeBuilder->getRootNode();\n } else {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('sfcod_email_engine');\n }\n\n $this->addMainSender($rootNode);\n $this->addSendersSection($rootNode);\n $this->addTemplatesSection($rootNode);\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n\t{\n\t\t$treeBuilder = new TreeBuilder();\n\t\t$rootNode = $treeBuilder->root('core');\n\t\t$rootNode\n\t\t\t->children()\n\t\t\t\t->booleanNode('require_dev_dependencies')->defaultValue(false)->end()\n\t\t\t\t->arrayNode('debug')\n\t\t\t\t\t->addDefaultsIfNotSet()\n\t\t\t\t\t->children()\n\t\t\t\t\t\t->booleanNode('exceptions')->defaultValue(false)->end()\n\t\t\t\t\t->end()\n\t\t\t\t->end()\n\t\t\t\t->arrayNode('twig')\n\t\t\t\t\t->addDefaultsIfNotSet()\n\t\t\t\t\t->children()\n\t\t\t\t\t\t->booleanNode('debug')->defaultValue(null)->end()\n\t\t\t\t\t\t->booleanNode('auto_reload')->defaultValue(null)->end()\n\t\t\t\t\t\t->booleanNode('enable_debug_extension')->defaultValue(false)->end()\n\t\t\t\t\t->end()\n\t\t\t\t->end()\n\t\t\t->end()\n\t\t;\n\t\treturn $treeBuilder;\n\t}", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $treeBuilder->root('e_xpansion_core')\n ->children()\n ->arrayNode('parameters')\n ->children()\n ->arrayNode('core_chat_color_codes')\n ->useAttributeAsKey('name')\n ->prototype('scalar')\n ->end()\n ->end()\n ->arrayNode('core_chat_glyph_icons')\n ->useAttributeAsKey('name')\n ->prototype('scalar')\n ->end()\n ->end()\n ->end()\n ->end()\n ->end();\n return $treeBuilder;\n }", "abstract public function generateConfiguration();", "public function getConfigTreeBuilder()\n\t{\n\t\t$treeBuilder = new TreeBuilder();\n\t\t$rootNode = $treeBuilder->root('highlight');\n\n\t\t$rootNode\n\t\t\t->children()\n\t\t\t\t\t->arrayNode('providers')\n\t\t\t\t\t\t ->performNoDeepMerging()\n\t\t\t\t\t\t //->addDefaultsIfNotSet()\n\t\t\t\t\t\t ->prototype('scalar')->end()\n\t\t\t\t\t\t ->defaultValue(array('geshi','pygment','highlight'))\n\t\t\t\t\t->end()\n\t\t\t->end();\n\t\t\t\t\t\t\n\t\t$this->addGlobalSection($rootNode);\n\t\t$this->addGeshiSection($rootNode);\n\t\t$this->addHighlightSection($rootNode);\n\t\t$this->addPygmentSection($rootNode);\n\t\t$this->addHttpAppspotSection($rootNode);\n\t\t$this->addHttpHilitemeSection($rootNode);\n\t\t\n\t\treturn $treeBuilder;\n\t}", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n\n $rootNode = $treeBuilder->root('myowncode_turbosms');\n $rootNode\n ->children()\n ->scalarNode('login')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('password')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('sender')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('debug')\n ->defaultFalse()\n ->end()\n ->scalarNode('save_to_db')\n ->defaultTrue()\n ->end()\n ->scalarNode('wsdl')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('vars');\n\n $rootNode\n\t\t\t\t->addDefaultsIfNotSet()\n ->children()\n\t\t\t\t\t->scalarNode('language')->isRequired()->cannotBeEmpty()\n\t\t\t\t\t->end()\n\t\t\t\t\t->scalarNode('source')->isRequired()->cannotBeEmpty()\n\t\t\t\t\t->end()\n\t\t\t\t\t->scalarNode('provider')->defaultValue('pygment')\n\t\t\t\t\t->end()\n ->end();\n\n return $treeBuilder; \n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('deploy');\n $rootNode\n ->children()\n ->append($this->getTargetsNode())\n ->end()\n ;\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n\n $treeBuilder = new TreeBuilder();\n\n $keePassConfig = $treeBuilder->root('KeePass');\n\n $keePassConfig->children()\n ->append($this->addKeePassNode())\n ->scalarNode('cache_folder')\n ->defaultValue('@data_folder@/cache')\n ->end()\n ->scalarNode('data_folder')\n ->defaultValue('%HOME%/.KeePassCli')\n ->end()\n ->scalarNode('app_folder')\n ->defaultValue(realpath(sprintf('%s/../../',dirname(__FILE__))))\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $root = $treeBuilder->root('light_saml_sp');\n\n $root\n ->children()\n ->arrayNode('username_mapper')\n ->defaultValue([\n ClaimTypes::EMAIL_ADDRESS,\n ClaimTypes::ADFS_1_EMAIL,\n ClaimTypes::COMMON_NAME,\n ClaimTypes::WINDOWS_ACCOUNT_NAME,\n 'urn:oid:0.9.2342.19200300.100.1.3',\n 'uid',\n 'urn:oid:1.3.6.1.4.1.5923.1.1.1.6',\n SimpleUsernameMapper::NAME_ID,\n ])\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $builder = new TreeBuilder();\n $root = $builder->root('phraseanet');\n $nodeBuilder = $root->children();\n\n $this->addSdkNode($nodeBuilder);\n\n return $builder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('deployer');\n\n $this->addServerSection($rootNode);\n $this->addFarmSection($rootNode);\n $this->addProjectSection($rootNode);\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n\t {\n\t $treeBuilder = new TreeBuilder();\n\t $rootNode = $treeBuilder->root('data_tables');\n\n\t $rootNode\n\t ->children()\n\t ->arrayNode('entities')\n\t\t\t\t\t\t->prototype('array')\n\t\t ->children()\n\t\t\t\t\t\t\t\t->scalarNode('name')\n\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->arrayNode('columns')\n\t\t\t\t\t\t\t\t\t->prototype('scalar')\n\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t->end()\n ->defaultValue([])\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->arrayNode('search_columns')\n\t\t\t\t\t\t\t\t\t->prototype('scalar')\n\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->scalarNode('post_process')\n ->defaultValue('')\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->scalarNode('user_limit')\n\t\t\t\t\t\t\t\t\t->defaultValue(0)\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->arrayNode('associative_columns')\n\t\t\t\t\t\t\t\t\t->prototype('array')\n\t\t\t\t\t\t\t\t\t\t->children()\n\t\t\t\t\t\t\t\t\t\t\t->scalarNode('field')\n\t\t\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->scalarNode('table')\n\t\t\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->scalarNode('target_field')\n\t\t\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->arrayNode('target_fields')\n\t\t\t\t\t\t\t\t\t\t\t\t->prototype('scalar')\n\t\t\t\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->scalarNode('join_type')\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->end()\n\t\t ->end()\n\t\t\t\t\t\t->end()\n\t ->end()\n\t ->end();\n\n\t return $treeBuilder;\n\t }", "public function getConfigTreeBuilder()\r\n {\r\n $treeBuilder = new TreeBuilder();\r\n $rootNode = $treeBuilder->root('kitano_payment_sips');\r\n\r\n $this->addConfigSection($rootNode);\r\n $this->addBinSection($rootNode);\r\n\r\n return $treeBuilder;\r\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $root = $treeBuilder->root('comindware_tracker');\n\n $this->addConnectionsNode($root);\n\n $root->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('doctrine_mongodb');\n $rootNode = $treeBuilder->getRootNode();\n\n $this->addDocumentManagersSection($rootNode);\n $this->addConnectionsSection($rootNode);\n $this->addResolveTargetDocumentsSection($rootNode);\n $this->addTypesSection($rootNode);\n\n $rootNode\n ->children()\n ->scalarNode('proxy_namespace')->defaultValue('MongoDBODMProxies')->end()\n ->scalarNode('proxy_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/mongodb/Proxies')->end()\n ->scalarNode('auto_generate_proxy_classes')\n ->defaultValue(ODMConfiguration::AUTOGENERATE_EVAL)\n ->beforeNormalization()\n ->always(static function ($v) {\n if ($v === false) {\n return ODMConfiguration::AUTOGENERATE_EVAL;\n }\n\n if ($v === true) {\n return ODMConfiguration::AUTOGENERATE_FILE_NOT_EXISTS;\n }\n\n return $v;\n })\n ->end()\n ->end()\n ->scalarNode('hydrator_namespace')->defaultValue('Hydrators')->end()\n ->scalarNode('hydrator_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/mongodb/Hydrators')->end()\n ->scalarNode('auto_generate_hydrator_classes')\n ->defaultValue(ODMConfiguration::AUTOGENERATE_NEVER)\n ->beforeNormalization()\n ->always(static function ($v) {\n if ($v === false) {\n return ODMConfiguration::AUTOGENERATE_NEVER;\n }\n\n if ($v === true) {\n return ODMConfiguration::AUTOGENERATE_ALWAYS;\n }\n\n return $v;\n })\n ->end()\n ->end()\n ->scalarNode('persistent_collection_namespace')->defaultValue('PersistentCollections')->end()\n ->scalarNode('persistent_collection_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/mongodb/PersistentCollections')->end()\n ->scalarNode('auto_generate_persistent_collection_classes')->defaultValue(ODMConfiguration::AUTOGENERATE_NEVER)->end()\n ->scalarNode('fixture_loader')\n ->defaultValue(ContainerAwareLoader::class)\n ->beforeNormalization()\n ->ifTrue(static function ($v) {\n return ! ($v === ContainerAwareLoader::class || in_array(ContainerAwareLoader::class, class_parents($v)));\n })\n ->then(static function ($v) {\n throw new LogicException(sprintf('The %s class is not a subclass of the ContainerAwareLoader', $v));\n })\n ->end()\n ->end()\n ->scalarNode('default_document_manager')->end()\n ->scalarNode('default_connection')->end()\n ->scalarNode('default_database')->defaultValue('default')->end()\n ->arrayNode('default_commit_options')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('j')->end()\n ->integerNode('timeout')->end()\n ->scalarNode('w')->end()\n ->integerNode('wtimeout')->end()\n // Deprecated options\n ->booleanNode('fsync')->info('Deprecated. Please use the \"j\" option instead.')->end()\n ->scalarNode('safe')->info('Deprecated. Please use the \"w\" option instead.')->end()\n ->end()\n ->end()\n ->arrayNode('controller_resolver')\n ->canBeDisabled()\n ->children()\n ->booleanNode('auto_mapping')\n ->defaultTrue()\n ->info('Set to false to disable using route placeholders as lookup criteria when the object id doesn\\'t match the argument name')\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $tb = new TreeBuilder('sherlockode_advanced_content');\n $root = $tb->getRootNode();\n\n $root\n ->children()\n ->arrayNode('entity_class')\n ->isRequired()\n ->children()\n ->scalarNode('content')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('content_version')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('scope')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page_type')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page_version')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page_meta')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page_meta_version')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->arrayNode('upload')\n ->children()\n ->scalarNode('image_directory')\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('uri_prefix')\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->arrayNode('init_command')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('directory')\n ->defaultValue('var/acb')\n ->end()\n ->scalarNode('files_directory')\n ->defaultValue('var/acb/files')\n ->end()\n ->booleanNode('allow_update')\n ->defaultFalse()\n ->end()\n ->end()\n ->end()\n ->arrayNode('templates')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('tools')\n ->cannotBeEmpty()\n ->defaultValue('@SherlockodeAdvancedContent/Tools/index.html.twig')\n ->end()\n ->end()\n ->end()\n ->arrayNode('default_options')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('wysiwyg_toolbar')\n ->defaultValue('basic')\n ->validate()\n ->ifNotInArray(['basic', 'standard', 'full'])\n ->thenInvalid('Invalid wysiwyg toolbar option %s')\n ->end()\n ->end()\n ->booleanNode('date_include_time')\n ->defaultTrue()\n ->end()\n ->end()\n ->end()\n ->arrayNode('field_types')\n ->useAttributeAsKey('code')\n ->arrayPrototype()\n ->children()\n ->booleanNode('enabled')->defaultTrue()->end()\n ->scalarNode('icon')->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('scopes')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('enabled')\n ->defaultFalse()\n ->end()\n ->end()\n ->end()\n ->arrayNode('mime_type_group')\n ->useAttributeAsKey('name')\n ->arrayPrototype()\n ->scalarPrototype()->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $tb;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n\n $root = $treeBuilder->root('security');\n\n $root\n ->children()\n ->arrayNode('firewalls')\n ->children()\n ->arrayNode('api_auth_by_key')\n ->children()\n ->arrayNode('keys')\n ->prototype('array')\n ->children()\n ->scalarNode('key')->end()\n ->scalarNode('name')->end()\n ->arrayNode('roles')\n ->defaultValue([])\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('dao_auth')\n ->children()\n ->arrayNode('users')\n ->useAttributeAsKey('username')\n ->prototype('array')\n ->children()\n ->scalarNode('username')->end()\n ->scalarNode('password')->end()\n ->arrayNode('roles')\n ->defaultValue([])\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $builder = new TreeBuilder();\n\n $builder->root('best_it_ct_customer_prices')\n ->children()\n ->scalarNode('cache_service_id')\n ->defaultValue('cache.app')\n ->info('Please provide the service id for your cache adapter.')\n ->end()\n ->scalarNode('client_service_id')\n ->info('Please provide the service id for your commercetools client.')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('query')\n ->defaultValue('container=\"{container}-{currencyValue}-{customerValue}\"')\n ->info('Please provide the search query. You can use placeholder in your query')\n ->end()\n ->scalarNode('container')\n ->defaultValue('customer-prices')\n ->info('Please provide the name of the custom object container where the prices are saved.')\n ->end()\n ->arrayNode('fields')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('article')\n ->defaultValue('article')\n ->info(\n 'Please provide the name of the custom object value field which saves the ' .\n 'article id.'\n )\n ->end()\n ->scalarNode('customer')\n ->defaultValue('customer')\n ->info(\n 'Please provide the name of the custom object value field which saves the ' .\n 'customer id.'\n )\n ->end()\n ->scalarNode('currency')\n ->defaultValue('currency')\n ->info(\n 'Please provide the name of the custom object value field which saves the ' .\n 'currency.'\n )\n ->end()\n ->scalarNode('prices')\n ->defaultValue('prices')\n ->info(\n 'Please provide the name of the custom object value field which saves the ' .\n 'money objects for the price.'\n )\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $builder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('zym_user', 'array');\n $rootNode\n ->children()\n ->scalarNode('db_driver')->cannotBeOverwritten()->isRequired()->cannotBeEmpty()->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('parameters');\n\n // google params\n $google = $rootNode->children()->arrayNode('google');\n if ($this->action !== 'listProjects') {\n $google->isRequired();\n }\n\n // billable bigquery project\n $param = $google->children()->scalarNode('projectId');\n if ($this->action !== 'listProjects') {\n $param->isRequired()->cannotBeEmpty();\n }\n\n // cloud storage bucket\n $param = $google->children()->scalarNode('storage');\n if ($this->action !== 'listBuckets' && $this->action !== 'listProjects') {\n $param->isRequired()->cannotBeEmpty();\n }\n\n // location\n $param = $google->children()->scalarNode('location');\n\n if ($this->action !== 'listBuckets' && $this->action !== 'listProjects') {\n $param->defaultValue('US');\n }\n\n // queries\n $rootNode\n ->children()\n ->arrayNode('queries')\n ->prototype('array')\n ->children()\n ->integerNode('id')\n ->min(0)\n ->end()\n ->scalarNode('name')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('query')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('outputTable')\n ->end()\n ->booleanNode('flattenResults')\n ->defaultValue(true)\n ->end()\n ->booleanNode('incremental')\n ->defaultValue(false)\n ->end()\n ->arrayNode('primaryKey')\n ->prototype('scalar')\n ->end()\n ->end()\n ->booleanNode('enabled')\n ->defaultValue(true)\n ->end()\n ->booleanNode('useLegacySql')\n ->defaultValue(true)\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n\n $rootNode->children()\n ->integerNode('retriesCount')\n ->min(0)\n ->defaultValue(5)\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n\n $root = $treeBuilder->root('git_deploy_project');\n $root->children()\n ->booleanNode('npm')->defaultNull()->end()\n ->booleanNode('composer')->defaultNull()->end()\n ->arrayNode('scripts')\n ->fixXmlConfig('script')\n ->arrayPrototype()\n ->beforeNormalization()\n ->ifString()->then(function($v) {\n return [\n 'command' => $v,\n ];\n })\n ->end()\n ->children()\n ->arrayNode('command')\n ->isRequired()\n ->beforeNormalization()\n ->castToArray()\n ->end()\n ->variablePrototype()->end()\n ->end() // Command\n ->arrayNode('trigger')\n ->beforeNormalization()\n ->castToArray()\n ->end()\n ->arrayPrototype()\n ->beforeNormalization()\n ->castToArray()\n ->ifString()->then(function($v) {\n return [\n 'path' => $v,\n ];\n })\n ->end()\n ->children()\n ->variableNode('path')->isRequired()->end()\n ->variableNode('trigger')->end()\n ->booleanNode('exact')->defaultTrue()->end()\n ->end()\n ->end()\n ->end() // Trigger\n ->end()\n ->end() // Script Array Prototype\n ->end() // Scripts Array Node\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('piedweb_conversation');\n $treeBuilder\n ->getRootNode()\n ->children()\n ->scalarNode('entity_message')->defaultValue('PiedWeb\\ConversationBundle\\Entity\\Message')->end()\n ->scalarNode('notification_emailTo')->defaultNull()->end()\n ->scalarNode('notification_interval')\n ->defaultValue('P12H')\n ->info(\"DateInterval's format\")\n ->end()\n ->arrayNode('form')\n ->end()\n ->scalarNode('form_message')\n ->defaultValue('PiedWeb\\ConversationBundle\\Form\\MessageForm')\n ->end()\n ->scalarNode('form_ms-message')\n ->defaultValue('PiedWeb\\ConversationBundle\\Form\\MultiStepMessageForm')\n ->end()\n ->scalarNode('form_newsletter')\n ->defaultValue('PiedWeb\\ConversationBundle\\Form\\NewsletterForm')\n ->end()\n ->scalarNode('possible_origins')->defaultNull()->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('dtc_grid');\n\n $rootNode\n ->children()\n ->arrayNode('jq_grid')\n ->children()\n ->arrayNode('css')\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('js')\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->scalarNode('purl')\n ->defaultValue('https://cdnjs.cloudflare.com/ajax/libs/purl/2.3.1/purl.min.js')\n ->end()\n ->arrayNode('jquery')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('url')\n ->defaultValue('https://code.jquery.com/jquery-3.3.1.min.js')\n ->end()\n ->scalarNode('integrity')\n ->defaultValue('sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=')\n ->end()\n ->scalarNode('crossorigin')\n ->defaultValue('anonymous')\n ->end()\n ->end()\n ->end()\n ->arrayNode('datatables')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('class')->defaultNull()->end()\n ->arrayNode('css')\n ->prototype('scalar')->end()\n ->defaultValue(['https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap.min.css'])\n ->end()\n ->arrayNode('js')\n ->prototype('scalar')->end()\n ->defaultValue(['https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js',\n 'https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap.min.js', ])\n ->end()\n ->end()\n ->end()\n ->arrayNode('theme')\n ->addDefaultsIfNotSet()\n ->children()\n ->arrayNode('css')\n ->prototype('scalar')->end()\n ->defaultValue(['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'])\n ->end()\n ->arrayNode('js')\n ->prototype('scalar')->end()\n ->defaultValue(['https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'])\n ->end()\n ->end()\n ->end()\n ->scalarNode('page_div_style')->defaultValue('margin: 10px')->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $node = $treeBuilder->root('px_cron_request');\n $node\n ->children()\n ->scalarNode('encryption_key')->isRequired()->end()\n ->arrayNode('cronjobs')\n ->prototype('array')\n ->children()\n ->scalarNode('job')->isRequired()->end()\n ->scalarNode('name')->isRequired()->end()\n ->booleanNode('symfonyCommand')->defaultValue(false)->end()\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('rompetomp_inertia');\n $treeBuilder->getRootNode()\n ->children()\n ->scalarNode('root_view')->defaultValue('app.html.twig')->end()\n ->arrayNode('ssr')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('enabled')->defaultFalse()->end()\n ->scalarNode('url')->defaultValue('')->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $mergeConfig = $this->shouldMergeConfig();\n $treeType = 'variable';\n\n if ($mergeConfig) {\n $treeType = 'array';\n }\n\n // Most recent versions of TreeBuilder have a constructor\n if (\\method_exists(TreeBuilder::class, '__construct')) {\n $treeBuilder = new TreeBuilder('aws', $treeType);\n } else { // which is not the case for older versions\n $treeBuilder = new TreeBuilder;\n $treeBuilder->root('aws', $treeType);\n }\n\n // If not AWS_MERGE_CONFIG, return empty, variable TreeBuilder\n if (!$mergeConfig) {\n return $treeBuilder;\n }\n\n if (method_exists($treeBuilder, 'getRootNode')) {\n $rootNode = $treeBuilder->getRootNode();\n } else {\n $rootNode = $treeBuilder->root('aws', $treeType);\n }\n\n // Define TreeBuilder to allow config validation and merging\n $rootNode\n ->ignoreExtraKeys(false)\n ->children()\n ->variableNode('credentials')->end()\n ->variableNode('debug')->end()\n ->variableNode('stats')->end()\n ->scalarNode('endpoint')->end()\n ->variableNode('endpoint_discovery')->end()\n ->arrayNode('http')\n ->children()\n ->floatNode('connect_timeout')->end()\n ->booleanNode('debug')->end()\n ->booleanNode('decode_content')->end()\n ->integerNode('delay')->end()\n ->variableNode('expect')->end()\n ->variableNode('proxy')->end()\n ->scalarNode('sink')->end()\n ->booleanNode('synchronous')->end()\n ->booleanNode('stream')->end()\n ->floatNode('timeout')->end()\n ->scalarNode('verify')->end()\n ->end()\n ->end()\n ->scalarNode('profile')->end()\n ->scalarNode('region')->end()\n ->integerNode('retries')->end()\n ->scalarNode('scheme')->end()\n ->scalarNode('service')->end()\n ->scalarNode('signature_version')->end()\n ->variableNode('ua_append')->end()\n ->variableNode('validate')->end()\n ->scalarNode('version')->end()\n ->end()\n ;\n\n //Setup config trees for each of the services\n foreach (array_column(Aws\\manifest(), 'namespace') as $awsService) {\n $rootNode\n ->children()\n ->arrayNode($awsService)\n ->ignoreExtraKeys(false)\n ->children()\n ->variableNode('credentials')->end()\n ->variableNode('debug')->end()\n ->variableNode('stats')->end()\n ->scalarNode('endpoint')->end()\n ->variableNode('endpoint_discovery')->end()\n ->arrayNode('http')\n ->children()\n ->floatNode('connect_timeout')->end()\n ->booleanNode('debug')->end()\n ->booleanNode('decode_content')->end()\n ->integerNode('delay')->end()\n ->variableNode('expect')->end()\n ->variableNode('proxy')->end()\n ->scalarNode('sink')->end()\n ->booleanNode('synchronous')->end()\n ->booleanNode('stream')->end()\n ->floatNode('timeout')->end()\n ->scalarNode('verify')->end()\n ->end()\n ->end()\n ->scalarNode('profile')->end()\n ->scalarNode('region')->end()\n ->integerNode('retries')->end()\n ->scalarNode('scheme')->end()\n ->scalarNode('service')->end()\n ->scalarNode('signature_version')->end()\n ->variableNode('ua_append')->end()\n ->variableNode('validate')->end()\n ->scalarNode('version')->end()\n ->end()\n ->end()\n ->end()\n ;\n }\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('kunstmaan_admin');\n\n $rootNode\n ->fixXmlConfig('admin_locale')\n ->fixXmlConfig('menu_item')\n ->children()\n ->scalarNode('admin_password')->end()\n ->scalarNode('dashboard_route')->end()\n ->arrayNode('admin_locales')\n ->defaultValue(array('en'))\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('session_security')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('ip_check')->defaultFalse()->end()\n ->booleanNode('user_agent_check')->defaultFalse()->end()\n ->end()\n ->end()\n ->scalarNode('default_admin_locale')->cannotBeEmpty()->defaultValue('en')->end()\n ->booleanNode('enable_console_exception_listener')->defaultTrue()->end()\n ->arrayNode('menu_items')\n ->defaultValue([])\n ->useAttributeAsKey('route', false)\n ->prototype('array')\n ->children()\n ->scalarNode('route')->isRequired()->end()\n ->scalarNode('label')->isRequired()->end()\n ->scalarNode('role')->defaultNull()->end()\n ->arrayNode('params')->defaultValue([])->prototype('scalar')->end()->end()\n ->scalarNode('parent')->defaultValue('KunstmaanAdminBundle_modules')->end()\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('etrias_cqrs');\n\n // Keep compatibility with symfony/config < 4.2\n if (!method_exists($treeBuilder, 'getRootNode')) {\n $rootNode = $treeBuilder->root('etrias_cqrs');\n } else {\n $rootNode = $treeBuilder->getRootNode();\n }\n\n $rootNode\n ->isRequired()\n ->children()\n ->arrayNode('cache')\n ->children()\n ->scalarNode('items_adapter')\n ->isRequired()\n ->info('service to store items (Symfony\\Component\\Cache\\Adapter\\AdapterInterface)')\n ->end()\n ->scalarNode('tags_adapter')\n ->isRequired()\n ->info('service to store tags (Symfony\\Component\\Cache\\Adapter\\AdapterInterface)')\n ->end()\n ->scalarNode('encoder')\n ->defaultValue('serialize')\n ->isRequired()\n ->info('service to store tags (Symfony\\Component\\Cache\\Adapter\\AdapterInterface)')\n ->end()\n ->arrayNode('default')\n ->isRequired()\n ->children()\n ->integerNode('expires_after')\n ->defaultValue(0)\n ->info('TTL in seconds')\n ->end()\n ->scalarNode('expires_at')\n ->defaultNull()\n ->info('A datetime string format')\n ->end()\n ->scalarNode('name_strategy')\n ->defaultValue(ReflectionStrategy::class)\n ->end()\n ->scalarNode('name_xpr')->defaultNull()->end()\n ->arrayNode('tags')\n ->prototype('scalar')->end()\n ->info('Expression format (services and security is available)')\n ->end()\n ->end()\n ->end()\n ->arrayNode('commands')\n ->useAttributeAsKey('command')\n ->arrayPrototype()\n ->children()\n ->integerNode('expires_after')\n ->defaultValue(0)\n ->info('TTL in seconds')\n ->end()\n ->scalarNode('expires_at')\n ->defaultNull()\n ->info('A datetime string format')\n ->end()\n ->scalarNode('name_strategy')\n ->defaultValue(ReflectionStrategy::class)\n ->end()\n ->scalarNode('name_xpr')->defaultNull()->end()\n ->arrayNode('tags')\n ->scalarPrototype()\n ->info('Expression format (services and security is available)')\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n if (\\method_exists(TreeBuilder::class, 'getRootNode')) {\n $treeBuilder = new TreeBuilder('data_grid');\n $rootNode = $treeBuilder->getRootNode();\n } else {\n // BC layer for symfony/config 4.1 and older\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('data_grid');\n }\n $rootNode\n ->children()\n ->arrayNode('instances')\n ->normalizeKeys(false)\n ->useAttributeAsKey('name')\n ->arrayPrototype()\n ->children()\n ->scalarNode('template')->defaultValue('@DataGrid/grid.blocks.html.twig')->end()\n ->scalarNode('no_data_message')->defaultValue('No data found')->end()\n ->booleanNode('pagination_enabled')->defaultValue(true)->end()\n ->integerNode('pagination_limit')->defaultValue(10)->end()\n ->scalarNode('translation_domain')->defaultNull()->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('system_socket');\n\n $rootNode\n ->children()\n ->scalarNode('queue_name')\n ->cannotBeEmpty()\n ->defaultValue('erp_to_socket_appeal')\n ->end()\n ->end()\n ;\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\r\n {\r\n $treeBuilder = new TreeBuilder();\r\n $rootNode = $treeBuilder->root('app_language');\r\n\r\n $this->addLanguageSection($rootNode);\r\n\r\n return $treeBuilder;\r\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $this->root = $treeBuilder->root(\"rms_push_notifications\");\n\n $this->addAndroid();\n $this->addiOS();\n $this->addMac();\n $this->addBlackberry();\n $this->addWindowsphone();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $builder = new TreeBuilder('rs_di_extra', 'array');\n $builder\n ->getRootNode()\n ->children()\n ->arrayNode('locations')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('all_bundles')->defaultFalse()->end()\n ->arrayNode('bundles')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('disallow_bundles')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('directories')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('exclude_directories')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('exclude_files')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n return $builder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder('knp_gaufrette');\n if (method_exists($treeBuilder, 'getRootNode')) {\n $rootNode = $treeBuilder->getRootNode();\n } else {\n // BC for symfony/config < 4.2\n $rootNode = $treeBuilder->root('knp_gaufrette');\n }\n\n $rootNode\n ->ignoreExtraKeys()\n ->fixXmlConfig('factory', 'factories')\n ->children()\n ->arrayNode('factories')\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder();\n $treeBuilder->root('s_redbull_api_doc')\n ->children()\n ->arrayNode('documentation')\n ->children()\n ->arrayNode('info')\n ->children()\n ->scalarNode('title')->end()\n ->scalarNode('description')->end()\n ->scalarNode('termsOfService')->end()\n ->arrayNode('contact')\n ->children()\n ->scalarNode('name')->end()\n ->scalarNode('url')->end()\n ->scalarNode('email')->end()\n ->end()\n ->end()\n ->arrayNode('license')\n ->children()\n ->scalarNode('name')->end()\n ->scalarNode('url')->end()\n ->end()\n ->end()\n ->scalarNode('version')->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('qcharts_frontend');\n\n // Here you should define the parameters that are allowed to\n // configure your bundle. See the documentation linked above for\n // more information on that topic.\n\n $defaultValue = [\n 'fos_user_ui'=>false\n ];\n\n $rootNode\n ->treatNullLike($defaultValue)\n ->children()\n ->scalarNode('fos_user_ui')\n ->defaultValue(false)\n ->info(\"boolean value, true if you're using FOSUserBundle and wish to use QCharts User's UI\")\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('shopping_feature_flag');\n\n $rootNode\n ->children()\n ->arrayNode('providers')\n ->children()\n ->arrayNode('cookie')\n ->children()\n ->arrayNode('values')\n ->useAttributeAsKey('featureFlag')\n ->arrayPrototype()\n ->isRequired()\n ->beforeNormalization()->castToArray()->end()\n ->scalarPrototype()\n ->beforeNormalization()->always(function($value) { return (string) $value; })->end()\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('userAgent')\n ->children()\n ->arrayNode('values')\n ->useAttributeAsKey('featureFlag')\n ->arrayPrototype()\n ->isRequired()\n ->beforeNormalization()->castToArray()->end()\n ->scalarPrototype()\n ->beforeNormalization()->always(function($value) { return (string) $value; })->end()\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $treeBuilder->root('dtl_distance_time')\n ->children()\n ->scalarNode('normalized_distance_unit')\n ->defaultValue('m')\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n if(method_exists(TreeBuilder::class, '__construct'))\n {\n $treeBuilder = new TreeBuilder('ns_flash');\n $rootNode = $treeBuilder->getRootNode();\n }\n /**\n * Included for backward-compatibility with SF3\n */\n else\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('ns_flash');\n }\n\n $rootNode\n ->children()\n ->scalarNode('template')->defaultValue('@NSFlash/Messages/index.html.twig')->cannotBeEmpty()->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTree()\n {\n $tb = new TreeBuilder();\n $root = $tb->root('vich_geographical');\n \n $root\n ->children()\n ->arrayNode('orm')\n ->useAttributeAsKey('id')\n ->prototype('array')\n ->performNoDeepMerging()\n ->children()\n ->scalarNode('enabled')->defaultTrue()->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('twig')\n ->performNoDeepMerging()\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('enabled')->defaultFalse()->end()\n ->end()\n ->end()\n ->arrayNode('class')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('query_service')\n ->cannotBeEmpty()\n ->defaultValue('Vich\\\\GeographicalBundle\\\\QueryService\\\\GoogleQueryService')\n ->end()\n ->scalarNode('map_renderer')\n ->cannotBeEmpty()\n ->defaultValue('Vich\\\\GeographicalBundle\\\\Map\\\\Renderer\\\\GoogleMapRenderer')\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n \n return $tb->buildTree();\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('resque');\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\r\n {\r\n $treeBuilder = new TreeBuilder();\r\n $rootNode = $treeBuilder->root('jt_api');\r\n\r\n // Here you should define the parameters that are allowed to\r\n // configure your bundle. See the documentation linked above for\r\n // more information on that topic.\r\n\r\n return $treeBuilder;\r\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('d4m_ebay');\n\n $rootNode\n ->children()\n ->scalarNode('session_token')->defaultValue('')->end()\n ->scalarNode('session_mode')->defaultValue('sandbox')->end()\n ->arrayNode('session_credentials')\n ->children()\n ->scalarNode('name')->end()\n ->scalarNode('appId')->end()\n ->scalarNode('devId')->end()\n ->scalarNode('certId')->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "private function generateConfig()\n {\n if ('' == $this->config->getName()) {\n throw new \\InvalidArgumentException('No module name given');\n }\n $target = sprintf(\n '%s/app/code/%s/%s/%s/etc/config.xml',\n $this->config->getPath(),\n $this->config->getCodePool(),\n $this->config->getNamespace(),\n $this->config->getName() \n );\n \n $this->renderFile($this->skeletonDir, 'config.xml', $target, array(\n 'config' => $this->config,\n ));\n \n \n $target = sprintf(\n '%s/app/etc/modules/%s_%s.xml',\n $this->config->getPath(),\n $this->config->getNamespace(),\n $this->config->getName() \n );\n \n $this->renderFile($this->skeletonDir, 'Module.xml', $target, array(\n 'config' => $this->config,\n )); \n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('symfony_open_tracing');\n /** @var ArrayNodeDefinition $rootNode */\n $rootNode = $treeBuilder->getRootNode();\n\n // Basic Sentry configuration\n $rootNode\n ->children()\n ->scalarNode('service_name')->end()\n ->scalarNode('enabled')->defaultTrue()->end()\n ->arrayNode('tracer_config')\n ->children()\n ->arrayNode('sampler')\n ->children()\n ->scalarNode('type')->defaultValue('const')->end()\n ->scalarNode('param')->defaultTrue()->end()\n ->end()\n ->end()\n ->arrayNode('local_agent')\n ->children()\n ->scalarNode('reporting_host')->defaultNull()->end()\n ->scalarNode('reporting_port')->defaultNull()->end()\n ->end()\n ->end()\n ->scalarNode('logging')->defaultTrue()->end()\n ->scalarNode('trace_id_header')->defaultNull()->end()\n ->scalarNode('baggage_header_prefix')->defaultNull()->end()\n ->scalarNode('debug_id_header_key')->defaultNull()->end()\n ->end()\n ->end()\n ->arrayNode('http_listener_skipped_routes')\n ->beforeNormalization()->castToArray()->end()\n ->prototype('scalar')->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('rabbitmq_persist');\n\n $rootNode->children()\n ->scalarNode('host')\n ->defaultValue('localhost')\n ->end()\n ->scalarNode('port')\n ->defaultValue('5672')\n ->end()\n ->scalarNode('user')\n ->defaultValue('guest')\n ->end()\n ->scalarNode('password')\n ->defaultValue('guest')\n ->end()\n ->scalarNode('vhost')\n ->defaultValue('/')\n ->end()\n ->booleanNode('insist')\n ->defaultFalse()\n ->end()\n ->scalarNode('login_method')\n ->defaultValue('AMQPLAIN')\n ->end()\n ->scalarNode('login_response')\n ->defaultValue(null)\n ->end()\n ->scalarNode('locale')\n ->defaultValue('en_US')\n ->end()\n ->floatNode('connection_timeout')\n ->defaultValue(3)\n ->end()\n ->floatNode('read_write_timeout')\n ->defaultValue(3)\n ->end()\n ->scalarNode('exchange')\n ->defaultValue('analytics')\n ->end()\n ->scalarNode('routingKey')\n ->defaultValue('actions')\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('doctrine_fixtures');\n\n $rootNode\n ->children()\n ->arrayNode('exclude_from_purge')\n ->info('Table names to be excluded from purge.')\n ->prototype('scalar')->end()\n ->defaultValue([])\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $tb = new TreeBuilder('security');\n $rootNode = $tb->getRootNode();\n\n $rootNode\n ->children()\n ->scalarNode('access_denied_url')->defaultNull()->example('/foo/error403')->end()\n ->enumNode('session_fixation_strategy')\n ->values([SessionAuthenticationStrategy::NONE, SessionAuthenticationStrategy::MIGRATE, SessionAuthenticationStrategy::INVALIDATE])\n ->defaultValue(SessionAuthenticationStrategy::MIGRATE)\n ->end()\n ->booleanNode('hide_user_not_found')->defaultTrue()->end()\n ->booleanNode('erase_credentials')->defaultTrue()->end()\n ->booleanNode('enable_authenticator_manager')->setDeprecated('symfony/security-bundle', '6.2', 'The \"%node%\" option at \"%path%\" is deprecated.')->defaultTrue()->end()\n ->arrayNode('access_decision_manager')\n ->addDefaultsIfNotSet()\n ->children()\n ->enumNode('strategy')\n ->values($this->getAccessDecisionStrategies())\n ->end()\n ->scalarNode('service')->end()\n ->scalarNode('strategy_service')->end()\n ->booleanNode('allow_if_all_abstain')->defaultFalse()->end()\n ->booleanNode('allow_if_equal_granted_denied')->defaultTrue()->end()\n ->end()\n ->validate()\n ->ifTrue(fn ($v) => isset($v['strategy'], $v['service']))\n ->thenInvalid('\"strategy\" and \"service\" cannot be used together.')\n ->end()\n ->validate()\n ->ifTrue(fn ($v) => isset($v['strategy'], $v['strategy_service']))\n ->thenInvalid('\"strategy\" and \"strategy_service\" cannot be used together.')\n ->end()\n ->validate()\n ->ifTrue(fn ($v) => isset($v['service'], $v['strategy_service']))\n ->thenInvalid('\"service\" and \"strategy_service\" cannot be used together.')\n ->end()\n ->end()\n ->end()\n ;\n\n $this->addPasswordHashersSection($rootNode);\n $this->addProvidersSection($rootNode);\n $this->addFirewallsSection($rootNode, $this->factories);\n $this->addAccessControlSection($rootNode);\n $this->addRoleHierarchySection($rootNode);\n\n return $tb;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n return new TreeBuilder(\"password_validator\");\n }", "protected function generateBreezeConfig()\n {\n\n $genConfPath = $this->getGeneratorConfigPath();\n $this->infoMessage(\"Creating generator conf file in $genConfPath.\");\n\n $galaxy = $this->getContextVar(\"galaxy\");\n $planet = $this->getContextVar(\"planet\");\n $createFile = $this->getContextVar(\"createFile\");\n\n $prefixes = $this->getTablePrefixes();\n $mainPrefix = array_shift($prefixes);\n\n\n DeveloperWizardBreezeGeneratorHelper::spawnConfFile($genConfPath, [\n \"galaxyName\" => $galaxy,\n \"planetName\" => $planet,\n \"createFilePath\" => $createFile,\n \"prefix\" => $mainPrefix,\n \"otherPrefixes\" => $prefixes,\n ]);\n return null;\n }", "protected function buildTypolinkConfiguration() {}", "public function getConfigTree()\n {\n $treeBuilder = new TreeBuilder();\n $treeBuilder\n ->root('melnikov_poppler', 'array')\n ->children()\n ->scalarNode('pdfunite_path')\n ->defaultValue('/opt/poppler19/bin/pdfunite')\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder->buildTree();\n }", "protected function generateConfiguration()\n {\n if (!in_array($this->format, array('yml', 'xml', 'php'))) {\n return;\n }\n\n $target = sprintf(\n '%s/Resources/config/routing/%s.%s',\n $this->bundle->getPath(),\n strtolower(str_replace('\\\\', '_', $this->entity)),\n $this->format\n );\n\n $this->renderFile('rest/config/routing.'.$this->format.'.twig', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n ));\n }", "public function end(): ConfigTreeBuilder\n {\n return $this->tree;\n }", "public function describe()\n {\n # create new node builder\n $nodeBuilder = new NodeBuilder('weightSelectorBuilder',$this->eventDispatcher,$this->repo,$this->utilities,$this->generator,$this->locale,$this->database,$this->templateLoader);\n \n # bind this definition as the parent of nodebuilder\n $nodeBuilder->setParent($this);\n \n # return node builder to continue chain\n return $nodeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder();\n /** @var ArrayNodeDefinition $rootNode */\n $rootNode = $treeBuilder->root('symfony_apm_agent');\n\n $rootNode\n ->children()\n ->scalarNode('open_transaction_listener')\n ->defaultValue(OpenTransactionListener::class)\n ->end()\n ->scalarNode('close_transaction_listener')\n ->defaultValue(CloseTransactionListener::class)\n ->end()\n ->scalarNode('open_transaction_factory')\n ->defaultValue(OpenTransactionFactory::class)\n ->end()\n ->scalarNode('server_url')\n ->defaultValue('http://localhost:8200')\n ->end()\n ->end()\n ;\n\n $rootNode\n ->children()\n ->arrayNode('listener_priorities')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('request')->defaultValue(0)->end()\n ->scalarNode('terminate')->defaultValue(20)->end()\n ->end()\n ->end()\n ->end()\n ;\n\n\n return $treeBuilder;\n }", "protected function addConfigParameterNode()\n {\n \t$builder = new TreeBuilder();\n \t$node = $builder->root('config');\n \n \t$node\n \t\t->treatTrueLike(array('form' => array(\n \t\t\t'type' => \"ASF\\WebsiteBundle\\Form\\Type\\ConfigType\",\n \t\t\t'name' => 'website_config_type'\n \t\t)))\n \t\t->treatFalseLike(array('form' => array(\n \t\t\t'type' => \"ASF\\WebsiteBundle\\Form\\Type\\ConfigType\",\n \t\t\t'name' => 'website_config_type'\n \t\t)))\n \t\t->addDefaultsIfNotSet()\n \t\t->children()\n \t\t\t->arrayNode('form')\n \t\t\t\t->addDefaultsIfNotSet()\n \t\t\t\t->children()\n \t\t\t\t\t->scalarNode('type')\n \t\t\t\t\t\t->defaultValue('ASF\\WebsiteBundle\\Form\\Type\\ConfigType')\n \t\t\t\t\t->end()\n \t\t\t\t\t->scalarNode('name')\n \t\t\t\t\t\t->defaultValue('website_config_type')\n \t\t\t\t\t->end()\n \t\t\t\t\t->arrayNode('validation_groups')\n \t\t\t\t\t\t->prototype('scalar')->end()\n \t\t\t\t\t\t->defaultValue(array(\"Default\"))\n \t\t\t\t\t->end()\n \t\t\t\t->end()\n \t\t\t->end()\n \t\t->end()\n \t;\n \n \treturn $node;\n }", "public function testSetconfiguration() {\n\n\t\t$hashConfig = array(\n\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\t\t$objBuilder->setConfiguration($hashConfig);\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(1));\n\t\t$objBuilder->setChildById(1, 0);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this->array($arrayResult)\n\t\t\t->size->isEqualTo(2);\n\n\t\tforeach ($arrayResult as $hash) {\n\t\t\t$this->array($hash)\n\t\t\t\t->hasKey('custom_id')\n\t\t\t\t->hasKey('custom_left')\n\t\t\t\t->hasKey('custom_right');\n\t\t}\n\n\t\t/*\n\t\t * Same test, using __construct() to set the configuration\n\t\t */\n\n\t\t$hashConfig = array(\n\t\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder($hashConfig);\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(1));\n\t\t$objBuilder->setChildById(1, 0);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this->array($arrayResult)\n\t\t->size->isEqualTo(2);\n\n\t\tforeach ($arrayResult as $hash) {\n\t\t\t$this->array($hash)\n\t\t\t->hasKey('custom_id')\n\t\t\t->hasKey('custom_left')\n\t\t\t->hasKey('custom_right');\n\t\t}\n\t}", "public function generateConfigCommand()\n {\n $this->outputLine('Making the following config settings:');\n foreach ($this->configSettings as $key => $value) {\n $this->h5pFramework->setOption($key, $value);\n $this->outputLine(\"<b>$key:</b> $value\");\n }\n }", "public function configureBuilder();", "public function buildConfigurationSummary();", "protected function buildFsTree()\n {\n mkdir($this->config_path, 0755, true);\n mkdir($this->compiledViewsPath(), 0755, true);\n }", "private function generateConfig() {\n $config_json = array(\n 'version' => '1.0.0',\n 'name' => $this->gateway_name,\n 'description' => '',\n 'authors' => [],\n 'currencies' => ['USD'],\n 'signup_url' => 'https://google.com'\n );\n\n foreach($config_json as $key => $value) {\n if($key == 'authors' && isset($this->config['authors'])) {\n foreach($this->config[\"authors\"] as $config_author) {\n $config_entry = array(\n \"name\" => \"\",\n \"url\" => \"\"\n );\n \n if(isset($config_author['name'])) {\n $config_entry[\"name\"] = $config_author['name'];\n \n if(isset($config_author[\"url\"])) {\n $config_entry[\"url\"] = $config_author['url'];\n }\n $config_json[\"authors\"][] = $config_entry;\n }\n }\n }\n else {\n if(isset($this->config[$key])) {\n $config_json[$key] = $this->config[$key];\n }\n }\n }\n\n return json_encode($config_json);\n }", "public function configure(ArrayNodeDefinition $builder)\n {\n }", "public function configure(ArrayNodeDefinition $builder)\n {\n $builder\n ->children()\n ->scalarNode('screenshot_path')->end()\n ->arrayNode('json')\n ->children()\n ->scalarNode('filename')->defaultValue('report.json')->end()\n ->scalarNode('output_path')->defaultValue('build/tests')->end()\n ->scalarNode('profiler_path')->defaultValue('build/behat/profiler')->end()\n ->end()\n ->end()\n ->arrayNode('manual')\n ->children()\n ->scalarNode(\"filename\")->isRequired()->end()\n ->scalarNode(\"path\")->isRequired()->end()\n ->scalarNode(\"tagname\")->isRequired()->end()\n ->scalarNode(\"screenshot_path\")->isRequired()->end()\n ->end()\n ->end()\n ;\n }", "public function build() {\n $config = $this->getConfiguration();\n return [\n '#theme' => 'helloadvanced',\n '#text' => isset($config['text']) ? $config['text'] : NULL,\n '#person' => isset($config['person']) ? $config['person'] : NULL,\n '#session' => isset($config['session']) ? $config['session'] : NULL,\n ];\n }", "public function createConfig()\n\t{\n\t}", "protected function build()\n {\n $this->global_variables = (new GlobalVariablesGenerator)->generate();\n }", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "protected function configure() {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),\n // add your own options here\n ));\n\n $this->namespace = 'u';\n $this->name = 'build-all';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [export-orders|INFO] task does things.\nCall it with:\n\n [php symfony u:build-all|INFO]\nEOF;\n }", "public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }", "protected function builders() {\n return [\n DrupalCoreRecommendedBuilder::class,\n DrupalDevDependenciesBuilder::class,\n DrupalPinnedDevDependenciesBuilder::class,\n ];\n }", "protected function config_generate()\n\t{\n\t\t// Check if Database is supported by Sphinx\n\t\tif ($this->db->get_sql_layer() =='mysql' || $this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli')\n\t\t{\n\t\t\t$this->dbtype = 'mysql';\n\t\t}\n\t\telse if ($this->db->get_sql_layer() == 'postgres')\n\t\t{\n\t\t\t$this->dbtype = 'pgsql';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_WRONG_DATABASE');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if directory paths have been filled\n\t\tif (!$this->config['fulltext_sphinx_data_path'])\n\t\t{\n\t\t\t$this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_NO_CONFIG_DATA');\n\t\t\treturn false;\n\t\t}\n\n\t\tinclude($this->phpbb_root_path . 'config.' . $this->php_ext);\n\n\t\t/* Now that we're sure everything was entered correctly,\n\t\tgenerate a config for the index. We use a config value\n\t\tfulltext_sphinx_id for this, as it should be unique. */\n\t\t$config_object = new \\phpbb\\search\\sphinx\\config($this->config_file_data);\n\t\t$config_data = array(\n\t\t\t'source source_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('type',\t\t\t\t\t\t$this->dbtype . ' # mysql or pgsql'),\n\t\t\t\t// This config value sql_host needs to be changed incase sphinx and sql are on different servers\n\t\t\t\tarray('sql_host',\t\t\t\t\t$dbhost . ' # SQL server host sphinx connects to'),\n\t\t\t\tarray('sql_user',\t\t\t\t\t'[dbuser]'),\n\t\t\t\tarray('sql_pass',\t\t\t\t\t'[dbpassword]'),\n\t\t\t\tarray('sql_db',\t\t\t\t\t\t$dbname),\n\t\t\t\tarray('sql_port',\t\t\t\t\t$dbport . ' # optional, default is 3306 for mysql and 5432 for pgsql'),\n\t\t\t\tarray('sql_query_pre',\t\t\t\t'SET NAMES \\'utf8\\''),\n\t\t\t\tarray('sql_query_pre',\t\t\t\t'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = (SELECT MAX(post_id) FROM ' . POSTS_TABLE . ') WHERE counter_id = 1'),\n\t\t\t\tarray('sql_query_range',\t\t\t'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''),\n\t\t\t\tarray('sql_range_step',\t\t\t\t'5000'),\n\t\t\t\tarray('sql_query',\t\t\t\t\t'SELECT\n\t\t\t\t\t\tp.post_id AS id,\n\t\t\t\t\t\tp.forum_id,\n\t\t\t\t\t\tp.topic_id,\n\t\t\t\t\t\tp.poster_id,\n\t\t\t\t\t\tp.post_visibility,\n\t\t\t\t\t\tCASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,\n\t\t\t\t\t\tp.post_time,\n\t\t\t\t\t\tp.post_subject,\n\t\t\t\t\t\tp.post_subject as title,\n\t\t\t\t\t\tp.post_text as data,\n\t\t\t\t\t\tt.topic_last_post_time,\n\t\t\t\t\t\t0 as deleted\n\t\t\t\t\tFROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.topic_id = t.topic_id\n\t\t\t\t\t\tAND p.post_id >= $start AND p.post_id <= $end'),\n\t\t\t\tarray('sql_query_post',\t\t\t\t''),\n\t\t\t\tarray('sql_query_post_index',\t\t'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = $maxid WHERE counter_id = 1'),\n\t\t\t\tarray('sql_query_info',\t\t\t\t'SELECT * FROM ' . POSTS_TABLE . ' WHERE post_id = $id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'forum_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'topic_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'poster_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'post_visibility'),\n\t\t\t\tarray('sql_attr_bool',\t\t\t\t'topic_first_post'),\n\t\t\t\tarray('sql_attr_bool',\t\t\t\t'deleted'),\n\t\t\t\tarray('sql_attr_timestamp',\t\t\t'post_time'),\n\t\t\t\tarray('sql_attr_timestamp',\t\t\t'topic_last_post_time'),\n\t\t\t\tarray('sql_attr_string',\t\t\t'post_subject'),\n\t\t\t),\n\t\t\t'source source_phpbb_' . $this->id . '_delta : source_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('sql_query_pre',\t\t\t\t''),\n\t\t\t\tarray('sql_query_range',\t\t\t''),\n\t\t\t\tarray('sql_range_step',\t\t\t\t''),\n\t\t\t\tarray('sql_query',\t\t\t\t\t'SELECT\n\t\t\t\t\t\tp.post_id AS id,\n\t\t\t\t\t\tp.forum_id,\n\t\t\t\t\t\tp.topic_id,\n\t\t\t\t\t\tp.poster_id,\n\t\t\t\t\t\tp.post_visibility,\n\t\t\t\t\t\tCASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,\n\t\t\t\t\t\tp.post_time,\n\t\t\t\t\t\tp.post_subject,\n\t\t\t\t\t\tp.post_subject as title,\n\t\t\t\t\t\tp.post_text as data,\n\t\t\t\t\t\tt.topic_last_post_time,\n\t\t\t\t\t\t0 as deleted\n\t\t\t\t\tFROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.topic_id = t.topic_id\n\t\t\t\t\t\tAND p.post_id >= ( SELECT max_doc_id FROM ' . SPHINX_TABLE . ' WHERE counter_id=1 )'),\n\t\t\t),\n\t\t\t'index index_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('path',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_main'),\n\t\t\t\tarray('source',\t\t\t\t\t\t'source_phpbb_' . $this->id . '_main'),\n\t\t\t\tarray('docinfo',\t\t\t\t\t'extern'),\n\t\t\t\tarray('morphology',\t\t\t\t\t'none'),\n\t\t\t\tarray('stopwords',\t\t\t\t\t''),\n\t\t\t\tarray('min_word_len',\t\t\t\t'2'),\n\t\t\t\tarray('charset_type',\t\t\t\t'utf-8'),\n\t\t\t\tarray('charset_table',\t\t\t\t'U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF'),\n\t\t\t\tarray('min_prefix_len',\t\t\t\t'0'),\n\t\t\t\tarray('min_infix_len',\t\t\t\t'0'),\n\t\t\t),\n\t\t\t'index index_phpbb_' . $this->id . '_delta : index_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('path',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_delta'),\n\t\t\t\tarray('source',\t\t\t\t\t\t'source_phpbb_' . $this->id . '_delta'),\n\t\t\t),\n\t\t\t'indexer' => array(\n\t\t\t\tarray('mem_limit',\t\t\t\t\t$this->config['fulltext_sphinx_indexer_mem_limit'] . 'M'),\n\t\t\t),\n\t\t\t'searchd' => array(\n\t\t\t\tarray('compat_sphinxql_magics'\t,\t'0'),\n\t\t\t\tarray('listen'\t,\t\t\t\t\t($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost') . ':' . ($this->config['fulltext_sphinx_port'] ? $this->config['fulltext_sphinx_port'] : '9312')),\n\t\t\t\tarray('log',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'log/searchd.log'),\n\t\t\t\tarray('query_log',\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'log/sphinx-query.log'),\n\t\t\t\tarray('read_timeout',\t\t\t\t'5'),\n\t\t\t\tarray('max_children',\t\t\t\t'30'),\n\t\t\t\tarray('pid_file',\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'searchd.pid'),\n\t\t\t\tarray('max_matches',\t\t\t\t(string) SPHINX_MAX_MATCHES),\n\t\t\t\tarray('binlog_path',\t\t\t\t$this->config['fulltext_sphinx_data_path']),\n\t\t\t),\n\t\t);\n\n\t\t$non_unique = array('sql_query_pre' => true, 'sql_attr_uint' => true, 'sql_attr_timestamp' => true, 'sql_attr_str2ordinal' => true, 'sql_attr_bool' => true);\n\t\t$delete = array('sql_group_column' => true, 'sql_date_column' => true, 'sql_str2ordinal_column' => true);\n\t\tforeach ($config_data as $section_name => $section_data)\n\t\t{\n\t\t\t$section = $config_object->get_section_by_name($section_name);\n\t\t\tif (!$section)\n\t\t\t{\n\t\t\t\t$section = $config_object->add_section($section_name);\n\t\t\t}\n\n\t\t\tforeach ($delete as $key => $void)\n\t\t\t{\n\t\t\t\t$section->delete_variables_by_name($key);\n\t\t\t}\n\n\t\t\tforeach ($non_unique as $key => $void)\n\t\t\t{\n\t\t\t\t$section->delete_variables_by_name($key);\n\t\t\t}\n\n\t\t\tforeach ($section_data as $entry)\n\t\t\t{\n\t\t\t\t$key = $entry[0];\n\t\t\t\t$value = $entry[1];\n\n\t\t\t\tif (!isset($non_unique[$key]))\n\t\t\t\t{\n\t\t\t\t\t$variable = $section->get_variable_by_name($key);\n\t\t\t\t\tif (!$variable)\n\t\t\t\t\t{\n\t\t\t\t\t\t$variable = $section->create_variable($key, $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$variable->set_value($value);\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$variable = $section->create_variable($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->config_file_data = $config_object->get_data();\n\n\t\treturn true;\n\t}", "public function buildNodes() {\n\t\t// build pip nodes\n\t\t$this->buildPluginNodes();\n\t\t\n\t\t// remove package\n\t\t$this->buildPackageNode();\n\t}", "public function generateConfigCache()\n\t{\n\t\t// Generate the class/template laoder cache file\n\t\t$objCacheFile = new \\File('system/cache/config/autoload.php', true);\n\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strFile = 'system/modules/' . $strModule . '/config/autoload.php';\n\n\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t{\n\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t}\n\t\t}\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the module loader cache file\n\t\t$objCacheFile = new \\File('system/cache/config/modules.php', true);\n\t\t$objCacheFile->write(\"<?php\\n\\n\");\n\n\t\t$objCacheFile->append(sprintf(\"static::\\$active = %s;\\n\", var_export(\\ModuleLoader::getActive(), true)));\n\t\t$objCacheFile->append(sprintf(\"static::\\$disabled = %s;\", var_export(\\ModuleLoader::getDisabled(), true)));\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the config cache file\n\t\t$objCacheFile = new \\File('system/cache/config/config.php', true);\n\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strFile = 'system/modules/' . $strModule . '/config/config.php';\n\n\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t{\n\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t}\n\t\t}\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the page mapping array\n\t\t$arrMapper = array();\n\t\t$objPages = \\PageModel::findPublishedRootPages();\n\n\t\tif ($objPages !== null)\n\t\t{\n\t\t\twhile ($objPages->next())\n\t\t\t{\n\t\t\t\t$strBase = ($objPages->dns ?: '*');\n\n\t\t\t\tif ($objPages->fallback)\n\t\t\t\t{\n\t\t\t\t\t$arrMapper[$strBase . '/empty.fallback'] = $strBase . '/empty.' . $objPages->language;\n\t\t\t\t}\n\n\t\t\t\t$arrMapper[$strBase . '/empty.' . $objPages->language] = $strBase . '/empty.' . $objPages->language;\n\t\t\t}\n\t\t}\n\n\t\t// Generate the page mapper file\n\t\t$objCacheFile = new \\File('system/cache/config/mapping.php', true);\n\t\t$objCacheFile->write(sprintf(\"<?php\\n\\nreturn %s;\\n\", var_export($arrMapper, true)));\n\t\t$objCacheFile->close();\n\n\t\t// Add a log entry\n\t\t$this->log('Generated the config cache', __METHOD__, TL_CRON);\n\t}", "private function createConfiguration()\n {\n $this->createVrpayecommercePluginConfig();\n $this->Form();\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = 'project';\n $this->name = 'nestedset-categories';\n $this->briefDescription = 'reorganization of categories to NestedSet behavior';\n $this->detailedDescription = <<<EOF\nreorganization of categories to NestedSet behavior\n [php symfony project:nestedset-categories|INFO]\nEOF;\n }", "public function actionGenerateModuleConfig()\n {\n $detectedModules = $this->actionDetectModules();\n\n $modules = Module::model()->findAll(new CDbCriteria(array(\n 'order' => 'name',\n 'condition' => 'enabled = true',\n )));\n $config = array();\n foreach ($modules as $module) {\n if (!isset($detectedModules[$module->name])) continue;\n $config[$module->name] = array(\n 'class' => $detectedModules[$module->name]\n );\n }\n $str = \"<?php\\nreturn \" . var_export($config, true) . \"\\n?>\";\n file_put_contents(Yii::getPathOfAlias('runtime.cache') . '/modules.php', $str);\n }", "public function setAsBuilder() {\r\n\t\t$this->setFrontEnd(false);\r\n\t\t$this->RenderWhole = true;\r\n\t\t$this->setMenuTemplate(__DIR__ . '/myNavigationBuilder.latte');\r\n\t}", "protected function configure() {\n\n $this->xmlconfig = array(\n \"name\" => array(\"xpath\" => \"mads:authority/mads:name\", \"class_name\" => \"mads_name\"),\n\n \"permanent\" => array(\"xpath\" => \"mads:affiliation[mads:position = 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"current\" => array(\"xpath\" => \"mads:affiliation[mads:position != 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"netid\" => array(\"xpath\" => \"mads:identifier[@type='netid']\"),\n );\n }", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public static function builder();", "public function generateYmlConfiguration()\n {\n $this->setSource(new WmsSource());\n $wmsconf = new WmsInstanceConfiguration();\n $wmsconf->setType(strtolower($this->getType()));\n $wmsconf->setTitle($this->title);\n $wmsconf->setIsBaseSource($this->isBasesource());\n\n $options = new WmsInstanceConfigurationOptions();\n $options->setUrl($this->configuration[\"url\"])\n ->setProxy($this->proxy)\n ->setVisible($this->visible)\n ->setFormat($this->getFormat())\n ->setInfoformat($this->infoformat)\n ->setTransparency($this->transparency)\n ->setOpacity($this->opacity / 100)\n ->setTiled($this->tiled);\n\n if (isset($this->configuration[\"vendor\"])) {\n $options->setVendor($this->configuration[\"vendor\"]);\n }\n\n $wmsconf->setOptions($options);\n\n if (!key_exists(\"children\", $this->configuration)) {\n $num = 0;\n $rootlayer = new WmsInstanceLayer();\n $rootlayer->setTitle($this->title)\n ->setId($this->getId() . \"_\" . $num)\n ->setMinScale(!isset($this->configuration[\"minScale\"]) ? null : $this->configuration[\"minScale\"])\n ->setMaxScale(!isset($this->configuration[\"maxScale\"]) ? null : $this->configuration[\"maxScale\"])\n ->setSelected(!isset($this->configuration[\"visible\"]) ? false : $this->configuration[\"visible\"])\n ->setPriority($num)\n ->setWmslayersource(new WmsLayerSource())\n ->setWmsInstance($this);\n $rootlayer->setToggle(false);\n $rootlayer->setAllowtoggle(true);\n $this->addLayer($rootlayer);\n foreach ($this->configuration[\"layers\"] as $layerDef) {\n $num++;\n $layer = new WmsInstanceLayer();\n $layersource = new WmsLayerSource();\n $layersource->setName($layerDef[\"name\"]);\n if (isset($layerDef[\"legendurl\"])) {\n $style = new Style();\n $style->setName(null);\n $style->setTitle(null);\n $style->setAbstract(null);\n $legendUrl = new LegendUrl();\n $legendUrl->setWidth(null);\n $legendUrl->setHeight(null);\n $onlineResource = new OnlineResource();\n $onlineResource->setFormat(null);\n $onlineResource->setHref($layerDef[\"legendurl\"]);\n $legendUrl->setOnlineResource($onlineResource);\n $style->setLegendUrl($legendUrl);\n $layersource->addStyle($style);\n }\n $layer->setTitle($layerDef[\"title\"])\n ->setId($this->getId() . '-' . $num)\n ->setMinScale(!isset($layerDef[\"minScale\"]) ? null : $layerDef[\"minScale\"])\n ->setMaxScale(!isset($layerDef[\"maxScale\"]) ? null : $layerDef[\"maxScale\"])\n ->setSelected(!isset($layerDef[\"visible\"]) ? false : $layerDef[\"visible\"])\n ->setInfo(!isset($layerDef[\"queryable\"]) ? false : $layerDef[\"queryable\"])\n ->setParent($rootlayer)\n ->setWmslayersource($layersource)\n ->setWmsInstance($this);\n $layer->setAllowinfo($layer->getInfo() !== null && $layer->getInfo() ? true : false);\n $rootlayer->addSublayer($layer);\n $this->addLayer($layer);\n }\n $children = array($this->generateLayersConfiguration($rootlayer));\n $wmsconf->setChildren($children);\n } else {\n $wmsconf->setChildren($this->configuration[\"children\"]);\n }\n $this->configuration = $wmsconf->toArray();\n }", "public function getBuilderConfig()\n {\n return $this->builder_config;\n }", "private function getConfigNode() {\n// $jsonConfig = \\CloudConfig::get(\"platform/proxy_shequ\", \"test\");\n// $config = json_decode($jsonConfig, true);\n $array = \\Yosymfony\\Toml\\Toml::Parse(__DIR__ . '/../config.toml');\n\n foreach ($array as $key => $value) {\n if ($key == \"common\") {\n\n $ex = explode(\":\", $value['redis_host']);\n $this->redisHost = $ex[0];\n $this->redisPort = $ex[1];\n\n if (isset($value['redis_auth'])) {\n $this->redisAuth = $value['redis_auth'];\n }\n\n if (isset($value['slow_limit'])) {\n $this->slow_limit = (int) $value['slow_limit'];\n }\n\n if (isset($value['big_limit'])) {\n $this->big_limit = (int) $value['big_limit'];\n }\n\n $this->RECORD_QUERY = $value['record_query'];\n } else {//nodes\n// $node = $key;\n foreach ($value['db'] as $db) {\n $this->getEntry($db, $value);\n }\n }\n }\n if (isset($array['common']['include_path'])) {\n $this->getConfigChildNode($array['common']['include_path']);\n }\n }", "public function __construct(ConfigTreeBuilder $tree)\n {\n $this->tree = $tree;\n }", "public function configure(ArrayNodeDefinition $builder)\n {\n //nothing to configure\n }", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}" ]
[ "0.7528792", "0.73049206", "0.72124696", "0.70483494", "0.7025038", "0.7012615", "0.6973417", "0.6945826", "0.68797654", "0.68684536", "0.6863819", "0.6863366", "0.6855712", "0.68030804", "0.6794495", "0.67527676", "0.6741344", "0.67340124", "0.6716738", "0.6703568", "0.6695264", "0.6685213", "0.66738737", "0.6665576", "0.6662926", "0.66413313", "0.6622073", "0.6619318", "0.661917", "0.6602133", "0.65942323", "0.6584732", "0.6579865", "0.65638715", "0.6556946", "0.6550517", "0.6543995", "0.65393263", "0.6534072", "0.6527039", "0.6509024", "0.6498385", "0.64973235", "0.6476601", "0.6456036", "0.6441737", "0.6431634", "0.6409593", "0.63776225", "0.63725054", "0.63715833", "0.63686806", "0.6347057", "0.63229316", "0.6286224", "0.6248193", "0.6221619", "0.6162701", "0.6044448", "0.6021304", "0.6002354", "0.59442514", "0.5910506", "0.58427954", "0.58246934", "0.57586473", "0.5747243", "0.56986743", "0.5673062", "0.5544828", "0.5514116", "0.5504068", "0.5479603", "0.5436093", "0.54350764", "0.5400649", "0.5391456", "0.533675", "0.53363365", "0.5332481", "0.5299732", "0.52831197", "0.5257122", "0.52527046", "0.5236062", "0.5223496", "0.5200543", "0.5194696", "0.51867235", "0.5181132", "0.51662886", "0.51617247", "0.51517683", "0.5140701", "0.5138181", "0.5131318", "0.51117337", "0.51043975", "0.51043975", "0.51043975" ]
0.6653944
25
funcao construtor da classe
function cl_sau_triagemavulsa() { //classes dos rotulos dos campos $this->rotulo = new rotulo("sau_triagemavulsa"); $this->pagina_retorno = basename($GLOBALS["HTTP_SERVER_VARS"]["PHP_SELF"]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct() ;", "function _construct() {\n \t\n\t\t\n\t}", "function __construct (){\n\t\t}", "function _construct(){ }", "public function _construct()\n\t{\n\n\t}", "function __construct(){\n\n\t\t}", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "function __construct() {\n\t\t\t\n\t\t}", "function __construct() {}", "function __construct(){\n\t\t// nowt much...\n\t}", "function __construct(){}", "function __construct(){}", "function __construct(){}", "public function __construct (){}", "function __construct(){\n\t\t}", "function __construct()\n\t{\n\n\t}", "function __construct() {\n\n\t\t}", "function __construct(){\r\n\t\t}", "public function __construct() { \n\t\t\n\n\t\t}", "function __construct()\r\n\t{\r\n\t}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private final function __construct() {}", "private function __construct() { \n\t\t\n\n\t}", "function __construct()\n\t{\n\t\t# code...\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function __construct()\n\t{\n\t}", "function __construct()\n\t{\n\t}", "function __construct()\n\t{\n\t}", "private function __construct()\t{}", "public function __construct()\n\t{\n\t}", "final private function __construct(){\r\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t//\n\t\t}", "private function __construct(){\n\t\t }", "protected abstract function __construct();", "function __construct(){\n\n\t}", "public function __construct()\r\n\t\t{\r\n\t\t}", "public function __construct()\n\t{\n\t\n\t}", "public function __construct()\n\t{\n\t\n\t}", "function __construct(){\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function __construct()\n\t{}", "function __construct()\n\t{\n \n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\n\t}", "public function __construct()\n\t{\n\n\t}", "public function __construct()\n\t{\n\n\t}", "public function __construct(){\n\t\t//\n\t}", "public function __construct(){\n\t\t//\n\t}", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "private function __construct(){\n\t\n\t}", "function __construct() {\n\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "private function __construct( )\n {\n\t}", "public function __construct() {\n\n\t\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct()\r\n\t{\r\n\t}", "private function __construct(){\n \t\n }", "private function __construct() {\r\n\t\r\n\t}", "function __construct() {\r\n\t}", "function __construct() {\r\n\t}" ]
[ "0.82710814", "0.8201428", "0.8043516", "0.80062735", "0.796183", "0.7928873", "0.7894286", "0.78932434", "0.78932434", "0.78932434", "0.78932434", "0.78932434", "0.78932434", "0.7892753", "0.7887893", "0.788242", "0.78764445", "0.7872269", "0.78641057", "0.78625774", "0.78625774", "0.78625774", "0.78494614", "0.78404146", "0.782691", "0.7825362", "0.78223693", "0.7772932", "0.7767797", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77637684", "0.77618545", "0.7750897", "0.77469", "0.77464163", "0.7745494", "0.7745494", "0.7745494", "0.7743061", "0.7741989", "0.7735934", "0.7732405", "0.7731418", "0.77172667", "0.77101105", "0.77092403", "0.7702783", "0.7702783", "0.77001476", "0.76978403", "0.76866823", "0.76810014", "0.7678487", "0.7678487", "0.7678487", "0.7678487", "0.7678487", "0.7678487", "0.7678487", "0.7678487", "0.7678487", "0.7678487", "0.7661576", "0.7661576", "0.7661576", "0.7661339", "0.7661339", "0.7661082", "0.76529324", "0.76510185", "0.7649274", "0.7649274", "0.7649274", "0.7649274", "0.7649274", "0.76464516", "0.7643331", "0.76395047", "0.76395047", "0.76395047", "0.76395047", "0.76395047", "0.7639284", "0.7633727", "0.7633691", "0.7633691" ]
0.0
-1
funcao para atualizar campos
function atualizacampos($exclusao=false) { if($exclusao==false){ $this->s152_i_codigo = ($this->s152_i_codigo == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_codigo"]:$this->s152_i_codigo); $this->s152_i_cbosprofissional = ($this->s152_i_cbosprofissional == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_cbosprofissional"]:$this->s152_i_cbosprofissional); $this->s152_i_cgsund = ($this->s152_i_cgsund == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_cgsund"]:$this->s152_i_cgsund); $this->s152_i_login = ($this->s152_i_login == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_login"]:$this->s152_i_login); $this->s152_i_pressaosistolica = ($this->s152_i_pressaosistolica == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_pressaosistolica"]:$this->s152_i_pressaosistolica); $this->s152_i_pressaodiastolica = ($this->s152_i_pressaodiastolica == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_pressaodiastolica"]:$this->s152_i_pressaodiastolica); $this->s152_i_cintura = ($this->s152_i_cintura == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_cintura"]:$this->s152_i_cintura); $this->s152_n_peso = ($this->s152_n_peso == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_n_peso"]:$this->s152_n_peso); $this->s152_i_altura = ($this->s152_i_altura == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_altura"]:$this->s152_i_altura); $this->s152_i_glicemia = ($this->s152_i_glicemia == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_glicemia"]:$this->s152_i_glicemia); $this->s152_i_alimentacaoexameglicemia = ($this->s152_i_alimentacaoexameglicemia == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_alimentacaoexameglicemia"]:$this->s152_i_alimentacaoexameglicemia); if($this->s152_d_dataconsulta == ""){ $this->s152_d_dataconsulta_dia = ($this->s152_d_dataconsulta_dia == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_d_dataconsulta_dia"]:$this->s152_d_dataconsulta_dia); $this->s152_d_dataconsulta_mes = ($this->s152_d_dataconsulta_mes == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_d_dataconsulta_mes"]:$this->s152_d_dataconsulta_mes); $this->s152_d_dataconsulta_ano = ($this->s152_d_dataconsulta_ano == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_d_dataconsulta_ano"]:$this->s152_d_dataconsulta_ano); if($this->s152_d_dataconsulta_dia != ""){ $this->s152_d_dataconsulta = $this->s152_d_dataconsulta_ano."-".$this->s152_d_dataconsulta_mes."-".$this->s152_d_dataconsulta_dia; } } if($this->s152_d_datasistema == ""){ $this->s152_d_datasistema_dia = ($this->s152_d_datasistema_dia == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_d_datasistema_dia"]:$this->s152_d_datasistema_dia); $this->s152_d_datasistema_mes = ($this->s152_d_datasistema_mes == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_d_datasistema_mes"]:$this->s152_d_datasistema_mes); $this->s152_d_datasistema_ano = ($this->s152_d_datasistema_ano == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_d_datasistema_ano"]:$this->s152_d_datasistema_ano); if($this->s152_d_datasistema_dia != ""){ $this->s152_d_datasistema = $this->s152_d_datasistema_ano."-".$this->s152_d_datasistema_mes."-".$this->s152_d_datasistema_dia; } } $this->s152_c_horasistema = ($this->s152_c_horasistema == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_c_horasistema"]:$this->s152_c_horasistema); $this->s152_n_temperatura = ($this->s152_n_temperatura == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_n_temperatura"]:$this->s152_n_temperatura); $this->s152_evolucao = ($this->s152_evolucao == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_evolucao"]:$this->s152_evolucao); $this->s152_perimetrocefalico = ($this->s152_perimetrocefalico == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_perimetrocefalico"]:$this->s152_perimetrocefalico); $this->s152_frequenciarespiratoria = ($this->s152_frequenciarespiratoria == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_frequenciarespiratoria"]:$this->s152_frequenciarespiratoria); $this->s152_frequenciacardiaca = ($this->s152_frequenciacardiaca == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_frequenciacardiaca"]:$this->s152_frequenciacardiaca); if($this->s152_dum == ""){ $this->s152_dum_dia = ($this->s152_dum_dia == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_dum_dia"]:$this->s152_dum_dia); $this->s152_dum_mes = ($this->s152_dum_mes == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_dum_mes"]:$this->s152_dum_mes); $this->s152_dum_ano = ($this->s152_dum_ano == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_dum_ano"]:$this->s152_dum_ano); if($this->s152_dum_dia != ""){ $this->s152_dum = $this->s152_dum_ano."-".$this->s152_dum_mes."-".$this->s152_dum_dia; } } $this->s152_saturacao = ($this->s152_saturacao == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_saturacao"]:$this->s152_saturacao); $this->s152_subjetivo = ($this->s152_subjetivo == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_subjetivo"]:$this->s152_subjetivo); }else{ $this->s152_i_codigo = ($this->s152_i_codigo == ""?@$GLOBALS["HTTP_POST_VARS"]["s152_i_codigo"]:$this->s152_i_codigo); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _updatefields() {}", "function _set_editable_fields()\n\t{\n\t\tif (empty($this->fields))\n\t\t{\n\t\t\t// pull the fields dynamically from the database\n\t\t\t$this->db->cache_on();\n\t\t\t$this->fields = $this->db->list_fields($this->primary_table);\n\t\t\t$this->db->cache_off();\n\t\t}\n\t}", "private function camposObligatorios()\n {\n $this->setRequiredField(\"mascara\");\n $this->setRequiredField(\"etiqueta\");\n/*\n $this->setRequiredField(\"id_padre\");\n*/\n $this->setRequiredField(\"posicion\");\n $this->setRequiredField(\"visible\");\n $this->setRequiredField(\"nivel_acceso\");\n/*\n $this->setRequiredField(\"accion\");\n*/\n\n return;\n }", "public function actualizarCampos(){\n //---- eliminamos todos los registros\n $sql = \"DELETE FROM \". TABLE_EMPRESA .\"_campo WHERE uid_empresa = \". $this->getUID();\n if( !$this->db->query($sql) ){ return $this->db->lastErrorString(); }\n\n //---- asignamos los que se han indicado en el formulario\n $inserts = array();\n $asignados = isset($_REQUEST[\"elementos-asignados\"]) ? $_REQUEST[\"elementos-asignados\"] : [];\n foreach ($asignados as $idCampoAsignado) {\n $inserts[] = \"(\". $this->getUID() .\", \". $idCampoAsignado .\")\";\n }\n\n if (!count($inserts)) return true;\n\n $sql = \"INSERT INTO \". TABLE_EMPRESA .\"_campo ( uid_empresa, uid_campo ) VALUES \". implode(\",\", $inserts);\n if( !$this->db->query($sql) ){ return $this->db->lastErrorString(); }\n\n //----- si todo va bien\n return true;\n }", "protected abstract function setFields();", "function asignar_valores2(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->modelo=$_POST['modelo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t}", "private function resetInputFields(){\n $this->nom = '';\n $this->departements_id = '';\n $this->arrondissement_id = '';\n }", "function asignar_valores(){\n\t\t$this->tabla=$_POST['tabla'];\n\t\t$this->pertenece=$_POST['pertenece'];\n\t\t$this->asunto=$_POST['asunto'];\n\t\t$this->descripcion=$_POST['contenido'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->hora=$_POST['hora'];\n\t\t$this->fechamod=$_POST['fechamod'];\n\t}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_nom('');\n $this->setId_nivel('');\n $this->setId_asignatura('');\n $this->setId_situacion('');\n // la fecha debe estar antes del acta por si hay que usar la funcion inventarActa.\n $this->setF_acta('');\n $this->setActa('');\n $this->setDetalle('');\n $this->setPreceptor('');\n $this->setId_preceptor('');\n $this->setEpoca('');\n $this->setId_activ('');\n $this->setNota_num('');\n $this->setNota_max('');\n $this->setTipo_acta('');\n $this->setPrimary_key($aPK);\n }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }", "private function resetInputFields()\n {\n $this->name = '';\n $this->code = '';\n $this->agency_id = '';\n\n $this->phone = '';\n $this->fax = '';\n\n $this->email = '';\n $this->address = '';\n $this->country = '';\n }", "function set_field($field,$edit=\"\",$view=\"\")\r\n {\r\n $userID = session::get(\"user\");\r\n \r\n if ($userID)\r\n {\r\n if (!right::get_field($field))\r\n database::query(\"INSERT INTO system SET name='$field',edit='$edit',view='$view'\");\r\n else\r\n database::query(\"UPDATE system SET edit='$edit',view='$view' WHERE name='$field'\");\r\n } \r\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setNivel_stgr('');\n $this->setDesc_nivel('');\n $this->setDesc_breve('');\n $this->setOrden('');\n $this->setPrimary_key($aPK);\n }", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "function asignar_valores(){\n $this->nombre=$_POST['nombre'];\n $this->prioridad=$_POST['prioridad'];\n $this->etiqueta=$_POST['etiqueta'];\n $this->descripcion=$_POST['descripcion'];\n $this->claves=$_POST['claves'];\n $this->tipo=$_POST['tipo'];\n }", "function asignar_valores(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->cedula=$_POST['cedula'];\n\t\t$this->correo=$_POST['correo'];\n\t}", "private function resetInputFields(){\n $this->teacher_id = '';\n $this->lending_id = '';\n $this->note = '';\n $this->device_id = '';\n $this->org_id_1 = '';\n $this->org_id_2 = '';\n $this->lendingDate = '';\n $this->returnDate = '';\n }", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->etiqueta=$_POST['etiqueta'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->icono=$_POST['icono'];\n\t}", "private function setAutofillFields() {\n foreach (static::getFields() as $field_name => $field) {\n if ($field instanceof AutofillField) {\n $this->values[$field_name] = $field->fill();\n }\n }\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_item('');\n $this->setId_enc('');\n $this->setId_nom('');\n $this->setModo('');\n $this->setF_ini('');\n $this->setF_fin('');\n $this->setId_nom_new('');\n $this->setPrimary_key($aPK);\n }", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "public function atualizar()\n {\n //Executa o processo de validação\n $validacao = self::validar('update');\n\n //Verifica o status da validação do formulário\n //Se não houveram erros, insere no banco de dados\n //Caso contrário, informa ao usuário os erros de validação\n if($validacao)\n {\n //Obtem os dados do formulário preenchido\n $empresa = $this->input->post();\n\n //Obtem o id da empresa a ser atualizada\n $id = $empresa['id_empresa'];\n\n //Atualiza os dados da empresa a partir do seu id e retorna o status da operação\n $status = $this->EmpresasModel->atualizar($id, $empresa);\n\n //Checa o status da operação\n //Se bem sucedida, carrega a tela de visualizar a empresa \n //Caso contrário, informa ao usuário\n if(!$status){\n\t\t\t\t$this->session->set_flashdata('error', 'Não foi possível alterar as informações.');\n\t\t\t}else{\n //Consulta os dados da empresa que foi atualizada\n $resultado = $this->EmpresasModel->getById($id);\n $dados = array(\"empresaid\" => $resultado, \"success\" => 'Informações alteradas com sucesso.'); \n //Carrega a tela com os dados atualizados\n $this->load->view(\"Empresas/empresa\", $dados);\n\t\t\t}\n }\n else\n {\n\t\t\t$this->session->set_flashdata('error', validation_errors('<p>','</p>'));\n }\n //Carrega a página de alterar os dados da empresa com as informações atuais\n $dados['empresaid'] = $this->EmpresasModel->getById($id);\n $this->load->view(\"Empresas/altera\", $dados); \n }", "private function resetInputFields()\n {\n $this->agency_id = '';\n $this->state_id = '';\n $this->name = '';\n $this->logo = '';\n $this->email = '';\n $this->phone = '';\n $this->fax = '';\n $this->address = '';\n $this->facebook = '';\n $this->instagram = '';\n $this->youtube = '';\n $this->viber = '';\n $this->whatsapp = '';\n $this->url = '';\n }", "public function atualizar() {\n $query = '\n UPDATE tb_atividade \n set \n nome = :nome,\n qntd_part = :qntd_part,\n inscricao = :inscricao,\n valor = :valor,\n tipo = :tipo,\n carga_hr = :carga_hr,\n data_inicio = :data_inicio,\n data_fim = :data_fim\n WHERE\n id = :id\n ';\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id', $_GET['id_att']);\n $stmt->bindValue(':nome', $this->atividade->__get('nome'));\n $stmt->bindValue(':qntd_part', $this->atividade->__get('qntd_part'));\n $stmt->bindValue(':inscricao', $this->atividade->__get('inscricao'));\n $stmt->bindValue(':valor', $this->atividade->__get('valor'));\n $stmt->bindValue(':tipo', $this->atividade->__get('tipo'));\n $stmt->bindValue(':carga_hr', $this->atividade->__get('carga_hr'));\n $stmt->bindValue(':data_inicio', $this->atividade->__get('data_inicio'));\n $stmt->bindValue(':data_fim', $this->atividade->__get('data_fim'));\n\n return $stmt->execute();\n }", "public function testUpdateExtraFields(): void { }", "protected function setupUpdateOperation()\n {\n CRUD::setValidation(SettingRequest::class);\n\n $readonly = [];\n if (User::min('id') !== backpack_user()->id) {\n $readonly = ['readonly' => 'readonly'];\n }\n\n CRUD::field('key')->type('text')->label('ID key')->attributes($readonly);\n CRUD::field('name')->type('text')->label('Nom');\n CRUD::field('value')->type(CRUD::getCurrentEntry()->type)->label('Contenu');\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_activ('');\n $this->setId_asignatura('');\n $this->setId_nom('');\n $this->setId_nivel('');\n $this->setId_situacion('');\n $this->setPreceptor('');\n $this->setId_preceptor('');\n $this->setNota_num('');\n $this->setNota_max('');\n $this->setActa('');\n $this->setPrimary_key($aPK);\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_dl('');\n $this->setDl('');\n $this->setRegion('');\n $this->setNombre_dl('');\n $this->setGrupo_estudios('');\n $this->setRegion_stgr('');\n $this->setStatus('');\n $this->setPrimary_key($aPK);\n }", "private function resetInputFields(){\n $this->name = '';\n $this->content = '';\n $this->todo_id = '';\n }", "public function prepAttributesForSave()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\t$this->setAttribute($name, ModelHelper::packageAttributeValue($config, $value, true));\n\t\t}\n\n\t\t// Populate dateCreated and uid if this is a new record\n\t\tif ($this->isNewRecord())\n\t\t{\n\t\t\t$this->dateCreated = DateTimeHelper::currentTimeForDb();\n\t\t\t$this->uid = StringHelper::UUID();\n\t\t}\n\n\t\t// Update the dateUpdated\n\t\t$this->dateUpdated = DateTimeHelper::currentTimeForDb();\n\t}", "function evt__form_pase__modificacion($datos)\r\n\t{\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $datos['id_cargo']=$car['id_cargo'];\r\n \r\n \r\n //print_r($pase_nuevo);exit;\r\n if($this->dep('datos')->tabla('pase')->esta_cargada()){//es modificacion\r\n $pas=$this->dep('datos')->tabla('pase')->get();\r\n if($pas['tipo']<>$datos['tipo']){\r\n toba::notificacion()->agregar('no puede cambiar el tipo del pase', 'info'); \r\n }else{\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n }\r\n }else{//es alta de un pase nuevo\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n $pase_nuevo=$this->dep('datos')->tabla('pase')->get();\r\n $p['id_pase']=$pase_nuevo['id_pase'];\r\n $this->dep('datos')->tabla('pase')->cargar($p);//lo cargo para que se sigan viendo los datos en el formulario\r\n if($datos['tipo']=='T'){//si el pase es temporal\r\n //ingreso un cargo en la unidad destino\r\n //la ingresa con fecha de alta = desde\r\n $nuevo_cargo['id_persona']=$car['id_persona'];\r\n $nuevo_cargo['codc_carac']=$car['codc_carac'];\r\n $nuevo_cargo['codc_categ']=$car['codc_categ'];\r\n $nuevo_cargo['codc_agrup']=$car['codc_agrup'];\r\n $nuevo_cargo['chkstopliq']=$car['chkstopliq'];\r\n $nuevo_cargo['fec_alta']=$datos['desde'];\r\n $nuevo_cargo['pertenece_a']=$datos['destino'];\r\n $nuevo_cargo['generado_x_pase']=$pase_nuevo['id_pase']; \r\n $res=$this->controlador()->dep('datos')->tabla('cargo')->agregar_cargo($nuevo_cargo);\r\n if($res==1){\r\n toba::notificacion()->agregar('Se ha creado un nuevo cargo en el destino del pase', 'info');\r\n }\r\n \r\n }else{//pase definitivo entonces tengo que modificar la fecha del cargo en la unidad destino con la fecha de alta del definitivo\r\n $nuevafecha = strtotime ( '-1 day' , strtotime ( $datos['desde'] ) ) ;\r\n $nuevafecha = date ( 'Y-m-d' , $nuevafecha );\r\n //print_r($nuevafecha);exit;\r\n $salida=$this->controlador()->dep('datos')->tabla('cargo')->modificar_alta($datos['id_cargo'],$datos['destino'],$datos['desde']);\r\n //le coloca fecha de baja al cargo de la unidad origen\r\n $this->controlador()->dep('datos')->tabla('cargo')->finaliza_cargo($datos['id_cargo'],$nuevafecha);\r\n if($salida==1){\r\n toba::notificacion()->agregar('Se ha modificado la fecha del cargo generado a partir del pase temporal', 'info');\r\n }\r\n \r\n } \r\n }\r\n \r\n\t}", "function dbSetVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->set($f,$this->$f);\n }\n\n }", "public function beforeSave() {\n\t\t\t\t\t\t\tif ($this->isNewRecord) {\n\t\t\t\t\t\t\t\t\t\t$this->usuario=Yii::app()->user->name;\n\t\t\t\t\t\t\t\t\t\t$this->creadoel=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t\t\t $this->iduser=Yii::app()->user->id;\n\t\t\t\t\t\t\t\t\t\t$this->mes=substr($this->fechacontable,5,2);\n\t\t\t\t\t\t\t\t\t\t$this->ano=substr($this->fechacontable,0,4);\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn parent::beforeSave();\n\t\t\t\t}", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "protected function asignarCamposRelacionales() {\n foreach($this->campos as $nombre=>$campo) {\n if($campo->tipo!='relacional'||($campo->relacion!='1:1'&&$campo->relacion!='1:0')) continue;\n $columna=$campo->columna;\n if(is_object($this->consultaValores->$nombre)) {\n //Asignado como entidad u objeto anónimo\n $this->consultaValores->$columna=$this->consultaValores->$nombre->id;\n } elseif(is_array($this->consultaValores->$nombre)) {\n //Asignado como array\n $this->consultaValores->$columna=$this->consultaValores->$nombre['id'];\n }\n }\n }", "private function resetInputFields(){\n $this->title = '';\n $this->original_url = '';\n $this->platform_id = '';\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_situacion('');\n $this->setDescripcion('');\n $this->setSuperada('');\n $this->setBreve('');\n $this->setPrimary_key($aPK);\n }", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->valor_vehiculo=$_POST['valor_vehiculo'];\n\t\t$this->saldo=$_POST['saldo'];\n\t\t$this->valor_inicial=$_POST['valor_inicial'];\n\t\t$this->comision=$_POST['comision'];\n\t\t$this->plazo=$_POST['plazo'];\n\t\t$this->cuotas=$_POST['cuotas'];\n\t\t$this->total=$_POST['total'];\n\t}", "public function update($aluno){\n\t\t$campos = \"\";\n \n \n\t\t if(!empty($aluno->nome)) $campos .=' nome = ?,';\n\t\t if(!empty($aluno->endereco)) $campos .=' endereco = ?,';\n\t\t if(!empty($aluno->numero)) $campos .=' numero = ?,';\n\t\t if(!empty($aluno->bairro)) $campos .=' bairro = ?,';\n\t\t if(!empty($aluno->cidade)) $campos .=' cidade = ?,';\n\t\t if(!empty($aluno->nacionalidade)) $campos .=' nacionalidade = ?,';\n\t\t if(!empty($aluno->cep)) $campos .=' cep = ?,';\n\t\t if(!empty($aluno->uf)) $campos .=' uf = ?,';\n\t\t if(!empty($aluno->local)) $campos .=' local = ?,';\n\t\t if(!empty($aluno->complemento)) $campos .=' complemento = ?,';\n\t\t if(!empty($aluno->inep)) $campos .=' inep = ?,';\n\t\t if(!empty($aluno->ni)) $campos .=' nis = ?,';\n\t\t if(!empty($aluno->telefone)) $campos .=' telefone = ?,';\n\t\t if(!empty($aluno->celular)) $campos .=' celular = ?,';\n\t\t if(!empty($aluno->email)) $campos .=' email = ?,';\n\t\t if(!empty($aluno->peso)) $campos .=' peso = ?,';\n\t\t if(!empty($aluno->altura)) $campos .=' altura = ?,';\n\t\t if(!empty($aluno->raca)) $campos .=' raca = ?,';\n\t\t if(!empty($aluno->tipoDefic)) $campos .=' tipo_defic = ?,';\n\t\t if(!empty($aluno->tipoTranspEscolar)) $campos .=' tipo_transp_escolar = ?,';\n\t\t if(!empty($aluno->idEducCenso)) $campos .=' id_educ_censo = ?,';\n\t\t if(!empty($aluno->tipoUsoInternet)) $campos .=' tipo_uso_internet = ?,';\n\t\t if(!empty($aluno->sexo)) $campos .=' sexo = ?,';\n\t\t if(!empty($aluno->regNascimento)) $campos .=' reg_nascimento = ?,';\n\t\t if(!empty($aluno->regLivroNum)) $campos .=' reg_livro_num = ?,';\n\t\t if(!empty($aluno->regFolhaNum)) $campos .=' reg_folha_num = ?,';\n\t\t if(!empty($aluno->regComarca)) $campos .=' reg_comarca = ?,';\n\t\t if(!empty($aluno->rg)) $campos .=' rg = ?,';\n\t\t if(!empty($aluno->rgOrgao)) $campos .=' rg_orgao = ?,';\n\t\t if(!empty($aluno->rgDataExpedicao)) $campos .=' rg_data_expedicao = ?,';\n\t\t if(!empty($aluno->titulo)) $campos .=' titulo = ?,';\n\t\t if(!empty($aluno->tituloZona)) $campos .=' titulo_zona = ?,';\n\t\t if(!empty($aluno->tituloSecao)) $campos .=' titulo_secao = ?,';\n\t\t if(!empty($aluno->reservista)) $campos .=' reservista = ?,';\n\t\t if(!empty($aluno->reservistaSerie)) $campos .=' reservista_serie = ?,';\n\t\t if(!empty($aluno->reservistaNumero)) $campos .=' reservista_numero = ?,';\n\t\t if(!empty($aluno->reservistaCategNum)) $campos .=' reservista_categ_num = ?,';\n\t\t if(!empty($aluno->reservistaCsm)) $campos .=' reservista_csm = ?,';\n\t\t if(!empty($aluno->cartProf)) $campos .=' cart_prof = ?,';\n\t\t if(!empty($aluno->grupoSangue)) $campos .=' grupo_sangue = ?,';\n\t\t if(!empty($aluno->grupoSangueRh)) $campos .=' grupo_sangue_rh = ?,';\n\t\t if(!empty($aluno->grupoSangueAlergia)) $campos .=' grupo_sangue_alergia = ?,';\n\t\t if(!empty($aluno->grupoSangueDiabetico)) $campos .=' grupo_sangue_diabetico = ?,';\n\t\t if(!empty($aluno->outraDoenca)) $campos .=' outra_doenca = ?,';\n\t\t if(!empty($aluno->familiaComposta)) $campos .=' familia_composta = ?,';\n\t\t if(!empty($aluno->estadoCivil)) $campos .=' estado_civil = ?,';\n\t\t if(!empty($aluno->usaOculo)) $campos .=' usa_oculos = ?,';\n\t\t if(!empty($aluno->destro)) $campos .=' destro = ?,';\n\t\t if(!empty($aluno->convenio)) $campos .=' convenio = ?,';\n\t\t if(!empty($aluno->nomePai)) $campos .=' nome_pai = ?,';\n\t\t if(!empty($aluno->paiVivo)) $campos .=' pai_vivo = ?,';\n\t\t if(!empty($aluno->paiNacionalidade)) $campos .=' pai_nacionalidade = ?,';\n\t\t if(!empty($aluno->paiNaturalidade)) $campos .=' pai_naturalidade = ?,';\n\t\t if(!empty($aluno->paiNivEscolar)) $campos .=' pai_niv_escolar = ?,';\n\t\t if(!empty($aluno->paiReligiao)) $campos .=' pai_religiao = ?,';\n\t\t if(!empty($aluno->paiProfissao)) $campos .=' pai_profissao = ?,';\n\t\t if(!empty($aluno->paiEnderTrab)) $campos .=' pai_ender_trab = ?,';\n\t\t if(!empty($aluno->paiTelefone)) $campos .=' pai_telefone = ?,';\n\t\t if(!empty($aluno->paiEmail)) $campos .=' pai_email = ?,';\n\t\t if(!empty($aluno->paiTitulo)) $campos .=' pai_titulo = ?,';\n\t\t if(!empty($aluno->paiTituloZona)) $campos .=' pai_titulo_zona = ?,';\n\t\t if(!empty($aluno->paiTituloSecao)) $campos .=' pai_titulo_secao = ?,';\n\t\t if(!empty($aluno->nomeMae)) $campos .=' nome_mae = ?,';\n\t\t if(!empty($aluno->maeViva)) $campos .=' mae_viva = ?,';\n\t\t if(!empty($aluno->maeNacionalidade)) $campos .=' mae_nacionalidade = ?,';\n\t\t if(!empty($aluno->maeNaturalidade)) $campos .=' mae_naturalidade = ?,';\n\t\t if(!empty($aluno->maeNivEscolar)) $campos .=' mae_niv_escolar = ?,';\n\t\t if(!empty($aluno->maeReligiao)) $campos .=' mae_religiao = ?,';\n\t\t if(!empty($aluno->maeProfissao)) $campos .=' mae_profissao = ?,';\n\t\t if(!empty($aluno->maeEnderTrab)) $campos .=' mae_ender_trab = ?,';\n\t\t if(!empty($aluno->maeTelefone)) $campos .=' mae_telefone = ?,';\n\t\t if(!empty($aluno->maeEmail)) $campos .=' mae_email = ?,';\n\t\t if(!empty($aluno->maeTitulo)) $campos .=' mae_titulo = ?,';\n\t\t if(!empty($aluno->maeTituloZona)) $campos .=' mae_titulo_zona = ?,';\n\t\t if(!empty($aluno->maeTituloSecao)) $campos .=' mae_titulo_secao = ?,';\n\t\t if(!empty($aluno->maeNi)) $campos .=' mae_nis = ?,';\n\t\t if(!empty($aluno->paiNi)) $campos .=' pai_nis = ?,';\n\t\t if(!empty($aluno->nomeResponsavel)) $campos .=' nome_responsavel = ?,';\n\t\t if(!empty($aluno->parentescoResponsavel)) $campos .=' parentesco_responsavel = ?,';\n\t\t if(!empty($aluno->nacionalResponsavel)) $campos .=' nacional_responsavel = ?,';\n\t\t if(!empty($aluno->naturalResponsavel)) $campos .=' natural_responsavel = ?,';\n\t\t if(!empty($aluno->nivEscolarResponsavel)) $campos .=' niv_escolar_responsavel = ?,';\n\t\t if(!empty($aluno->religiaoResponsavel)) $campos .=' religiao_responsavel = ?,';\n\t\t if(!empty($aluno->profissaoResponsavel)) $campos .=' profissao_responsavel = ?,';\n\t\t if(!empty($aluno->enderTrabResponsavel)) $campos .=' ender_trab_responsavel = ?,';\n\t\t if(!empty($aluno->telefResponsavel)) $campos .=' telef_responsavel = ?,';\n\t\t if(!empty($aluno->emailResponsavel)) $campos .=' email_responsavel = ?,';\n\t\t if(!empty($aluno->tituloResponsavel)) $campos .=' titulo_responsavel = ?,';\n\t\t if(!empty($aluno->tituloZonaResponsavel)) $campos .=' titulo_zona_responsavel = ?,';\n\t\t if(!empty($aluno->tituloSecaoResponsavel)) $campos .=' titulo_secao_responsavel = ?,';\n\t\t if(!empty($aluno->descriTranspEscolar)) $campos .=' descri_transp_escolar = ?,';\n\t\t if(!empty($aluno->paiUf)) $campos .=' pai_uf = ?,';\n\t\t if(!empty($aluno->maeUf)) $campos .=' mae_uf = ?,';\n\t\t if(!empty($aluno->responsavelUf)) $campos .=' responsavel_uf = ?,';\n\t\t if(!empty($aluno->dataNascimento)) $campos .=' data_nascimento = ?,';\n\t\t if(!empty($aluno->ufRegComarca)) $campos .=' uf_reg_comarca = ?,';\n\t\t if(!empty($aluno->cpfAluno)) $campos .=' cpf_aluno = ?,';\n\t\t if(!empty($aluno->cpfPai)) $campos .=' cpf_pai = ?,';\n\t\t if(!empty($aluno->cpfMae)) $campos .=' cpf_mae = ?,';\n\t\t if(!empty($aluno->cpfResponsavel)) $campos .=' cpf_responsavel = ?,';\n\t\t if(!empty($aluno->codUf)) $campos .=' cod_uf = ?,';\n\t\t if(!empty($aluno->codCidade)) $campos .=' cod_cidade = ?,';\n\t\t if(!empty($aluno->codPai)) $campos .=' cod_pais = ?,';\n\t\t if(!empty($aluno->created)) $campos .=' created = ?,';\n\t\t if(!empty($aluno->status)) $campos .=' status = ?,';\n\t\t if(!empty($aluno->senha)) $campos .=' senha = ?,';\n\t\t if(!empty($aluno->foto)) $campos .=' foto = ?,';\n\t\t if(!empty($aluno->colaboraRendaFamiliar)) $campos .=' colabora_renda_familiar = ?,';\n\n \n $campos = substr($campos,0,-1);\n \n $sql = 'UPDATE aluno SET '.$campos.' WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t\n\t\t if(!empty($aluno->nome)) \t\t$sqlQuery->set($aluno->nome);\n\t\t if(!empty($aluno->endereco)) \t\t$sqlQuery->set($aluno->endereco);\n\t\t if(!empty($aluno->numero)) \t\t$sqlQuery->set($aluno->numero);\n\t\t if(!empty($aluno->bairro)) \t\t$sqlQuery->set($aluno->bairro);\n\t\t if(!empty($aluno->cidade)) \t\t$sqlQuery->set($aluno->cidade);\n\t\t if(!empty($aluno->nacionalidade)) \t\t$sqlQuery->set($aluno->nacionalidade);\n\t\t if(!empty($aluno->cep)) \t\t$sqlQuery->set($aluno->cep);\n\t\t if(!empty($aluno->uf)) \t\t$sqlQuery->set($aluno->uf);\n\t\t if(!empty($aluno->local)) \t\t$sqlQuery->set($aluno->local);\n\t\t if(!empty($aluno->complemento)) \t\t$sqlQuery->set($aluno->complemento);\n\t\t if(!empty($aluno->inep)) \t\t$sqlQuery->set($aluno->inep);\n\t\t if(!empty($aluno->ni)) \t\t$sqlQuery->set($aluno->ni);\n\t\t if(!empty($aluno->telefone)) \t\t$sqlQuery->set($aluno->telefone);\n\t\t if(!empty($aluno->celular)) \t\t$sqlQuery->set($aluno->celular);\n\t\t if(!empty($aluno->email)) \t\t$sqlQuery->set($aluno->email);\n\t\t if(!empty($aluno->peso)) \t\t$sqlQuery->set($aluno->peso);\n\t\t if(!empty($aluno->altura)) \t\t$sqlQuery->set($aluno->altura);\n\t\t if(!empty($aluno->raca)) \t\t$sqlQuery->set($aluno->raca);\n\t\t if(!empty($aluno->tipoDefic)) \t\t$sqlQuery->set($aluno->tipoDefic);\n\t\t if(!empty($aluno->tipoTranspEscolar)) \t\t$sqlQuery->set($aluno->tipoTranspEscolar);\n\t\t if(!empty($aluno->idEducCenso)) \t\t$sqlQuery->set($aluno->idEducCenso);\n\t\t if(!empty($aluno->tipoUsoInternet)) \t\t$sqlQuery->set($aluno->tipoUsoInternet);\n\t\t if(!empty($aluno->sexo)) \t\t$sqlQuery->set($aluno->sexo);\n\t\t if(!empty($aluno->regNascimento)) \t\t$sqlQuery->set($aluno->regNascimento);\n\t\t if(!empty($aluno->regLivroNum)) \t\t$sqlQuery->set($aluno->regLivroNum);\n\t\t if(!empty($aluno->regFolhaNum)) \t\t$sqlQuery->set($aluno->regFolhaNum);\n\t\t if(!empty($aluno->regComarca)) \t\t$sqlQuery->set($aluno->regComarca);\n\t\t if(!empty($aluno->rg)) \t\t$sqlQuery->set($aluno->rg);\n\t\t if(!empty($aluno->rgOrgao)) \t\t$sqlQuery->set($aluno->rgOrgao);\n\t\t if(!empty($aluno->rgDataExpedicao)) \t\t$sqlQuery->set($aluno->rgDataExpedicao);\n\t\t if(!empty($aluno->titulo)) \t\t$sqlQuery->set($aluno->titulo);\n\t\t if(!empty($aluno->tituloZona)) \t\t$sqlQuery->set($aluno->tituloZona);\n\t\t if(!empty($aluno->tituloSecao)) \t\t$sqlQuery->set($aluno->tituloSecao);\n\t\t if(!empty($aluno->reservista)) \t\t$sqlQuery->set($aluno->reservista);\n\t\t if(!empty($aluno->reservistaSerie)) \t\t$sqlQuery->set($aluno->reservistaSerie);\n\t\t if(!empty($aluno->reservistaNumero)) \t\t$sqlQuery->set($aluno->reservistaNumero);\n\t\t if(!empty($aluno->reservistaCategNum)) \t\t$sqlQuery->set($aluno->reservistaCategNum);\n\t\t if(!empty($aluno->reservistaCsm)) \t\t$sqlQuery->set($aluno->reservistaCsm);\n\t\t if(!empty($aluno->cartProf)) \t\t$sqlQuery->set($aluno->cartProf);\n\t\t if(!empty($aluno->grupoSangue)) \t\t$sqlQuery->set($aluno->grupoSangue);\n\t\t if(!empty($aluno->grupoSangueRh)) \t\t$sqlQuery->set($aluno->grupoSangueRh);\n\t\t if(!empty($aluno->grupoSangueAlergia)) \t\t$sqlQuery->set($aluno->grupoSangueAlergia);\n\t\t if(!empty($aluno->grupoSangueDiabetico)) \t\t$sqlQuery->set($aluno->grupoSangueDiabetico);\n\t\t if(!empty($aluno->outraDoenca)) \t\t$sqlQuery->set($aluno->outraDoenca);\n\t\t if(!empty($aluno->familiaComposta)) \t\t$sqlQuery->set($aluno->familiaComposta);\n\t\t if(!empty($aluno->estadoCivil)) \t\t$sqlQuery->set($aluno->estadoCivil);\n\t\t if(!empty($aluno->usaOculo)) \t\t$sqlQuery->set($aluno->usaOculo);\n\t\t if(!empty($aluno->destro)) \t\t$sqlQuery->set($aluno->destro);\n\t\t if(!empty($aluno->convenio)) \t\t$sqlQuery->set($aluno->convenio);\n\t\t if(!empty($aluno->nomePai)) \t\t$sqlQuery->set($aluno->nomePai);\n\t\t if(!empty($aluno->paiVivo)) \t\t$sqlQuery->set($aluno->paiVivo);\n\t\t if(!empty($aluno->paiNacionalidade)) \t\t$sqlQuery->set($aluno->paiNacionalidade);\n\t\t if(!empty($aluno->paiNaturalidade)) \t\t$sqlQuery->set($aluno->paiNaturalidade);\n\t\t if(!empty($aluno->paiNivEscolar)) \t\t$sqlQuery->set($aluno->paiNivEscolar);\n\t\t if(!empty($aluno->paiReligiao)) \t\t$sqlQuery->set($aluno->paiReligiao);\n\t\t if(!empty($aluno->paiProfissao)) \t\t$sqlQuery->set($aluno->paiProfissao);\n\t\t if(!empty($aluno->paiEnderTrab)) \t\t$sqlQuery->set($aluno->paiEnderTrab);\n\t\t if(!empty($aluno->paiTelefone)) \t\t$sqlQuery->set($aluno->paiTelefone);\n\t\t if(!empty($aluno->paiEmail)) \t\t$sqlQuery->set($aluno->paiEmail);\n\t\t if(!empty($aluno->paiTitulo)) \t\t$sqlQuery->set($aluno->paiTitulo);\n\t\t if(!empty($aluno->paiTituloZona)) \t\t$sqlQuery->set($aluno->paiTituloZona);\n\t\t if(!empty($aluno->paiTituloSecao)) \t\t$sqlQuery->set($aluno->paiTituloSecao);\n\t\t if(!empty($aluno->nomeMae)) \t\t$sqlQuery->set($aluno->nomeMae);\n\t\t if(!empty($aluno->maeViva)) \t\t$sqlQuery->set($aluno->maeViva);\n\t\t if(!empty($aluno->maeNacionalidade)) \t\t$sqlQuery->set($aluno->maeNacionalidade);\n\t\t if(!empty($aluno->maeNaturalidade)) \t\t$sqlQuery->set($aluno->maeNaturalidade);\n\t\t if(!empty($aluno->maeNivEscolar)) \t\t$sqlQuery->set($aluno->maeNivEscolar);\n\t\t if(!empty($aluno->maeReligiao)) \t\t$sqlQuery->set($aluno->maeReligiao);\n\t\t if(!empty($aluno->maeProfissao)) \t\t$sqlQuery->set($aluno->maeProfissao);\n\t\t if(!empty($aluno->maeEnderTrab)) \t\t$sqlQuery->set($aluno->maeEnderTrab);\n\t\t if(!empty($aluno->maeTelefone)) \t\t$sqlQuery->set($aluno->maeTelefone);\n\t\t if(!empty($aluno->maeEmail)) \t\t$sqlQuery->set($aluno->maeEmail);\n\t\t if(!empty($aluno->maeTitulo)) \t\t$sqlQuery->set($aluno->maeTitulo);\n\t\t if(!empty($aluno->maeTituloZona)) \t\t$sqlQuery->set($aluno->maeTituloZona);\n\t\t if(!empty($aluno->maeTituloSecao)) \t\t$sqlQuery->set($aluno->maeTituloSecao);\n\t\t if(!empty($aluno->maeNi)) \t\t$sqlQuery->set($aluno->maeNi);\n\t\t if(!empty($aluno->paiNi)) \t\t$sqlQuery->set($aluno->paiNi);\n\t\t if(!empty($aluno->nomeResponsavel)) \t\t$sqlQuery->set($aluno->nomeResponsavel);\n\t\t if(!empty($aluno->parentescoResponsavel)) \t\t$sqlQuery->set($aluno->parentescoResponsavel);\n\t\t if(!empty($aluno->nacionalResponsavel)) \t\t$sqlQuery->set($aluno->nacionalResponsavel);\n\t\t if(!empty($aluno->naturalResponsavel)) \t\t$sqlQuery->set($aluno->naturalResponsavel);\n\t\t if(!empty($aluno->nivEscolarResponsavel)) \t\t$sqlQuery->set($aluno->nivEscolarResponsavel);\n\t\t if(!empty($aluno->religiaoResponsavel)) \t\t$sqlQuery->set($aluno->religiaoResponsavel);\n\t\t if(!empty($aluno->profissaoResponsavel)) \t\t$sqlQuery->set($aluno->profissaoResponsavel);\n\t\t if(!empty($aluno->enderTrabResponsavel)) \t\t$sqlQuery->set($aluno->enderTrabResponsavel);\n\t\t if(!empty($aluno->telefResponsavel)) \t\t$sqlQuery->set($aluno->telefResponsavel);\n\t\t if(!empty($aluno->emailResponsavel)) \t\t$sqlQuery->set($aluno->emailResponsavel);\n\t\t if(!empty($aluno->tituloResponsavel)) \t\t$sqlQuery->set($aluno->tituloResponsavel);\n\t\t if(!empty($aluno->tituloZonaResponsavel)) \t\t$sqlQuery->set($aluno->tituloZonaResponsavel);\n\t\t if(!empty($aluno->tituloSecaoResponsavel)) \t\t$sqlQuery->set($aluno->tituloSecaoResponsavel);\n\t\t if(!empty($aluno->descriTranspEscolar)) \t\t$sqlQuery->set($aluno->descriTranspEscolar);\n\t\t if(!empty($aluno->paiUf)) \t\t$sqlQuery->set($aluno->paiUf);\n\t\t if(!empty($aluno->maeUf)) \t\t$sqlQuery->set($aluno->maeUf);\n\t\t if(!empty($aluno->responsavelUf)) \t\t$sqlQuery->set($aluno->responsavelUf);\n\t\t if(!empty($aluno->dataNascimento)) \t\t$sqlQuery->set($aluno->dataNascimento);\n\t\t if(!empty($aluno->ufRegComarca)) \t\t$sqlQuery->set($aluno->ufRegComarca);\n\t\t if(!empty($aluno->cpfAluno)) \t\t$sqlQuery->set($aluno->cpfAluno);\n\t\t if(!empty($aluno->cpfPai)) \t\t$sqlQuery->set($aluno->cpfPai);\n\t\t if(!empty($aluno->cpfMae)) \t\t$sqlQuery->set($aluno->cpfMae);\n\t\t if(!empty($aluno->cpfResponsavel)) \t\t$sqlQuery->set($aluno->cpfResponsavel);\n\t\t if(!empty($aluno->codUf)) \t\t$sqlQuery->set($aluno->codUf);\n\t\t if(!empty($aluno->codCidade)) \t\t$sqlQuery->set($aluno->codCidade);\n\t\t if(!empty($aluno->codPai)) \t\t$sqlQuery->set($aluno->codPai);\n\t\t if(!empty($aluno->created)) \t\t$sqlQuery->set($aluno->created);\n\t\t if(!empty($aluno->status)) \t\t$sqlQuery->set($aluno->status);\n\t\t if(!empty($aluno->senha)) \t\t$sqlQuery->set($aluno->senha);\n\t\t if(!empty($aluno->foto)) \t\t$sqlQuery->set($aluno->foto);\n\t\t if(!empty($aluno->colaboraRendaFamiliar)) \t\t$sqlQuery->set($aluno->colaboraRendaFamiliar);\n\n\t\t$sqlQuery->setNumber($aluno->id);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function asignar_valores(){\n\t\t$this->codigo=$_POST['codigo'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->categoria=$_POST['categoria'];\n\t\t$this->hotel=$_POST['hoteles'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->lugar=$_POST['lugar'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->detal=$_POST['detal'];\n\t\t$this->mayor=$_POST['mayor'];\n\t\t$this->limite=$_POST['limite'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->segmento=$_POST['segmento'];\n\t\t$this->principal=$_POST['principal'];\n\t\t\n\t\t\n\t}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_item('');\n $this->setId_ubi('');\n $this->setId_tarifa('');\n $this->setYear('');\n $this->setCantidad('');\n $this->setObserv('');\n $this->setId_serie('');\n $this->setPrimary_key($aPK);\n }", "protected function setDbalInputFieldsToRender() {}", "public static function setters();", "private function addAtrributesToCRUD() {\r\n if (!empty($this->__attributes)) {\r\n $this->myCRUD()->setAtributes($this->__attributes);\r\n }\r\n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }", "public function atualizar(){\r\n return (new Database('atividades'))->update('id = '.$this->id,[\r\n 'titulo' => $this->titulo,\r\n 'descricao' => $this->descricao,\r\n 'ativo' => $this->ativo,\r\n 'data' => $this->data\r\n ]);\r\n }", "function _prep_for_form($field)\r\n\t{\r\n\t\t$this->{$field} = $this->form_validation->prep_for_form($this->{$field});\r\n\t}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_item('');\n $this->setId_ubi('');\n $this->setF_gasto('');\n $this->setTipo('');\n $this->setCantidad('');\n $this->setPrimary_key($aPK);\n }", "protected function prepareForValidation(): void\n {\n // $this->merge([\n // 'created_by' => Auth::user()->id\n // ]);\n // $this->merge([\n // 'updated_by' => Auth::user()->id\n // ]);\n\n // $this->merge([\n // 'status' => 'Active',\n // 'name' => $this->input('display_name'),\n // 'password' => ''\n // ]);\n\n\n // $this->merge([\n // 'slug' => str_slug($this->input('title'))\n // ]);\n // $this->merge([\n // 'posted_at' => Carbon::parse($this->input('posted_at'))\n // ]);\n }", "function asignar_valores3(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t\n\t\t$this->id=$_POST['id'];\n\t\t$this->temporada=$_POST['temporada'];\n\t\t$this->nombre=$_POST['nombre_plan'];\n\t\t$this->descripcion=$_POST['descripcion_plan'];\n\t\t$this->precio=$_POST['precio_plan'];\n\t\t$this->maxadultos=$_POST['maxadultos'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->mostrar=$_POST['publica'];\n\t\t\n\t}", "function asignar_valores2(){\n\t\t/* Metodo para recibir valores del exterior. */\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t\n\t\t$this->id=$_POST['id'];\n\t\t$this->desde=$_POST['desde'];\n\t\t$this->hasta=$_POST['hasta'];\n\t\t$this->titulo=$_POST['titulo'];\n\t\t$this->alternativo=$_POST['alternativo'];\n\t\t$this->paxadicional=$_POST['paxadicional'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->mostrar=$_POST['publica'];\n\t\t\n\t\t$this->desde_a=$_POST['desde_a'];\n\t\t$this->hasta_a=$_POST['hasta_a'];\n\t\t$this->precio_a=$_POST['precio_a'];\n\t\t$this->desde_b=$_POST['desde_b'];\n\t\t$this->hasta_b=$_POST['hasta_b'];\n\t\t$this->precio_b=$_POST['precio_b'];\n\t\t\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed222_i_codigo = ($this->ed222_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed222_i_codigo\"]:$this->ed222_i_codigo);\n $this->ed222_i_itinerario = ($this->ed222_i_itinerario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed222_i_itinerario\"]:$this->ed222_i_itinerario);\n $this->ed222_i_escolaproc = ($this->ed222_i_escolaproc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed222_i_escolaproc\"]:$this->ed222_i_escolaproc);\n }else{\n $this->ed222_i_codigo = ($this->ed222_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed222_i_codigo\"]:$this->ed222_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->y78_codtipo = ($this->y78_codtipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_codtipo\"]:$this->y78_codtipo);\n $this->y78_receit = ($this->y78_receit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_receit\"]:$this->y78_receit);\n $this->y78_valor = ($this->y78_valor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_valor\"]:$this->y78_valor);\n $this->y78_descr = ($this->y78_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_descr\"]:$this->y78_descr);\n }else{\n $this->y78_codtipo = ($this->y78_codtipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_codtipo\"]:$this->y78_codtipo);\n $this->y78_receit = ($this->y78_receit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"y78_receit\"]:$this->y78_receit);\n }\n }", "public function postHydrate(): void\n {\n if ('invalid' === $this->value) {\n $this->value = 'valid';\n }\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}", "function after_validation_on_update() {}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_region('');\n $this->setRegion('');\n $this->setNombre_region('');\n $this->setStatus('');\n $this->setPrimary_key($aPK);\n }", "public function actualiza($dataArray){\n //deleted, created_at y updated_at son comunes, pero estos jamas se actualizaran por acá\n if (array_key_exists('fechaNac',$dataArray))\n $dataArray['fechaNac'] = DateFormat::spanishDateToEnglishDate($dataArray['fechaNac']);\n if (array_key_exists('password',$dataArray))\n $dataArray['password'] = bcrypt($dataArray['password']);\n $this->personaNatural->update($dataArray);\n $this->model->update($dataArray); //set data only in its PersonaNatural model\n }", "function setInputValues()\n {\n // Set input type based on GET/POST\n $inputType = ($_SERVER['REQUEST_METHOD'] === 'POST') ? INPUT_POST : INPUT_GET;\n // Init global variables\n global $typeID, $classID, $makeID, $price, $model, $year;\n global $sort, $sortDirection;\n // Set each variable, escape special characters\n $typeID = filter_input($inputType, 'typeID', FILTER_VALIDATE_INT);\n $classID = filter_input($inputType, 'classID', FILTER_VALIDATE_INT);\n $makeID = filter_input($inputType, 'makeID', FILTER_VALIDATE_INT);\n $sort = filter_input($inputType, 'sort', FILTER_VALIDATE_INT);\n $sortDirection = filter_input($inputType, 'sortDirection', FILTER_VALIDATE_INT);\n $price = filter_input($inputType, 'price', FILTER_VALIDATE_INT);\n $year = filter_input($inputType, 'year', FILTER_VALIDATE_INT);\n $model = htmlspecialchars(filter_input($inputType, 'model'));\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed03_i_codigo = ($this->ed03_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_codigo\"]:$this->ed03_i_codigo);\n $this->ed03_i_rechumanoativ = ($this->ed03_i_rechumanoativ == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_rechumanoativ\"]:$this->ed03_i_rechumanoativ);\n $this->ed03_i_relacaotrabalho = ($this->ed03_i_relacaotrabalho == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_relacaotrabalho\"]:$this->ed03_i_relacaotrabalho);\n }else{\n $this->ed03_i_codigo = ($this->ed03_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_codigo\"]:$this->ed03_i_codigo);\n }\n }", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->c64_codpla = ($this->c64_codpla == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c64_codpla\"]:$this->c64_codpla);\n $this->c64_estrut = ($this->c64_estrut == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c64_estrut\"]:$this->c64_estrut);\n $this->c64_descr = ($this->c64_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c64_descr\"]:$this->c64_descr);\n }else{\n $this->c64_codpla = ($this->c64_codpla == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"c64_codpla\"]:$this->c64_codpla);\n }\n }", "public function _set_model_fields(){\n // set fields only when they have not been set for this object\n if($this->_fields_loaded===FALSE){\n\n foreach ($this->_meta() as $meta) {\n\n $this->{$meta->name} = '';\n }\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed77_i_codigo = ($this->ed77_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_codigo\"]:$this->ed77_i_codigo);\n $this->ed77_i_base = ($this->ed77_i_base == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_base\"]:$this->ed77_i_base);\n $this->ed77_i_escola = ($this->ed77_i_escola == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_escola\"]:$this->ed77_i_escola);\n $this->ed77_i_basecont = ($this->ed77_i_basecont == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_basecont\"]:$this->ed77_i_basecont);\n }else{\n $this->ed77_i_codigo = ($this->ed77_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_codigo\"]:$this->ed77_i_codigo);\n }\n }", "public function atualizar($oficina){\r\n\t\t$sql = 'UPDATE oficina SET id = :id, nome = :nome, data = :data, carga_horaria = :carga_horaria, horario = :horario, id_evento = :id_evento, tipo = :tipo, vagas = :vagas WHERE id = :id';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->bindValue(':id',$oficina->getId()); \n\r\t\t$consulta->bindValue(':nome',$oficina->getNome()); \n\r\t\t$consulta->bindValue(':data',$oficina->getData()); \n\r\t\t$consulta->bindValue(':carga_horaria',$oficina->getCarga_horaria()); \n\r\t\t$consulta->bindValue(':horario',$oficina->getHorario()); \n\r\t\t$consulta->bindValue(':id_evento',$oficina->getId_evento()); \n\r\t\t$consulta->bindValue(':tipo',$oficina->getTipo()); \n\r\t\t$consulta->bindValue(':vagas',$oficina->getVagas()); \r\n\t\t$consulta->execute();\r\n\t}", "function before_validation_on_update() {}", "public function onBeforeWrite()\n {\n foreach (self::$defaults as $field => $value) {\n if (empty($this->$field)) {\n $this->$field = $value;\n }\n }\n //TODO: prevent non-heirarichal entries, eg country = '*', then state = 'blah'\n parent::onBeforeWrite();\n }", "protected function editar()\n {\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->fa35_i_codigo = ($this->fa35_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"fa35_i_codigo\"]:$this->fa35_i_codigo);\n $this->fa35_i_listacontrolado = ($this->fa35_i_listacontrolado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"fa35_i_listacontrolado\"]:$this->fa35_i_listacontrolado);\n $this->fa35_i_medanvisa = ($this->fa35_i_medanvisa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"fa35_i_medanvisa\"]:$this->fa35_i_medanvisa);\n }else{\n $this->fa35_i_codigo = ($this->fa35_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"fa35_i_codigo\"]:$this->fa35_i_codigo);\n }\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "public function beforeValidation() {\n\t\t$this->modified = new RawValue('now()');\n\t}", "public function setFielda($campos) {\n $fields = $this->separate($campos[0]);\n\n # Get the query based in filters\n $this->checkFields($fields);\n # If exists two type fields, check table\n $this->checkTable($campos[1]);\n # Check type of data\n $this->checkType();\n}", "function SeteoCampos(){\n\t\t// Campos que van en en detalle, deben empezar su nombre con 'C'\n\t\t$this->addField('C1', 99999,\t0, 15);\n $this->addField('C2', 99999,\t0, 15);\n $this->addField('C3', 99999,\t0, 40);\t\t\n $this->addField('C4', 99999,\t0, 65);\t\t\n $this->addField('C5', 99999,\t0, 40);\n $this->addField('C6', 99999,\t0, 25);\t\t\n $this->addField('C7', 99999,\t0, 65);\t\t\n\t\t\n\t\t$this->addField('HG1', 0,\t0,\t160);\n\t\t\t\t\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tr20_id = ($this->tr20_id == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_id\"]:$this->tr20_id);\n if($this->tr20_dtalvara == \"\"){\n $this->tr20_dtalvara_dia = ($this->tr20_dtalvara_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_dia\"]:$this->tr20_dtalvara_dia);\n $this->tr20_dtalvara_mes = ($this->tr20_dtalvara_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_mes\"]:$this->tr20_dtalvara_mes);\n $this->tr20_dtalvara_ano = ($this->tr20_dtalvara_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_ano\"]:$this->tr20_dtalvara_ano);\n if($this->tr20_dtalvara_dia != \"\"){\n $this->tr20_dtalvara = $this->tr20_dtalvara_ano.\"-\".$this->tr20_dtalvara_mes.\"-\".$this->tr20_dtalvara_dia;\n }\n }\n $this->tr20_numcgm = ($this->tr20_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_numcgm\"]:$this->tr20_numcgm);\n $this->tr20_ruaid = ($this->tr20_ruaid == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_ruaid\"]:$this->tr20_ruaid);\n $this->tr20_nro = ($this->tr20_nro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_nro\"]:$this->tr20_nro);\n $this->tr20_bairroid = ($this->tr20_bairroid == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_bairroid\"]:$this->tr20_bairroid);\n $this->tr20_complem = ($this->tr20_complem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_complem\"]:$this->tr20_complem);\n $this->tr20_fone = ($this->tr20_fone == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_fone\"]:$this->tr20_fone);\n $this->tr20_prefixo = ($this->tr20_prefixo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_prefixo\"]:$this->tr20_prefixo);\n }else{\n $this->tr20_id = ($this->tr20_id == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_id\"]:$this->tr20_id);\n }\n }", "protected function prepareForValidation()\n {\n\n $attrs = $this->all();\n $attrs['day'] = ucfirst($attrs['day']);\n $hours = $this->transformHoursAndMinutes();\n $attrs['time_start'] = $hours[0];\n $attrs['time_end'] = $hours[1];\n $this->replace($attrs);\n }", "function save_user_fields ($user_id) {\n if ( isset($_POST['billing_first_name']) ){\n update_user_meta($user_id, 'billing_first_name', sanitize_text_field($_POST['billing_first_name']));\n }\n \n if ( isset($_POST['billing_last_name']) ){\n update_user_meta($user_id, 'billing_last_name', sanitize_text_field($_POST['billing_last_name']));\n }\n\n if ( isset($_POST['billing_tipo_documento']) ){\n update_user_meta($user_id, 'billing_tipo_documento', sanitize_text_field($_POST['billing_tipo_documento']));\n }\n\n if ( isset($_POST['billing_numero_documento']) ){\n update_user_meta($user_id, 'billing_numero_documento', sanitize_text_field($_POST['billing_numero_documento']));\n }\n \n}", "private function setupFieldsAttributes() {\n\n\t\tforeach ( $this->form as $field ) {\n\n\t\t\tif ( ! $field->hasAttribute( 'id' ) ) {\n\t\t\t\t$field->setAttribute( 'id', esc_attr( sanitize_title( $field->getName() ) ) );\n\t\t\t}\n\t\t}\n\n\t}", "public function atualiza($aluno){\n\t\t\t$sql = \"UPDATE aluno SET nome=:nome,turma=:turma,telefone=:telefone,cidade=:cidade,bairro=:bairro,rua=:rua,numero_casa=:numero_casa,complementos=:complementos WHERE id=:id\";\n\n\t\t\t$query = $this->conexao->prepare($sql);\n\n\t\t\t$query->execute(['nome'=>$aluno->getNome(),'turma'=>$aluno->getTurma(),'telefone'=>$aluno->getTelefone(), 'cidade'=>$aluno->getCidade(), 'bairro'=>$aluno->getBairro(), 'rua'=>$aluno->getRua(), 'numero_casa'=>$aluno->getNumeroCasa(), 'complementos'=>$aluno->getComplementos(), 'id'=>$aluno->getId()]);\n\n\t\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed276_i_codigo = ($this->ed276_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_i_codigo\"]:$this->ed276_i_codigo);\n $this->ed276_i_alunoalt = ($this->ed276_i_alunoalt == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_i_alunoalt\"]:$this->ed276_i_alunoalt);\n $this->ed276_c_campo = ($this->ed276_c_campo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_c_campo\"]:$this->ed276_c_campo);\n $this->ed276_c_contant = ($this->ed276_c_contant == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_c_contant\"]:$this->ed276_c_contant);\n $this->ed276_c_contatual = ($this->ed276_c_contatual == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_c_contatual\"]:$this->ed276_c_contatual);\n }else{\n $this->ed276_i_codigo = ($this->ed276_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed276_i_codigo\"]:$this->ed276_i_codigo);\n }\n }", "public function actualizar_perfil(Request $request){\n // 'dato_opcion1' => $request->dato_opcion1 , 'dato_opcion2' => $request->dato_opcion2 , 'dato_opcion3' => $request->dato_opcion3 , 'opcion1_valor' => $request->opcion1_valor , 'opcion2_valor' => $request->opcion2_valor, 'opcion3_valor' => $request->opcion3_valor]);\n\nif ($request->nombre != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['nombre' => $request->nombre]);\n}\nif ($request->apellidos != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['apellidos' => $request->apellidos]);\n}\nif ($request->dni != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['dni' => $request->dni]);\n}\nif ($request->email != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['alumno.email' => $request->email]);\n}\nif ($request->direccion != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['direccion' => $request->direccion]);\n}\nif ($request->carrera != \"-\") {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['carrera' => $request->carrera]);\n}\n\nif ($request->dato_opcion1 != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['dato_opcion1' => $request->dato_opcion1]);\n}\nif ($request->dato_opcion2 != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['dato_opcion2' => $request->dato_opcion2]);\n}\nif ($request->dato_opcion3 != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['dato_opcion3' => $request->dato_opcion3]);\n}\n\nif ($request->opcion1_valor != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['opcion1_valor' => $request->opcion1_valor]);\n}\nif ($request->opcion2_valor != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['opcion2_valor' => $request->opcion2_valor]);\n}\nif ($request->opcion3_valor != NULL) {\n DB::table('alumno')\n ->join('users','users.id','=','user_id')\n ->where('users.id','=', Auth::user()->id)\n ->update(['opcion3_valor' => $request->opcion3_valor]);\n}\n\nreturn redirect()->back()->with('message', 'INFORMACIÓN DE PERFIL ACTUALIZADA CORRECTAMENTE');\n\n\n}", "function save() {\n //save the added fields\n }", "public function beforeSave()\n {\n $this->setParams([\n 'url' => $this->getValue(),\n 'apiKey' => $this->getFieldsetDataValue('api_key'),\n 'version' => $this->getFieldsetDataValue('api_version')\n ]);\n\n if (!$this->isUrl($this->getValue())) {\n throw new \\Magento\\Framework\\Exception\\ValidatorException(__('Invalid CRM url'));\n }\n\n if (!$this->isHttps($this->getValue())) {\n $this->schemeEdit($this->getValue());\n }\n\n if ($this->validateApiUrl($this->api)) {\n $this->setValue($this->getValue());\n }\n\n parent::beforeSave();\n }", "public function actualizar(){\n }", "public function actualizar(){\n }", "protected function setNullAllAttributes()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\tif( $value == \"real\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"int\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"date\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"string\" ) $this->$field = null ;\n\t\t}\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->l30_codigo = ($this->l30_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_codigo\"]:$this->l30_codigo);\n if($this->l30_data == \"\"){\n $this->l30_data_dia = ($this->l30_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_dia\"]:$this->l30_data_dia);\n $this->l30_data_mes = ($this->l30_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_mes\"]:$this->l30_data_mes);\n $this->l30_data_ano = ($this->l30_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_ano\"]:$this->l30_data_ano);\n if($this->l30_data_dia != \"\"){\n $this->l30_data = $this->l30_data_ano.\"-\".$this->l30_data_mes.\"-\".$this->l30_data_dia;\n }\n }\n $this->l30_portaria = ($this->l30_portaria == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_portaria\"]:$this->l30_portaria);\n if($this->l30_datavalid == \"\"){\n $this->l30_datavalid_dia = ($this->l30_datavalid_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_dia\"]:$this->l30_datavalid_dia);\n $this->l30_datavalid_mes = ($this->l30_datavalid_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_mes\"]:$this->l30_datavalid_mes);\n $this->l30_datavalid_ano = ($this->l30_datavalid_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_ano\"]:$this->l30_datavalid_ano);\n if($this->l30_datavalid_dia != \"\"){\n $this->l30_datavalid = $this->l30_datavalid_ano.\"-\".$this->l30_datavalid_mes.\"-\".$this->l30_datavalid_dia;\n }\n }\n $this->l30_tipo = ($this->l30_tipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_tipo\"]:$this->l30_tipo);\n $this->l30_nomearquivo = ($this->l30_nomearquivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_nomearquivo\"]:$this->l30_nomearquivo);\n }else{\n $this->l30_codigo = ($this->l30_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_codigo\"]:$this->l30_codigo);\n }\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n if (is_array($value)) {\n $value = $this->_helper->makeStorableArrayFieldValue($value);\n }\n \n $this->setValue($value);\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->v59_inicial = ($this->v59_inicial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v59_inicial\"]:$this->v59_inicial);\n $this->v59_numpre = ($this->v59_numpre == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v59_numpre\"]:$this->v59_numpre);\n }else{\n $this->v59_inicial = ($this->v59_inicial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v59_inicial\"]:$this->v59_inicial);\n $this->v59_numpre = ($this->v59_numpre == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v59_numpre\"]:$this->v59_numpre);\n }\n }", "public function beforeValidationOnUpdate()\n {\n // Timestamp on the update\n $this->modifyAt = time();\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "private function before_custom_save()\n\t\t{\n\t\t\t$fields = self::$db->table_info($this->table_name);\n\t\t\tforeach($fields AS $field)\n\t\t\t{\n\t\t\t\tif(!strlen($this->$field['name'])) {\n\t\t\t\t\t$this->$field['name'] = 'NULL';\n\t\t\t\t}\n\t\t\t\tif(method_exists($this, 'preSave_'.$field['name'])) {\n\t\t\t\t\t$this->{'preSave_'.$field['name']}($field);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private function resetInputFields(){\n $this->name = '';\n }", "protected function _beforeSave()\n {\n $value = $this->getValue();\n $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->pc31_orcamforne = ($this->pc31_orcamforne == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_orcamforne\"]:$this->pc31_orcamforne);\n $this->pc31_nomeretira = ($this->pc31_nomeretira == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_nomeretira\"]:$this->pc31_nomeretira);\n if($this->pc31_dtretira == \"\"){\n $this->pc31_dtretira_dia = ($this->pc31_dtretira_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_dtretira_dia\"]:$this->pc31_dtretira_dia);\n $this->pc31_dtretira_mes = ($this->pc31_dtretira_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_dtretira_mes\"]:$this->pc31_dtretira_mes);\n $this->pc31_dtretira_ano = ($this->pc31_dtretira_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_dtretira_ano\"]:$this->pc31_dtretira_ano);\n if($this->pc31_dtretira_dia != \"\"){\n $this->pc31_dtretira = $this->pc31_dtretira_ano.\"-\".$this->pc31_dtretira_mes.\"-\".$this->pc31_dtretira_dia;\n }\n }\n $this->pc31_horaretira = ($this->pc31_horaretira == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_horaretira\"]:$this->pc31_horaretira);\n $this->pc31_liclicitatipoempresa = ($this->pc31_liclicitatipoempresa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_liclicitatipoempresa\"]:$this->pc31_liclicitatipoempresa);\n $this->pc31_tipocondicao = ($this->pc31_tipocondicao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_tipocondicao\"]:$this->pc31_tipocondicao);\n }else{\n $this->pc31_orcamforne = ($this->pc31_orcamforne == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"pc31_orcamforne\"]:$this->pc31_orcamforne);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh157_sequencial = ($this->rh157_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh157_sequencial\"]:$this->rh157_sequencial);\n $this->rh157_usuario = ($this->rh157_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh157_usuario\"]:$this->rh157_usuario);\n $this->rh157_lotacao = ($this->rh157_lotacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh157_lotacao\"]:$this->rh157_lotacao);\n }else{\n $this->rh157_sequencial = ($this->rh157_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh157_sequencial\"]:$this->rh157_sequencial);\n }\n }", "public function actualizar(){\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ov01_sequencial = ($this->ov01_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_sequencial\"]:$this->ov01_sequencial);\n $this->ov01_situacaoouvidoriaatendimento = ($this->ov01_situacaoouvidoriaatendimento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_situacaoouvidoriaatendimento\"]:$this->ov01_situacaoouvidoriaatendimento);\n $this->ov01_tipoprocesso = ($this->ov01_tipoprocesso == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_tipoprocesso\"]:$this->ov01_tipoprocesso);\n $this->ov01_formareclamacao = ($this->ov01_formareclamacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_formareclamacao\"]:$this->ov01_formareclamacao);\n $this->ov01_tipoidentificacao = ($this->ov01_tipoidentificacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_tipoidentificacao\"]:$this->ov01_tipoidentificacao);\n $this->ov01_usuario = ($this->ov01_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_usuario\"]:$this->ov01_usuario);\n $this->ov01_depart = ($this->ov01_depart == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_depart\"]:$this->ov01_depart);\n $this->ov01_instit = ($this->ov01_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_instit\"]:$this->ov01_instit);\n $this->ov01_numero = ($this->ov01_numero == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_numero\"]:$this->ov01_numero);\n $this->ov01_anousu = ($this->ov01_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_anousu\"]:$this->ov01_anousu);\n if($this->ov01_dataatend == \"\"){\n $this->ov01_dataatend_dia = ($this->ov01_dataatend_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_dataatend_dia\"]:$this->ov01_dataatend_dia);\n $this->ov01_dataatend_mes = ($this->ov01_dataatend_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_dataatend_mes\"]:$this->ov01_dataatend_mes);\n $this->ov01_dataatend_ano = ($this->ov01_dataatend_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_dataatend_ano\"]:$this->ov01_dataatend_ano);\n if($this->ov01_dataatend_dia != \"\"){\n $this->ov01_dataatend = $this->ov01_dataatend_ano.\"-\".$this->ov01_dataatend_mes.\"-\".$this->ov01_dataatend_dia;\n }\n }\n $this->ov01_horaatend = ($this->ov01_horaatend == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_horaatend\"]:$this->ov01_horaatend);\n $this->ov01_requerente = ($this->ov01_requerente == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_requerente\"]:$this->ov01_requerente);\n $this->ov01_solicitacao = ($this->ov01_solicitacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_solicitacao\"]:$this->ov01_solicitacao);\n $this->ov01_executado = ($this->ov01_executado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_executado\"]:$this->ov01_executado);\n }else{\n $this->ov01_sequencial = ($this->ov01_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ov01_sequencial\"]:$this->ov01_sequencial);\n }\n }", "public function atualizar(){\r\n return (new Database('cartao'))->update(' id = '.$this->id, [\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n }", "private function resetInput()\n {\t\t\n //Que id es para las acciones\n $this->selected_id = null;\n $this->cob_solicitud = null;\n $this->cob_comproban = null;\n $this->cob_serie = null;\n $this->cob_numero = null;\n $this->con_subtotal = null;\n $this->cob_igv = null;\n $this->cob_total = null;\n \n }" ]
[ "0.6695341", "0.6605308", "0.64370596", "0.6316871", "0.6283973", "0.6258171", "0.61481196", "0.6110965", "0.60848427", "0.60702395", "0.60149026", "0.599725", "0.59970146", "0.5989812", "0.59833664", "0.59787756", "0.5958578", "0.5952102", "0.5949218", "0.58850634", "0.58798766", "0.58768326", "0.5876628", "0.5858562", "0.5850082", "0.58473146", "0.5845345", "0.5844452", "0.58374846", "0.5832204", "0.5821885", "0.5819664", "0.5812444", "0.5810945", "0.5801257", "0.5798577", "0.5796496", "0.57763314", "0.5760644", "0.57575405", "0.5756319", "0.5751845", "0.5736158", "0.5734885", "0.57137454", "0.5707973", "0.57073426", "0.5679917", "0.56780595", "0.5669278", "0.5661958", "0.5659978", "0.565698", "0.5650588", "0.5648171", "0.5644754", "0.5625338", "0.5624294", "0.56232595", "0.56150866", "0.56145936", "0.5612502", "0.5606811", "0.5600033", "0.5599975", "0.55907667", "0.5577752", "0.5573324", "0.5572444", "0.55716074", "0.5569206", "0.5566881", "0.5566866", "0.55666983", "0.5553846", "0.5552441", "0.55479354", "0.55443203", "0.55438894", "0.55432594", "0.5542165", "0.5540224", "0.5540033", "0.55380124", "0.5536279", "0.5536279", "0.5535149", "0.55267227", "0.5523294", "0.55213153", "0.5519469", "0.5515962", "0.55152893", "0.55141896", "0.549482", "0.54921424", "0.5490246", "0.5487981", "0.5484655", "0.54841876", "0.54806924" ]
0.0
-1
Get the failed pipe name.
public function getPipeName() { return $this->pipeName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getErrorName(){\n return $this->error_name;\n }", "protected function failureShort()\n\t{\n\t\treturn $this->getEventName();\n\t}", "public function getInvalidName()\n {\n return $this->_invalidName;\n }", "public function getFailedSubtask()\n {\n return $this->get(self::FAILED_SUBTASK);\n }", "public function failError()\n {\n if (\n ($packet = $this->getPacket()) and\n $packet['status'] !== Job::STATUS_FAILED and\n ($e = json_decode($packet['exception'], true))\n ) {\n return empty($e['error']) ? var_export($e, true) : $e['error'];\n }\n\n return 'Unknown exception';\n }", "function get_error_name($errno)\n{\n $constants = get_defined_constants(true);\n $keys = array_keys($constants['Core'], $errno);\n $keys = array_filter($keys, function($value) {\n return (strpos($value, 'E_') === 0);\n });\n return implode('|', $keys); // There should only be one member of the array, all being well.\n}", "static function getLastFailedJob( $jobName ) {\n return self::getLastRunJobOfType( $jobName, self::STATUS_FAILED );\n }", "public function getLPFailed();", "public function getFailedMessage()\n {\n if (array_key_exists(\"failedMessage\", $this->_propDict)) {\n return $this->_propDict[\"failedMessage\"];\n } else {\n return null;\n }\n }", "private function getLastError() {\n $errorCode = socket_last_error();\n return socket_strerror($errorCode);\n }", "public function lastError(): string\n {\n $errno = smbclient_state_errno($this->state);\n return 'SMB: ' .$this->errorCode[$errno]?? \"error code $errno\";\n }", "public function getExceptionName()\n {\n return $this->_exception;\n }", "private function getLastSocketError() {\n $errStr = '-1: Unknown error';\n\n if (function_exists('socket_import_stream')) {\n $socket = socket_import_stream($this->socket);\n $errCode = socket_last_error($socket);\n $errStr = $errCode . ': ' . socket_strerror($errCode);\n }\n\n return $errStr;\n }", "public function getErrorActionName()\n {/*{{{*/\n return $this->get(self::KEY_ERROR_ACTION_NAME);\n }", "public function getLastError(): string\n {\n return $this->lastError;\n }", "public function getLastError(): string\r\n {\r\n return $this->lastError;\r\n }", "public function getErr()\n {\n return $this->get(self::ERR);\n }", "public function getErr()\n {\n return $this->get(self::ERR);\n }", "public function latestFailedDeploymentHook()\n {\n return $this->request('get', '/api/latest-failed-hook')['hook'];\n }", "public function getFailureMessage()\n {\n\t\tif(null !== $this->_failed_index)\n\t\t\treturn $this->_items[$this->_failed_index]->getFailureMessage();\n\t\treturn '';\n }", "public function getErr() {}", "public function getError(): string\n {\n foreach ($this->getBulkResponses() as $bulkResponse) {\n if ($bulkResponse->hasError()) {\n return $bulkResponse->getError();\n }\n }\n\n return '';\n }", "public function getFailureTableName()\n {\n return $this->getTable($this->_failureTableName);\n }", "private function getError($name = null)\n {\n return $this->local_errors->get($name);\n }", "public function getFailedReasonMessage(){\n $failedReasonMessages = self::getFailedReasonMessages();\n if(isset($failedReasonMessages[$this->failedReason])){\n return $failedReasonMessages[$this->failedReason];\n }else {\n return $this->failedReason;\n }\n }", "public function getStandardErrorMessage()\n {\n return $this->behatProcess->getErrorOutput();\n }", "function lastErrno();", "public function getErrorMsg()\r\n {\r\n return $this->lastErrorMsg;\r\n }", "public function getFailed(): int\n {\n return $this->failed;\n }", "public function getLastError()\n {\n $result = '';\n\n if (is_object($this->provider)) {\n $result = $this->provider->getLastError();\n }\n\n return $result;\n }", "public function getType(): string\n\t{\n\t\treturn get_class($this->err);\n\t}", "private function socketLastError() : string\n {\n return socket_strerror( socket_last_error( $this->socket ) );\n }", "public function getFailUrl(): ?string\n {\n return $this->getParameter('failUrl');\n }", "public function testBrokenPipe(): void\n {\n $passable = '(0)';\n $container = new Container();\n $pipeline = new Pipeline($container);\n\n $result = $pipeline\n ->send($passable)\n ->through([\n PipeOne::class => 'a',\n PipeTwo::class => 'b',\n BrokenPipeOne::class => 'c',\n ])\n ->via('handle')\n ->then(function ($passable) {\n return $passable . '(e)';\n })\n ->run();\n\n self::assertEquals('(-2b)(-1a)', $result);\n }", "public function getFailReason()\n {\n return $this->get(self::_FAIL_REASON);\n }", "public function getName()\n {\n return 'fatal.error';\n }", "private function getPoolStatusFileName()\n\t{\n\t\treturn($this->getPoolDir().'/m23StatusFile.info');\n\t}", "protected function cvFail($cmd) {\n $p = Process::runFail($this->cv($cmd));\n return $p->getErrorOutput() . $p->getOutput();\n }", "public function getExceptionName()\n {\n return $this->class;\n }", "public function getMessage(): string\n\t{\n\t\treturn $this->err->getMessage();\n\t}", "public function getName()\n\t{\n\t\treturn 'Workflow Exception';\n\t}", "public final function getLastErrorMsg() {\n return $this->lastErrorMsg;\n }", "public function getError()\n\t{\n\t\treturn $this->err;\n\t}", "public function getError(): string\n {\n return $this->error;\n }", "public function getErrorMessage()\n {\n return $this->streamErrorMessage;\n }", "public function error()\n {\n return $this->stderr?:$this->stdout;\n }", "public function getLastError()\n {\n return $this->lastErrorMsg;\n }", "public function errorCode()\n {\n return $this->error !== false ? 'HY000' : null;\n }", "public function errorMessage()\n {\n return $this->provider->errorMessage;\n }", "public function getCallbackFail()\n {\n return $this->callbackFail;\n }", "public function getFailureReason();", "function get_last_error() {\n\t\treturn $this->errors[count($this->errors - 1)];\n\t}", "public function getFileName()\n {\n return $this->getParam('flowFilename');\n }", "public function getStdErrFilePath() {\n if (!$this->filepath) {\n $this->filepath = tempnam(Config::get('tmp_dir'), 'stderr_');\n }\n return $this->filepath;\n }", "public function getBattleCheckFail()\n {\n return $this->get(self::_BATTLE_CHECK_FAIL);\n }", "public function getTmpName()\n\t{\n\t\treturn $this->tmpName;\n\t}", "function getError()\n\t{\n\t\treturn $this->err;\n\t}", "public function getError(): string\n {\n return $this->Error;\n }", "public function getErrorNumber() {\n return curl_errno($this->_getCommHandler());\n }", "public function getFailureReason()\n {\n return $this->failure_reason;\n }", "public function getOutputName(): string\n {\n return $this->outputName;\n }", "protected function getErrorMessage(): string\n\t{\n\t\tif($this->input !== null)\n\t\t{\n\t\t\t$errorMessage = $this->input->getErrorMessage();\n\t\t}\n\n\t\treturn $errorMessage ?? $this->defaultErrorMessage;\n\t}", "public function getLastError()\n {\n return $this->lastError;\n }", "public function getLastError()\n {\n return $this->lastError;\n }", "public static function failed(): self\n {\n return self::getInstance('FAILED');\n }", "public function getErrorNo()\n {\n return curl_errno($this->ch);\n }", "public function getFailedActivityId(): ?string;", "public function getPortName()\n {\n return isset($this->port_name) ? $this->port_name : '';\n }", "public function getPortName()\n {\n return isset($this->port_name) ? $this->port_name : '';\n }", "public function getRuleName(): ?string { return $this->server->getRuleName(); }", "public function getName()\n\t{\n\t\treturn $this->process;\n\t}", "public function getLastError()\r\n\t{\r\n\t\t// TODO: we should move this to returning an Error\r\n\t\t$numErrors = count($this->errors);\r\n\t\tif ($numErrors > 0)\r\n\t\t{\r\n\t\t\treturn $this->errors[$numErrors-1]['message'];\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}", "public function getStdErr()\n {\n return $this->information['stdErr'];\n }", "public function errNo()\n {\n return curl_errno($this->curl);\n }", "public function getRuleName(): ?string\n {\n return $this->rule->getName();\n }", "protected function _getErrorMessage()\n {\n return pg_last_error($this->conn_id);\n }", "public function lastError()\r\n\t{\r\n\t\tif( $this->conn->Errors->Count )\r\n\t\t\treturn $this->conn->Errors[ $this->conn->Errors->Count - 1 ]->Description;\r\n\t\t\r\n\t\treturn '';\r\n\t}", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getLastErrorMessage(): ?string;", "public function getTempName() {}", "public function getIgnoreFailedSubtask()\n {\n return $this->get(self::IGNORE_FAILED_SUBTASK);\n }", "public function getLastError();", "public function error()\n {\n if(is_resource($this->link))\n {\n return pg_last_error($this->link);\n }\n else\n {\n return '';\n }\n }", "public function getErrNo() {\n return $this->get(self::ERR_NO);\n }", "public function getLastError(): ?string\n {\n return $this->last_error;\n }", "public function getLastError() {\n\t\t\treturn $this->lastError;\n\t\t}", "public static function rejected(string $name)\n {\n return new static(\n $name,\n 'Pipe \"'.$name.'\" has been rejected.',\n static::REJECTED\n );\n }", "public function getProcessLogName()\n\t\t{\n\t\t\treturn $this->process_log_name;\n\t\t}", "public function getError()\n {\n return $this->fileInfo['error'];\n }", "public function getTmpName()\n {\n return $this->tmpName;\n }", "public function getTranslationKey()\n {\n $filter = new Zend_Filter_StringToUpper();\n $key = $filter->filter($this->_rule);\n if (!empty($key)) {\n return 'RULE_FAILED_'.$key;\n }\n return '';\n }", "public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}", "public function getLastValidationError(): string;", "function getErrno()\n {\n return $this->Errno;\n }", "private function getStreamName(){\n return Shopware()->Container()->getParameter('kernel.logs_dir') . \"/\" . $this->getFileName() . \"_\". Shopware()->Container()->getParameter('kernel.environment') . \".log\";\n }", "public function getError() {\n\t\treturn $this->current_error;\n\t}", "public static function failed()\n\t{\n\t\treturn Request::$failed;\n\t}", "public function getLoginFailedReason() {\n\t\treturn $this->error;\n\t}", "public function getError()\n {\n return $this->currentError;\n }" ]
[ "0.570066", "0.56586754", "0.5643886", "0.56232846", "0.5567122", "0.54656506", "0.54360574", "0.542045", "0.5377586", "0.5373938", "0.53502643", "0.53370655", "0.5312367", "0.53057307", "0.5300275", "0.5294478", "0.52780265", "0.52780265", "0.52302533", "0.5196543", "0.5171336", "0.5158706", "0.5132028", "0.51310164", "0.5130058", "0.5119702", "0.51159704", "0.5100412", "0.50685084", "0.50624406", "0.50566083", "0.5054253", "0.50537556", "0.503518", "0.5004284", "0.49816564", "0.4978303", "0.4972001", "0.4971024", "0.49708018", "0.49573165", "0.49561253", "0.49526173", "0.49487337", "0.49407145", "0.4933378", "0.49281147", "0.4927182", "0.49180922", "0.49083948", "0.4896733", "0.48949188", "0.4891751", "0.4891329", "0.4884395", "0.4865809", "0.48646125", "0.4858723", "0.48552677", "0.48491848", "0.484206", "0.483714", "0.4836873", "0.4836873", "0.48360255", "0.48256642", "0.4815404", "0.480712", "0.480712", "0.48036897", "0.48033616", "0.47976932", "0.47959524", "0.4792813", "0.47850934", "0.4778193", "0.4771271", "0.47691923", "0.47691923", "0.47679338", "0.47673398", "0.47659123", "0.47640988", "0.4759679", "0.47558495", "0.47539717", "0.474966", "0.47495386", "0.47451764", "0.47376737", "0.47368103", "0.47287714", "0.47269833", "0.4725808", "0.4725583", "0.47228462", "0.47178563", "0.47172922", "0.47161776", "0.47158825" ]
0.66784656
0
Create new exception instance with EXCEPTION_THROWN status.
public static function exceptionThrown(string $name, \Exception $e) { return new static( $name, 'Pipe "'.$name.'" failed due to exception (message: "'.$e->getMessage().'", code: '.$e->getCode().').', static::EXCEPTION_THROWN, $e ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }", "public static function httpStatusException($message)\n {\n return new self($message, self::HTTP_STATUS_EXCEPTION);\n }", "public static function createHttpStatus($messageBody = 'Internal Error', $httpCode = self::CODE_HTTP_INTERNAL_ERROR, $resource = null, $previous = null){\n $exp = new Exception($messageBody, self::CODE_PRETTY_HTTP_STATUS, $previous);\n $exp->setHttpCode($httpCode);\n $exp->setWebResource($resource);\n return $exp;\n }", "static function throwError($message = 'Something went from with DTWENTY', $code = 500)\n {\n throw new D20Exception($message);\n }", "public function toException()\n {\n if ($this->failed()) {\n return new RequestException($this);\n }\n }", "public static function createFromException(\\Throwable $e) {\n while ($e) {\n if ($e instanceof EnforcedResponseException) {\n return new static($e->getResponse());\n }\n\n $e = $e->getPrevious();\n }\n }", "public function getException(): Throwable;", "public function getException(): Throwable;", "public static function makeException($message = \"\", $code = 0, $previous = NULL) {\n $trace = debug_backtrace();\n\n $callingClass = '';\n if (!empty($trace[1]['class'])) {\n $callingClass = $trace[1]['class'];\n }\n\n $excClassName = self::getExceptionClass($callingClass);\n\n return new $excClassName($message, $code, $previous);\n }", "public static function unexpected(): self\n {\n return new self(299, 200);\n }", "function throw_exception($message,$statusCode = 1004)\n {\n throw new \\think\\exception\\HttpException($statusCode,$message);\n }", "public static function fromThrowable(\\Exception $exception, $data = null) {\n return new static($data, $exception->getMessage(), $exception->getCode(), $exception);\n }", "public function testExceptionWithMessage()\n {\n throw new ThumbNotFoundException('Thumb not found!');\n }", "static public function exception($class, $message = '', $code = 0)\n {\n $class = (string) $class;\n\n self::loadClass($class);\n\n $exception = new $class($message, $code);\n\n if (!$exception instanceof Exception) {\n throw new Zend_Exception('Invalid exception class used in Zend::exception()');\n }\n\n return $exception;\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "public function create()\n {\n throw new Exception('Not yet implemented');\n }", "public function throwException($flag){ \r\n\t\tExceptionHandler::instance()->throwException($flag);\r\n\t\treturn $this;\r\n\t}", "public function throwError();", "public function testConstructWithInvalidStatusThrowsException($status)\n\t{\t\t\n\t\t$this->setExpectedException('InvalidArgumentException');\n\t\t$timeSheetStatusChange = new TimeSheetStatusChange($status);\n\t}", "public static function createFromException(string $message, Throwable $exception): self\n {\n return new static($message, $exception->getCode(), $exception->getFile(), $exception->getLine(), $exception);\n }", "public static function missinglogic($message)\n {\n return new static(\"Error exception:\\t\".$message);\n }", "public static function gone($message = '', \\Exception $previous = NULL)\n {\n return new self($message, 410, $previous);\n }", "private function exceptionTraceArgsHelper(string $message): \\Exception\n {\n return new \\Exception($message);\n }", "public static function sendException(\\Throwable $exception): void\n {\n if (!static::hasNewRelic()) {\n return;\n }\n\n $exceptionClass = get_class($exception);\n if (in_array($exceptionClass, static::$ignoredExceptions)) {\n return;\n }\n\n newrelic_notice_error($exception);\n }", "public function throwException($bag, $message = null, $code = 400, Throwable $previous = null)\n {\n $exception = $this->exception;\n throw new $exception($bag, $message, $code, $previous);\n }", "public function __construct(Exception $exception) {\n\n\t\t// merge required status codes with additional ones found in the configfile\n\t\t$this->statusCodes = Hash::mergeDiff(Configure::read('RestKit.statusCodes'), $this->statusCodes);\n\n\t\tparent::__construct($exception);\n\t}", "public function testCreateUnsuccessfulReason()\n {\n }", "public function testOrderStatusUnshipped() : void \n {\n $values = ['Unshipped'];\n $this->expectException(\\Exception::class);\n $type = new OrderStatus($values);\n }", "protected function createExceptionFromLastError(string $function): ConnectionException\n {\n $this->close();\n\n return new ConnectionException($function.' failed');\n }", "public static function clientError(): self\n {\n return new self(400, 499);\n }", "public function sendHttpStatusCode()\n {\n http_response_code($this->httpResponseCode);\n\n return $this;\n }", "public function getException();", "public function testWithExpectedException(): void\n {\n $this->get('/tests_apps/throw_exception');\n $this->assertResponseCode(500);\n }", "public function __construct($title, $message, $template = false)\n {\n Exception::__construct($message);\n\n $this->code = $title;\n\n if ($template !== false) {\n $this->template = $template;\n }\n }", "public function createRejected($reason);", "public static function create(int $code, ServerRequestInterface $request, ?Throwable $previous=null): self {\n\t\tif (!in_array($code, array_keys(self::EXC_INFO))) {\n\t\t\t$code = 0;\n\t\t}\n\t\t$message = self::EXC_INFO[$code]['name'];\n\t\t$e = new self($message, $code, $previous);\n\t\t$e->request = $request;\n\t\treturn $e;\n\t}", "protected function throwFail(): void\n {\n throw new Exception($this->failMessage[1], $this->failMessage[0], [var_export($this->validatingValue, true)]);\n }", "public function convertException(Throwable $exception): Throwable;", "public function raise() {\n throw $this;\n }", "public static function occurred(array $context): self\n {\n return new RequestException(\n \"There was an error requesting the Model\",\n 500,\n null,\n $context\n );\n }", "public static function tooManyRequests($message = '', \\Exception $previous = NULL)\n {\n return new self($message, 429, $previous);\n }", "public function setException(\\Exception $exception)\r\n\t{\r\n\t\t$this->_exception = $exception;\r\n\t\t$this->_status = false;\r\n\t\treturn $this;\r\n\t}", "private function throwException()\n {\n throw new CacheException(\\odbc_errormsg(), (int) \\odbc_error());\n }", "protected function prepareException(Exception $e)\n {\n if ($e instanceof AuthorizationException) {\n $e = new HttpException(403, $e->getMessage());\n }\n\n return $e;\n }", "protected function requestExceptionWithResponse()\n {\n $exception = function ($request) {\n return new RequestException(\n 'test',\n $request,\n Litecoin\\LitecoindResponse::createFrom($this->rawTransactionError())\n );\n };\n\n return $exception;\n }", "public function failed()\n {\n $this->status = JSendResponse::STATUS_FAIL;\n\n return $this;\n }", "public function testException()\n {\n throw new Exception('This is not expected.');\n }", "protected function throwUnableToCreate()\n {\n throw new FilesystemException(\"Unable to create the file '{$this->path}'. A directory with the same path already exists.\");\n }", "public function createTrace(\\Exception $exception)\n {\n $trace = array();\n\n // Except for FatalErrorException, the first frame of \\ErrorException stacktrace\n // refers to the error handler which is not useful.\n if (!$exception instanceof \\ErrorException || $exception instanceof FatalErrorException) {\n $trace[] = $this->getExceptionFrame($exception);\n }\n\n return new Trace($this->transform(array_merge($trace, $exception->getTrace())));\n }", "protected function requestExceptionWithoutResponse()\n {\n $exception = function ($request) {\n return new RequestException('test', $request);\n };\n\n return $exception;\n }", "public function testCreatedException()\n {\n $this->expectException(DomainException::class);\n County::create('County One',0, 200);\n }", "public function __construct(Exception $exception)\n {\n $this->exception = get_class($exception);\n $this->message = $exception->getMessage();\n $this->code = $exception->getCode() ? $exception->getCode() : 400;\n }", "public function throw()\n {\n $callback = func_get_args()[0] ?? null;\n\n if ($this->failed()) {\n throw tap($this->toException(), function ($exception) use ($callback) {\n if ($callback && is_callable($callback)) {\n $callback($this, $exception);\n }\n });\n }\n\n return $this;\n }", "public function __construct(Exception $previous = null, $headers = [], $code = 0)\n {\n $message = 'EXCEPTION_EXOTEL_CONFIG_EXCEPTION';\n parent::__construct(400, $message ?: 'You have some exotel exception.', $previous, $headers, $code);\n }", "public static function forbidden($message = '', \\Exception $previous = NULL)\n {\n return new self($message, 403, $previous);\n }", "public function catchException()\n {\n // get the current exception\n $e = $this->getException();\n\n // throw a copy, with the original as the previous exception so that\n // we can see a full trace.\n $class = get_class($e);\n throw new $class($e->getMessage(), $e->getCode(), $e);\n }", "public function testCreateExceptionWithoutAnyArguments()\n {\n new ConfigurationException();\n }", "public function testCreateFail()\n {\n // fail\n (new ExperimentRecruitingTokenResponse())->create(-1, 'fail', -1);\n }", "public static function create(...$args): self\n {\n $ex = end($args) instanceof \\Throwable ? array_pop($args) : null;\n $message = sprintf(...$args);\n\n return new static($message, 0, $ex);\n }", "public static function failed(): self\n {\n return self::getInstance('FAILED');\n }", "function raise(\\Exception $ex);", "public function __construct($payload, $exception, $worker, $queue) {\n\t\tif (!isset($payload['retrying']) || !$payload['retrying'] || $payload['retryDelay'] <= 0) {\n\t\t\treturn parent::__construct($payload, $exception, $worker, $queue);\n\t\t}\n\n\t\t$retryDelay = $payload['retryDelay'];\n\n\t\t$data = new stdClass;\n\t\t$data->failed_at = strftime('%a %b %d %H:%M:%S %Z %Y');\n\t\t$data->payload = $payload;\n\t\t$data->exception = get_class($exception);\n\t\t$data->error = $exception->getMessage();\n\t\t$data->backtrace = explode(\"\\n\", $exception->getTraceAsString());\n\t\t$data->worker = (string)$worker;\n\t\t$data->queue = $queue;\n\t\t$data->retry_delay = $retryDelay;\n\t\t$data->retried_at = strftime('%a %b %d %H:%M:%S %Z %Y', $payload['retryingAt']);\n\t\t$data = json_encode($data);\n\n\t\tResque::redis()->rpush('failed', $data);\n\t}", "final public static function getBaseException(\\Exception $exception)\n {\n while ($exception->getPrevious() !== null) {\n $exception = $exception->getPrevious();\n }\n\n return $exception;\n }", "function throwAt($timing, $method, $exception = false, $args = false) {\n $this->dieOnNoMethod($method, \"throw at\");\n $this->actions->registerAt($timing, $method, $args,\n new SimpleThrower($exception ? $exception : new Exception()));\n }", "public function createException($message = '', $code = 0, $previous = null)\n {\n return new RootException($message, $code, $previous);\n }", "private function createStatusErrorResponse(): stdClass\n {\n $response = new stdClass();\n $response->statusErrors = new stdClass();\n $response->statusErrors->error = new stdClass();\n $response->statusErrors->error->_ = 'Order could not be found with the given key.';\n $response->statusErrors->error->code = 'REQUEST_DATA_INCORRECT';\n\n return $response;\n }", "public function setExceptionClass($className){\n $this->exceptionClass = $className;\n return $this;\n }", "public function setStatusDenied()\n {\n $this->status = 'DENIED';\n\n return $this;\n }", "public function makeErrorAction()\n {\n // test this\n\n $this->app->abort(404, 'I am a code generated 404 error message');\n\n }", "public function abort($code, $message = '', array $headers = array())\n\t{\n\t\tthrow new HttpException($code, $message, null, $headers);\n\t}", "public function testThrowException()\n {\n throw new ImageNotReadableException();\n }", "public static function sendException($exception)\r\n {\r\n $emails = Config::inst()->get(self::class, 'Emails');\r\n if ($emails) {\r\n $emails = explode(\",\", $emails);\r\n $email = new Email();\r\n $email\r\n ->setTo($emails)\r\n ->setSubject('SilverStripe Hail module fetch error on ' . SiteConfig::current_site_config()->getTitle() . ' (' . gethostname() . ')')\r\n ->setBody(\"<p>Hi,</p><p>An error occurred while fetching from the Hail API: </p> <p>{$exception->getMessage()}</p><p>Website name: \" . SiteConfig::current_site_config()->getTitle() . \"</p><p>Website Folder: \" . Director::baseFolder() . \"</p><p>Server hostname: \" . gethostname() . \"</p>\");\r\n $email->send();\r\n }\r\n }", "public function __construct($message = \"\", $code = 0, Exception $previous = null)\n {\n parent::__construct($message, $code, $previous);\n $exception = new \\App\\Exception();\n $exception -> message = $message;\n $exception -> code = (int)$code;\n $exception -> type = 'exception';\n $exception -> trace = $this->getTraceAsString();\n $exception -> save();\n }", "public function testCreatePayloadFailedRaiseException()\n {\n $user = factory(User::class)->create();\n $webhook = factory(Webhook::class)->create(['user_id' => $user->id]);\n $this->actingAs($user);\n\n $mock = Mockery::mock(PayloadRepository::class);\n $mock->shouldReceive('create')->andThrowExceptions([new QueryException('', [], new Exception)]);\n $this->app->instance(PayloadRepository::class, $mock);\n\n $response = $this->post(route('webhooks.payloads.store', $webhook), [\n 'content' => 'Hi my name is {{name}}',\n 'params' => '{\"name\": \"rasmus\", \"age\": \"30\"}',\n 'fields' => ['name', 'age'],\n 'operators' => ['==', '>='],\n 'values' => ['rammus', '30']\n ]);\n\n $this->assertEquals(0, Payload::all()->count());\n $this->assertEquals(0, Condition::all()->count());\n }", "public function testThrowException(): void\n {\n throw new Exception();\n }", "public function __construct(GuzzleException $previous, bool $useStatusCode = false)\n {\n /** @var \\GuzzleHttp\\Psr7\\Response|null $response */\n $response = method_exists($previous, 'getResponse') ? $previous->getResponse() : null;\n\n if ($useStatusCode) {\n $this->statusCode = is_null($response) ? 500 : $response->getStatusCode();\n }\n\n parent::__construct(trans('admin/server.exceptions.daemon_exception', [\n 'code' => is_null($response) ? 'E_CONN_REFUSED' : $response->getStatusCode(),\n ]), $previous, DisplayException::LEVEL_WARNING);\n }", "function __construct($exception) {\n $this->exception = $exception;\n }", "public static function error(string $message = null, int $code = 400, Throwable $exception = null) : object\n {\n $integerCode = ($code == '0' || !is_numeric($code)) ? 500 : $code;\n $code = (in_array($integerCode,static::$validCodes,true)) ? $integerCode : 500;\n $trace = (isThrowableInstance($exception)) ? $exception : debug_backtrace();\n $classBaseName = class_basename($trace);\n\n if($classBaseName=='NotFoundHttpException'){\n $code = 404;\n }\n\n $standard = [\n 'status' => false,\n 'code' => $code,\n 'client' => ApiKey::who(),\n 'env' => config('app.env'),\n 'responseTime' => Date::now(),\n 'responseCode' => static::responseCode(),\n 'errorInput' => static::errorInput(),\n 'exception' => $classBaseName,\n 'errorMessage' => static::getExceptionMessageForEnvironment($message,$code),\n 'endpoint' => request()->url(),\n 'rules' => [static::rules()],\n ];\n\n return static::response(\n array_merge($standard,static::throwIn($trace,$code,$message)),\n $code\n );\n }", "public function testApiError()\n {\n $this->client->shouldReceive('send')->once()->andReturn(\n new Response(200, [], file_get_contents(__DIR__ . '/../Fixtures/access-denied.json'))\n );\n\n $this->expectException(PushwooshException::class);\n $this->expectExceptionMessage('Access denied or application not found');\n\n $this->pushwoosh->createMessage(\n new PushwooshPendingMessage($this->pushwoosh)\n );\n }", "public static function unknownError(): self {\n\t\treturn new static(101);\n\t}", "public function testException() {\n\t\ttry {\n\t\t\t$array = array( 'ABC' );\n\t\t\t$percentages = new Percentages( $array );\n\t\t} catch ( \\RuntimeException $expected ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->fail( 'An expected exception has not been raised.' );\n\t}", "function returnError($message, $code)\n{\n throw new \\Exception($message, $code);\n}", "function testrateException()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::rate(20, -36.157534, 255, 0, 3);\n\t}", "protected static function createException($value, $message, $code, $propertyPath = null, array $constraints = array())\n {\n $exceptionClass = static::$exceptionClass;\n\n return new $exceptionClass($message, ReturnCode::INVALID_ARGUMENT, $propertyPath, $value, $constraints);\n }", "public function setStatus($status, \\Throwable $e = null)\n {\n if (!($packet = $this->getPacket())) {\n $shifts = debug_backtrace();\n while($item = array_shift($shifts)) {\n if(empty($item['file'])) {\n $item['file'] = '';\n }\n if(stripos($item['file'], 'Foundation/Retry') !== false && $item['function'] === '_exec') break;\n }\n array_splice($shifts, 3);\n $packet = array(\n 'id' => $this->id,\n 'queue' => $this->queue,\n 'payload' => $this->payload,\n 'worker' => '',\n 'status' => $status,\n 'created_by' => json_encode(array_map(function($item) {\n if(empty($item['line'])) $item['line'] = 'na';\n if(empty($item['file'])) $item['file'] = 'na';\n if(empty($item['function'])) $item['function'] = 'na';\n if(empty($item['args'])) $item['args'] = [];\n return array(\n 'origin' => str_replace($GLOBALS['system_root'], \"\", $item['file']) . ':' . @$item['line'] . ' ' . @$item['function'],\n 'args' => $item['args'],\n );\n }, $shifts)),\n 'created' => microtime(true),\n 'updated' => microtime(true),\n 'delayed' => 0,\n 'started' => 0,\n 'finished' => 0,\n 'output' => '',\n 'exception' => null,\n );\n }\n\n $packet['worker'] = (string)$this->worker;\n $packet['status'] = $status;\n $packet['updated'] = microtime(true);\n\n if ($status == Job::STATUS_RUNNING) {\n $packet['started'] = microtime(true);\n }\n\n if (in_array($status, self::$completeStatuses)) {\n $packet['finished'] = microtime(true);\n if($status == Job::STATUS_COMPLETE) $packet['progress'] = 100;\n }\n\n if ($e && (!$e instanceof \\Core\\Job\\RetryException)) {\n if($packet['exception']) {\n $exceptionPacket = json_decode($packet['exception'], true);\n } else {\n $exceptionPacket = [];\n }\n\n if(count($exceptionPacket) > 5) {\n array_splice($exceptionPacket, 0, count($exceptionPacket) - 5);\n } \n\n if(empty($packet['failed_count'])) {\n $packet['failed_count'] = 0;\n }\n $exceptionPacket[] = array(\n 'attempt' => $packet['failed_count'] + 1,\n 'class' => get_class($e),\n 'error' => sprintf('%s in %s on line %d', $e->getMessage(), $e->getFile(), $e->getLine()),\n 'backtrace' => explode(\"\\n\", $e->getTraceAsString())\n );\n $packet['exception'] = json_encode($exceptionPacket);\n }\n\n $this->redis->hmset(self::redisKey($this), $packet);\n // $this->redis->hincrby(self::redisKey($this), ['exec_time' => $this->execTime()]);\n\n // Expire the status for completed jobs\n if (in_array($status, self::$completeStatuses)) {\n $expiryTime = \\Resque::getConfig('default.expiry_time', \\Resque::DEFAULT_EXPIRY_TIME);\n\n $this->redis->expire(self::redisKey($this), $expiryTime);\n\n if($this->isPerformedOnBot) {\n $lastRun = intval($this->redis->hget('jobs:stat:' . $this->getPresentation(), 'recent'));\n $frequency = intval($this->redis->hget('jobs:stat:' . $this->getPresentation(), 'frequency'));\n $this->redis->zincrby('jobs:time', $this->execTime(), $status . \"::\" . $this->getPresentation());\n $this->redis->zincrby('jobs:count', 1, $status . \"::\" . $this->getPresentation());\n\n $stat = [\n 'class_name' => $this->getClass(),\n 'recent' => time(),\n 'frequency' => ($lastRun > 0) ? ((time() - $lastRun + ( $frequency > 1 ? $frequency : 1)) / 2) : 1,\n\n ];\n\n $this->redis->hmset('jobs:stat:' . $this->getPresentation(), $stat);\n }\n\n }\n }", "function ensure($condition, $error_message) {\n if (!$condition) {\n $e = new Exception($error_message);\n throw $e;\n }\n}", "public function testHttpExceptionPresenter() :void\n {\n $e = new HttpException(500);\n $response = (new HttpExceptionPresenter($e))->response();\n $expected = [[\n 'status' => 500,\n 'title' => 'An unknown error has occurred'\n ]];\n\n $this->assertEquals($expected, $response);\n }", "public function onException(Exception $err): Effect|Response;", "function raise($message) {\n\t\t\t$error_message = \"Model Class: \".$this->get_class_name().\"<br />\";\n\t\t\t$error_message .= \"Error Message: \".$message;\n\t\t\tthrow new ActiveRecordException($error_message, \"500\");\n\t\t}", "public static function generate(RequestException $e)\n {\n switch (static::errorNumber($e)) {\n case 7:\n return 503;\n break;\n case 28:\n return 504;\n break;\n default:\n return 500;\n break;\n }\n }", "public function testSendRequestException()\n {\n $exception = new RequestException(\n 'Something went terribly wrong',\n $this->request\n );\n\n $this->client->expects($this->once())\n ->method('send')\n ->with($this->request)\n ->will($this->throwException($exception));\n\n $this->setExpectedException(\n 'RuntimeException',\n 'Something went terribly wrong'\n );\n\n $this->object->send($this->request);\n }", "public function testUnsetException()\n {\n $object = new Throwable;\n $object->get();\n }", "public function __construct(string $message, Throwable $e, int $code = 0, array $headers = [])\n {\n parent::__construct(403, $message, $e, $headers, $code);\n }", "public function testExceptionIsThrownWhenRateLimitIsReached()\n {\n $passwordFile = 'hit_rate_limit.txt';\n $password = 'password';\n $hibp = $this->createHibpWithMockedClientResponse(__DIR__ . '/_files/' . $passwordFile);\n $this->expectException(\\RuntimeException::class);\n $hibp->isPwnedPassword($password);\n $this->fail('Expected exception for hit rate was not triggered');\n }", "public function abortIfRequestHasFailed(?string $message = null): void\n {\n $statusCode = $this->getStatusCode();\n\n if ($statusCode >= 400 && $statusCode < 600) {\n throw new HttpException($this, $message);\n }\n }", "public function failed(UserCreated $userCreatedEvent, $exception)\n {\n //\n }", "public function __construct($exceptions = false)\n {\n }", "public function storageSerializerFactoryNewInstanceException(IntegrationTester $I)\n {\n $I->wantToTest('Storage\\SerializerFactory - newInstance() - exception');\n\n $name = uniqid();\n $I->expectThrowable(\n new Exception('Service ' . $name . ' is not registered'),\n function () use ($name) {\n $serializer = new SerializerFactory();\n $adapter = new AdapterFactory($serializer);\n\n $service = $adapter->newInstance($name);\n }\n );\n }", "public function enableExceptions()\n {\n $this->throwException = true;\n }", "public function throwExceptions($state)\r\n {\r\n $this->_frontController->throwExceptions($state);\r\n }" ]
[ "0.6047018", "0.5504797", "0.50828433", "0.50808585", "0.50643855", "0.5048091", "0.5035881", "0.5035881", "0.50031996", "0.49794927", "0.49740174", "0.4940508", "0.48400757", "0.48311758", "0.48148528", "0.47601962", "0.47592512", "0.47174627", "0.4714104", "0.47020203", "0.46205747", "0.46072158", "0.4555211", "0.45386574", "0.45360887", "0.45235214", "0.45151946", "0.45126", "0.45122975", "0.45035878", "0.45003322", "0.44868097", "0.44837454", "0.44671154", "0.44630355", "0.4462558", "0.44293243", "0.44286522", "0.44213805", "0.4387569", "0.43871534", "0.43857756", "0.43789726", "0.4376619", "0.4374336", "0.4372085", "0.43624625", "0.43585938", "0.43541184", "0.43487266", "0.43420997", "0.43372703", "0.43362913", "0.43331745", "0.43300048", "0.43290192", "0.432743", "0.432137", "0.43124786", "0.43078834", "0.43072057", "0.43056712", "0.42995065", "0.4297943", "0.4288336", "0.4288273", "0.42852485", "0.42730612", "0.42712268", "0.4264454", "0.42582598", "0.4256154", "0.42554042", "0.42535877", "0.42486468", "0.42284027", "0.42247453", "0.4224583", "0.42126086", "0.42120546", "0.42112294", "0.42105561", "0.42079514", "0.42057005", "0.41998753", "0.4198819", "0.4192133", "0.4187542", "0.41821188", "0.41813633", "0.417732", "0.41745517", "0.41690835", "0.4166963", "0.41668484", "0.41626674", "0.41610694", "0.415491", "0.41526958", "0.41457865" ]
0.5032825
8
Create new exception instance with REJECTED status.
public static function rejected(string $name) { return new static( $name, 'Pipe "'.$name.'" has been rejected.', static::REJECTED ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createRejected($reason);", "public function setStatusDenied()\n {\n $this->status = 'DENIED';\n\n return $this;\n }", "public function reject()\n {\n $url = URIResource::Make($this->path, array($this->id));\n $data = new DataPacket(array(\"state\" => CALL_STATES::rejected));\n $this->client->post($url, $data->get());\n\n return Constructor::Make($this, $data->get());\n }", "private function createNotDeletableException()\n {\n throw new RuntimeException(sprintf(\n 'The entities of type \"%s\" cannot be deleted from its repository.',\n $this->getEntityServiceName()\n ));\n }", "public static function forbidden($message = '', \\Exception $previous = NULL)\n {\n return new self($message, 403, $previous);\n }", "public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }", "public function reject()\n {\n return $this->setStatus(self::STATUS_REJECTED);\n }", "private function createBadRequestResponse(): Response\n {\n return new Response(\n $this->getStatusTextForResponseCode(Response::HTTP_BAD_REQUEST),\n Response::HTTP_BAD_REQUEST\n );\n }", "public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }", "public function reject() {\n }", "public function toException()\n {\n if ($this->failed()) {\n return new RequestException($this);\n }\n }", "public function cant_create_with_wrong_status()\n {\n $project = factory(Project::class)->raw(['status' => $this->faker->word]);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'status',\n ],\n ]);\n }", "public function createForbidden($message = 'Forbidden')\n {\n return $this->createWithError($message, 403, self::CODE_FORBIDDEN);\n }", "public function create()\n {\n throw new Exception('Not yet implemented');\n }", "public function throwForbidden()\n {\n throw new Exception\\ForbiddenException('Forbidden', 1449130939);\n }", "private function createNotReadableException()\n {\n throw new RuntimeException(sprintf(\n 'It is not possible to read entities of type \"%s\" from its repository.',\n $this->getEntityServiceName()\n ));\n }", "protected function getBadRequestResponse()\n {\n $response = new Response();\n $response->setStatusCode(400);\n $response->setContent('Bad request');\n\n return $response;\n }", "protected function throwInaccessibleException() {}", "public function __construct(string $message, Throwable $e, int $code = 0, array $headers = [])\n {\n parent::__construct(403, $message, $e, $headers, $code);\n }", "public static function createHttpStatus($messageBody = 'Internal Error', $httpCode = self::CODE_HTTP_INTERNAL_ERROR, $resource = null, $previous = null){\n $exp = new Exception($messageBody, self::CODE_PRETTY_HTTP_STATUS, $previous);\n $exp->setHttpCode($httpCode);\n $exp->setWebResource($resource);\n return $exp;\n }", "public static function reject() {\n return new Reject('Not match Reference');\n }", "public function withUnprocessableEntity($message = 'Unprocessable Entity')\n {\n return $this->setStatusCode(\n HttpStatus::HTTP_UNPROCESSABLE_ENTITY\n )->withMessage($message);\n }", "public function prohibited(string|int|float $message): self\n {\n return $this->addMessage(new Prohibited($message));\n }", "public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }", "public function create()\n {\n abort(403);\n }", "public function throwNotAcceptable()\n {\n throw new Exception\\NotAcceptableException('Not Acceptable', 1449131015);\n }", "public function reject($msg, $status_code = 500){\n\t\treturn response($msg, $status_code);\n\t}", "public static function httpStatusException($message)\n {\n return new self($message, self::HTTP_STATUS_EXCEPTION);\n }", "private function createStatusErrorResponse(): stdClass\n {\n $response = new stdClass();\n $response->statusErrors = new stdClass();\n $response->statusErrors->error = new stdClass();\n $response->statusErrors->error->_ = 'Order could not be found with the given key.';\n $response->statusErrors->error->code = 'REQUEST_DATA_INCORRECT';\n\n return $response;\n }", "public function testConstructWithInvalidStatusThrowsException($status)\n\t{\t\t\n\t\t$this->setExpectedException('InvalidArgumentException');\n\t\t$timeSheetStatusChange = new TimeSheetStatusChange($status);\n\t}", "public static function forbidden($message = 'Forbidden.')\n {\n throw new ResponseException($message, 403);\n }", "public function testCreateUnsuccessfulReason()\n {\n }", "public function createBadRequestResponse($message = 'Bad Request.')\n\t{\n\t\treturn new Response($message, 400);\n\t}", "protected function prepareException(Exception $e)\n {\n if ($e instanceof AuthorizationException) {\n $e = new HttpException(403, $e->getMessage());\n }\n\n return $e;\n }", "public function create()\n {\n //Create rejection\n return view('rejection.create');\n }", "protected static function createException($value, $message, $code, $propertyPath = null, array $constraints = array())\n {\n $exceptionClass = static::$exceptionClass;\n\n return new $exceptionClass($message, ReturnCode::INVALID_ARGUMENT, $propertyPath, $value, $constraints);\n }", "private function createNotWritableException()\n {\n throw new RuntimeException(sprintf(\n 'The entities of type \"%s\" cannot be written to its repository.',\n $this->getEntityServiceName()\n ));\n }", "public function assertForbidden(): self\n {\n PHPUnit::assertSame(\n 403, $this->response->getStatusCode(),\n 'Response status code [' . $this->response->getStatusCode() . '] is not a forbidden status code.'\n );\n\n return $this;\n }", "public function testCreateFail()\n {\n // fail\n (new ExperimentRecruitingTokenResponse())->create(-1, 'fail', -1);\n }", "protected function requestExceptionWithoutResponse()\n {\n $exception = function ($request) {\n return new RequestException('test', $request);\n };\n\n return $exception;\n }", "protected function throwFail(): void\n {\n throw new Exception($this->failMessage[1], $this->failMessage[0], [var_export($this->validatingValue, true)]);\n }", "public function createInvalidArgumentException($message = '')\n {\n $mock = $this->mock('InvalidArgumentException')\n ->new($message);\n\n return $mock;\n }", "public static function reject() {\n return new Reject('Not match Atom in []');\n }", "public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }", "public static function withRejected()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->withRejected();\n }", "public static function unauthorized($message = '', \\Exception $previous = NULL)\n {\n return new self($message, 401, $previous);\n }", "public function testInvalidEnum()\n {\n $this->expectException(UnexpectedValueException::class);\n\n $createPaymentAccountRequest = new CreatePaymentAccountRequest(\n 'Valid Description',\n 'INVALID_ENUM_VALUE'\n );\n }", "public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}", "public static function createReject($promiseOrValue);", "public static function rejected()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->rejected();\n }", "function reject(Transaction $transaction, $description)\n {\n return $this->addStatus($transaction,TransactionStatus::STATUS_REJECTED,$description);\n }", "public function rejectTitle(?string $title): self\n {\n $new = clone $this;\n $new->rejectTitle = $title;\n\n return $new;\n }", "public static function reject() {\n return new Reject('Not match Organic Subset');\n }", "public function createUnauthorized($message = 'Unauthorized')\n {\n return $this->createWithError($message, 401, self::CODE_UNAUTHORIZED);\n }", "public static function buildBadRequestErrorResponse(string $message = \"\"): static\n {\n $dto = new static();\n $dto->setCode(Response::HTTP_BAD_REQUEST);\n $dto->setSuccess(false);\n $dto->setMessage($message);\n\n return $dto;\n }", "public function __construct($title, $message, $template = false)\n {\n Exception::__construct($message);\n\n $this->code = $title;\n\n if ($template !== false) {\n $this->template = $template;\n }\n }", "public static function createFromException(\\Throwable $e) {\n while ($e) {\n if ($e instanceof EnforcedResponseException) {\n return new static($e->getResponse());\n }\n\n $e = $e->getPrevious();\n }\n }", "public function throw404($message = \"\")\n {\n $this->assignation['errorMessage'] = $message;\n\n return new Response(\n $this->getTwig()->render('404.html.twig', $this->assignation),\n Response::HTTP_NOT_FOUND,\n ['content-type' => 'text/html']\n );\n }", "public static function badRequest($message = '', \\Exception $previous = NULL)\n {\n return new self($message, 400, $previous);\n }", "public function testCreateReviewException()\n {\n $criticClient = $this->getClientWithMockResponses([\n new \\GuzzleHttp\\Psr7\\Response(200, [], json_encode(['id' => '1234'])),\n ]);\n\n $criticClient->createReview($this->postFields, '', '');\n }", "public static function create(int $code, ServerRequestInterface $request, ?Throwable $previous=null): self {\n\t\tif (!in_array($code, array_keys(self::EXC_INFO))) {\n\t\t\t$code = 0;\n\t\t}\n\t\t$message = self::EXC_INFO[$code]['name'];\n\t\t$e = new self($message, $code, $previous);\n\t\t$e->request = $request;\n\t\treturn $e;\n\t}", "function throw_exception($message,$statusCode = 1004)\n {\n throw new \\think\\exception\\HttpException($statusCode,$message);\n }", "static public function exception($class, $message = '', $code = 0)\n {\n $class = (string) $class;\n\n self::loadClass($class);\n\n $exception = new $class($message, $code);\n\n if (!$exception instanceof Exception) {\n throw new Zend_Exception('Invalid exception class used in Zend::exception()');\n }\n\n return $exception;\n }", "protected function throwUnableToCreate()\n {\n throw new FilesystemException(\"Unable to create the file '{$this->path}'. A directory with the same path already exists.\");\n }", "private function create404()\n {\n $this->response->setStatusCode(404);\n\n $url = $this->request->originalUrl ?: $this->request->getUrl();\n $escaper = new Escaper();\n $message = sprintf(\n \"Cannot %s %s\\n\",\n $escaper->escapeHtml($this->request->getMethod()),\n $escaper->escapeHtml((string) $url)\n );\n $this->response->end($message);\n }", "protected function unavailable(Request $request): Response\n {\n return new Response([\n 'errors' => [[\n 'status' => '403',\n 'title' => Response::$statusTexts[403],\n 'detail' => 'This action is unavailable',\n ]],\n 'meta' => new \\stdClass(),\n 'links' => [\n '_self' => $request->fullUrl(),\n ],\n ], 403);\n }", "public function reject()\n {\n $this->channel->basic_reject(\n $this->tag(),\n true\n );\n }", "protected function respuestaForbiddenRequest($message)\n {\n return new RespuestaConEstado(\n RespuestaConEstado::STATUS_FORBIDDEN,\n RespuestaConEstado::CODE_FORBIDDEN,\n $message\n );\n }", "public function testCreateReviewGuzzleException()\n {\n $criticClient = $this->getClientWithMockResponses([\n new \\GuzzleHttp\\Psr7\\Response(401, [], json_encode([])),\n ]);\n\n $criticClient->createReview(\n $this->postFields,\n 'someClientId',\n 'someClientSecret'\n );\n }", "public static function reject($id)\n {\n return Order::where('id',$id)\n ->update(['status'=>'CANCELLED']);\n }", "public function create(Request $request)\n {\n throw new Exception(\"Error Processing Request\", 1);\n \n }", "public static function missinglogic($message)\n {\n return new static(\"Error exception:\\t\".$message);\n }", "public static function gone($message = '', \\Exception $previous = NULL)\n {\n return new self($message, 410, $previous);\n }", "public function failed()\n {\n $this->status = JSendResponse::STATUS_FAIL;\n\n return $this;\n }", "public function testCreateFailPrivateConstructor() {\n $this->expectException(Exception::class);\n $this->_createCreator()->create(ConstructTest\\PrivateConstruct::class);\n }", "public function disabled()\n\t{\n\t\t$this->disabled = true;\n\t\treturn $this;\n\t}", "public function forbidden() {\n return $this->setStatus(403);\n }", "public function setStatusCancelled()\n {\n $this->status = 'CANCELLED';\n\n return $this;\n }", "public function testSubjectDeniedInvalid()\n {\n $policy = Policy::instance()->hasUsername('ccornutt');\n $policySet = PolicySet::instance()->add('policy1', $policy);\n\n $subject = new Subject((object)['username' => 'ccornutt']);\n\n $en = new Enforcer($policySet);\n $this->assertFalse($en->denies('policy1', $subject));\n }", "public function createNotFound($message = 'Resource Not Found')\n {\n return $this->createWithError($message, 404, self::CODE_NOT_FOUND);\n }", "public function __construct($message = \"Forbidden\", $code = 403, $previous = null) {\n parent::__construct($message, $code, $previous);\n }", "public function testCreatedException()\n {\n $this->expectException(DomainException::class);\n County::create('County One',0, 200);\n }", "public function testOrderStatusUnshipped() : void \n {\n $values = ['Unshipped'];\n $this->expectException(\\Exception::class);\n $type = new OrderStatus($values);\n }", "public function __construct(Exception $previous = null, $headers = [], $code = 0)\n {\n $message = 'EXCEPTION_EXOTEL_CONFIG_EXCEPTION';\n parent::__construct(400, $message ?: 'You have some exotel exception.', $previous, $headers, $code);\n }", "public function throwBadRequest()\n {\n throw new Exception\\BadRequestException('Bad request', 1449130902);\n }", "public static function invalidAttachmentType()\n {\n return new static('Attachment Type provided is invalid.');\n }", "public function create()\n {\n return response(null, 404);\n }", "public function testCreateUserDenied()\n {\n $client = $this->createAuthorizedClient('user');\n\n $client->request('GET', '/comment/add/' . $this->getReference('issue-test')->getCode());\n\n $this->assertEquals(403, $client->getResponse()->getStatusCode());\n }", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function reject(...$arguments): self {\n return $this->end(self::STATE_REJECTED, $this->_failed, $arguments);\n }", "public function test403()\n {\n $schedule = $this->createFactorySchedule();\n\n $user = $this->randomEntrant();\n\n $response = $this->requestToApi(\n $user, 'DELETE', '/schedules/'. $schedule->id\n );\n\n $response->assertStatus(403);\n }", "final private function __construct()\n {\n throw new Exception( 'Enum and Subclasses cannot be instantiated.' );\n }", "public function notHospitalised()\n {\n $this->whereClause .= ' AND status <> ?';\n $this->parameterList[] = RequestStatus::HOSPITAL;\n\n return $this;\n }", "public function create()\n {\n abort('404');\n }", "public function create()\n {\n return view('errors.403');\n }", "public function negate()\n {\n return new self($this->amount->negated(), $this->currency->getCode());\n }", "public function testCreateExceptionWithoutAnyArguments()\n {\n new ConfigurationException();\n }", "protected function throwValidationException($field_name, $message) {\n $e = new ValidationException($message);\n $e->setField($field_name);\n throw $e;\n }", "public function asIssue()\n\t{\n\t\t$this->severity = 'error';\n\t\t$this->cannotClose();\n\t\treturn $this;\n\t}", "public function assertCancelled()\n {\n $this->expectedState = Node::STATE_CANCEL;\n return $this;\n }" ]
[ "0.6180533", "0.5850701", "0.57170737", "0.57142437", "0.5597774", "0.55886364", "0.556708", "0.5554983", "0.5474281", "0.53034467", "0.5274926", "0.52101874", "0.5162231", "0.5159003", "0.51343906", "0.51205933", "0.5119561", "0.51128805", "0.51067215", "0.50914586", "0.5090013", "0.50558436", "0.5047425", "0.5025001", "0.50198156", "0.5011664", "0.5010085", "0.50077736", "0.49833217", "0.498031", "0.49789652", "0.49553064", "0.49448347", "0.4934039", "0.4928955", "0.49204254", "0.49149504", "0.49090347", "0.48864287", "0.48142716", "0.48125613", "0.47896606", "0.47796533", "0.47783637", "0.47756732", "0.47738275", "0.47612658", "0.47579288", "0.47574174", "0.47556186", "0.47549757", "0.47543183", "0.47346053", "0.47230697", "0.47075897", "0.47008762", "0.4699426", "0.4691729", "0.468825", "0.4668213", "0.46648663", "0.4658261", "0.46422186", "0.46401587", "0.46390808", "0.46344918", "0.46306053", "0.46286434", "0.46226177", "0.4622572", "0.4622478", "0.46188802", "0.46183187", "0.4616704", "0.46110606", "0.45873332", "0.45847207", "0.45799562", "0.45758152", "0.45640707", "0.45595458", "0.455245", "0.45446932", "0.45418906", "0.45394763", "0.45363528", "0.45309055", "0.4524345", "0.45141554", "0.45055962", "0.45055112", "0.44956797", "0.44914538", "0.44874975", "0.44747928", "0.44737223", "0.44630402", "0.44564253", "0.44545087", "0.4445249" ]
0.5292176
10
Lists all creditInfo entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $creditInfos = $em->getRepository('AppBundle:CreditInfo')->findAll(); return $this->render('creditinfo/index.html.twig', array( 'creditInfos' => $creditInfos, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndex() {\n $searchModel = new CreditSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getAll()\r\n {\r\n // Query the database and return an array of contacts\r\n return $this->getEntityManager()\r\n ->createQuery(\r\n 'SELECT c FROM AppBundle:Contact c ORDER BY c.firstName, c.lastName ASC'\r\n )\r\n ->getResult();\r\n }", "public function getCredits();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $maincompany = $this->getUser()->getMaincompany();\n \n $accounts = $em->getRepository('NvCargaBundle:Account')->findByMaincompany($maincompany);\n $entities = $em->getRepository('NvCargaBundle:Payment')->findByAccount($accounts);\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getCurrenciesAction()\n {\n $em = $this->getDoctrine()->getManager();\n $currencies = $em->getRepository('ApiBundle:Currency')->findAll();\n $view = $this->view($currencies);\n return $this->handleView($view);\n }", "public function listAll()\n {\n return $this->contractor->all()->pluck('name', 'id')->all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $account = $em->getRepository('AppBundle:Account')->findAll();\n\n return array(\n 'accounts' => $account,\n );\n }", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n $user = $this->getUser();\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($user));\n $pobox = $user->getPobox();\n if (!$pobox) {\n throw $this->createNotFoundException('Usted no es cliente...');\n } \n $customer = $pobox->getCustomer();\n $entities = $em->getRepository('NvCargaBundle:Payment')->findByCustomer($customer);\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Cardtype')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Currency::all();\n }", "public function ListarCreditos()\n{\n\tself::SetNames();\n\t$sql =\"SELECT \n\tventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.fechaabono, SUM(abonoscreditos.montoabono) as abonototal, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.emailcliente, cajas.nrocaja\n\tFROM\n\t(ventas LEFT JOIN abonoscreditos ON ventas.codventa=abonoscreditos.codventa) LEFT JOIN clientes ON \n\tclientes.codcliente=ventas.codcliente LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.tipopagove ='CREDITO' GROUP BY ventas.codventa\";\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "private function getCompanyCredits ()\n {\n $content = Utils::getContent($this->_strUrl . \"companycredits\");\n\n // get the uls order\n $order = [];\n foreach ($content->find(\"#company_credits_content h4\") as $title) {\n $order[] = $title->attr(\"id\");\n }\n\n $ulList = $content->find(\"#company_credits_content ul\");\n\n // get the uls order\n foreach ($order as $pos => $type)\n {\n foreach ($ulList[$pos]->find(\"li\") as $company)\n {\n $a = $company->find(\"a\")[0];\n\n preg_match(\"/\\/company\\/co([0-9]+)\\?/\", $a->attr(\"href\"), $matches);\n\n if (isset($matches[1]) && !empty($matches[1]))\n {\n $basicData = [\n \"id\" => $matches[1],\n \"name\" => $a->text(),\n ];\n\n if ($type == \"distributors\")\n {\n // Hispano Foxfilms S.A.E. (2009) (Spain) (theatrical) => (2009) (Spain) (theatrical)\n $remainingText = str_replace($basicData[\"name\"], \"\", $company->text());\n\n preg_match(\"/\\(([0-9]{4})-?\\) \\(([A-Za-z0-9_.]+)\\) \\((?:theatrical|TV)\\)/\", $remainingText, $matches);\n\n if (!empty($matches)) {\n $basicData[\"year\"] = (int)$matches[1];\n $basicData[\"country\"] = $matches[2];\n $this->{$type}[] = $basicData;\n }\n } else {\n $this->{$type}[] = $basicData;\n }\n }\n }\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('uesperaBundle:ClienteCredito')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function InfGetCreditCards($inf_contact_id) {\n\t$object_type = \"CreditCard\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$object->removeRestrictedFields(); // Remove CreditCard and CVV\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $inf_contact_id, 'Status' => 3));\n\n $cards_array = array();\n foreach ($objects as $i => $object) {\n\t\t// Give it a userful index, ie, card_id\n\t\t$array = $object->toArray();\n $cards_array[$array['Id']] = $array;\n }\n\treturn $cards_array; // Maybe multiple cards\n}", "public function indexAction()\n {\n // to retrieve Address and BankAccount entities (fetched automatically)\n $this->view->assignMultiple([\n 'addresses' => $this->customer->getAddresses(),\n 'bankAccounts' => $this->customer->getBankAccounts(),\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HffBlogBundle:Comentarios')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getCreditos()\n {\n return $this->creditos;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CreditUnionFrontendBundle:Pricelist')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\t $user = $this->getUser();\n\t //$test = $this->getDoctrine()->getRepository(charge::class)->selectCharge($user->getId());\n\t $conv = $this->getDoctrine()->getRepository(charge::class)->findAll();\n return $this->render('charges/index.html.twig', array(\n 'charges' => $conv,\n ));\n }", "public function all()\n {\n return $this->atividadeComercialRepository->all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $cargaisons = $em->getRepository('AppBundle:Cargaison')->findAll();\n\n return $this->render('cargaison/index.html.twig', array(\n 'cargaisons' => $cargaisons,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $cahierdescharges = $em->getRepository('MyFOSUserBundle:Cahierdescharges')->findAll();\n\n return $this->render('cahierdescharges/index.html.twig', array(\n 'cahierdescharges' => $cahierdescharges,\n ));\n }", "public function indexAction()\n {\n return new ViewModel(array(\n 'creditcards' => $this->getCreditcardTable()->fetchAll(),\n )); \n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AcmebsceneBundle:Account')->findAll();\n\n return $this->render('AcmebsceneBundle:Account:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CMSBundle:Client')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n\t {\n\t $accounts = $this->Accounts->find('all');\n\t $this->set(compact('accounts'));\n\t }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppWebBundle:Catalogo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function credit_view_all(){\n\t\t$user_transactions_credit=array();\n\t\t$user_transactions_credit=$this->UserModel->getCreditPackage(array('member_id'=>$this->session->userdata('member_id'),'payment_process'=> '1'),0);\n\t\tif($_SERVER['HTTP_REFERER']!=base_url().\"account/credit_view_all\"){\n\t\t\t$this->session->set_userdata('HTTP_REFERER', $_SERVER['HTTP_REFERER']);\n\t\t\t$previous_page_url=$_SERVER['HTTP_REFERER'];\n\t\t}else{\n\t\t\t$previous_page_url=$this->session->userdata('HTTP_REFERER');\n\t\t}\n\t\t//Loads header, Invoices list and footer view.\n\t\t$this->load->view('header',array('title'=>'My Invoices','previous_page_url'=>$previous_page_url));\n\t\t$this->load->view('user/invoices_list',array('user_transactions_credit'=>$user_transactions_credit));\n\t\t$this->load->view('footer-inner-red');\n\t}", "public static function fetch_all_in_a_list()\n\t{\n\t return Company::orderBy( 'name' )->lists( 'name' , 'id' );\n\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SiteSavalizeBundle:Company')->findAll();\n\n return $this->render('SiteSavalizeBundle:Company:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function getAll()\r\n {\r\n return $this->contactManager->fetchAll(true, null, null);\r\n }", "public function Company_Info_List(){\n /*\n $user = session('USER_ID'); // 获取已登录用户\n */\n // $user = 'c4b19072a79e4a6e81f06761f1e6bd2b';\n // $where = array('USER_ID' => $user);\n // if(!empty($keywords)){\n // $where['COMPANY_NAME'] = array('like',\"%$keywords%\");\n // }\n // if (!empty($start_date)) {\n // $where['CREATE_TIME'] = array('gt',$start_date);\n // }\n // if (!empty($end_date)) {\n // $where['CREATE_TIME'] = array('lt',$end_date);\n // }\n // $count = M('a_sys_user_attr_company_info')\n // -> where($where)\n // -> count();\n\n // $Page = new \\Think\\Page($count, $pagenum);// 实例化分页类 传入总记录数和每页显示的记录数($pagenum)\n\n // $show = $Page->show();// 分页显示输出\n\n // $list = M('a_sys_user_attr_company_info as info') // 查询公司信息表\n \t\t// -> field('COMPANYINFO_ID,COMPANY_NAME,CERT,COMPANY_AUTHENTICATION,SERVICE_LEVEL,COMPANY_NUM') // 需求字段\n \t\t// -> join('a_service_level as level on info.SERVICE_ID = level.SERVICE_ID') // 两表联查\n // ->limit($Page->firstRow.','.$Page->listRows) // 分页查询\n \t\t// -> where($where) \t\t// 查询条件\n \t\t// -> select();\n\n // // var_dump($list);die;\n \n // $this -> assign('show' , $show);\n // $this -> assign('list' , $list);\n $this -> display('list');\n }", "public function index()\n {\n return Account::all();\n }", "public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }", "public function fetchAll()\n {\n $query = $this->em->createQuery(\"\n SELECT\n ccb.id,\n usr.nome corretor,\n con.nome contato ,\n ccb.dataBloqueio,\n ccb.status\n FROM\n {$this->repository} ccb\n JOIN crm\\Entity\\Usuarios usr WITH ccb.corretor = usr.id\n JOIN crm\\Entity\\Contatos con WITH ccb.contato = con.id\"\n );\n $results = $query->getResult();\n if(!is_null($results)) {\n return $results;\n }\n return new ApiProblem('404', \"Recurso n�o localizado\");\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $agency = $this->getUser()->getAgency();\n $maincompany = $this->getUser()->getMaincompany();\n $type = $agency->getType();\n // $all = $em->getRepository('NvCargaBundle:Bill')->findBy(['canceled'=>FALSE, 'maincompany'=> $maincompany])\n $all = $em->getRepository('NvCargaBundle:Bill')->createQueryBuilder('b')\n ->where('b.status != :status')\n ->andwhere('b.maincompany = :maincompany')\n ->setParameters(array('maincompany' => $maincompany, 'status' => 'ANULADA'))\n ->orderBy('b.number', 'DESC')\n ->setMaxResults(500)\n ->getQuery()\n ->getResult();\n if ($type == \"MASTER\") {\n $entities = $all;\n } else {\n $entities = [];\n foreach ($all as $entity) {\n $guide = $entity->getGuides()->last();\n if ($guide->getAgency() === $agency()) {\n $entities[] = $entity;\n }\n }\n }\n return array(\n 'entities' => $entities,\n );\n\n }", "public function index()\n {\n return Contract::all();\n }", "public function listallAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n\t\n $em = $this->getDoctrine()->getManager();\n $maincompany = $this->getUser()->getMaincompany();\n $entities = $em->getRepository('NvCargaBundle:Customer')->findBy(['maincompany'=>$maincompany,'active'=>true]);\n \n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n foreach ($entity->getBaddress() as $dir ) {\n $city = $dir->getCity();\n if ($city) { \n $result[$counter]['name'] = $dir->getName();\n $result[$counter]['lastname'] = $dir->getLastname();\n if ($dir->getCustomer()->getPobox()) {\n $result[$counter]['pobox'] = $dir->getCustomer()->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $dir->getCustomer()->getEmail();\n\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $entity->getId();\n \n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n }\n// foreach ($entities as $entity) {\n// $result[$counter]['customerid'] = $entity->getId();\n// $result[$counter]['name'] = $entity->getName();\n// $result[$counter]['lastname'] = $entity->getLastname();\n// if ($entity->getPobox()) {\n// $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n// } else {\n// $result[$counter]['pobox'] = '';\n// }\n// $result[$counter]['email'] = $entity->getEmail();\n// \n// $result[$counter]['docid'] = $entity->getAdrdefault()->getDocid();\n// $result[$counter]['address'] = $entity->getAdrdefault()->getAddress();\n// $city = $entity->getAdrdefault()->getCity();\n// $result[$counter]['cityid'] = $city->getId();\n// $result[$counter]['cityname'] = $city->getName();\n// $result[$counter]['state'] = $city->getState()->getName();\n// $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n// $result[$counter]['phone'] = $entity->getAdrdefault()->getPhone();\n// $result[$counter]['mobile'] = $entity->getAdrdefault()->getMobile();\n// \n// $result[$counter]['barrio'] = $entity->getAdrdefault()->getBarrio();\n// $result[$counter]['zip'] = $entity->getAdrdefault()->getZip();\n// $result[$counter]['type'] = $entity->getType()->getName();\n// $counter++;\n// }\n return new JsonResponse($result); \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 Company::all();\n }", "public function index()\n {\n return Company::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $cotisations = $em->getRepository('AppBundle:Cotisation')->findAll();\n\n return $this->render('cotisation/index.html.twig', array(\n 'cotisations' => $cotisations,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $repository = $em->getRepository('COEShopBundle:Discount');\n\n $entities = $repository->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MrsBlogBundle:Cidades')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Complaint::where('iPersonID', (integer)session()->get('customer_id'))->get();\n }", "function get_all_contacts() {\n //get all the users\n $task = Doctrine_Query::create()\n ->from('Zim_Model_User');\n $exec = $task->execute();\n $contacts = $exec->toArray();\n //return the array of contacts\n return $contacts;\n\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Currency::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\t\n\t\t$this->setActivity(\"List view\");\t\n $em = $this->getDoctrine()->getManager();\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$oRep = $em->getRepository('BoAdminBundle:Local');\n\t\t$oContractEntity=$em->getRepository('BoAdminBundle:Contracts');\n\t\t$nb_tc = $oRep->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null) $page=1;\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$aLocal = $em->getRepository('BoAdminBundle:Local')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n\t\t$this->updateAllLocal();\n\t\t//Pour la recherche des opérations en deux dates \n\t\t$oCcdate = new Ccdate();\n $Ccdateform = $this->createForm('Bo\\AdminBundle\\Form\\CcdateType', $oCcdate);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\LocalType2', new Local());\n\n return $this->render('local/index.html.twig', array(\n \t'locals' => $aLocal,\n\t\t'types'=>$oContractEntity->getContractType(),\n\t\t'fields'=>$oContractEntity->getWorkFields(),\n\t\t'campuss'=>$em->getRepository('BoAdminBundle:Campus')->findAll(),\n\t\t'ccd_form' => $Ccdateform->createView(),\n \t'form' => $form->createView(),\n\t\t'now' => new \\DateTime(),\n\t\t'page' => $page, // On transmet à la vue la page courante,\n\t\t'nb_pages' => $nb_pages, //le nombre total de pages,\n\t\t'total'=>$nb_tc, // Et le nombre total d'enregistrement.\n\t\t'pm'=>\"local\",\n\t\t'sm'=>\"local\",\n ));\n }", "public function index(){\n return MarketInfo::all();\n }", "public function getallCreditCustomers() \n\t{ \n\t $cid = $this->gasolinereceived_model->getCompanyId();\n\t\t $cid1 = $cid['0']->c_id;\n\t\t \n\t\t $this->db->where('c_id',$cid1);\n\t\t \n\t\t $this->db->order_by('date_created','DESC');\n\t\t $query = $this->db->get('credit_customer')->result();\n\t $q=$this->db->last_query($query );\n\t\t// print_r($q); die('err');\n\t return $query;\n\t \n\t}", "public function indexAction() {\n\t$em = $this->getDoctrine()->getManager();\n\n\t$entities = $em->getRepository('MagypRendicionDeCajaBundle:Comprobante')->findAll();\n\n\treturn array(\n\t 'entities' => $entities,\n\t);\n }", "public function index()\n {\n return Account::select('*')->take(30)->get();\n }", "public function indexAction()\n {\n $user = $this->getUser()->getId();\n $Cabinets = $this->getDoctrine()\n ->getRepository('AppBundle:Cabinet')\n ->findOneBy(array('user_id' => $user));\n $contacts = $this->getDoctrine()\n ->getRepository('AppBundle:Contact')\n ->findBy(array ('cabinet' => $Cabinets),array('id' => 'ASC'));;\n\n return $this->render('contact/index.html.twig', array(\n 'contacts' => $contacts,'Cabinets' => $Cabinets\n ));\n }", "public function index(Request $request)\n {\n return Account::all();\n }", "public function getAll()\n {\n return $this->_info;\n\n }", "public function listAll()\n\t{\n\t\t$data['auditorias'] = $this->relatorio_model->listaAuditorias(1);\n\n\t\t$data['ncs'] = $this->relatorio_model->listaNCs(1);\n\n\t\t$data['acs'] = $this->relatorio_model->listaACs(1);\n\n\t\t$data['main_content'] = 'relatorio/relatorio_view';\n\t\t\n\t\t// Envia todas as informações para tela //\n\t\t$this->parser->parse('template', $data);\n\t}", "public function listContract()\n {\n return view('admin.basic.customer.list-contract', [\n 'data' => Contract::distinct('user_id')->get(['user_id', 'admin_id', 'phone', 'email']),\n 'pageTitle' => Lang::trans('label.Customer contract')\n ]);\n }", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n $countriesRepository = $em->getRepository('ShopBundle:Countries');\n\n $countryList = $countriesRepository->findBy(\n array(),\n array('country' => 'ASC')\n );\n\n return array(\n 'countryList' => $countryList,\n );\n }", "public function list()\n {\n return $this->repo->getAll();\n ;\n }", "public function index()\n {\n return view('admin::banking.accounts.list', [\n 'accounts' => Account::getAllByBusiness()\n ]);\n }", "public static function index()\n {\n return Comida::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CheckmanBundle:Spendings')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function all(): array\n {\n return Billingo::get('bank_accounts');\n }", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n $agency = $this->getUser()->getAgency();\n $maincompany = $this->getUser()->getMaincompany();\n $type = $agency->getType();\n\n if ($type == \"MASTER\") {\n $entities = $em->getRepository('NvCargaBundle:Guide')->createQueryBuilder('g')\n ->where('g.bill IS NULL')\n ->andwhere('g.maincompany = :maincompany')\n ->setParameters(array('maincompany' => $maincompany))\n ->orderBy('g.number', 'ASC')\n ->setMaxResults(1000)\n ->getQuery()\n ->getResult();\n $agencies = $em->getRepository('NvCargaBundle:Agency')->findByMaincompany($maincompany);\n } else {\n $entities = $em->getRepository('NvCargaBundle:Guide')->createQueryBuilder('g')\n ->where('g.agency = :ag' )\n ->andwhere('g.bill IS NULL')\n ->setParameters(array('ag' => $agency))\n ->orderBy('g.number', 'ASC')\n ->setMaxResults(1000)\n ->getQuery()\n ->getResult();\n $agencies = null;\n }\n return array(\n 'entities' => $entities,\n 'agencies' => $agencies,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n \n $entity = new Incapacidad();\n $form = $this->createCreateForm($entity);\n \n $entities = $em->getRepository('DGPlusbelleBundle:Incapacidad')->findAll();\n\n return array(\n 'form'=>$form->createView(),\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Entity::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminCommonBundle:LocalBanner')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "public function getCurrenciesAction()\n {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Shop\\Currency');\n\n $builder = $repository->createQueryBuilder('c');\n $builder->select(\n [\n 'c.id as id',\n 'c.name as name',\n 'c.currency as currency',\n 'c.symbol as symbol',\n 'c.factor as factor',\n 'c.default as default'\n ]\n );\n\n $query = $builder->getQuery();\n\n $total = Shopware()->Models()->getQueryCount($query);\n\n $data = $query->getArrayResult();\n\n $this->View()->assign(\n [\n 'success' => true,\n 'data' => $data,\n 'total' => $total\n ]\n );\n }", "public function getCredits() {\n\t\tif(!$this->_configId) throw new Exception(lang('error_126'));\n\t\tif(!$this->_identifier) throw new Exception(lang('error_127'));\n\t\t\n\t\t// get configs\n\t\t$config = $this->showConfigs(true);\n\t\t\n\t\t// choose database\n\t\t$database = $config['config_database'] == \"MuOnline\" ? $this->muonline : $this->memuonline;\n\t\t\n\t\t// build query\n\t\t$data = array(\n\t\t\t'identifier' => $this->_identifier\n\t\t);\n\t\t$variables = array('{TABLE}','{COLUMN}','{USER_COLUMN}');\n\t\t$values = array($config['config_table'], $config['config_credits_col'], $config['config_user_col']);\n\t\t$query = str_replace($variables, $values, \"SELECT {COLUMN} FROM {TABLE} WHERE {USER_COLUMN} = :identifier\");\n\t\t\n\t\t// add credits\n\t\t$getCredits = $database->queryFetchSingle($query, $data);\n\t\tif(!is_array($getCredits)) throw new Exception(lang('error_143'));\n\t\t\n\t\treturn $getCredits[$config['config_credits_col']];\n\t}", "public function getAllCitationsAdmin() {\n $listeCitations = array();\n $sql = \"SELECT cit_num,per_num,per_num_valide,per_num_etu,cit_libelle,cit_date,cit_valide,cit_date_valide,cit_date_depo FROM citation\";\n $requete = $this->db->prepare($sql);\n $requete->execute();\n while ($citation = $requete->fetch(PDO::FETCH_OBJ)) {\n $listeCitations[] = new Citation($citation);\n }\n $requete->closeCursor();\n return $listeCitations;\n }", "public static function list () {\n // Retrieve account resources.\n $accounts = Json::get('account', null);\n\n // If account resource is not avaiable, internal server error.\n if ($accounts == 1)\n return 1;\n\n // Return accounts.\n return $accounts;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clatesals = $em->getRepository('AppBundle:Clatesal')->findAll();\n\n return $this->render('clatesal/index.html.twig', array(\n 'clatesals' => $clatesals,\n ));\n }", "public function all()\n\t{\t\n\t\t$counts = $this->contact_model->get_conatct_counts();\n\t\t$this->load->library('pagination');\n\t\t$config['base_url'] = base_url().'/Company/index';\n\t\t$config['total_rows'] = $counts;\n\t\t$this->pagination->initialize($config);\n\t\t\n\t\t$contacts = $this->contact_model->get_all_conatct();\n\t\t\n\t\t$response = array('total' => $counts,\n\t\t\t\t\t\t'contacts' => $contacts);\n\t\techo json_encode($response);\n\t}", "public function showAllBetAction()\n {\n $em = $this->getDoctrine()->getManager();\n $bets = $em->getRepository('BetBundle:Bet')->findBy(array(),array('id' => 'DESC'),20);\n\n return $this->render('admin/showBet.html.twig', array(\n 'bets' => $bets,\n ));\n }", "public function index()\n {\n $dsGoiCredit = GoiCredit::all();\n return view('ds-goi-credit', compact('dsGoiCredit'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('EnterpriseBundle:Customer')->findAll();\n\n return $this->render('EnterpriseBundle:Default:index.html.twig', array(\n 'entities' => $entities\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $cuisines = $em->getRepository('MyAppAdminBundle:Cuisine')->findAll();\n\n return $this->render('cuisine/index.html.twig', array(\n 'cuisines' => $cuisines,\n ));\n }", "public function indexAction()\n {\n \n $em = $this->getDoctrine()->getManager();\n /*\n $entities = $em->getRepository('NvCargaBundle:City')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n */\n $listall = $this->getUser()->getMaincompany()->getCountries();\n $countries = array();\n $count = 0;\n foreach ($listall as $country) {\n $countries[$count]['id'] = $country->getId();\n $countries[$count]['name'] = $country->getName();\n $count++;\n }\n return $this->render('NvCargaBundle:City:index.html.twig',array('countries' => $countries)); \n\n }", "public function listAllCustomers();", "public function index(Request $request, ProgramCreditFilters $filters) {\n $credits = $this->service()->repo()->list($request->user(), $filters);\n return $credits;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ComDaufinBundle:Incident')->findAll();\n\n return $this->render('ComDaufinBundle:Incident:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $caisses = $em->getRepository('AppBundle:Caisse')->findAll();\n\n return $this->render('caisse/index.html.twig', array(\n 'caisses' => $caisses,\n ));\n }", "public function index()\n {\n //\n $status = DB::table('users')\n ->join('cradits', 'users.id', '=', 'cradits.user_id')\n ->select('users.f_name', 'cradits.*')\n ->get();\n return view('admin.credit.list', compact('status'));\n }", "public function index()\n {\n \n $creditos = Credito::all()->where('estado','En gestion');\n \n\n\n return view('creditos.index', compact('creditos'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('JetBredaBundle:Alquiler')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $realtyCompanies = $this->getRealtyCompanyRepository()\n ->findAllRealtyCompany()->getQuery()->getResult();\n\n return [\n 'realtyCompanies' => $realtyCompanies,\n ];\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $information = $em->getRepository('AppBundle:Information')->findAll();\n return $this->render('APIInfoBundle:information:index.html.twig', array(\n 'information' => $information,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('VentesBundle:DetailsProduits')->findAll();\n\n return $this->render('VentesBundle:DetailsProduits:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index()\n {\n return Contatos::orderBy('id', 'DESC')->get();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SubscriptionBundle:SubscriptionBase')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function show(CreditCard $creditCard)\n {\n //\n }", "public function listar(){\n\n $sql = \"SELECT * FROM buro_credito\";\n\n return $this->mysql->getRows($sql);\n\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $centros = $em->getRepository('AppBundle:Centro')->findAll();\n\n return $this->render('centro/index.html.twig', array(\n 'centros' => $centros,\n ));\n }", "public function getAll()\n {\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n \t\n $entities = $em->getRepository('JobHubBundle:Experience')->findBy(array('candidat' => $this->getCurrentCandidat()));\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $listeCours = $em->getRepository('SvtBassemBundle:Cours')->findAll();\n\n return $this->render('SvtAdminBundle:listecours:index.html.twig', array(\n 'listeCours' => $listeCours,\n ));\n }", "public function getAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('p.*')\n ->from('Pc', 'p');\n\n $statement = $queryBuilder->execute();\n $PcData = $statement->fetchAll();\n foreach ($PcData as $computerData) {\n $PcEntityList[$computerData['id']] = new Pc($computerData['id'], $computerData['marque']);\n }\n\n return $PcEntityList;\n }", "public function index()\n {\n $company = $this->repository->all();\n return $company;\n }" ]
[ "0.6347158", "0.59950393", "0.59759474", "0.5968247", "0.5921126", "0.58915967", "0.5890987", "0.58732206", "0.5864416", "0.5832881", "0.5810455", "0.5807005", "0.58052987", "0.5767612", "0.5762164", "0.5745808", "0.5737595", "0.57221955", "0.5716083", "0.57069993", "0.5700973", "0.56854326", "0.56710213", "0.5667276", "0.56652254", "0.5663093", "0.56606895", "0.56590456", "0.5658521", "0.56513816", "0.564063", "0.56391835", "0.5632409", "0.56265104", "0.56161916", "0.5614915", "0.56054276", "0.56023085", "0.5600987", "0.5597337", "0.5597337", "0.55902493", "0.5587693", "0.5580856", "0.55736727", "0.55692405", "0.5558158", "0.55263793", "0.5524868", "0.5517893", "0.5511245", "0.5498979", "0.5498511", "0.5493183", "0.54802597", "0.5476652", "0.5472753", "0.5461443", "0.546051", "0.5457235", "0.54348195", "0.5432703", "0.5429395", "0.5428931", "0.54286987", "0.5424064", "0.5422162", "0.5415875", "0.5415523", "0.54135776", "0.5408677", "0.5402942", "0.53951734", "0.5391995", "0.5389026", "0.5383879", "0.537225", "0.5372248", "0.5372038", "0.5370919", "0.5370215", "0.5367812", "0.53613913", "0.5356151", "0.5354099", "0.5350915", "0.5349623", "0.5340839", "0.53398293", "0.53397983", "0.53237385", "0.5313035", "0.530736", "0.5305373", "0.5304237", "0.53022724", "0.5300938", "0.5296194", "0.5295713", "0.5293225" ]
0.7377111
0
Display a listing of the resource.
public function index() { $usuarios=Usuario::orderBy('id','DESC')->paginate(6); $rols=Rol::all(); return view('usuario.index', compact('usuarios','rols')); }
{ "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 view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\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 $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\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 }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\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 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 permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function 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 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 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.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
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 &eacute;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
Store a newly created resource in storage.
public function store(UsuarioRequest $request) { $persona=new Persona(); $persona->nombre= $request->nombre; $persona->apellido1= $request->apellido1; $persona->apellido2= $request->apellido2; $persona->cedula= $request->cedula; $persona->genero= $request->genero; $persona->telefono= $request->telefono; $persona->domicilio= $request->domicilio; $persona->save(); $usuario=new Usuario(); $usuario->rol_id=$request->rol_id; $usuario->email=$request->email; $usuario->password=bcrypt($request->password); $usuario->persona_id=persona::get()->max('id'); $usuario->save(); return back()->with('info','El usuario se registro exitosamente'); }
{ "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) { $usuario=Usuario::find($id); return view('usuario.mostrar', compact('usuario')); }
{ "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
Update the specified resource in storage.
public function edit($id) { $usuario=Usuario::find($id); $roles=rol::all(); return view('usuario.editar', compact('usuario','roles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Update the specified resource in storage.
public function update(request $request, $id) { $dato=request()->validate([ 'nombre'=>'required|max:30', 'apellido1'=>'required|max:25', 'apellido2'=>'max:25', 'cedula' => 'required|String|max:10', 'genero'=>'required|max:2', 'telefono'=>'required|max:10', 'domicilio'=>'required|max:50', 'rol_id'=>'required', 'email'=>'required|email|unique:usuario,email,'.$id, 'password'=>'nullable|string|min:6', ],[ 'nombre.required'=>'El campo nombre es obligatorio', 'apellido1.required'=>'El campo apellido paterno es obligatorio', 'apellido2.max'=>'El campo apellido materno es de maximo 25 caraceteres ', 'cedula.required' => 'El campo cedula es obligatorio', 'genero.required'=>'El campo genero es obligatorio', 'telefono.required'=>'El campo telefono es obligatorio', 'domicilio.required'=>'El campo domicilio es obligatorio', 'rol_id.required'=>'El campo rol es obligatorio', 'email.required'=>'El campo password es obligatorio' , 'email.unique'=>'El email ya fue registrado escoge otra' , 'password.min'=>' El campo password debe contener almenos 6 caracteres obligatorio', ]); $usuario=Usuario::find($id); $usuario->rol_id=$request->rol_id; $usuario->email=$request->email; if ($request->password !=null) { $usuario->password=bcrypt($request->password ); }else{ unset($request->password ); } $usuario->save(); $persona= Persona::find($usuario->persona_id); $persona->nombre= $request->nombre; $persona->apellido1= $request->apellido1; $persona->apellido2= $request->apellido2; $persona->cedula= $request->cedula; $persona->genero= $request->genero; $persona->telefono= $request->telefono; $persona->domicilio= $request->domicilio; $persona->save(); return back()->with('info','El usuario se registro exitosamente'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $usuario=Usuario::find($id); $persona=Persona::find($usuario->persona_id); $persona->delete(); $usuario->delete(); return back()->with('info', 'El registro del usuario fue eliminado de manera exitosa'); }
{ "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
helper for other modules to check for existing message
public function relativeExists($type, $objectId, $userId, $conditions = null) { return $this->messagesModel->relativeExists($type, $objectId, $userId, $conditions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkMessage(){\r\n \t\t// checking message\r\n \t\t$message_id = $this->_request->getParam(\"message_id\");\r\n \t\t// check id param for project\r\n \t\tif(!is_numeric($message_id)){\r\n \t\t\t$this->_helper->FlashMessenger(array('error' => 'This FloBox message is not found, are you trying to hack us? :D '));\r\n \t\t\t$this->_redirect('/member/error/');\r\n \t\t}\r\n \t\t \r\n \t\ttry{\r\n \t\t\treturn $this->facadeFlobox->findOneMessage($this->_member_id,$message_id);\r\n \t\t}catch(\\Exception $e){\r\n \t\t\t$this->_helper->FlashMessenger(array('error' => $e->getMessage()));\r\n \t\t\t$this->_redirect('/member/error/');\r\n \t\t}\r\n \t}", "private function _checkMessageFor()\n {\n return;\n \n $dbh = $this->_connectToDb();\n \n $stmt = $dbh->query(\"SELECT message, when, from FROM messages WHERE LOWER(nick) = '\". strtolower(trim($this->_data->nick)) .\"' AND seen = 0 ORDER BY id DESC LIMIT 1\");\n \n $row = $stmt->fetch(PDO::FETCH_OBJ);\n\n if (isset($row->when)) {\n\n $this->_privmessage(\n 'I have a message for you from '. $row->from,\n $this->_data->nick\n );\n $this->_privmessage(\n 'Message begin: '. $row->message .' :: Message End',\n $this->_data->nick\n );\n $this->_privmessage(\n 'Send: '. $row->when,\n $this->_data->nick\n );\n }\n }", "abstract public function get_message();", "private function check_message ()\n\t{\t\tif (isset($_SESSION['message']))\n\t\t{\n\t\t\t// Add it as an attribute and erase the stored version\n\t\t\t$this->message = $_SESSION['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->message = \"\";\n\t\t}\n\t}", "protected abstract function _message();", "public function hasMsg(){\n return $this->_has(18);\n }", "private function check_message(){\t\t\tif(isset($_SESSION['message'])){\r\n\t\t\t\t// Add it as an attribute and erase the stored version\r\n\t\t\t\t\r\n\t\t\t\t$this->message = $_SESSION['message'];\r\n\t\t\t\tunset($_SESSION['message']);\r\n\t\t\t}else{\r\n\t\t\t\t$this->message=\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage() {}", "public function getMessage() {}", "public function getMessage() {}", "public function is_there_any_msg()\n\t{\n\t\tif(isset($_SESSION[\"message\"]))\n\t\t{\n\t\t\t$this->_message = $_SESSION[\"message\"];\n\t\t\tunset($_SESSION[\"message\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_message=\"\";\n\t\t}\n\t}", "abstract protected function getNotFoundMessage();", "public function messagefrom($usercheck)\n {\n \t\n\n }", "function loadMessages( $title, &$message ) {\n\t\treturn true;\n\t}", "function system_message($message) {\n\treturn system_messages($message, \"messages\");\n}", "static function hasMessage()\n {\n foreach (self::TYPES as $type)\n {\n if (self::has($type)) return true;\n }\n return false;\n }", "function isValid(&$inMessage = '');", "public function getMessage()\n {\n }", "public function getMessage()\n {\n }", "public function hasIfmsg(){\n return $this->_has(28);\n }", "public function hasMessage(): bool\n {\n return $this->hasJson('message');\n }", "private static function getSystemMessage($identifier) {\r\n if(key_exists($identifier, self::$system_messages)){\r\n return self::$system_messages[$identifier];\r\n }else{\r\n return false;\r\n }\r\n }", "public function getMessage(): string;", "public function getMessage(): string;", "public function getMessage(): string;", "public function getMessage(): string;", "public function getMessage(): string;", "public function message ();", "public function needsVerificationMessage ();", "function checkMessage() {\n if (isset($_SESSION['message'])) {\n echo \"\n <br>\n <div class='container'>\n <div class='alert alert-dismissible alert-{$_SESSION['message']['type']}' role='alert'>\n <strong>{$_SESSION['message']['name']}</strong> {$_SESSION['message']['desc']}\n <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n <span aria-hidden='true'>&times;</span>\n </button>\n </div>\n </div>\";\n unset($_SESSION['message']);\n }\n }", "function utilmessage($message){\n return $message;\n }", "private function altMessageExist()\n { \n return !empty($this->altMessage);\n }", "function messageExists($id){\n return (getSingleValue(\"SELECT COUNT(`id`) FROM `private_messages` WHERE `id` = '\" . escape(intval($id)) . \"'\") >= 1);\n }", "protected function renderMessage() {}", "public static function getDefaultMessage(): string;", "abstract public function getMsgError();", "abstract public function getFullMessage($msgNo);", "public function message($message);", "public function isMessage()\n {\n return !empty(self::$message);\n }", "public function hasMessageId(){\n return $this->_has(3);\n }", "function message(Message $message);", "private function message($code = NULL){\n $returnResult = false;\n if($code != NULL || $code != ''){\n $message = [\n \"401\" => \"Parameter mismatch\",\n \"402\" => \"Content Not Found\",\n \"403\" => \"Ran into exception\",\n \"200\" => \"Created Successfully\",\n \"201\" => \"Successfully Updated\",\n \"202\" => \"Successfully deleted\",\n \"203\" => \"User not present\",\n \"204\" => \"Group Deleted\",\n \"205\" => \"Group cannot be deleted, user present\"\n ];\n $returnResult = $message[$code];\n }\n return $returnResult;\n }", "public function hasMessage()\n {\n return $this->message !== null;\n }", "public function hasMessage()\n {\n return $this->hasMessage;\n }", "public function initMessage() {}", "function get_message($message){\n\t\t$this->gmessage = $message;\n\t}", "public function getNewMessageIfExist($request){\n\n $loggedUser = Auth::user()->id;\n $message = Message::where([['user_id','=',$loggedUser],['sender_user_id','=',$request->sender_user_id], ['is_read','=',0]])->get();\n\n $message->load(\"hasUser\", \"hasSender\");\n\n if($message->count() < 1){\n return response()->json(['success'=> 0]);\n }else{\n /**\n * Set view content of the dialog\n */\n $content = \"\";\n $messageIds = [];\n\n foreach ($message as $key => $item){\n /**\n * If message is repeat unset it\n */\n if($item->message == $request->lastMessage){\n unset($message[$key]);\n }\n /**\n * If message == last Message from form the unset it\n */\n\n //get ToDay (Azi)\n $today = Carbon::today('Europe/Moscow');\n $today = $today->format('d.m.y');\n // get hour and minutes\n $time = Carbon::parse($item->created_at);\n $time = $time->format('H:i');\n // get month day and year\n $created_at = Carbon::parse($item->created_at);\n $created_at = $created_at->format('d.m.y');\n\n if($created_at < $today){\n $message[$key]->dateFormat = $created_at.', '.$time;\n }else{\n $message[$key]->dateFormat = $time;\n }\n\n /**\n * Set role\n */\n $userRole = $item->hasSender->load('role_user')->role_user->load(\"role\")->role->alias;\n $userRoleName = $item->hasSender->load('role_user')->role_user->load(\"role\")->role->name;\n\n if($userRole == \"Moderator\" || $userRole == \"Admin\"){\n $message[$key]->hasSender->name = $userRoleName;\n };\n if($this->loggedUser == $item->hasSender->id){\n $message[$key]->hasSender->name = \"Вы\";\n }\n\n if ($item->sender_user_id == $this->loggedUser){\n $message[$key]->iAreSender = 1;\n }\n $avatarLink = strpos($item->hasSender->avatar, '://');\n\n\n $content .= $this->viewDialog($avatarLink, $item->hasSender->avatar, $item->hasSender->name, $item->hasSender->id, $item->dateFormat, $item->message, $item->iAreSender);\n $messageIds[] = $item->id;\n\n }\n /**\n *will the marked that read\n */\n $updated = DB::table('messages')->whereIn('id', $messageIds)->update(['is_read'=>1]);\n\n return response()->json(['success'=> 1, 'message'=>$content, 'updated_read' => $updated, 'senderId'=>$request->sender_user_id]);\n }\n }", "public function testGetValidMessageByMessageText(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "function _prep_message( $message = '' )\n\t{\n\t\tif ( $message == '' AND isset( $_GET['msg'] ) )\n\t\t{\n\t\t\t$message = lang( $_GET['msg'] );\n\t\t}\n\n\t\t$this->cached_vars['message']\t= $message;\n\n\t\treturn TRUE;\n\t}", "public function msg($msg);", "public function get_message() { return $this->getMessage(); }", "public function getMessage(){\n if( !isset($this->openForm) ) return false;\n if( !is_bool($this->openForm) && !is_array($this->openForm) )\n return self::getFormMessage($this->openForm);\n if( is_array($this->openForm) )\n return self::getFormMessage($this->openForm['formid']);\n return false;\n }", "public function message()\n {\n return 'Ya existe una susbcripción con el identificador de la venta';\n }", "function check()\n {\n $message= plugin::check();\n \n if(preg_match(\"/[^a-zA-Z]/\",$this->LogoffName)){\n $message[] = msgPool::invalid(_(\"Name\"),$this->LogoffName,\"/[a-zA-Z]/\");\n }\n\n if(empty($this->LogoffName)){\n $message[] = msgPool::required(_(\"Script name\"));\n }\n\n if(empty($this->LogoffDescription)){\n $message[] = msgPool::required(_(\"Description\"));\n }\n\n return $message;\n }", "public function isMessage() {\n return (bool) !empty(self::$message);\n }", "public function displayMessage() {}", "public static function checkMessageExistence($message, $path ,$result){\n if(is_null($result[$message])){\n throw new Exception(\n 'Unable to locate message ('.$message.') in file('.$path.').');\n }\n }", "public function isMessage() {\n return (bool) (!empty(self::$message));\n }", "function isMessage(){\r\n return isset($_SESSION['message'])?true:false;\r\n}", "function messages_notification_msg($hook_name, $entity_type, $return_value, $params) {\n\n\tif ($params['entity'] instanceof ElggEntity) {\n\t\tif ($params['entity']->getSubtype() == 'messages') {\n\t\t\treturn false;\n\t\t}\n\t}\n}", "public function valide_messageid() {\n\t\tif (empty ( $this->getMessageId () )) {\n\t\t\t$this->onDebug ( $this->getMessageId (), 2 );\n\t\t\t$this->onError ( \"Il faut un message id renvoye par O365 pour travailler\" );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function get_message($default='')\n\t{\n\t\t$msg = isset($_SESSION['message']) ? $_SESSION['message'] : $default;\n\t\tunset($_SESSION['message']);\n\t\treturn $msg;\n\t}", "public function messages();", "public function messages();", "public function messages();", "private function _messageFor()\n {\n // First, get the message\n //$message_for = preg_match('^!messagefor-[$1]', $this->_data->message)\n //preg_match('/^!messagefor-(.*):/', '!messagefor-Mike I missed you', $matches); var_dump($matches);\n try {\n // Connect\n $dbh = $this->_connectToDb();\n\n // Insert\n $stmt = $dbh->prepare(\"INSERT INTO message(`nick`, `message`, `when`, `from`) VALUES (:nick, :message, NOW(), :from)\");\n\n $stmt->bindParam(':nick', $message_for, PDO::PARAM_STR);\n $stmt->bindParam(':message', $message_payload, PDO::PARAM_STR);\n $stmt->bindParam(':from', $this->_data->nick, PDO::PARAM_STR);\n\n $stmt->execute();\n\n $dbh = null;\n\n }\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }", "function add($message) { return; }", "public function testMessageIdExists()\r\n\t\t{\r\n\t\t\r\n\t\t\t$db_host = \"localhost\"; //Host address (most likely localhost)\r\n\t\t\t$db_name = \"website_test\"; //Name of Database\r\n\t\t\t$db_user = \"websiteUser\"; //Name of database user\r\n\t\t\t$db_pass = \"4WPXGzCUm2y2TeG7\"; //Password for database user\r\n\t\t\t$db_table_prefix = \"apt_\";\r\n\t\t\t$GLOBALS['db_table_prefix'] = $db_table_prefix;\r\n\r\n\t\t\t$errors = array();\r\n\t\t\t$successes = array();\r\n\t\t\t$GLOBALS['errors'] = $errors;\r\n\t\t\t$GLOBALS['successes'] = $successes;\r\n\r\n\t\t\t//Create a new mysqli object with database connection parameters\r\n\t\t\t$mysqli = new mysqli($db_host, $db_user, $db_pass, $db_name);\r\n\t\t\t$GLOBALS['mysqli'] = $mysqli;\r\n\r\n\t\t\tif(mysqli_connect_errno())\r\n\t\t\t{\r\n\t\t\t\techo \"Connection Failed: \" . mysqli_connect_errno();\r\n\t\t\t\t$this->assertTrue(false);\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\r\n\t\t\t$ifMessageExists = messageIdExists(1);\r\n\t\t\t\r\n\t\t\t$result = true;\r\n\t\t\t\r\n\t\t\tif(!isset($ifMessageExists) || !messageIdExists(1))\r\n\t\t\t{\r\n\t\t\t\t$result = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->assertTrue($result);\r\n\t\t}", "public function message()\n {\n return 'That email address is already in use.';\n }", "public function testDefaultFromGetFirstMessageFromKeyIfKeyDoesntExist()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $this->assertEquals('This', $flash->getFirstMessage('Test', 'This'));\n }", "public function getMessage()\n\t{\n\t\tprepareDisplayContext();\n\t}", "function admin_msg($message)\r\n{\r\n\t$text = '';\r\n\r\n\tif( checkAdmin() and get('admin_template')=='yes')\r\n\t{\r\n\t\t$text = $message;\t\t\r\n\t}\t\r\n\r\n\treturn $text;\r\n}", "public function message()\n\t{\n\t\t$this->add('message', 'required', true, 'Message is required.');\n\t\t$this->add('message', 'regexp', '#^[a-zA-Z0-9\\s_\\- ,\\.!]*$#', 'Bad message format.');\n\t\t$this->add('message', 'max', 250, 'Bad message length, no more than 250 characters.');\n\n\t\t$this->setInformation('message', 'Message desciption, no specials characters, no accent, no more than 250 characters...');\n\t}", "function cis_login_message($msg) {\n\tglobal $cis_login_message;\n\t$cis_login_message[] = $msg;\n}", "public function testGetInvalidMessageByMessageText(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "function isValid(&$message = '') {\n\t\t$valid = true;\n\t\tif ( $valid ) {\n\t\t\t$valid = $this->checkID($message);\n\t\t}\n\t\tif ( $valid ) {\n\t\t\t$valid = $this->checkReplacesTerms($message);\n\t\t}\n\t\tif ( $valid ) {\n\t\t\t$valid = $this->checkVersion($message);\n\t\t}\n\t\tif ( $valid ) {\n\t\t\t$valid = $this->checkDescription($message);\n\t\t}\n\t\tif ( $valid ) {\n\t\t\t$valid = $this->checkHtmlLink($message);\n\t\t}\n\t\tif ( $valid ) {\n\t\t\t$valid = $this->checkPdfLink($message);\n\t\t}\n\t\treturn $valid;\n\t}", "function message($message_id)\n\t{\n\t\t//echo '<pre>'.$this->MessageFunc.'</pre>';\n\t\t$func = create_function('$id,$text',$this->MessageFunc);\n\t\t\n\t\t$func($message_id,$this->forum_text[$message_id]);\n\t\treturn false;\n\t}", "function ppmess_user_legality($message_id, $post_id, $logged_user){\n\t\n\tglobal $wpdb;\n\t\n\t$query = \"SELECT * FROM {$wpdb->prefix}private_messages WHERE (message_id = $message_id AND message_parent = 0 AND post_id = $post_id ) \n\t\t\t\tAND ( receiver_id = $logged_user OR sender_id = $logged_user ) LIMIT 1\";\n\t\t\t\n\t$result = $wpdb->get_results( $query, ARRAY_A );\n\t\n\tif($wpdb->num_rows == 1)\n\t\treturn TRUE;\n\telse \n\t\treturn FALSE;\n}", "static private function CreateHeaderMessage() {\n\t\tif (isset($_SESSION['message'])) {\n\t\t\t$type = (string)$_SESSION['message-type'];\n\t\t\tif ($type == 'note' || $type == 'error' || $type == 'info') {\n\t\t\t\tMessages::add((string)$_SESSION['message'], $type);\n\t\t\t}\n unset($_SESSION['message']);\n unset($_SESSION['message-type']);\n\t\t}\n\t}", "public function getMessage(): string\n {\n return $this->requireString('message');\n }", "function check_for_querystrings() {\r\n\t\t\tif ( isset( $_REQUEST['message'] ) ) {\r\n\t\t\t\tUM()->shortcodes()->message_mode = true;\r\n\t\t\t}\r\n\t\t}", "public function _prep_message( $message = '' )\n\t{\n\t\tif ( $message == '' AND isset( $_GET['msg'] ) )\n\t\t{\n\t\t\t$message = lang( $_GET['msg'] );\n\t\t}\n\n\t\t$this->cached_vars['message']\t= $message;\n\n\t\treturn TRUE;\n\t}", "private function initMessage()\n {\n $this->_message['MSG_ERROR'] = Utils::getMessageError();\n $this->_message['MSG_ALERT'] = Utils::getMessageALert();\n }", "public function hasMessages()\r\n {\n return $this->fm->hasMessages();\n }", "private function checkMessageSanity(string $message, DataObject $context): bool\n {\n try {\n $replaced = $this->placeholderProcessor->process($message, $context, true);\n if (strpos($replaced, $this->placeholderProcessor->getUnknownText()) !== false) {\n return false;\n }\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "public function testGetMessageFromKeyIncludingCurrent()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n $flash->addMessageNow('Test', 'Test3');\n\n $messages = $flash->getMessages();\n\n $this->assertEquals(['Test', 'Test2','Test3'], $flash->getMessage('Test'));\n }", "public function vxMessageCreateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['msg_receivers_value'] = '';\n\t\t/* receivers: raw */\n\t\t$rt['msg_receivers_a'] = array();\n\t\t/* receivers: validated */\n\t\t$rt['msg_receivers_v'] = array();\n\t\t/* receivers: validated names */\n\t\t$rt['msg_receivers_n'] = array();\n\t\t/* msg_receivers_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => not exist\n\t\t999 => unspecific */\n\t\t$rt['msg_receivers_error'] = 0;\n\t\t$rt['msg_receivers_error_msg'] = array(1 => '你忘记写收件人了', 2 => '你写的一位或多位收件人不存在');\n\t\t\n\t\tif (isset($_POST['msg_receivers'])) {\n\t\t\t$rt['msg_receivers_value'] = make_single_safe($_POST['msg_receivers']);\n\t\t\tif (strlen($rt['msg_receivers_value']) > 0) {\n\t\t\t\t$rt['msg_receivers_a'] = explode(',', $rt['msg_receivers_value']);\n\t\t\t\tforeach ($rt['msg_receivers_a'] as $msg_receiver) {\n\t\t\t\t\t$msg_receiver = trim($msg_receiver);\n\t\t\t\t\t$sql = \"SELECT usr_id, usr_nick FROM babel_user WHERE usr_nick = '{$msg_receiver}'\";\n\t\t\t\t\t$rs = mysql_query($sql, $this->db);\n\t\t\t\t\tif (mysql_num_rows($rs) == 1) {\n\t\t\t\t\t\t$User = mysql_fetch_object($rs);\n\t\t\t\t\t\tmysql_free_result($rs);\n\t\t\t\t\t\tif ($User->usr_id != $this->User->usr_id) {\n\t\t\t\t\t\t\tif (!in_array($User->usr_id, $rt['msg_receivers_v'])) {\n\t\t\t\t\t\t\t\t$rt['msg_receivers_v'][] = $User->usr_id;\n\t\t\t\t\t\t\t\t$rt['msg_receivers_n'][] = $User->usr_nick;\n\t\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\t\tmysql_free_result($rs);\n\t\t\t\t\t\t$rt['msg_receivers_error'] = 2;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($rt['msg_receivers_error'] == 0) {\n\t\t\t\t\tif (count($rt['msg_receivers_v']) == 0) {\n\t\t\t\t\t\t$rt['msg_receivers_value'] = '';\n\t\t\t\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rt['msg_receivers_value'] = implode(',', $rt['msg_receivers_n']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\t$rt['msg_body_value'] = '';\n\t\t$rt['msg_body_error'] = 0;\n\t\t$rt['msg_body_error_msg'] = array(1 => '你忘记写消息内容了', 2 => '你写的消息内容超出长度限制了');\n\t\t\n\t\tif (isset($_POST['msg_body'])) {\n\t\t\t$rt['msg_body_value'] = make_multi_safe($_POST['msg_body']);\n\t\t\t$rt['msg_body_length'] = mb_strlen($rt['msg_body_value'], 'UTF-8');\n\t\t\tif ($rt['msg_body_length'] > 0) {\n\t\t\t\tif ($rt['msg_body_length'] > 200) {\n\t\t\t\t\t$rt['msg_body_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['msg_body_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['msg_body_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "function has_message($db, $user_id, $message_id)\n{\n\t$sql = \"SELECT * FROM messages where to_id= :to_id and id= :message_id\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':to_id'=>$user_id, ':message_id'=>$message_id));\n\t$us = $st->fetchAll();\n\treturn $us;\n}" ]
[ "0.7245242", "0.7107755", "0.7054096", "0.7028923", "0.6967726", "0.6849033", "0.67937195", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.67572194", "0.6670767", "0.6670767", "0.6670767", "0.6641928", "0.6626021", "0.6563928", "0.65230644", "0.6474602", "0.64668036", "0.64639735", "0.6397808", "0.6397808", "0.63956845", "0.63660175", "0.6346491", "0.62810427", "0.62810427", "0.62810427", "0.62810427", "0.62810427", "0.6272542", "0.6267761", "0.62624097", "0.6247638", "0.6247483", "0.62272173", "0.61889803", "0.61651635", "0.61412823", "0.61355925", "0.6125996", "0.61108005", "0.61009306", "0.61002135", "0.60878783", "0.6067924", "0.6066926", "0.6056659", "0.6048825", "0.6038905", "0.60373133", "0.60117924", "0.59998655", "0.5988023", "0.5983022", "0.5973425", "0.5966917", "0.5963035", "0.5944835", "0.5934044", "0.5920442", "0.5920154", "0.5917966", "0.5914618", "0.59084004", "0.5891279", "0.5891279", "0.5891279", "0.5891205", "0.58841", "0.58745366", "0.5873784", "0.5868674", "0.5866926", "0.586075", "0.5859153", "0.5859127", "0.585532", "0.5833907", "0.5833434", "0.5825972", "0.582433", "0.5818768", "0.58143425", "0.58137065", "0.5812584", "0.58076364", "0.5805726", "0.57907057", "0.5787664", "0.5779265" ]
0.0
-1
Generates the configuration tree builder.
public function getConfigTreeBuilder(): TreeBuilder { $tb = new TreeBuilder('security'); $rootNode = $tb->getRootNode(); $rootNode ->children() ->scalarNode('access_denied_url')->defaultNull()->example('/foo/error403')->end() ->enumNode('session_fixation_strategy') ->values([SessionAuthenticationStrategy::NONE, SessionAuthenticationStrategy::MIGRATE, SessionAuthenticationStrategy::INVALIDATE]) ->defaultValue(SessionAuthenticationStrategy::MIGRATE) ->end() ->booleanNode('hide_user_not_found')->defaultTrue()->end() ->booleanNode('erase_credentials')->defaultTrue()->end() ->booleanNode('enable_authenticator_manager')->setDeprecated('symfony/security-bundle', '6.2', 'The "%node%" option at "%path%" is deprecated.')->defaultTrue()->end() ->arrayNode('access_decision_manager') ->addDefaultsIfNotSet() ->children() ->enumNode('strategy') ->values($this->getAccessDecisionStrategies()) ->end() ->scalarNode('service')->end() ->scalarNode('strategy_service')->end() ->booleanNode('allow_if_all_abstain')->defaultFalse()->end() ->booleanNode('allow_if_equal_granted_denied')->defaultTrue()->end() ->end() ->validate() ->ifTrue(fn ($v) => isset($v['strategy'], $v['service'])) ->thenInvalid('"strategy" and "service" cannot be used together.') ->end() ->validate() ->ifTrue(fn ($v) => isset($v['strategy'], $v['strategy_service'])) ->thenInvalid('"strategy" and "strategy_service" cannot be used together.') ->end() ->validate() ->ifTrue(fn ($v) => isset($v['service'], $v['strategy_service'])) ->thenInvalid('"service" and "strategy_service" cannot be used together.') ->end() ->end() ->end() ; $this->addPasswordHashersSection($rootNode); $this->addProvidersSection($rootNode); $this->addFirewallsSection($rootNode, $this->factories); $this->addAccessControlSection($rootNode); $this->addRoleHierarchySection($rootNode); return $tb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConfigTreeBuilder()\n {\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('chameleon_system_core');\n $root = $treeBuilder->getRootNode();\n $root->isRequired();\n\n $root\n ->children()\n ->scalarNode('vendor_dir')->end()\n ->scalarNode('redirectstrategy')\n ->defaultValue('registershutdown')\n ->end()\n ->scalarNode('query_modifier_order_by_class')->end()\n ->arrayNode('pdo')\n ->children()\n ->scalarNode('mysql_attr_init_command')->end()\n ->end()\n ->end()\n ->append($this->getCronjobConfig())\n ->append($this->getMailTargetTransformationServiceConfig())\n ->append($this->getMailerConfig())\n ->append($this->getGoogleMapsApiConfig())\n ->append($this->getBackendConfig())\n ->append($this->getModuleExecutionConfig())\n ->append($this->getResourceCollectionConfig())\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('exsyst_dynamic_class_generation');\n\n $rootNode\n ->children()\n ->scalarNode('cache_directory')->defaultValue('%kernel.cache_dir%/exsyst-clsgen')->end()\n ->scalarNode('temporary_directory')->defaultValue('%kernel.cache_dir%/exsyst-clsgen')->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('responsive_image');\n\n // Add basic configurations.\n $rootNode\n ->children()\n ->booleanNode('debug')\n ->defaultFalse()\n ->end()\n ->booleanNode('cache_bust')\n ->defaultFalse()\n ->end()\n ->variableNode('image_entity_class')\n ->defaultValue([])\n ->end()\n ->enumNode('image_driver')\n ->defaultValue('gd')\n ->values(['gd', 'imagick'])\n ->end()\n ->integerNode('image_compression')\n ->defaultValue(90)\n ->min(0)->max(100)\n ->end()\n ->scalarNode('image_directory')\n ->defaultValue('images')\n ->end()\n ->scalarNode('image_styles_directory')\n ->defaultValue('styles')\n ->end()\n ->arrayNode('breakpoints')\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('image_styles')\n ->prototype('array')\n ->children()\n ->integerNode('width')\n ->min(1)\n ->end()\n ->integerNode('height')\n ->min(1)\n ->end()\n ->enumNode('effect')\n ->defaultValue('scale')\n ->values(['scale', 'crop'])\n ->end()\n ->booleanNode('greyscale')\n ->defaultFalse()\n ->end()\n ->end()\n ->end()\n ->end()\n ->variableNode('picture_sets')->end()\n ->arrayNode('crop_focus_widget')\n ->children()\n ->booleanNode('include_js_css')\n ->defaultTrue()\n ->end()\n ->booleanNode('display_coordinates')\n ->defaultTrue()\n ->end()\n ->end()\n ->end()\n ->append($this->addAWSNode())\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('venice_app');\n\n $mappingNode = $rootNode->children()->arrayNode('entity_mapping')->useAttributeAsKey('name');\n $mappingNode->prototype('array')->children()\n ->scalarNode('entity')->isRequired()->end()\n ->arrayNode('map')->useAttributeAsKey('name')->prototype('scalar');\n\n $rootNode->children()\n ->arrayNode('forms_override')\n ->defaultValue([])\n ->useAttributeAsKey('venice_forms_override')\n ->prototype('scalar');\n\n $rootNode->children()\n ->arrayNode('entity_forms')\n ->defaultValue([])\n ->useAttributeAsKey('venice_entity_forms')\n ->prototype('scalar');\n\n $rootNode->children()\n ->arrayNode('entity_override')\n ->defaultValue([])\n ->useAttributeAsKey('venice_entity_override')\n ->prototype('scalar');\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('coffee_bike_dachser');\n\n $rootNode\n ->children()\n ->scalarNode('dachser_branch_number')->end()\n ->scalarNode('dachser_gln_number')->end()\n ->scalarNode('dachser_branch_number_full')->end()\n ->scalarNode('dachser_sftp_host')->end()\n ->scalarNode('dachser_sftp_port')->end()\n ->scalarNode('dachser_sftp_username')->end()\n ->scalarNode('dachser_sftp_password')->end()\n ->scalarNode('dachser_sftp_remote_in_path')->end()\n ->scalarNode('dachser_sftp_remote_out_path')->end()\n ->scalarNode('dachser_sftp_remote_in_save_path')->end()\n ->scalarNode('dachser_sftp_local_in_path')->end()\n ->scalarNode('dachser_sftp_local_out_path')->end()\n ->scalarNode('dachser_sftp_local_in_save_path')->end()\n ->scalarNode('dachser_sftp_local_in_tmp')->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n // to stick with strict snake_case to make sure it works.\n if (method_exists(TreeBuilder::class, 'getRootNode')) {\n $treeBuilder = new TreeBuilder('meteo_concept_h_captcha');\n $rootNode = $treeBuilder->getRootNode();\n } else {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('meteo_concept_h_captcha');\n }\n\n $rootNode\n ->children()\n ->arrayNode('hcaptcha')\n ->info(\"The configuration value of your hCaptcha account (visit https://dashboard.hcaptcha.com to find them).\")\n ->children()\n ->scalarNode('site_key')\n ->info(\"The site key for this website.\")\n ->defaultValue(null)\n ->end()\n ->scalarNode('secret')\n ->info(\"The secret used to authenticate requests to hCaptcha verification endpoint.\")\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n return new TreeBuilder();\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('graphql');\n\n //@formatter:off\n $rootNode\n ->children()\n ->arrayNode('schemas')\n ->requiresAtLeastOneElement()\n ->useAttributeAsKey('name')\n ->arrayPrototype()\n ->children()\n ->scalarNode('sdl')\n ->info('Path to the SDL graphql definition')\n ->end()\n ->scalarNode('route')\n ->defaultValue(self::DEFAULT_ROUTE)\n ->treatNullLike(self::DEFAULT_ROUTE)\n ->end()\n ->arrayNode('resolvers')\n ->useAttributeAsKey('type')\n ->isRequired()\n ->requiresAtLeastOneElement()\n ->beforeNormalization()\n ->always(function($resolvers){\n return $this->normalizeResolvers($resolvers);\n })\n ->end()\n ->prototype('scalar')->end()\n ->validate()\n ->always(function($resolvers){\n $this->validateResolvers($resolvers);\n return $resolvers;\n })\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n //@formatter:on\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n if (Kernel::VERSION_ID >= 40300) {\n $treeBuilder = new TreeBuilder('sfcod_email_engine');\n $rootNode = $treeBuilder->getRootNode();\n } else {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('sfcod_email_engine');\n }\n\n $this->addMainSender($rootNode);\n $this->addSendersSection($rootNode);\n $this->addTemplatesSection($rootNode);\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n\t{\n\t\t$treeBuilder = new TreeBuilder();\n\t\t$rootNode = $treeBuilder->root('core');\n\t\t$rootNode\n\t\t\t->children()\n\t\t\t\t->booleanNode('require_dev_dependencies')->defaultValue(false)->end()\n\t\t\t\t->arrayNode('debug')\n\t\t\t\t\t->addDefaultsIfNotSet()\n\t\t\t\t\t->children()\n\t\t\t\t\t\t->booleanNode('exceptions')->defaultValue(false)->end()\n\t\t\t\t\t->end()\n\t\t\t\t->end()\n\t\t\t\t->arrayNode('twig')\n\t\t\t\t\t->addDefaultsIfNotSet()\n\t\t\t\t\t->children()\n\t\t\t\t\t\t->booleanNode('debug')->defaultValue(null)->end()\n\t\t\t\t\t\t->booleanNode('auto_reload')->defaultValue(null)->end()\n\t\t\t\t\t\t->booleanNode('enable_debug_extension')->defaultValue(false)->end()\n\t\t\t\t\t->end()\n\t\t\t\t->end()\n\t\t\t->end()\n\t\t;\n\t\treturn $treeBuilder;\n\t}", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $treeBuilder->root('e_xpansion_core')\n ->children()\n ->arrayNode('parameters')\n ->children()\n ->arrayNode('core_chat_color_codes')\n ->useAttributeAsKey('name')\n ->prototype('scalar')\n ->end()\n ->end()\n ->arrayNode('core_chat_glyph_icons')\n ->useAttributeAsKey('name')\n ->prototype('scalar')\n ->end()\n ->end()\n ->end()\n ->end()\n ->end();\n return $treeBuilder;\n }", "abstract public function generateConfiguration();", "public function getConfigTreeBuilder()\n\t{\n\t\t$treeBuilder = new TreeBuilder();\n\t\t$rootNode = $treeBuilder->root('highlight');\n\n\t\t$rootNode\n\t\t\t->children()\n\t\t\t\t\t->arrayNode('providers')\n\t\t\t\t\t\t ->performNoDeepMerging()\n\t\t\t\t\t\t //->addDefaultsIfNotSet()\n\t\t\t\t\t\t ->prototype('scalar')->end()\n\t\t\t\t\t\t ->defaultValue(array('geshi','pygment','highlight'))\n\t\t\t\t\t->end()\n\t\t\t->end();\n\t\t\t\t\t\t\n\t\t$this->addGlobalSection($rootNode);\n\t\t$this->addGeshiSection($rootNode);\n\t\t$this->addHighlightSection($rootNode);\n\t\t$this->addPygmentSection($rootNode);\n\t\t$this->addHttpAppspotSection($rootNode);\n\t\t$this->addHttpHilitemeSection($rootNode);\n\t\t\n\t\treturn $treeBuilder;\n\t}", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n\n $rootNode = $treeBuilder->root('myowncode_turbosms');\n $rootNode\n ->children()\n ->scalarNode('login')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('password')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('sender')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('debug')\n ->defaultFalse()\n ->end()\n ->scalarNode('save_to_db')\n ->defaultTrue()\n ->end()\n ->scalarNode('wsdl')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('vars');\n\n $rootNode\n\t\t\t\t->addDefaultsIfNotSet()\n ->children()\n\t\t\t\t\t->scalarNode('language')->isRequired()->cannotBeEmpty()\n\t\t\t\t\t->end()\n\t\t\t\t\t->scalarNode('source')->isRequired()->cannotBeEmpty()\n\t\t\t\t\t->end()\n\t\t\t\t\t->scalarNode('provider')->defaultValue('pygment')\n\t\t\t\t\t->end()\n ->end();\n\n return $treeBuilder; \n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('deploy');\n $rootNode\n ->children()\n ->append($this->getTargetsNode())\n ->end()\n ;\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n\n $treeBuilder = new TreeBuilder();\n\n $keePassConfig = $treeBuilder->root('KeePass');\n\n $keePassConfig->children()\n ->append($this->addKeePassNode())\n ->scalarNode('cache_folder')\n ->defaultValue('@data_folder@/cache')\n ->end()\n ->scalarNode('data_folder')\n ->defaultValue('%HOME%/.KeePassCli')\n ->end()\n ->scalarNode('app_folder')\n ->defaultValue(realpath(sprintf('%s/../../',dirname(__FILE__))))\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $root = $treeBuilder->root('light_saml_sp');\n\n $root\n ->children()\n ->arrayNode('username_mapper')\n ->defaultValue([\n ClaimTypes::EMAIL_ADDRESS,\n ClaimTypes::ADFS_1_EMAIL,\n ClaimTypes::COMMON_NAME,\n ClaimTypes::WINDOWS_ACCOUNT_NAME,\n 'urn:oid:0.9.2342.19200300.100.1.3',\n 'uid',\n 'urn:oid:1.3.6.1.4.1.5923.1.1.1.6',\n SimpleUsernameMapper::NAME_ID,\n ])\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $builder = new TreeBuilder();\n $root = $builder->root('phraseanet');\n $nodeBuilder = $root->children();\n\n $this->addSdkNode($nodeBuilder);\n\n return $builder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('deployer');\n\n $this->addServerSection($rootNode);\n $this->addFarmSection($rootNode);\n $this->addProjectSection($rootNode);\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n\t {\n\t $treeBuilder = new TreeBuilder();\n\t $rootNode = $treeBuilder->root('data_tables');\n\n\t $rootNode\n\t ->children()\n\t ->arrayNode('entities')\n\t\t\t\t\t\t->prototype('array')\n\t\t ->children()\n\t\t\t\t\t\t\t\t->scalarNode('name')\n\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->arrayNode('columns')\n\t\t\t\t\t\t\t\t\t->prototype('scalar')\n\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t->end()\n ->defaultValue([])\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->arrayNode('search_columns')\n\t\t\t\t\t\t\t\t\t->prototype('scalar')\n\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->scalarNode('post_process')\n ->defaultValue('')\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->scalarNode('user_limit')\n\t\t\t\t\t\t\t\t\t->defaultValue(0)\n\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->arrayNode('associative_columns')\n\t\t\t\t\t\t\t\t\t->prototype('array')\n\t\t\t\t\t\t\t\t\t\t->children()\n\t\t\t\t\t\t\t\t\t\t\t->scalarNode('field')\n\t\t\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->scalarNode('table')\n\t\t\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->scalarNode('target_field')\n\t\t\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->arrayNode('target_fields')\n\t\t\t\t\t\t\t\t\t\t\t\t->prototype('scalar')\n\t\t\t\t\t\t\t\t\t\t\t\t\t->cannotBeEmpty()\n\t\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t\t->scalarNode('join_type')\n\t\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t\t->end()\n\t\t\t\t\t\t\t\t->end()\n\t\t ->end()\n\t\t\t\t\t\t->end()\n\t ->end()\n\t ->end();\n\n\t return $treeBuilder;\n\t }", "public function getConfigTreeBuilder()\r\n {\r\n $treeBuilder = new TreeBuilder();\r\n $rootNode = $treeBuilder->root('kitano_payment_sips');\r\n\r\n $this->addConfigSection($rootNode);\r\n $this->addBinSection($rootNode);\r\n\r\n return $treeBuilder;\r\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $root = $treeBuilder->root('comindware_tracker');\n\n $this->addConnectionsNode($root);\n\n $root->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('doctrine_mongodb');\n $rootNode = $treeBuilder->getRootNode();\n\n $this->addDocumentManagersSection($rootNode);\n $this->addConnectionsSection($rootNode);\n $this->addResolveTargetDocumentsSection($rootNode);\n $this->addTypesSection($rootNode);\n\n $rootNode\n ->children()\n ->scalarNode('proxy_namespace')->defaultValue('MongoDBODMProxies')->end()\n ->scalarNode('proxy_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/mongodb/Proxies')->end()\n ->scalarNode('auto_generate_proxy_classes')\n ->defaultValue(ODMConfiguration::AUTOGENERATE_EVAL)\n ->beforeNormalization()\n ->always(static function ($v) {\n if ($v === false) {\n return ODMConfiguration::AUTOGENERATE_EVAL;\n }\n\n if ($v === true) {\n return ODMConfiguration::AUTOGENERATE_FILE_NOT_EXISTS;\n }\n\n return $v;\n })\n ->end()\n ->end()\n ->scalarNode('hydrator_namespace')->defaultValue('Hydrators')->end()\n ->scalarNode('hydrator_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/mongodb/Hydrators')->end()\n ->scalarNode('auto_generate_hydrator_classes')\n ->defaultValue(ODMConfiguration::AUTOGENERATE_NEVER)\n ->beforeNormalization()\n ->always(static function ($v) {\n if ($v === false) {\n return ODMConfiguration::AUTOGENERATE_NEVER;\n }\n\n if ($v === true) {\n return ODMConfiguration::AUTOGENERATE_ALWAYS;\n }\n\n return $v;\n })\n ->end()\n ->end()\n ->scalarNode('persistent_collection_namespace')->defaultValue('PersistentCollections')->end()\n ->scalarNode('persistent_collection_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/mongodb/PersistentCollections')->end()\n ->scalarNode('auto_generate_persistent_collection_classes')->defaultValue(ODMConfiguration::AUTOGENERATE_NEVER)->end()\n ->scalarNode('fixture_loader')\n ->defaultValue(ContainerAwareLoader::class)\n ->beforeNormalization()\n ->ifTrue(static function ($v) {\n return ! ($v === ContainerAwareLoader::class || in_array(ContainerAwareLoader::class, class_parents($v)));\n })\n ->then(static function ($v) {\n throw new LogicException(sprintf('The %s class is not a subclass of the ContainerAwareLoader', $v));\n })\n ->end()\n ->end()\n ->scalarNode('default_document_manager')->end()\n ->scalarNode('default_connection')->end()\n ->scalarNode('default_database')->defaultValue('default')->end()\n ->arrayNode('default_commit_options')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('j')->end()\n ->integerNode('timeout')->end()\n ->scalarNode('w')->end()\n ->integerNode('wtimeout')->end()\n // Deprecated options\n ->booleanNode('fsync')->info('Deprecated. Please use the \"j\" option instead.')->end()\n ->scalarNode('safe')->info('Deprecated. Please use the \"w\" option instead.')->end()\n ->end()\n ->end()\n ->arrayNode('controller_resolver')\n ->canBeDisabled()\n ->children()\n ->booleanNode('auto_mapping')\n ->defaultTrue()\n ->info('Set to false to disable using route placeholders as lookup criteria when the object id doesn\\'t match the argument name')\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\r\n {\r\n $tree = new TreeBuilder();\r\n\r\n $tree->root('three_scale')\r\n ->children()\r\n ->scalarNode('provider_key')->defaultValue(false)->isRequired()->end()\r\n ->arrayNode('client')\r\n ->children()\r\n ->scalarNode('class')->end()\r\n ->end()\r\n ->end()\r\n ->end();\r\n\r\n return $tree;\r\n }", "public function getConfigTreeBuilder()\n {\n $tb = new TreeBuilder('sherlockode_advanced_content');\n $root = $tb->getRootNode();\n\n $root\n ->children()\n ->arrayNode('entity_class')\n ->isRequired()\n ->children()\n ->scalarNode('content')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('content_version')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('scope')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page_type')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page_version')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page_meta')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('page_meta_version')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->arrayNode('upload')\n ->children()\n ->scalarNode('image_directory')\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('uri_prefix')\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->arrayNode('init_command')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('directory')\n ->defaultValue('var/acb')\n ->end()\n ->scalarNode('files_directory')\n ->defaultValue('var/acb/files')\n ->end()\n ->booleanNode('allow_update')\n ->defaultFalse()\n ->end()\n ->end()\n ->end()\n ->arrayNode('templates')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('tools')\n ->cannotBeEmpty()\n ->defaultValue('@SherlockodeAdvancedContent/Tools/index.html.twig')\n ->end()\n ->end()\n ->end()\n ->arrayNode('default_options')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('wysiwyg_toolbar')\n ->defaultValue('basic')\n ->validate()\n ->ifNotInArray(['basic', 'standard', 'full'])\n ->thenInvalid('Invalid wysiwyg toolbar option %s')\n ->end()\n ->end()\n ->booleanNode('date_include_time')\n ->defaultTrue()\n ->end()\n ->end()\n ->end()\n ->arrayNode('field_types')\n ->useAttributeAsKey('code')\n ->arrayPrototype()\n ->children()\n ->booleanNode('enabled')->defaultTrue()->end()\n ->scalarNode('icon')->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('scopes')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('enabled')\n ->defaultFalse()\n ->end()\n ->end()\n ->end()\n ->arrayNode('mime_type_group')\n ->useAttributeAsKey('name')\n ->arrayPrototype()\n ->scalarPrototype()->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $tb;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n\n $root = $treeBuilder->root('security');\n\n $root\n ->children()\n ->arrayNode('firewalls')\n ->children()\n ->arrayNode('api_auth_by_key')\n ->children()\n ->arrayNode('keys')\n ->prototype('array')\n ->children()\n ->scalarNode('key')->end()\n ->scalarNode('name')->end()\n ->arrayNode('roles')\n ->defaultValue([])\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('dao_auth')\n ->children()\n ->arrayNode('users')\n ->useAttributeAsKey('username')\n ->prototype('array')\n ->children()\n ->scalarNode('username')->end()\n ->scalarNode('password')->end()\n ->arrayNode('roles')\n ->defaultValue([])\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $builder = new TreeBuilder();\n\n $builder->root('best_it_ct_customer_prices')\n ->children()\n ->scalarNode('cache_service_id')\n ->defaultValue('cache.app')\n ->info('Please provide the service id for your cache adapter.')\n ->end()\n ->scalarNode('client_service_id')\n ->info('Please provide the service id for your commercetools client.')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('query')\n ->defaultValue('container=\"{container}-{currencyValue}-{customerValue}\"')\n ->info('Please provide the search query. You can use placeholder in your query')\n ->end()\n ->scalarNode('container')\n ->defaultValue('customer-prices')\n ->info('Please provide the name of the custom object container where the prices are saved.')\n ->end()\n ->arrayNode('fields')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('article')\n ->defaultValue('article')\n ->info(\n 'Please provide the name of the custom object value field which saves the ' .\n 'article id.'\n )\n ->end()\n ->scalarNode('customer')\n ->defaultValue('customer')\n ->info(\n 'Please provide the name of the custom object value field which saves the ' .\n 'customer id.'\n )\n ->end()\n ->scalarNode('currency')\n ->defaultValue('currency')\n ->info(\n 'Please provide the name of the custom object value field which saves the ' .\n 'currency.'\n )\n ->end()\n ->scalarNode('prices')\n ->defaultValue('prices')\n ->info(\n 'Please provide the name of the custom object value field which saves the ' .\n 'money objects for the price.'\n )\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $builder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('zym_user', 'array');\n $rootNode\n ->children()\n ->scalarNode('db_driver')->cannotBeOverwritten()->isRequired()->cannotBeEmpty()->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('parameters');\n\n // google params\n $google = $rootNode->children()->arrayNode('google');\n if ($this->action !== 'listProjects') {\n $google->isRequired();\n }\n\n // billable bigquery project\n $param = $google->children()->scalarNode('projectId');\n if ($this->action !== 'listProjects') {\n $param->isRequired()->cannotBeEmpty();\n }\n\n // cloud storage bucket\n $param = $google->children()->scalarNode('storage');\n if ($this->action !== 'listBuckets' && $this->action !== 'listProjects') {\n $param->isRequired()->cannotBeEmpty();\n }\n\n // location\n $param = $google->children()->scalarNode('location');\n\n if ($this->action !== 'listBuckets' && $this->action !== 'listProjects') {\n $param->defaultValue('US');\n }\n\n // queries\n $rootNode\n ->children()\n ->arrayNode('queries')\n ->prototype('array')\n ->children()\n ->integerNode('id')\n ->min(0)\n ->end()\n ->scalarNode('name')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('query')\n ->isRequired()\n ->cannotBeEmpty()\n ->end()\n ->scalarNode('outputTable')\n ->end()\n ->booleanNode('flattenResults')\n ->defaultValue(true)\n ->end()\n ->booleanNode('incremental')\n ->defaultValue(false)\n ->end()\n ->arrayNode('primaryKey')\n ->prototype('scalar')\n ->end()\n ->end()\n ->booleanNode('enabled')\n ->defaultValue(true)\n ->end()\n ->booleanNode('useLegacySql')\n ->defaultValue(true)\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n\n $rootNode->children()\n ->integerNode('retriesCount')\n ->min(0)\n ->defaultValue(5)\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n\n $root = $treeBuilder->root('git_deploy_project');\n $root->children()\n ->booleanNode('npm')->defaultNull()->end()\n ->booleanNode('composer')->defaultNull()->end()\n ->arrayNode('scripts')\n ->fixXmlConfig('script')\n ->arrayPrototype()\n ->beforeNormalization()\n ->ifString()->then(function($v) {\n return [\n 'command' => $v,\n ];\n })\n ->end()\n ->children()\n ->arrayNode('command')\n ->isRequired()\n ->beforeNormalization()\n ->castToArray()\n ->end()\n ->variablePrototype()->end()\n ->end() // Command\n ->arrayNode('trigger')\n ->beforeNormalization()\n ->castToArray()\n ->end()\n ->arrayPrototype()\n ->beforeNormalization()\n ->castToArray()\n ->ifString()->then(function($v) {\n return [\n 'path' => $v,\n ];\n })\n ->end()\n ->children()\n ->variableNode('path')->isRequired()->end()\n ->variableNode('trigger')->end()\n ->booleanNode('exact')->defaultTrue()->end()\n ->end()\n ->end()\n ->end() // Trigger\n ->end()\n ->end() // Script Array Prototype\n ->end() // Scripts Array Node\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('piedweb_conversation');\n $treeBuilder\n ->getRootNode()\n ->children()\n ->scalarNode('entity_message')->defaultValue('PiedWeb\\ConversationBundle\\Entity\\Message')->end()\n ->scalarNode('notification_emailTo')->defaultNull()->end()\n ->scalarNode('notification_interval')\n ->defaultValue('P12H')\n ->info(\"DateInterval's format\")\n ->end()\n ->arrayNode('form')\n ->end()\n ->scalarNode('form_message')\n ->defaultValue('PiedWeb\\ConversationBundle\\Form\\MessageForm')\n ->end()\n ->scalarNode('form_ms-message')\n ->defaultValue('PiedWeb\\ConversationBundle\\Form\\MultiStepMessageForm')\n ->end()\n ->scalarNode('form_newsletter')\n ->defaultValue('PiedWeb\\ConversationBundle\\Form\\NewsletterForm')\n ->end()\n ->scalarNode('possible_origins')->defaultNull()->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('dtc_grid');\n\n $rootNode\n ->children()\n ->arrayNode('jq_grid')\n ->children()\n ->arrayNode('css')\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('js')\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->scalarNode('purl')\n ->defaultValue('https://cdnjs.cloudflare.com/ajax/libs/purl/2.3.1/purl.min.js')\n ->end()\n ->arrayNode('jquery')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('url')\n ->defaultValue('https://code.jquery.com/jquery-3.3.1.min.js')\n ->end()\n ->scalarNode('integrity')\n ->defaultValue('sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=')\n ->end()\n ->scalarNode('crossorigin')\n ->defaultValue('anonymous')\n ->end()\n ->end()\n ->end()\n ->arrayNode('datatables')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('class')->defaultNull()->end()\n ->arrayNode('css')\n ->prototype('scalar')->end()\n ->defaultValue(['https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap.min.css'])\n ->end()\n ->arrayNode('js')\n ->prototype('scalar')->end()\n ->defaultValue(['https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js',\n 'https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap.min.js', ])\n ->end()\n ->end()\n ->end()\n ->arrayNode('theme')\n ->addDefaultsIfNotSet()\n ->children()\n ->arrayNode('css')\n ->prototype('scalar')->end()\n ->defaultValue(['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'])\n ->end()\n ->arrayNode('js')\n ->prototype('scalar')->end()\n ->defaultValue(['https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'])\n ->end()\n ->end()\n ->end()\n ->scalarNode('page_div_style')->defaultValue('margin: 10px')->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $node = $treeBuilder->root('px_cron_request');\n $node\n ->children()\n ->scalarNode('encryption_key')->isRequired()->end()\n ->arrayNode('cronjobs')\n ->prototype('array')\n ->children()\n ->scalarNode('job')->isRequired()->end()\n ->scalarNode('name')->isRequired()->end()\n ->booleanNode('symfonyCommand')->defaultValue(false)->end()\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('rompetomp_inertia');\n $treeBuilder->getRootNode()\n ->children()\n ->scalarNode('root_view')->defaultValue('app.html.twig')->end()\n ->arrayNode('ssr')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('enabled')->defaultFalse()->end()\n ->scalarNode('url')->defaultValue('')->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $mergeConfig = $this->shouldMergeConfig();\n $treeType = 'variable';\n\n if ($mergeConfig) {\n $treeType = 'array';\n }\n\n // Most recent versions of TreeBuilder have a constructor\n if (\\method_exists(TreeBuilder::class, '__construct')) {\n $treeBuilder = new TreeBuilder('aws', $treeType);\n } else { // which is not the case for older versions\n $treeBuilder = new TreeBuilder;\n $treeBuilder->root('aws', $treeType);\n }\n\n // If not AWS_MERGE_CONFIG, return empty, variable TreeBuilder\n if (!$mergeConfig) {\n return $treeBuilder;\n }\n\n if (method_exists($treeBuilder, 'getRootNode')) {\n $rootNode = $treeBuilder->getRootNode();\n } else {\n $rootNode = $treeBuilder->root('aws', $treeType);\n }\n\n // Define TreeBuilder to allow config validation and merging\n $rootNode\n ->ignoreExtraKeys(false)\n ->children()\n ->variableNode('credentials')->end()\n ->variableNode('debug')->end()\n ->variableNode('stats')->end()\n ->scalarNode('endpoint')->end()\n ->variableNode('endpoint_discovery')->end()\n ->arrayNode('http')\n ->children()\n ->floatNode('connect_timeout')->end()\n ->booleanNode('debug')->end()\n ->booleanNode('decode_content')->end()\n ->integerNode('delay')->end()\n ->variableNode('expect')->end()\n ->variableNode('proxy')->end()\n ->scalarNode('sink')->end()\n ->booleanNode('synchronous')->end()\n ->booleanNode('stream')->end()\n ->floatNode('timeout')->end()\n ->scalarNode('verify')->end()\n ->end()\n ->end()\n ->scalarNode('profile')->end()\n ->scalarNode('region')->end()\n ->integerNode('retries')->end()\n ->scalarNode('scheme')->end()\n ->scalarNode('service')->end()\n ->scalarNode('signature_version')->end()\n ->variableNode('ua_append')->end()\n ->variableNode('validate')->end()\n ->scalarNode('version')->end()\n ->end()\n ;\n\n //Setup config trees for each of the services\n foreach (array_column(Aws\\manifest(), 'namespace') as $awsService) {\n $rootNode\n ->children()\n ->arrayNode($awsService)\n ->ignoreExtraKeys(false)\n ->children()\n ->variableNode('credentials')->end()\n ->variableNode('debug')->end()\n ->variableNode('stats')->end()\n ->scalarNode('endpoint')->end()\n ->variableNode('endpoint_discovery')->end()\n ->arrayNode('http')\n ->children()\n ->floatNode('connect_timeout')->end()\n ->booleanNode('debug')->end()\n ->booleanNode('decode_content')->end()\n ->integerNode('delay')->end()\n ->variableNode('expect')->end()\n ->variableNode('proxy')->end()\n ->scalarNode('sink')->end()\n ->booleanNode('synchronous')->end()\n ->booleanNode('stream')->end()\n ->floatNode('timeout')->end()\n ->scalarNode('verify')->end()\n ->end()\n ->end()\n ->scalarNode('profile')->end()\n ->scalarNode('region')->end()\n ->integerNode('retries')->end()\n ->scalarNode('scheme')->end()\n ->scalarNode('service')->end()\n ->scalarNode('signature_version')->end()\n ->variableNode('ua_append')->end()\n ->variableNode('validate')->end()\n ->scalarNode('version')->end()\n ->end()\n ->end()\n ->end()\n ;\n }\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('kunstmaan_admin');\n\n $rootNode\n ->fixXmlConfig('admin_locale')\n ->fixXmlConfig('menu_item')\n ->children()\n ->scalarNode('admin_password')->end()\n ->scalarNode('dashboard_route')->end()\n ->arrayNode('admin_locales')\n ->defaultValue(array('en'))\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('session_security')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('ip_check')->defaultFalse()->end()\n ->booleanNode('user_agent_check')->defaultFalse()->end()\n ->end()\n ->end()\n ->scalarNode('default_admin_locale')->cannotBeEmpty()->defaultValue('en')->end()\n ->booleanNode('enable_console_exception_listener')->defaultTrue()->end()\n ->arrayNode('menu_items')\n ->defaultValue([])\n ->useAttributeAsKey('route', false)\n ->prototype('array')\n ->children()\n ->scalarNode('route')->isRequired()->end()\n ->scalarNode('label')->isRequired()->end()\n ->scalarNode('role')->defaultNull()->end()\n ->arrayNode('params')->defaultValue([])->prototype('scalar')->end()->end()\n ->scalarNode('parent')->defaultValue('KunstmaanAdminBundle_modules')->end()\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('etrias_cqrs');\n\n // Keep compatibility with symfony/config < 4.2\n if (!method_exists($treeBuilder, 'getRootNode')) {\n $rootNode = $treeBuilder->root('etrias_cqrs');\n } else {\n $rootNode = $treeBuilder->getRootNode();\n }\n\n $rootNode\n ->isRequired()\n ->children()\n ->arrayNode('cache')\n ->children()\n ->scalarNode('items_adapter')\n ->isRequired()\n ->info('service to store items (Symfony\\Component\\Cache\\Adapter\\AdapterInterface)')\n ->end()\n ->scalarNode('tags_adapter')\n ->isRequired()\n ->info('service to store tags (Symfony\\Component\\Cache\\Adapter\\AdapterInterface)')\n ->end()\n ->scalarNode('encoder')\n ->defaultValue('serialize')\n ->isRequired()\n ->info('service to store tags (Symfony\\Component\\Cache\\Adapter\\AdapterInterface)')\n ->end()\n ->arrayNode('default')\n ->isRequired()\n ->children()\n ->integerNode('expires_after')\n ->defaultValue(0)\n ->info('TTL in seconds')\n ->end()\n ->scalarNode('expires_at')\n ->defaultNull()\n ->info('A datetime string format')\n ->end()\n ->scalarNode('name_strategy')\n ->defaultValue(ReflectionStrategy::class)\n ->end()\n ->scalarNode('name_xpr')->defaultNull()->end()\n ->arrayNode('tags')\n ->prototype('scalar')->end()\n ->info('Expression format (services and security is available)')\n ->end()\n ->end()\n ->end()\n ->arrayNode('commands')\n ->useAttributeAsKey('command')\n ->arrayPrototype()\n ->children()\n ->integerNode('expires_after')\n ->defaultValue(0)\n ->info('TTL in seconds')\n ->end()\n ->scalarNode('expires_at')\n ->defaultNull()\n ->info('A datetime string format')\n ->end()\n ->scalarNode('name_strategy')\n ->defaultValue(ReflectionStrategy::class)\n ->end()\n ->scalarNode('name_xpr')->defaultNull()->end()\n ->arrayNode('tags')\n ->scalarPrototype()\n ->info('Expression format (services and security is available)')\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n if (\\method_exists(TreeBuilder::class, 'getRootNode')) {\n $treeBuilder = new TreeBuilder('data_grid');\n $rootNode = $treeBuilder->getRootNode();\n } else {\n // BC layer for symfony/config 4.1 and older\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('data_grid');\n }\n $rootNode\n ->children()\n ->arrayNode('instances')\n ->normalizeKeys(false)\n ->useAttributeAsKey('name')\n ->arrayPrototype()\n ->children()\n ->scalarNode('template')->defaultValue('@DataGrid/grid.blocks.html.twig')->end()\n ->scalarNode('no_data_message')->defaultValue('No data found')->end()\n ->booleanNode('pagination_enabled')->defaultValue(true)->end()\n ->integerNode('pagination_limit')->defaultValue(10)->end()\n ->scalarNode('translation_domain')->defaultNull()->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('system_socket');\n\n $rootNode\n ->children()\n ->scalarNode('queue_name')\n ->cannotBeEmpty()\n ->defaultValue('erp_to_socket_appeal')\n ->end()\n ->end()\n ;\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\r\n {\r\n $treeBuilder = new TreeBuilder();\r\n $rootNode = $treeBuilder->root('app_language');\r\n\r\n $this->addLanguageSection($rootNode);\r\n\r\n return $treeBuilder;\r\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $this->root = $treeBuilder->root(\"rms_push_notifications\");\n\n $this->addAndroid();\n $this->addiOS();\n $this->addMac();\n $this->addBlackberry();\n $this->addWindowsphone();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $builder = new TreeBuilder('rs_di_extra', 'array');\n $builder\n ->getRootNode()\n ->children()\n ->arrayNode('locations')\n ->addDefaultsIfNotSet()\n ->children()\n ->booleanNode('all_bundles')->defaultFalse()->end()\n ->arrayNode('bundles')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('disallow_bundles')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('directories')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('exclude_directories')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->arrayNode('exclude_files')\n ->beforeNormalization()\n ->ifString()\n ->then(function ($v) {\n return preg_split('/\\s*,\\s*/', $v);\n })\n ->end()\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n return $builder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder('knp_gaufrette');\n if (method_exists($treeBuilder, 'getRootNode')) {\n $rootNode = $treeBuilder->getRootNode();\n } else {\n // BC for symfony/config < 4.2\n $rootNode = $treeBuilder->root('knp_gaufrette');\n }\n\n $rootNode\n ->ignoreExtraKeys()\n ->fixXmlConfig('factory', 'factories')\n ->children()\n ->arrayNode('factories')\n ->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder();\n $treeBuilder->root('s_redbull_api_doc')\n ->children()\n ->arrayNode('documentation')\n ->children()\n ->arrayNode('info')\n ->children()\n ->scalarNode('title')->end()\n ->scalarNode('description')->end()\n ->scalarNode('termsOfService')->end()\n ->arrayNode('contact')\n ->children()\n ->scalarNode('name')->end()\n ->scalarNode('url')->end()\n ->scalarNode('email')->end()\n ->end()\n ->end()\n ->arrayNode('license')\n ->children()\n ->scalarNode('name')->end()\n ->scalarNode('url')->end()\n ->end()\n ->end()\n ->scalarNode('version')->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('qcharts_frontend');\n\n // Here you should define the parameters that are allowed to\n // configure your bundle. See the documentation linked above for\n // more information on that topic.\n\n $defaultValue = [\n 'fos_user_ui'=>false\n ];\n\n $rootNode\n ->treatNullLike($defaultValue)\n ->children()\n ->scalarNode('fos_user_ui')\n ->defaultValue(false)\n ->info(\"boolean value, true if you're using FOSUserBundle and wish to use QCharts User's UI\")\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('shopping_feature_flag');\n\n $rootNode\n ->children()\n ->arrayNode('providers')\n ->children()\n ->arrayNode('cookie')\n ->children()\n ->arrayNode('values')\n ->useAttributeAsKey('featureFlag')\n ->arrayPrototype()\n ->isRequired()\n ->beforeNormalization()->castToArray()->end()\n ->scalarPrototype()\n ->beforeNormalization()->always(function($value) { return (string) $value; })->end()\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('userAgent')\n ->children()\n ->arrayNode('values')\n ->useAttributeAsKey('featureFlag')\n ->arrayPrototype()\n ->isRequired()\n ->beforeNormalization()->castToArray()->end()\n ->scalarPrototype()\n ->beforeNormalization()->always(function($value) { return (string) $value; })->end()\n ->cannotBeEmpty()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $treeBuilder->root('dtl_distance_time')\n ->children()\n ->scalarNode('normalized_distance_unit')\n ->defaultValue('m')\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n if(method_exists(TreeBuilder::class, '__construct'))\n {\n $treeBuilder = new TreeBuilder('ns_flash');\n $rootNode = $treeBuilder->getRootNode();\n }\n /**\n * Included for backward-compatibility with SF3\n */\n else\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('ns_flash');\n }\n\n $rootNode\n ->children()\n ->scalarNode('template')->defaultValue('@NSFlash/Messages/index.html.twig')->cannotBeEmpty()->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTree()\n {\n $tb = new TreeBuilder();\n $root = $tb->root('vich_geographical');\n \n $root\n ->children()\n ->arrayNode('orm')\n ->useAttributeAsKey('id')\n ->prototype('array')\n ->performNoDeepMerging()\n ->children()\n ->scalarNode('enabled')->defaultTrue()->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('twig')\n ->performNoDeepMerging()\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('enabled')->defaultFalse()->end()\n ->end()\n ->end()\n ->arrayNode('class')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('query_service')\n ->cannotBeEmpty()\n ->defaultValue('Vich\\\\GeographicalBundle\\\\QueryService\\\\GoogleQueryService')\n ->end()\n ->scalarNode('map_renderer')\n ->cannotBeEmpty()\n ->defaultValue('Vich\\\\GeographicalBundle\\\\Map\\\\Renderer\\\\GoogleMapRenderer')\n ->end()\n ->end()\n ->end()\n ->end()\n ;\n \n return $tb->buildTree();\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('resque');\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\r\n {\r\n $treeBuilder = new TreeBuilder();\r\n $rootNode = $treeBuilder->root('jt_api');\r\n\r\n // Here you should define the parameters that are allowed to\r\n // configure your bundle. See the documentation linked above for\r\n // more information on that topic.\r\n\r\n return $treeBuilder;\r\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('d4m_ebay');\n\n $rootNode\n ->children()\n ->scalarNode('session_token')->defaultValue('')->end()\n ->scalarNode('session_mode')->defaultValue('sandbox')->end()\n ->arrayNode('session_credentials')\n ->children()\n ->scalarNode('name')->end()\n ->scalarNode('appId')->end()\n ->scalarNode('devId')->end()\n ->scalarNode('certId')->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "private function generateConfig()\n {\n if ('' == $this->config->getName()) {\n throw new \\InvalidArgumentException('No module name given');\n }\n $target = sprintf(\n '%s/app/code/%s/%s/%s/etc/config.xml',\n $this->config->getPath(),\n $this->config->getCodePool(),\n $this->config->getNamespace(),\n $this->config->getName() \n );\n \n $this->renderFile($this->skeletonDir, 'config.xml', $target, array(\n 'config' => $this->config,\n ));\n \n \n $target = sprintf(\n '%s/app/etc/modules/%s_%s.xml',\n $this->config->getPath(),\n $this->config->getNamespace(),\n $this->config->getName() \n );\n \n $this->renderFile($this->skeletonDir, 'Module.xml', $target, array(\n 'config' => $this->config,\n )); \n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder('symfony_open_tracing');\n /** @var ArrayNodeDefinition $rootNode */\n $rootNode = $treeBuilder->getRootNode();\n\n // Basic Sentry configuration\n $rootNode\n ->children()\n ->scalarNode('service_name')->end()\n ->scalarNode('enabled')->defaultTrue()->end()\n ->arrayNode('tracer_config')\n ->children()\n ->arrayNode('sampler')\n ->children()\n ->scalarNode('type')->defaultValue('const')->end()\n ->scalarNode('param')->defaultTrue()->end()\n ->end()\n ->end()\n ->arrayNode('local_agent')\n ->children()\n ->scalarNode('reporting_host')->defaultNull()->end()\n ->scalarNode('reporting_port')->defaultNull()->end()\n ->end()\n ->end()\n ->scalarNode('logging')->defaultTrue()->end()\n ->scalarNode('trace_id_header')->defaultNull()->end()\n ->scalarNode('baggage_header_prefix')->defaultNull()->end()\n ->scalarNode('debug_id_header_key')->defaultNull()->end()\n ->end()\n ->end()\n ->arrayNode('http_listener_skipped_routes')\n ->beforeNormalization()->castToArray()->end()\n ->prototype('scalar')->end()\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('rabbitmq_persist');\n\n $rootNode->children()\n ->scalarNode('host')\n ->defaultValue('localhost')\n ->end()\n ->scalarNode('port')\n ->defaultValue('5672')\n ->end()\n ->scalarNode('user')\n ->defaultValue('guest')\n ->end()\n ->scalarNode('password')\n ->defaultValue('guest')\n ->end()\n ->scalarNode('vhost')\n ->defaultValue('/')\n ->end()\n ->booleanNode('insist')\n ->defaultFalse()\n ->end()\n ->scalarNode('login_method')\n ->defaultValue('AMQPLAIN')\n ->end()\n ->scalarNode('login_response')\n ->defaultValue(null)\n ->end()\n ->scalarNode('locale')\n ->defaultValue('en_US')\n ->end()\n ->floatNode('connection_timeout')\n ->defaultValue(3)\n ->end()\n ->floatNode('read_write_timeout')\n ->defaultValue(3)\n ->end()\n ->scalarNode('exchange')\n ->defaultValue('analytics')\n ->end()\n ->scalarNode('routingKey')\n ->defaultValue('actions')\n ->end()\n ->end();\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n $rootNode = $treeBuilder->root('doctrine_fixtures');\n\n $rootNode\n ->children()\n ->arrayNode('exclude_from_purge')\n ->info('Table names to be excluded from purge.')\n ->prototype('scalar')->end()\n ->defaultValue([])\n ->end()\n ->end()\n ;\n\n return $treeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n return new TreeBuilder(\"password_validator\");\n }", "protected function generateBreezeConfig()\n {\n\n $genConfPath = $this->getGeneratorConfigPath();\n $this->infoMessage(\"Creating generator conf file in $genConfPath.\");\n\n $galaxy = $this->getContextVar(\"galaxy\");\n $planet = $this->getContextVar(\"planet\");\n $createFile = $this->getContextVar(\"createFile\");\n\n $prefixes = $this->getTablePrefixes();\n $mainPrefix = array_shift($prefixes);\n\n\n DeveloperWizardBreezeGeneratorHelper::spawnConfFile($genConfPath, [\n \"galaxyName\" => $galaxy,\n \"planetName\" => $planet,\n \"createFilePath\" => $createFile,\n \"prefix\" => $mainPrefix,\n \"otherPrefixes\" => $prefixes,\n ]);\n return null;\n }", "protected function buildTypolinkConfiguration() {}", "public function getConfigTree()\n {\n $treeBuilder = new TreeBuilder();\n $treeBuilder\n ->root('melnikov_poppler', 'array')\n ->children()\n ->scalarNode('pdfunite_path')\n ->defaultValue('/opt/poppler19/bin/pdfunite')\n ->end()\n ->end()\n ->end();\n\n return $treeBuilder->buildTree();\n }", "protected function generateConfiguration()\n {\n if (!in_array($this->format, array('yml', 'xml', 'php'))) {\n return;\n }\n\n $target = sprintf(\n '%s/Resources/config/routing/%s.%s',\n $this->bundle->getPath(),\n strtolower(str_replace('\\\\', '_', $this->entity)),\n $this->format\n );\n\n $this->renderFile('rest/config/routing.'.$this->format.'.twig', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n ));\n }", "public function end(): ConfigTreeBuilder\n {\n return $this->tree;\n }", "public function describe()\n {\n # create new node builder\n $nodeBuilder = new NodeBuilder('weightSelectorBuilder',$this->eventDispatcher,$this->repo,$this->utilities,$this->generator,$this->locale,$this->database,$this->templateLoader);\n \n # bind this definition as the parent of nodebuilder\n $nodeBuilder->setParent($this);\n \n # return node builder to continue chain\n return $nodeBuilder;\n }", "public function getConfigTreeBuilder(): TreeBuilder\n {\n $treeBuilder = new TreeBuilder();\n /** @var ArrayNodeDefinition $rootNode */\n $rootNode = $treeBuilder->root('symfony_apm_agent');\n\n $rootNode\n ->children()\n ->scalarNode('open_transaction_listener')\n ->defaultValue(OpenTransactionListener::class)\n ->end()\n ->scalarNode('close_transaction_listener')\n ->defaultValue(CloseTransactionListener::class)\n ->end()\n ->scalarNode('open_transaction_factory')\n ->defaultValue(OpenTransactionFactory::class)\n ->end()\n ->scalarNode('server_url')\n ->defaultValue('http://localhost:8200')\n ->end()\n ->end()\n ;\n\n $rootNode\n ->children()\n ->arrayNode('listener_priorities')\n ->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('request')->defaultValue(0)->end()\n ->scalarNode('terminate')->defaultValue(20)->end()\n ->end()\n ->end()\n ->end()\n ;\n\n\n return $treeBuilder;\n }", "protected function addConfigParameterNode()\n {\n \t$builder = new TreeBuilder();\n \t$node = $builder->root('config');\n \n \t$node\n \t\t->treatTrueLike(array('form' => array(\n \t\t\t'type' => \"ASF\\WebsiteBundle\\Form\\Type\\ConfigType\",\n \t\t\t'name' => 'website_config_type'\n \t\t)))\n \t\t->treatFalseLike(array('form' => array(\n \t\t\t'type' => \"ASF\\WebsiteBundle\\Form\\Type\\ConfigType\",\n \t\t\t'name' => 'website_config_type'\n \t\t)))\n \t\t->addDefaultsIfNotSet()\n \t\t->children()\n \t\t\t->arrayNode('form')\n \t\t\t\t->addDefaultsIfNotSet()\n \t\t\t\t->children()\n \t\t\t\t\t->scalarNode('type')\n \t\t\t\t\t\t->defaultValue('ASF\\WebsiteBundle\\Form\\Type\\ConfigType')\n \t\t\t\t\t->end()\n \t\t\t\t\t->scalarNode('name')\n \t\t\t\t\t\t->defaultValue('website_config_type')\n \t\t\t\t\t->end()\n \t\t\t\t\t->arrayNode('validation_groups')\n \t\t\t\t\t\t->prototype('scalar')->end()\n \t\t\t\t\t\t->defaultValue(array(\"Default\"))\n \t\t\t\t\t->end()\n \t\t\t\t->end()\n \t\t\t->end()\n \t\t->end()\n \t;\n \n \treturn $node;\n }", "public function testSetconfiguration() {\n\n\t\t$hashConfig = array(\n\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\t\t$objBuilder->setConfiguration($hashConfig);\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(1));\n\t\t$objBuilder->setChildById(1, 0);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this->array($arrayResult)\n\t\t\t->size->isEqualTo(2);\n\n\t\tforeach ($arrayResult as $hash) {\n\t\t\t$this->array($hash)\n\t\t\t\t->hasKey('custom_id')\n\t\t\t\t->hasKey('custom_left')\n\t\t\t\t->hasKey('custom_right');\n\t\t}\n\n\t\t/*\n\t\t * Same test, using __construct() to set the configuration\n\t\t */\n\n\t\t$hashConfig = array(\n\t\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder($hashConfig);\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(1));\n\t\t$objBuilder->setChildById(1, 0);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this->array($arrayResult)\n\t\t->size->isEqualTo(2);\n\n\t\tforeach ($arrayResult as $hash) {\n\t\t\t$this->array($hash)\n\t\t\t->hasKey('custom_id')\n\t\t\t->hasKey('custom_left')\n\t\t\t->hasKey('custom_right');\n\t\t}\n\t}", "public function generateConfigCommand()\n {\n $this->outputLine('Making the following config settings:');\n foreach ($this->configSettings as $key => $value) {\n $this->h5pFramework->setOption($key, $value);\n $this->outputLine(\"<b>$key:</b> $value\");\n }\n }", "public function configureBuilder();", "public function buildConfigurationSummary();", "protected function buildFsTree()\n {\n mkdir($this->config_path, 0755, true);\n mkdir($this->compiledViewsPath(), 0755, true);\n }", "private function generateConfig() {\n $config_json = array(\n 'version' => '1.0.0',\n 'name' => $this->gateway_name,\n 'description' => '',\n 'authors' => [],\n 'currencies' => ['USD'],\n 'signup_url' => 'https://google.com'\n );\n\n foreach($config_json as $key => $value) {\n if($key == 'authors' && isset($this->config['authors'])) {\n foreach($this->config[\"authors\"] as $config_author) {\n $config_entry = array(\n \"name\" => \"\",\n \"url\" => \"\"\n );\n \n if(isset($config_author['name'])) {\n $config_entry[\"name\"] = $config_author['name'];\n \n if(isset($config_author[\"url\"])) {\n $config_entry[\"url\"] = $config_author['url'];\n }\n $config_json[\"authors\"][] = $config_entry;\n }\n }\n }\n else {\n if(isset($this->config[$key])) {\n $config_json[$key] = $this->config[$key];\n }\n }\n }\n\n return json_encode($config_json);\n }", "public function configure(ArrayNodeDefinition $builder)\n {\n }", "public function configure(ArrayNodeDefinition $builder)\n {\n $builder\n ->children()\n ->scalarNode('screenshot_path')->end()\n ->arrayNode('json')\n ->children()\n ->scalarNode('filename')->defaultValue('report.json')->end()\n ->scalarNode('output_path')->defaultValue('build/tests')->end()\n ->scalarNode('profiler_path')->defaultValue('build/behat/profiler')->end()\n ->end()\n ->end()\n ->arrayNode('manual')\n ->children()\n ->scalarNode(\"filename\")->isRequired()->end()\n ->scalarNode(\"path\")->isRequired()->end()\n ->scalarNode(\"tagname\")->isRequired()->end()\n ->scalarNode(\"screenshot_path\")->isRequired()->end()\n ->end()\n ->end()\n ;\n }", "public function build() {\n $config = $this->getConfiguration();\n return [\n '#theme' => 'helloadvanced',\n '#text' => isset($config['text']) ? $config['text'] : NULL,\n '#person' => isset($config['person']) ? $config['person'] : NULL,\n '#session' => isset($config['session']) ? $config['session'] : NULL,\n ];\n }", "public function createConfig()\n\t{\n\t}", "protected function build()\n {\n $this->global_variables = (new GlobalVariablesGenerator)->generate();\n }", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "protected function configure() {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),\n // add your own options here\n ));\n\n $this->namespace = 'u';\n $this->name = 'build-all';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [export-orders|INFO] task does things.\nCall it with:\n\n [php symfony u:build-all|INFO]\nEOF;\n }", "public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }", "protected function builders() {\n return [\n DrupalCoreRecommendedBuilder::class,\n DrupalDevDependenciesBuilder::class,\n DrupalPinnedDevDependenciesBuilder::class,\n ];\n }", "protected function config_generate()\n\t{\n\t\t// Check if Database is supported by Sphinx\n\t\tif ($this->db->get_sql_layer() =='mysql' || $this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli')\n\t\t{\n\t\t\t$this->dbtype = 'mysql';\n\t\t}\n\t\telse if ($this->db->get_sql_layer() == 'postgres')\n\t\t{\n\t\t\t$this->dbtype = 'pgsql';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_WRONG_DATABASE');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if directory paths have been filled\n\t\tif (!$this->config['fulltext_sphinx_data_path'])\n\t\t{\n\t\t\t$this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_NO_CONFIG_DATA');\n\t\t\treturn false;\n\t\t}\n\n\t\tinclude($this->phpbb_root_path . 'config.' . $this->php_ext);\n\n\t\t/* Now that we're sure everything was entered correctly,\n\t\tgenerate a config for the index. We use a config value\n\t\tfulltext_sphinx_id for this, as it should be unique. */\n\t\t$config_object = new \\phpbb\\search\\sphinx\\config($this->config_file_data);\n\t\t$config_data = array(\n\t\t\t'source source_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('type',\t\t\t\t\t\t$this->dbtype . ' # mysql or pgsql'),\n\t\t\t\t// This config value sql_host needs to be changed incase sphinx and sql are on different servers\n\t\t\t\tarray('sql_host',\t\t\t\t\t$dbhost . ' # SQL server host sphinx connects to'),\n\t\t\t\tarray('sql_user',\t\t\t\t\t'[dbuser]'),\n\t\t\t\tarray('sql_pass',\t\t\t\t\t'[dbpassword]'),\n\t\t\t\tarray('sql_db',\t\t\t\t\t\t$dbname),\n\t\t\t\tarray('sql_port',\t\t\t\t\t$dbport . ' # optional, default is 3306 for mysql and 5432 for pgsql'),\n\t\t\t\tarray('sql_query_pre',\t\t\t\t'SET NAMES \\'utf8\\''),\n\t\t\t\tarray('sql_query_pre',\t\t\t\t'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = (SELECT MAX(post_id) FROM ' . POSTS_TABLE . ') WHERE counter_id = 1'),\n\t\t\t\tarray('sql_query_range',\t\t\t'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''),\n\t\t\t\tarray('sql_range_step',\t\t\t\t'5000'),\n\t\t\t\tarray('sql_query',\t\t\t\t\t'SELECT\n\t\t\t\t\t\tp.post_id AS id,\n\t\t\t\t\t\tp.forum_id,\n\t\t\t\t\t\tp.topic_id,\n\t\t\t\t\t\tp.poster_id,\n\t\t\t\t\t\tp.post_visibility,\n\t\t\t\t\t\tCASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,\n\t\t\t\t\t\tp.post_time,\n\t\t\t\t\t\tp.post_subject,\n\t\t\t\t\t\tp.post_subject as title,\n\t\t\t\t\t\tp.post_text as data,\n\t\t\t\t\t\tt.topic_last_post_time,\n\t\t\t\t\t\t0 as deleted\n\t\t\t\t\tFROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.topic_id = t.topic_id\n\t\t\t\t\t\tAND p.post_id >= $start AND p.post_id <= $end'),\n\t\t\t\tarray('sql_query_post',\t\t\t\t''),\n\t\t\t\tarray('sql_query_post_index',\t\t'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = $maxid WHERE counter_id = 1'),\n\t\t\t\tarray('sql_query_info',\t\t\t\t'SELECT * FROM ' . POSTS_TABLE . ' WHERE post_id = $id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'forum_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'topic_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'poster_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'post_visibility'),\n\t\t\t\tarray('sql_attr_bool',\t\t\t\t'topic_first_post'),\n\t\t\t\tarray('sql_attr_bool',\t\t\t\t'deleted'),\n\t\t\t\tarray('sql_attr_timestamp',\t\t\t'post_time'),\n\t\t\t\tarray('sql_attr_timestamp',\t\t\t'topic_last_post_time'),\n\t\t\t\tarray('sql_attr_string',\t\t\t'post_subject'),\n\t\t\t),\n\t\t\t'source source_phpbb_' . $this->id . '_delta : source_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('sql_query_pre',\t\t\t\t''),\n\t\t\t\tarray('sql_query_range',\t\t\t''),\n\t\t\t\tarray('sql_range_step',\t\t\t\t''),\n\t\t\t\tarray('sql_query',\t\t\t\t\t'SELECT\n\t\t\t\t\t\tp.post_id AS id,\n\t\t\t\t\t\tp.forum_id,\n\t\t\t\t\t\tp.topic_id,\n\t\t\t\t\t\tp.poster_id,\n\t\t\t\t\t\tp.post_visibility,\n\t\t\t\t\t\tCASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,\n\t\t\t\t\t\tp.post_time,\n\t\t\t\t\t\tp.post_subject,\n\t\t\t\t\t\tp.post_subject as title,\n\t\t\t\t\t\tp.post_text as data,\n\t\t\t\t\t\tt.topic_last_post_time,\n\t\t\t\t\t\t0 as deleted\n\t\t\t\t\tFROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.topic_id = t.topic_id\n\t\t\t\t\t\tAND p.post_id >= ( SELECT max_doc_id FROM ' . SPHINX_TABLE . ' WHERE counter_id=1 )'),\n\t\t\t),\n\t\t\t'index index_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('path',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_main'),\n\t\t\t\tarray('source',\t\t\t\t\t\t'source_phpbb_' . $this->id . '_main'),\n\t\t\t\tarray('docinfo',\t\t\t\t\t'extern'),\n\t\t\t\tarray('morphology',\t\t\t\t\t'none'),\n\t\t\t\tarray('stopwords',\t\t\t\t\t''),\n\t\t\t\tarray('min_word_len',\t\t\t\t'2'),\n\t\t\t\tarray('charset_type',\t\t\t\t'utf-8'),\n\t\t\t\tarray('charset_table',\t\t\t\t'U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF'),\n\t\t\t\tarray('min_prefix_len',\t\t\t\t'0'),\n\t\t\t\tarray('min_infix_len',\t\t\t\t'0'),\n\t\t\t),\n\t\t\t'index index_phpbb_' . $this->id . '_delta : index_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('path',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_delta'),\n\t\t\t\tarray('source',\t\t\t\t\t\t'source_phpbb_' . $this->id . '_delta'),\n\t\t\t),\n\t\t\t'indexer' => array(\n\t\t\t\tarray('mem_limit',\t\t\t\t\t$this->config['fulltext_sphinx_indexer_mem_limit'] . 'M'),\n\t\t\t),\n\t\t\t'searchd' => array(\n\t\t\t\tarray('compat_sphinxql_magics'\t,\t'0'),\n\t\t\t\tarray('listen'\t,\t\t\t\t\t($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost') . ':' . ($this->config['fulltext_sphinx_port'] ? $this->config['fulltext_sphinx_port'] : '9312')),\n\t\t\t\tarray('log',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'log/searchd.log'),\n\t\t\t\tarray('query_log',\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'log/sphinx-query.log'),\n\t\t\t\tarray('read_timeout',\t\t\t\t'5'),\n\t\t\t\tarray('max_children',\t\t\t\t'30'),\n\t\t\t\tarray('pid_file',\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'searchd.pid'),\n\t\t\t\tarray('max_matches',\t\t\t\t(string) SPHINX_MAX_MATCHES),\n\t\t\t\tarray('binlog_path',\t\t\t\t$this->config['fulltext_sphinx_data_path']),\n\t\t\t),\n\t\t);\n\n\t\t$non_unique = array('sql_query_pre' => true, 'sql_attr_uint' => true, 'sql_attr_timestamp' => true, 'sql_attr_str2ordinal' => true, 'sql_attr_bool' => true);\n\t\t$delete = array('sql_group_column' => true, 'sql_date_column' => true, 'sql_str2ordinal_column' => true);\n\t\tforeach ($config_data as $section_name => $section_data)\n\t\t{\n\t\t\t$section = $config_object->get_section_by_name($section_name);\n\t\t\tif (!$section)\n\t\t\t{\n\t\t\t\t$section = $config_object->add_section($section_name);\n\t\t\t}\n\n\t\t\tforeach ($delete as $key => $void)\n\t\t\t{\n\t\t\t\t$section->delete_variables_by_name($key);\n\t\t\t}\n\n\t\t\tforeach ($non_unique as $key => $void)\n\t\t\t{\n\t\t\t\t$section->delete_variables_by_name($key);\n\t\t\t}\n\n\t\t\tforeach ($section_data as $entry)\n\t\t\t{\n\t\t\t\t$key = $entry[0];\n\t\t\t\t$value = $entry[1];\n\n\t\t\t\tif (!isset($non_unique[$key]))\n\t\t\t\t{\n\t\t\t\t\t$variable = $section->get_variable_by_name($key);\n\t\t\t\t\tif (!$variable)\n\t\t\t\t\t{\n\t\t\t\t\t\t$variable = $section->create_variable($key, $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$variable->set_value($value);\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$variable = $section->create_variable($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->config_file_data = $config_object->get_data();\n\n\t\treturn true;\n\t}", "public function buildNodes() {\n\t\t// build pip nodes\n\t\t$this->buildPluginNodes();\n\t\t\n\t\t// remove package\n\t\t$this->buildPackageNode();\n\t}", "public function generateConfigCache()\n\t{\n\t\t// Generate the class/template laoder cache file\n\t\t$objCacheFile = new \\File('system/cache/config/autoload.php', true);\n\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strFile = 'system/modules/' . $strModule . '/config/autoload.php';\n\n\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t{\n\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t}\n\t\t}\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the module loader cache file\n\t\t$objCacheFile = new \\File('system/cache/config/modules.php', true);\n\t\t$objCacheFile->write(\"<?php\\n\\n\");\n\n\t\t$objCacheFile->append(sprintf(\"static::\\$active = %s;\\n\", var_export(\\ModuleLoader::getActive(), true)));\n\t\t$objCacheFile->append(sprintf(\"static::\\$disabled = %s;\", var_export(\\ModuleLoader::getDisabled(), true)));\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the config cache file\n\t\t$objCacheFile = new \\File('system/cache/config/config.php', true);\n\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strFile = 'system/modules/' . $strModule . '/config/config.php';\n\n\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t{\n\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t}\n\t\t}\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the page mapping array\n\t\t$arrMapper = array();\n\t\t$objPages = \\PageModel::findPublishedRootPages();\n\n\t\tif ($objPages !== null)\n\t\t{\n\t\t\twhile ($objPages->next())\n\t\t\t{\n\t\t\t\t$strBase = ($objPages->dns ?: '*');\n\n\t\t\t\tif ($objPages->fallback)\n\t\t\t\t{\n\t\t\t\t\t$arrMapper[$strBase . '/empty.fallback'] = $strBase . '/empty.' . $objPages->language;\n\t\t\t\t}\n\n\t\t\t\t$arrMapper[$strBase . '/empty.' . $objPages->language] = $strBase . '/empty.' . $objPages->language;\n\t\t\t}\n\t\t}\n\n\t\t// Generate the page mapper file\n\t\t$objCacheFile = new \\File('system/cache/config/mapping.php', true);\n\t\t$objCacheFile->write(sprintf(\"<?php\\n\\nreturn %s;\\n\", var_export($arrMapper, true)));\n\t\t$objCacheFile->close();\n\n\t\t// Add a log entry\n\t\t$this->log('Generated the config cache', __METHOD__, TL_CRON);\n\t}", "private function createConfiguration()\n {\n $this->createVrpayecommercePluginConfig();\n $this->Form();\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = 'project';\n $this->name = 'nestedset-categories';\n $this->briefDescription = 'reorganization of categories to NestedSet behavior';\n $this->detailedDescription = <<<EOF\nreorganization of categories to NestedSet behavior\n [php symfony project:nestedset-categories|INFO]\nEOF;\n }", "public function actionGenerateModuleConfig()\n {\n $detectedModules = $this->actionDetectModules();\n\n $modules = Module::model()->findAll(new CDbCriteria(array(\n 'order' => 'name',\n 'condition' => 'enabled = true',\n )));\n $config = array();\n foreach ($modules as $module) {\n if (!isset($detectedModules[$module->name])) continue;\n $config[$module->name] = array(\n 'class' => $detectedModules[$module->name]\n );\n }\n $str = \"<?php\\nreturn \" . var_export($config, true) . \"\\n?>\";\n file_put_contents(Yii::getPathOfAlias('runtime.cache') . '/modules.php', $str);\n }", "public function setAsBuilder() {\r\n\t\t$this->setFrontEnd(false);\r\n\t\t$this->RenderWhole = true;\r\n\t\t$this->setMenuTemplate(__DIR__ . '/myNavigationBuilder.latte');\r\n\t}", "protected function configure() {\n\n $this->xmlconfig = array(\n \"name\" => array(\"xpath\" => \"mads:authority/mads:name\", \"class_name\" => \"mads_name\"),\n\n \"permanent\" => array(\"xpath\" => \"mads:affiliation[mads:position = 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"current\" => array(\"xpath\" => \"mads:affiliation[mads:position != 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"netid\" => array(\"xpath\" => \"mads:identifier[@type='netid']\"),\n );\n }", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public static function builder();", "public function generateYmlConfiguration()\n {\n $this->setSource(new WmsSource());\n $wmsconf = new WmsInstanceConfiguration();\n $wmsconf->setType(strtolower($this->getType()));\n $wmsconf->setTitle($this->title);\n $wmsconf->setIsBaseSource($this->isBasesource());\n\n $options = new WmsInstanceConfigurationOptions();\n $options->setUrl($this->configuration[\"url\"])\n ->setProxy($this->proxy)\n ->setVisible($this->visible)\n ->setFormat($this->getFormat())\n ->setInfoformat($this->infoformat)\n ->setTransparency($this->transparency)\n ->setOpacity($this->opacity / 100)\n ->setTiled($this->tiled);\n\n if (isset($this->configuration[\"vendor\"])) {\n $options->setVendor($this->configuration[\"vendor\"]);\n }\n\n $wmsconf->setOptions($options);\n\n if (!key_exists(\"children\", $this->configuration)) {\n $num = 0;\n $rootlayer = new WmsInstanceLayer();\n $rootlayer->setTitle($this->title)\n ->setId($this->getId() . \"_\" . $num)\n ->setMinScale(!isset($this->configuration[\"minScale\"]) ? null : $this->configuration[\"minScale\"])\n ->setMaxScale(!isset($this->configuration[\"maxScale\"]) ? null : $this->configuration[\"maxScale\"])\n ->setSelected(!isset($this->configuration[\"visible\"]) ? false : $this->configuration[\"visible\"])\n ->setPriority($num)\n ->setWmslayersource(new WmsLayerSource())\n ->setWmsInstance($this);\n $rootlayer->setToggle(false);\n $rootlayer->setAllowtoggle(true);\n $this->addLayer($rootlayer);\n foreach ($this->configuration[\"layers\"] as $layerDef) {\n $num++;\n $layer = new WmsInstanceLayer();\n $layersource = new WmsLayerSource();\n $layersource->setName($layerDef[\"name\"]);\n if (isset($layerDef[\"legendurl\"])) {\n $style = new Style();\n $style->setName(null);\n $style->setTitle(null);\n $style->setAbstract(null);\n $legendUrl = new LegendUrl();\n $legendUrl->setWidth(null);\n $legendUrl->setHeight(null);\n $onlineResource = new OnlineResource();\n $onlineResource->setFormat(null);\n $onlineResource->setHref($layerDef[\"legendurl\"]);\n $legendUrl->setOnlineResource($onlineResource);\n $style->setLegendUrl($legendUrl);\n $layersource->addStyle($style);\n }\n $layer->setTitle($layerDef[\"title\"])\n ->setId($this->getId() . '-' . $num)\n ->setMinScale(!isset($layerDef[\"minScale\"]) ? null : $layerDef[\"minScale\"])\n ->setMaxScale(!isset($layerDef[\"maxScale\"]) ? null : $layerDef[\"maxScale\"])\n ->setSelected(!isset($layerDef[\"visible\"]) ? false : $layerDef[\"visible\"])\n ->setInfo(!isset($layerDef[\"queryable\"]) ? false : $layerDef[\"queryable\"])\n ->setParent($rootlayer)\n ->setWmslayersource($layersource)\n ->setWmsInstance($this);\n $layer->setAllowinfo($layer->getInfo() !== null && $layer->getInfo() ? true : false);\n $rootlayer->addSublayer($layer);\n $this->addLayer($layer);\n }\n $children = array($this->generateLayersConfiguration($rootlayer));\n $wmsconf->setChildren($children);\n } else {\n $wmsconf->setChildren($this->configuration[\"children\"]);\n }\n $this->configuration = $wmsconf->toArray();\n }", "public function getBuilderConfig()\n {\n return $this->builder_config;\n }", "private function getConfigNode() {\n// $jsonConfig = \\CloudConfig::get(\"platform/proxy_shequ\", \"test\");\n// $config = json_decode($jsonConfig, true);\n $array = \\Yosymfony\\Toml\\Toml::Parse(__DIR__ . '/../config.toml');\n\n foreach ($array as $key => $value) {\n if ($key == \"common\") {\n\n $ex = explode(\":\", $value['redis_host']);\n $this->redisHost = $ex[0];\n $this->redisPort = $ex[1];\n\n if (isset($value['redis_auth'])) {\n $this->redisAuth = $value['redis_auth'];\n }\n\n if (isset($value['slow_limit'])) {\n $this->slow_limit = (int) $value['slow_limit'];\n }\n\n if (isset($value['big_limit'])) {\n $this->big_limit = (int) $value['big_limit'];\n }\n\n $this->RECORD_QUERY = $value['record_query'];\n } else {//nodes\n// $node = $key;\n foreach ($value['db'] as $db) {\n $this->getEntry($db, $value);\n }\n }\n }\n if (isset($array['common']['include_path'])) {\n $this->getConfigChildNode($array['common']['include_path']);\n }\n }", "public function __construct(ConfigTreeBuilder $tree)\n {\n $this->tree = $tree;\n }", "public function configure(ArrayNodeDefinition $builder)\n {\n //nothing to configure\n }", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}" ]
[ "0.7528792", "0.73049206", "0.72124696", "0.70483494", "0.7025038", "0.7012615", "0.6973417", "0.6945826", "0.68797654", "0.68684536", "0.6863819", "0.6863366", "0.6855712", "0.68030804", "0.6794495", "0.67527676", "0.6741344", "0.67340124", "0.6716738", "0.6703568", "0.6695264", "0.6685213", "0.66738737", "0.6665576", "0.6662926", "0.6653944", "0.66413313", "0.6622073", "0.6619318", "0.661917", "0.6602133", "0.65942323", "0.6584732", "0.6579865", "0.65638715", "0.6556946", "0.6550517", "0.6543995", "0.65393263", "0.6534072", "0.6527039", "0.6509024", "0.6498385", "0.64973235", "0.6476601", "0.6456036", "0.6441737", "0.6431634", "0.6409593", "0.63776225", "0.63725054", "0.63715833", "0.63686806", "0.6347057", "0.63229316", "0.6286224", "0.6248193", "0.6221619", "0.6044448", "0.6021304", "0.6002354", "0.59442514", "0.5910506", "0.58427954", "0.58246934", "0.57586473", "0.5747243", "0.56986743", "0.5673062", "0.5544828", "0.5514116", "0.5504068", "0.5479603", "0.5436093", "0.54350764", "0.5400649", "0.5391456", "0.533675", "0.53363365", "0.5332481", "0.5299732", "0.52831197", "0.5257122", "0.52527046", "0.5236062", "0.5223496", "0.5200543", "0.5194696", "0.51867235", "0.5181132", "0.51662886", "0.51617247", "0.51517683", "0.5140701", "0.5138181", "0.5131318", "0.51117337", "0.51043975", "0.51043975", "0.51043975" ]
0.6162701
58
Constructor Class is not intended to be implemented
private function __construct() { throw new RuntimeException("Can't get there from here"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final private function __construct() {}", "final private function __construct() {}", "protected abstract function __construct();", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private final function __construct() {}", "final private function __construct()\n\t{\n\t}", "final private function __construct() {\n\t\t\t}", "final private function __construct()\n {\n }", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "final private function __construct()\n {\n }", "final private function __construct()\n {\n }", "protected final function __construct() {}", "private function __construct()\r\n {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "abstract protected function __construct();", "private function __construct()\t{}", "private function __construct( )\n {\n\t}", "function _construct(){ }", "private function __construct () {}", "final private function __construct(){\r\r\n\t}", "public function _construct()\n\t{\n\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "abstract public function __construct();", "abstract public function __construct();", "abstract public function __construct();" ]
[ "0.84958524", "0.84958524", "0.845607", "0.8426613", "0.8426613", "0.8426613", "0.839833", "0.8333885", "0.83254385", "0.83208936", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8294996", "0.8267648", "0.8267648", "0.8250938", "0.8241631", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82240456", "0.82236195", "0.82236195", "0.8222307", "0.82092494", "0.82067525", "0.8179146", "0.81489456", "0.81454444", "0.8143494", "0.8130422", "0.8129377", "0.8125098", "0.8125098", "0.8125098" ]
0.0
-1
Check for valid field type
public static function isValidField($fieldType) { return array_key_exists($fieldType, self::$fields); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_field_type($name)\n {\n }", "function acf_is_field_type($name = '')\n{\n}", "function testFieldTypeIsNotSetExpectsError() {\n\t\t// arrange\n\t\tglobal $post;\n\t\t$TestValidTextField = new TestValidTextField();\n\t\t$TestValidTextField->fields['field']['type'] = null;\n\t\t\\WP_Mock::wpFunction( 'wp_die', array( 'times' => 1 ) );\n\t\t$validated = array();\n\t\t$saved = array();\n\n\t\t// act\n\t\t$TestValidTextField->validate( $post->ID, $TestValidTextField->fields['field'], $validated, $saved );\n\n\t\t// assert\n\t\t// Passes when error is called\n\t}", "protected function check_type()\n {\n $regex = \"/^int$|^bool$|^string$/\";\n\n $result = preg_match($regex, $this->token);\n\n if($result == 0 or $result == FALSE)\n {\n fwrite(STDERR, \"Error, expecting <type> function parameter! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n } \n }", "abstract protected function getValidType(): string;", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function validDataTypes();", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "public function testIsValidType()\n {\n $this->assertFalse(\n Method::invoke($this->type, 'isValidType', $this, 'test'),\n 'The value should not be valid.'\n );\n\n $this->assertTrue(\n Method::invoke($this->type, 'isValidType', $this, 1.23),\n 'The value should be valid.'\n );\n }", "function getTypeOfField($fieldName);", "public function testDataTypeWithLengthNotSpecified()\n {\n $tableName = 'ramp_tabletest1';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'id';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertFalse($field->isEnum());\n $this->assertSame(\"int\", $field->getDataType());\n $this->assertNull($field->getLength());\n $this->_assertWholelyLocal($field);\n $this->_assertMetaInfoValues($tableName, $whichField, $field);\n }", "public function testGetInvalidFieldType()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\r\n\t\t\t$user->get(array());\r\n\t\t}", "function validate_fields() {\n\t\treturn true;\n\t}", "public function validate_fields() {\n \n\t\t//...\n \n }", "function is_valid_type($type){\n\t\treturn in_array($type, $this->valid_types);\n\t}", "function validate_is_number($field_input, array &$field): bool\n{\n if (!is_numeric($field_input)) {\n $field['error'] = 'Type in integer';\n return false;\n }\n return true;\n}", "public function typeIsValid()\n {\n if (!$this->scan_attributes) {\n return false;\n }\n\n return !is_null($this->scan_attributes->template_type);\n }", "protected function validateType($value)\n {\n }", "public function isType($type){\n \n // canary...\n if(!$this->hasType()){ return false; }//if\n \n return ($this->field_map['type'] === $type);\n \n }", "function get_field_types()\n {\n }", "public function test_retrieving_all_available_field_types_returns_types_when_available()\n {\n $this->setupTextAndPasswordFieldTypes();\n $types = $this->fieldManager->availableTypes();\n $this->assertTrue(is_array($types));\n $this->assertCount(2, $types);\n $this->assertArrayHasKey('password', $types);\n $this->assertArrayHasKey('text', $types);\n $this->assertContains(\\LaravelFlare\\Fields\\Types\\PasswordField::class, $types);\n $this->assertContains(\\LaravelFlare\\Fields\\Types\\TextField::class, $types);\n }", "function pgtype_isnumber ($field_type) {\n\tswitch (strtolower(trim($field_type))) {\n\t\tcase 'bool': // a boolean from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tcase 'int2': // a small integer from a pg database\n\t\tcase 'int4': // an integer from a pg database\n\t\tcase 'int8': // a long integer from a pg database\n\t\t\t$output = true;\n\t\t\tbreak;\n\t\tcase 'numeric': // a \"numeric\" real number field from a pg database\n\t\tcase 'float4': // a single precision real number field from a pg database\n\t\tcase 'float8': // a double precision real number field from a pg database\n\t\t\t$output = true;\n\t\t\tbreak;\n\t\tcase 'date': // a date field from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tcase 'time': // a time field from a pg database\n\t\tcase 'timetz': // a time field with timezone from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tcase 'timestamp': // a timestamp field from a pg database\n\t\tcase 'timestamptz': // a timestamp field with timezone from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tcase 'text': // a text field from a pg database\n\t\tcase 'varchar': // a varchar field from a pg database\n\t\tcase 'bpchar': // a bpchar field from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tdefault: // an unanticipated field type, put a text box or single selects, but may not work\n\t\t\t$output = false;\n\t}\n\treturn $output;\n}", "public function checkType() {\n\t\t//Because the DB gave us a string for the card type, we must\n\t\t//ensure that they are strings and compare accordingly.\n\t\tif (strcmp($this->getTypeAsStr(), \"aspect\")==0) {\n\t\t\t$this->boostInfo = 0;\n\t\t\t$this->magnitude = 0;\n\t\t}\n\t}", "public function is_valid_field() {\n\t\tglobal $wpdb, $bp;\n\n\t\t$retval = $wpdb->get_row( $wpdb->prepare( \"SELECT id FROM {$bp->profile->table_name_fields} WHERE id = %d\", $this->field_id ) );\n\n\t\treturn apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, $this ) );\n\t}", "protected function areFieldChangeFunctionsValid() {}", "function acf_field_type_exists($type = '')\n{\n}", "public function getTypeOfField($fieldName)\n {\n }", "public function testIsValidTypeInvalid()\n {\n $this->assertFalse($this->annotation->isValidType('INVALID'));\n }", "public static function isFieldValid(Field $field): bool\n {\n return ($field instanceof AttributeField) || ($field instanceof EnumField);\n }", "function isValidDocType($docType){\n $qh = new QueryHelper();\n\n $columnName = \"DocumentTypeVal\";\n $selectDocumentType = \"SELECT * FROM DocumentType;\";\n if($qh -> verifyDropDownInput($docType, $selectDocumentType, $columnName)){\n return true;\n }\n else{\n echo \"invalid doc type\";\n return false;\n }\n }", "static function validateField ( $description )\n\t{\n\t\t$res = array () ;\n\n\t\t// Checkin name and type\n\t\tif ( !is_array($description)\n\t\t|| !ake('name', $description)\n\t\t|| !ake('type', $description)\n\t\t|| !( is_string ('name') || is_int ('name') )\n\t\t|| !is_string ('type') || strlen ('type') < 1 )\n\t\t{\n\t\t trigger_error( \"DB Errors: \\n\" . 'Name or type or both are not valids : name must be an int or a string, and type must be a string ', E_USER_ERROR ) ;\n\t\t}\n\n\t\t// Checking ENUM type : values, default value\n\t\tif ( $description['type'] == DBSchema::TYPE_ENUM )\n\t\t{\n\t\t\tif ( !ake('values', $description) || !is_array ( $description['values'] ) || count ( $description['values'] ) == 0 )\n\t\t\t{\n\t\t\t\t$res[] = 'For enum type, a key \"values\" must exists in field description, and its value must be a non-empty array.' ;\n\t\t\t}\n\n\t\t\tif ( ake('default', $description) && !in_array ( $description['default'] , $description['values'] ) )\n\t\t\t{\n\t\t\t\t$res[] = 'For enum type, the default value must exists in \"values\" array' ;\n\t\t\t}\n\t\t\t// Checking non ENUM type default value\n\t\t} else if ( ake('default', $description) && !self::validateFieldType($description['type'], $description['default']) )\n\t\t{\n\t\t\t$res[] = 'The default value must be typed as \"type\" key' ;\n\t\t}\n\n\t\t// Checking behavior regarding type\n\t\tif ( ake ( 'behavior', $description ) )\n\t\t{\n\t\t\tswitch ( true )\n\t\t\t{\n\t\t\t\tcase $description['behavior'] & DBSchema::BHR_INCREMENT:\n\t\t\t\t\tif ( $description['type'] != DBSchema::TYPE_INT)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res[] = 'The INCREMENT behavior must be applied on INT typed fields' ;\n\t\t\t\t\t\tunset ( $description['behavior'] ) ;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase $description['behavior'] & DBSchema::BHR_DT_ON_EDIT:\n\t\t\t\t\tif ( $description['type'] != DBSchema::TYPE_DATETIME)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res[] = 'The DATETIME_ON_EDIT behavior must be applied on DATETIME typed fields' ;\n\t\t\t\t\t\tunset ( $description['behavior'] ) ;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase $description['behavior'] & DBSchema::BHR_TS_ON_EDIT:\n\t\t\t\t\tif ( $description['type'] != DBSchema::TYPE_TIMESTAMP )\n\t\t\t\t\t{\n\t\t\t\t\t\t$res[] = 'The TIMESTAMP_ON_EDIT behavior must be applied on TIMESTAMP typed fields' ;\n\t\t\t\t\t\tunset ( $description['behavior'] ) ;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase $description['behavior'] & DBSchema::BHR_SHA1:\n\t\t\t\tcase $description['behavior'] & DBSchema::BHR_MD5:\n\t\t\t\t\tif ( $description['type'] != DBSchema::TYPE_STRING)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res[] = 'The TIMESTAMP_ON_EDIT behavior must be applied on TIMESTAMP typed fields' ;\n\t\t\t\t\t\tunset ( $description['behavior'] ) ;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( count ( $res ) > 0 )\n\t\t{\n\t\t\t$this->debug( \"DB Errors: \\n\" . implode(\",\\n\" , $res) ) ;\n\t\t}\n\n\t\treturn true ;\n\t}", "public static function validateType()\n\t{\n\t\treturn array(\n\t\t\tarray(__CLASS__, 'checkType')\n\t\t);\n\t}", "function PMA_isTablefieldChar($field)\n{\n // If check to ensure types such as \"enum('one','two','char',..)\" or\n // \"enum('one','two','varchar',..)\" are not categorized as char.\n if (stripos($field['Type'], 'char') === 0\n || stripos($field['Type'], 'varchar') === 0\n ) {\n return stristr($field['Type'], 'char');\n } else {\n return false;\n }\n}", "abstract protected function validateFieldLength($fieldLength);", "private function checkImportEssentialField($type) {\n $mandatoryFields = EfrontImport::getMandatoryFields($type);\n $not_found = false;\n foreach ($mandatoryFields as $dbField => $columnName) {\n if (!isset($this -> mappings[$dbField])) {\n $not_found = true;\n break;\n }\n }\n if ($not_found) {\n $this -> log[\"failure\"][\"headerproblem\"] = _HEADERDOESNOTINCLUDEESSENTIALCOLUMN . \": \" . implode(\",\", $mandatoryFields);\n return false;\n } else {\n return true;\n }\n }", "function validate_field($field)\n {\n }", "function get_field_type($name)\n {\n }", "function get_field_type($field)\n\t{\n\t\tif( $field == \"usr_email\" )\n\t\t\treturn \"email\";\n\t\telse if( $field == \"usr_cod_postal\" )\n\t\t\treturn \"number\";\n\t\telse\n\t\t\treturn \"text\";\n\t}", "private function _isValidType($type) {\n return in_array($type, array('select', 'checkboxes', 'checkbox', 'radios',\n 'radio', 'textfield', 'textarea', 'file', 'submit', 'reset',\n 'hidden', 'fieldset', 'markup', 'button', 'password'));\n }", "function checkForDataTypes($modifyModel = false) {\n $res = true;\n foreach ($this->listFields() as $fieldName) {\n $fieldInfo = $this->getFieldInfo($fieldName);\n $res = $this->_checkForDataType($fieldName, $fieldInfo, $modifyModel) && $res; \n }\n return $res;\n }", "protected function type_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('type_name', translate('name'), 'trim|required|callback_unique_type');\n }", "public function validType($key, $type, &$data) {\n\n\n if(!is_bool($data) && !is_array($data) && is_string($data) && !strlen($data)) return false;\n\n // database conversion types\n $type = preg_replace('/\\(.*/','',$type);\n\n switch (strtolower($type)) {\n case \"varbinary\": case \"varchar\": case \"char\": case \"string\": return is_string($data);\n case \"text\": case \"txt\": return is_string($data);\n case \"integer\": if(strval(intval($data))===strval($data)) $data=intval($data);return is_integer($data);\n case \"decimal\": case \"float\": if(floatval($data)!=0 || $data===\"0\" || $data === 0) $data=floatval($data);return is_float($data);\n case \"bit\": if(strval(intval($data))===strval($data)) $data=intval($data);return ($data==0 || $data==1);\n case \"model\": return is_array($data) && !empty($data);\n case \"json\": if(is_array($data)) $data = json_encode($data);return is_string($data) && is_array(json_decode($data,true));\n case \"name\": return $this->validateName($key,$data);\n case \"ip\": return filter_var($data,FILTER_VALIDATE_IP);\n case \"url\": return filter_var($data,FILTER_VALIDATE_URL);\n case \"email\": return is_string($data) && $this->validateEmail($key,\"email\",$data);\n case \"emails\": return is_array($data) && $this->validateEmail($key,\"email\",$data);\n case \"phone\": return is_string($data);\n case \"zip\": return is_string($data);\n case \"keyname\": return is_string($data);\n case \"key\": return is_string($data);\n case \"date\": return $this->validateDate($data);\n case \"datetime\": return $this->validateDateTime($data);\n case \"datetimeiso\": return $this->validateDateTimeISO($data);\n case \"currency\": return is_numeric($data);\n case \"boolean\": if(!is_bool($data) && ($data=='true' || $data=='false')) $data = ($data == 'true');return is_bool($data);\n case \"array\": return is_array($data);\n case \"list\": return is_array($data);\n case \"array_to_string\": if(is_array($data)) $data=implode(\",\",$data);return is_string($data);\n default: return false;\n }\n }", "public function testDataTypeWithLengthSpecified()\n {\n $tableName = 'ramp_tabletest1';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'name';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertFalse($field->isEnum());\n $this->assertSame(\"varchar\", $field->getDataType());\n $this->assertSame(\"100\", $field->getLength());\n $this->_assertWholelyLocal($field);\n $this->_assertMetaInfoValues($tableName, $whichField, $field);\n }", "function isTextType($type)\n{\n return($type == \"string\" or $type == \"varchar\" or $type == \"tinytext\" or $type == \"password\" or\n $type == \"set\" or $type == \"enum\" or $type == \"char\" or $type == \"file\" or isTextAreaType($type));\n}", "function ae_check_db_fields( ) {\n\n $count = 0;\n $cols = ae_get_db_fields();\n $foo = ae_db_queries();\n if( $cols ){\n foreach($cols as $col) {\n\n if( isset($foo[$col->COLUMN_NAME]) ) {\n\n if(\n $col->DATA_TYPE != $foo[$col->COLUMN_NAME]['type'] ||\n $col->CHARACTER_MAXIMUM_LENGTH < $foo[$col->COLUMN_NAME]['numb']\n ) {\n $count++;\n }\n }\n }\n }\n\n return $count;\n}", "public function testRegistrationFieldsWrongType(): void { }", "public function getValidTypes()\r\n\t{\r\n\t\treturn array(\"Float\", \"Integer\", \"Location\", \"Text\", \"Boolean\", \r\n\t\t\t\"MultiText\", \"Date\", \"DateTime\", \"Enum\", \"MultiEnum\", \"Group\");\t\r\n\t}", "function acf_get_valid_field($field = \\false)\n{\n}", "function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}", "public function is_valid()\n\t{\n\t\t\n\t\t$field_value = trim($this->value);\n\t\t\n\t\tif($field_value == \"\")\n\t\t\treturn !$this->required;\n\t\t\n\t\tif(!in_array($field_value, $this->enum_array))\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n \t\n\t}", "function check( $value, $type='text' )\n {\n return Pgg_Validate::is( $value, $type );\n }", "private function validate($value,$type) {\n\t\tswitch($type) {\n\t\t\tcase \"varchar\":\n\t\t\t\treturn self::is_alphanum($value);\n\t\t\t\tbreak;\n\t\t\tcase \"int\":\n\t\t\t\treturn self::is_num($value);\n\t\t\t\tbreak;\n\t\t\tcase \"binary\":\n\t\t\t\treturn self::is_binary($value);\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tcase \"signed\":\n\t\t\t\treturn self::is_signed($value);\n\t\t\t\tbreak;\n\t\t\tcase \"file\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static function field($value, string $type, array $params = []): bool\n {\n $validated = true;\n switch ($type) {\n case \"email\":\n $validated = self::email($value);\n\n break;\n case \"text\":\n $validated = self::str_length($value, $params);\n break;\n case \"password\":\n $validated = self::str_length($value, $params) === true && self::password($value) === true;\n\n }\n\n return $validated;\n }", "public function testAcceptsAnInputObjectTypeWithFields()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $inputObjectType = newInputObjectType([\n 'name' => 'SomeInputObject',\n 'fields' => ['f' => ['type' => stringType()]],\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $field = $inputObjectType->getField('f');\n $this->assertEquals(stringType(), $field->getType());\n }", "private function isTypeValid($param)\n {\n return is_array($param) || is_string($param) || is_null($param);\n }", "function register_field_type_info($info)\n {\n }", "function acf_validate_field( $field ) {\n\t\t\n\t\t// 5.5.6 - changed filter name\n\t\t$field = apply_filters( \"acf/get_valid_field/type={$field['type']}\", $field );\n\t\t$field = apply_filters( \"acf/get_valid_field\", $field );\n\t\t\n\t\t\n\t\t// return\n\t\treturn $field;\n\t\t\n\t}", "abstract public function supported_fields();", "public function testIsMultiTypeInvalid()\n {\n $this->assertFalse($this->annotation->isMultiValuedType(Field::TYPE_BOOLEAN));\n }", "public function testUpdateFieldsWrongType(): void { }", "public final function getFieldtype($fld)\n {\n return isset($this->columns->{$fld}) ? $this->db->convertType($this->columns->{$fld}->type) : false;\n }", "function register_field_type($class)\n {\n }", "public function validateType()\n {\n $validTalkTypes = $this->getOption('types');\n\n if (empty($this->_cleanData['type']) || !isset($this->_cleanData['type'])) {\n $this->_addErrorMessage(\"You must choose what type of talk you are submitting\");\n\n return false;\n }\n\n if (!isset($validTalkTypes[$this->_cleanData['type']])) {\n $this->_addErrorMessage(\"You did not choose a valid talk type\");\n\n return false;\n }\n\n return true;\n }", "public function validate()\n {\n $this->validateRequiredParameters();\n\n if (!is_string($this->getType())) {\n throw new InvalidDocumentException(\"The type parameter must be a string\");\n }\n }", "public function getDataWithTypeField() {}", "protected abstract function get_rest_field_type();", "public function hasCustomFields(): bool\n {\n foreach ($this->fields as $fieldName => $field) {\n if (isset($field['type']) === false) {\n throw (new \\Exception('Field \\'' . $fieldName . '\\' has no type'));\n }\n\n if ($field['type'] == 'custom') {\n return true;\n }\n }\n\n return false;\n }", "private function validate_fields_against_table( $fields ) {\n\t\tglobal $wpdb;\n\n\t\t$valid_fields = array();\n\n\t\t// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\t\t$result = $wpdb->get_results( \"SHOW COLUMNS FROM {$this->table}\", ARRAY_A );\n\n\t\tforeach ( $result as $result_row ) {\n\t\t\t$valid_fields[] = $result_row['Field'];\n\t\t}\n\n\t\t// Check if the fields are actually contained in the table.\n\t\tforeach ( $fields as $field_to_check ) {\n\t\t\tif ( ! in_array( $field_to_check, $valid_fields, true ) ) {\n\t\t\t\tthrow new Exception( \"Invalid field name: field '{$field_to_check}' doesn't exist in table {$this->table}\" );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function checkInlineFileTypeAccessForFieldForFieldNoFiletypesReturnsTrue() {}", "public function isValueValid($value) {\n\t\treturn $value instanceof DataType\\TextType;\n\t}", "function drush_behat_op_is_field($is_field_info) {\n list($entity_type, $field_name) = $is_field_info;\n return _drush_behat_is_field($entity_type, $field_name);\n}", "protected function checkType(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Type) && $this->_Type !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Type} is not a valid value for Type\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\tif ( $isValid && $this->_Type != '' && !in_array($this->_Type, array(self::TYPE_SOURCE, self::TYPE_THUMBNAIL, self::TYPE_FILE, self::TYPE_CCA)) ) {\n\t\t\t$inMessage .= \"Type must be one of TYPE_SOURCE, TYPE_THUMBNAIL, TYPE_FILE\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\treturn $isValid;\n\t}", "function validate ($type, $value)\n {\n \n if($type == \"link\") {\n return filter_var($value, FILTER_VALIDATE_URL);\n }\n if($type == \"picture\") {\n $ext = substr($value, strlen($value) - 4, 4);\n if($ext != \".png\" && $ext != \".jpg\" && $ext != \".gif\") return false;\n else return true;\n }\n if($type == \"int\") {\n return is_numeric($value);\n }\n if($type == \"string\") {\n return true;\n }\n if($type == \"date\") {\n if($value instanceof DateTime) return true;\n else return false;\n }\n }", "public function getUnsupportedFieldTypes()\n {\n return array( 'Rich Text', 'Table', 'Matrix' );\n }", "public function valid () {\n return isset($this->__fields[key($this->__fields)]);\n }", "public function getFieldType($fieldname);", "public function checkFieldStatus()\n {\n $helper = $this->helper;\n $product = $this->coreRegistry->registry('product');\n $productType = $product->getTypeId();\n $allowedsProducts = explode(',', $helper->getAllowedProductType());\n if (in_array($productType, $allowedsProducts)) {\n return true;\n }\n return false;\n }", "public static function isFieldValid(Field $field): bool\n {\n return ($field instanceof Json && $field->collectionType === ValueCollection::LIST_COLLECTION)\n || ($field instanceof ManyRelationField);\n }", "function checkFields( $args )\r\n {\r\n\t\treturn true;\r\n }", "function __validate($val=false, $type=false) {\n\t\tif(!$val || !$type) return false;\n\t\t$val = trim($val);\n\t\tswitch($type) {\n\t\t\tcase 'numeric':\n\t\t\t\tif(is_numeric($val)) return true;\n\t\t\t\tbreak;\n\t\t\tcase 'exists':\n\t\t\t\tif($val && $val != '' && $val !== '') return true;\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\tif(!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $val)) return false;\n\t\t\t\tif(!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$\", $val)) return false;\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase 'password':\n\t\t\t\tif(preg_match(\"/^[a-zA-Z0-9_-]{8,20}$/i\", $val)) return true;\n\t\t\t\tbreak;\n\t\t\tcase 'bool':\n\t\t\t\tif($val === true || $val === false) return true;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn false;\n\t}", "function hasValidDataField()\r\n {\r\n $result=false;\r\n\r\n if ($this->_datafield!=\"\")\r\n {\r\n if ($this->_datasource!=null)\r\n {\r\n if ($this->_datasource->Dataset!=null)\r\n {\r\n $result=true;\r\n }\r\n }\r\n }\r\n\r\n return($result);\r\n }", "private function changelog_validate_object () {\n\t\t# set valid objects\n\t\t$objects = array(\n\t\t\t\t\t\t\"ip_addr\",\n\t\t\t\t\t\t\"subnet\",\n\t\t\t\t\t\t\"section\"\n\t\t\t\t\t\t);\n\t\t# check\n\t\treturn in_array($this->object_type, $objects) ? true : false;\n\t}", "function acf_validate_field($field = array())\n{\n}", "public function isField() : bool\n {\n return null == $this->fields || empty($this->fields);\n }", "public static function isFieldUsed($field_type)\n {\n return Symphony::Database()->fetchVar('count', 0, sprintf(\n \"SELECT COUNT(*) AS `count` FROM `tbl_fields` WHERE `type` = '%s'\",\n $field_type\n )) > 0;\n }", "public function test_retrieving_all_available_field_types_returns_none_when_empty()\n {\n $this->setupNoFieldTypes();\n $types = $this->fieldManager->availableTypes();\n $this->assertTrue(is_array($types));\n $this->assertEmpty($types);\n }", "public function validate_fields() {\n\n\t\t$this->validate_refund_address_field();\n\t}", "function validate_user_field($field)\n {\n }", "function validateUploadField(&$model, $fieldData, $fieldName) {\n if (empty($fieldData[$fieldName]) || !is_array($fieldData[$fieldName])) return false;\n return true;\n }", "function __checkType($type = null) {\n\t\t$valid = false;\n \tforeach($this->allowedTypes as $allowedType) {\n \t\tif(strtolower($type) == strtolower($allowedType)){\n \t\t$valid = true;\n \t\t}\n \t}\n\t\tif(!$valid) {\n\t\t\t$this->Session->setFlash('You tried to upload an invalid type! Please upload your pictures in jpeg, gif, or png format!');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t}", "function PMA_istableFieldBlob($field)\n{\n // If check to ensure types such as \"enum('one','two','blob',..)\" or\n // \"enum('one','two','tinyblob',..)\" etc. are not categorized as blob.\n if (stripos($field['Type'], 'blob') === 0\n || stripos($field['Type'], 'tinyblob') === 0\n || stripos($field['Type'], 'mediumblob') === 0\n || stripos($field['Type'], 'longblob') === 0\n ) {\n return stristr($field['Type'], 'blob');\n } else {\n return false;\n }\n}", "public function vehicle_type_check(){\n\t\t\t\n\t\t\t$str1 = $this->input->post('vehicle_type');\n\t\t\t\n\t\t\tif ($str1 == '' || $str1 == '0')\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('vehicle_type_check', 'Please select a vehicle type');\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}", "static function validate ($type, $v)\n {\n if (is_null ($v) || $v === '')\n return true;\n\n switch ($type) {\n\n case type::binding:\n return is_string ($v);\n\n case type::any:\n case type::bool: // Any value can be typecast to boolean.\n return true;\n\n case type::data:\n return is_array ($v) || is_object ($v)\n || $v instanceof \\Traversable\n || (is_string ($v) && strpos ($v, '{') !== false);\n\n case type::id:\n return !!preg_match ('#^[\\w\\-]+$#', $v);\n\n case type::content:\n return $v instanceof Metadata || is_string ($v); // Note: content props can be specified in attribute syntax.\n\n case type::metadata:\n return $v instanceof Metadata;\n\n case type::collection:\n return is_array ($v);\n\n case type::number:\n return is_numeric ($v);\n\n case type::string:\n return is_scalar ($v) || (is_object ($v) && method_exists ($v, '__toString'));\n }\n return false;\n }", "public function validateType(GDT_Form $form, GDT $field, $value)\n\t{\n\t if ($user = GDO_User::getByLogin($value))\n\t {\n\t if (!$user->isMember())\n\t {\n \t return $field->error('err_user_type', [t('enum_member')]);\n\t }\n\t }\n\t return true;\n\t}", "function validate_taxonomy_field($field)\n {\n }", "function oci_field_type($statement, $field)\n{\n}", "public function check()\n {\n return ctype_digit($this->value);\n }", "public function check_validity() {\r\n\t\t$value = $this->get_posted_value();\r\n\r\n\t\t// required field check\r\n\t\t// 0, '0', and 0.0 need special handling since they're valid, but PHP considers them falsy values.\r\n\t\tif ( $this->props['required'] && ( empty( $value ) && ! in_array( $value, [ 0, '0', 0.0 ], true ) ) ) {\r\n\t\t\t// translators: Placeholder %s is the label for the required field.\r\n\t\t\tthrow new \\Exception( sprintf( _x( '%s is a required field.', 'Add listing form', 'my-listing' ), $this->props['label'] ) );\r\n\t\t}\r\n\r\n\t\t// if field isn't required, then no validation is needed for empty values\r\n\t\tif ( empty( $value ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// otherwise, run validations\r\n\t\t$this->validate();\r\n\t}", "public function fieldDataIsValid(array $fieldData) : bool\n {\n return true;\n }", "public function testConstructWithType()\n {\n $oField = new Field('DATE');\n\n $this->assertInstanceOf('PhpOffice\\\\PhpWord\\\\Element\\\\Field', $oField);\n $this->assertEquals('DATE', $oField->getType());\n }" ]
[ "0.75615853", "0.69236153", "0.66642106", "0.6571284", "0.6525033", "0.6510676", "0.6494292", "0.6459748", "0.64550215", "0.6442062", "0.64420354", "0.6441303", "0.6424762", "0.6422379", "0.63895327", "0.6347795", "0.6340625", "0.6333328", "0.6326221", "0.63169986", "0.63147277", "0.62462467", "0.623349", "0.62275547", "0.6221689", "0.62180406", "0.6188283", "0.6186024", "0.6163538", "0.61586726", "0.6144003", "0.6142207", "0.6137882", "0.61335176", "0.61198187", "0.6100194", "0.6094", "0.6087424", "0.6079739", "0.6076077", "0.6058136", "0.605547", "0.60515326", "0.6049816", "0.60433275", "0.6034886", "0.60328805", "0.60290813", "0.6010205", "0.60086954", "0.6005359", "0.59984285", "0.5994458", "0.59898573", "0.5981685", "0.59759617", "0.59607387", "0.5950095", "0.59466", "0.5945469", "0.59362286", "0.5933956", "0.5925861", "0.5924779", "0.592436", "0.592357", "0.5916506", "0.5909108", "0.5899483", "0.58832556", "0.5881211", "0.5881081", "0.58806145", "0.58765113", "0.5868088", "0.58652776", "0.5864538", "0.5859819", "0.58578134", "0.5855539", "0.58511525", "0.58500534", "0.5836598", "0.5826951", "0.5825922", "0.5824166", "0.5823508", "0.581745", "0.58145905", "0.5803121", "0.5792998", "0.57867616", "0.57850575", "0.5768974", "0.57671064", "0.5762971", "0.575921", "0.57575244", "0.57567763", "0.57535195" ]
0.5907314
68
Return list of fields and their descriptions/options
public static function getFields() { return self::$fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getListFields();", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function getFieldsList(){\n return $this->_get(1);\n }", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function listFields()\n\t{\n\t\treturn array('id' => 'ID', 'title' => 'Title', 'estimated' => 'Estimated', 'status' => 'Status', 'getPercentageComplete' => 'Percentage Complete');\n\t}", "function getFields();", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "protected function _fields()\n\t{\n\t\treturn array(\n\t\t\t\t'name',\n\t\t\t 'intro', 'sort_order',\n\t\t\t 'status', 'feature',\n\t\t);\n\t}", "public function getAllFields();", "public static function get_fields()\n {\n }", "function get_fields( ) {\n\t\treturn $this->fields_list;\n\t\t}", "public function getFields()\n {\n if ($this->fields) {\n return $this->fields;\n }\n\n $this->fields = array(\n 'data_type_id',\n 'name',\n 'aliases',\n 'description',\n 'driver',\n );\n\n return $this->fields;\n }", "public function list_fields() {\n return $this->db->list_fields($this->_table());\n }", "public function fields()\n {\n return [ \n ];\n }", "function get_field_list()\r\n\t{\r\n\t\t$fields = array();\r\n\r\n\t\tif (Authority::can('edit', 'admin/item/definition'))\r\n\t\t{\r\n\t\t\t$id_definition = $this->input->post('id_item_definition');\r\n\r\n\t\t\t$fields = $this->extend_field_model->get_lang_list(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'parent' => 'item',\r\n\t\t\t\t\t'id_parent' => $id_definition\r\n\t\t\t\t),\r\n\t\t\t\tSettings::get_lang('default')\r\n\t\t\t);\r\n\r\n\t\t\t// Set type names\r\n\t\t\tforeach($fields as &$field)\r\n\t\t\t{\r\n\t\t\t\t$field['type_name'] = self::$_TYPE_NAMES[$field['type']];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//\r\n\t\t$this->template['id_item_definition'] = $id_definition;\r\n\t\t$this->template['fields'] = $fields;\r\n\r\n\t\t$this->output('item/definition/fields');\r\n\t}", "public function fetchFields();", "public function fields(){\n\t\treturn array();\n\t}", "public function fields() {\n return $this->fields;\n }", "public function fields()\r\n {\r\n return $this->fields;\r\n }", "function GetFieldsList()\n\t{\n\t\tglobal $dal_info;\n\t\treturn array_keys( $dal_info[ $this->infoKey ] );\n\t}", "public function &getFields();", "public function getAllFields()\n {\n return $this->fields;\n }", "abstract public function getFields();", "abstract public function getFields();", "public function fields()\n {\n return $this->fields;\n }", "public function fields()\n {\n return $this->fields;\n }", "public function get_fields() {\r\n\t\treturn $this->fields;\r\n\t}", "public function getFields()\r\n {\r\n return $this->fields;\r\n }", "public function get_fields() {\n return $this->fields;\n }", "function get_field_list()\n\t{\n\t\t$fields = array();\n\n\n\t\t$this->xhr_output($fields);\n\t}", "public function getFrontendFields();", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "public function get_fields() {\n\t\treturn $this->fields;\n\t}", "abstract public function fields();", "public function getFields() {\n\t\treturn array(\n\t\t\tself::FIELD_ID,\n\t\t\tself::FIELD_NAME,\n\t\t\tself::FIELD_CREATED_AT,\n\t\t);\n\t}", "abstract function fields_options();", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function fields() {\n // The fields are passed to the constructor for this plugin.\n return $this->fields;\n }", "public function listFields()\n {\n return array_keys($this->fields);\n }", "private function getFields()\n {\n return [\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"first_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"last_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"happy\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"select\",\n \"field_name\" => \"character\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => [\n [\"value\" => \"biff\", \"label\" => \"Biff\"],\n [\"value\" => \"marty\", \"label\" => \"Marty\"],\n [\"value\" => \"doc\", \"label\" => \"Doc Brown\"],\n [\"value\" => \"jennifer\", \"label\" => \"Jennifer\"],\n [\"value\" => \"needles\", \"label\" => \"Needles\"],\n ]\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"kids\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n ];\n }", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.dealcategory.fields'\n );\n return $fullResult;\n }", "abstract protected function getFields();", "static public function getFieldsList () {\n return self::_getInstance()->_fieldsList;\n }", "private function _fields() {\n if ($this->_table() && empty($this->fields)) {\n $this->fields = $this->db->list_fields($this->_table());\n }\n return $this->fields;\n }", "public function getFields()\n\t{\n\t\treturn [];\n\t}", "public function getFields() {\n\n $fields = array(\"consumer_id\" => array('required'=> true, 'type'=>'hidden', 'disableDecorator' => array('HtmlTag', 'Label', 'DtDdWrapper')),\n \"allergy\" => array('label'=>'Allergy', 'required'=> true),\n \"info\"=>array('label'=>'Info','required'=> false, 'attributes'=>array('rows'=>'4', 'cols'=>'8')));\n \n if( !empty( $this->_id ) ) {\n \n $fields['id'] = array('default'=>$this->_id, 'type'=>'hidden', 'required'=> true,\n 'disableDecorator' => array('HtmlTag', 'Label', 'DtDdWrapper')); \n }\n \n return $fields;\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n return [];\n }", "public function getFields()\n\t{\n\t\treturn $this->fields;\n\t}", "public function getFields()\n\t{\n\t\treturn $this->fields;\n\t}", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.invoice.fields'\n );\n return $fullResult;\n }", "public function fetch_fields() {}", "public function fields() : DeepList {\n return $this->_fields;\n }", "public function fields()\n {\n return array_map(\n function (array $field) {\n return Field::fromArray($field);\n },\n $this->client->get('field')\n );\n }", "public static function fields()\n {\n return [\n 'name' => 'text',\n 'lastname' => 'text',\n 'password' => 'password',\n 'email' => 'email',\n 'github_username' => 'text',\n ];\n }", "function list_fields()\n\t{\n\t\t$field_names = array();\n\t\twhile ($field = mysqli_fetch_field($this->result_id))\n\t\t{\n\t\t\t$field_names[] = $field->name;\n\t\t}\n\n\t\treturn $field_names;\n\t}", "public function getFields() {\n\t\treturn $this->fields;\n\t}", "public function getFields() {\n\t\treturn $this->fields;\n\t}", "protected function getFieldsFromShowItem() {}", "protected function getFields()\n {\n return $this->fields;\n }", "protected function getFields()\n {\n return $this->fields;\n }", "public function getFieldDescriptions()\n {\n return array(\n 'shipment.created_at' => 'Read only.',\n 'shipment.updated_at' => 'Read only.',\n 'shipment.order_increment_id' => 'Required to create a shipment.',\n 'shipment.items' => 'Required to create a shipment.',\n 'shipment.entity_id' => 'Read only.',\n 'shipment.external_order_id' => 'Read only.'\n );\n }", "public function getFields()\n\t\t{\n\t\t\treturn $this->fields;\n\t\t}", "function fields()\n\t{\n\t\treturn $this->_fields;\n\t}", "public function getFieldList()\n {\n $sObjectName = $this->getShopObjectName();\n\n if ($sObjectName) {\n $oShopObject = oxNew($sObjectName);\n } else {\n $oShopObject = oxNew('oxbase');\n $oShopObject->init($this->getTableName());\n }\n\n if ($oShopObject instanceof oxI18n) {\n $oShopObject->setLanguage(0);\n $oShopObject->setEnableMultilang(false);\n }\n\n $sViewName = $oShopObject->getViewName();\n $sFields = str_ireplace('`' . $sViewName . \"`.\", \"\", strtoupper($oShopObject->getSelectFields()));\n $sFields = str_ireplace(array(\" \", \"`\"), array(\"\", \"\"), $sFields);\n $this->_aFieldList = explode(\",\", $sFields);\n\n return $this->_aFieldList;\n }", "public function getFields() {\n return $this->program->getFields();\n }", "public function getFieldList()\n {\n return $this->_fieldList;\n }", "public function getFields(): array;", "public function getFields(): array;", "public function getFields(): array;", "function get_core_fields($options)\n\t{ \n $output=array();\n $output['title']=$this->get_array_nested_value($options,'table_description/title_statement/title');\n $output['subtitle']=$this->get_array_nested_value($options,'table_description/title_statement/sub_title');\n $output['idno']=$this->get_array_nested_value($options,'table_description/title_statement/idno');\n\n $nations=(array)$this->get_array_nested_value($options,'table_description/ref_country');\n $nations=array_column($nations,'name');\n\n $output['nations']=$nations;\n $output['nation']=$this->get_country_names_string($nations);\n\n $output['abbreviation']=$this->get_array_nested_value($options,'table_description/title_statement/alternate_title'); \n \n $auth_entity=$this->get_array_nested_value($options,'table_description/publisher');\n $output['authoring_entity']=$this->array_column_to_string($auth_entity,$column_name='name', $max_length=300);\n\n $years=$this->get_years($options);\n $output['year_start']=$years['start'];\n $output['year_end']=$years['end'];\n \n return $output;\n }", "public function getFields(){\n\t\treturn $this->Fields;\n\t}", "public function getFields()\n {\n return $this->_fields;\n }", "public function getFields()\n {\n return $this->_fields;\n }", "public function get_fields()\n {\n return [\n \"isys_catg_invoice_list__denotation\" => \"LC__CMDB__CATG__TITLE\",\n \"isys_catg_invoice_list__amount\" => \"LC__CMDB__CATG__INVOICE__AMOUNT\",\n \"isys_catg_invoice_list__date\" => \"LC__CMDB__CATG__INVOICE__DATE\",\n \"isys_catg_invoice_list__edited\" => \"LC__CMDB__CATG__INVOICE__EDITED\",\n \"isys_catg_invoice_list__financial_accounting_delivery\" => \"LC__CMDB__CATG__INVOICE__FINANCIAL_ACCOUNTING_DELIVERY\",\n \"isys_catg_invoice_list__charged\" => \"LC__CMDB__CATG__INVOICE__CHARGED\",\n ];\n }", "public function getFields()\n\t{\n\t\treturn [\"tanggal\", \"keterangan\"];\n\t}", "public static function fields()\n {\n return [\n 'nice_quote_id' => 'text',\n 'date' => 'text',\n 'netdays' => 'text',\n 'total' => 'text',\n 'status' => 'text',\n ];\n }" ]
[ "0.80122834", "0.79005677", "0.79005677", "0.79005677", "0.79005677", "0.79005677", "0.7887434", "0.7864652", "0.7864652", "0.7864652", "0.7864652", "0.7864652", "0.7864652", "0.7829832", "0.7774427", "0.77306986", "0.77306986", "0.77306986", "0.7676392", "0.76489675", "0.75643474", "0.75257105", "0.75172466", "0.7462351", "0.7333654", "0.7328387", "0.73007774", "0.72914577", "0.7289104", "0.728626", "0.72791034", "0.72485435", "0.7248207", "0.72418034", "0.72418034", "0.720915", "0.720915", "0.7202219", "0.71895075", "0.7179081", "0.7168356", "0.7149778", "0.7141211", "0.7140596", "0.7131996", "0.71221405", "0.71148974", "0.71109575", "0.71109575", "0.71109575", "0.71109575", "0.71109575", "0.71109575", "0.71109575", "0.71109575", "0.71109575", "0.71109575", "0.71109575", "0.71036434", "0.71005225", "0.70953655", "0.70952654", "0.7092051", "0.70915836", "0.7089112", "0.7082549", "0.70818734", "0.70744854", "0.70744854", "0.70744854", "0.70744854", "0.70744854", "0.7071439", "0.7071439", "0.70705223", "0.7053294", "0.7049694", "0.704353", "0.70299816", "0.7025978", "0.7005431", "0.7005431", "0.6994104", "0.6990975", "0.6990975", "0.698999", "0.69890946", "0.6984548", "0.69779503", "0.69645554", "0.69616616", "0.6955046", "0.6955046", "0.6955046", "0.6948258", "0.6946856", "0.694498", "0.694498", "0.6944072", "0.69381803", "0.6932915" ]
0.0
-1
$area = ['area' => Area::lists('nombre','id')];
public function create() { return \View::make('cdp/new_cdp'/*,$area*/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function area()\n {\n return $this->belongsTo('App\\Models\\Area', 'area_id', 'id');\n }", "public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }", "public function Tarea()\n {\n return $this->hasMany('App\\Tarea','areas_id','id');\n }", "public function area_list($id)\n {\n $area_list=DB::table('add_area')->where('add_city_id',$id)->get();\n return view('/view_areas',['area_list'=>$area_list,'city_id'=>$id]);\n }", "function getAreaPorDeptoSinAsignar(){\r\n\r\n $cens_id = $this->input->post('id_censo');\r\n $depa_id = $this->input->post('id_depto');\r\n $areas = $this->Areas->ObtenerXDepaSinAsignar($cens_id, $depa_id)->areas->area;\r\n\r\n echo json_encode($areas);\r\n\r\n }", "function getAreaPorDepto(){\r\n\r\n $depa_id = $this->input->post('id_depto');\r\n $areas = $this->Areas->ObtenerXDepartamentos($depa_id)->areas->area;\r\n echo json_encode($areas);\r\n }", "public function ajaxAreas()\n {\n $lineId = Input::get('lineId');\n $areas = Area::where('line_id', $lineId)->lists('name', 'id');\n return Response::json($areas); \n }", "public function getAreas(): AreasCollection;", "public function area()\n {\n return $this->belongsTo('App\\Area');\n }", "public function area()\n {\n return $this->belongsTo('App\\Area');\n }", "public function area_interes(){\n\t\treturn $this->belongsTo('App\\AreaInteres', 'Asp_ID_Area_Interes');\n\t}", "public function Tiempos_x_Area()\n {\n return $this->hasMany('App\\Tiempos_x_Area','areas_id','id');\n }", "public function index()\n {\n //$sub_area = Sub_area::all();\n //Listar relaciones con foreach EagerLoading\n $sub_area = Sub_area::with('areas')->get();\n //dd($area = $sub_area->areas());\n\n return view('sub_area.index',['sub_area' => $sub_area]);\n }", "public function areasDetails()\n {\n return $this->hasManyThrough(FilterPracticeArea::class, CandidateSubSpecialism::class, 'candidate_id', 'id', 'id', 'area_id');\n }", "public function tareas()\n {\n return $this->hasMany('App\\Tarea','id_cliente');\n }", "public function create()\n {\n $all_areas = Area::all();\n\n //dd($all_areas);\n return view('dashboard.pages.Property.create')->with(array('all_areas' => $all_areas));\n }", "public function get_area($id=0){\n $areas = Area::where('city_id', $id)->orderBy('name', 'asc')->get();\n $output = '';\n if(count($areas)>0){\n $output .= '<option value=\"\">Select area</option>';\n foreach($areas as $area){\n $output .='<option '. (Session::get('area') == $area->id ? \"selected\" : \"\" ).' value=\"'.$area->id.'\">'.$area->name.'</option>';\n }\n }\n echo $output;\n }", "static function get() {\n global $p;\n $areaid= intval($p['id']);\n echo json_encode(sql::result(\"select areaID as id,areaName as name from area where mainArea='\".$areaid.\"'\"));\n }", "public static function ADMIN_AREA_GET_AREA_LIST(){\n\t $SQL_String = \"SELECT * FROM area_main WHERE _keep=1 ORDER BY ano ASC;\";\n\t return $SQL_String;\n\t}", "public function create()\n {\n $area = Area::with('departamentos')->get();\n\n return view('sub_area.create',['areas' => $area]);\n }", "public function index()\n {\n /*$datos['areas'] = Area::paginate(10);\n return view('area.index', $datos);*/\n $areas = Area::paginate(10);\n return view('area.index', compact('areas'));\n }", "public function User()\n {\n return $this->hasMany('App\\User','areas_id','id');\n }", "public function areas($id = null){\n $data['areas'] = [];\n if( request()->ajax() ){\n $data['areas'] = getAreas($id)->toSelect(0, 'Select Area');\n }\n\n return $data;\n }", "public function area(){\n return $this->hasMany(InspectionArea::class,'inspection_id','id');\n }", "function listar_areas(){\n $sql =\n \"SELECT\n tbl_area_encargada.Pk_Id_Area_Encargada,\n tbl_area_encargada.Nombre\n FROM\n destinatarios_email\n INNER JOIN tbl_area_encargada ON destinatarios_email.Fk_Id_Area_Encargada = tbl_area_encargada.Pk_Id_Area_Encargada\n GROUP BY\n destinatarios_email.Fk_Id_Area_Encargada\n ORDER BY\n destinatarios_email.Fk_Id_Area_Encargada ASC\";\n\n //Se retorna el resultado de la consulta\n return $this->db->query($sql)->result();\n }", "public function sides()\n {\n return $this->belongsToJson(Side::class,'side_ids');\n }", "public function area_list(){\n $area_list = $this->User_Model->get_list_by_id2('tahsil_id as area_id, tahsil_name as area_name','tahsil_status',1,'tahsil');\n if($area_list) {\n $response[\"status\"] = TRUE;\n $response[\"area_list\"] = $area_list;\n } else {\n $response[\"status\"] = FALSE;\n $response[\"area_list\"] = $area_list;\n }\n\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function create()\n {\n $areas = Area::all();\n return response()->json([\n 'areas' => $areas,\n ]);\n }", "public function getFrontendAreas(): AreasCollection;", "public static function listado() {\n $aulas = array();\n $resultset = DB::table('aulas')->get();\n foreach ($resultset as $var) {\n $aulas[$var->AULA] = $var->AULA;\n }\n return $aulas;\n }", "public function getRegiones($id){ //id del pais\n return Region::where('codPais','=',$id)->get();\n \n }", "public function regionlist(){\n if($this->request->all()){\n $id = array_flatten($this->request->all());\n $sorted = $this->region->select('id','region')->whereIn('id',$id)->where('status',1)->get()->sortBy('region');\n }else{\n $sorted = $this->region->select('id','region')->where('status',1)->get()->sortBy('region');\n }\n return $sorted->values()->all();\n }", "public function listar()\n {\n $empleados = Empleados::with('area')->get();\n return view('empleados.listar', compact('empleados'));\n }", "public function index()\n {\n $areas = DB::table('grados')->get();\n return view('titulomiig::area')->with('areas', $areas);\n }", "public function run()\n {\n \n\n \\DB::table('areas')->delete();\n \n \\DB::table('areas')->insert(array (\n 0 => \n array (\n 'id' => 14,\n 'name' => 'Administración Pública local',\n ),\n 1 => \n array (\n 'id' => 10,\n 'name' => 'Administración pública provincial',\n ),\n 2 => \n array (\n 'id' => 16,\n 'name' => 'Agricultura, ganadería, pesca y silvicultura',\n ),\n 3 => \n array (\n 'id' => 15,\n 'name' => 'Agua y saneamiento',\n ),\n 4 => \n array (\n 'id' => 7,\n 'name' => 'Arte y cultura',\n ),\n 5 => \n array (\n 'id' => 1,\n 'name' => 'Ciencia y tecnología',\n ),\n 6 => \n array (\n 'id' => 9,\n 'name' => 'Desarrollo social',\n ),\n 7 => \n array (\n 'id' => 13,\n 'name' => 'Desarrollo urbano',\n ),\n 8 => \n array (\n 'id' => 12,\n 'name' => 'Economía social',\n ),\n 9 => \n array (\n 'id' => 6,\n 'name' => 'Educación',\n ),\n 10 => \n array (\n 'id' => 2,\n 'name' => 'Energía',\n ),\n 11 => \n array (\n 'id' => 5,\n 'name' => 'Industria, comercio y servicios',\n ),\n 12 => \n array (\n 'id' => 11,\n 'name' => 'Infraestructura, Vivienda y Edificaciones',\n ),\n 13 => \n array (\n 'id' => 3,\n 'name' => 'Medio Ambiente',\n ),\n 14 => \n array (\n 'id' => 8,\n 'name' => 'Salud',\n ),\n 15 => \n array (\n 'id' => 4,\n 'name' => 'Tecnologías de la información y la comunicación',\n ),\n ));\n \n \n }", "public function index()\n {\n $areas = Area::orderBy('idArea', 'asc')\n ->where('clasificacion', 'area')\n ->get();\n\n $subareas = Area::orderBy('idArea', 'asc')\n ->where('clasificacion', 'subarea')\n ->get();\n return view('areas.edit', compact(['areas', 'subareas']));\n \n }", "public function index(){\n\n $zonas = $this->database->select('Zona',['id','zona']);\n\n for ($i=0; $i <count($zonas); $i++) {\n\n $zonas[$i]['id']=intval($zonas[$i]['id']);\n\n }\n\n return $zonas;\n\n }", "public static function obtenerEmpresas(){ \n $partidas = self::find() \n ->orderBy('razon_social')\n ->all();\n return ArrayHelper::map($partidas,'empresa_id','razon_social');\n }", "public function listar($unidad_id)\n {\n $this->db->where('a_unidad',(int)$unidad_id);\n return $this->db->get('Areas')->result();\n }", "public function tareas()\n {\n return $this->hasMany('App\\Tarea');\n }", "public function devolveTodosGruposAreas() {\n\t\t$this->load->database();\n\t\t$queryResult = $this->db->select('Area.id as AreaID , Area.nome, Grupo.id as GrupoID, Grupo.tipo,')\n\t\t\t\t\t\t\t\t->from('Grupo_Area')\n\t\t\t\t\t\t\t\t->join('Area', 'Grupo_Area.area = Area.id')\n\t\t\t\t\t\t\t\t->join('Grupo', 'Grupo_Area.grupo = Grupo.id')\n\t\t\t\t\t\t\t\t->get();\n\t\t$result = $queryResult->result();\t\t\t\t\t\n\t\t\n\t\treturn $result;\n\t}", "public function fields()\n {\n $statuses = \\App\\Status::all()->pluck('name','id');\n return [\n Select::make('Status','id')->options($statuses)\n ];\n }", "public function index()\n {\n $id = Auth::user()->id;\n\n $params = [\n 'titulo' => 'Area de actuacao',\n 'perfil' => Perfil::find($id),\n 'areas' => AreaActuacao::all(),\n ];\n return view('membro.area.index')->with($params);\n\n }", "public function area_setting($id)\n {\n $area=DB::table('add_city')->where('id',$id)->first();\n //print_r($area);exit();\n return view('/add_areas',['area'=>$area,'city_id'=>$id]);\n }", "function get_list_to_show($area)\n\t{\n\t\t$this->load->model('_procurement_plan');\n\t\t$this->load->model('_contract');\n\t\t$this->load->model('_bid');\n\t\t$list = array();\n\t\t\n\t\tif($area == 'procurement_plans') {\n\t\t\t$list = $this->_procurement_plan->lists(array('status'=>'published', 'offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE));\n\t\t} else if($area == 'best_evaluated_bidders') {\n\t\t\t$list = $this->_bid->lists('awards');\n\t\t} else if($area == 'active_notices') {\n\t\t\t$list = $this->_tender->lists(array('status'=>'published', 'display_type'=>'public', 'offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE));\n\t\t} else if($area == 'contract_awards') {\n\t\t\t$list = $this->_contract->lists(array('offset'=>0, 'limit'=>NUM_OF_ROWS_PER_PAGE, 'status'=>array('active','complete','endorsed','commenced')));\n\t\t}\n\t\t\n\t\treturn $list;\n\t}", "public function create()\n {\n $areas = Area::all();\n return view('/catalogos.areas.nueva')->with(compact('areas'));\n }", "public function Tipos_fase()\n {\n return $this->hasMany('App\\Planeacion_tipo','areas_id','id');\n }", "public function listar(){\n $eventos = \n DB::table('agendas')->where('id_usuario', auth()->user()->id )->orwhere('cliente', auth()->user()->id )->get();\n\n // $eventos = Agenda::all();\n // dd($eventos);\n $eve=[];\n\n foreach($eventos as $evento){\n\n\n $eve[] = [\n\n \"id\"=>$evento->id,\n \"start\"=>$evento->fecha . \" \" . $evento->hora_inicio,\n \"end\"=>$evento->fecha . \" \". $evento->hora_final,\n \"title\"=>$evento->titulo,\n \"backgroundColor\"=>$evento->estado == 1 ? \"#7ACF2A\" : \"#CF2A2A\",\n \"textColor\"=>\"#fff\",\n \"extendedProps\"=>[\n \"id_usuario\"=>$evento->id_usuario,\n \"precio\"=>$evento->precio,\n\n\n ]\n\n ]; \n\n\n }\n\n return response()->json($eve);\n\n}", "public function index()\n {\n $areas = Area::orderBy('area')->get();\n return view('main.expedition.area.index')->withAreas($areas);\n }", "public function fillRoles(){\n $query = Rol::select('id_rol','nombre')->where('estado','=','true')->get();\n return $query;\n }", "public function run()\n {\n //factory(Kind::class, 10)->create();\n $items = [\n [\n 'name' => 'Aposentadoria por Idade',\n 'area_id' => 2\n ],\n [\n 'name' => 'Aposentadoria por Tempo de Contribuição',\n 'area_id' => 2\n ],\n [\n 'name' => 'Aposentadoria Especial - Trabalhador Rural',\n 'area_id' => 2\n ],\n [\n 'name' => 'Auxílio Doença',\n 'area_id' => 2\n ],\n [\n 'name' => 'LOAS',\n 'area_id' => 2\n ], [\n 'name' => 'Ação de Aposentadoria por Idade',\n 'area_id' => 5\n ],\n [\n 'name' => 'ação de Aposentadoria por Tempo de Contribuição',\n 'area_id' => 5\n ],\n [\n 'name' => 'Ação de Aposentadoria Especial - Trabalhador Rural',\n 'area_id' => 5\n ],\n [\n 'name' => 'Ação de Auxílio Doença c/c Aposentadoria por Invalidez',\n 'area_id' => 5\n ],\n [\n 'name' => 'Ação de Requerimento de Benefício Assistencial',\n 'area_id' => 5\n ],\n [\n 'name' => 'Ação de Usucapião',\n 'area_id' => 6\n ],\n [\n 'name' => 'Ação de Indenização por Danos Materiais e Morais',\n 'area_id' => 6\n ],\n [\n 'name' => 'Ação de Inventário',\n 'area_id' => 8\n ],\n [\n 'name' => 'Ação de Alimentos',\n 'area_id' => 6\n ],\n\n ];\n //factory(Area::class, 10)->create();\n foreach ($items as $item) {\n Kind::create($item);\n }\n }", "public function index()\n {\n $areas = Area::all();\n \n return view('areas', compact('areas'));\n }", "public function run()\n {\n Areas::truncate();\n Areas::create([\n 'nombre'=> 'Dirección General',\n 'tipo_area'=>'Dirección'\n ]);\n Areas::create([\n 'nombre'=>'Capital Humanos',\n 'pertenece'=>1,\n 'tipo_area'=>'RRHH'\n ]);\n Areas::create([\n 'nombre'=>'Contable - Finaciera',\n 'pertenece'=>1,\n 'tipo_area'=>'Economía'\n ]);\n Areas::create([\n 'nombre'=>'Técnica',\n 'pertenece'=>1,\n 'tipo_area'=>'Técnica'\n ]);\n Areas::create([\n 'nombre'=>'Informática',\n 'pertenece'=>1,\n 'tipo_area'=>'Informática'\n ]);\n Areas::create([\n 'nombre'=>'Operaciones',\n 'pertenece'=>1,\n 'tipo_area'=>'Operaciones'\n ]);\n Areas::create([\n 'nombre'=>'Brigada de Operaciones',\n 'pertenece'=>6,\n 'tipo_area'=>'Brigada de Operaciones'\n ]);\n Areas::create([\n 'nombre'=>'Comercial',\n 'pertenece'=>1,\n 'tipo_area'=>'Comercial'\n ]);\n Areas::create([\n 'nombre'=>'Mecanización',\n 'pertenece'=>1,\n 'tipo_area'=>'Mecanización'\n ]);\n Areas::create([\n 'nombre'=>'Aseguramientos Generales',\n 'pertenece'=>1,\n 'tipo_area'=>'Aseguramientos Generales'\n ]);\n }", "public static function getAllAreas() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from area');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "private function listado_obras(){\n \treturn Sesion::where(\"inicio\",\">\",Carbon::now())->distinct()->get(['nombre_obra']);\n }", "public function my_profile()\n {\n\n $user = \\Auth::user();\n\n $this->data['areas'] = Area::all();\n $myUser = User::where('id',$user->id)->get()->toArray();\n $this->data['user'] = $myUser[0];\n $this->data['areas_defined'] = \\DB::table('area_user')->select('area_id')->where(\"user_id\",$this->data['user']['id'])->get();\n\n\n $areas = array();\n\n if(!empty($this->data['areas_defined'])){\n\n foreach ($this->data['areas_defined'] as $key2 => $value2) {\n array_push($areas, $value2->area_id);\n }\n\n $this->data['areas_defined'] = $areas;\n }\n\n return view('backpack::auth.account.my_profile', $this->data);\n }", "public function getArrayParaSelect()\n {\n return $this->model()::pluck('nome', 'id')->all();\n }", "public function list_pais()\n {\n $listpais = DB::table('par_pais')->select('id','pai_nombre')->orderBy('pai_nombre')->get();\n\t\treturn $listpais;\n }", "public function fields(Request $request)\n {\n\n // $nestedBranchAreasForm = NestedForm::make('Branch_areas');\n // $nestedBranchAreasForm = $nestedBranchAreasForm->showOnDetail(true);\n\n return [\n\n\n ID::make()->sortable(),\n Text::make('ชื่อสาขา', 'name')->sortable()\n ->size('w-1/2')\n ->rules('required'),\n Text::make('รหัส', 'code')\n ->size('w-1/2')\n ->hideFromIndex(),\n Text::make('โทรศัพท์', 'phoneno')\n ->size('w-1/2')\n ->rules('required', 'numeric')\n ->hideFromIndex(),\n Select::make('การเป็นเจ้าของ', 'type')->options([\n 'owner' => 'บริษัทเป็นเจ้าของ',\n 'pathner' => 'ร่วมบริการ'\n ])->displayUsingLabels()\n ->size('w-1/2')\n ->hideFromIndex(),\n\n new Panel('ที่อยู่', $this->addressFields()),\n HasMany::make('พื้นที่บริการของสาขา', 'branch_areas', 'App\\Nova\\Branch_area'),\n HasMany::make('เส้นทางขนส่งภายในสาขา', 'branch_routes', 'App\\Nova\\Branch_route'),\n BelongsToMany::make('เส้นทางขนส่งระหว่างสาขา', 'routeto', 'App\\Nova\\Branch')\n ->fields(function () {\n return [\n Text::make('ชื่อเส้นทาง', 'name'),\n Currency::make('ระยะทาง(กม.)', 'distance'),\n ];\n }),\n\n\n ];\n }", "private function _getAreas() \r\n {\r\n $values = explode(\",\", Mage::getStoreConfig('cms/banners/areas'));\r\n $areas = array();\r\n\r\n foreach ($values as $value) {\r\n $areas[] = array('value' => $value, 'label' => $value);\r\n }\r\n $areas[] = array('value' => 'category', 'label' => 'categoria');\r\n\r\n return $areas;\r\n }", "public function create()\n {\n\t\t$areas = $this->areaRepository->pluck('nombre','id');\n return view('empleados.create', compact('areas',$areas));\n }", "public function getHouseListAttribute(){\n return $this->houses->lists('id')->all();\n }", "public function __construct()\n {\n $this->middleware('auth'); //enable this for auth! //**************todo\n\t\t\n$this->Area = \\App\\Models\\Area::orderBy('AreaName')->lists('AreaName','AreaID');\n$this->Country =\\App\\Models\\Country::orderBy('CountryName')->lists('CountryName','CountryID');\n$this->District =\\App\\Models\\District::orderBy('DistrictName')->lists('DistrictName','DistrictID');\n$this->Project =\\App\\Models\\ProjectStatus::orderBy('ProjectStatus')->lists('ProjectStatus','ProjectStatusID');\n$this->Region =\\App\\Models\\Region::orderBy('Region')->lists('Region','RegionID');\n\n }", "public function index()\n {\n return TareaResource::collection(Tarea::with('categorias')->get());\n }", "public function getMapareasList(){\n return $this->_get(30);\n }", "public function getAffiliationsData(){\n $producersCountry=Producer::distinct()->get(['country_id']);\n $producersCountryList=$producersCountry->implode('country_id', ', ');\n $producersCountryList=explode(',',$producersCountryList);\n return Country::whereIn('id',$producersCountryList)->get(); \n }", "public function index()\n {\n $subareas = subarea::all();\n return response($subareas,200);\n }", "function get_list($id = NULL) {\n $this->db->select('areas.*, states.state_name, countries.name as country_name, cities.city_name');\n $this->db->join('cities', 'cities.id=areas.city_id');\n $this->db->join('states', 'states.id=cities.state_id');\n $this->db->join('countries', 'countries.id=states.country_id');\n if (empty($id)) {\n $query = $this->db->get('areas');\n return $query->result_array();\n }\n\n $query = $this->db->get_where('areas', array('areas.id' => $id));\n return $query->row_array();\n }", "private function data() {\n return collect([\n ['name' => 'Bangla', 'code' => 'bangla', 'description' => 'Bangla 1st/2nd Part', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ['name' => 'English', 'code' => 'english', 'description' => 'English 1st/2nd Part', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ['name' => 'Mathematics', 'code' => 'math', 'description' => 'Mathematics', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ['name' => 'General Science', 'code' => 'science', 'description' => 'General Science', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ['name' => 'Computer', 'code' => 'computer', 'description' => 'Computer', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ['name' => 'Physics', 'code' => 'physics', 'description' => 'Physics', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ['name' => 'Chemistry', 'code' => 'chemistry', 'description' => 'Chemistry', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ['name' => 'Biology', 'code' => 'biology', 'description' => 'Biology', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ['name' => 'Higher Math', 'code' => 'highermath', 'description' => 'Higher Math', 'status_id' => 1, 'created_by' => 1, 'updated_by' => 1],\n ]);\n }", "public function create()\n {\n $roles = Role::pluck('name','name')->all();\n return $roles;\n }", "public function amenities()\n {\n return $this->belongsToMany(\n 'App\\Amenity', 'listing_amenities', 'listing_id', 'amenity_id'\n )->select(['id', 'title', 'icon']);\n }", "public function create()\n {\n\n //$categorias = DB::table('categorias')->get()->pluck('nombre','id');\n\n $categorias = Categoria::all(['id','nombre']);\n return view('recetas.create')->with('categorias', $categorias);\n }", "public function getBackendAreas(): AreasCollection;", "public function index()\n {\n //\n $areas = Area::all();\n return view('backend.area.index', compact('areas'));\n }", "public function getcity_area($id)\n {\n $data = $this->addcity->with(['Area'])->find($id);\n //dd($data);\n return $data;\n }", "public function definition()\n {\n $area = $this->faker->streetAddress;\n $slug = Str::slug($area, '-');\n return [\n 'name' => $area,\n 'slug' =>$slug,\n 'city_id' => rand(1,2),\n 'image' => 'http://lorempixel.com/720/480/city/'.rand(1,10),\n 'intro' => $this->faker->paragraph($nbSentences = 3, $variableNbSentences = true),\n ];\n }", "public function companyOfUser(){\n\n $company = Auth::user()->companies;\n $location = Location::where('id', Auth::user()->company_location)->get();\n \n foreach($company as $c){\n $c['locations'] = $location;\n }\n\n return $company;\n }", "public function listar() {\n\t\t\ttry {\n\t\t\t\t$consulta = 'SELECT * FROM Area ORDER BY codigo_area ASC';\n\t\t\t\t//ejecutando la consulta\n\t\t\t\tif($this->databaseTransaction != null) {\n\t\t\t\t\t$resultado = $this->databaseTransaction->ejecutar($consulta);\n\t\t\t\t\tif($this->databaseTransaction->cantidadResultados() == 0) {\n\t\t\t\t\t\t$this->databaseTransaction->cerrar();\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$array = null;\n\t\t\t\t\t\t$i \t = 0;\n\t\t\t\t\t\twhile($registro = $this->databaseTransaction->resultados()) {\n\t\t\t\t\t\t\t$array[$i] = new Area($registro);\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->databaseTransaction->cerrar();\n\t\t\t\t\t\treturn $array;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(ambiente == 'DEV') { echo \"Controller Area - Listar: El objeto DatabaseTransaction se encuentra nulo\"; }\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}catch(Exception $e) {\n\t\t\t\tif(ambiente == 'DEV') { echo $e->getMessage(); }\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function getReservas()\n {\n return $this->hasMany(Reserva::class, ['idLibros' => 'idLibros']);\n }", "public function columnasLista(){\n $gridlista=array(\n array('name'=>'nombre','type'=>'raw','value'=>'CHtml::link($data->nombre,array(\"update\",\"id\"=>$data->id))'),\n 'cantidadpresentacion',\n 'salida',\n // 'idempresa',\n array('name'=>'idempresa','type'=>'raw','value'=>'$data->getNombreEmpresa()'),\n );\n\n return $gridlista;\n }", "public function definition()\n {\n return [\n 'name' => $this->faker->randomElement($array = array ('Grupo 1','Grupo 2','Grupo 3','Grupo 4', 'Grupo 5','Grupo 6','Grupo 7','Grupo 8','Grupo 9')),\n 'id_course' => Course::all()->random()->id\n ];\n }", "public function index()\n {\n $data = Estudiantes::all();\n $data->map(function($item){\n $item->carreras = $item->carreras()->get();\n $item->carreras->map(function ($info){\n $info->nombreCarrera = $info->carrera()->first()->nombre;\n return $info;\n });\n return $item;\n });\n return response()->json(['data'=>$data],200);\n //return view(\"Estudiantes.menu\",[\"estudiantes\"=>Estudiantes::all()]);\n }", "public function getnombre_tipo_institucion(Request $request)\n\n{\n\n $tipo_institucion= DB::table(\"tipo_institucion\")\n\n ->where(\"id_nombre_institucion\",$request->id_nombre_institucion)\n\n ->pluck(\"nombre_tipo_institucion\",\"id_tipo_institucion\");\n\n return response()->json($tipo_institucion);\n\n}", "public function obras()\n {\n return $this->belongsToMany(Obra::class, 'usuarios_obras', 'usuario', 'id_obra');\n }", "public function showAreas($id)\n {\n $carrera = EntidadFederativa::where('id',$id)->first();\n $carrera->load('Area');\n if(!is_null($carrera))\n {\n return response()->json(\n [\n \"msg\"=>\"success\",\n \"carrera\"=>$carrera->toArray()\n ],200);\n }\n else{\n return response()->json('carrera_not_found',404);\n }\n }", "public function index()\n {\n $areas = Area::orderBy('id', 'DESC')->paginate(10);\n\n return view('admin.areas.index')->with('areas', $areas);\n }", "public function amenityIds()\n {\n $this->attributes['amenityIds'] = $this->amenities->pluck('id');\n }", "public function listado(){\n //return view('proveedores.listado', ['proveedores' => Proveedor::all()]);\n return Provincia::find(1)->with(['Pais'])->first(); \n }", "public function index()\n {\n $areas = Area::all();\n return view('area.index', compact('areas'));\n }", "public function amenities()\n {\n return $this->belongsToMany('App\\Models\\Properties\\Amenity');\n }", "public function getAutoposList(){\n return $this->_get(2);\n }", "function AllPartenaires(){\n return $this->db->get($this->partenaires)->result();\n }", "public function getnombre_institucion(Request $request)\n\n{\n\n $nombre_institucion= DB::table(\"nombre_institucion\")\n\n ->where(\"codigo_municipio_trabajo\",$request->codigo_municipio_trabajo)\n\n ->pluck(\"nombre_institucion_trabajo\",\"id_nombre_institucion\");\n\n return response()->json($nombre_institucion);\n\n}", "public function create()\n {\n //\n $areas = Area::all();\n return view('empleado.create', compact('areas'));\n }", "public function index()\n {\n// $asistencias = Asistencia::all()->groupBy('fecha');\n// // dd($asistencias);\n// //dd($asistencias);\n// foreach($asistencias as $as){\n// foreach ($as as $a){\n// dd($a);\n// }\n// }\n $u = Auth::user();\n $doc = Docente::where('identificacion', $u->identificacion)->first();\n $hoy = getdate();\n $a = $hoy[\"year\"] . \"-\" . $hoy[\"mon\"] . \"-\" . $hoy[\"mday\"];\n if ($doc != null) {\n $per = Periodo::where([['fechainicio', '<=', $a], ['fechafin', '>=', $a]])->first();\n if ($per == null) {\n $cargaAcademica = collect();\n } else {\n $cargaAcademica = Cargaacademica::where([['docente_id', $doc->id], ['periodo_id', $per->id]])->get();\n }\n } else {\n $cargaAcademica = Cargaacademica::all();\n }\n $asis = null;\n if($cargaAcademica != null){\n foreach ($cargaAcademica as $item){\n $obj = Asistencia::where('cargaacademica_id',$item->id)->get()->groupBy('fecha');\n if(count($obj)>0){\n $asis[]=$obj;\n }\n }\n }\n $asistencias = collect();\n if($asis != null){\n foreach ($asis as $i){\n foreach ($i as $item) {\n foreach ($item as $e){\n $asistencias[]=$e;\n }\n }\n }\n }\n return view('evaluacion.asistencia.list')\n ->with('location', 'evaluacion')\n ->with('asistencias', $asistencias);\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n $this->counties = Region::select('id','name')->get()->values()->toArray();\n\t}", "public function getmunicipio_lugar_trabajo(Request $request)\n\n{\n\n $municipio_lugar_trabajo = DB::table(\"municipio_lugar_trabajo\")\n\n ->where(\"codigo_departamento_trabajo\",$request->codigo_departamento_trabajo)\n\n ->pluck(\"nombre_municipio_trabajo\",\"codigo_municipio_trabajo\");\n\n return response()->json($municipio_lugar_trabajo);\n\n}", "function get_repartidossres() //obtiene los repartidores\n {\n\n $repartidores = DB::table('repartidores')->get();\n return $repartidores;\n }", "public function select(){\n $records =10;\n $data = $this->repository->getObjects($records);\n $user = $this->returnTr($data);\n $area = Area::all();\n $select = $this->returnOption($area,\"Chọn khu vực\" );\n return response()->json(['user'=>$user,'select'=>$select]); \n }", "function ubigeopersonal($id)\n {\n if (isset($id)) {\n $ubigeo = ubigeo::where('id',$id)->pluck('nombre','id')->toarray();\n } else {\n $ubigeo=[];\n }\n return $ubigeo;\n }", "public function manytomany(){\n $el = AnggotaModel::get();\n return view('gampanganfolder.list-relasi-mtom')->with(compact(array( 'el' )));\n }" ]
[ "0.6637162", "0.65577596", "0.64578867", "0.64275897", "0.63709915", "0.6361617", "0.6304897", "0.62886757", "0.62538403", "0.62538403", "0.60980946", "0.60748583", "0.60354066", "0.6017104", "0.59778106", "0.5966224", "0.59030604", "0.5901392", "0.5900677", "0.58889014", "0.58827496", "0.5882235", "0.5861463", "0.58581024", "0.5841703", "0.58279705", "0.58162177", "0.57968926", "0.57837003", "0.5775001", "0.5750049", "0.5737235", "0.5698415", "0.56837296", "0.56676406", "0.56541395", "0.5652211", "0.56494874", "0.5640018", "0.5636935", "0.563218", "0.56305546", "0.56276417", "0.562381", "0.5622883", "0.56189114", "0.5613369", "0.56077254", "0.5606244", "0.5603858", "0.5601542", "0.5600783", "0.5588462", "0.5580703", "0.55718344", "0.5568354", "0.55642635", "0.5556248", "0.5542934", "0.554063", "0.5531189", "0.5530392", "0.5521879", "0.55213094", "0.55208474", "0.55173993", "0.55143297", "0.5511879", "0.55029345", "0.5487214", "0.54869676", "0.548312", "0.54808724", "0.5469402", "0.5467751", "0.5461038", "0.5460448", "0.54580724", "0.545143", "0.5447385", "0.54462105", "0.5446013", "0.5429366", "0.54198295", "0.54051614", "0.54012054", "0.54000753", "0.5398596", "0.5398253", "0.5391888", "0.53895545", "0.5388069", "0.538715", "0.5384497", "0.53838694", "0.5381219", "0.5380578", "0.537936", "0.5378847", "0.5375876", "0.53756344" ]
0.0
-1
Create a new exception instance.
public function __construct($validation, $response = null) { parent::__construct('The given data was invalid.'); $this->validation = $validation; $this->response = $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }", "public function create()\n {\n throw new Exception('Not yet implemented');\n }", "public static function makeException($message = \"\", $code = 0, $previous = NULL) {\n $trace = debug_backtrace();\n\n $callingClass = '';\n if (!empty($trace[1]['class'])) {\n $callingClass = $trace[1]['class'];\n }\n\n $excClassName = self::getExceptionClass($callingClass);\n\n return new $excClassName($message, $code, $previous);\n }", "public static function createFromException(string $message, Throwable $exception): self\n {\n return new static($message, $exception->getCode(), $exception->getFile(), $exception->getLine(), $exception);\n }", "static public function exception($class, $message = '', $code = 0)\n {\n $class = (string) $class;\n\n self::loadClass($class);\n\n $exception = new $class($message, $code);\n\n if (!$exception instanceof Exception) {\n throw new Zend_Exception('Invalid exception class used in Zend::exception()');\n }\n\n return $exception;\n }", "public function __construct($title, $message, $template = false)\n {\n Exception::__construct($message);\n\n $this->code = $title;\n\n if ($template !== false) {\n $this->template = $template;\n }\n }", "public function Create()\n\t\t{\n\t\t\tthrow new Exception('Create object not supported');\n\t\t}", "public function __construct()\n {\n throw new Exception('This class is not intended to be instantiated.');\n }", "public function getException();", "public static function create(int $code, ServerRequestInterface $request, ?Throwable $previous=null): self {\n\t\tif (!in_array($code, array_keys(self::EXC_INFO))) {\n\t\t\t$code = 0;\n\t\t}\n\t\t$message = self::EXC_INFO[$code]['name'];\n\t\t$e = new self($message, $code, $previous);\n\t\t$e->request = $request;\n\t\treturn $e;\n\t}", "public function testCreatedException()\n {\n $this->expectException(DomainException::class);\n County::create('County One',0, 200);\n }", "public function __construct($message = \"\", $code = 0, Exception $previous = null)\n {\n parent::__construct($message, $code, $previous);\n $exception = new \\App\\Exception();\n $exception -> message = $message;\n $exception -> code = (int)$code;\n $exception -> type = 'exception';\n $exception -> trace = $this->getTraceAsString();\n $exception -> save();\n }", "function __construct($exception) {\n $this->exception = $exception;\n }", "public function createInvalidArgumentException($message = '')\n {\n $mock = $this->mock('InvalidArgumentException')\n ->new($message);\n\n return $mock;\n }", "public function testCreateExceptionWithoutAnyArguments()\n {\n new ConfigurationException();\n }", "public static function fromThrowable(\\Exception $exception, $data = null) {\n return new static($data, $exception->getMessage(), $exception->getCode(), $exception);\n }", "public function toException()\n {\n if ($this->failed()) {\n return new RequestException($this);\n }\n }", "protected static function createException($value, $message, $code, $propertyPath = null, array $constraints = array())\n {\n $exceptionClass = static::$exceptionClass;\n\n return new $exceptionClass($message, ReturnCode::INVALID_ARGUMENT, $propertyPath, $value, $constraints);\n }", "public function createException($message = '', $code = 0, $previous = null)\n {\n return new RootException($message, $code, $previous);\n }", "public function __construct($message, $class = null, $line = 0, $code = 0) {\n\t\t// First thing to do is set the Exception message\n\t\tif (empty($message)) {\n\t\t\t$message = 'And unknown exception is being reported by the SPARK library';\n\t\t}\n\t\t\n\t\t// Instantiate the base PHP Exception object\n\t\tparent::__construct($message);\n\t\t\n\t\t// Set the exception object properties\n\t\t$this->code = $code;\n\t\t$this->class = $class;\n\t\t$this->file = str_replace('_', '/', $class) . '.php'; // Easy file path builder\n\t\t$this->line = $line;\n\t}", "public function createException($message = '')\n {\n $mock = $this->getMockBuilder('Exception')\n ->setConstructorArgs([$message])\n ->getMock();\n\n return $mock;\n }", "public function createException($message = '')\n {\n $mock = $this->getMockBuilder('Exception')\n ->setConstructorArgs([$message])\n ->getMock();\n\n return $mock;\n }", "public function __construct(\\Exception $exception)\n {\n parent::__construct($exception->getMessage(), $exception->getCode(),\n $exception);\n\n $this->file = $exception->getFile();\n $this->line = $exception->getLine();\n $this->type = get_class($exception);\n }", "public static function factory($exceptions = TRUE)\n\t{\n\t\treturn new Email($exceptions);\n\t}", "public static function forKey($key, Exception $cause = null)\n {\n return new static(sprintf(\n 'The key \"%s\" does not exist.',\n $key\n ), 0, $cause);\n }", "public function __construct(Exception $exception)\n {\n $this->exception = $exception;\n }", "public function __construct( Exception $e )\n {\n $this->exception = $e;\n parent::__construct( $e->getMessage() );\n }", "function __construct($code, $append=null, &$msgs=null)\n\t{\n\t\tif($msgs === null)\n\t\t{\n\t\t\t$msgs = array();\n\t\t}\n\n\t\tif(array_key_exists($code, $msgs))\n\t\t{\n\t\t\t// massage message string\n\t\t\t$message = $msgs[$code];\n\t\t\t$append = $append ? ': ' . $append : '';\n\t\t\t$message .= $append . '.';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = 'An unknown exception occured.';\n\t\t}\n\n\t\t// pass the fixed-up data to the parent Exception construct\n\t\tparent::__construct($message, $code);\n\t}", "public static function createFromException(\\Throwable $e) {\n while ($e) {\n if ($e instanceof EnforcedResponseException) {\n return new static($e->getResponse());\n }\n\n $e = $e->getPrevious();\n }\n }", "public function __construct($e) {\n\t\tif (!$e instanceof \\Exception && !$e instanceof \\Throwable) {\n\t\t\tthrow new InvalidArgumentException('Stack Trace Printer requires throwable to be passed, received ' . get_class($e), 1806031136);\n\t\t}\n\t\t\n\t\t$this->exception = $e;\n\t}", "public static function missinglogic($message)\n {\n return new static(\"Error exception:\\t\".$message);\n }", "public function __construct(Exception $exception)\n {\n $this->exception = get_class($exception);\n $this->message = $exception->getMessage();\n $this->code = $exception->getCode() ? $exception->getCode() : 400;\n }", "public function __construct($exception)\n {\n $this->exception = $exception;\n }", "public function testExceptionSanity() {\r\n $e = new StorageException();\r\n $this->assertTrue($e instanceof \\Exception);\r\n }", "public function catchException()\n {\n // get the current exception\n $e = $this->getException();\n\n // throw a copy, with the original as the previous exception so that\n // we can see a full trace.\n $class = get_class($e);\n throw new $class($e->getMessage(), $e->getCode(), $e);\n }", "public function storageSerializerFactoryNewInstanceException(IntegrationTester $I)\n {\n $I->wantToTest('Storage\\SerializerFactory - newInstance() - exception');\n\n $name = uniqid();\n $I->expectThrowable(\n new Exception('Service ' . $name . ' is not registered'),\n function () use ($name) {\n $serializer = new SerializerFactory();\n $adapter = new AdapterFactory($serializer);\n\n $service = $adapter->newInstance($name);\n }\n );\n }", "function __toString() {\n\t\treturn \"Exception\";\n\t}", "public function testConstructor()\n {\n $params = ['fieldName' => 'quantity', 'value' => -100, 'minValue' => 0];\n $inputException = new InputException(\n new Phrase('The %fieldName value of \"%value\" must be greater than or equal to %minValue.', $params)\n );\n\n $this->assertEquals(\n 'The %fieldName value of \"%value\" must be greater than or equal to %minValue.',\n $inputException->getRawMessage()\n );\n $this->assertStringMatchesFormat('%s greater than or equal to %s', $inputException->getMessage());\n $this->assertEquals(\n 'The quantity value of \"-100\" must be greater than or equal to 0.',\n $inputException->getLogMessage()\n );\n }", "public static function create(ResponseInterface $response) {\n $error_data = static::getErrorData($response);\n if (in_array(\n $error_data['error_subcode'], array(458, 459, 460, 463, 464, 467))\n || in_array($error_data['code'], array(100, 102, 190))\n || $error_data['type'] === 'OAuthException') {\n\n return new AuthorizationException($response);\n } elseif (in_array($error_data['code'], array(1, 2))) {\n\n return new ServerException($response);\n } elseif (in_array($error_data['code'], array(4, 17, 341))) {\n\n return new ThrottleException($response);\n } elseif ($error_data['code'] == 506) {\n\n return new ClientException($response);\n } elseif ($error_data['code'] == 10\n || ($error_data['code'] >= 200 && $error_data['code'] <= 299)) {\n\n return new PermissionException($response);\n } else {\n\n return new self($response);\n }\n }", "public static function fromException(Throwable $exception, array $parameters = []): self\n {\n return new self(\n $exception::class,\n $exception->getMessage(),\n $exception->getCode(),\n $parameters,\n self::buildTrace($exception)\n );\n }", "public function create(Request $request)\n {\n throw new Exception(\"Error Processing Request\", 1);\n \n }", "public function testCreateExceptionWithArguments()\n {\n $message = 'test';\n $previous = new Exception();\n $exception = new ConfigurationException($message, $previous);\n\n self::assertEquals(\n $message,\n $exception->getMessage(),\n 'The exception message was not set.'\n );\n\n self::assertSame(\n $previous,\n $exception->getPrevious(),\n 'The previous exception was not set.'\n );\n }", "public static function reflectionFailure(string $entity, ReflectionException $previousException): self\n {\n return new self(sprintf('An error occurred in %s', $entity), 0, $previousException);\n }", "public static function exceptionThrown(string $name, \\Exception $e)\n {\n return new static(\n $name,\n 'Pipe \"'.$name.'\" failed due to exception (message: \"'.$e->getMessage().'\", code: '.$e->getCode().').',\n static::EXCEPTION_THROWN,\n $e\n );\n }", "public function testExceptionWithMessage()\n {\n throw new ThumbNotFoundException('Thumb not found!');\n }", "private function exceptionTraceArgsHelper(string $message): \\Exception\n {\n return new \\Exception($message);\n }", "public function testFactoryCreationErrorWillBeCaughtAndRethrownAsContainerException(): void\n {\n $container = new Container();\n\n $name = 'FooService';\n $exceptionMessage = 'This is another test exception message';\n\n $factory = static function () use ($exceptionMessage): void {\n throw new \\RuntimeException($exceptionMessage);\n };\n\n $container->setFactory($name, $factory);\n\n $this->expectException(ContainerException::class);\n $this->expectExceptionMessage(\n sprintf('The service \\'%s\\' could not be created: %s', $name, $exceptionMessage)\n );\n\n $container->get($name);\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function __construct(Exception $previous = null, $headers = [], $code = 0)\n {\n $message = 'EXCEPTION_EXOTEL_CONFIG_EXCEPTION';\n parent::__construct(400, $message ?: 'You have some exotel exception.', $previous, $headers, $code);\n }", "public static function getInstance(): ExceptionDistributor\n {\n if (!self::$instance) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }", "public function __construct($trigger, $value, $message)\n {\n $this->trigger = $trigger;\n parent::__construct(sprintf(self::EXCEPTION_FORMAT, $trigger, $value, $message));\n }", "public static function httpStatusException($message)\n {\n return new self($message, self::HTTP_STATUS_EXCEPTION);\n }", "public function __construct () {\n\t\tthrow Exception::thrown(\"Not implemented for this platform\");\n\t}", "public function __construct(GuzzleException $e)\n {\n $this->e = $e;\n }", "public function __construct()\n {\n $this->exceptions = new ObjectStorage();\n }", "public function getException(): Throwable;", "public function getException(): Throwable;", "final private function __construct()\n {\n throw new Exception( 'Enum and Subclasses cannot be instantiated.' );\n }", "public function __construct($exceptionCode, $extendedMessage = '')\n {\n $message = \"\";\n switch ($exceptionCode)\n {\n case self::EX_NOCONTEXT:\n $message = \"Context was not initialized. HttpContext::initialize() needs to be called before proper request handling.\";\n break;\n case self::EX_KEYNOTFOUND:\n $message = \"The key was not found.\";\n break;\n case self::EX_SINGLETONINSTANCE:\n $message = \"Cannot create instance of an ISingleton. Use the getInstance() method instead.\";\n break;\n case self::EX_INVALIDOFFSET:\n $message = \"Invalid offset. Offsets must be non-negative integers and less than the size of the collection.\";\n break;\n case self::EX_INVALIDKEY:\n $message = \"Invalid key. Keys must be non-empty strings.\";\n break;\n case self::EX_NOTIMPLENTED:\n $message = \"The method is unsupported as it has not yet been implemented.\";\n break;\n case self::EX_READONLYCOLLECTION:\n $message = \"Unable to modify the colletion because it is read-only.\";\n break;\n case self::EX_INVALIDPARAMETER:\n $message = \"The parameter is invalid.\";\n break;\n case self::EX_INVALIDMETHODCALL:\n $message = \"The method is unsupported or the operation is invalid in the current state of the object.\";\n break;\n case self::EX_CLASSNOTFOUND:\n $message = \"The class was not found.\";\n break;\n case self::EX_INVALIDOPERATION:\n $message = \"The operation is invalid in the current state of the object.\";\n break;\n case self::EX_DBCONNECTION:\n $message = \"Cannot connect to database server.\";\n break;\n case self::EX_QUERYEXECUTE:\n $message = \"Cannot execute query.\";\n break;\n case self::EX_READONLYADAPTER:\n $message = \"Table adapter is derived from a read-only database object.\";\n break;\n case self::EX_DBPROVIDERNOTFOUND:\n $message = \"Database provider is not supported.\";\n break;\n case self::EX_DUPLICATEDKEY:\n $message = \"Duplicate key entry.\";\n break;\n case self::EX_MEMBERSHIPUSER:\n $message = \"Membership user operation failed.\";\n break;\n case self::EX_MEMBERSHIPROLE:\n $message = \"Membership role operation failed.\";\n break;\n case self::EX_MAILCONNECTION:\n $message = \"Connection to mail server failed.\";\n break;\n case self::EX_MAILLOGIN:\n $message = \"Invalid login information.\";\n break;\n default:\n $message = \"An unknown exception was thrown.\";\n break;\n }\n \n parent::__construct($message . \" \" . $extendedMessage, $exceptionCode);\n }", "public static function create(...$args): self\n {\n $ex = end($args) instanceof \\Throwable ? array_pop($args) : null;\n $message = sprintf(...$args);\n\n return new static($message, 0, $ex);\n }", "protected function requestExceptionWithResponse()\n {\n $exception = function ($request) {\n return new RequestException(\n 'test',\n $request,\n Litecoin\\LitecoindResponse::createFrom($this->rawTransactionError())\n );\n };\n\n return $exception;\n }", "public function testConstructorInvalidType()\n\t{\n\t\t$this->expectException(\\RuntimeException::class);\n\t\tnew Builder('foo');\n\t}", "public static function fromClass(string $class, string $message, ...$args): \\Exception\n {\n $message = '%s: ' . $message;\n\n return static::create($message, $class, ...$args);\n }", "public function createInstance()\n {\n $mock = $this->getMockBuilder(static::TEST_SUBJECT_CLASSNAME)\n ->getMockForTrait();\n $mock->method('__')\n ->will($this->returnArgument(0));\n $mock->method('_createInvalidArgumentException')\n ->will($this->returnCallback(function ($message) {\n return new InvalidArgumentException($message);\n }));\n\n return $mock;\n }", "function __construct($class, $method, $message)\n\t{\n\t\tparent::__construct($message);\n\n\t\t// Assign custom exception data.\n\t\t$this->_class = $class;\n\t\t$this->_method = $method;\n\t\t$this->_string = \"[$class - $method()]: $message\";\n\t\t$this->_time = time();\n\t}", "public function addException($message, $code = null){\n return $this->_exception = new ApplicationException($message, $code);\n }", "public function setExceptionClass($className){\n $this->exceptionClass = $className;\n return $this;\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "public function __construct(){\n throw new Exception(\"Cannot instantiate this class. Please use the static methods validateLogin() and logout() instead.\");\n }", "private function __construct()\n {\n throw new RuntimeException(\"Can't get there from here\");\n }", "public function __construct($exceptions = false)\n {\n }", "final public function __construct() { throw new WeeboException(\"Cannot instantiate static class!\"); }", "private function createNotReadableException()\n {\n throw new RuntimeException(sprintf(\n 'It is not possible to read entities of type \"%s\" from its repository.',\n $this->getEntityServiceName()\n ));\n }", "public static function from_view_exception( $uri, $exception ) {\n\t\t$message = \\sprintf(\n\t\t\t'Could not load the View URI \"%1$s\". Reason: \"%2$s\".',\n\t\t\t$uri,\n\t\t\t$exception->getMessage()\n\t\t);\n\n\t\treturn new static( $message, (int) $exception->getCode(), $exception );\n\t}", "public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }", "protected function createExceptionFromLastError(string $function): ConnectionException\n {\n $this->close();\n\n return new ConnectionException($function.' failed');\n }", "public function create()\n {\n throw new LogicException('Invalid call to \"create\" method. Need to call the \"instance\" method.');\n }", "public function __construct(string $key, string $value) \n {\n if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n throw new \\Exception(sprintf('%s is not a valid email address.', $value));\n }\n\n $this->key = $key;\n $this->value = $value;\n }", "public function filterTagFactoryNewInstanceException(UnitTester $I)\n {\n $I->wantToTest('Tag\\TagFactory - newInstance() - exception');\n\n $I->expectThrowable(\n new SupportException('Service unknown is not registered'),\n function () {\n $escaper = new Escaper();\n $factory = new TagFactory($escaper);\n $service = $factory->newInstance('unknown');\n }\n );\n }", "public function __construct($pathToSourceFile = '', $mime = null)\n {\n if(!file_exists($pathToSourceFile))\n {\n throw new Exception(\"$pathToSourceFile does not exist\");\n }\n \n if(!$mime)\n {\n throw new Exception(\"Mime type '$mime' is not valid\");\n }\n\n $this->pathToSourceFile = $pathToSourceFile;\n $this->type = $mime;\n \n $this->createWorkingImageResource($pathToSourceFile);\n }", "public function createEntity($entityName = null)\n {\n if (is_null($entityName)) {\n $entityName = $this->getEntityName();\n if ( !$entityName) {\n // @todo throw good Exception\n throw new \\Exception(\"entityName not set. Can't create class.\");\n }\n } else {\n if (false === class_exists($entityName)) {\n // @todo throw good Exception\n throw new \\Exception(\"'\".$entityName.\"' class doesn't exist. Can't create class.\");\n }\n }\n\n return new $entityName;\n }", "public function createEvent()\n {\n return new Event();\n }", "public function __construct(ExceptionInterface $exception)\n {\n $this->dateTimeUtc = new DateTimeImmutable('now', new DateTimeZone('UTC'));\n $this->exception = $exception;\n $this->id = uniqid('', true);\n }", "public function __construct($message, $code = 0, Exception $previous = null) {\n parent::__construct($message, $code, $previous);\n\t\tlogExcepMessage(\"../log/exceptionLog.txt\",$message);\n }", "public function __construct($name = 'main', $start_index = 1)\n {\n if (isset(self::$instances[$name]))\n {\n throw new Exception ('An instance with name '.$name.' already exists');\n }\n\n $this->index = $start_index;\n self::$instances[$name] = $this;\n }", "protected function requestExceptionWithoutResponse()\n {\n $exception = function ($request) {\n return new RequestException('test', $request);\n };\n\n return $exception;\n }", "protected function createException(string $error, int $errorNo, string $sqlState, ?string $query = null): Exception\n\t{\n\t\tif (in_array($errorNo, [1216, 1217, 1451, 1452, 1701], true)) {\n\t\t\treturn new ForeignKeyConstraintViolationException($error, $errorNo, $sqlState, null, $query);\n\t\t} elseif (in_array($errorNo, [1062, 1557, 1569, 1586], true)) {\n\t\t\treturn new UniqueConstraintViolationException($error, $errorNo, $sqlState, null, $query);\n\t\t} elseif (in_array($errorNo, [1044, 1045, 1046, 1049, 1095, 1142, 1143, 1227, 1370, 2002, 2005, 2054], true)) {\n\t\t\treturn new ConnectionException($error, $errorNo, $sqlState);\n\t\t} elseif (in_array($errorNo, [1048, 1121, 1138, 1171, 1252, 1263, 1566], true)) {\n\t\t\treturn new NotNullConstraintViolationException($error, $errorNo, $sqlState, null, $query);\n\t\t} elseif ($query !== null) {\n\t\t\treturn new QueryException($error, $errorNo, $sqlState, null, $query);\n\t\t} else {\n\t\t\treturn new DriverException($error, $errorNo, $sqlState);\n\t\t}\n\t}", "public function __construct(TransferException $exception)\n {\n $this->exception = $exception;\n }", "protected function prepareException(Exception $e)\n {\n if ($e instanceof AuthorizationException) {\n $e = new HttpException(403, $e->getMessage());\n }\n\n return $e;\n }", "function raise(\\Exception $ex);", "public function testCreateFailPrivateConstructor() {\n $this->expectException(Exception::class);\n $this->_createCreator()->create(ConstructTest\\PrivateConstruct::class);\n }", "public function createInstance()\n {\n $mock = $this->getMockForTrait(static::TEST_SUBJECT_CLASSNAME);\n $mock->method('_createInvalidArgumentException')\n ->will($this->returnCallback(function ($message = null) {\n return $this->createInvalidArgumentException($message);\n }));\n $mock->method('__')\n ->will($this->returnArgument(0));\n\n return $mock;\n }", "protected function __construct(\\Exception $e, array $options)\n\t{\n\t\t$this->public_key = $options['publickey'];\n\n\t\tparent::__construct($e, $options);\n\t}", "public static function clientException(ResponseInterface $response, $data)\n {\n return static::createInstance($response, $data);\n }", "final public function __construct()\n {\n throw new \\LogicException();\n }", "public function testException()\n {\n throw new Exception('This is not expected.');\n }", "public function testConstructor()\n {\n $subject = $this->createInstance([\n '_initBaseException',\n '_construct',\n '_setSubject',\n ]);\n $_subject = $this->reflect($subject);\n $message = uniqid('message-');\n $code = rand(1, 99);\n $value = uniqid('out-of-range-value-');\n $previous = $this->createException(uniqid('previous-message'));\n\n $subject->expects($this->exactly(1))\n ->method('_initBaseException')\n ->with($message, $code, $previous);\n $subject->expects($this->exactly(1))\n ->method('_construct');\n $subject->expects($this->exactly(1))\n ->method('_setSubject')\n ->with($value);\n\n $subject->__construct($message, $code, $previous, $value);\n }", "function __construct() {\n\t\t$this->exception_method = [];\n\t\tparent::__construct();\n\t\t\n\t}", "public function createEvent(string $name): Event\n {\n if (!$this->isEventIDValid($name)) {\n throw new RuntimeException('invalid event name: ' . $name);\n }\n\n $class = $this->validEventIDs[$name];\n /** @var \\CaptainHook\\App\\Event $event */\n $event = new $class($this->io, $this->config, $this->repository);\n return $event;\n }" ]
[ "0.70328814", "0.6948437", "0.6474613", "0.63535994", "0.6143062", "0.6053798", "0.6031357", "0.5999044", "0.59871596", "0.59513366", "0.5930377", "0.59061944", "0.5893656", "0.58490723", "0.58267224", "0.5820033", "0.58135116", "0.57601756", "0.57563764", "0.573397", "0.57086605", "0.57086605", "0.5687422", "0.56842804", "0.56842685", "0.5670416", "0.56574714", "0.56495273", "0.5641089", "0.5638324", "0.5633677", "0.56251955", "0.5612989", "0.56095606", "0.55971056", "0.55957496", "0.5574", "0.55640864", "0.5557119", "0.5550963", "0.5547164", "0.5490432", "0.5487289", "0.5486731", "0.5484895", "0.5438387", "0.5426176", "0.5421112", "0.5421112", "0.5421112", "0.5409914", "0.54056644", "0.53962594", "0.53935313", "0.53918535", "0.5377753", "0.53534293", "0.5351017", "0.5351017", "0.53470373", "0.5345199", "0.53430265", "0.5342956", "0.5337001", "0.5332181", "0.5321539", "0.53051203", "0.530297", "0.52855504", "0.5285258", "0.5264063", "0.5259612", "0.52474636", "0.5246137", "0.5233374", "0.52296966", "0.52198726", "0.5217599", "0.52089524", "0.51904035", "0.5169318", "0.5163749", "0.5156871", "0.51379126", "0.5130935", "0.5119848", "0.5119745", "0.51165897", "0.51163286", "0.51082087", "0.51033413", "0.51024127", "0.5101963", "0.5101504", "0.5091864", "0.50826967", "0.50821763", "0.50759107", "0.50502694", "0.5044956", "0.5042764" ]
0.0
-1
Get all of the validation error messages.
public function errors() { return $this->validation->messages()->messages(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidationMessages();", "protected function validationErrorMessages()\n {\n return [];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "public function getErrorMessages() {}", "public function getValidationErrorMessages() {}", "public function errors()\n {\n return $this->getRules()->getMessageBag()->all();\n }", "public function getValidationMessages()\n {\n return $this->validationMessages;\n }", "public function getAllMessage()\n {\n $messages = [];\n foreach (array_keys($this->errors) as $key) {\n $messages[$key] = $this->getMessage($key);\n }\n return $messages;\n }", "public function getErrorMessages()\n {\n return $this->errorMessages;\n }", "public function validateAll()\n {\n $errorMsgs = array();\n return $errorMsgs;\n }", "public function getErrors()\n {\n return $this->getInputFilter()->getMessages();\n }", "public function getErrorMessages() : array\n {\n return $this->errors_messages;\n }", "public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }", "public function getMessages()\n {\n return $this->_errorMessages;\n }", "function getMessages() {\n\t\t$fields = $this->getFields();\n\t\t$allMessages = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldMessages = $field->getValidationMessages();\n\t\t\tif ($fieldMessages) {\n\t\t\t\t$allMessages[$field->getName()] = $fieldMessages;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $allMessages;\n\t}", "public function get_clear_error_msgs()\n {\n $msgs = array();\n foreach ($this->errors as $e) {\n $msgs[$e['field']][$e['rule']] = $this->get_validation_error_msg($e['field'], $e['rule'], $e['value']);\n\n }\n return $msgs;\n }", "public function errors()\n {\n return $this->validator->errors()->messages();\n }", "public function getErrors(): array\n {\n return $this->getInputFilter()->getMessages();\n }", "public function getErrors()\n {\n return $this->messageBag->all();\n }", "public function getValidationErrors()\n {\n $fields = $this->getFields();\n if (!$fields) {\n return [];\n }\n\n $result = [];\n foreach ($fields as $field) {\n if ($field instanceof AbstractFormField) {\n if (!$field->isValid()) {\n $result = array_merge($result, $field->getErrorMessages());\n }\n }\n }\n\n return $result;\n }", "public function getErrorMessages() {\n\t\t$errorMessages = '';\n\t\tforeach ($this->errorMessages as $index => $error) {\n\t\t\t$errorMessages .= \"[Error:\" . $index . '] ' . $error . \"\\n<br />\";\n\t\t}\n\t\treturn $errorMessages;\n\t}", "public function getErrorMessages()\n {\n $errors = [];\n foreach ($this->fields as $field) {\n if ($field instanceof AbstractFormField && !$field->isValid()) {\n $fldErrors = $field->getErrorMessages();\n $errors = array_merge($errors, $fldErrors);\n }\n }\n\n return $errors;\n }", "public function validation_errors()\n\t{\n\t\t$errors = array();\n\n\t\tforeach ($this->validators as $fld=>$arr)\n\t\t{\n\t\t\tforeach ($arr as $vl)\n\t\t\t{\n\t\t\t\t$vl->page = $this;\n\n\t\t\t\tif (!$vl->validate($fld, $this->vars))\n\t\t\t\t{\n\t\t\t\t\t$errors[$fld] = $vl->error_message($fld, $this->vars);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $errors;\n\t}", "public function getErrorMessagesList(){\n \t$errors = $this->getMessages();\n \tif(count($errors)){\n \t\t$result = [];\n \t\tforeach ($errors as $elementName => $elementErrors){\n \t\t\tforeach ($elementErrors as $errorMsg){\n \t\t\t\t$result[] = $errorMsg;\n \t\t\t}\n \t\t}\n \t\treturn $result;\n \t}\n \treturn null;\n }", "public function getValidationErrors();", "public function getValidationErrors();", "public function getErrorMessages()\n {\n $translator = Mage::helper('importexport');\n $messages = array();\n\n foreach ($this->_errors as $errorCode => $errorRows) {\n if (isset($this->_messageTemplates[$errorCode])) {\n $errorCode = $translator->__($this->_messageTemplates[$errorCode]);\n }\n foreach ($errorRows as $errorRowData) {\n $key = $errorRowData[1] ? sprintf($errorCode, $errorRowData[1]) : $errorCode;\n $messages[$key][] = $errorRowData[0];\n }\n }\n return $messages;\n }", "public function getError(): array\n {\n return $this->errorMessages;\n }", "public function get_errors() {\n\t\treturn $this->errors->get_error_messages();\n\t}", "public function allError() {\n return $this->errorMsg;\n }", "public function get_error_messages();", "public function errorMessages()\n {\n return [\n self::RULE_REQUIRED => 'This field is required',\n self::RULE_EMAIL => 'This field must be a valid email address',\n self::RULE_MIN => 'Min length of this field must be {min}',\n self::RULE_MAX => 'Max length of this field must be {max}',\n self::RULE_MATCH => 'This field must be the same as {match}',\n self::RULE_UNIQUE => 'Record with this {field} already exists'\n ];\n }", "public function getErrorMessages(){\n return $this->arr_msg; \n }", "public function errorMessages() : array\n {\n return [\n self::RULE_REQUIRED => 'Required.',\n self::RULE_EMAIL => 'Must be a valid email address.',\n self::RULE_MIN => 'Must be at least {min} characters.',\n self::RULE_MAX => 'Must be less than {max} characters.',\n self::RULE_MATCH => 'Must match {match}.',\n self::RULE_UNIQUE => '{column} is already in use.'\n ];\n }", "protected function getValidationErrors()\n {\n return $this->validation->errors();\n }", "public function getValidationErrors() {\n if (true == ($this->validation instanceof Validation)) {\n return $this->validation->getErrors();\n }\n\n return array();\n }", "public function getErrors()\n {\n return $this->validator->errors();\n }", "public function getErrors()\n {\n $errors = $this->getValue('klarna_validation_errors');\n return $errors ? $errors : array();\n }", "public function getAllerrors() {\n return $this->errors;\n }", "public function getErrors(): array {\n return $this->validationError;\n }", "public function getValidatorMessages()\n {\n $messages = [];\n \n foreach ($this->owner->getValidatorRules() as $rule) {\n \n if ($rule->hasMessage()) {\n $messages[$rule->getType()] = $rule->getMessage();\n }\n \n }\n \n return $messages;\n }", "public function get_errors() {\n $res = array();\n foreach($this->errors as $error) {\n $res[] = $error->errormsg;\n }\n return $res;\n }", "protected function _getValidationErrors()\n {\n if (is_null($this->validationErrors)) {\n return array();\n }\n\n return $this->validationErrors;\n }", "public function getValidationErrors()\n\t{\n\t\treturn $this->validationErrors;\n\t}", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function getMessages()\n {\n foreach (parent::getMessages() as $message) {\n switch ($message->getType()) {\n case 'PresenceOf':\n $message->setMessage('The field ' . $message->getField() . ' is required');\n break;\n case 'Uniqueness':\n $message->setMessage('The field ' . $message->getField() . ' must be unique');\n break;\n case 'Email':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid email');\n break;\n case 'Url':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid url');\n break;\n case 'InclusionIn':\n $message->setMessage('The field ' . $message->getField() . ' must contain a value in [' . implode(',', $message->getDomain()) . ']');\n break;\n case 'DateValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid date.');\n break;\n case 'TimestampValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid timestamps.');\n break;\n }\n }\n\n return parent::getMessages();\n }", "protected function validationErrorMessages()\n {\n return [\n 'password.required' => trans('strings.request_password_required'),\n 'password.confirmed' => trans('strings.request_password_confirmed'),\n 'password.min' => trans('strings.request_password_min', ['chars' => config('db_limits.users.minPasswordLength')]),\n ];\n }", "public function getValidationErrors() {\n\t\treturn $this->_validationErrors;\n\t}", "public function getErrors()\n {\n return $this->_arrValidationErrors;\n }", "public function getValidationErrors() {\n\t\tif ($this->_errors === null) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->_errors->toArray();\n\t}", "public function getValidationErrors() {\n\t\t$out = array();\n\t\t$this->loadFields();\n\t\tforeach($this->fields as $field) {\n\t\t\t$out = array_merge($out, $field->getValidationErrors());\n\t\t}\n\t\tif ((!$this->lat || !$this->lng) && !$this->feature_id) {\n\t\t\t$out[] = \"You must set a location!\";\n\t\t}\n\t\treturn $out;\n\t}", "public function getValidationErrors()\n\t{\n\t\tif(is_array($this->validation_errors) && \n\t\t\tsizeof($this->validation_errors))\n\t\t{\n\t\t\treturn array_unique($this->validation_errors);\n\t\t}\n\t\treturn array();\n\t}", "public function messages()\n {\n $items = [];\n foreach (static::attributes() as $key => $val) {\n $items[$key . '.required'] = t('common.form.errors.required', [\n 'attribute' => $val,\n ]);\n }\n \n return $items;\n }", "public function getErrors();", "public function getErrors();", "public function getErrors();", "public function getErrors();", "public function getErrors(): array\n {\n $errors = [];\n\n /** @var string $name @var HashSet $messages */\n foreach ($this->errors as $name => $messages) {\n $errors[$name] = [];\n foreach ($messages as $message) {\n $errors[$name][] = $message;\n }\n }\n\n return $errors;\n }", "public function errors()\n {\n // return new \\ArrayList($this->errorList.values());\n }", "public function errors()\n {\n return $this->validator->errors();\n }", "public function errors()\n {\n return $this->validator->errors();\n }", "public function errors()\n {\n return $this->validator->errors();\n }", "public function errors()\n {\n return $this->validator->errors();\n }", "public function get_validation_messages() {\n\t\t$field = $this->field;\n\t\t$id = $this->get_id( $field );\n\t\t$is_required = $this->is_required( $field );\n\t\t$messages = '';\n\n\t\t$post_title = self::get_property( 'post_title', $field, '' );\n\t\t$post_content = self::get_property( 'post_content', $field, '' );\n\t\t$post_excerpt = self::get_property( 'post_excerpt', $field, '' );\n\t\t$post_image = self::get_property( 'post_image', $field, '' );\n\t\t$setting_required_message = self::get_property( 'required_message', $field, '' );\n\t\t$post_type = self::get_property( 'post_type', $field, 'post' );\n\n\t\t$post_title_enabled = ! empty( $post_title );\n\t\t$post_content_enabled = ! empty( $post_content );\n\t\t$post_excerpt_enabled = ! empty( $post_excerpt );\n\t\t$post_image_enabled = ! empty( $post_image );\n\t\t$category_list = forminator_post_categories( $post_type );\n\n\t\tif ( $is_required ) {\n\t\t\tif ( $post_title_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-title\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_title_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post title', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_content_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-content\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_content_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post content', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_excerpt_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-excerpt\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_excerpt_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post excerpt', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_image_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-image\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_image_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please upload a post image', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif( ! empty( $category_list ) ) {\n\t\t\t\tforeach ( $category_list as $category ) {\n\t\t\t\t\t$post_category_enabled = self::get_property( $category['value'], $field, '' );\n\t\t\t\t\tif ( $post_category_enabled ) {\n\t\t\t\t\t\t$post_category_multiple = self::get_property( $category['value'].'_multiple', $field, '' );\n\t\t\t\t\t\tif( $post_category_multiple ){\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '[]\": {' . \"\\n\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '\": {' . \"\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t\t\t'forminator_postdata_field_' . $category['value'] . '_validation_message',\n\t\t\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please select a '. $category['singular'], Forminator::DOMAIN ) ),\n\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t$field\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $messages;\n\t}", "public function getValidationErrors() {\n\t\treturn (array)$this -> _errors;\n\t}", "function getErrors()\n\t{\n\t\treturn [];\n\t}", "protected function validationMessages(): array\n {\n return [];\n }", "public function getMessages($key)\n {\n return isset($this->errors[$key]) ? $this->errors[$key] : [];\n }", "public function validationErrors() {\n\t\t$return = array();\n\n\t\t$models = ClassRegistry::keys();\n\t\tforeach ($models as $currentModel) {\n\t\t\t$currentObject = ClassRegistry::getObject($currentModel);\n\t\t\tif ($currentObject instanceof Model) {\n\t\t\t\t$return[$currentObject->alias] = $currentObject->validationErrors;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "private function getErrorMessages(): array\n {\n return [\n 'notEmpty' => 'Campo {{name}} obligatorio',\n 'date' => '{{name}} debe tener una fecha valida. Ejemplo de formato: {{format}}\\'',\n 'intVal' => '',\n 'between' => '',\n 'in' => '',\n 'floatVal' => '',\n 'length' => '',\n 'stringType' => '',\n 'objectType' => '',\n 'cantidadRegistros' => 'dsfsdfsd',\n 'periodo.notEmpty' => 'Campo Periodo: es obligatorio',\n 'periodo' => 'Campo Periodo: Debe tener el formato AAAAMM, donde AAAA indica el año y MM el mes en números',\n 'orden.notEmpty' => 'Campo Orden: es obligatorio',\n 'orden' => 'Campo Orden: Debe ser igual a 1 ó 2.',\n 'codigoComprobante.notEmpty' => 'Campo Codigo de Comprobante: es obligatorio',\n 'codigoComprobante' => 'Campo Codigo de Comprobante: Debe debe estar comprendido entre 1 y 9998.',\n 'numeroComprobante.notEmpty' => 'Campo Numero de Comprobante: es obligatorio',\n 'numeroComprobante' => 'Campo Numero de Comprobante: Debe debe estar comprendido entre 1 y 99999999.',\n 'puntoVenta.notEmpty' => 'Punto de venta: es obligatorio',\n 'puntoVenta' => 'Punto de venta: Debe debe estar comprendido entre 1 y 9998.',\n ];\n }", "function getErrors()\n {\n $errMsg = '';\n foreach ($this->errors as $error) {\n $errMsg .= $error;\n $errMsg .= '<br/>';\n }\n return $errMsg;\n }", "public function getErrors(): array\n {\n return Logger::getErrorMessages();\n }", "protected function validationErrorMessages()\n {\n return [\n 'password.regex' => 'Password must contain at least 1 uppercase letter and 1 number.',\n ];\n }", "public function getErrors(): array\n {\n $error = [];\n\n foreach ($this->list as $r) {\n $error[$r->getPropertyPath()] = $r->getMessage();\n }\n\n return $error;\n }", "public function getMandatoryValidationMessages() {}", "protected function importValidationMessages()\n {\n return [];\n }", "public function errors()\n {\n return $this->provider->getMessageBag();\n }", "public function messages()\n {\n return [\n 'started_at.required_if' => __('validation.required'),\n 'ended_at.required_if' => __('validation.required'),\n 'subject_id.required_if' => __('validation.required'),\n 'competency.required_if' => __('validation.required'),\n 'learning_goals.required_if' => __('validation.required'),\n 'behavior.required_if' => __('validation.required'),\n ];\n }", "public function all(): array\n {\n $messages = [];\n foreach ($this->stack as $error) {\n $messages[] = $error->getMessage();\n }\n\n return $messages;\n }", "private function getErrors() {\n \n $inError = $this->getInErrorWords();\n $errors = array();\n $length = count($inError);\n if ($length === 0) {\n return $errors;\n }\n $error = null;\n $currentErrorType = null;\n for ($i = 0; $i <= $length; $i++) {\n \n if ($i === $length) {\n $errors[] = $error;\n break;\n }\n \n if (!isset($currentErrorType) || $currentErrorType === $inError[$i]['error']) {\n $message = (isset($error) ? $error['message'] . ' ' : '') . $inError[$i]['word'];\n }\n else {\n $errors[] = $error;\n $message = $inError[$i]['word'];\n }\n \n $currentErrorType = $inError[$i]['error'];\n $error = array(\n 'error' => $currentErrorType,\n 'message' => (isset($error) ? $error['message'] . ' ' : '') . $inError[$i]['word']\n );\n }\n return $errors;\n }", "public function messages() \n {\n return[\n 'name.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.numeric' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.major' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity']\n ];\n }", "public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}", "public function messages()\n {\n return [\n 'first_name.required' => 'First name cannot be blank.',\n 'first_name.string' => 'First name must be formatted as a string.',\n 'first_name.max' => 'First name exceeded the max number of characters.',\n 'last_name.required' => 'Last name cannot be blank.',\n 'last_name.string' => 'Last name must be formatted as a string.',\n 'last_name.max' => 'Last name exceeded the max number of characters.',\n 'email.required' => 'Email cannot be blank.',\n 'email.string' => 'Email name must be formatted as a string.',\n 'email.email' => 'Email must be formatted as a valid email address',\n 'email.max' => 'Email exceeded the max number of characters.',\n ];\n }", "public function messages()\n {\n $messages = [];\n foreach($this->request->get('users') as $key => $val)\n {\n $messages['users.'. $key . '.name.max'] = 'The field labeled \"Name ' . $key . '\" must be less than :max characters.';\n $messages['users.'. $key . '.phone.max'] = 'The field labeled \"Phone ' . $key . '\" must be less than :max characters.';\n $messages['users.'. $key . '.name.min'] = 'The field labeled \"Name ' . $key . '\" must be more than :min characters.';\n $messages['users.'. $key . '.phone.min'] = 'The field labeled \"Phone ' . $key . '\" must be more than :min characters.';\n }\n return $messages;\n }", "public function errors() {\n $Errors = array();\n foreach ($this->__fields() as $field) {\n $E = $this->$field->errorsList();\n if ($E) $Errors[$field] = $E;\n }\n return $Errors;\n }", "public function getErrors() {\r\n return $this->pdocrudErrCtrl->getErrors();\r\n }", "public function messages()\n {\n return [\n 'contractor_account_id.exists' => 'Invalid data.',\n 'truck_id.exists' => 'Invalid data.',\n 'source_id.exists' => 'Invalid data.',\n 'destination_id.exists' => 'Invalid data.',\n 'driver_id.exists' => 'Invalid data.',\n 'material_id.exists' => 'Invalid data.',\n ];\n }", "public function messages()\n {\n $illegalFields = [ 'email', 'type', 'status', 'branches', ];\n $messages = [];\n\n foreach ($illegalFields as $key => $attribute) {\n $messages[\"{$attribute}.not_present\"] = __('The field :attribute must not be present.');\n }\n\n return $messages;\n }", "public function messages()\n {\n return [\n 'zipcode.required' => 'A Zipcode is required',\n 'publicPlace.required' => 'A Public Place is required',\n 'neighbordhood.required' => 'A Neighbordhood is required',\n 'complement.required' => 'A Complement Name is required',\n 'number.required' => 'A Number is required',\n 'city.required' => 'A City is required',\n 'state.required' => 'A State is required',\n\n 'zipcode.max' => 'A Zipcode max 255 characteres required.',\n 'publicPlace.max' => 'A Public Place max 255 characteres required.',\n 'neighbordhood.max' => 'A Neighbordhood max 255 characteres required.',\n 'complement.max' => 'A Complementmax 255 characteres required.',\n 'number.max' => 'A Number max 255 characteres required.',\n 'city.max' => 'A City max 255 characteres required.',\n 'state.max' => 'A State max 255 characteres required.',\n ];\n }", "public function messages()\n {\n return $messages = [\n 'source_funds.required' => trans('common.error_messages.req_this_field'),\n 'jurisdiction_funds.required' => trans('common.error_messages.req_this_field'),\n 'annual_income.required' => trans('common.error_messages.req_this_field'),\n 'other_source.required' => trans('common.error_messages.req_this_field'),\n 'estimated_wealth.required' => trans('common.error_messages.req_this_field'),\n 'wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'other_wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'tin_code.required' => trans('common.error_messages.req_this_field'),\n 'is_abandoned.required' => trans('common.error_messages.req_this_field'),\n 'date_of_abandonment.required' => trans('common.error_messages.req_this_field'),\n 'abandonment_reason.required' => trans('common.error_messages.req_this_field'),\n 'justification.required' => trans('common.error_messages.req_this_field'),\n 'tin_country_name.required' => trans('common.error_messages.req_this_field'),\n 'tin_number.required' => trans('common.error_messages.req_this_field'),\n ];\n }", "public function getErrors()\n\t{\n\t\t$errors = array();\n\t\t/** @var Miao_Form_Control $control */\n\t\t/** @var Miao_Form_Validate $validator */\n\t\tforeach ( $this->getControls() as $control )\n\t\t{\n\t\t\tif ( !$control->isValid() )\n\t\t\t{\n\t\t\t\t$validator = $control->error();\n\t\t\t\t$errors[] = array(\n\t\t\t\t\t'name' => $control->getName(),\n\t\t\t\t\t'error' => $validator->getMessage() );\n\t\t\t}\n\t\t}\n\t\treturn $errors;\n\t}", "public function getErrors(): array\n {\n return $this->errors;\n }", "public function getErrors(): array\n {\n return $this->errors;\n }", "public function getErrors(): array\n {\n return $this->errors;\n }", "public function getErrors(): array\n {\n return $this->errors;\n }", "public function getErrors(): array\n {\n return $this->errors;\n }", "public function getErrors(): array\n {\n return $this->errors;\n }", "public function getErrors(): array\n {\n return $this->errors;\n }", "public function messages()\n {\n return [\n 'name.required' => 'Email is required!',\n 'year.required' => 'Year is required!',\n 'artist_id.required' => 'Artist is required!'\n ];\n }" ]
[ "0.8462841", "0.8401337", "0.8401337", "0.8325618", "0.8279654", "0.82191825", "0.8131191", "0.80997646", "0.80711967", "0.8062478", "0.80487376", "0.80277896", "0.8006037", "0.7972693", "0.7965387", "0.7954231", "0.7930176", "0.7926157", "0.792453", "0.7908467", "0.7879117", "0.7863131", "0.78598666", "0.77954376", "0.77918684", "0.77918684", "0.77832544", "0.7767938", "0.7717568", "0.7716702", "0.7711443", "0.76842594", "0.76712966", "0.76693213", "0.76343715", "0.7598346", "0.7597816", "0.7585064", "0.75737166", "0.75694996", "0.7566647", "0.756641", "0.75539654", "0.75449544", "0.75329685", "0.75329685", "0.7527026", "0.75167054", "0.7514265", "0.7503328", "0.7492843", "0.7492459", "0.747726", "0.74730617", "0.74641496", "0.74641496", "0.74641496", "0.74641496", "0.7455927", "0.7454209", "0.74403095", "0.74403095", "0.74403095", "0.74403095", "0.74245656", "0.7419608", "0.7416394", "0.74145716", "0.7405949", "0.74049205", "0.7396414", "0.739456", "0.7380542", "0.73789024", "0.7367994", "0.7365635", "0.73531044", "0.735072", "0.7344719", "0.73446906", "0.73393863", "0.7337786", "0.733091", "0.7328421", "0.7321611", "0.7313315", "0.7305464", "0.73015785", "0.7287058", "0.7285274", "0.7283839", "0.72763115", "0.72587395", "0.72587395", "0.72587395", "0.72587395", "0.72587395", "0.72587395", "0.72587395", "0.72564715" ]
0.80184394
12
Set the HTTP status code to be used for the response.
public function status($status) { $this->status = $status; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setStatusCode($code)\r\n {\r\n http_response_code($code);\r\n }", "function setStatusCode($code);", "protected function setHTTPstatus($code)\n {\n $realCode = Response::$statusTexts;\n\n if (isset($realCode[$code])) {\n $this->HTTPstatus = $code;\n }\n }", "protected function set_status( $code ) {\n\t\tstatus_header( $code );\n\t}", "public function setStatusCode($status);", "public function setStatusCode($code)\n {\n $this->statusCode = $code;\n }", "protected function setHttpCode(Int $code = 200)\n {\n http_response_code($code);\n }", "protected function setStatusCode($code)\n {\n $this->statusCode = (int) $code;\n }", "public function setResponseCode($code) {}", "public function setStatusCode($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS] \n = $value;\n }", "public function status($code)\n {\n $this['response']->setStatus($code);\n }", "public function setStatus(int $code): void\n {\n http_response_code($code);\n }", "public function setStatusCode($statusCode);", "public function setResponseCode(HttpStatusCode|int|null $code = 200): void\n {\n $codeObject = $code;\n\n if (!$codeObject)\n {\n return;\n }\n\n if (is_int($code))\n {\n $codeObject = HttpStatus::fromInt($code);\n }\n\n http_response_code($codeObject->code);\n }", "private function setStatusCode()\n {\n $this->status_code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);\n }", "protected function set_status($code)\n {\n }", "public function setResponseCode($code);", "public function set_status($code)\n {\n }", "public function set_status($code)\n {\n }", "protected static function setStatusCode($code)\n {\n return self::$statusCode = $code;\n\n }", "public function setResponseStatus($status) {}", "private function _setHttpResponseHeader($code = null) {\n\t\t$httpCode = $this->controller->response->httpCodes($code);\n\t\tif ($httpCode[$code]) {\n\t\t\t$this->controller->response->statusCode($code);\n\t\t} else {\n\t\t\t$this->controller->response->statusCode(500);\n\t\t\t$code = 500;\n\t\t}\n\t}", "public function setStatusCode($code, $text);", "public function setStatusCode(int $statusCode): void\n {\n $this->statusCode = $statusCode;\n }", "public function setStatusCode($statusCode)\n {\n \\http_response_code($statusCode);\n }", "public function setStatusCode($code) {\r\n\t\tif (! is_int ( $code ) || (100 > $code) || (599 < $code)) {\r\n\t\t\tthrow new Exception\\InvalidArgumentException ( 'Invalid HTTP response' . ' code:' . $code );\r\n\t\t}\r\n\t\t$this->statusCode = $code;\r\n\t\treturn $this;\r\n\t}", "public function setHttpCode($code) {\n $this->httpCode = $code;\n }", "public function setStatusCode(int $statusCode)\n {\n $this->statusCode = $statusCode;\n }", "public function setStatusCode(int $statusCode)\n {\n $this->meta['status_code'] = $statusCode;\n }", "public function setStatusCode($statusCode)\r\n {\r\n $this->_statusCode = $statusCode;\r\n }", "public function setStatusCode($code)\n {\n $this->statusCode = $code;\n $this->statusText = HttpCode::getStatusText($code);\n if ($this->statusText === null) {\n throw new InvalidArgumentException(\"invalid HTTP status code '$code'\");\n }\n return $this;\n }", "public function setResponseCode($responseCode);", "public function setStatusCode(int $statusCode): ResponseInterface;", "public function setStatusCode(int $code): \\Maleficarum\\Response\\AbstractResponse {\n $message = \\Maleficarum\\Response\\Http\\Status::getMessageForStatus($code);\n\n $this->response->setStatusCode($code, $message);\n\n return $this;\n }", "private function setStatus(int $httpStatusCode): void\n {\n $this->statusCode = $httpStatusCode;\n }", "public function setHttpResponseCode($code)\n {\n if (!is_int($code) || (100 > $code) || (599 < $code)) {\n require_once 'Zend/Controller/Response/Exception.php';\n throw new Zend_Controller_Response_Exception('Invalid HTTP response code');\n }\n\n if ((300 <= $code) && (307 >= $code)) {\n $this->_isRedirect = true;\n } else {\n $this->_isRedirect = false;\n }\n\n $this->_httpResponseCode = $code;\n return $this;\n }", "protected function setHttpCode( $code)\r\n {\r\n $this->httpcode = $code;\r\n }", "function setResponseCode($code) {\n $this->responseCode = $code;\n }", "function setStatusCode($code,$message = null){\n\t\tif(preg_match('/^([0-9]{3}) (.+)/',$code,$matches)){\n\t\t\t$code = $matches[1];\n\t\t\t$message = $matches[2];\n\t\t}\n\n\t\tsettype($code,\"integer\");\n\t\t$this->_StatusCode_Redefined = true;\n\t\t$this->_StatusCode = $code;\n\t\t$this->_StatusMessage = $message;\n\t}", "public function setStatusCode($code, $name = null)\n {\n $this->statusCode = $code;\n $this->statusText = null !== $name ? $name : self::$statusTexts[$code];\n }", "public function setStatusCode($code)\n {\n $code = (int) $code;\n if ($code < 100 || $code > 600) {\n throw new \\RuntimeException('HTTP Response Code must be between 100 and 600');\n }\n $this->status = (int) $code;\n\n return $this;\n }", "public function setHttpResponseCode($code)\r\n\t{\r\n\t\tif (!is_int($code) || (100 > $code) || (599 < $code)) {\r\n\t\t\tthrow new Syx_Response_Exception('Invalid HTTP response code');\r\n\t\t}\r\n\r\n\t\tif ((300 <= $code) && (307 >= $code)) {\r\n\t\t\t$this->_isRedirect = true;\r\n\t\t} else {\r\n\t\t\t$this->_isRedirect = false;\r\n\t\t}\r\n\r\n\t\t$this->_httpResponseCode = $code;\r\n\t\treturn $this;\r\n\t}", "public function setStatusCode($statusCode)\n {\n $this->statusCode = $statusCode;\n }", "public function setStatusCode($code)\n {\n $this->statusCode = $code;\n\n return $this;\n }", "public function setStatusCode($code)\n {\n $this->statusCode = $code;\n\n return $this;\n }", "protected function setStatusCode($statusCode)\r\n {\r\n $this->slim->response()->status($statusCode);\r\n }", "public function setHttpStatus(int $http_status): void\n {\n $this->http_status = $http_status;\n }", "function set_status_header(int $p_code = 200, string $p_text = '') {\n if (flcCommon::is_cli()) {\n return;\n }\n\n /* if (empty($p_code) or !is_numeric($p_code)) {\n $p_text = 'Status code must be numeric';\n $p_code = 500;\n }*/\n\n if (empty($p_text)) {\n is_int($p_code) or $p_code = (int)$p_code;\n\n if (isset(self::$status_codes[$p_code])) {\n $p_text = self::$status_codes[$p_code];\n } else {\n $p_text = '(null)';\n $p_code = 500;\n }\n }\n\n if (strpos(PHP_SAPI, 'cgi') === 0) {\n header('Status: '.$p_code.' '.$p_text, true);\n } else {\n header($this->get_protocol_version().' '.$p_code.' '.$p_text, true, $p_code);\n }\n }", "public function & setStatusCode( $a_code )\r\n\t{\r\n\t\t$this->m_code = intval($a_code);\r\n\t\treturn $this;\r\n\t}", "public function setServerStatusCode($code)\n {\n $this->historial->server_status_code = $code;\n }", "public function setHTTPResponseCode($http_response_code)\n {\n $this->http_response_code = $http_response_code;\n }", "public static function status(int $httpCode = null)\n {\n if ($httpCode === null) return self::$httpCode;\n self::$httpCode = $httpCode;\n }", "protected static function statusCode($code=null) {\r\n\t\tstatic $current_status;\r\n\t\t\r\n\t\tif ($code) {\r\n $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';\r\n\t\t\t$current_status = $code;\r\n\t\t\theader($protocol. ' ' . static::$messages[$code]);\r\n\t\t}\r\n\t\treturn $current_status?:200;\r\n\t}", "public function setCode(int $code): ResponseInterface;", "public static function setHttpResponseCode($code = null)\n {\n if (is_null($code)) {\n return (isset($GLOBALS['http_response_code']))\n ? $GLOBALS['http_response_code']\n : 200;\n }\n\n switch ($code) {\n case 100: $text = 'Continue'; break;\n case 101: $text = 'Switching Protocols'; break;\n case 200: $text = 'OK'; break;\n case 201: $text = 'Created'; break;\n case 202: $text = 'Accepted'; break;\n case 203: $text = 'Non-Authoritative Information'; break;\n case 204: $text = 'No Content'; break;\n case 205: $text = 'Reset Content'; break;\n case 206: $text = 'Partial Content'; break;\n case 300: $text = 'Multiple Choices'; break;\n case 301: $text = 'Moved Permanently'; break;\n case 302: $text = 'Moved Temporarily'; break;\n case 303: $text = 'See Other'; break;\n case 304: $text = 'Not Modified'; break;\n case 305: $text = 'Use Proxy'; break;\n case 400: $text = 'Bad Request'; break;\n case 401: $text = 'Unauthorized'; break;\n case 402: $text = 'Payment Required'; break;\n case 403: $text = 'Forbidden'; break;\n case 404: $text = 'Not Found'; break;\n case 405: $text = 'Method Not Allowed'; break;\n case 406: $text = 'Not Acceptable'; break;\n case 407: $text = 'Proxy Authentication Required'; break;\n case 408: $text = 'Request Time-out'; break;\n case 409: $text = 'Conflict'; break;\n case 410: $text = 'Gone'; break;\n case 411: $text = 'Length Required'; break;\n case 412: $text = 'Precondition Failed'; break;\n case 413: $text = 'Request Entity Too Large'; break;\n case 414: $text = 'Request-URI Too Large'; break;\n case 415: $text = 'Unsupported Media Type'; break;\n case 500: $text = 'Internal Server Error'; break;\n case 501: $text = 'Not Implemented'; break;\n case 502: $text = 'Bad Gateway'; break;\n case 503: $text = 'Service Unavailable'; break;\n case 504: $text = 'Gateway Time-out'; break;\n case 505: $text = 'HTTP Version not supported'; break;\n default:\n exit('Unknown http status code \"' . htmlentities($code) . '\"');\n break;\n }\n\n $protocol = (isset($_SERVER['SERVER_PROTOCOL']))\n ? $_SERVER['SERVER_PROTOCOL']\n : 'HTTP/1.0';\n\n header($protocol . ' ' . $code . ' ' . $text);\n\n $GLOBALS['http_response_code'] = $code;\n\n return $code;\n }", "protected function setResponse($status_code, $message='')\r\n {\r\n $this->response_vars['status_code'] = $status_code;\r\n $this->response_vars['message'] = $message;\r\n }", "static function set_status_header($code = 200, $text = '')\n\t{\n\t\t$stati = array(\n\t\t\t\t\t\t200\t=> 'OK',\n\t\t\t\t\t\t201\t=> 'Created',\n\t\t\t\t\t\t202\t=> 'Accepted',\n\t\t\t\t\t\t203\t=> 'Non-Authoritative Information',\n\t\t\t\t\t\t204\t=> 'No Content',\n\t\t\t\t\t\t205\t=> 'Reset Content',\n\t\t\t\t\t\t206\t=> 'Partial Content',\n\n\t\t\t\t\t\t300\t=> 'Multiple Choices',\n\t\t\t\t\t\t301\t=> 'Moved Permanently',\n\t\t\t\t\t\t302\t=> 'Found',\n\t\t\t\t\t\t304\t=> 'Not Modified',\n\t\t\t\t\t\t305\t=> 'Use Proxy',\n\t\t\t\t\t\t307\t=> 'Temporary Redirect',\n\n\t\t\t\t\t\t400\t=> 'Bad Request',\n\t\t\t\t\t\t401\t=> 'Unauthorized',\n\t\t\t\t\t\t403\t=> 'Forbidden',\n\t\t\t\t\t\t404\t=> 'Not Found',\n\t\t\t\t\t\t405\t=> 'Method Not Allowed',\n\t\t\t\t\t\t406\t=> 'Not Acceptable',\n\t\t\t\t\t\t407\t=> 'Proxy Authentication Required',\n\t\t\t\t\t\t408\t=> 'Request Timeout',\n\t\t\t\t\t\t409\t=> 'Conflict',\n\t\t\t\t\t\t410\t=> 'Gone',\n\t\t\t\t\t\t411\t=> 'Length Required',\n\t\t\t\t\t\t412\t=> 'Precondition Failed',\n\t\t\t\t\t\t413\t=> 'Request Entity Too Large',\n\t\t\t\t\t\t414\t=> 'Request-URI Too Long',\n\t\t\t\t\t\t415\t=> 'Unsupported Media Type',\n\t\t\t\t\t\t416\t=> 'Requested Range Not Satisfiable',\n\t\t\t\t\t\t417\t=> 'Expectation Failed',\n\n\t\t\t\t\t\t500\t=> 'Internal Server Error',\n\t\t\t\t\t\t501\t=> 'Not Implemented',\n\t\t\t\t\t\t502\t=> 'Bad Gateway',\n\t\t\t\t\t\t503\t=> 'Service Unavailable',\n\t\t\t\t\t\t504\t=> 'Gateway Timeout',\n\t\t\t\t\t\t505\t=> 'HTTP Version Not Supported'\n\t\t\t\t\t);\n\n\t\tif ($code == '' OR ! is_numeric($code))\n\t\t{\n\t\t\tself::show_error('Status codes must be numeric', 500);\n\t\t}\n\n\t\tif (isset($stati[$code]) AND $text == '')\n\t\t{\t\t\t\t\n\t\t\t$text = $stati[$code];\n\t\t}\n\t\n\t\tif ($text == '')\n\t\t{\n\t\t\tself::show_error('No status text available. Please check your status code number or supply your own message text.', 500);\n\t\t}\n\t\n\t\t$server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;\n\n\t\tif (substr(php_sapi_name(), 0, 3) == 'cgi')\n\t\t{\n\t\t\theader(\"Status: {$code} {$text}\", TRUE);\n\t\t}\n\t\telseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')\n\t\t{\n\t\t\theader($server_protocol.\" {$code} {$text}\", TRUE, $code);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"HTTP/1.1 {$code} {$text}\", TRUE, $code);\n\t\t}\n\t}", "function response($code){\n $this->response_code = $code;\n }", "function status($code) {\n $reason=@constant('self::HTTP_'.$code);\n if (PHP_SAPI!='cli')\n header($_SERVER['SERVER_PROTOCOL'].' '.$code.' '.$reason);\n return $reason;\n }", "public function statusCode($code = null) {\n\t\tif ($code === null) {\n\t\t\treturn $this->_status;\n\t\t}\n\t\tif (!isset($this->_statusCodes[$code])) {\n\t\t\tthrow new CakeException(__d('cake_dev', 'Unknown status code'));\n\t\t}\n\t\treturn $this->_status = $code;\n\t}", "public function setCode(int $code): Response {\n\t\t$this->code = $code;\n\t\thttp_response_code($code);\n\n\t\treturn $this;\n\t}", "public function setStatusCode(int $statusCode): Response {\n\t\t$this->statusCode = $statusCode;\n\n\t\treturn $this;\n\t}", "private function setHttpCode($httpCode) {\n $this->httpCode = $httpCode;\n }", "public function setHttpStatus($status)\n {\n $this->httpStatus = $status;\n }", "public function setStatusCode($statusCode = 200)\n {\n \t$this->statusCode = $statusCode;\n\n \treturn $this;\n }", "private function sendResponseCode(): void\n {\n\n $http = sprintf(\n 'HTTP/%s %s %s',\n $this->versionProtocol,\n $this->responseCode,\n $this->httpCodeText[$this->responseCode]\n );\n\n header($http, true);\n http_response_code($this->responseCode);\n\n }", "public function setCode(int $code)\n{\n self::$stored['codes'][] = $code;\n http_response_code($code);\n}", "public function setStatuscode(int $statusCode, string $statusText) : \\codename\\core\\response {\n $this->statusCode = $statusCode;\n $this->statusText = $statusText;\n return $this;\n }", "public function setStatusCode(int $statusCode): void\n {\n $this->ngsStatusCode = $statusCode;\n }", "public function status(int $code);", "public function setStatusCode(int $status) : static\n {\n $this->status = $status;\n $this->statusText = self::$statusTexts[$status] ?? 'unknown status';\n return $this;\n }", "protected function setResponseStatus(ResponseStatus $value)\n {\n $this->responseStatus = $value;\n }", "public function statusCode($new_value = null)\n {\n // Get\n if ($new_value === null) {\n return $this->status_code;\n }\n\n // Set\n if (is_int($new_value) && $new_value >= 100 && $new_value <= 599) {\n $this->status_code = $new_value;\n return $this;\n }\n\n // If invalid then thrown an Exception\n $error = 'Unhandled Response Status Code of [%s] for [%s->%s()].';\n if (is_int($new_value)) {\n $error = sprintf($error, $new_value, __CLASS__, __FUNCTION__);\n } else {\n $error = sprintf($error, 'type: ' . gettype($new_value), __CLASS__, __FUNCTION__);\n }\n throw new \\Exception($error);\n }", "public function setCode(int $code)\n {\n if (!array_key_exists($code, self::STATUS_TEXTS)) {\n throw new OutOfBoundsException(sprintf(\"%d is not a valid HTTP code\", $code));\n }\n \n $this->code = $code;\n }", "public function setHttpCode($httpCode)\n {\n $this->httpCode = $httpCode;\n }", "public static function resetStatus($httpCode = 200)\n {\n return http_response_code($httpCode);\n }", "public function code( $code = null ) {\n\t\tif ( null !== $code ) {\n\t\t\t$this->_code = $code;\n\n\t\t\t// Do we have the PHP 5.4 \"http_response_code\" function?\n\t\t\tif ( function_exists( 'http_response_code' ) ) {\n\t\t\t\t// Have PHP automatically create our HTTP Status header from our code\n\t\t\t\thttp_response_code( $code );\n\t\t\t} else {\n\t\t\t\t// Manually create the HTTP Status header\n\t\t\t\t$protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';\n\t\t\t\t$this->header( \"$protocol $code\" );\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_code;\n\t}", "public function setHttpResponseCode($code)\n {\n $this->httpResponseCode = $code;\n\n return $this;\n }", "public function setStatusCode(int $code, $text = null)\n {\n $this->statusCode = $code;\n if ($this->isInvalid()) {\n throw new \\InvalidArgumentException(sprintf('The status code \"%s\" is not valid.', $code));\n }\n\n if (null === $text) {\n $this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : 'unknown status';\n\n return $this;\n }\n\n if (false === $text) {\n $this->statusText = '';\n\n return $this;\n }\n\n $this->statusText = $text;\n\n return $this;\n }", "protected function setErrorHeader() {\n\t\tif ($this->response_code >= 400 && $this->response_code < 500) {\n\t\t\theader('HTTP/1.1 ' . $this->response_code . \" \" . SVException::g($this->response_code));\n\t\t\texit(0);\n\t\t}\n\t}", "function http_response_code($newcode = NULL)\n\t\t{\n\t\t\tstatic $code = 200;\n\t\t\tif($newcode !== NULL)\n\t\t\t{\n\t\t\t\theader('X-PHP-Response-Code: '.$newcode, true, $newcode);\n\t\t\t\tif(!headers_sent())\n\t\t\t\t\t$code = $newcode;\n\t\t\t}\n\t\t\treturn $code;\n\t }", "public function setStatusCode(int $statusCode)\n {\n $this->statusCode = $statusCode;\n\n return $this;\n }", "protected function set_valid_response_codes()\n {\n //@todo manage response codes\n $this->valid_response_codes = array(200);\n }", "function set_status_header($code = 200, $text = '') {\n $stati = array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 307 => 'Temporary Redirect',\n\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported'\n );\n\n if ($code == '' OR !is_numeric($code)) {\n show_error('Status codes must be numeric', 500);\n }\n\n if (isset($stati[$code]) AND $text == '') {\n $text = $stati[$code];\n }\n\n if ($text == '') {\n show_error('No status text available. Please check your status code number or supply your own message text.', 500);\n }\n\n $server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;\n\n if (substr(php_sapi_name(), 0, 3) == 'cgi') {\n header(\"Status: {$code} {$text}\", TRUE);\n }\n elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0') {\n header($server_protocol . \" {$code} {$text}\", TRUE, $code);\n }\n else {\n header(\"HTTP/1.1 {$code} {$text}\", TRUE, $code);\n }\n}", "public function statusCode($httpResponseCode) {\n // @link http://gif.phpnet.org/frederic/programs/http_status_codes/\n header('x', true, $httpResponseCode);\n }", "public function setResponseCode(int $code): Header\n {\n\n $this->responseCode = $code;\n\n return $this;\n\n }", "private function http_response_code($new_code = null)\n {\n if (!function_exists('http_response_code')) {\n function http_response_code($new_code = NULL)\n {\n static $code = 200;\n if ($new_code !== NULL) {\n header('X-PHP-Response-Code: ' . $new_code, true, $new_code);\n if (!headers_sent()) {\n $code = $new_code;\n }\n }\n return $code;\n }\n } else {\n http_response_code($new_code);\n }\n }", "private function setResponseCode($responseCode) {\n $this->responseCode = $responseCode;\n }", "public function getStatusCode()\n {\n return $this->statusCode ?: 200;\n }", "public function status($code) {\n $this->status = $code;\n return $this;\n }", "public function getStatusCode(){\n return $this->httpResponseCode;\n }", "public function testAbleToSetStatus()\n {\n $this->response->setStatus(404);\n $this->assertEquals(\n 404, $this->response->getStatus(),\n 'Unable to set Status'\n );\n }", "public function status_code()\n {\n }", "public function code($code = null)\r\n {\r\n if (null !== $code) {\r\n // Require that the response be unlocked before changing it\r\n $this->requireUnlocked();\r\n\r\n $this->status = new HttpStatus($code);\r\n\r\n return $this;\r\n }\r\n\r\n return $this->status->getCode();\r\n }", "public function httpCode(int $code): self\n {\n http_response_code($code);\n\n return $this;\n }", "public function setStatusCodeMsg($msg)\r\n {\r\n $this->_statusCodeMsg = $msg;\r\n }", "public function set_status_code(int $p_code, string $p_reason = '') {\n // Valid range?\n if ($p_code < 100 || $p_code > 599) {\n throw new RuntimeException(\"$p_code is not a valid HTTP return status code\");\n }\n\n // Unknown and no message?\n if (!array_key_exists($p_code, static::$status_codes) && empty($p_reason)) {\n throw new RuntimeException(\"Unknown HTTP status code provided with no message: $p_code\");\n }\n\n $this->status_code = $p_code;\n\n $this->reason = !empty($p_reason) ? $p_reason : static::$status_codes[$p_code];\n\n }", "protected function setStatusCode(int $statusCode)\n {\n $this->statusCode = $statusCode;\n \n return $this;\n }", "function statusCode()\n {\n }", "function sendHttpStatus($code) \n {\n\t\tstatic $_status = array(\n\t\t\t// Informational 1xx\n\t\t\t100 => 'Continue',\n\t\t\t101 => 'Switching Protocols',\n\n\t\t\t// Success 2xx\n\t\t\t200 => 'OK',\n\t\t\t201 => 'Created',\n\t\t\t202 => 'Accepted',\n\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content',\n\t\t\t205 => 'Reset Content',\n\t\t\t206 => 'Partial Content',\n\n\t\t\t// Redirection 3xx\n\t\t\t300 => 'Multiple Choices',\n\t\t\t301 => 'Moved Permanently',\n\t\t\t302 => 'Found', // 1.1\n\t\t\t303 => 'See Other',\n\t\t\t304 => 'Not Modified',\n\t\t\t305 => 'Use Proxy',\n\t\t\t// 306 is deprecated but reserved\n\t\t\t307 => 'Temporary Redirect',\n\n\t\t\t// Client Error 4xx\n\t\t\t400 => 'Bad Request',\n\t\t\t401 => 'Unauthorized',\n\t\t\t402 => 'Payment Required',\n\t\t\t403 => 'Forbidden',\n\t\t\t404 => 'Not Found',\n\t\t\t405 => 'Method Not Allowed',\n\t\t\t406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t408 => 'Request Timeout',\n\t\t\t409 => 'Conflict',\n\t\t\t410 => 'Gone',\n\t\t\t411 => 'Length Required',\n\t\t\t412 => 'Precondition Failed',\n\t\t\t413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long',\n\t\t\t415 => 'Unsupported Media Type',\n\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\n\t\t\t// Server Error 5xx\n\t\t\t500 => 'Internal Server Error',\n\t\t\t501 => 'Not Implemented',\n\t\t\t502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable',\n\t\t\t504 => 'Gateway Timeout',\n\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t509 => 'Bandwidth Limit Exceeded'\n\t\t);\n\t\tif(isset($_status[$code])) {\n\t\t\theader('HTTP/1.1 '.$code.' '.$_status[$code]);\n\t\t}\n\t}", "public function getHTTPStatusCode() { return $this->status; }" ]
[ "0.85335654", "0.836792", "0.82445693", "0.82313687", "0.8196753", "0.8183882", "0.81658024", "0.8160293", "0.80143756", "0.79786605", "0.79654694", "0.795734", "0.7955241", "0.7945231", "0.7920958", "0.7907239", "0.78440416", "0.78156865", "0.78138447", "0.7798765", "0.7790681", "0.77082056", "0.7696541", "0.76573586", "0.76298046", "0.7622992", "0.75794", "0.75740343", "0.75659406", "0.7545005", "0.7519966", "0.7510227", "0.7510209", "0.75094014", "0.7496003", "0.7488537", "0.7469871", "0.74632573", "0.74547935", "0.7427816", "0.7424371", "0.74197", "0.7417377", "0.74083716", "0.74083716", "0.74058104", "0.73550504", "0.7296094", "0.72946554", "0.7276643", "0.7256289", "0.723665", "0.71960306", "0.71611774", "0.7125248", "0.7121948", "0.71150416", "0.7101395", "0.70921147", "0.7076601", "0.70706934", "0.7050935", "0.70426494", "0.7032934", "0.70213044", "0.70190537", "0.7013534", "0.7002292", "0.70002365", "0.69807446", "0.69782555", "0.69613147", "0.6960684", "0.69605416", "0.6940401", "0.69356644", "0.6918425", "0.69071245", "0.69046915", "0.6902373", "0.6899806", "0.68996847", "0.68892384", "0.6888162", "0.68803585", "0.6878231", "0.68725777", "0.687062", "0.6869252", "0.68575114", "0.6836648", "0.6826", "0.68209743", "0.6820482", "0.680999", "0.67973155", "0.6759453", "0.67576057", "0.6747209", "0.67436874", "0.6733631" ]
0.0
-1
Set the URL to redirect to on a validation error.
public function redirectTo($url) { $this->redirectTo = $url; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setErrorUrl($val)\n {\n $this->_propDict[\"errorUrl\"] = $val;\n return $this;\n }", "public function redirectBackWithErrors($validator);", "public function getRedirectToFormOnValidationError()\n {\n return $this->redirectToFormOnValidationError;\n }", "public function setRedirectUrl($url);", "function redirect_error($code, $url = null) {\n\n global $CFG;\n\n // Set the redirect URL if it wasn't specified as a parameter\n if (!$url) {\n $url = $CFG->wwwroot;\n }\n\n // URL encode parameters to error page\n $code = urlencode($code);\n $url = urlencode($url);\n\n // Redirect user to error page with encoded parameters\n redirect($CFG->wwwroot . \"/blocks/courseprefs/error.php?error=$code\" .\n ($url ? \"&url=$url\" : ''));\n}", "protected function _redirectToError()\n {\n $this->_redirect(self::ZIPMONEY_ERROR_ROUTE);\n }", "public function getErrorUrl()\n {\n if (array_key_exists(\"errorUrl\", $this->_propDict)) {\n return $this->_propDict[\"errorUrl\"];\n } else {\n return null;\n }\n }", "public function callbackFail()\n {\n $this->redirectTo();\n }", "public function setRedirectUrl($url = NULL) {\n if (($url === NULL) || ($url instanceof Url)) {\n $this->redirectUrl = $url;\n }\n }", "public function validateRedirectUrlKeepsCleanUrlDataProvider() {}", "public function redirectToExternalUrl() {}", "protected static function _url(){\n if (self::$_ruleValue) {\n $str = filter_var(trim(self::$_elementValue), FILTER_VALIDATE_URL);\n if (!$str) {\n self:: setErrorMessage(\"Enter valid URL\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function validateRedirectUrlClearsUrlDataProvider() {}", "public function setRedirect($url, $code = 302);", "public function invalidUrl($url) {\n\t\t\n\t\t$this->Session->setFlash(\"Invalid URL\");\n\t\t\n\t\treturn $this->redirect($url);\n\t\t\n\t}", "function wp_validate_redirect($location, $fallback_url = '')\n {\n }", "public function redirectToHome(array $errors = []);", "function setFailedValidationStatusCode();", "public function validateRedirectUrlClearsInvalidUrlInSubdirectoryDataProvider() {}", "public function runError() {\n\t\t\t$this->setSession('sError', $this->getError());\n\n\t\t\t// Set the router\n\t\t\tredirect(\n\t\t\t\t$this->getUrl(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'sRouter' => 'error', \n\t\t\t\t\t\t'sController' => 'index'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function addValidationRedirect($crnrstn_form_handle = NULL, $html_dom_form_input_name_pipe_delim = NULL, $validation_key_pipe_delim = NULL, $on_error_redirect_uri = NULL, $on_success_redirect_uri = NULL){\n\n\n return NULL;\n\n }", "function setRedirect( $url, $msg = null ) {\n\t\t$this->_redirect = $url;\n\t\tif ($msg !== null) {\n\t\t\t$this->_message = $msg;\n\t\t}\n\t}", "function setFailOnMainUrlError($fail_on_error) {\n $this->fields['fail_on_main_url_error'] = $fail_on_error;\n return $this;\n }", "function setFailOnMainUrlError($fail_on_error) {\n $this->fields['fail_on_main_url_error'] = $fail_on_error;\n return $this;\n }", "protected function checkRedirect() {}", "public function setWebsiteRedirect(){\n\t\t\n\t\t// Set the state and tell plugins.\n\t\t$this->setState('REDIRECTING');\n\t\t$this->notifyObservers();\n\t\t\n\t\t//Show success message on redirected to page\n\t\t$_SESSION['ERROR_TYPE'] = \"success\";\n\t\t$_SESSION['ERROR_MESSAGE'] = \"Website Data Saved Successfully\";\n\t\t\n\t\t//Go Redirect\n\t\t$this->setRedirect(\"index.php?system=GeneralSettings&page=edit\");\t\n\t}", "public function setRedirectUrl($redirectUrl);", "public function setRedirectUrl(string $redirectUrl);", "public function validateFailedURL() {\r\n return $this->validateResultURL(self::FAILED_STATUS);\r\n }", "protected function getRedirectUrl()\n {\n return null;\n }", "protected function redirectTo()\n {\n //generate URL dynamicaly .\n return '/login'; // return dynamicaly generated URL.\n }", "public function redirectAction()\n {\n $model = new KBariotis_NBP_Model_NBP();\n\n $redirectUrl = $model->getRedirectUrl();\n\n if ($redirectUrl)\n $this->_redirectUrl($redirectUrl);\n else\n $this->_redirectUrl(Mage::getUrl('checkout/onepage/failure'));\n }", "public function getRedirectUrl()\n {\n }", "public function getFailureUrl();", "public function callbackFail()\r\n {\r\n //$this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\r\n $this->redirectTo();\r\n }", "public function setRedirectToFormOnValidationError($bool)\n {\n $this->redirectToFormOnValidationError = $bool;\n return $this;\n }", "public function mustRedirect();", "abstract protected function redirectTo();", "function setFailOnAnyUrlError($fail_on_error) {\n $this->fields['fail_on_any_url_error'] = $fail_on_error;\n return $this;\n }", "function setFailOnAnyUrlError($fail_on_error) {\n $this->fields['fail_on_any_url_error'] = $fail_on_error;\n return $this;\n }", "protected function redirectTo()\n {\n\n return '/'; // return dynamicaly generated URL.\n }", "protected function setUrl() {\r\n\t\t$this->url = htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), ENT_QUOTES);\r\n\t}", "public function getFailUrl(): ?string\n {\n return $this->getParameter('failUrl');\n }", "private function setUrl(): void\n {\n $completeUrl = $_SERVER['REQUEST_URI'];\n $explodedUrl = \\explode('?', $completeUrl);\n $this->url = trim($explodedUrl[0], '/'); // Cleaned URL\n }", "protected function redirect($url)\n\t{\n\t\t$this->_redirect = $url;\n\t\t$this->_flow = PAGE_FLOW_REDIRECT;\n\t}", "public function set_response_url($url) {\n\t\tif (strpos($url, \"http://\") !== 0) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"\\$url should start with http://, $url given.\");\n\t\t}\n\t\t$this->return_url = $url;\n\t}", "public function errorStyleUrlRoute() {\n return $this->app[\"config\"]->get(\"laravel-admin::error_style_url_route\");\n }", "public function setLocation($url);", "function myErrorHandler()\n{\n header(\"Location: ../\");\n}", "abstract protected function redirect();", "public function redirect();", "public function redirect();", "public function redirect();", "public function setError($err);", "function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->redirect_url;\r\n\t}", "public function redirectTo();", "public function beforeSave()\n {\n $this->setParams([\n 'url' => $this->getValue(),\n 'apiKey' => $this->getFieldsetDataValue('api_key'),\n 'version' => $this->getFieldsetDataValue('api_version')\n ]);\n\n if (!$this->isUrl($this->getValue())) {\n throw new \\Magento\\Framework\\Exception\\ValidatorException(__('Invalid CRM url'));\n }\n\n if (!$this->isHttps($this->getValue())) {\n $this->schemeEdit($this->getValue());\n }\n\n if ($this->validateApiUrl($this->api)) {\n $this->setValue($this->getValue());\n }\n\n parent::beforeSave();\n }", "function redirect_with_errors($to, $errors)\n {\n return redirect($to)->withInput()->withErrors($errors);\n }", "function redirect_with_errors(string $to, $errors): RedirectResponse\n {\n return \\redirect($to)->withInput()->withErrors($errors);\n }", "public function redirect(): void\n {\n $this->admin->redirect($this->redirect, $this->redirectCode);\n }", "public function redirect(string $url, $status_code = 302);", "public function testErrorIsThrownIfURLIsInvalid()\n {\n self::$importer->get('invalid-google-url', now()->subYear(), now()->addYear());\n }", "function caSetRedirect($ps_url) {\n\t\tglobal $g_response;\n\t\tif(!($g_response instanceof ResponseHTTP)) { return false; }\n\n\t\t$g_response->setRedirect($ps_url);\n\t\treturn true;\n\t}", "public function redirect() {\n\n\t\t// @todo. How to handle https?\n\t\t$domain = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t$data = $this->EE->shortee->get_url($domain,$this->EE->input->get('url',true));\n\n\t\tif(!$data) {\n\t\t\t$loc = $this->EE->config->item('site_url');\n\t\t} else {\n\t\t\t$loc = $data['url'];\n\t\t\t$this->EE->shortee->log_view($data['id'],$_SERVER['REMOTE_ADDR']);\n\t\t}\n\n\t\theader(\"Location: \".$loc, true, 302);\n\t\texit;\n\t}", "public function setUrlOK($url) {\n if(!filter_var($url, FILTER_VALIDATE_URL)) {\n throw new ValueException(\"Key value \".$url.\" is incorrect\");\n }\n $this->URL_OK = $url;\n }", "function URLValidator(\n \t\t$a_str_fieldName, $a_str_errorMessage = null, $a_str_fieldValue = null,\n \t\t$_option_print_error = URL_DO_NOT_PRINT_ERRORS,\n \t\t$_option_connect = URL_DO_NOT_CONNECT_2_URL) {\n\n\n\t$this->str_fieldName = $a_str_fieldName;\n\t$this->str_fieldValue = $a_str_fieldValue;\n\t\n\t// check for null field value\n\tif($this->str_fieldValue == null)\n\t{\n\t\t$this->str_fieldValue = $this->getValueByFieldName($this->str_fieldName);\n\t}\n\n\t// check for default error message\n\tif($a_str_errorMessage == null)\n\t{\n\t\t$this->str_errorMessage = \"Invalid URL address\";\n\t}\n\telse\n\t{\n\t\t$this->str_errorMessage = $a_str_errorMessage;\n\t}\n\n\t//check the options\n\tif (!in_array($_option_print_error, array(\n\t\tURL_DO_NOT_PRINT_ERRORS,\n\t\tURL_DO_PRINT_ERRORS\n\t\t))) {\n\t\t$this->error(sprintf(\"Invalid PRINT_ERROR option [%s]\",\n\t\t\t$_option_print_error), __FILE__, __LINE__);\n\t\treturn;\n\t\t} else {\n\t\t$this->REPORTS['print_errors'] = $_option_print_error;\n\t\t}\n\tif (!in_array($_option_connect, array(\n\t\tURL_DO_NOT_CONNECT_2_URL,\n\t\tURL_DO_CONNECT_2_URL\n\t\t))) {\n\t\t$this->error(sprintf(\"Invalid CONNECT_2_URL option [%s]\",\n\t\t\t$_option_connect), __FILE__, __LINE__);\n\t\treturn;\n\t\t} else {\n\t\t$this->REPORTS['connect_to_url'] = $_option_connect;\n\t\t}\n\t\n\t//check the url\n\tif (!$a_str_fieldValue) {\n\t\t$this->error(sprintf(\"No URL provided\"), __FILE__, __LINE__);\n\t\treturn;\n\t\t} else {\n\t\t$this->url = $a_str_fieldValue;\n\t\t}\n\t}", "public function setLocation(string $url): void\n {\n if (!filter_var($url, FILTER_VALIDATE_URL)) {\n throw new UserException(\"Invalid value for header: Location\");\n }\n $this->location = $url;\n }", "public function setLocation($url = null);", "public function setRedirect($redirect){\n $this->redirect = $redirect;\n }", "public function error301($redirectURI)\n {\n }", "public function redirect()\n {\n add_settings_field(\n 'redirect',\n apply_filters($this->plugin_name . 'label-redirect', esc_html__('Redirect', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-general',\n [\n 'description' => 'Redirect requests for ' . get_site_url() . '/security.txt to ' . get_site_url() . '/.well-known/security.txt.',\n 'id' => 'redirect',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['redirect']) ? $this->options['redirect'] : false,\n ]\n );\n }", "public function redirecturl()\n\t\t\t{\n\t\t\t\tif($this->fields_arr['pcakey'])\n\t\t\t\t Redirect2URL($_SESSION['pcakey'][$this->fields_arr['pcakey']]);\n\t\t\t}", "public function getRedirectUrl() {\n return $this->redirectUrl;\n }", "public function getFormErrorPage();", "function dp_fallback_url() {\n $fallback_url = yourls_get_option( 'fallback_url' );\n\tyourls_redirect( $fallback_url, 302 ); //Use a temporal redirect in case there is a valid keyword in the future\n}", "public function errorScriptUrlRoute() {\n return $this->app[\"config\"]->get(\"laravel-admin::error_script_url_route\");\n }", "function redirect($location = ''){\n $this->_redirect = true;\n $this->_redirect_location = $location;\n $this->_HTML = false;\n $this->_JSON = false;\n }", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "abstract protected function getRedirectUrl(): Url;", "public function beforeValidate()\n\t{\n\t\t$this->url = $this->url ? $this->url : LittleBigHelper::slug($this->name);\n\n\t\treturn parent::beforeValidate();\n\t}", "public function getRedirectUrl() {\n return (string) $this->getValue('redirect_url');\n }", "public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }", "public function setRedirectDocument($value) { $this->_redirectDocument = $value; }", "protected function errorAction()\n\t{\n\t\t$this->handleTargetNotFoundError();\n\n\t\treturn $this->getFlattenedValidationErrorMessage();\n\t}", "private function redirect_to_error_page($message = array())\n\t{\n\t\t// redirect to error page\n\t\t\\Session::set_flash('error', $message);\n\t\t\\Response::redirect('admin/error');\n\t}", "public static function setServerServiceValidateURL($url = '') \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setServerServiceValidateURL($url);\t\t\n\t}", "public function initializeRedirectUrlHandlers() {}", "public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }", "public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }", "public function forbiddenError() {\n sfContext::getInstance()->getController()->redirect('errores/forbidden');\n\t}", "public function setCallbackUrl($callback_url)\n {\n if (! filter_var($callback_url, FILTER_VALIDATE_URL)) {\n throw new Exception(\"URL provided is not valid\");\n }\n\n $this->callback_url = $callback_url;\n }", "public function getRedirectUrl() : string\n {\n return '';\n }", "public function callbackFail()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\n $this->redirectTo();\n }", "public function &setExternalLoginUrl($value);", "public function showLinkRequestForm()\n {\n\t\treturn redirect('/');\n\t}", "public function setRedirect($redirect) {\n\t\t$this->redirect = $redirect;\n\t}", "function redirectToUrl($url) {\r\n redirect_to($url);\r\n }" ]
[ "0.6954889", "0.68955415", "0.6732466", "0.66135854", "0.6600891", "0.646445", "0.62752587", "0.6222175", "0.61953205", "0.61849195", "0.6177951", "0.6142614", "0.6136702", "0.6130507", "0.6129488", "0.6095145", "0.60922813", "0.60456705", "0.6026349", "0.60113174", "0.6001413", "0.59628874", "0.5863943", "0.5863943", "0.58486384", "0.5842639", "0.5819677", "0.5813531", "0.5792826", "0.5770534", "0.5736402", "0.570864", "0.57054704", "0.5689371", "0.56815386", "0.56740296", "0.5671992", "0.5660989", "0.56506443", "0.56506443", "0.56488335", "0.56450605", "0.5612245", "0.561111", "0.5608906", "0.5607166", "0.5597873", "0.5583544", "0.55727357", "0.55714357", "0.55690974", "0.55690974", "0.55690974", "0.55554473", "0.5546407", "0.5545766", "0.5541042", "0.5530132", "0.55220705", "0.5506659", "0.5500563", "0.54962933", "0.54962194", "0.54959685", "0.5495324", "0.54853636", "0.54830116", "0.5472482", "0.54652864", "0.54597414", "0.544709", "0.5446097", "0.54369646", "0.5433599", "0.5432517", "0.5431427", "0.5427073", "0.54263264", "0.54263264", "0.54263264", "0.54263264", "0.54263264", "0.541801", "0.54133224", "0.5409195", "0.5407771", "0.54074705", "0.540055", "0.53954375", "0.5388798", "0.53872705", "0.538066", "0.538066", "0.5376477", "0.5375028", "0.5369997", "0.53668845", "0.53656834", "0.5365677", "0.5361936", "0.5361106" ]
0.0
-1
Get the underlying response instance.
public function getResponse() { return $this->response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResponse()\n {\n if (is_null($this->_response)) {\n $this->_response = new Response();\n }\n return $this->_response;\n }", "protected function _getResponse() {\n\t\treturn new Response;\n\t}", "public function &getResponse() : ResponseInterface\n {\n return $this->response;\n }", "public static function getCurrentResponse() {\r\n if (self::$response == NULL) {\r\n self::$response = new self();\r\n }\r\n return self::$response;\r\n }", "protected function getResponse()\n {\n return $this->response;\n }", "public function getResponseInstance(){\n\t\treturn ControllerResponse::getInstance();\n\t}", "protected function getResponse()\n {\n return $this->response;\n }", "public function getResponseObject()\n {\n return $this->response_object;\n }", "public function getResponse() : Response\n {\n return $this->response;\n }", "public function getResponseObject()\n {\n return $this->responseObject;\n }", "public function getResponseObject()\n {\n return $this->responseObject;\n }", "public function getResponseObject()\n {\n return $this->responseObject;\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }" ]
[ "0.7851141", "0.7808749", "0.7805127", "0.78039885", "0.7633257", "0.7628721", "0.7601387", "0.7593149", "0.7553586", "0.75289524", "0.75289524", "0.75289524", "0.7505279", "0.7505279", "0.7505279", "0.7505279", "0.7505279", "0.7505279", "0.7505279", "0.7505279", "0.7505279", "0.7505279", "0.7505279", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825", "0.75037825" ]
0.0
-1
Assert that a value is a integer
public static function isInteger($value, $min = null, $max = null) { if (!is_int($value)) { throw new \InvalidArgumentException("Not an integer:" . json_encode($value)); } if ($min !== null) { if (!is_int($min)) { throw new \InvalidArgumentException("Parameter 'min' is not an int: " . json_encode($min)); } if ($value < $min) { throw new \InvalidArgumentException("Integer smaller than '$min' : $value"); } } if ($max !== null) { if (!is_int($max)) { throw new \InvalidArgumentException("Parameter 'max' is not an int: " . json_encode($max)); } if ($value > $max) { throw new \InvalidArgumentException("Integer greater than '$max' : $value"); } } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function o_isInt($value) {\n\t\t\treturn Obj::singleton()->isInt($value);\n\t\t}", "public function testInteger()\n {\n // Generate integer data.\n $data = $this->getData('integer', $this::INT_BYTES);\n\n // Integer data should all be native PHP integer type.\n $this->assertContainsOnly('integer', $data);\n\n // While it is *possible* that the integer 0 is legitimately generated in a\n // small test run (small relative to PHP_INT_MAX) it is much, much more\n // likely that seeing exactly 0 means \"infinity\" was generated by the system\n // trying to convert more bits than it can internally represent\n // (usually either 32 or 64) and then casting \"infinity\" to an integer,\n // which results in 0. Similarly, seeing the upper bounds in the data\n // probably means there's something bad going on.\n $this->assertNotContains(0, $data);\n $this->assertNotContains(PHP_INT_MAX, $data);\n }", "public static function assertIsInt( $actual, $message = '' ) {\n\t\tstatic::assertInternalType( 'int', $actual, $message );\n\t}", "public function testToValueMakeInteger()\n {\n $expected = Integer::class;\n\n $input = [\n 'type' => 'number.integer',\n 'value' => 12\n ];\n\n $sut = new Value();\n\n $result = $sut->toValue($input);\n\n $this->assertInstanceOf($expected, $result);\n }", "public static function anInteger($value) \n {\n return (is_int($value))?:false;\n }", "function isInteger ($value)\r\n{\r\n\treturn is_int ($value);\r\n}", "public function testInteger()\n {\n set_error_handler([$this->instance, 'handleError'], E_NOTICE);\n $int = $this->instance|0;\n restore_error_handler();\n\n self::assertTrue(\n is_int($int),\n 'Instance cannot be typecast to an integer'\n );\n }", "public static function assertIsInt($actual, $message = '')\n {\n static::assertInternalType('int', $actual);\n }", "function df_is_int($v):bool {return is_numeric($v) && ($v == (int)$v);}", "public static function assertIsInt(string $var_name, mixed $value): void\n {\n self::assertIsType($var_name, $value, [Type::INTEGER], Ex\\NotIntegerException::class);\n }", "public function testCastToInteger($data) {\n\t\t$this->assertTrue(is_int(Convertor::cast($data)), \"[{$data}] is not Integer\");\n\t\t$this->assertGreaterThan(0, Convertor::cast($data), \"[{$data}] is not greater than 0\");\n\t}", "static public function testInt($value) {\n\t\tstatic $useOldGoodTestInt = null;\n\n\t\tif (is_null($useOldGoodTestInt)) {\n\t\t\t$useOldGoodTestInt = !class_exists('t3lib_utility_Math');\n\t\t}\n\t\tif ($useOldGoodTestInt) {\n\t\t\t$result = t3lib_div::testInt($value);\n\t\t}\n\t\telse {\n\t\t\t$result = t3lib_utility_Math::canBeInterpretedAsInteger($value);\n\t\t}\n\t\treturn $result;\n\t}", "#[@test]\n public function integerType() {\n $this->testType(new Integer(0), 0, 0.0);\n }", "public function isInt()\n {\n return \\is_int($this->value);\n }", "public static function ensureInteger($value)\n\t{\n\t\treturn (integer)$value;\n\t}", "static public function isInt($value)\n {\n return filter_var($value, FILTER_VALIDATE_INT) !== false;\n }", "public function validIntegers() {}", "function testForInt($data)\r\n\t{\r\n\t\tif (!filter_var($data, FILTER_VALIDATE_INT) === false)\r\n\t\t{\r\n\t\t\treturn intval($data);\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\techo(\"Integer is not valid<br>\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected function isInteger($value, $rule='', $data='', $field=''){\n /*\n * 1. value should be a number\n * 2. value should be a Integer\n * 3. value should be more than 0\n */\n if(is_numeric($value) && is_int($value + 0) && ($value + 0)>0){\n return true;\n }else{\n return 'Banner ' . $field . ' must be a positive Integer.';\n }\n }", "public function testInteger() {\n $this->assertEquals(1292932, Sanitize::integer('129sdja2932'));\n $this->assertEquals(-1275452, Sanitize::integer('-12,754.52'));\n $this->assertEquals(18840, Sanitize::integer('+18#840'));\n }", "private function var_is_int($value) {\n\t\t// Returns TRUE if $value is an integer.\n\t\t// Returns FALSE otherwise.\n\t\t// This function will take any data type as input.\n \treturn ((string) $value) === ((string)(int) $value);\n\t}", "public function isInteger()\n\t{\n\t\treturn $this->identifier(\n\t\t\tfunction($val){\n\t\t\t\treturn ctype_digit($val);\n\t\t\t}, 'Is not an integer.'\n\t\t);\n\t}", "function validInt($value)\n {\n return filter_var($value, FILTER_VALIDATE_INT);\n }", "public static function isInt($value)\n {\n return (string) (int) $value === (string) $value || $value === false;\n }", "public function checkInteger(): int\n {\n if (!is_int($this->getValue())) {\n throw new TypeInvalidException('int', gettype($this->getValue()));\n }\n\n return $this->getValue();\n }", "function is_integer_val($value) {\n\treturn (!preg_match(\"/\\D/\", $value)) ? true : false;\n}", "public static function assertIsNotInt( $actual, $message = '' ) {\n\t\tstatic::assertNotInternalType( 'int', $actual, $message );\n\t}", "public function testIntegerFieldValidation()\n {\n $field = $this->table->getField('numberfour');\n\n $testVal = 1;\n $expected = 1;\n $this->assertEquals($expected, $field->getPHPValue($testVal));\n\n $testVal = 1.123;\n $this->assertEquals($expected, $field->getPHPValue($testVal));\n\n $testVal = 0;\n $expected = 0;\n $this->assertEquals($expected, $field->getPHPValue($testVal));\n }", "public static function assertIsInt(string $key, $var): void\n {\n self::assertIsType($key, $var, [self::TYPE_INTEGER]);\n }", "function isInteger($v) {\n return is_int($v) || (is_string($v) && preg_match('/^[0-9]+$/', $v));\n}", "public static function _integer($value, $field) {\n\t\treturn (bool)preg_match('/^-?[0-9]+$/', $value);\n\t}", "protected function validateInt($value) {\n if (preg_match(\"/^\\-?[0-9]+$/\", $value))\n return true;\n $this->setError(t(\"Invalid integer\"));\n return false;\n }", "function vInt( $value )\r\n\t\t{\r\n\t\t\t#return filter_var($value, FILTER_VALIDATE_FLOAT); // float\r\n\t\t\treturn filter_var( $value, FILTER_VALIDATE_INT ); # int\r\n\t\t\t\r\n\t\t}", "public function testGetDataTableIntegerDataType() {\r\n\t\t// Insert border values into database\r\n\t\t$minvalue = '-2147483648';\r\n\t\t$maxvalue = '2147483647';\r\n\t\t$this->executeQuery('insert into POTEST (UUID, INT_VALUE) values (\\'testuuid0\\','.$minvalue.')');\r\n\t\t$this->executeQuery('insert into POTEST (UUID, INT_VALUE) values (\\'testuuid1\\','.$maxvalue.')');\r\n\t\t// Extract datatable\r\n\t\t$datatable = $this->getPersistenceAdapter()->getDataTable('select INT_VALUE from POTEST order by UUID');\r\n\t\t$datamatrix = $datatable->getDataMatrix();\r\n\t\t// Check strings for correct conversion\r\n\t\t$this->assertEquals($minvalue, $datamatrix[0][0], 'Minimum integer value is not converted to string as expected.');\r\n\t\t$this->assertEquals($maxvalue, $datamatrix[1][0], 'Maximum integer value is not converted to string as expected.');\r\n\t}", "public function isInt()\n {\n return (is_numeric($this->_value) || is_int($this->_value));\n }", "public function functionCanBeInterpretedAsIntegerValidDataProvider() {}", "public static function isInt($value)\n {\n return ((string)(int)$value === (string)$value || $value === false);\n }", "#[@test]\n public function integerCast() {\n $this->assertSourcecodeEquals(\n '$i= (int)$str;',\n $this->emit('$i= (int)$str;')\n );\n }", "public function testIDIsAnInteger()\n {\n $item = new ItemChild;\n\n $this->assertIsInt($item->getID());\n }", "function rest_is_integer($maybe_integer)\n {\n }", "private static function isInteger($entry) {\n return ctype_digit(strval($entry));\n }", "function int($value)\n{\n return intval($value);\n}", "function if_not_int_throw_e($var) {\n if (!is_int($var)) {\n throw new Exception('Variable must be integer. Current value: '.$var);\n }\n}", "protected function validateInteger($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_INT) !== false;\n\t}", "public function invalidIntegers() {}", "function isInteger($value){\n\t\t$regExp =\t\"/[0-9]/\";\n\t\t$toBeTested = trim($value);\n\t\t$tested= preg_match_all($regExp, $toBeTested,$matches);\n\t\tif(count($matches[0]) != strlen($toBeTested)){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function myisint($int)\n{\n if(is_numeric($int) === TRUE){\n \n // It's a number, but it has to be an integer\n if((int)$int == $int){\n\n return TRUE;\n \n // It's a number, but not an integer, so we fail\n }else{\n \n return FALSE;\n }\n \n // Not a number\n }else{\n \n return FALSE;\n }\n}", "function isInteger ($s) {\r\n return is_integer($s);\r\n }", "function checkIfInt($checkMe){\n\tif(is_Int((int)$checkMe) == true){\n\t\treturn true;\n\t\t// an acceptable respne\n\t}else{\n\t\treturn false;\n\t}\n\t\n}", "public function testWarningsErrnoIsIntegerAndNotEmpty(): void\n {\n $value = $this->get_reflection_property_value('warnings')[0];\n\n $this->assertIsInt($value['errno']);\n $this->assertNotEmpty($value['errno']);\n }", "protected function validateInteger($attribute, $value)\n {\n return filter_var($value, FILTER_VALIDATE_INT) !== false;\n }", "public static function isInteger($int) {\n return is_int($int);\n\n }", "function validate_int() {\n # Check if the value is an integer\n if (is_int($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for integer ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Integer Value\n return intval($this->cur_val);\n }\n }", "public function isInteger(): bool\n {\n return $this->phpType === self::INTEGER;\n }", "protected final function _isValidInt($key,$value){\n\n if(!is_numeric($value) || strpos($value,'.') !== false){\n return $this->setError($key,\"`{$key}` must be a integer\");\n }//if\n\n if(!$this->_isBetweenMinAndMax($key,$value)){\n return false;\n }//if\n\n return true;\n\n }", "public function isInt(string|int|float $message): self\n {\n return $this->addMessage(new IsInt($message));\n }", "private function int ($param)\n {\n $this->type = 'int';\n $this->value = (int)$this->value;\n return true;\n }", "protected function assertIntArg(\\Closure $callback) {\n\t\t$invalidValues = array(null, '123a', new \\stdClass(), $callback, 12.3, array(1));\n\n\t\tforeach ($invalidValues as $value) {\n\t\t\ttry {\n\t\t\t\t$callback($value);\n\t\t\t\t$this->fail('Expected an InvalidArgumentException but nothing was thrown when using $value = ' . $value);\n\t\t\t} catch (\\InvalidArgumentException $e) {\n\t\t\t\t// Expected, pass!\n\t\t\t}\n\t\t}\n\t}", "private function isInt($int)\n {\n return is_numeric($int);\n }", "public static function isInteger($var, $name)\n {\n try {\n (int) $var;\n } catch (\\Exception $e) {\n throw new InvalidArgumentTypeException(gettype(123), $name);\n }\n }", "public function isIntegerInRangeRejectsOtherDataTypesDataProvider() {}", "protected function isInteger($value)\n {\n return is_numeric($value) and (string)(integer)$value === (string)$value;\n }", "public static function integer(?string $valueType = null);", "public function testQuantityTypeIsInteger()\n {\n $mosaic = new Mosaic([\n \"namespaceId\" => \"evias.sdk\",\n \"name\" => \"nem-php\"]);\n\n $attachment = new MosaicAttachment([\n \"mosaicId\" => $mosaic->toDTO(),\n \"quantity\" => \"1500\"]);\n\n $this->assertInternalType(\"int\", $attachment->quantity);\n $this->assertInternalType(\"int\", $attachment->getAttribute(\"quantity\"));\n }", "public function hasIntValue(){\n return $this->_has(2);\n }", "function is_int_val( string $str )\n {\n return is_numeric( $str ) && \\intval( $str ) == $str;\n }", "function isInteger($field, $msg, $inner=FALSE){\n\t\t$value = $this->_getValue($field);\n\t\tif(!is_integer($value)){\n\t\tif($inner==FALSE){\n $this->_errorList[] = array(\"field\" => $field,\n\t\t\"value\" => $value, \"msg\" => $msg);\n\t\treturn false;\n }else{\n return false;\n }\n\t\t\n\t\t}else{\n\t\treturn true;\n\t\t}\n\t}", "public function check()\n {\n return ctype_digit($this->value);\n }", "public function testExample()\n {\n $int = 56;\n\n $calc = Calc::create(10)->div(5)->add(3)->mult(10)->sub(4);\n\n $this->assertTrue($int, $calc->result());\n }", "public static function isInt($value)\n {\n if (is_string($value)) {\n $value = trim($value);\n }\n if (is_numeric($value)) {\n $float = (float)$value;\n $int = (int)$value;\n $is = Floating::eq($float, $int);\n return $is;\n }\n return false;\n }", "function my_is_int($var) {\n\treturn (is_numeric($var)&&(intval($var)==floatval($var)));\n}", "public function validate( $value )\n\t{\n\t\treturn (int)$value === $value;\n\t}", "function TypeCheck($i) \n{\n\n\tif (intval($i) == 0) {\n\n \t echo \"Bad String\";\n\n\t} else {\n\n echo intval($i);\n\n\t}\n}", "static function checkInteger($param) {\n \n if(isset($param) && is_numeric($param)) { \n return true;\n } else {\n return false;\n }\n }", "public function functionCanBeInterpretedAsIntegerInvalidDataProvider() {}", "public function testTypes(){\n //assertEquals(2, \"2\") will pass\n\n //assertSame is strict. 1 != \"1\"\n //$this->assertSame(\"lol\" - 2, -2); // Non numeric value error\n //$this->assertSame(\"Anything\" - 1, -1); // Non numerif value error\n $this->assertSame(\"0\" + 4, 4);\n $this->assertSame(\"0\" . 4, \"04\");\n $this->assertSame(\"0\" - 4, -4);\n $this->assertSame(\"0\" * 4, 0);\n $this->assertSame(\"0\" / 4, 0);\n //$this->assertSame(\"0\" / 0, 0); //Division by Zero exception\n //$this->assertSame(\"foo\" - \"bar\", 0); //Non numeric error\n //$this->assertNotSame(\"foo\" - \"bar\", 2); Non numeric value\n //$this->assertNotSame(\"foo\" - \"bar\", false); //Non numeric value\n //$this->assertSame(\"foo\" * \"bar\", 0); //Non numeric value\n //$this->assertSame(\"foo\" / \"bar\", 0); //Division by Zero exception\n\n }", "public function testWidthWithInteger()\n {\n $this->box->setWidth(200);\n static::assertEquals(200, $this->box->getWidth());\n }", "public function toBeInt(string $message = ''): self\n {\n Assert::assertIsInt($this->actual, $message);\n return $this;\n }", "public function validate($field, $value) {\n if (! empty($value) && ($value != '')) {\n if ((! is_numeric($value)) || (is_numeric($value) && (floatval($value) != intval($value)))) {\n throw new \\fwk\\exceptions\\InvalidInput(sprintf(_('%s should be a valid int'), $field));\n }\n }\n return true;\n }", "function sanitize_int( $value, $key, array $data ) {\n\treturn (int) $value;\n}", "protected function isint($field, $err_msg){\n if(!is_numeric($field)){\n throw new Exception($err_msg);\n }\n }", "public function integer($int) {\n if (is_numeric($int)):\n return TRUE;\n else:\n return FALSE;\n endif;\n }", "function getInteger($input) : int {\n return $input;\n}", "function sugar_valid_int($value, $min=1, $max=65535) {\n $options = array(\n 'options' => array(\n 'min_range' => $min,\n 'max_range' => $max,\n ),\n );\n return filter_var($value, FILTER_VALIDATE_INT, $options);\n}", "public function testSetAndRetrieveInteger(): void\n {\n $key = \"A test key\";\n $expected = 27;\n $this->testNotStrict->set($key, $expected);\n $actual = $this->testNotStrict->get($key);\n $this->assertEquals($expected, $actual);\n }", "function is_num($arg){ \n\tif (!(int)$arg) {\n\treturn false ;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "public function testGetMultipleInvalidTypeInteger(): void\n {\n $keyValuePairs = 978;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public function testConfidenceNotAnInteger()\n {\n new Text('Foo bar', 'foo');\n }", "function o_castInt($value) {\n\t\t\treturn Obj::singleton()->castInt($value);\n\t\t}", "public function testInteger()\r\n {\r\n $s = new XML_Serializer();\r\n $s->serialize(456223);\r\n $this->assertEquals('<integer>456223</integer>', $s->getSerializedData());\r\n $s->serialize(-34);\r\n $this->assertEquals('<integer>-34</integer>', $s->getSerializedData());\r\n $s->serialize(0);\r\n $this->assertEquals('<integer>0</integer>', $s->getSerializedData());\r\n }", "public function testSaveDataTableIntegerDataType() {\r\n\t\t$minvalue = '-2147483648';\r\n\t\t$maxvalue = '2147483647';\r\n\t\t// Store datatable\r\n\t\t$datatable = new avorium_core_data_DataTable(2, 2);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'INT_VALUE');\r\n\t\t$datatable->setCellValue(0, 0, 'testuuid0');\r\n\t\t$datatable->setCellValue(0, 1, $minvalue);\r\n\t\t$datatable->setCellValue(1, 0, 'testuuid1');\r\n\t\t$datatable->setCellValue(1, 1, $maxvalue);\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t\t// Read database via SQL\r\n\t\t$results = $this->executeQuery('select INT_VALUE from POTEST order by UUID');\r\n\t\t// Compare values\r\n\t\t$this->assertEquals($minvalue, $results[0][0], 'Minimum integer value is not converted from string as expected.');\r\n\t\t$this->assertEquals($maxvalue, $results[1][0], 'Maximum integer value is not converted from string as expected.');\r\n\t}", "public static function valid_positive_integer($value){\n\t\treturn preg_match('@^[0-9]+$@',$value) === 1;\n\t}", "protected function validate(int $value): void\n {\n }", "function get_int($value) {\n return is_numeric($value) && !preg_match('/x/i', $value) ? $value : '0';\n}", "public function test_integer() {\n $schema_table_definition = new Schema_Table_Definition('table_name');\n $schema_table_definition->integer('column_name', array( 'option' => 'here' ));\n \n $this->assert_equal($schema_table_definition->columns(), array(\n 'column_name' => array('type' => 'INT', 'option' => 'here'))\n );\n }", "public static function int() {}", "public function testPrecedenceIsInteger()\n {\n foreach ( $this->operators as $operator )\n {\n self::assertThat( $operator->precedence, self::isType( 'integer' ), \"Precendence for operator <\" . get_class( $operator ) . \"> must be an integer.\" );\n }\n }", "#[@test]\n public function selectInteger() {\n $this->assertEquals(1, $this->db()->query('select 1 as value')->next('value'));\n }", "public static function validateInteger(TextBase $control)\r\n\t{\r\n\t\tforeach ($control->getValue() as $tag) {\r\n\t\t\tif (!Strings::match($tag, '/^-?[0-9]+$/')) {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn TRUE;\r\n\t}", "protected function validateUint($value) {\n if (preg_match(\"/^[0-9]+$/\", $value))\n return true;\n $this->setError(t(\"Invalid positive integer\"));\n return false;\n }" ]
[ "0.76404744", "0.73373735", "0.72822654", "0.72496456", "0.72393894", "0.7191699", "0.717144", "0.7157355", "0.7152943", "0.7133855", "0.71289515", "0.697651", "0.6931286", "0.6880131", "0.68589467", "0.685552", "0.6839575", "0.6831767", "0.679716", "0.6782992", "0.67142475", "0.66537607", "0.66514623", "0.6644435", "0.66185534", "0.66007924", "0.6596276", "0.65763754", "0.65464705", "0.65150154", "0.651331", "0.6499903", "0.6499167", "0.6496391", "0.6492211", "0.64890516", "0.6482698", "0.6469376", "0.6469367", "0.6425639", "0.6421581", "0.64039695", "0.6337106", "0.6327212", "0.6321555", "0.6304424", "0.6289359", "0.62773275", "0.6277023", "0.62587774", "0.6254263", "0.62204957", "0.621637", "0.620045", "0.6187515", "0.6167197", "0.6143991", "0.61140436", "0.6091494", "0.6088709", "0.6064489", "0.6032579", "0.60292846", "0.6008228", "0.60067415", "0.60023683", "0.59890723", "0.59848934", "0.5980575", "0.5979422", "0.5971665", "0.5968798", "0.59510463", "0.59505683", "0.594158", "0.592652", "0.59091955", "0.58918816", "0.5890913", "0.58905673", "0.58823687", "0.58815956", "0.58765703", "0.5870087", "0.58677334", "0.5860963", "0.58543885", "0.5852562", "0.5851593", "0.58450925", "0.58439595", "0.5839936", "0.5828281", "0.5820649", "0.5808339", "0.5791173", "0.578488", "0.5781131", "0.5766346", "0.5747676" ]
0.58624303
85
Assert that a value is a float
public static function isFloat($value, $min = null, $max = null) { if (!is_float($value)) { throw new \InvalidArgumentException("Not an float:" . json_encode($value)); } if ($min !== null) { if (!(is_int($min) || is_float($min))) { throw new \InvalidArgumentException("Parameter 'min' is not an int or float: " . json_encode($min)); } if ($value < $min) { throw new \InvalidArgumentException("Float smaller than '$min' : $value"); } } if ($max !== null) { if (!(is_int($max) || is_float($max))) { throw new \InvalidArgumentException("Parameter 'max' is not an int or float : " . json_encode($max)); } if ($value > $max) { throw new \InvalidArgumentException("Float greater than '$max' : $value"); } } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function aFloat($value)\n {\n return (is_float($value))?:false;\n }", "function o_isFloat($value) {\n\t\t\treturn Obj::singleton()->isFloat($value);\n\t\t}", "public static function assertIsFloat( $actual, $message = '' ) {\n\t\tstatic::assertInternalType( 'float', $actual, $message );\n\t}", "public function testRandomFloat()\n {\n $initial_value = random_float();\n \n $this->assertInternalType('float', $initial_value);\n }", "public static function ensureFloat($value)\n\t{\n\t\treturn (float)$value;\n\t}", "public function checkFloat($value)\n {\n return $this->checkHasType($value, 'double');\n }", "public function testFloat()\n {\n set_error_handler([$this->instance, 'handleError'], E_NOTICE);\n $float = $this->instance+.0;\n restore_error_handler();\n\n self::assertTrue(\n is_float($float),\n 'Instance cannot be typecast to a float'\n );\n }", "public function validFloats() {}", "public function testFloat()\n {\n $float = (float) 13.54;\n $this->assertSame($float, $this->_filter->filter($float));\n }", "#[@test]\n public function floatType() {\n $this->testType(new Float(0), 0, 0.0);\n }", "function validFloat($value)\n {\n return filter_var($value, FILTER_VALIDATE_FLOAT);\n }", "public function testCastToFloat($data) {\n\t\t$this->assertTrue(is_float(Convertor::cast($data)), \"[{$data}] is not Float\");\n\t\t$this->assertGreaterThan(0, Convertor::cast($data), \"[{$data}] is not greater than 0\");\n\t}", "public function checkFloat(): float\n {\n if (!is_float($this->getValue())) {\n throw new TypeInvalidException('float', gettype($this->getValue()));\n }\n\n return $this->getValue();\n }", "function validate_float() {\n # Check if the value is a foat\n if (is_float($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error( \"Validation for float ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Float Value\n return floatval($this->cur_val);\n }\n }", "public static function is_float($value)\n {\n return is_numeric($value) && (null !== str($value)->indexOf('.'));\n }", "public function float()\n {\n $floatFilter = new stubFloatFilter();\n $this->assertSame($floatFilter, $floatFilter->setDecimals(2));\n $this->assertEquals(156, $floatFilter->execute('1.564'));\n }", "public function testFloat() {\n $this->assertEquals(100.25, Sanitize::float('1array(0)0.25'));\n $this->assertEquals(-125.55, Sanitize::float('-abc125.55'));\n $this->assertEquals(1203.11, Sanitize::float('+1203.11'));\n }", "private function validateFloat($value)\n {\n return $this->validateDecimal($value, ValidatorHandler::VALUE_TYPE_IS_NOT_FLOAT);\n }", "protected function validateFloat($attribute, $value)\n {\n return filter_var($value, FILTER_VALIDATE_FLOAT) !== false;\n }", "protected function validateFloat($value) {\n if (preg_match(\"/^\\-?[0-9]+\\.?[0-9]*$/\", $value))\n return true;\n $this->setError(t(\"Invalid decimal number\"));\n return false;\n }", "protected function validateUfloat($value) {\n if (preg_match(\"/^[0-9]+\\.?[0-9]*$/\", $value))\n return true;\n $this->setError(t(\"Invalid positive decimal number\"));\n return false;\n }", "function is_float(mixed $var): bool\n{\n return php_is_float($var);\n}", "public function invalidFloats() {}", "public function isFloat(): bool\n {\n return $this->phpType === self::FLOAT;\n }", "public static function float() {}", "private function float ($param)\n {\n $this->type = 'float';\n $this->value = (float)$this->value;\n return true;\n }", "function isFloat($field, $msg, $inner=FALSE){\n\t\t$value = $this->_getValue($field);\n\t\tif(!is_float($value)){\n\t\tif($inner==FALSE){\n $this->_errorList[] = array(\"field\" => $field,\n\t\t\"value\" => $value, \"msg\" => $msg);\n\t\treturn false;\n }else{\n return false;\n }\n\t\t\n\t\t}else{\n\t\treturn true;\n\t\t}\n\t}", "protected final function _isValidFloat($key,$value){\n\n if(!is_numeric($value)){\n return $this->setError($key,\"`{$key}` must be numeric\");\n }//if\n\n if(!$this->_isBetweenMinAndMax($key,$value)){\n return false;\n }//if\n\n return true;\n\n }", "public function functionCanBeInterpretedAsFloatValidDataProvider() {}", "public static function assertIsNotFloat( $actual, $message = '' ) {\n\t\tstatic::assertNotInternalType( 'float', $actual, $message );\n\t}", "public static function isFloat($string) {\n return is_float($string);\n\n }", "public static function float(?string $valueType = null);", "public function testSetAndRetrieveFloat(): void\n {\n $key = \"A test key\";\n $expected = 7.234;\n $this->testNotStrict->set($key, $expected);\n $actual = $this->testNotStrict->get($key);\n $this->assertEquals($expected, $actual);\n }", "function o_castFloat($value) {\n\t\t\treturn Obj::singleton()->castFloat($value);\n\t\t}", "#[@test]\n public function selectFloat() {\n $this->assertEquals(0.5, $this->db()->query('select 0.5 as value')->next('value'));\n }", "public static function filterFloat($attrValue)\n\t{\n\t\treturn filter_var($attrValue, FILTER_VALIDATE_FLOAT);\n\t}", "private function assertIsValidAmount(float $value)\n {\n return 0 <= $value;\n }", "public static function validateFloat(TextBase $control)\r\n\t{\r\n\t\tforeach ($control->getValue() as $tag) {\r\n\t\t\tif (!Strings::match($tag, '/^-?[0-9]*[.,]?[0-9]+$/')) {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn TRUE;\r\n\t}", "private static function toFloat($value)\n {\n return (float) $value;\n }", "function isValidFloat($var) {\n //Returns error message for an invalid float string\n\n //Check for unsafe characters\n $msg = isSantizeString($var);\n if ($msg != \"\") {\n return $msg;\n }\n\n if (filter_var($var, FILTER_VALIDATE_FLOAT)) {\n return \"\";\n } else {\n return \"Invalid Floating Number\";\n }\n}", "public function testGetMultipleInvalidTypeFloat(): void\n {\n $keyValuePairs = 97.8;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public static function sanitize_float( $value ) {\n\t\tif ( empty( $value ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );\n\t}", "function toFloat ($value) {\n assert(count(func_get_args()) == 1);\n if (is_scalar($value)) {\n $convertedValue = filter_var($value, FILTER_VALIDATE_FLOAT, FILTER_NULL_ON_FAILURE);\n if ($convertedValue !== null)\n return $convertedValue;\n }\n if (is_object($value) && hasMember($value, 'toFloat'))\n return toFloat($value->toFloat());\n throw new RuntimeException('Unable to convert to float.');\n}", "public function toBeFloat(string $message = ''): self\n {\n Assert::assertIsFloat($this->actual, $message);\n return $this;\n }", "public function testSetMultipleInvalidTypeFloat(): void\n {\n $keyValuePairs = 51.50;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->setMultiple($keyValuePairs);\n }", "public function isIntOrFloat($value)\n {\n return (is_int($value) || is_float($value));\n }", "public function testInvokeReturnsTrueIfFloatsAreEqual()\n\t{\n $this->assertTrue((new AlmostEquals())(1/10, 0.1));\n \n return;\n\t}", "function float_check($var) {\n\tif ( is_numeric($var) )\n\t\treturn $var;\n\treturn null;\n}", "public function float()\n\t{\n\t\treturn $this->filter(FILTER_SANITIZE_NUMBER_FLOAT);\n\t}", "public function testStringToFloat()\n {\n $locale = localeconv();\n $string = \"13{$locale['decimal_point']}543\";\n $this->assertSame(13.543, $this->_filter->filter($string));\n }", "public function fromFloat($value)\n {\n switch ((string) $value) {\n case 'Infinity':\n return INF;\n case '-Infinity':\n return -INF;\n case 'NaN':\n return NAN;\n default:\n return (float) $value;\n }\n }", "public static function isFloat($float)\n {\n return strval((float) $float) == strval($float);\n }", "public function functionCanBeInterpretedAsFloatInvalidDataProvider() {}", "function valid_float($value, $min = NULL, $max = NULL)\n {\n $valid = (is_float($value) OR (is_numeric($value) && floatval($value) == $value));\n \n // If no bounds have been set, we're done.\n if ( ! $valid OR (is_null($min) && is_null($max)))\n {\n return $valid;\n }\n \n $min = is_null($min) ? -INF : (valid_float($min) ? floatval($min) : -INF);\n $max = is_null($max) ? INF : (valid_float($max) ? floatval($max) : INF);\n \n $value = floatval($value);\n $real_min = min($min, $max);\n $real_max = max($min, $max);\n \n return $valid && (min(max($value, $real_min), $real_max) === $value);\n }", "public function scrubFloat(float $data) : float;", "public function value()\n {\n $floatFilter = new stubFloatFilter();\n $this->assertSame($floatFilter, $floatFilter->setDecimals(3));\n $this->assertEquals(8453, $floatFilter->execute('8.4533'));\n $this->assertEquals(8453, $floatFilter->execute('8.4538'));\n $this->assertEquals(8450, $floatFilter->execute('8.45'));\n $this->assertEquals(8000, $floatFilter->execute('8'));\n $this->assertEquals(8453, $floatFilter->execute(8.4533));\n $this->assertEquals(8453, $floatFilter->execute(8.4538));\n $this->assertEquals(8450, $floatFilter->execute(8.45));\n $this->assertEquals(8000, $floatFilter->execute(8));\n }", "public function testSetAmountWithProblematicFloat()\n {\n $amounts = array (\n 0 => 1.8,\n 1 => 11.0,\n 2 => 18.3,\n 3 => 2.3,\n 4 => 7.0,\n 5 => 10.2,\n 6 => 7.6,\n 7 => 2.3,\n 8 => 7.0,\n 9 => 6.4,\n 10 => 1.8,\n 11 => 2.6,\n 12 => 15.5,\n 13 => 1.8,\n 14 => 7.6,\n 15 => 8.7,\n 16 => 5.6,\n 17 => 7.6,\n 18 => 5.4,\n 19 => 3.1,\n 20 => 10.8,\n 21 => 2.6,\n 22 => 2.6,\n 23 => 6.5,\n 24 => 10.2,\n 25 => 47.0,\n 26 => 3.1,\n 27 => 2.6,\n );\n\n $total = 0.0;\n foreach ($amounts as $amount) {\n $total += $amount;\n }\n\n $this->assertSame(218, (int)$total);\n\n $this->slipData->setAmount($total);\n\n $this->assertSame(219, $this->slipData->getAmountFrancs());\n $this->assertSame('00', $this->slipData->getAmountCents());\n }", "static public function Float($var, $flags = null) {\r\n\r\n\t\t$cleaned = filter_var($var, FILTER_SANITIZE_NUMBER_FLOAT, $flags);\r\n\t\treturn $cleaned == \"\" ? false : (float)$cleaned;\r\n\r\n\t}", "function floatval($var)\n{\n}", "public function setFloat(string $key, float $value, int $ttl = 0): bool;", "public static function readFloat()\n {\n $res = filter_var(self::readLine(), FILTER_VALIDATE_FLOAT);\n \n if($res === false)\n throw new Exception(\"valor invalido\");\n \n return $res;\n }", "public function testIntToFloat()\n {\n $int = (int) 5;\n $this->assertSame((float) 5, $this->_filter->filter($int));\n }", "public static function isFloat($float)\n {\n return strval((float)$float) == strval($float);\n }", "public function convertValue($value) {\n $floatValue = floatval($value);\n if ($floatValue === 0.0 && $value !== '0' && $value !== '0.0') {\n throw new InvalidParameterValueException();\n }\n return $floatValue;\n }", "public function getFNumber(): ?float {\n $val = $this->getBackingStore()->get('fNumber');\n if (is_null($val) || is_float($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'fNumber'\");\n }", "public function WriteValueFloat(string $ident, float $value)\n {\n if (!is_float($value)) {\n trigger_error($this->Translate(\"Value is not float\"), E_USER_NOTICE);\n return false;\n }\n return $this->WriteValue($ident, (float)$value);\n }", "public function float($name, $displayName = null)\n {\n if (trim($this->data[$name]) != ''\n && !filter_var($this->data[$name], FILTER_VALIDATE_FLOAT)\n ) {\n if (!($this->data[$name] == \"0\")) {\n $this->errors->add(\n '<b>' .\n $this->displayName($name, $displayName) .\n '</b> must be a decimal number.'\n );\n return false;\n }\n }\n return true;\n }", "public function hasFloatField()\n {\n return $this->get(self::FLOAT_FIELD) !== null;\n }", "function testpresentValueException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::presentValue(0.29, -7, 100);\n\t}", "public function floatValue($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public static function isFloat($floatInput, array $hashOptions = array())\n {\n $floatMin = isset($hashOptions['min']) ? (int) $hashOptions['min'] : null;\n $floatMax = isset($hashOptions['max']) ? (int) $hashOptions['max'] : null;\n return self::validateNumber($floatInput, 'is_float', $floatMin, $floatMax);\n }", "public function float($prompt = 'Float', $message = 'Please enter a floating-point decimal.') {\n return $this->text($prompt, function($result) { \n return filter_var($result, FILTER_VALIDATE_FLOAT); \n }, $message);\n }", "public function testCalculateFloatInput()\n {\n $calc = new ReversePolishCalculator();\n $calc\n ->enter(1.5)\n ->enter(1.5)\n ->add()\n ;\n\n $this->assertEquals([3], $calc->getStack());\n }", "public static function isFloatingPoint($type) {\n\t\treturn ($type == 'float' || $type == 'double' || $type == 'decimal');\n\t}", "public function testWidthWithFloat()\n {\n $this->box->setWidth(200.10);\n static::assertEquals(200, $this->box->getWidth());\n }", "#[@test]\n public function selectFloatOne() {\n $this->assertEquals(1.0, $this->db()->query('select 1.0 as value')->next('value'));\n }", "function testpresentValueException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::presentValue(0.29, 7, 100, 0, 3);\n\t}", "public static function assertFinite( $actual, $message = '' ) {\n\t\tstatic::assertTrue( \\is_finite( $actual ), $message );\n\t}", "public function setFloatField($value)\n {\n return $this->set(self::FLOAT_FIELD, $value);\n }", "public function testInvokeReturnsFalseIfFloatsAreNotEqual()\n {\n $this->assertFalse((new AlmostEquals())(0.2, 0.7));\n \n return;\n\t}", "public function validFloatProvider() {\n\t\treturn [\n\t\t\t\"string 12.34\"\t=> [\"12.34\"],\n\t\t\t\"float 12.34\"\t=> [12.34]\n\t\t];\n\t}", "function testfutureValueException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::futureValue(0.29, -7, 100);\n\t}", "#[@test]\n public function selectFloatZero() {\n $this->assertEquals(0.0, $this->db()->query('select 0.0 as value')->next('value'));\n }", "public function putFloat(string $name, ?float $value): string;", "function testfutureValueException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::futureValue(0.29, 7, 100, 0, 3);\n\t}", "function is_float_problem() {\n $num1 = 2009010200.01;\n $num2 = 2009010200.02;\n\n return ((string)$num1 === (string)$num2 or $num1 === $num2 or $num2 <= (string)$num1);\n}", "public static function isValueValid($value) : bool\n {\n if (! is_float($value)) {\n return false;\n }\n \n return $value >= 0;\n }", "function sanitize_float( $value, $key, array $data ) {\n\treturn (float) $value;\n}", "public function testSetAmountWithAnotherProblematicFloat()\n {\n $total = 114.9984;\n\n $this->assertSame(114, (int)$total);\n\n $this->slipData->setAmount($total);\n\n $this->assertSame(115, $this->slipData->getAmountFrancs());\n $this->assertSame('00', $this->slipData->getAmountCents());\n }", "function float_or_null($f) {\n return $f === null ? null : (float) $f;\n}", "public static function isValueValid($value) : bool\n {\n if (! is_float($value)) {\n return false;\n }\n \n if ($value < -90. || $value > 90.) {\n return false;\n }\n \n // $digits = explode(\".\", (string)(float)$value);\n // var_dump($digits[1] ?? '');\n \n return true;\n }", "private function assertIsValidPercentage(float $value)\n {\n return 0 <= $value && Reduction::MAX_ALLOWED_PERCENTAGE >= $value;\n }", "public function float($value) : float|array\n\t{\n\t\treturn $this->handlers->map($value, function ($value) {\n\t\t\treturn (float)$value;\n\t\t});\n\t}", "public function toFloat(): float\n {\n return (float) $this->getValue();\n }", "public function float($value)\n {\n $bytes = pack('f*', $value);\n if ($this->isBigEndian()) {\n $bytes = strrev($bytes);\n }\n $this->write($bytes, 4);\n }", "function sanitize_floats($value)\n{\n return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n}", "public static function check($value, array $requirements = array())\n {\n $res = filter_var($value, FILTER_VALIDATE_FLOAT);\n\n // Check value is float type\n if ($res === false) {\n throw new InvalidDataTypeException(\"value must be a float\");\n }\n\n // Cast as float and check if value meets the requirements\n $value = (float) $value;\n\n // Minimum value\n if (isset($requirements['min']) && $value < $requirements['min']) {\n $error = 'value must be greater than or equal to '.$requirements['min'];\n\n if (isset($requirements['max'])) {\n $error .= ' and less than or equal to '.$requirements['max'];\n }\n\n throw new InvalidDataValueException($error);\n // Maximum value\n } elseif (isset($requirements['max']) && $value > $requirements['max']) {\n $error = 'value must be less than or equal to '.$requirements['max'];\n\n if (isset($requirements['min'])) {\n $error .= ' and greater than or equal to '.$requirements['min'];\n }\n\n throw new InvalidDataValueException($error);\n }\n\n return $value;\n }", "function readFloat();", "public function float()\n {\n if (!is_float($this->value)) {\n throw new InvalidFloatException($this->name, $this->value);\n }\n\n return $this;\n }", "public function isFloatingPointType($type)\n {\n return $this->source->isFloatingPointType($type);\n }" ]
[ "0.80622", "0.79303616", "0.7676855", "0.76667655", "0.76324576", "0.76309997", "0.760839", "0.7608327", "0.7578361", "0.75453335", "0.74983776", "0.7390214", "0.7355064", "0.7349988", "0.733766", "0.7324791", "0.7294238", "0.72372735", "0.72193015", "0.7198567", "0.710279", "0.7002401", "0.6973462", "0.6952631", "0.6913548", "0.6897588", "0.6879183", "0.687763", "0.6843401", "0.68219584", "0.6815503", "0.6729628", "0.6729084", "0.6654207", "0.66098446", "0.660874", "0.6598571", "0.65975106", "0.6582677", "0.6551843", "0.65317625", "0.6513182", "0.6478601", "0.64670134", "0.64578736", "0.6433794", "0.64199036", "0.64091206", "0.6335753", "0.6322598", "0.63214636", "0.63157445", "0.63145965", "0.63081515", "0.63068116", "0.6302332", "0.6295489", "0.62811434", "0.6276043", "0.6274596", "0.6269799", "0.62658644", "0.6265827", "0.6213524", "0.62078923", "0.6197178", "0.619492", "0.6193967", "0.61889666", "0.6165338", "0.6162768", "0.61622405", "0.61569023", "0.6155984", "0.61504894", "0.6134097", "0.61335826", "0.6132724", "0.61222064", "0.61098903", "0.61050946", "0.61020935", "0.609116", "0.60894096", "0.6063952", "0.6051266", "0.6047395", "0.6046715", "0.6045579", "0.60126334", "0.60053074", "0.59547955", "0.59303755", "0.5923207", "0.592133", "0.58821857", "0.58819735", "0.5865685", "0.58638316", "0.58607185" ]
0.6743706
31
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 authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\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 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 isAuth()\n {\n return $this->session->hasAuthorisation();\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 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 isAuthorized() {\n\t\t\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 if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\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()\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 // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\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.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'nama' => 'required|string', 'email' => 'required|unique:companies,email', 'website' => 'required', 'alamat' => 'required', 'logo' => 'required|mimes:png|dimensions:min_width=100,min_height=200|max:2000', ]; }
{ "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 }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $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 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 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 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 $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 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 '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 }", "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 // 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 }", "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\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "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 {\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 getValidationRules() : array;", "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 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 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\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 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 }", "protected function get_validation_rules()\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 }", "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 defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\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.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Returns a flatten collection of existing Registry traps' data items from top to bottom. Bubbling used (if any key has null value then if it is an existing key with the same name in one of the lower levels, lower leveled value WILL overwrites the higher leveled null value if a key has not null value in the higher level then use that value in the result for that key instead).
public function &__invoke() { $result = new stdClass(); Adhoc::eachTrap('Registry', function ($trap) use (&$result) { $data =& $trap->GetList(); foreach ($data as $k=>$v) { if (!isset($result->$k) and isset($v)) { $result->$k = $v; } } } ); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFlattenItems()\n {\n return $this->items()->active()->where('is_active', 1)->defaultOrder()->get()->toFlatTree();\n }", "public function flatten()\n {\n $output = [];\n foreach (I($this->hash) as $value) {\n $array = __PRIVATE__::getArrayFrom($value);\n $output[] = $array !== null\n ? $array\n // Because of self::getArrayFrom, this will ALWAYS throw its error\n : __CONTRACT__::contentIsA(FoldableInterface::class, $value);\n }\n return static::from(call_user_func_array('array_merge', $output));\n }", "public abstract function flatten(bool $preserveKeys = false): ArrayMap;", "public function stack() {\n $out = array();\n foreach ($this as $k => $v) $out[$k] = $v;\n return $out;\n }", "public function flatItems()\n {\n $result = [];\n\n foreach ($this->items as $k => $item) {\n if (! $item->subItems->isEmpty()) {\n $result[$k] = $item;\n $result = array_merge($result, $this->getArrayableItems($item->subItems));\n\n continue;\n }\n\n $result[$k] = $item;\n }\n\n return new static($result);\n }", "protected function migrateEntryOrderToStructure()\n {\n $tree = collect($this->entryOrder)\n ->sortKeys()\n ->values()\n ->map(function ($id) {\n return ['entry' => $id];\n })\n ->all();\n\n return [\n 'max_depth' => 1,\n 'tree' => $tree,\n ];\n }", "public function flatten() {}", "public function flatten() {}", "function md_flatten_keys($a, $lvl = 0){\n\tif(!is_array($a)) return $a;\n\t$b = array();\n\tforeach($a as $k => $v){\n\t\t$b[$k] = $lvl;\n\t\tif(is_array($v)) $b += md_flatten_keys($v, $lvl+1);\n\t}\n\treturn $b;\n}", "public function flatten();", "public function flatten();", "public function flatten();", "public function flattenLeft();", "protected static function _flatten($results, $key = null)\n {\n $stack = [];\n foreach ($results as $k => $r) {\n $id = $k;\n if (!is_null($key)) {\n $id = $key;\n }\n if (is_array($r) && !empty($r)) {\n $stack = array_merge($stack, self::_flatten($r, $id));\n } else {\n $stack[] = ['id' => $id, 'value' => $r];\n }\n }\n return $stack;\n }", "protected function toArrayRecursive($data)\n {\n if (is_array($data) || is_object($data)) {\n $result = [];\n foreach ($data as $key => $value) {\n if ($key === \"mappingClasses\") {\n continue;\n }\n if (is_object($value) && method_exists($value, \"getAll\")) {\n $result[$key] = $this->toArrayRecursive($value->getAll());\n } else {\n if ($value !== null) {\n $result[$key] = $this->toArrayRecursive($value);\n }\n }\n }\n return $result;\n }\n return $data;\n }", "public function getHaystack()\n {\n return array_unique(\n array_merge(parent::getHaystack(), $this->getExtraHaystack())\n );\n }", "public function toArray()\n {\n if ($this->isEmpty()) {\n return array();\n }\n\n $imploded = array();\n $current = $this->bottom();\n\n while ($current) {\n $imploded[$current->getKey()] = $current->getValue();\n $current = $current->getAfter();\n }\n\n return $imploded;\n }", "public function flatten(): array\n {\n return [\n 'id' => $this->ID,\n 'title' => $this->Title,\n 'location' => $this->Location,\n 'region' => $this->Region,\n 'bucket' => $this->Bucket,\n 'key' => $this->Key,\n 'etag' => $this->ETag,\n 'name' => $this->Name,\n 'size' => $this->getSizeForHuman(),\n 'type' => $this->Type\n ];\n }", "public function getRootEntries();", "public function collapseAll()\n {\n foreach ($this->_tree as $key => $val) {\n if ($key !== self::BASE_ELT) {\n $this->collapse($val['v']);\n }\n }\n }", "function inflate($list){\n $r = array();\n $flat = array();\n foreach($list as $val)\n {\n $flat[$val['id']] = $val;\n }\n foreach($list as $val)\n {\n if(!isset($flat[$val['parent']])) {\n $r[$val['id']] = &$flat[$val['id']];\n }\n else {\n if(!isset($flat[$val['parent']]['children'])) $flat[$val['parent']]['children'] = array();\n $flat[$val['parent']]['children'][] = &$flat[$val['id']];\n }\n }\n return $r;\n}", "protected function flatten($array)\n {\n $levelResults = array();\n $results = array();\n \n // Loops through level values, where an array or object flattens the next level,\n // where values applies these to the level results.\n foreach ($array as $key => $value) {\n if (is_array($value) or is_object($value)) {\n $temp = self::flatten((array)$value);\n $results = array_merge($temp, $results);\n } else {\n if (gettype($value) == 'boolean') {\n $levelResults[$key] = (($value) ? 'true' : 'false');\n } else {\n $levelResults[$key] = (string)$value;\n }\n }\n }\n \n // Copies higher level values onto lower levels so that the array remains 2 dimensional.\n // Will duplicate the values over multiple rows should this happen.\n if (count($levelResults) > 0 and count($results) > 0) {\n $resultsCount = count($results);\n for ($i = 0; $i < $resultsCount; $i ++) {\n foreach ($levelResults as $key => $value) {\n $results[$i][$key] = $value;\n }\n }\n } else if (count($results) == 0 and count($levelResults) > 0) {\n $results[] = $levelResults;\n }\n \n return $results;\n }", "public function flatten(string $prefix = null): array\n {\n $result = [];\n\n $data = $this->get($prefix);\n\n foreach ($data as $itemKey => $value) {\n $nextKey = is_null($prefix) ? $itemKey : $prefix . $this->delimiter . $itemKey;\n\n if (is_array($value)) {\n $result[] = $this->flatten($nextKey);\n } else {\n $result[] = [$nextKey => $value];\n }\n }\n\n return array_merge(...$result);\n }", "protected function unflatten( $messages ) {\n\t\t$array = array();\n\t\tforeach ( $messages as $key => $value ) {\n\t\t\t$plurals = $this->unflattenPlural( $key, $value );\n\n\t\t\tif ( $plurals === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( $plurals as $key => $value ) {\n\n\t\t\t\t$path = explode( '.', $key );\n\t\t\t\tif ( count( $path ) == 1 ) {\n\t\t\t\t\t$array[$key] = $value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$pointer = &$array;\n\t\t\t\tdo {\n\t\t\t\t\t/**\n\t\t\t\t\t * Extract the level and make sure it exists.\n\t\t\t\t\t */\n\t\t\t\t\t$level = array_shift( $path );\n\t\t\t\t\tif ( !isset( $pointer[$level] ) ) {\n\t\t\t\t\t\t$pointer[$level] = array();\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Update the pointer to the new reference.\n\t\t\t\t\t */\n\t\t\t\t\t$tmpPointer = &$pointer[$level];\n\t\t\t\t\tunset( $pointer );\n\t\t\t\t\t$pointer = &$tmpPointer;\n\t\t\t\t\tunset( $tmpPointer );\n\n\t\t\t\t\t/**\n\t\t\t\t\t * If next level is the last, add it into the array.\n\t\t\t\t\t */\n\t\t\t\t\tif ( count( $path ) === 1 ) {\n\t\t\t\t\t\t$lastKey = array_shift( $path );\n\t\t\t\t\t\t$pointer[$lastKey] = $value;\n\t\t\t\t\t}\n\t\t\t\t} while ( count( $path ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $array;\n\t}", "public function flatten() {\n\t\t$this->_value = Hash::flatten($this->_value);\n\n\t\treturn $this;\n\t}", "function gemini_migrate_d5_menu_flat($menu) {\n $a = array();\n foreach($menu as $m) {\n $b = array(\n 'mid' => $m->mid,\n 'pid' => $m->pid,\n 'path' => $m->path,\n 'title'=> $m->title,\n 'weight' => $m->weight,\n 'type' => $m->type\n );\n\n array_push($a, $b);\n }\n\n // Create entry for Navigation as it doesn't exist in the the DB\n $a[] = array(\n 'mid' => '1',\n 'pid' => '0',\n 'path' => '',\n 'title'=> 'Navigation',\n 'weight' => '0',\n 'type' => '118'\n );\n return $a;\n}", "public function toArray() {\n\t\t$array = [];\n\t\t$sorter = function($value, $key) use(&$array) {\n\t\t\tif($value instanceof NodeList) {\n\t\t\t\t$newValue = [];\n\t\t\t\tforeach($value as $node) {\n\t\t\t\t\t$newValue[] = $node->toArray();\n\t\t\t\t}\n\t\t\t\t$value = $newValue;\n\t\t\t}\n\t\t\telseif($value instanceof Icon) {\n\t\t\t\t$value = $value->toArray();\n\t\t\t}\n\t\t\telseif($value instanceof DOMElement) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$array[$key] = $value;\n\t\t};\n\t\t\n\t\tforeach(get_object_vars($this) as $key => $value) {\n\t\t\t$sorter($value, $key);\n\t\t}\n\t\t\n\t\treturn $array;\n\t}", "public function flatten(){\n\t\t$this->content=$this->flatten_array_build(\"first\");\n\t\tforeach($this->content as $item){\n\t\t\tif(is_a($item,\"elem\")){\n\t\t\t\t$item->master=$this;\n\t\t\t\t$item->self_closing=true;\n\t\t\t\t$item->content=array();\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}", "public function flattenFilters()\n {\n $filters = [];\n foreach ($this->filterdata['filters'] as $filter) {\n if (array_key_exists('filters', $filter)) {\n foreach ($filter['filters'] as $subfilter) {\n $filters[] = $subfilter;\n }\n } else {\n $filters[] = $filter;\n }\n }\n return $filters;\n }", "public function allFlattened(): array;", "public function dump()\n {\n $values = array();\n if (!$this->isEmpty()) {\n $queue = $this->root->dump(new \\SplQueue());\n while (!$queue->isEmpty()) {\n $values[] = $queue->dequeue();\n }\n }\n return $values;\n }", "public function expandGraphs()\n {\n return $this->graph->map(function (SchemaPiece $graph) {\n return $graph->getData();\n });\n }", "function entries()\n {\n $entries = array();\n\n while ($entry = $this->shiftEntry()) {\n $entries[] = $entry;\n }\n\n return $entries;\n }", "public static function toFlatArray($data)\n {\n foreach ($data as $key => $value) {\n if (is_array($value)) {\n $value = self::toFlatArray($value);\n unset($data[$key]);\n $data = array_merge($data, $value);\n }\n }\n return $data;\n }", "function erp_array_flatten( $array ) {\n if ( ! is_array( $array ) ) {\n return false;\n }\n $result = array();\n foreach ( $array as $key => $value ) {\n if ( is_array( $value ) ) {\n $result = array_merge( $result, erp_array_flatten( $value ) );\n } else {\n $result[ $key ] = $value;\n }\n }\n\n return $result;\n}", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "public function ancestors()\r\n {\r\n $return = array();\r\n \r\n $item = $this;\r\n while (!empty($item->parent))\r\n {\r\n $clone = (new static())->load(array(\r\n '_id' => new \\MongoId((string) $item->parent)\r\n ));\r\n unset($item);\r\n if (!empty($clone->id))\r\n {\r\n array_unshift($return, $clone);\r\n if (!empty($clone->parent))\r\n {\r\n $item = $clone;\r\n }\r\n }\r\n }\r\n \r\n return $return;\r\n }", "private function array_flatten_recursive($input_value, $parent_key = \"\") {\r\n\t\t$output_value = array();\r\n\t\tforeach ($input_value as $key => $value) {\r\n\t\t\t$this_key = (empty($parent_key)) ? $key : $parent_key.\"[{$key}]\";\r\n\t\t\tif (is_array($value)) {\r\n\t\t\t\t$this_value = $this->array_flatten_recursive($value, $this_key);\r\n\t\t\t\tif (!empty($this_value)) { $output_value = array_merge($output_value, $this_value); } else { $output_value[$this_key] = null; }\r\n\t\t\t}\r\n\t\t\telse { $output_value[$this_key] = $value; }\r\n\t\t}\r\n\t\treturn $output_value;\r\n\t}", "function flatten($array) {\n $result = array();\n foreach($array as $key => $subarray) {\n $result = array_merge($result, $subarray);\n }\n return $result;\n }", "function array_flatten($array) { \r\n if (!is_array($array)) { \r\n return false; \r\n } \r\n $result = array(); \r\n foreach ($array as $key => $value) { \r\n if (is_array($value)) { \r\n $result = array_merge($result, array_flatten($value)); \r\n } else { \r\n $result[$key] = $value; \r\n } \r\n } \r\n return $result; \r\n}", "public function mapRedisSchema()\n {\n $namespaces = $this->findAllStoresForDatabase();\n\n // create container for keys\n $container = array();\n\n // iterate through each key\n foreach ($namespaces as $namespace)\n {\n // break up by the namespace\n $path = explode( $this->getNamespaceSeparator(), $namespace );\n\n // create a copy of the container\n $root = & $container;\n\n // cache last key\n $value = last( $path );\n\n // glue the element to its predecessor\n while (count( $path ) > 1)\n {\n // take the top key\n $branch = array_shift( $path );\n\n // make this key an array if not exists\n if (!isset( $root[$branch] ))\n {\n $root[$branch] = array();\n }\n\n // and attach it to it's predecessor\n $root = & $root[$branch];\n }\n\n if( is_string($root) ) continue;\n\n // add the final piece back on\n $root[] = $value;\n }\n\n return $container;\n }", "public function testFlatten() {\n $match = $this->collapsed;\n $match['empty'] = null;\n\n $this->assertEquals($match, Hash::flatten($this->expanded));\n }", "public static function flatten(array $data, $separator = '.')\n {\n $result = [];\n $stack = [];\n $path = null;\n \n reset($data);\n while (!empty($data)) {\n $key = key($data);\n $element = $data[$key];\n unset($data[$key]);\n \n if (is_array($element) && !empty($element)) {\n if (!empty($data)) {\n $stack[] = [$data, $path];\n }\n $data = $element;\n reset($data);\n $path .= $key . $separator;\n } else {\n $result[$path . $key] = $element;\n }\n \n if (empty($data) && !empty($stack)) {\n list($data, $path) = array_pop($stack);\n reset($data);\n }\n }\n return $result;\n }", "public function get_flat_items_list()\n {\n $list = array();\n $i = 1;\n foreach ($this->items as $id => $dummy) {\n $abs_order = 0;\n // Passes the array as a pointer so it is modified in $list directly.\n $this->items[$id]->get_flat_list($list,$abs_order, $i, 0);\n $i++;\n }\n\n return $list;\n }", "protected function convertChildrenToArray(): array\n {\n return $this->children()->keys();\n }", "public function reverseMap()\n {\n $mappedData = [];\n\n foreach ($this->rawData as $index => $field) {\n $mappedData[$index]['id'] = getVal($field, ['id'], '');\n $mappedData[$index]['reference'] = getVal($field, ['transaction', 'reference'], '');\n $mappedData[$index]['date'] = getVal($field, ['transaction', 'transaction_date', 0, 'date'], '');\n $mappedData[$index]['amount'] = getVal($field, ['transaction', 'value', 0, 'amount'], '');\n $mappedData[$index]['currency'] = getVal($field, ['transaction', 'value', 0, 'currency'], '');\n $mappedData[$index]['description'] = getVal($field, ['transaction', 'description', 0, 'narrative', 0, 'narrative'], '');\n $mappedData[$index]['organisation'] = getVal($field, ['transaction', 'receiver_organization', 0, 'narrative', 0, 'narrative'], '');\n }\n\n return $mappedData;\n }", "public function toArray()\n {\n $data = [];\n if (isset($this->bottom)) {\n $data['bottom'] =\n $this->bottom instanceof Arrayable\n ? $this->bottom->toArray()\n : $this->bottom;\n }\n if (isset($this->top)) {\n $data['top'] =\n $this->top instanceof Arrayable\n ? $this->top->toArray()\n : $this->top;\n }\n return $data;\n }", "public static function getTopLevel()\n {\n $dataArr = [];\n $parentCatsArr = self::getParentOnlyCats();\n foreach($parentCatsArr as $obj) {\n $dataArr[$obj->id]['title'] = $obj->title;\n $dataArr[$obj->id]['cats_id'] = $obj->id;\n }\n return $dataArr;\n }", "protected function flatten_config($data, &$all, $lastkey = '')\n {\n if (is_array_assoc($data)) {\n if (!empty($lastkey)) {\n $lastkey = $lastkey.'.';\n }\n\n foreach ($data as $key => $value) {\n $this->flatten_config($value, $all, $lastkey.$key);\n }\n } else {\n $all[$lastkey] = $data;\n }\n }", "function stage_flatten($array, $prefix = '')\n{\n $result = array();\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $result = $result + stage_flatten($value, $prefix . $key . '.');\n } else {\n $result[$prefix . $key] = $value;\n }\n }\n return $result;\n}", "public function toNestedArray()\n {\n $result = array();\n foreach ($this->lists as $list) {\n foreach ($list as $item) {\n if (is_object($item)) {\n if (method_exists($item, 'toMap')) {\n $result[] = $item->toMap();\n } else {\n $result[] = (array) $item;\n }\n } else {\n $result[] = $item;\n }\n }\n }\n return $result;\n }", "function array_flatten(array $array):array\n{\n if (!is_array($array)) {\n return false;\n }\n $result = array();\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $result = array_merge($result, array_flatten($value));\n } else {\n $result = array_merge($result, array($key => $value));\n }\n }\n return $result;\n}", "public function testFlattenKeysRecursively()\n {\n $multiDimensional = array(\n 'Hello' => array(\n 'World' => array(\n 'How' => array(\n \"Are\" => \"You?\"\n )\n )\n )\n );\n\n $flatten = array('Hello.World.How.Are' => 'You?');\n\n $this\n ->given($array = new classToTest())\n ->then\n ->array($array::flattenKeysRecursively($multiDimensional))\n ->isEqualTO($flatten)\n\n ;\n }", "public function getSkuHierarchy ()\n {\n $sql = \"select t1.id,t1.layer_name,t1.layer_code,t1.layer_description,t1.parent_layer_id,t2.id as parent_layer_id,\"\n . \" (Select b.layer_name from tbld_sku_hierarchy as b where t2.id = b.id) as parent_layer_name from tbld_sku_hierarchy as t1 left join tbld_sku_hierarchy as t2 on t2.id = t1.parent_layer_id \";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "function flatten_tree(&$tree, $start_level, &$items)\n {\n foreach($tree as $item)\n {\n if($item['level'] === (integer) $start_level)\n {\n $items[] = $item;\n }\n\n if(isset($item['children']))\n {\n $this->flatten_tree($item['children'], $start_level, $items);\n }\n }\n }", "private function triBlocs($blocs) {\n\t\tforeach ($blocs as $key => $bloc) {\n\t\t\t$blocs[$key]['ordre'] = $blocs[$key]['order_' . $key];\n\t\t}\n\t\tforeach($blocs as $key => $values) {\n\t\t\t$order[$key] = $values['ordre'];\n\t\t}\n\t\tarray_multisort($order, SORT_NUMERIC, $blocs);\n\t\tforeach($blocs as $key => $values) {\n \t\tif ($blocs[$key]['ordre']) {\n \t\t\tunset($blocs[$key]['ordre']);\n \t\t}\n\t\t}\n\t\treturn $blocs;\n\t}", "function _taxonomy_menu_trails_fetch_link_deepest($vars) {\n extract($vars);\n\n $candidates = array();\n foreach ($results as $candidate) {\n //Prefer the lightest of items with the same menu and path\n if (!isset($candidates[$candidate['menu_name']][$candidate['link_path']])) {\n $candidate['weight'] = $candidate['link_weight'];\n $candidates[$candidate['menu_name']][$candidate['link_path']] = $candidate;\n\n // Add any menus not already in the menu name search list.\n if (!in_array($candidate['menu_name'], $menu_names)) {\n $menu_names[] = $candidate['menu_name'];\n }\n }\n }\n\n // processing array according on saved settings\n switch($settings['multiple_menu']) {\n case 'first':\n array_pop($candidates);\n break;\n\n case 'last':\n array_shift($candidates);\n break;\n }\n\n if (!empty($candidates)) {\n foreach ($menu_names as $menu_name) {\n if (!empty($candidates[$menu_name])) {\n foreach ($candidates[$menu_name] as $candidate_item) {\n $map = explode('/', $candidate_item['link_path']);\n _menu_translate($candidate_item, $map);\n if ($candidate_item['access']) {\n $selected_items[] = $candidate_item;\n }\n }\n }\n }\n }\n\n return $selected_items;\n}", "public function generate($headings)\n {\n /** @var Entry $previous */\n $root = $previous = new RootEntry();\n foreach ($headings as $heading) {\n if ($heading->getLevel() < $previous->getLevel()) {\n $parent = $previous;\n do {\n $parent = $parent->getParent();\n } while ($heading->getLevel() <= $parent->getLevel() && $parent->getLevel() != 0);\n\n $parent->addChild($heading);\n $previous = $heading;\n continue;\n }\n\n\n if ($heading->getLevel() > $previous->getLevel()) {\n $previous->addChild($heading);\n $previous = $heading;\n continue;\n }\n\n //if ($heading->getLevel() == $previous->getLevel()) {\n $previous->getParent()->addChild($heading);\n $previous = $heading;\n continue;\n //}\n }\n\n return $root;\n }", "public function flattenArray($array, $preserveKeys = 0, &$out = array())\n {\n foreach ($array as $key => $child) {\n if (is_array($child)) {\n $out = $this->flattenArray($child, $preserveKeys, $out);\n } elseif ($preserveKeys + is_string($key) > 1) {\n $out[$key] = $child;\n } else {\n $out[] = $child;\n }\n }\n return $out;\n }", "protected function convertChildrenToArray()\n {\n $data = array();\n foreach ($this->getChildren() as $name => $child) {\n $data = array_merge($data, $this->convertChildToArray($name, $child));\n }\n return $data;\n }", "public function toStack(): Stack {\n $stack = new ArrayStack();\n foreach ($this->items as $item) {\n $stack->push($item);\n }\n return $stack;\n }", "public function getDataTree() {\n $array = [\n 'id' => $this->id,\n 'name' => $this->name,\n 'type' => $this->type,\n 'data' => ['href' => route('sensors.edit', $this->id)],\n 'children' => []\n ];\n\n foreach( $this->children as $child ) {\n $array['children'][] = $child->getDataTree();\n }\n\n return $array;\n }", "public function expandAll()\n {\n foreach ($this->_parent[self::BASE_ELT] as $val) {\n $this->expand($val, true);\n }\n }", "function BreadcrumbSet() {\n\t\treturn new DataObjectSet( $this->Ancestors( $this ) );\n\t}", "public function fetchKeyedArray()\n\t{\n\t\t$arr = $this->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC);\n\t\t$arr = array_map('reset', $arr);\n\t\t$keys = array_keys($arr);\n\t\t// if there's only one item in the lower arrays, we might as well\n\t\t// remove the array element\n\t\tif (count($keys) && count($arr[$keys[0]]) == 1)\n\t\t{\n\t\t\t$arr = array_map('reset', $arr);\n\t\t}\n\n\t\treturn $arr;\n\t}", "public function values($skeleton = null)\n {\n $skeleton = $skeleton ?? $this->structure();\n foreach ($skeleton as $k => $v) {\n if (isset($v['children'])) {\n $skeleton[$k] = $this->values($v['children']);\n } else {\n $skeleton[$k] = $v['value'] ?? null;\n }\n }\n return $skeleton;\n }", "function get_flat_tree( $root = 1 )\n\t {\n\t \t\n\t\t$node = $this->get_node( $root );\n\t\tif($node == false)\n\t\t\treturn false;\n\n\t\t$query = ee()->db->select('*')\n\t\t\t->from( $this->tree_table )\n\t\t\t->join('channel_titles', 'channel_titles.entry_id = '.$this->tree_table.'.entry_id', 'left')\n\t\t\t->where($this->tree_table.\".lft BETWEEN \".$node['lft'].\" AND \".$node['rgt'])\n\t\t\t->group_by($this->tree_table.\".node_id\")\n\t\t\t->order_by($this->tree_table.\".lft\", \"asc\")\n\t\t\t->get();\n\t\t\n\t\t$right = array();\n\t\t$result = array();\n\t\t$current =& $result;\n\t\t$stack = array();\n\t\t$stack[0] =& $result;\n\t\t$level = 0;\n\t\t$i = 0;\n\n\t\tforeach($query->result_array() as $row)\n\t\t{\n\n\t\t\t// go more shallow, if needed\n\t\t\tif(count($right))\n\t\t\t{\n\t\t\t\twhile($right[count($right)-1] < $row['rgt'])\n\t\t\t\t{\n\t\t\t\t\tarray_pop($right);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Go one level deeper?\n\t\t\tif(count($right) > $level)\n\t\t\t{\n\t\t\t\tend($current);\n\t\t\t}\n\t\t\t// the stack contains all parents, current and maybe next level\n\t\t\t// $current =& $stack[count($right)];\n\t\t\t// add the data\n\t\t\t$current[] = $row;\n\t\t\t// go one level deeper with the index\n\t\t\t$level = count($right);\n\t\t\t$right[] = $row['rgt'];\n\n\t\t\t$current[$i]['level'] = $level;\n\t\t\t$current[$i]['childs'] = round(($row['rgt'] - $row['lft']) / 2, 0);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "public function getRenderDataInnslag()\n {\n $renderData = $this->getRenderData();\n $this->_collected = [];\n if ($renderData->harGrupper()) {\n foreach ($renderData->getGrupper() as $gruppe) {\n if ($gruppe->harGrupper()) {\n foreach ($gruppe->getGrupper() as $undergruppe) {\n $this->_collectInnslag($undergruppe);\n }\n } else {\n $this->_collectInnslag($gruppe);\n }\n }\n } else {\n $this->_collectInnslag($renderData);\n }\n\n return $this->_collected;\n }", "function get_toc($toc_flat) {\n $result = array();\n $nodes = array();\n foreach ($toc_flat as & $item) {\n if (array_key_exists('directory', $item) && !empty($item['directory'])) {\n $item['items'] = array();\n $nodes[$item['directory']] = & $item;\n if (array_key_exists('parent', $item) && !empty($item['parent'])) {\n $nodes[$item['parent']]['items'][] = & $item;\n } else {\n $result[] = & $item;\n }\n }\n }\n return $result;\n}", "public function flatten(): Set;", "function pushToKeyLoop($dataList,$arrayInput,$childKey=\"child\"){ \n foreach ($dataList as $key => $value) {\n foreach ($value as $keyData => $valueData) {\n $arrayInput = self::pushToKey($key,$keyData,$valueData,$arrayInput,$childKey);\n }\n }\n ksort($arrayInput);\n return $arrayInput;\n}", "function _buildArray() {\n\t$trunk = array();\n\n\tif (!isset($this->_indentSort[0])) {\n\t\treturn $trunk;\n\t}\n\n\tforeach ($this->_indentSort[0] as $n) {\n\t\tif (empty($n->parent)) {\n\t\t$this->_nodeArrayizeData($n);\n\t\t// Check for references and copy the needed data to complete them.\n\t\t$this->_makeReferences($n);\n\t\t// Merge our data with the big array we're building\n\t\t$trunk = $this->_array_kmerge($trunk,$n->data);\n\t\t}\n\t}\n\n\treturn $trunk;\n\t}", "private function flatten(array $messages): array\n {\n $result = [];\n foreach ($messages as $key => $value) {\n if (\\is_array($value)) {\n foreach ($this->flatten($value) as $k => $v) {\n if (null !== $v) {\n $result[$key.'.'.$k] = $v;\n }\n }\n } elseif (null !== $value) {\n $result[$key] = $value;\n }\n }\n\n return $result;\n }", "function array_flatten($array) { \n\tif (!is_array($array)) { \n\t\treturn FALSE; \n\t} \n\t$result = array(); \n\tforeach ($array as $key => $value) { \n\t\tif (is_array($value)) { \n\t\t\t$result = array_merge($result, array_flatten($value)); \n\t\t} \n\t\telse { \n\t\t\t$result[$key] = $value; \n\t\t} \n\t} \n\treturn $result; \n}", "protected function _preFlatten() {}", "function retrieveHierarchy() {\r\n\t\t$arrCats = $this->generateTreeByLevels(3);\r\n\t\t\r\n\t\treturn $arrCats;\r\n\t}", "public function getBreadcrumbs()\n\t\t{\n\t\t\t// ziskame aktualni stranku, postupne z jejiho ID urezavame casti, pridavame odpovidajici stranky a itemy\n\t\t\t$items = [];\n\t\t\t$currentPage = $this->getCurrentPage();\n\n\t\t\tif ($currentPage !== NULL) {\n\t\t\t\tdo {\n\t\t\t\t\tif (isset($this->pages[$currentPage])) { // pokud stranka existuje\n\t\t\t\t\t\tif (isset($this->afterItems[$currentPage])) { // array_reverse\n\t\t\t\t\t\t\t$items = array_merge($items, array_reverse($this->afterItems[$currentPage]));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($this->pages[$currentPage]->isVisibleInBreadcrumbs()) {\n\t\t\t\t\t\t\t$items[] = $this->pages[$currentPage];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($this->beforeItems[$currentPage])) { // array_reverse\n\t\t\t\t\t\t\t$items = array_merge($items, array_reverse($this->beforeItems[$currentPage]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// urizneme cast\n\t\t\t\t\tif ($currentPage === '') {\n\t\t\t\t\t\tbreak; // currentPage = NULL\n\t\t\t\t\t}\n\n\t\t\t\t\t$currentPage = Helpers::getParent($currentPage);\n\n\t\t\t\t} while ($currentPage !== NULL);\n\n\t\t\t\t$items = array_reverse($items);\n\t\t\t}\n\n\t\t\tforeach ($this->items as $item) {\n\t\t\t\t$items[] = $item;\n\t\t\t}\n\n\t\t\treturn $items;\n\t\t}", "public function getBreadCrumb()\n {\n $result = [];\n $current = $this->getCurrent();\n while (!\\is_null($current)) {\n array_unshift($result, $current);\n $current = $current->getParent();\n }\n\n return $result;\n }", "public function toArray()\n {\n\t\t$rev = array();\n\t\tforeach($this->_data as $item){\n\t\t\t$rev[] = $item->toArray();\n\t\t}\n return $rev;\n }", "public function toArray()\n {\n $a = [];\n if (($e = $this->first) != null) {\n do {\n $key = $e->getKey();\n $value = $e->getValue();\n $a[$key] = $value;\n } while (($e = $e->next) != null);\n }\n return $a;\n }", "public function toArray($_recursive = TRUE);", "public function traverse() {\n return($this->root->SortedArray());\n }", "public function getAncestors();", "private function flatten($array)\n {\n $flattened = [];\n\n foreach ($array as $collection => $entries) {\n foreach ($entries as $uuid => $entry) {\n $flattened[$uuid] = $entry;\n }\n }\n\n return $flattened;\n }", "public static function flattenKey(&$key) {\n\t\tif ($key) {\n\t\t\tif (is_array($key)) {\n\t\t\t\t$key[0] = self::flattenKey($key[0]);\n\t\t\t} else if (is_object($key)) {\n\t\t\t\t$key = get_class($key);\n\t\t\t}\n\t\t}\n\t\treturn $key;\n\t}", "protected function get_full_stack_subscribers_data():array{\n\t $debug_data = [];\n\t foreach($this->full_stack_subscribers as $label=>$subscriber){\n\t $debug_data[$label] = print_r($subscriber(),true);\n\t }\n\t return $debug_data;\n\t}", "public function getTreeRelations()\n {\n $out = new stdClass();\n $out->parent = null;\n $out->children = null;\n\n foreach($this->_map as $bind => $config)\n {\n if(!is_array($config) || !isset($config[self::MAP_TYPE]) || !in_array($config[self::MAP_TYPE],\n self::$_relationTypes))\n {\n continue;\n }\n if($config[self::MAP_MAPPER] == get_class($this) && $config[self::MAP_TYPE] == self::RELATION_CHILDREN)\n {\n $out->children = array(\n 'alias' => $bind,\n self::MAP_KEY => $config[self::MAP_KEY],\n self::MAP_FOREIGN_KEY => $config[self::MAP_FOREIGN_KEY]\n );\n }\n elseif($config[self::MAP_MAPPER] == get_class($this) && $config[self::MAP_TYPE] == self::RELATION_PARENT)\n {\n $out->parent = array(\n 'alias' => $bind,\n self::MAP_KEY => $config[self::MAP_KEY],\n self::MAP_FOREIGN_KEY => $config[self::MAP_FOREIGN_KEY]\n );\n }\n }\n return $out;\n }", "public function glitchDump(): iterable\n {\n $output = [];\n\n foreach (array_merge($this->_values, $this->_changes) as $key => $value) {\n if ($value instanceof IValueContainer) {\n $value = $value->getDumpValue();\n }\n\n if (array_key_exists($key, $this->_changes)) {\n if (!array_key_exists($key, $this->_values)) {\n $key = '+ ' . $key;\n } elseif ($this->_changes[$key] === null) {\n if (isset($this->_values[$key])) {\n $value = $this->_values[$key];\n }\n\n if ($value !== null) {\n $key = '- ' . $key;\n }\n } else {\n $key .= ' *';\n }\n }\n\n yield 'value:' . $key => $value;\n }\n }", "public function tree_backup_list() {\n global $db;\n\n return $db->fetch_table(\"SELECT * FROM `\".$this->table.\"_restore` ORDER BY STAMP DESC\");\n }", "private function iterate($results): array\n {\n $level = 1;\n while (true) {\n $merged = collect();\n foreach ($results[$level - 1] as $parent) {\n $temp = collect();\n if (is_array($results)) {\n $results[$level] = collect();\n }\n if ($parent->getChildren->isEmpty() != true) { // negation (!) at the start is easy to miss\n $temp = $parent->getChildren;\n }\n $merged = $merged->merge($temp);\n }\n $results[$level] = $merged;\n $merged = collect();//resets merged collection for next level\n if ($results[$level]->isEmpty()) {\n return $results;\n }\n $level++;\n }\n }", "protected function getTree()\n {\n $tree = [];\n // copy of '$this->data'.\n $data = $this->data;\n// return Helper::debug($data);\n// die();\n\n foreach($data as $id => &$node) {\n if( $node['parent'] == 0 ) {\n $tree[$id] = &$node;\n } else {\n $data[$node['parent']]['childs'][$id] = &$node;\n }\n }\n return $tree;\n }", "function flattenArray($array)\n{\n\t$flatArray = array();\n\tforeach ($array as $subElement) {\n \tif (is_array($subElement)) {\n\t\t\t$flatArray = array_merge($flatArray, flattenArray($subElement));\n\t\t} else {\n\t\t\t$flatArray[] = $subElement;\n\t\t}\n\t}\n\n\treturn $flatArray;\n}", "public function dataFix($data)\n {\n $items = [];\n\n if (!empty($data) && is_array($data)) {\n foreach ($data as $item) {\n if (!empty($item['value'])) {\n if (!empty($item['key']))\n $items[$item['key']] = $item['value'];\n else\n $items[$item['value']] = $item['value'];\n }\n }\n }\n\n return $items;\n }", "function _drush_utils_array_fold($values) {\n $is_array = is_array($values);\n if (!$is_array) {\n return $values;\n }\n $result = array();\n while ($is_array) {\n $is_array = FALSE;\n foreach ($values as $key => $data) {\n if (is_array($data)) {\n foreach ($data as $sub_key => $sub_data) {\n $fold = _drush_utils_array_fold($sub_data);\n if (is_array($fold)) {\n foreach ($fold as $k => $val) {\n $result[$key . '.' . $sub_key . '.' . $k] = $val;\n }\n }\n else {\n $result[$key . '.' . $sub_key] = $fold;\n }\n }\n }\n else {\n $result[$key] = $data;\n }\n }\n }\n return $result;\n}", "function ancestors() {\n\t\t$ancestors = array();\n\t\tfor ($here = $this ; $here !== NULL ; $here = $here->_parent) {\n\t\t\t$ancestors []= $here;\n\t\t}\n\t\treturn array_reverse($ancestors);\n\t}", "function fusion_array_merge_recursive( array $array1, array $array2 ) {\n\t$merged = $array1;\n\n\tforeach ( $array2 as $key => $value ) {\n\t\tif ( is_array( $value ) && isset( $merged[ $key ] ) && is_array( $merged[ $key ] ) ) {\n\t\t\t$merged[ $key ] = fusion_array_merge_recursive( $merged[ $key ], $value );\n\t\t} elseif ( is_numeric( $key ) && isset( $merged[ $key ] ) ) {\n\t\t\t$merged[] = $value;\n\t\t} else {\n\t\t\t$merged[ $key ] = $value;\n\t\t}\n\t}\n\n\treturn $merged;\n}", "public static function getFlattened(array $elements) {\n $flattened_elements = [];\n foreach ($elements as $key => &$element) {\n if (Element::property($key) || !is_array($element)) {\n continue;\n }\n\n $flattened_elements[$key] = self::getProperties($element);\n $flattened_elements += self::getFlattened($element);\n }\n return $flattened_elements;\n }", "public function getChildrenAggregationData()\n {\n $out = [];\n\n $mapping = [\n 'product' => [\n 'properties' => [\n 'title' => [\n 'type' => 'string',\n ],\n ],\n ],\n 'comment' => [\n '_parent' => [\n 'type' => 'product',\n ],\n '_routing' => [\n 'required' => true,\n ],\n 'properties' => [\n 'sub_title' => [\n 'type' => 'string',\n ],\n ],\n ],\n ];\n\n // Case #0 simple terms aggregation.\n $aggregation = new TermsAggregation('test_terms_agg');\n $aggregation->setField('comment.sub_title');\n\n $result = [\n 'doc_count' => 2,\n 'agg_test_terms_agg' => [\n 'buckets' => [\n [\n 'key' => 'bar',\n 'doc_count' => 1,\n ],\n [\n 'key' => 'foo',\n 'doc_count' => 1,\n ],\n ],\n ],\n ];\n\n $out[] = [\n $aggregation,\n $result,\n $mapping,\n ];\n\n return $out;\n }", "protected final function get_ancestors()\n\t{\n\t\tif(!isset($this->parent))\n\t\t\treturn array($this->id);\n\t\t\t\n\t\treturn array_merge($this->parent->get_ancestors(),array($this->id));\t\n\t}", "public static function data_valuesFlipCopy(): array {\n\t\treturn [\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'A', 'B', 'C',\n\t\t\t\t], [\n\t\t\t\t\t'A' => 'A', 'B' => 'B', 'C' => 'C',\n\t\t\t\t],\n\t\t\t], [\n\t\t\t\t[\n\t\t\t\t\t'one', 'two', 'three',\n\t\t\t\t], [\n\t\t\t\t\t'one' => 'one', 'two' => 'two', 'three' => 'three',\n\t\t\t\t],\n\t\t\t], [\n\t\t\t\t[\n\t\t\t\t\t'1', '2', '3', 'fish', '4', '5', '1', '2',\n\t\t\t\t], [\n\t\t\t\t\t'1' => '1', '2' => '2', '3' => '3', 'fish' => 'fish', '4' => '4', '5' => '5',\n\t\t\t\t],\n\t\t\t], [\n\t\t\t\t[\n\t\t\t\t\t'a' => 'A', 'b' => 'B',\n\t\t\t\t], [\n\t\t\t\t\t'A' => 'A', 'B' => 'B',\n\t\t\t\t],\n\t\t\t], [\n\t\t\t\t[\n\t\t\t\t\t'A', 'B',\n\t\t\t\t], [\n\t\t\t\t\t'A' => 'A', 'B' => 'B',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\t}", "public function ancestors(): Collection\n {\n $post = $this->wpPost;\n if (!$post->post_parent) {\n return new Collection(); // do not have any ancestors\n }\n\n $ancestor = get_post($post->post_parent);\n $ancestors = [];\n $ancestors[] = $ancestor;\n\n while ($ancestor->post_parent) {\n $ancestor = get_post($ancestor->post_parent);\n array_unshift($ancestors, $ancestor);\n }\n\n $ancestors = array_map(function ($post) {\n return new static($post);\n }, $ancestors);\n\n $ancestors = new Collection($ancestors);\n\n return $this->setAttribute(__METHOD__, $ancestors);\n }" ]
[ "0.57027346", "0.5575795", "0.53862685", "0.5378057", "0.53104943", "0.5206815", "0.51706266", "0.51706266", "0.51179093", "0.51052564", "0.51052564", "0.51052564", "0.50791794", "0.49956474", "0.49617583", "0.49398476", "0.49003732", "0.4877262", "0.48716614", "0.48472396", "0.47934374", "0.4792105", "0.47641918", "0.47537285", "0.475259", "0.47518602", "0.47358528", "0.47250253", "0.47165307", "0.46571305", "0.4652584", "0.4644352", "0.46288872", "0.46208423", "0.46095794", "0.46042186", "0.4575621", "0.45631316", "0.45538238", "0.45526758", "0.45437258", "0.4538532", "0.45310906", "0.45226228", "0.45163727", "0.45131978", "0.45033836", "0.44980532", "0.44865993", "0.44751817", "0.44726118", "0.44710302", "0.44629925", "0.4452329", "0.44500715", "0.44479945", "0.4447301", "0.44435513", "0.44395182", "0.44348708", "0.44310167", "0.44257742", "0.44235212", "0.44215944", "0.44196156", "0.44186842", "0.4416026", "0.44120583", "0.44085595", "0.44071653", "0.44022277", "0.44011286", "0.4375974", "0.43756762", "0.43749744", "0.4373506", "0.43731114", "0.43722245", "0.4367951", "0.4367447", "0.4365788", "0.43653813", "0.43404308", "0.43392277", "0.43371192", "0.4335907", "0.43233532", "0.43190047", "0.4309814", "0.43064982", "0.42963448", "0.42892098", "0.4287937", "0.4280512", "0.42693785", "0.4268008", "0.42621544", "0.42604864", "0.42567822", "0.42519465", "0.4247903" ]
0.0
-1
TODO: sql: refactor: move logic to controller
public function save(array $data): mixed { $fields = $this->db->list_fields($this->tableName); foreach ($fields as $field) { if (isset($data[$field])) { $this->db->set($field, $data[$field]); } } if (! isset($data['id'])) { $return = $this->db->insert($this->tableName); } else { if (is_array($this->primaryKey)) { $ids = explode(".", $data['id']); foreach ($this->primaryKey as $idx => $key) { $this->db->where("{$this->tableName}.{$key}", $ids[$idx]); } } else { $this->db->where("{$this->tableName}.{$this->primaryKey}", $data['id']); } $return = $this->db->update($this->tableName); } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function query();", "function get_sql_crud() {\n try {\n $app = Slim\\Slim::getInstance();\n $table = $app->request->params('table_name');\n $model = $app->request->params('model');\n $ck_sql_alias = $app->request->params('ck_sql_alias');\n\n $gii = new easyuigii();\n $gii->ck_sql_alias = $ck_sql_alias;\n $data = $gii->get_sql_for_select($table, $model);\n\n $app->render(200, ['success' => true, 'sql' => $data]);\n } catch (Exception $e) {\n $app->render(200, ['isError' => true, 'msg' => $e->getMessage()]);\n error_log(LogTime() . 'error - get sql for crud ' . PHP_EOL, 3, 'logs/error.log');\n }\n}", "public function _query()\n {\n }", "public function query()\n\t{\n\t\t\n\t}", "public function query()\n {\n }", "public function query()\n {\n }", "public function query();", "public function query();", "public function query();", "function createQuery() ;", "public function Query() {\n \n }", "public function Query(){\n\t}", "public function Query(){\n\t}", "public function Query(){\n\t}", "public function query() {\n\n }", "private function _generateQuery() {\n\t\t// vyhodnoceni odeslanych filtracnich dat\n\t\t$filterObj = $this->getRequest()->getParam(\"_filter\", null);\n\t\t$uuid = $this->getRequest()->getParam(\"id\", null);\n\t\t$uuids = $this->getRequest()->getParam(\"_uuids\", null);\n\t\t\n\t\t// vyhodnoceni stavu\n\t\tif ($uuid) {\n\t\t\t// uuid byl odeslan primo v requestu\n\t\t\t$this->_queryObject = array($uuid);\n\t\t\t\n\t\t\treturn;\n\t\t} elseif ($uuids) {\n\t\t\t// byl odeslan seznam uuid\n\t\t\t$this->_queryObject = (array) $uuids;\n\t\t\t\n\t\t\treturn;\n\t\t} elseif (!$filterObj) {\n\t\t\t// zadna z moznosti nebyla vyuzita\n\t\t\t$this->_queryObject = array();\n\t\t}\n\t\t\n\t\t/**\n\t\t * pokud program dosel az sem, byl odeslan plnohodnotny filtracni objekt\n\t\t */ \n\t\t\n\t\t// reset referenci\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vytvoreni filtracniho objektu a ziskani seznamu tabulek\n\t\t$queryObj = BB_Db_Query_Factory::factory($filterObj);\n\t\t$tableNames = BB_Db_Query_Reference::getTables();\n\t\t\n\t\t// vygenerovani seznamu pouzitych sloupcu z index\n\t\t$usedColumns = $this->getRequest()->getParam(\"_uuidColumns\", array());\n\t\t$usedColumns = (array) $usedColumns;\n\t\t\n\t\tif (!$usedColumns) {\n\t\t\t// seznam pouzitych sloupci je prazdny - toto neni pripustne\n\t\t\tthrow new Zend_Exception(\"UUID_COLUMNS_NOT_SET\", 400);\n\t\t}\n\t\t\n\t\t$usedReferences = array();\n\t\t\n\t\tforeach ($usedColumns as $column) {\n\t\t\t$reference = new BB_Db_Query_Reference($column);\n\t\t\t\n\t\t\t// kontrola jestli je tabulka v seznamu\n\t\t\tif (!in_array($reference->getTable(), $tableNames)) {\n\t\t\t\t// tabulka neni v seznamu, vyhodi se chyba\n\t\t\t\tthrow new Zend_Exception(\"UNKNOWN_INDEX_UUID_COLUMN\", 400);\n\t\t\t}\n\t\t\t\n\t\t\t$usedReferences[] = new BB_Db_Query_Reference($column);\n\t\t}\n\t\t\n\t\t// anulace statickych vlastnosti reference\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vygenerovani infomraci pro filtraci dat\n\t\t$filterData = new stdClass;\n\t\t\n\t\t$filterData->columns = $usedReferences;\n\t\t$filterData->query = $queryObj;\n\t\t$filterData->tables = $tableNames;\n\t\t\n\t\t// nastaveni objektu\n\t\t$this->_queryObject = $filterData;\n\t\t\n\t\treturn $this;\n\t}", "abstract function getSQL();", "public static function query()\n {\n }", "public function actionServerdata(){\n $requestData = $_REQUEST;\n $model = new Services;\n $primary_key = $model->tableSchema->primaryKey;\n $array_cols = Yii::app()->db->schema->getTable(Services::model()->tableSchema->name)->columns;\n $array = array();\n $i = 0;\n foreach($array_cols as $key=>$col){\n $array[$i] = $col->name;\n $i++;\n }\n\n $columns = $array;\n $currentrole = Yii::app()->user->role;\n if($currentrole != \"admin\"){\n $userid = Yii::app()->user->id;\n $sql = \"SELECT * from \".Services::model()->tableSchema->name.\" where user_id = \".$userid;\n }\n else{\n $sql = \"SELECT * from \".Services::model()->tableSchema->name.\" where 1=1\";\n }\n\n if (!empty($requestData['search']['value']))\n {\n $sql.=\" AND ( $primary_key LIKE '%\" . $requestData['search']['value'] . \"%' \";\n foreach($array_cols as $key=>$col){\n if($col->name != $primary_key)\n {\n $sql.=\" OR \".$col->name.\" LIKE '%\" . $requestData['search']['value'] . \"%'\";\n }\n }\n $sql.=\")\";\n }\n\n $j = 0;\n\n // getting records as per search parameters\n foreach($columns as $key=>$column){\n\n if( !empty($requestData['columns'][$key]['search']['value']) ){ //name\n $sql.=\" AND $column LIKE '%\".$requestData['columns'][$key]['search']['value'].\"%' \";\n }\n $j++;\n }\n\n $count_sql = str_replace(\"*\",\"count(*) as columncount\",$sql);\n $data = Yii::app()->db->createCommand($count_sql)->queryAll();\n $totalData = $data[0]['columncount'];\n $totalFiltered = $totalData;\n\n $sql.=\" ORDER BY \" . $columns[$requestData['order'][0]['column']] . \" \" . $requestData['order'][0]['dir'] . \" LIMIT \" . $requestData['start'] . \" ,\" .\n $requestData['length'] . \" \";\n\n $result = Yii::app()->db->createCommand($sql)->queryAll();\n\n $data = array();\n $i=1;\n\n\n foreach ($result as $key => $row)\n {\n $nestedData = array();\n $nestedData[] = $row[$primary_key];\n\n if(!empty($row['user_id'])){\n $sql = \"SELECT full_name from user_info where user_id = \".$row['user_id'];\n $result = Yii::app()->db->createCommand($sql)->queryAll();\n if(!empty($result)){\n $row['user_id'] = $result[0]['full_name'];\n }\n }\n\n if(!empty($row['resource_id'])){\n $sql = \"SELECT resource_name from resources where resource_id = \".$row['resource_id'];\n $result = Yii::app()->db->createCommand($sql)->queryAll();\n if(!empty($result)){\n $row['resource_id'] = $result[0]['resource_name'];\n }\n }\n\n foreach($array_cols as $key=>$col){\n $nestedData[] = $row[\"$col->name\"];\n }\n\n $data[] = $nestedData;\n $i++;\n }\n\n\n $json_data = array(\n \"draw\" => intval($requestData['draw']),\n \"recordsTotal\" => intval($totalData),\n \"recordsFiltered\" => intval($totalFiltered),\n \"data\" => $data // total data array\n );\n\n echo json_encode($json_data);\n }", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function get_sql()\n {\n }", "protected function _prepareRowsAction() {\n \n }", "function query() {}", "function get_sql_combo() {\n try {\n $app = Slim\\Slim::getInstance();\n $table = $app->request->params('table_name');\n\n $gii = new easyuigii();\n $gii->set_db_setting();\n $model_combo = $gii->get_table_model_from_db($table);\n $data = $gii->get_sql_for_select($table, $model_combo);\n\n $app->render(200, ['success' => true, 'sql' => $data]);\n } catch (Exception $e) {\n $app->render(200, ['isError' => true, 'msg' => $e->getMessage()]);\n error_log(LogTime() . 'error - get sql for combo' . PHP_EOL, 3, 'logs/error.log');\n }\n}", "public function getAlgorithmsAction(){\n $view = FOSView::create(); \n $em = $this->getDoctrine()->getManager();\n $repo = $em->getRepository('ByExampleRecommandationsBundle:Algorithm');\n $results=$repo->findAllAlgo();\n if($results){ //\n $view->setStatusCode(200)->setData($results); \n }else{ \n $view->setStatusCode(404);\n }\n return $view;\n\n \n}", "function execute() {\r\n\t\t/*\r\n\t\t * Basic Information Table\r\n\t\t */\r\n\t\t$this->setTableName('leafTranslate');\r\n\t\t$this->setPrimaryKeyName('leafTranslateId');\r\n\t\t/*\r\n\t\t * All the $_POST enviroment.\r\n\t\t */\r\n\t\tif (isset($_POST ['leafTranslateId'])) {\r\n\t\t\t$this->setLeafTranslateId($this->strict($_POST ['leafTranslateId'], 'numeric'), 0, 'single');\r\n\t\t}\r\n\t\tif (isset($_POST ['leafIdTemp'])) {\r\n\t\t\t$this->setLeafIdTemp($this->strict($_POST ['leafIdTemp'], 'numeric'));\r\n\t\t}\r\n\t\tif (isset($_POST ['leafId'])) {\r\n\t\t\t$this->setLeafId($this->strict($_POST ['leafId'], 'numeric'));\r\n\t\t}\r\n\t\tif (isset($_POST ['leafSequence'])) {\r\n\t\t\t$this->setLeafSequence($this->strict($_POST ['leafSequence'], 'memo'));\r\n\t\t}\r\n\t\tif (isset($_POST ['LeafCode'])) {\r\n\t\t\t$this->setLeafCode($this->strict($_POST ['leafCode'], 'memo'));\r\n\t\t}\r\n\t\tif (isset($_POST ['leafNative'])) {\r\n\t\t\t$this->setLeafNative($this->strict($_POST ['leafNative'], 'memo'));\r\n\t\t}\r\n\t\t/*\r\n\t\t * All the $_GET enviroment.\r\n\t\t */\r\n\t\tif (isset($_GET ['leafTranslateId'])) {\r\n\t\t\t$this->setTotal(count($_GET ['leafTranslateId']));\r\n\t\t}\r\n\r\n\t\tif (isset($_GET ['leafTranslateId'])) {\r\n\t\t\tif (is_array($_GET ['leafTranslateId'])) {\r\n\t\t\t\t$this->leafTranslateId = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isDefault'])) {\r\n\t\t\tif (is_array($_GET ['isDefault']) ) {\r\n\t\t\t\t$this->isDefault = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isNew']) ) {\r\n\t\t\tif (is_array($_GET ['isNew'])) {\r\n\t\t\t\t$this->isNew = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isDraft']) ) {\r\n\t\t\tif (is_array($_GET ['isDraft'])) {\r\n\t\t\t\t$this->isDraft = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isUpdate']) ) {\r\n\t\t\tif (is_array($_GET ['isUpdate'])) {\r\n\t\t\t\t$this->isUpdate = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isDelete']) ) {\r\n\t\t\tif (is_array($_GET ['isDelete'])) {\r\n\t\t\t\t$this->isDelete = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isActive']) ) {\r\n\t\t\tif (is_array($_GET ['isActive'])) {\r\n\t\t\t\t$this->isActive = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isApproved']) ) {\r\n\t\t\tif (is_array($_GET ['isApproved'])) {\r\n\t\t\t\t$this->isApproved = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isReview']) ) {\r\n\t\t\tif (is_array($_GET ['isReview'])) {\r\n\t\t\t\t$this->isReview = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isPost']) ) {\r\n\t\t\tif (is_array($_GET ['isPost'])) {\r\n\t\t\t\t$this->isPost = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$primaryKeyAll = '';\r\n\t\tfor ($i = 0; $i < $this->getTotal(); $i++) {\r\n\t\t\tif (isset($_GET ['leafTranslateId'])) {\r\n\t\t\t\t$this->setLeafTranslateId($this->strict($_GET ['leafTranslateId'] [$i], 'numeric'), $i, 'array');\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isDefault'])) {\r\n\t\t\t\tif ($_GET ['isDefault'] [$i] == 'true' ) {\r\n\t\t\t\t\t$this->setIsDefault(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isDefault'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsDefault(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isNew'])) {\r\n\t\t\t\tif ($_GET ['isNew'] [$i] == 'true' ) {\r\n\t\t\t\t\t$this->setIsNew(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isNew'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsNew(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isDraft'])) {\r\n\t\t\t\tif ($_GET ['isDraft'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsDraft(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isDraft'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsDraft(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isUpdate'])) {\r\n\t\t\t\tif ($_GET ['isUpdate'] [$i] == 'true' ) {\r\n\t\t\t\t\t$this->setIsUpdate(1, $i, 'array');\r\n\t\t\t\t} if ($_GET ['isUpdate'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsUpdate(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isDelete'])) {\r\n\t\t\t\tif ($_GET ['isDelete'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsDelete(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isDelete'] [$i] == 'false' ) {\r\n\t\t\t\t\t$this->setIsDelete(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isActive'])) {\r\n\t\t\t\tif ($_GET ['isActive'] [$i] == 'true' ) {\r\n\t\t\t\t\t$this->setIsActive(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isActive'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsActive(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isApproved'])) {\r\n\t\t\t\tif ($_GET ['isApproved'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsApproved(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isApproved'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsApproved(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isReview'])) {\r\n\t\t\t\tif ($_GET ['isReview'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsReview(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isReview'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsReview(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isPost']) || isset($_GET ['isPostDetail']) ) {\r\n\t\t\t\tif ($_GET ['isPost'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsPost(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isPost'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsPost(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$primaryKeyAll .= $this->getLeafTranslateId($i, 'array') . \",\";\r\n\t\t}\r\n\t\t$this->setPrimaryKeyAll((substr($primaryKeyAll, 0, - 1)));\r\n\t\t/**\r\n\t\t * All the $_SESSION enviroment.\r\n\t\t */\r\n\t\tif (isset($_SESSION ['staffId'])) {\r\n\t\t\t$this->setExecuteBy($_SESSION ['staffId']);\r\n\t\t}\r\n\t\t/**\r\n\t\t * TimeStamp Value.\r\n\t\t */\r\n\t\tif ($this->getVendor() == self::MYSQL) {\r\n\t\t\t$this->setExecuteTime(\"'\" . date(\"Y-m-d H:i:s\") . \"'\");\r\n\t\t} else if ($this->getVendor() == self::MSSQL) {\r\n\t\t\t$this->setExecuteTime(\"'\" . date(\"Y-m-d H:i:s\") . \"'\");\r\n\t\t} else if ($this->getVendor() == self::ORACLE) {\r\n\t\t\t$this->setExecuteTime(\"to_date('\" . date(\"Y-m-d H:i:s\") . \"','YYYY-MM-DD HH24:MI:SS')\");\r\n\t\t}\r\n\t}", "function query() {\n }", "private function sqlstatements() {\n $this->select = array( );\n $this->insert = array( 'INSERT INTO :entity (xxx) VALUES (yyy)' );\n $this->update = array( );\n $this->delete = array( );\n }", "public function query()\n {\n $insumo_query = Insumo::query();\n # OBRA\n $obra = Obra::find($this->request()->get('obra_id'));\n $insumos = $insumo_query->join('orcamentos', 'orcamentos.insumo_id', '=', 'insumos.id')\n ->where('orcamentos.obra_id', $this->request()->get('obra_id'))\n ->where('orcamentos.ativo', 1);\n\n // Verificar se existe OC aberta deste usuário ou se ele está editando alguma OC (SESSÃO)\n\n #dando prioridade a sessão\n $ordem = null;\n// \\Session::forget('ordemCompra');\n// \\Session::flush('ordemCompra');\n// dd(\\Session::get('ordemCompra'));\n if(\\Session::get('ordemCompra')){\n $ordem = OrdemDeCompra::where('id', \\Session::get('ordemCompra'))\n ->where('oc_status_id', 1)\n ->where('user_id', Auth::user()->id)\n ->where('obra_id', $obra->id)->first();\n }else {\n $ordem = OrdemDeCompra::where('oc_status_id', 1)\n ->where('user_id', Auth::user()->id)\n ->where('obra_id', $obra->id)->first();\n }\n\n $insumos->select(\n [\n 'insumos.id',\n 'insumos.codigo',\n 'insumos.nome',\n DB::raw(\"format(orcamentos.qtd_total,2,'de_DE') as qtd_total\"),\n DB::raw(\"CONCAT(insumos_sub.codigo,' - ' ,insumos_sub.nome) as substitui\"),\n 'orcamentos.id as orcamento_id',\n 'insumos.unidade_sigla',\n 'insumos.insumo_grupo_id',\n 'orcamentos.obra_id',\n 'orcamentos.grupo_id',\n 'orcamentos.subgrupo1_id',\n 'orcamentos.subgrupo2_id',\n 'orcamentos.subgrupo3_id',\n 'orcamentos.servico_id',\n 'orcamentos.preco_total',\n 'orcamentos.preco_unitario',\n 'orcamentos.insumo_incluido',\n 'orcamentos.orcamento_que_substitui',\n DB::raw('(SELECT\n CONCAT(codigo, \\' - \\', nome)\n FROM\n grupos\n WHERE\n orcamentos.grupo_id = grupos.id) AS tooltip_grupo'),\n DB::raw('(SELECT\n CONCAT(codigo, \\' - \\', nome)\n FROM\n grupos\n WHERE\n orcamentos.subgrupo1_id = grupos.id) AS tooltip_subgrupo1'),\n DB::raw('(SELECT\n CONCAT(codigo, \\' - \\', nome)\n FROM\n grupos\n WHERE\n orcamentos.subgrupo2_id = grupos.id) AS tooltip_subgrupo2'),\n DB::raw('(SELECT\n CONCAT(codigo, \\' - \\', nome)\n FROM\n grupos\n WHERE\n orcamentos.subgrupo3_id = grupos.id) AS tooltip_subgrupo3'),\n DB::raw('(SELECT\n CONCAT(codigo, \\' - \\', nome)\n FROM\n servicos\n WHERE\n orcamentos.servico_id = servicos.id) AS tooltip_servico'),\n DB::raw('format((\n orcamentos.qtd_total \n -\n (\n IFNULL(\n (\n SELECT sum(ordem_de_compra_itens.qtd) FROM ordem_de_compra_itens\n JOIN ordem_de_compras\n ON ordem_de_compra_itens.ordem_de_compra_id = ordem_de_compras.id\n WHERE ordem_de_compra_itens.insumo_id = orcamentos.insumo_id\n AND ordem_de_compra_itens.grupo_id = orcamentos.grupo_id\n AND ordem_de_compra_itens.subgrupo1_id = orcamentos.subgrupo1_id\n AND ordem_de_compra_itens.subgrupo2_id = orcamentos.subgrupo2_id\n AND ordem_de_compra_itens.subgrupo3_id = orcamentos.subgrupo3_id\n AND ordem_de_compra_itens.servico_id = orcamentos.servico_id\n AND (\n ordem_de_compra_itens.aprovado IS NULL\n OR\n ordem_de_compra_itens.aprovado = 1\n )\n AND ordem_de_compra_itens.deleted_at IS NULL\n AND ordem_de_compra_itens.data_dispensa IS NULL\n AND ordem_de_compras.obra_id ='. $obra->id .'\n AND ordem_de_compras.oc_status_id != 6\n AND ordem_de_compras.oc_status_id != 4\n ),0\n )\n )\n -\n (\n IFNULL(\n IFNULL(\n (\n SELECT sum(ordem_de_compra_itens.valor_total) FROM ordem_de_compra_itens\n JOIN ordem_de_compras\n ON ordem_de_compra_itens.ordem_de_compra_id = ordem_de_compras.id\n WHERE \n ordem_de_compra_itens.insumo_id in\n (\n SELECT \n insumo_id\n FROM\n orcamentos as OrcSub\n WHERE\n OrcSub.orcamento_que_substitui = orcamentos.id\n )\n AND ordem_de_compra_itens.grupo_id = orcamentos.grupo_id\n AND ordem_de_compra_itens.subgrupo1_id = orcamentos.subgrupo1_id\n AND ordem_de_compra_itens.subgrupo2_id = orcamentos.subgrupo2_id\n AND ordem_de_compra_itens.subgrupo3_id = orcamentos.subgrupo3_id\n AND ordem_de_compra_itens.servico_id = orcamentos.servico_id\n AND (\n ordem_de_compra_itens.aprovado IS NULL\n OR\n ordem_de_compra_itens.aprovado = 1\n )\n AND ordem_de_compra_itens.data_dispensa IS NULL\n AND ordem_de_compra_itens.deleted_at IS NULL\n AND ordem_de_compras.obra_id ='. $obra->id .'\n AND ordem_de_compras.oc_status_id != 6\n AND ordem_de_compras.oc_status_id != 4\n ),0\n ),0\n \n / orcamentos.preco_unitario\n \n )\n )\n ),2,\\'de_DE\\') as saldo'),\n // Colocar a OC se existir em aberto ou em sessão\n DB::raw('format((\n SELECT ordem_de_compra_itens.qtd FROM ordem_de_compra_itens\n JOIN ordem_de_compras\n ON ordem_de_compra_itens.ordem_de_compra_id = ordem_de_compras.id\n WHERE ordem_de_compra_itens.insumo_id = insumos.id\n AND ordem_de_compra_itens.grupo_id = orcamentos.grupo_id\n AND ordem_de_compra_itens.subgrupo1_id = orcamentos.subgrupo1_id\n AND ordem_de_compra_itens.subgrupo2_id = orcamentos.subgrupo2_id\n AND ordem_de_compra_itens.subgrupo3_id = orcamentos.subgrupo3_id\n AND ordem_de_compra_itens.servico_id = orcamentos.servico_id\n AND (\n ordem_de_compra_itens.aprovado IS NULL\n OR\n ordem_de_compra_itens.aprovado = 0\n )\n AND ordem_de_compra_itens.deleted_at IS NULL\n AND ordem_de_compras.obra_id ='. $obra->id .'\n AND ordem_de_compras.oc_status_id = 1\n '.($ordem ? ' AND ordem_de_compras.id ='. $ordem->id .' ': 'AND ordem_de_compras.id = 0').'\n ),2,\\'de_DE\\') as quantidade_compra'),\n DB::raw('format((\n SELECT ordem_de_compra_itens.qtd FROM ordem_de_compra_itens\n JOIN ordem_de_compras\n ON ordem_de_compra_itens.ordem_de_compra_id = ordem_de_compras.id\n WHERE ordem_de_compra_itens.insumo_id = insumos.id\n AND ordem_de_compra_itens.grupo_id = orcamentos.grupo_id\n AND ordem_de_compra_itens.subgrupo1_id = orcamentos.subgrupo1_id\n AND ordem_de_compra_itens.subgrupo2_id = orcamentos.subgrupo2_id\n AND ordem_de_compra_itens.subgrupo3_id = orcamentos.subgrupo3_id\n AND ordem_de_compra_itens.servico_id = orcamentos.servico_id\n AND (\n ordem_de_compra_itens.aprovado IS NULL\n OR\n ordem_de_compra_itens.aprovado = 0\n )\n AND ordem_de_compra_itens.deleted_at IS NULL\n AND ordem_de_compras.obra_id ='. $obra->id .'\n AND ordem_de_compras.oc_status_id = 1\n '.($ordem ? ' AND ordem_de_compras.id ='. $ordem->id .' ': 'AND ordem_de_compras.id = 0').'\n ),2,\\'de_DE\\') as quantidade_comprada'),\n DB::raw('(SELECT total FROM ordem_de_compra_itens\n JOIN ordem_de_compras\n ON ordem_de_compra_itens.ordem_de_compra_id = ordem_de_compras.id\n WHERE ordem_de_compra_itens.insumo_id = insumos.id\n AND ordem_de_compra_itens.grupo_id = orcamentos.grupo_id\n AND ordem_de_compra_itens.subgrupo1_id = orcamentos.subgrupo1_id\n AND ordem_de_compra_itens.subgrupo2_id = orcamentos.subgrupo2_id\n AND ordem_de_compra_itens.subgrupo3_id = orcamentos.subgrupo3_id\n AND ordem_de_compra_itens.servico_id = orcamentos.servico_id\n AND (\n ordem_de_compra_itens.aprovado IS NULL\n OR\n ordem_de_compra_itens.aprovado = 0\n )\n AND ordem_de_compra_itens.aprovado IS NULL\n AND ordem_de_compra_itens.deleted_at IS NULL\n AND ordem_de_compras.oc_status_id = 1\n '.($ordem ? ' AND ordem_de_compras.id ='. $ordem->id .' ': 'AND ordem_de_compras.id = 0').'\n AND ordem_de_compra_itens.obra_id ='. $obra->id .' ) as total'),\n DB::raw('(SELECT motivo_nao_finaliza_obra FROM ordem_de_compra_itens\n JOIN ordem_de_compras\n ON ordem_de_compra_itens.ordem_de_compra_id = ordem_de_compras.id\n WHERE ordem_de_compra_itens.insumo_id = insumos.id\n AND ordem_de_compra_itens.grupo_id = orcamentos.grupo_id\n AND ordem_de_compra_itens.subgrupo1_id = orcamentos.subgrupo1_id\n AND ordem_de_compra_itens.subgrupo2_id = orcamentos.subgrupo2_id\n AND ordem_de_compra_itens.subgrupo3_id = orcamentos.subgrupo3_id\n AND ordem_de_compra_itens.servico_id = orcamentos.servico_id\n AND (\n ordem_de_compra_itens.aprovado IS NULL\n OR\n ordem_de_compra_itens.aprovado = 0\n )\n AND ordem_de_compra_itens.aprovado IS NULL\n AND ordem_de_compra_itens.deleted_at IS NULL\n AND ordem_de_compras.oc_status_id = 1\n '.($ordem ? ' AND ordem_de_compras.id ='. $ordem->id .' ': 'AND ordem_de_compras.id = 0').'\n AND ordem_de_compra_itens.obra_id ='. $obra->id .' ) as motivo_nao_finaliza_obra'),\n ]\n )\n ->whereNotNull('orcamentos.qtd_total')\n ->where(DB::raw('IFNULL(\n (SELECT\n ordem_de_compras.oc_status_id\n FROM\n ordem_de_compra_itens\n JOIN\n ordem_de_compras ON ordem_de_compra_itens.ordem_de_compra_id = ordem_de_compras.id\n WHERE\n ordem_de_compra_itens.insumo_id = orcamentos.insumo_id\n AND ordem_de_compra_itens.grupo_id = orcamentos.grupo_id\n AND ordem_de_compra_itens.subgrupo1_id = orcamentos.subgrupo1_id\n AND ordem_de_compra_itens.subgrupo2_id = orcamentos.subgrupo2_id\n AND ordem_de_compra_itens.subgrupo3_id = orcamentos.subgrupo3_id\n AND ordem_de_compra_itens.servico_id = orcamentos.servico_id\n AND (ordem_de_compra_itens.aprovado IS NULL\n OR ordem_de_compra_itens.aprovado = 1)\n AND ordem_de_compra_itens.deleted_at IS NULL\n AND ordem_de_compras.obra_id = '. $obra->id .'\n AND ordem_de_compras.oc_status_id != 6\n AND ordem_de_compras.oc_status_id != 4\n AND orcamentos.orcamento_que_substitui IS NOT NULL\n LIMIT 1\n )\n , 1)'), 1)\n ->where('orcamentos.ativo', 1);\n\n $insumo_query->leftJoin(DB::raw('orcamentos orcamentos_sub'), 'orcamentos_sub.id', 'orcamentos.orcamento_que_substitui');\n //ex: left join insumos insumos_sub on `insumos_sub`.`id` = `orcamentos_sub`.`insumo_id` \n\t\t$insumo_query->leftJoin(DB::raw('insumos insumos_sub'), 'insumos_sub.id', 'orcamentos_sub.insumo_id');\n\t\t$insumo_query->leftJoin(DB::raw('carteira_insumos'), 'insumos.id', 'carteira_insumos.insumo_id');\n\t\t$insumo_query->leftJoin(DB::raw('carteiras'), 'carteiras.id', 'carteira_insumos.carteira_id');\n\n if ($this->request()->get('grupo_id')) {\n if (count($this->request()->get('grupo_id')) && $this->request()->get('grupo_id')[0] != \"\") {\n $insumo_query->where('orcamentos.grupo_id', $this->request()->get('grupo_id'));\n }\n }\n\n if($this->request()->get('subgrupo1_id')){\n if(count($this->request()->get('subgrupo1_id')) && $this->request()->get('subgrupo1_id')[0] != \"\") {\n $insumo_query->where('orcamentos.subgrupo1_id', $this->request()->get('subgrupo1_id'));\n }\n }\n if($this->request()->get('subgrupo2_id')){\n if(count($this->request()->get('subgrupo2_id')) && $this->request()->get('subgrupo2_id')[0] != \"\") {\n $insumo_query->where('orcamentos.subgrupo2_id', $this->request()->get('subgrupo2_id'));\n }\n }\n if($this->request()->get('subgrupo3_id')){\n if(count($this->request()->get('subgrupo3_id')) && $this->request()->get('subgrupo3_id')[0] != \"\") {\n $insumo_query->where('orcamentos.subgrupo3_id', $this->request()->get('subgrupo3_id'));\n }\n }\n if($this->request()->get('servico_id')){\n if(count($this->request()->get('servico_id')) && $this->request()->get('servico_id')[0] != \"\") {\n $insumo_query->where('orcamentos.servico_id', $this->request()->get('servico_id'));\n }\n }\n if($this->request()->get('planejamento_id')){\n if(count($this->request()->get('planejamento_id')) && $this->request()->get('planejamento_id')[0] != \"\") {\n $insumo_query->join('planejamento_compras', function ($join) {\n $join->on('planejamento_compras.grupo_id', 'orcamentos.grupo_id');\n $join->on('planejamento_compras.subgrupo1_id', 'orcamentos.subgrupo1_id');\n $join->on('planejamento_compras.subgrupo2_id', 'orcamentos.subgrupo2_id');\n $join->on('planejamento_compras.subgrupo3_id', 'orcamentos.subgrupo3_id');\n $join->on('planejamento_compras.servico_id', 'orcamentos.servico_id');\n $join->on('planejamento_compras.insumo_id', 'orcamentos.insumo_id');\n })\n ->where('planejamento_compras.planejamento_id', $this->request()->get('planejamento_id'))\n ->whereNull('planejamento_compras.deleted_at');\n }\n }\n\t\t\n if($this->request()->get('insumo_grupos_id')){\n if(count($this->request()->get('insumo_grupos_id')) && $this->request()->get('insumo_grupos_id')[0] != \"\") {\n $insumo_query->where('insumos.insumo_grupo_id', $this->request()->get('insumo_grupos_id'));\n }\n }\n\t\t\n\t\tif($this->request()->get('carteira_id')){\n if(count($this->request()->get('carteira_id')) && $this->request()->get('carteira_id')[0] != \"\") {\n $insumo_query->where('carteiras.id', $this->request()->get('carteira_id'));\n }\n }\n\n//\t\tif($this->request()->get('exibir_por_carteira')){\n// if(count($this->request()->get('exibir_por_carteira')) && $this->request()->get('exibir_por_carteira')[0] != \"\") {\n// $insumo_query->groupBy('carteiras.nome');\n// }\n// }\n\n Session::put(['query['.$this->request()->get('random').']' => $insumo_query->toSql(), 'bindings['.$this->request()->get('random').']' => $insumo_query->getBindings()]);\n\n return $this->applyScopes($insumo_query);\n }", "public function run()\n {\n DB::statement(\"SELECT SETVAL('beneficiarios.bajas_id_seq', COALESCE(MAX(id), 1) ) FROM beneficiarios.bajas;\");\n\t\tDB::statement(\"SELECT SETVAL('beneficiarios.categorias_nacer_id_seq', COALESCE(MAX(id), 1) ) FROM beneficiarios.categorias_nacer;\");\n\t\tDB::statement(\"SELECT SETVAL('beneficiarios.ceb_id_seq', COALESCE(MAX(id), 1) ) FROM beneficiarios.ceb;\");\n\t\tDB::statement(\"SELECT SETVAL('beneficiarios.contacto_id_seq', COALESCE(MAX(id), 1) ) FROM beneficiarios.contacto;\");\n\t\tDB::statement(\"SELECT SETVAL('beneficiarios.embarazos_id_seq', COALESCE(MAX(id), 1) ) FROM beneficiarios.embarazos;\");\n\t\tDB::statement(\"SELECT SETVAL('beneficiarios.periodos_id_seq', COALESCE(MAX(id), 1) ) FROM beneficiarios.periodos;\");\n\t\tDB::statement(\"SELECT SETVAL('beneficiarios.score_id_seq', COALESCE(MAX(id), 1) ) FROM beneficiarios.score;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.grupos_etarios_cei_id_seq', COALESCE(MAX(id), 1) ) FROM cei.grupos_etarios_cei;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.indicadores_calculo_id_seq', COALESCE(MAX(id), 1) ) FROM cei.indicadores_calculo;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.indicadores_calculo_indicador_seq', COALESCE(MAX(indicador), 1) ) FROM cei.indicadores_calculo;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.indicadores_denominadores_id_seq', COALESCE(MAX(id), 1) ) FROM cei.indicadores_denominadores;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.indicadores_detalle_id_seq', COALESCE(MAX(id), 1) ) FROM cei.indicadores_detalle;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.indicadores_id_seq', COALESCE(MAX(id), 1) ) FROM cei.indicadores;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.indicadores_tipo_id_seq', COALESCE(MAX(id), 1) ) FROM cei.indicadores_tipo;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.lineas_cuidado_cei_id_seq', COALESCE(MAX(id), 1) ) FROM cei.lineas_cuidado_cei;\");\n\t\tDB::statement(\"SELECT SETVAL('cei.resultados_id_seq', COALESCE(MAX(id), 1) ) FROM cei.resultados;\");\n\t\tDB::statement(\"SELECT SETVAL('chat.conversaciones_id_seq', COALESCE(MAX(id), 1) ) FROM chat.conversaciones;\");\n\t\tDB::statement(\"SELECT SETVAL('chat.mensajes_id_seq', COALESCE(MAX(id), 1) ) FROM chat.mensajes;\");\n\t\tDB::statement(\"SELECT SETVAL('comprobantes.comprobantes_id_seq', COALESCE(MAX(id), 1) ) FROM comprobantes.comprobantes;\");\n\t\tDB::statement(\"SELECT SETVAL('consultas.automaticas_id_consulta_seq', COALESCE(MAX(id_consulta), 1) ) FROM consultas.automaticas;\");\n\t\tDB::statement(\"SELECT SETVAL('consultas.estandar_id_consulta_seq', COALESCE(MAX(id_consulta), 1) ) FROM consultas.estandar;\");\n\t\tDB::statement(\"SELECT SETVAL('ddjj.backup_id_impresion_seq', COALESCE(MAX(id_impresion), 1) ) FROM ddjj.backup;\");\n\t\tDB::statement(\"SELECT SETVAL('ddjj.doiu9_id_impresion_seq', COALESCE(MAX(id_impresion), 1) ) FROM ddjj.doiu9;\");\n\t\tDB::statement(\"SELECT SETVAL('ddjj.sirge_id_impresion_seq', COALESCE(MAX(id_impresion), 1) ) FROM ddjj.sirge;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.addendas_id_seq', COALESCE(MAX(id), 1) ) FROM efectores.addendas;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.categorias_ppac_id_categoria_seq', COALESCE(MAX(id_categoria), 1) ) FROM efectores.categorias_ppac;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.compromiso_gestion_id_compromiso_seq', COALESCE(MAX(id_compromiso), 1) ) FROM efectores.compromiso_gestion;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.convenio_administrativo_id_convenio_seq', COALESCE(MAX(id_convenio), 1) ) FROM efectores.convenio_administrativo;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.efectores_addendas_id_seq', COALESCE(MAX(id), 1) ) FROM efectores.efectores_addendas;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.efectores_id_efector_seq', COALESCE(MAX(id_efector), 1) ) FROM efectores.efectores;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.efectores_neonatales_id_seq', COALESCE(MAX(id), 1) ) FROM efectores.efectores_neonatales;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.efectores_obstetricos_id_seq', COALESCE(MAX(id), 1) ) FROM efectores.efectores_obstetricos;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.email_id_email_seq', COALESCE(MAX(id_email), 1) ) FROM efectores.email;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.operaciones_id_operacion_seq', COALESCE(MAX(id_operacion), 1) ) FROM efectores.operaciones;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.referentes_id_referente_seq', COALESCE(MAX(id_referente), 1) ) FROM efectores.referentes;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.telefonos_id_telefono_seq', COALESCE(MAX(id_telefono), 1) ) FROM efectores.telefonos;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.tipo_categorizacion_id_categorizacion_seq', COALESCE(MAX(id_categorizacion), 1) ) FROM efectores.tipo_categorizacion;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.tipo_dependencia_administrati_id_dependencia_administrativa_seq', COALESCE(MAX(id_dependencia_administrativa), 1) ) FROM efectores.tipo_dependencia_administrativa;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.tipo_efector_id_tipo_efector_seq', COALESCE(MAX(id_tipo_efector), 1) ) FROM efectores.tipo_efector;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.tipo_estado_id_estado_seq', COALESCE(MAX(id_estado), 1) ) FROM efectores.tipo_estado;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.tipo_operacion_id_operacion_seq', COALESCE(MAX(id_operacion), 1) ) FROM efectores.tipo_operacion;\");\n\t\tDB::statement(\"SELECT SETVAL('efectores.tipo_telefono_id_tipo_telefono_seq', COALESCE(MAX(id_tipo_telefono), 1) ) FROM efectores.tipo_telefono;\");\n\t\tDB::statement(\"SELECT SETVAL('estadisticas.graficos_id_seq', COALESCE(MAX(id), 1) ) FROM estadisticas.graficos;\");\n\t\tDB::statement(\"SELECT SETVAL('estadisticas.reportes_id_seq', COALESCE(MAX(id), 1) ) FROM estadisticas.reportes;\");\n\t\tDB::statement(\"SELECT SETVAL('fondos.fondos_id_seq', COALESCE(MAX(id), 1) ) FROM fondos.fondos;\");\n\t\tDB::statement(\"SELECT SETVAL('geo.departamentos_id_seq', COALESCE(MAX(id), 1) ) FROM geo.departamentos;\");\n\t\tDB::statement(\"SELECT SETVAL('geo.entidades_id_seq', COALESCE(MAX(id), 1) ) FROM geo.entidades;\");\n\t\tDB::statement(\"SELECT SETVAL('geo.localidades_id_seq', COALESCE(MAX(id), 1) ) FROM geo.localidades;\");\n\t\tDB::statement(\"SELECT SETVAL('geo.regiones_id_region_seq', COALESCE(MAX(id_region), 1) ) FROM geo.regiones;\");\n\t\tDB::statement(\"SELECT SETVAL('indicadores.indicadores_medica_id_seq', COALESCE(MAX(id), 1) ) FROM indicadores.indicadores_medica;\");\n\t\tDB::statement(\"SELECT SETVAL('indicadores.indicadores_medica_rangos_id_rango_indicador_seq', COALESCE(MAX(id_rango_indicador), 1) ) FROM indicadores.indicadores_medica_rangos;\");\n\t\tDB::statement(\"SELECT SETVAL('indicadores.indicadores_priorizados_anual_id_seq', COALESCE(MAX(id), 1) ) FROM indicadores.indicadores_priorizados_anual;\");\n\t\tDB::statement(\"SELECT SETVAL('indicadores.indicadores_priorizados_id_seq', COALESCE(MAX(id), 1) ) FROM indicadores.indicadores_priorizados;\");\n\t\tDB::statement(\"SELECT SETVAL('indicadores.metas_efectores_priorizados_id_seq', COALESCE(MAX(id), 1) ) FROM indicadores.metas_efectores_priorizados;\");\n\t\tDB::statement(\"SELECT SETVAL('logs.logins_id_seq', COALESCE(MAX(id_inicio), 1) ) FROM logs.logins;\");\n\t\tDB::statement(\"SELECT SETVAL('logs.rechazos_id_seq', COALESCE(MAX(id), 1) ) FROM logs.rechazos;\");\n\t\tDB::statement(\"SELECT SETVAL('mobile.reporte_problemas_id_problema_seq', COALESCE(MAX(id_problema), 1) ) FROM mobile.reporte_problemas;\");\n\t\tDB::statement(\"SELECT SETVAL('mobile.tipo_familiar_id_tipo_familiar_seq', COALESCE(MAX(id_tipo_familiar), 1) ) FROM mobile.tipo_familiar;\");\n\t\tDB::statement(\"SELECT SETVAL('mobile.usuarios_id_usuario_seq', COALESCE(MAX(id_usuario), 1) ) FROM mobile.usuarios;\");\n\t\tDB::statement(\"SELECT SETVAL('prestaciones.prestaciones_id_seq', COALESCE(MAX(id), 1) ) FROM prestaciones.prestaciones;\");\n\t\tDB::statement(\"SELECT SETVAL('prestaciones.rechazos_migracion_id_seq', COALESCE(MAX(id), 1) ) FROM prestaciones.rechazos_migracion;\");\n\t\tDB::statement(\"SELECT SETVAL('puco.obras_sociales_id_osp_seq', COALESCE(MAX(id_osp), 1) ) FROM puco.obras_sociales;\");\n\t\tDB::statement(\"SELECT SETVAL('puco.sss_temp_id_osp_prueba_seq', COALESCE(MAX(id_osp_prueba), 1) ) FROM puco.sss_temp;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.areas_id_area_seq', COALESCE(MAX(id_area), 1) ) FROM sistema.areas;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.clases_documento_id_seq', COALESCE(MAX(id), 1) ) FROM sistema.clases_documento;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.consultas_mensuales_id_seq', COALESCE(MAX(id), 1) ) FROM sistema.consultas_mensuales;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.entidades_id_seq', COALESCE(MAX(id), 1) ) FROM sistema.entidades;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.estados_id_estado_seq', COALESCE(MAX(id_estado), 1) ) FROM sistema.estados;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.lotes_lote_seq', COALESCE(MAX(lote), 1) ) FROM sistema.lotes;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.menues_id_menu_seq', COALESCE(MAX(id_menu), 1) ) FROM sistema.menues;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.modulos_id_modulo_seq', COALESCE(MAX(id_modulo), 1) ) FROM sistema.modulos;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.modulos_menu_id_relacion_seq', COALESCE(MAX(id_relacion), 1) ) FROM sistema.modulos_menu;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.padrones_id_padron_seq', COALESCE(MAX(id_padron), 1) ) FROM sistema.padrones;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.parametros_id_parametro_seq', COALESCE(MAX(id_parametro), 1) ) FROM sistema.parametros;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.regiones_id_region_seq', COALESCE(MAX(id_region), 1) ) FROM sistema.regiones;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.sexos_id_sexo_seq', COALESCE(MAX(id_sexo), 1) ) FROM sistema.sexos;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.subidas_id_subida_seq', COALESCE(MAX(id_subida), 1) ) FROM sistema.subidas;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.sugerencias_id_sugerencia_seq', COALESCE(MAX(id_sugerencia), 1) ) FROM sistema.sugerencias;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.tipo_documento_id_tipo_documento_seq', COALESCE(MAX(id_tipo_documento), 1) ) FROM sistema.tipo_documento;\");\n\t\tDB::statement(\"SELECT SETVAL('sistema.usuarios_id_usuario_seq', COALESCE(MAX(id_usuario), 1) ) FROM sistema.usuarios;\");\n\t\tDB::statement(\"SELECT SETVAL('solicitudes.estados_id_seq', COALESCE(MAX(id), 1) ) FROM solicitudes.estados;\");\n\t\tDB::statement(\"SELECT SETVAL('solicitudes.grupos_id_seq', COALESCE(MAX(id), 1) ) FROM solicitudes.grupos;\");\n\t\tDB::statement(\"SELECT SETVAL('solicitudes.operadores_id_seq', COALESCE(MAX(id), 1) ) FROM solicitudes.operadores;\");\n\t\tDB::statement(\"SELECT SETVAL('solicitudes.prioridades_id_seq', COALESCE(MAX(id), 1) ) FROM solicitudes.prioridades;\");\n\t\tDB::statement(\"SELECT SETVAL('solicitudes.solicitudes_id_seq', COALESCE(MAX(id), 1) ) FROM solicitudes.solicitudes;\");\n\t\tDB::statement(\"SELECT SETVAL('solicitudes.tipo_solicitud_id_seq', COALESCE(MAX(id), 1) ) FROM solicitudes.tipo_solicitud;\");\n }", "function showSnows()\n{\n\n $requete = \"SELECT id, code, brand, model, snowLength,qtyAvailable,description,dailyPrice,photo,active FROM snows;\";\n $request = executeQuery($requete);\n\n return $request;\n}", "public function test_executeQuery()\n\t{\n\t}", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function viewVotingInformation()\r\n{\r\n $query_string = \"SELECT systemname, systeminformation FROM voting_system\";\r\n $query_string .= \"WHERE systemid = :systemid\";\r\n\r\n return $query_string;\r\n}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "public function index()\n\t{\n\t\t// $this->model->first();\n\t\t// $data = $this->model->where('userid', 18)->findAll();\n\t\t// $data = $this->model->where('userid', 18)->orderBy('firstname','asc')->findAll();\n\t\t// return $this->respond($data);\n\n\t\techo \"hii\";\n\t\t// echo $this->model->getLastQuery();\n\t}", "public function giveOrGet(){\n //$pass = $this->db->query($result);\n \n }", "public function index()\n {\n $sql = <<<EOT\n SELECT ms.id, ms.mamuon, ms.ngaymuon, ms.hantra, ms.soluong, ms.ngaytra, ms.tinhtrang, \n dg.tendocgia, dg.chucvu, dg.gioitinh, dg.namsinh, dg.diachi, dg.sdt, dg.email, dg.quequan,\n tt.tenthuthu, tt.mathuthu, tt.chucvu, tt.gioitinh, tt.namsinh, tt.diachi, tt.sdt, tt.email, tt.quequan,\n s.tensach, s.tentacgia, tl.tentheloai, xb.tennxb\n FROM qltv_muonsach ms\n JOIN qltv_docgia dg ON dg.id = ms.docgia_id\n JOIN qltv_thuthu tt ON tt.id = ms.thuthu_id\n JOIN qltv_sach s ON s.id = ms.sach_id\n JOIN qltv_theloai tl ON tl.id = s.theloai_id\n JOIN qltv_nxb xb ON xb.id = s.nxb_id\n GROUP BY ms.id, ms.mamuon, ms.ngaymuon, ms.hantra, ms.soluong, ms.ngaytra, ms.tinhtrang,\n dg.tendocgia, dg.chucvu, dg.gioitinh, dg.namsinh, dg.diachi, dg.sdt, dg.email, dg.quequan,\n tt.tenthuthu, tt.mathuthu, tt.chucvu, tt.gioitinh, tt.namsinh, tt.diachi, tt.sdt, tt.email, tt.quequan,\n s.tensach, s.tentacgia, tl.tentheloai, xb.tennxb\nEOT; //chuỗi có xuống dòng\n // Raw SQL\n\n $list = DB::select($sql); // Phân trang cho dữ liệu\n //$users= DB::table('qltv_muonsach'); // Hiển thị Phân Trang\n return view('backend.muonsach.index')\n ->with('listMuonsach', $list);\n }", "private function _getDatatablesQuery()\n {\n $this->query = DB::table($this->table);\n $this->query->leftJoin('categories', 'categories.id', '=', 'documents.category_id');\n $this->query->select('documents.stt', 'documents.id', 'documents.title','documents.updated_at');\n\n if (strpos(URL::current(), 'admin') < 0) {\n $this->query->where('categories.searchable', 1);\n }\n\n if (Input::get('cat'))\n $this->query->where('documents.category_id', Input::get('cat'));\n\n if (Input::get('isBuyed')) {\n $this->query->join('users_documents', 'users_documents.document_id', '=', 'documents.stt');\n $this->query->where('users_documents.user_id', Auth::user()->id);\n }\n\n if(Input::has('search.value')) {\n $this->_getSearchStringQuery();\n }\n\n // here order processing\n if (isset($_GET['order'])) {\n $this->query->orderBy(\n $this->column_order[$_GET['order']['0']['column']],\n $_GET['order']['0']['dir']\n );\n } else if (isset($this->order)) {\n $order = $this->order;\n $this->query->orderBy(key($order), $order[key($order)]);\n }\n }", "public function executeNoDb()\n {\n //return Request::emptyResponse();\n }", "public function readAction() {\n\t\tif(getParam('id')){\n\t\t\t$model = new $this->model(intval(getParam('id')));\n\t\t\t$records = array(\n\t\t\t\t$this->formatRow($model->get())\n\t\t\t);\n\t\t\t$this->setParam('records', $records);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// get submitted params\n\t\t$sortBy = getParam('sort', false);\n\t\t$filter = json_decode(getParam('filter', '{}'), true);\n\t\t\n\t\t// Setup the filtering and query variables\n\t\t$start = intval(getParam('start', 0));\n\t\t$limit = intval(getParam('limit', 0));\n\t\t\n\t\t//Fields to select\n\t\t$fields = $this->getFields();\n\t\t\n\t\t//From to use\n\t\t$from = $this->getFrom();\n\t\t\n\t\t//Join tables\n\t\t$join = $this->getJoin();\n\t\t\n\t\t//Base where clause\n\t\t$where = $this->getWhere();\n\t\t\n\t\t//Sort\n\t\t$sort = $this->getSort();\n\t\t\n\t\tif ($sortBy) {\n\t\t\t$sortArray = json_decode($sortBy, true);\n\t\t\t$numSorters = count($sortArray);\n\t\t\t$sort = array();\n\t\t\tfor ($i = 0; $i < $numSorters; $i++) {\n\t\t\t\t$sort[] = $sortArray[$i]['property'] . ' ' . $sortArray[$i]['direction'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Filter\n\t\t$where = array_merge($where, $this->applyFilter($filter));\n\t\t\n\n\t\t\n\t\t// convert query data to sql\n\t\t$fieldsSql = implode(',', $fields);\n\t\t$fromSql = ' FROM ' . implode(',', $from);\n\t\t$joinSql = implode(' ', $join);\n\t\t$whereSql = 'WHERE ' . implode(' AND ', $where);\n\t\tif (!count($where)) {\n\t\t\t$whereSql = '';\n\t\t}\n\t\t$sortSql = implode(',', $sort);\n\n\t\t// get total count\n\t\t$total = 0;\n\t\t$totalQuery = \"SELECT COUNT(*) total $fromSql $joinSql $whereSql\";\n\t\t$row = LP_Db::fetchRow($totalQuery);\n\t\tif ($row) {\n\t\t\t$total = $row['total'];\n\t\t}\n\t\t$this->setParam('total', $total);\n\t\t\n\t\t// get records\n\t\t$query = \"SELECT $fieldsSql $fromSql $joinSql $whereSql\";\n\t\t$this->setParam('query', $query);\n\t\tif($limit){\n\t\t\t$query = LP_Util::buildQuery($query, $sortSql, $limit, $start);\n\t\t}\n\t\t$rows = LP_Db::fetchAll($query);\n\t\t$numRows = count($rows);\n\t\t$records = array();\n\t\t\n\t\t//Format rows\n\t\tforeach ($rows as $row){\n\t\t\t$records[] = $this->formatRow($row);\n\t\t}\n\t\t\n\t\t$this->setParam('records', $records);\n\t}", "public function viewVotingSummary()\r\n{\r\n $query_string = \"SELECT systemid, systemname, systemsummary \";\r\n $query_string .= \"FROM voting_system \";\r\n $query_string .= \"WHERE systemtypeid = :systemtypeid\";\r\n\r\n return $query_string;\r\n}", "public static function query();", "public function preRetrieve();", "function verifiRentsDetails($id)\n{\n\n $requete = \"SELECT idSnow FROM rentsdetails where idSnow='$id';\";\n $request = executeQuery($requete);\n\n\n return $request;\n}", "public function actionIndex()\n {\n $query = new Query();\n $query->select(['COUNT(*)','value'=>'status']);\n $query->from([Status::tableName()]);\n $query->groupBy('value');\n $query->orderBy(['count'=>SORT_ASC]);\n return $query->all();\n // return $query->createCommand()->sql;\n }", "public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }", "public function filtrar(){\n\n \t\t$sql=\"select * from __________ where ;\";\n \t return $this->ejecutar($sql); \n\n }", "public function run()\n {\n\n $detail = new Detail();\n $detail->name = 'Sin Gestion';\n $detail->status_id = 1;\n $detail->save();\n\n // Potencial Cliente = 1\n\n $detail = new Detail();\n $detail->name = 'En Gestion';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Positivo con Correo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Positivo sin Correo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'No Contesta';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Solicitud de Muestras';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Agregado';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Correo por Confirmar';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Devuelto';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Envia lista de Precio';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Envio de Catalogo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Futuros Productos';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Posible';\n $detail->status_id = 1;\n $detail->save();\n\n\n\n // Muestras = 2\n\n\n $detail = new Detail();\n $detail->name = 'Sin Contactar';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Por Concretar Venta';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'En Seguimiento';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Muestras';\n $detail->status_id = 2;\n $detail->save();\n\n // Rechazos = 3\n $detail = new Detail();\n $detail->name = 'Usan Tomates Naturales';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Precio';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan Salsa para Pizza';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan Concentrado';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan otro Producto';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Presetacion';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Rechazado';\n $detail->status_id = 3;\n $detail->save();\n\n\n // Clientes Activos = 4\n\n $detail = new Detail();\n $detail->name = 'Baja';\n $detail->status_id = 4;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Promesa de Compra';\n $detail->status_id = 4;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Venta';\n $detail->status_id = 4;\n $detail->save();\n\n\n // Bajas = 5\n\n\n $detail = new Detail();\n $detail->name = 'Precio';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Motivos Administrativos';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Falta de Seguimiento';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Calidad del Producto';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Otros';\n $detail->status_id = 5;\n $detail->save();\n\n }", "protected function prepareSelectStatement() {}", "abstract protected function model();", "abstract protected function model();", "public function index(){\n dd('abcdefg');\n $dbData=DB::connection('sqlsrvkenya')->select(\"SELECT * FROM tblEmployee INNER JOIN tblEmployee_Contact ON tblEmployee_Contact.Emp_Id=tblEmployee.Emp_Id\");\n\n $results=$this->getUnique($dbData);\n // echo json_encode($results);\n if($this->insert($results)){\n return redirect()->back();\n }else{\n return redirect()->back();\n }\n\n }", "public function getSQL();", "public function run()\n {\n $_ = \\DB::statement('SELECT @@GLOBAL.foreign_key_checks');\n \\DB::statement('set foreign_key_checks = 0');\n \\Milestone\\Appframe\\Model\\ResourceActionMethod::query()\n ->create([\t'id' => '803301', \t'resource_action' => '803201', \t'type' => 'Form', \t'idn1' => '800901', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803302', \t'resource_action' => '803202', \t'type' => 'List', \t'idn1' => '802201', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803303', \t'resource_action' => '803203', \t'type' => 'Form', \t'idn1' => '800902', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803304', \t'resource_action' => '803204', \t'type' => 'List', \t'idn1' => '802202', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803305', \t'resource_action' => '803205', \t'type' => 'ManageRelation', \t'idn1' => '800804', \t'idn2' => '802201', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803306', \t'resource_action' => '803206', \t'type' => 'ListRelation', \t'idn1' => '800805', \t'idn2' => '802209', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803307', \t'resource_action' => '803207', \t'type' => 'ListRelation', \t'idn1' => '802203', \t'idn2' => '802204', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803308', \t'resource_action' => '803208', \t'type' => 'List', \t'idn1' => '802204', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803309', \t'resource_action' => '803209', \t'type' => 'List', \t'idn1' => '802207', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803310', \t'resource_action' => '803210', \t'type' => 'FormWithData', \t'idn1' => '800903', \t'idn2' => '802701', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803311', \t'resource_action' => '803211', \t'type' => 'FormWithData', \t'idn1' => '800904', \t'idn2' => '802701', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803312', \t'resource_action' => '803212', \t'type' => 'Data', \t'idn1' => '802701', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803313', \t'resource_action' => '803213', \t'type' => 'FormWithData', \t'idn1' => '800905', \t'idn2' => '802701', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803314', \t'resource_action' => '803214', \t'type' => 'ListRelation', \t'idn1' => '800806', \t'idn2' => '802210', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803315', \t'resource_action' => '803215', \t'type' => 'Form', \t'idn1' => '800906', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803316', \t'resource_action' => '803216', \t'type' => 'List', \t'idn1' => '802211', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803317', \t'resource_action' => '803217', \t'type' => 'List', \t'idn1' => '802212', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803318', \t'resource_action' => '803218', \t'type' => 'ListRelation', \t'idn1' => '800813', \t'idn2' => '802210', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803319', \t'resource_action' => '803219', \t'type' => 'ListRelation', \t'idn1' => '800813', \t'idn2' => '802207', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803320', \t'resource_action' => '803220', \t'type' => 'ListRelation', \t'idn1' => '800813', \t'idn2' => '802204', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803321', \t'resource_action' => '803221', \t'type' => 'AddRelation', \t'idn1' => '800809', \t'idn2' => '800902', \t'idn3' => '801006', \t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803322', \t'resource_action' => '803222', \t'type' => 'FormWithData', \t'idn1' => '800901', \t'idn2' => '802702', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803323', \t'resource_action' => '803223', \t'type' => 'FormWithData', \t'idn1' => '800906', \t'idn2' => '802704', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803324', \t'resource_action' => '803224', \t'type' => 'FormWithData', \t'idn1' => '800902', \t'idn2' => '802703', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803325', \t'resource_action' => '803225', \t'type' => 'List', \t'idn1' => '802213', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803326', \t'resource_action' => '803226', \t'type' => 'FormWithData', \t'idn1' => '800907', \t'idn2' => '802705', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803327', \t'resource_action' => '803227', \t'type' => 'FormWithData', \t'idn1' => '800908', \t'idn2' => '802701', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803328', \t'resource_action' => '803228', \t'type' => 'Form', \t'idn1' => '800909', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803329', \t'resource_action' => '803229', \t'type' => 'List', \t'idn1' => '802216', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803330', \t'resource_action' => '803230', \t'type' => 'FormWithData', \t'idn1' => '800909', \t'idn2' => '802706', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803331', \t'resource_action' => '803231', \t'type' => 'ManageRelation', \t'idn1' => '800815', \t'idn2' => '802216', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803332', \t'resource_action' => '803232', \t'type' => 'ManageRelation', \t'idn1' => '800814', \t'idn2' => '802202', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803333', \t'resource_action' => '803233', \t'type' => 'ManageRelation', \t'idn1' => '800801', \t'idn2' => '802202', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803334', \t'resource_action' => '803234', \t'type' => 'ManageRelation', \t'idn1' => '800816', \t'idn2' => '802201', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803335', \t'resource_action' => '803235', \t'type' => 'ManageRelation', \t'idn1' => '800817', \t'idn2' => '802216', \t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803336', \t'resource_action' => '803236', \t'type' => 'List', \t'idn1' => '802217', \t\t\t\t\t\t\t\t\t\t\t\t])\n ->create([\t'id' => '803337', \t'resource_action' => '803237', \t'type' => 'List', \t'idn1' => '802218', \t\t\t\t\t\t\t\t\t\t\t\t])\n ;\n \\DB::statement('set foreign_key_checks = ' . $_);\n }", "public function fetchResult();", "protected abstract function model();", "public abstract function get_query();", "public function actionIndex2()\r\n\t{\r\n\t\t// calling line :\r\n\t\t/*\r\n\t\thttp://www.k-m.ru/app2/index.php?r=backend/index&Table=Assortment&_dc=1401196798272&page=1&start=0&limit=20&filter[0][field]=price&filter[0][data][type]=numeric&filter[0][data][comparison]=lt&filter[0][data][value]=5&filter[0][field]=price&filter[0][data][type]=numeric&filter[0][data][comparison]=lt&filter[0][data][value]=56&filter[1][field]=size&filter[1][data][type]=list&filter[1][data][value]=medium,large\r\n\t\t*/\r\n// filter[0][operator]=OR&filter[0][field]=title&filter[0][data][type]=string&filter[0][data][value]=ela\r\n\t\t$ModelName = $_GET['Table'];\t\t\r\n\t/*\tif (!class_exists($ModelName, false)) \r\n\t\t\treturn json_encode(array('success'=> false , 'msg'=> Yii::t('general', 'There is no such class in the system')));*/\r\n\t\t\t\r\n\t\t$table_name = 'tarex_' . strtolower($ModelName);\r\n\t\t// collect request parameters\r\n\t\t$offset = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;\r\n\t\t$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : 50;\r\n\t\t$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';\r\n\t\t$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';\r\n\t\t$filters = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : null;\r\n\t\t\r\n\t\t// GridFilters sends filters as an Array if not json encoded\r\n\t\tif (is_array($filters)) {\r\n\t\t\t$encoded = false;\r\n\t\t} else {\r\n\t\t\t$encoded = true;\r\n\t\t\t$filters = json_decode($filters);\r\n\t\t}\r\n\t\t\r\n\t\t$where = ' 0 = 0 ';\r\n\t\t$qs = '';\r\n\r\n\t\t// loop through filters sent by client\r\n\t\tif (is_array($filters)) {\r\n\t\t\tfor ($i=0;$i<count($filters);$i++){\r\n\t\t\t\t$filter = $filters[$i];\r\n\r\n\t\t\t\t// assign filter data (location depends if encoded or not)\r\n\t\t\t\tif ($encoded) {\r\n\t\t\t\t\t$field = $filter->field;\r\n\t\t\t\t\t$value = $filter->value;\r\n\t\t\t\t\t$compare = isset($filter->comparison) ? $filter->comparison : null;\r\n\t\t\t\t\t$filterType = $filter->type;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$field = $filter['field'];\r\n\t\t\t\t\t$value = $filter['data']['value'];\r\n\t\t\t\t\t$compare = isset($filter['data']['comparison']) ? $filter['data']['comparison'] : null;\r\n\t\t\t\t\t$filterType = $filter['data']['type'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch($filterType){\r\n\t\t\t\t\tcase 'string' : $qs .= \" AND \".$field.\" LIKE '%\".$value.\"%' \"; Break;\r\n\t\t\t\t\tcase 'list' :\r\n\t\t\t\t\t\tif (strstr($value,',')){\r\n\t\t\t\t\t\t\t$fi = explode(',',$value);\r\n\t\t\t\t\t\t\tfor ($q=0;$q<count($fi);$q++){\r\n\t\t\t\t\t\t\t\t$fi[$q] = \"'\".$fi[$q].\"'\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$value = implode(',',$fi);\r\n\t\t\t\t\t\t\t$qs .= \" AND \".$field.\" IN (\".$value.\")\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$qs .= \" AND \".$field.\" = '\".$value.\"'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t\tcase 'boolean' : $qs .= \" AND \".$field.\" = \".($value); Break;\r\n\t\t\t\t\tcase 'numeric' :\r\n\t\t\t\t\t\tswitch ($compare) {\r\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND \".$field.\" = \".$value; Break;\r\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND \".$field.\" < \".$value; Break;\r\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND \".$field.\" > \".$value; Break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t\tcase 'date' :\r\n\t\t\t\t\t\tswitch ($compare) {\r\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND \".$field.\" = '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND \".$field.\" < '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND \".$field.\" > '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$where .= $qs;\r\n\t\t}\r\n\t\t\r\n\t\t$query = \"SELECT * FROM {$table_name} WHERE \" . $where;\r\n\t\t/// \"SELECT COUNT(id) FROM demo WHERE \".$where\r\n\t\t$sql = \"SELECT COUNT(*) FROM {$table_name} WHERE \" . $where;\r\n\t\theader('Content-type:text/html; charset=utf-8');\r\n\t\techo '$sql=', $sql, '<br>';\r\n\t\t$data_count = Yii::app()->db->createCommand($sql)->queryScalar();\r\n\t\t//$data_count = CActiveRecord::model($ModelName)->count($criteria);\r\n\t\techo '$sql count = ' , $data_count, '<br>';\r\n\t\t\r\n\t\t// добавление сортировки и ограничений на вывод\r\n\t\tif ($sort != \"\") {\r\n\t\t\t$query .= \" ORDER BY \".$sort.\" \".$dir;\r\n\t\t}\t\t\r\n\t\t//$query .= \" LIMIT \".$offset.\",\".$limit;\r\n\t\t\r\n\t\t//echo 'запрос с сортировкой и ограничением на вывод: $query = ', $query, '<br><br>'; // показ окончательного запроса\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$criteria = new CDbCriteria;\t \r\n\t\t//$data_count = CActiveRecord::model($ModelName)->count($criteria); \r\n\t\t\r\n\t\t//$criteria->addCondition( $filter['']) \r\n\t\t//$criteria->select = array('id', 'oem', 'article', 'title', 'make');\r\n\t\t\r\n\t\t// добавляем параметры постраничного вывода\r\n\t\t\r\n\t\t/*\r\n\t\t$criteria->limit = $_GET['limit'] ? $_GET['limit'] : 20; //echo \"Limit = \", $_GET['limit'];\r\n\t\t$criteria->offset = $_GET['start'] ? $_GET['start'] : 0; \r\n\t\t*/\r\n\t\t\r\n\t\t//echo '$criteria = '; print_r($criteria->toArray()); echo '<br/>';\r\n\t\t//$data = CActiveRecord::model($ModelName)->findAll($criteria); \r\n\t\t$data = CActiveRecord::model($ModelName)->findAllBySql($query); \r\n\t\t\r\n\t//\tprint_r($data);\r\n\t\t\r\n\t\t//$table_name='yiiapp_'.$Table; \r\n\r\n\t\t//$variable = 'MainMenu'; \r\n\t\t//$TestData = $variable::model()->findAll(); // since 5.3\r\n\t\t\r\n\t\t/*\r\n\t\t$criteria=new CDbCriteria(array(\r\n\t\t'select'=>'t.*,count(j.*)',\r\n\t\t'join'=>'left join CountTbl j on condition',\r\n\t\t'order'=>'count(j.*)',\r\n\t\t))\r\n\r\n\t\t$criteria->condition='id=:id AND login=:login';\r\n\t\t$criteria->params=array(':id'=>5, ':login' => 'test'); // задаем параметры\r\n*/\r\n\t\t$new = array();\r\n\t foreach($data as $r) \r\n\t\t{\t\t \r\n\t\t\t/*$res['id']=$r['id'];\t\r\n\t\t\t$res['title']=$r['title'];\t\r\n\t\t\t$res['oem']=$r['oem'];\t\t\t\t\r\n\t\t\t$res['article']=$r['title'];\t\r\n\t\t\t$res['make']=$r['make'];\t*/\r\n\t\t\tforeach($r as $key => $value)\r\n\t\t\t{\r\n\t\t\t\t$res[$key] = $value;\r\n\t\t\t}\r\n\t\t\t$new[] = $res;\r\n\t\t} \r\n\t\t $result = array(\r\n\t\t\t'success'=>true,\r\n\t\t\t'data' => $new,\r\n\t\t\t'count' => $data_count //sizeof($new)\r\n\t\t );\r\n\t\t//echo 'TestData '.$TestData;\r\n\t\tprint_r(json_encode($result)); \r\n\t\t\r\n\t\t\r\n\t}", "abstract protected function initQuery(): void;", "public function prepareRecord()\n {\n // Get specific record\n $requestParameters = $this->Request->all();\n $Model = clone $this->Model;\n if (request('action') == \"view\") {\n // Hook Filter viewModifyRecord\n $Model = $this->doFilter(\"viewPrepareRecord\", $Model);\n } else {\n $Model = $this->doFilter(\"prepareRecord\", $Model);\n }\n foreach ($requestParameters['indexes'] as $column => $value) {\n $Model = $Model->where($column, '=', $value);\n }\n $record = $Model->first();\n // Is valid record\n if (!$record) {\n // Redirect to List Page\n // Set session flash for notify Entry is not exist\n return redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_error', trans('dkscaffolding.no.entry'));\n }\n $this->Model->setRawAttributes($record->getAttributes(), true);\n }", "function processRequest(&$db) {\n\t\t$tbl = $_REQUEST[\"name\"];\n\n\t\t$str = $db->getInsertStatement($tbl);\n\t\t\t\n\t\tif ($str === false)\n\t\t\tcreateErrorGrid($db, $db->getLastQuery());\n\t\telse {\n\t\t\tprint \"<div id='results'>\".htmlspecialchars($str).\"</div>\";\n\t\t\tprint \"<script type=\\\"text/javascript\\\" language='javascript'> parent.transferQuery(); </script>\\n\";\n\t\t}\n\t}", "function recordController($action, $name, $comment){\n //Setup DB connection using PDO\n $MySQLObject = new PDO('mysql:host=localhost;dbname=userrecords','root','');\n //incase charset is set to other than UTF-8 / UCS-2 / Latin-1 / ASCII\n $MySQLObject->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n \n //Switch between according to what is called\n switch($action){\n //Add a record \n case 'Add Record':\n $sql = \"INSERT INTO recordsList(name,comment)\" .\n \"VALUES(?,?)\";\n //prepare our query\n $resultIns = $MySQLObject->prepare($sql);\n $resultIns->bindParam(1,$name,PDO::PARAM_STR);\n $resultIns->bindParam(2,$comment,PDO::PARAM_STR);\n $resultIns->execute();\n //Check for errors \n if($resultIns->errorCode() !== '00000'){ \n die(\"Could not add record \".$resultIns->errorCode());\n }\n break;\n //Delete a Record or Set\n case 'Delete Record':\n //Get the record id/Array to delete\n $recordID = $_POST['ID'];\n //Check to see if we have data \n if(empty($recordID)) break;\n //iterate through the post array\n foreach($recordID as &$ID){\n $sql = \"DELETE FROM recordsList WHERE ID = ?\";\n $resultDel = $MySQLObject->prepare($sql);\n $resultDel->bindParam(1,$ID,PDO::PARAM_INT);\n $resultDel->execute();\n if($resultDel->errorCode() !== '00000') die(\"Could not delete record. \");\n }\n break; \n default:\n break;\n }\n \n //Load all records\n $resultSel=$MySQLObject->prepare(\"SELECT * from recordsList\");\n $resultSel->execute();\n if($resultSel->errorCode() === '00000'){\n echo json_encode($resultSel->fetchAll());\n }\n \n }", "public function indexAction() {\n //on forge la requete SQL\n $articles = $this->repo->getAll();\n \n if ($articles) {\n $nbRows = count($articles);\n \n \n \n \n \n \n \n }\n \n \n \n }", "protected function setupListOperation()\n {\n CRUD::column('key')->label('ID key')->type('text');\n CRUD::column('name')->label('Nom')->type('text')->limit(200);\n }", "public function indexAction() {\n \n $peticion = $this->getRequest();\n $sesion = $peticion->getSession();\n $this->container->get('security.context');\n $error = $peticion->attributes->get(SecurityContext::AUTHENTICATION_ERROR, $sesion->get(SecurityContext::AUTHENTICATION_ERROR));\n if ($error){\n return $this->lAction();\n }\n \n //$peticion = $this->getRequest();\n //$sesion = $peticion->getSession();\n //$this->container->get('security.context');\n //$error = $peticion->attributes->get(SecurityContext::AUTHENTICATION_ERROR, $sesion->get(SecurityContext::AUTHENTICATION_ERROR)); \n \n $em = $this->getDoctrine()->getEntityManager();\n $db = $em->getConnection();\n \n $query = \"SELECT paciente.nome,responsavel.nome as nome_resp, responsavel.email, orden_responsavel.paciente_id, orden_responsavel.responsavel_id \n FROM public.orden_responsavel, public.responsavel, public.paciente \n WHERE orden_responsavel.paciente_id = paciente.id_paciente AND\n orden_responsavel.id = responsavel.id_responsavel;\"; //limit 10\n $stmt = $db->prepare($query);\n $params = array();\n $stmt->execute($params);\n $po=$stmt->fetchAll(); \n \n $final = array();\n $i = 0;\n foreach ($po as $k=>$v) {\n if($k > 0){\n if($po[$k]['nome'] == $po[$k-1]['nome'] && $po[$k]['nome_resp'] != $po[$k-1]['nome_resp']){\n $final[$i]= array('f' => 's','n' => $po[$k-1][\"nome\"], 'id_p' => $po[$k-1][\"paciente_id\"], 'r1'=>$po[$k-1][\"nome_resp\"], 'id_r1' => $po[$k-1][\"responsavel_id\"], 'e_r1' => $po[$k-1][\"email\"],\n 'r2' => $po[$k][\"nome_resp\"], 'id_r2' => $po[$k][\"responsavel_id\"], 'e_r2' => $po[$k][\"email\"]); \n $i++;\n }else if($po[$k]['nome'] == $po[$k-1]['nome'] && $po[$k]['nome_resp'] == $po[$k-1]['nome_resp']){\n $final[$i]= array('f' => 'n','n' => $po[$k-1][\"nome\"], 'id_p' => $po[$k-1][\"paciente_id\"], 'r1'=>$po[$k-1][\"nome_resp\"], 'id_r1' => $po[$k-1][\"responsavel_id\"], 'e_r1' => $po[$k-1][\"email\"]);\n $i++;\n }\n } \n } \n //var_dump($final); die();\n return $this->render('ReportsBundle:Default:dashboard.html.twig', array('last_username' => $sesion->get(SecurityContext::LAST_USERNAME), 'error' => $error, 'p'=> $final));\n }", "public function query(Document $model, Request $request)\n {\n\n // $user_id = auth()->guard('admin')->user()->user_id;\n // $user_type = auth()->guard('admin')->user()->user_type;\n // $name = auth()->guard('admin')->user()->name;\n // $unit=auth()->guard('admin')->user()->getUnit;\n // $master = Master::where('name', $name)->get();\n // $related_branches_arr = array('No branches');\n // $related_branch_depatments_arr = array('No Departments related to branch');\n // $related_master_branch_depatments_arr = array('No Departments related to master branch');\n\n // if (count($master) == 0) {} else {\n // $related_branches_arr = array();\n // $related_branch_depatments_arr = array();\n // $related_master_branch_depatments_arr = array();\n\n // $related_branches = Branch::Where('master_id', $master[0]->id)->get();\n\n // foreach ($related_branches as $related_branch) {\n // array_push($related_branches_arr, $related_branch->name);\n\n // $depts = Department::where('branch_id', $related_branch->id)->get();\n // foreach ($depts as $dept) {\n // array_push($related_master_branch_depatments_arr, $dept->name);\n // }\n // }\n\n // // getting the department documents that related to the logged branch\n\n // }\n // $branch = Branch::where('name', $name)->get();\n // if (count($branch) > 0) {\n // $branch_depts = Department::where('branch_id', $branch[0]->id)->get();\n // foreach ($branch_depts as $branch_dept) {\n\n // array_push($related_branch_depatments_arr, $branch_dept->name);\n // }\n // }\n\n // return Document::where(\n // [\n // \"logged_user_id\" => $user_id,\n // 'user_type' => $user_type,\n // ]\n // )\n // ->orWhere('sender', 'LIKE', \"%{$name}%\")\n // ->orWhereIn('sender', $related_branches_arr)\n // ->orWhereIn('sender', $related_branch_depatments_arr)\n // ->orWhereIn('sender', $related_master_branch_depatments_arr)\n // ->orWhere('reciever', 'LIKE', \"%{$name}%\")\n // ->orWhereIn('reciever', $related_branches_arr)\n // ->orWhereIn('reciever', $related_branch_depatments_arr)\n // ->orWhereIn('reciever', $related_master_branch_depatments_arr)\n // ->orWhere('copy_to', 'LIKE', \"%{$name}%\")\n // ->orWhereIn('copy_to', $related_branches_arr)\n // ->orWhereIn('copy_to', $related_branch_depatments_arr)\n // ->orWhereIn('copy_to', $related_master_branch_depatments_arr)\n\n // ->get();\n\n $user_id = auth()->guard('admin')->user()->user_id;\n $user_type = auth()->guard('admin')->user()->user_type;\n $name = auth()->guard('admin')->user()->getUnit->name;\n return Document::where(\n [\n \"logged_user_id\" => $user_id,\n 'user_type' => $user_type,\n ])\n ->orWhere('sender', 'LIKE', \"%{$name}%\")\n ->orWhere('reciever', 'LIKE', \"%{$name}%\")\n ->orWhere('copy_to', 'LIKE', \"%{$name}%\")\n ->get();\n\n\n }", "public function parseSQLDataProvider() {}", "public function actionGettraningapplicants(){\n\n\n $result_array = [];\n parse_str($_SERVER['REQUEST_URI'], $result_array);\n //$result_array['order'][0]['column'];\n switch ($result_array['order'][0]['column']) {\n case '0':\n $result_array['order'][0]['column'] = 'id';\n break;\n default:\n $result_array['order'][0]['column'] = 'id';\n break;\n }\n $sort = $result_array['order'][0]['column'];\n $order = $result_array['order'][0]['dir'];\n if(empty($result_array['search']['value'])){\n $model = Labours::model()->findAll(array(\n 'condition'=>'t.status = 1',\n 'order' => \"$sort $order\",\n 'limit' =>$result_array['length'],\n 'offset' => $result_array['start'],\n ));\n $student = Labours::model()->findAll(array('condition'=>'t.status = 1'));\n } else{\n $model = Labours::model()->findAll(array(\n 'condition' => '(id LIKE :id) OR (full_name LIKE :name) OR (cnic LIKE :cnic) OR (mobile_number LIKE :number) OR (designation LIKE :designation) AND status = 1',\n 'params' => array(':id'=>$result_array['search']['value'],':name'=>$result_array['search']['value'].'%',':cnic'=>'%'.$result_array['search']['value'].'%',':number'=>'%'.$result_array['search']['value'].'%',':designation'=>$result_array['search']['value'].'%'),\n 'order' => \"$sort $order\",\n 'limit' =>$result_array['length'],\n 'offset' => $result_array['start'],\n ));\n $student = Labours::model()->findAll(array(\n 'condition' => '(id LIKE :id) OR (full_name LIKE :name) OR (cnic LIKE :cnic) OR (mobile_number LIKE :number) OR (designation LIKE :designation) AND status = 1',\n 'params' => array(':id'=>$result_array['search']['value'],':name'=>$result_array['search']['value'].'%',':cnic'=>'%'.$result_array['search']['value'].'%',':number'=>'%'.$result_array['search']['value'].'%',':designation'=>$result_array['search']['value'].'%'),\n ));\n }\n \n $result = array();\n //print_r($result_array);exit;\n $i=0;\n $result['draw'] = $result_array['draw'];\n $result['recordsTotal'] = count($student);\n $result['recordsFiltered'] = count($student);\n $result['data'] = '';\n if($model){\n foreach($model as $labor): \n if($this->Laborstatus($labor->id)==false){ \n if(!$labor->traings){\n \n $result['data'][$i][] = '<input type=\"checkbox\" name=\"trainingLabor[]\" value=\"'.$labor->id.'\">';\n $result['data'][$i][] = '<a href=\"'.Yii::app()->baseUrl.'/labor/view/id/'.$labor->id.'\">'.$labor->id.'</a>';\n $result['data'][$i][] = '<a href=\"'.Yii::app()->baseUrl.'/labor/view/id/'.$labor->id.'\">'.$labor->full_name.'</a>';\n $result['data'][$i][] = $labor->cnic;\n if($labor->category_id==1){ \n $cat = 'Skilled'; \n }\n if($labor->category_id==2){ \n $cat ='Unskilled'; \n }\n $result['data'][$i][] = $cat ;\n $result['data'][$i][] = $labor->mobile_number;\n if(@$training->status==1){\n $btn = '<a href=\"#\" class=\"addtrainingResult\" data-toggle=\"modal\" data-target=\"#rejectModal\" rel=\"'.$labor->id.'\"><button type=\"button\" class=\"btn btn-info btn-xs\">Add Result</button></a>';\n } else{\n $btn = '';\n }\n $result['data'][$i][] = $btn;\n $i++;\n }\n } \n endforeach; \n }\n \n echo json_encode($result);\n }", "public function index(Request $request)\n\t{\n\t\ttry{\n\t\t\t$aColumns = array(\n\t\t\t\t'kode','kdppk','kdindex','lvl','kddept','kdunit','kdsatker','nodok','tgdok','revisike','norevisi','tgrevisi','kdprogram',\n\t\t\t\t'kdgiat','kdoutput','kdsoutput','kdkmpnen','kdskmpnen','kdakun','uraian','paguakhir','nilblokir','identif'\n\t\t\t);\n\t\t\t/* Indexed column (used for fast and accurate table cardinality) */\n\t\t\t$sIndexColumn = \"identif\";\n\t\t\t/* DB table to use */\n\n\t\t\t$sTable = \" \n\t\t\t\tSELECT t.*\n\t\t\t\t FROM (SELECT kdindex,\n\t\t\t\t kode,\n\t\t\t\t\t\t\t kdppk,\n\t\t\t\t\t\t\t lvl,\n\t\t\t\t\t\t\t kddept,\n\t\t\t\t\t\t\t kdunit,\n\t\t\t\t\t\t\t kdsatker,\n\t\t\t\t\t\t\t nodok,\n\t\t\t\t\t\t\t tgdok,\n\t\t\t\t\t\t\t revisike,\n\t\t\t\t\t\t\t norevisi,\n\t\t\t\t\t\t\t tgrevisi,\n\t\t\t\t\t\t\t kdprogram,\n\t\t\t\t\t\t\t kdgiat,\n\t\t\t\t\t\t\t kdoutput,\n\t\t\t\t\t\t\t kdsoutput,\n\t\t\t\t\t\t\t kdkmpnen,\n\t\t\t\t\t\t\t kdskmpnen,\n\t\t\t\t\t\t\t kdakun,\n\t\t\t\t\t\t\t TRIM(uraian) AS uraian,\n\t\t\t\t\t\t\t paguakhir,\n\t\t\t\t\t\t\t nilblokir,\n\t\t\t\t\t\t\t CONCAT(kdprogram,\n\t\t\t\t\t\t\t\t\t '-',\n\t\t\t\t\t\t\t\t\t kdgiat,\n\t\t\t\t\t\t\t\t\t '-',\n\t\t\t\t\t\t\t\t\t kdoutput,\n\t\t\t\t\t\t\t\t\t '-',\n\t\t\t\t\t\t\t\t\t kdsoutput,\n\t\t\t\t\t\t\t\t\t '-',\n\t\t\t\t\t\t\t\t\t kdkmpnen,\n\t\t\t\t\t\t\t\t\t '-',\n\t\t\t\t\t\t\t\t\t kdskmpnen,\n\t\t\t\t\t\t\t\t\t '-',\n\t\t\t\t\t\t\t\t\t kdakun)\n\t\t\t\t\t\t\t\t AS identif\n\t\t\t\t\t\t FROM d_pagu\n\t\t\t\t\t\t WHERE lvl = 7) t\";\n\t\t\t/*\n\t\t\t * Paging\n\t\t\t */\n\t\t\t$sLimit = \"\";\n\t\t\t$iDisplayStart=$request->input('start');\n\t\t\t$iDisplayLength=$request->input('length');\n\t\t\tif ( isset( $iDisplayStart ) && $iDisplayLength != '-1' ) \n\t\t\t{\n\t\t\t\t $sLimit = \"LIMIT \".intval( $request->input('start') ).\", \".\n\t\t\t\t\tintval( $request->input('length') );\n\t\t\t}\n\t\t\t \n\t\t\t \n\t\t\t/*\n\t\t\t * Ordering\n\t\t\t */\n\t\t\t$sOrder = \"\";\n\t\t\tif ( $request->input('order') !==null )\n\t\t\t{\n\t\t\t\t$arr_order=$request->input('order');\n\t\t\t\t\n\t\t\t\tif(isset($arr_order[0]['column'])){\n\t\t\t\t\t$sort_col=$arr_order[0]['column'];\n\t\t\t\t\t\n\t\t\t\t\t$sort_dir='desc';\n\t\t\t\t\tif(isset($arr_order[0]['dir'])){\n\t\t\t\t\t\t$sort_dir=$arr_order[0]['dir'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$sOrder = \" ORDER BY a.\".$aColumns[ intval( $sort_col ) ].\" \".($sort_dir==='asc' ? 'asc' : 'desc') .\" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t \n\t\t\t \n\t\t\t/*\n\t\t\t * Filtering\n\t\t\t */\n\t\t\t$sWhere = \"\";\n\t\t\t$arr_search=$request->input('search');\n\t\t\t$sSearch=$arr_search['value'];\n\t\t\tif ( isset($sSearch) && $sSearch != \"\" )\n\t\t\t{\n\t\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t\t{\n\t\t\t\t\t$arr_where[] = $aColumns[$i].\" LIKE '%\".( $sSearch ).\"%' \";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sWhere .= \"WHERE \".implode(\" OR \", $arr_where);\n\t\t\t}\n\t\t\t \n\t\t\t/* Individual column filtering */\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( isset($bSearchable_i) && $bSearchable_i == \"true\" && $request->input('sSearch_'.$i) != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\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$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= $aColumns[$i].\" LIKE '%\".($request->input('sSearch_'.$i)).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Data set length after filtering */\n\t\t\t$iFilteredTotal = 0;\n\t\t\t$rows = DB::select(\"\n\t\t\t\tSELECT COUNT(*) as jumlah FROM (\".$sTable.\") a\n\t\t\t\");\n\t\t\t$result = (array)$rows[0];\n\t\t\tif($result){\n\t\t\t\t$iFilteredTotal = $result['jumlah'];\n\t\t\t}\n\t\t\t\n\t\t\t/* Total data set length */\n\t\t\t$iTotal = 0;\n\t\t\t$rows = DB::select(\"\n\t\t\t\tSELECT COUNT(\".$sIndexColumn.\") as jumlah FROM (\".$sTable.\") a\n\t\t\t\");\n\t\t\t$result = (array)$rows[0];\n\t\t\tif($result){\n\t\t\t\t$iTotal = $result['jumlah'];\n\t\t\t}\n\t\t \n\t\t\t/*\n\t\t\t * Format Output\n\t\t\t */\n\t\t\t$output = array(\n\t\t\t\t\"sEcho\" => intval($request->input('sEcho')),\n\t\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\t\"aaData\" => array()\n\t\t\t);\n\n\t\t\t/*\n\t\t\t * SQL queries\n\t\t\t */\n\t\t\t$sQuery = \"\n\t\t\t\tSELECT SQL_CALC_FOUND_ROWS \".str_replace(\" , \", \" \", implode(\", \", $aColumns)).\"\n\t\t\t\tFROM ($sTable) a\n\t\t\t\t$sWhere\n\t\t\t\t$sOrder\n\t\t\t\t$sLimit\n\t\t\t\";\n\t\t\t\n\t\t\t$rows = DB::select($sQuery);\n\t\t\t\n\t\t\tforeach( $rows as $row )\n\t\t\t{\t\t\t\n\t\t\t\t$aksi='<center>\n\t\t\t\t\t\t\t<!--<a href=\"javascript:;\" id=\"'.$row->kdindex.'\" title=\"Ubah data\" class=\"btn btn-xs btn-primary ubah\"><i class=\"fa fa-pencil\"></i></a>\n\t\t\t\t\t\t\t<a href=\"javascript:;\" id=\"'.$row->kdindex.'\" title=\"Hapus\" class=\"btn btn-xs btn-danger hapus\"><i class=\"fa fa-times\"></i></a>-->\n\t\t\t\t\t\t</center>';\n\t\t\t\t\t\t\t\n\t\t\t\t$output['aaData'][] = array(\n\t\t\t\t\t$row->kode,\n\t\t\t\t\t$row->kdppk,\n\t\t\t\t\t//~ $row->kddept,\n\t\t\t\t\t//~ $row->kdunit,\n\t\t\t\t\t//~ $row->kdsatker,\n\t\t\t\t\t$row->revisike,\n\t\t\t\t\t$row->kdprogram,\n\t\t\t\t\t$row->kdgiat,\n\t\t\t\t\t$row->kdoutput,\n\t\t\t\t\t$row->kdsoutput,\n\t\t\t\t\t$row->kdkmpnen,\n\t\t\t\t\t$row->kdskmpnen,\n\t\t\t\t\t$row->kdakun,\n\t\t\t\t\t'<div style=\"text-align:right;\">'.number_format($row->paguakhir,0,',','.').'</div>',\n\t\t\t\t\t$aksi\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\treturn response()->json($output);\n\t\t}\n\t\tcatch(\\Exception $e){\n\t\t\treturn $e;\n\t\t\t//return 'Terdapat kesalahan lainnya!';\n\t\t}\n\t}", "public function getSystems()\r\n{\r\n $query_string = \"SELECT systemid, systemname \";\r\n $query_string .= \"FROM voting_system\";\r\n\r\n return $query_string;\r\n}", "function master_view_query_result(): Array {\n\n $table = strtolower($this->controller);\n \n $model = $this->current_model;\n\n $select_columns = $this->toggle_master_view_select_columns(); \n\n $lookup_tables = $this->CI->grants->lookup_tables($table);\n \n $master_view_query_result = $this->CI->grants_model->run_master_view_query($table,$select_columns,$lookup_tables);\n \n return $this->CI->grants->update_query_result_for_fields_changed_to_select_type($this->controller,$master_view_query_result);\n \n }", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "abstract protected function _query($sql);", "public function execute() {}", "public function execute() {}" ]
[ "0.6210525", "0.61157763", "0.6026694", "0.5985294", "0.58402675", "0.58402675", "0.58164304", "0.58164304", "0.58164304", "0.579439", "0.5791223", "0.5755574", "0.5755574", "0.5755574", "0.5746844", "0.56777984", "0.55644524", "0.5562151", "0.5552568", "0.5544328", "0.5544328", "0.5544328", "0.55440277", "0.5531428", "0.5519292", "0.55189556", "0.55164623", "0.5505197", "0.54568744", "0.5445948", "0.54313", "0.54108423", "0.5398612", "0.5391967", "0.53559315", "0.5349316", "0.5349316", "0.5349316", "0.5349316", "0.5349316", "0.5349316", "0.5349316", "0.5349316", "0.5349316", "0.5345668", "0.5345456", "0.53344876", "0.5324136", "0.5315731", "0.5315645", "0.5313379", "0.53127956", "0.5304225", "0.5296438", "0.52913785", "0.5289976", "0.5254088", "0.52507037", "0.52497935", "0.52455956", "0.5238575", "0.5222567", "0.5222567", "0.52175003", "0.5211362", "0.5207178", "0.52043974", "0.5203064", "0.5200509", "0.5195016", "0.51898026", "0.5181874", "0.5181437", "0.517862", "0.51726884", "0.5167452", "0.5165452", "0.5165093", "0.51608133", "0.5146263", "0.51460165", "0.51459134", "0.51435024", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5142291", "0.5140763", "0.5140763", "0.5140478", "0.51403826", "0.51403826" ]
0.0
-1
Perform the configured migrations
public function execute(string $setName, TablesList $tableCollection, ViewsList $viewCollection): void { foreach ($tableCollection->getTables() as $table => $sampler) { try { $this->ensureEmptyTargetTable($table, $this->sourceConnection, $this->destConnection); $sampler->setTableName($table); $sampler->setSourceConnection($this->sourceConnection); $sampler->setDestConnection($this->destConnection); $rows = $sampler->execute(); $this->logger->info("$setName: migrated '$table' with '" . $sampler->getName() . "': $rows rows"); } catch (\Exception $e) { $this->logger->error( "$setName: failed to migrate '$table' with '" . $sampler->getName() . "': " . $e->getMessage() ); throw $e; } } foreach ($viewCollection->getViews() as $view) { $this->migrateView($view, $setName); } $this->migrateTableTriggers($setName, $tableCollection); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function migrate() {}", "public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "public function runDatabaseMigrations()\n {\n $this->parentRunDatabaseMigrations();\n\n $this->artisan('cms:migrate');\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('cms:migrate:rollback');\n });\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }", "public static function migrate()\n {\n\n // If there is not a declaration that migrations have been run'd\n if( ! isset($GLOBALS['migrated_test_database']))\n {\n // Run migrations\n require path('sys').'cli/dependencies'.EXT;\n\n $which_db = \\Config::get('database.default');\n $database = \\Config::get('database.connections.'.$which_db);\n\n $migration_table = null;\n if($which_db == 'mysql')\n {\n $query = \"SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = ? AND table_name = ?\";\n $migration_table = \\DB::query($query, array($database['database'], $database['prefix'].'laravel_migrations'));\n }\n\n // if($which_db == 'sqlite')\n // {\n // //$migration = \"SELECT * FROM {$database['database']}.sqlite_master WHERE type='table'\";\n // //sqlite3_exec(budb, \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\"\n // \\sqlite_open(\":memory:\", $database['database']);\n // $migration = \\sqlite_exec($database['database'], \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\");\n // }\n\n if(isset($migration_table['0']->count) and $migration_table['0']->count == '0')\n {\n Command::run(array('migrate:install'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n else\n {\n Command::run(array('migrate:reset'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n\n\n //Insert basic data\n\n // Declare that migrations have been run'd\n $GLOBALS['migrated_test_database'] = true;\n }\n }", "public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}", "function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }", "public function migrate()\n\t{\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function runMigrations()\n {\n if (file_exists($this->baseSqlite())) {\n return;\n }\n\n config(['database.connections.sqlite.database' => $this->copySqlite()]);\n if (method_exists($this, 'withoutMockingConsoleOutput')) {\n $this->withoutMockingConsoleOutput()->artisan('migrate');\n } else {\n Artisan::call('migrate');\n }\n\n // Run Seeders\n copy($this->copySqlite(), $this->baseSqlite());\n return;\n }", "public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "public function runDatabaseMigrations()\n {\n $this->artisan('migrate:fresh', $this->migrateFreshUsing());\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n\n RefreshDatabaseState::$migrated = false;\n });\n }", "public function migrate() \n {\n\n Masteryl_Migration::createOrUpdateDir(MASTERYL_MIGRATIONS_PATH, $this);\n\n if(!empty($this->modules)) {\n foreach($this->modules as $mod) {\n $dir = $mod['path'].'migrations';\n \n if(file_exists($dir))\n Masteryl_Migration::createOrUpdateDir($dir, $this);\n }\n }\n\n }", "public static function dbMigrate(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Migrate the database\n\t\t\tArtisan::call('migrate');\n\t\t}\n\t}", "public function runDatabaseMigrations()\n {\n if (!$this->runMigrations) {\n return;\n }\n\n $this->artisan('migrate:fresh');\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n });\n }", "public function applyMigration()\n {\n $this->createMigrationsTable();\n $applied_migrations = $this->get_applied_migrations();\n\n $files = scandir(Application::$ROOT_DIR.'/migrations');\n $to_apply_migrations = array_diff($files, $applied_migrations);\n\n $new_migrations = [];\n\n foreach ($to_apply_migrations as $migration) {\n // skip unwanted folders\n if ($migration === '.' || $migration === '..') {\n continue;\n }\n require_once Application::$ROOT_DIR.'/migrations/'.$migration;\n\n $class_name = pathinfo($migration, PATHINFO_FILENAME);\n $instance = new $class_name();\n $instance->up();\n\n $new_migrations[] = $migration;\n }\n\n if (!empty($new_migrations)) {\n $this->saveMigration($new_migrations);\n }\n else {\n echo $this->log(\"All migrations are applied\");\n }\n }", "public function migrateDb();", "public function migrate()\n {\n Artisan::call('migrate', [\n '--seed' => true\n ]);\n }", "public function migrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/Database/Migrations');\n\n $this->publishes([\n __DIR__.'/Database/Migrations/' => database_path('migrations')\n ], $this->packageName.'-migrations');\n }", "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "public function migrateDatabase();", "public function __invoke()\n {\n $this->migrate();\n }", "function migrate(){\n\n create_table();\n save_migration_tables();\n\n}", "public function callMigration()\n {\n Artisan::call('lucy:migration', $this->builder->getAttribute('migration'));\n\n Artisan::call('migrate');\n }", "private function setupMigrations()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n }", "public function migrate()\n {\n $this->prepareWizardsTable();\n\n $this->processProcessing();\n $this->processLogs();\n $this->processConfigData();\n\n $this->prepareOrdersTables();\n $this->prepareOrdersConfigTable();\n $this->processOrdersData();\n }", "protected function defineDatabaseMigrations()\n {\n $this->loadMigrationsFrom(realpath(__DIR__.'/../database/migrations'));\n\n $this->artisan('migrate', ['--database' => 'testbench'])->run();\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback', ['--database' => 'testbench'])->run();\n });\n }", "public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}", "public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function migrateAndSeed()\n {\n return $this->migrate();\n }", "public function up()\n {\n $this->table('articles')\n ->addColumn('title', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('details', 'text', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('categories', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('football_ragistrations', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('student_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created_to', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('friends', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('amount', 'float', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('city', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('menus')\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('status', 'tinyinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('picnic_ragistrations', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('student_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('amount', 'decimal', [\n 'default' => null,\n 'null' => false,\n 'precision' => 10,\n 'scale' => 2,\n ])\n ->addColumn('created_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('products', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('category_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('profiles')\n ->addColumn('user_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('mobile', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('skills')\n ->addColumn('user_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 30,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('spouses', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('friend_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('students')\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('age', 'decimal', [\n 'default' => null,\n 'null' => false,\n 'precision' => 10,\n 'scale' => 3,\n ])\n ->addColumn('country', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('created_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('submenus')\n ->addColumn('menu_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('status', 'boolean', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('users')\n ->addColumn('username', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('email', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('amount', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('password', 'string', [\n 'default' => null,\n 'limit' => 100,\n 'null' => false,\n ])\n ->addColumn('image', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('status', 'tinyinteger', [\n 'default' => '1',\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n \t\n \tUser::truncate();\n \n Schema::enableForeignKeyConstraints();\n\n $usersToMigrate = Migrate::all();\n\n collect($usersToMigrate)->each(function($user) {\n \t$this->create($user);\n });\n\n $this->admin();\n }", "public function up()\n\t{\n\t\t//\n\t\tDB::query(\"insert into app_apps_applications (id, app_nicename, app_folder, created_at, updated_at)\n\t\t values (1, 'My First Application', 'yourappname', '2013-06-10 12:00:00', '2013-06-10 12:00:00');\");\n\n DB::query(\"insert into app_apps_fbapps (id, fbappid, fbsecret, fbnamespace, app_apps_application_id, created_at, updated_at) \n \tvalues (1, 'fbkey', 'fbsecret', '01', 1, '2013-06-10 12:00:00', '2013-06-10 12:00:00');\");\n \n // Insert 3 application instances\n DB::query(\"insert into app_user_apps_publishes (id, status, app_user_apps_publish_page_id, app_apps_fbapp_id, app_apps_application_id, created_at, updated_at)\n \tvalues\n \t(1, 'A', '0001', 1, 1, '2013-06-10 12:00:00', '2013-06-10 12:00:00'),\n \t(2, 'A', '0002', 1, 1, '2013-06-10 12:00:00', '2013-06-10 12:00:00'),\n \t(3, 'A', '0003', 1, 1, '2013-06-10 12:00:00', '2013-06-10 12:00:00')\n \t;\");\n\n\t}", "public function up()\n {\n\n $this->table('users')\n ->removeColumn('can_edit')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'text', [\n 'default' => null,\n 'length' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->update();\n $this->table('roles')\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('alias', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addIndex(\n [\n 'alias',\n ],\n ['unique' => true]\n )\n ->create();\n\n $this->table('roles')->insert([\n [\n 'id' => '1',\n 'name' => 'Newbie',\n 'alias' => 'guest'\n ],\n [\n 'id' => '2',\n 'name' => 'Benutzer',\n 'alias' => 'user'\n ],\n [\n 'id' => '3',\n 'name' => 'Admin',\n 'alias' => 'admin'\n ],\n ])->saveData();\n\n $this->table('users')\n ->addColumn('role_id', 'integer', [\n 'after' => 'id',\n 'default' => '1',\n 'length' => 11,\n 'null' => false,\n ])\n ->addIndex(\n [\n 'role_id',\n ],\n [\n 'name' => 'FK_users_roles',\n ]\n )\n ->update();\n\n $this->table('stundenplan')\n ->addColumn('loggedInNote', 'text', [\n 'after' => 'info_for_db',\n 'default' => null,\n 'length' => null,\n 'null' => true,\n ])\n ->update();\n\n $this->table('users')\n ->addForeignKey(\n 'role_id',\n 'roles',\n 'id',\n [\n 'update' => 'CASCADE',\n 'delete' => 'RESTRICT',\n ]\n )\n ->update();\n\n $this->query('UPDATE users SET role_id = 3 WHERE email = \"[email protected]\"');\n }", "protected function defineDatabaseMigrationsAfterDatabaseRefreshed()\n {\n // Define database migrations after database refreshed.\n }", "public function up()\n {\n $result = $this->fetchAll(\"SELECT * FROM `visualisation_settings` WHERE `model` = 'BusinessContinuityPlanAudit' ORDER BY `id` DESC\");\n\n if (!empty($result) && count($result) > 1 && !empty($result[0]['id'])) {\n $this->query(\"DELETE FROM `visualisation_settings` WHERE `id` = {$result[0]['id']}\");\n }\n }", "public static function migrateDatabase()\n {\n DB::statement(\"CREATE TABLE IF NOT EXISTS `videos` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `premium` tinyint(1) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `failed_jobs` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`),\n UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `images` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `migrations` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `batch` int(11) NOT NULL,\n PRIMARY KEY (`id`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `movies` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `year` smallint(5) unsigned NOT NULL,\n `rating` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `length` mediumint(8) unsigned NOT NULL,\n `cast` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `genre` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `thumbnail` bigint(20) unsigned NOT NULL,\n `video` bigint(20) unsigned NOT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n `trailer` bigint(20) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `movies_thumbnail_foreign` (`thumbnail`),\n KEY `movies_video_foreign` (`video`),\n KEY `movies_trailer_foreign` (`trailer`),\n CONSTRAINT `movies_thumbnail_foreign` FOREIGN KEY (`thumbnail`) REFERENCES `images` (`id`),\n CONSTRAINT `movies_trailer_foreign` FOREIGN KEY (`trailer`) REFERENCES `videos` (`id`),\n CONSTRAINT `movies_video_foreign` FOREIGN KEY (`video`) REFERENCES `videos` (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `password_resets` (\n `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n KEY `password_resets_email_index` (`email`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `series` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `year` smallint(5) unsigned NOT NULL,\n `rating` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `cast` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `genre` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n `thumbnail` bigint(20) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `series_thumbnail_foreign` (`thumbnail`),\n CONSTRAINT `series_thumbnail_foreign` FOREIGN KEY (`thumbnail`) REFERENCES `images` (`id`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `settings` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `setting` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n PRIMARY KEY (`id`)\n )\");\n\n DB::statement(\"\tCREATE TABLE IF NOT EXISTS `subscriptions` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `user_id` bigint(20) unsigned NOT NULL,\n `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stripe_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stripe_status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stripe_plan` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `quantity` int(11) DEFAULT NULL,\n `trial_ends_at` timestamp NULL DEFAULT NULL,\n `ends_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `subscriptions_user_id_stripe_status_index` (`user_id`,`stripe_status`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `subscription_items` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `subscription_id` bigint(20) unsigned NOT NULL,\n `stripe_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stripe_plan` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `quantity` int(11) DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `subscription_items_subscription_id_stripe_plan_unique` (`subscription_id`,`stripe_plan`),\n KEY `subscription_items_stripe_id_index` (`stripe_id`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `subscription_types` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `product_id` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `subscription_plans` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `stripe_price_id` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,\n `benefits` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `subscription_type_id` bigint(20) unsigned NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `price` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,\n `billing_interval` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`),\n KEY `subscription_plans_subscription_type_id_foreign` (`subscription_type_id`),\n CONSTRAINT `subscription_plans_subscription_type_id_foreign` FOREIGN KEY (`subscription_type_id`) REFERENCES `subscription_types` (`id`)\n )\");\n\n DB::statement(\"\tCREATE TABLE IF NOT EXISTS `translations` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `language` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `users` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email_verified_at` timestamp NULL DEFAULT NULL,\n `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `stripe_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `card_brand` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `card_last_four` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `trial_ends_at` timestamp NULL DEFAULT NULL,\n `roles` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'user',\n `language` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `users_email_unique` (`email`),\n KEY `users_stripe_id_index` (`stripe_id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `seasons` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `order` smallint(6) NOT NULL,\n `series_id` bigint(20) unsigned NOT NULL,\n `thumbnail` bigint(20) unsigned NOT NULL,\n `trailer` bigint(20) unsigned NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `year` smallint(5) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `seasons_series_id_foreign` (`series_id`),\n KEY `seasons_thumbnail_foreign` (`thumbnail`),\n KEY `seasons_trailer_foreign` (`trailer`),\n CONSTRAINT `seasons_series_id_foreign` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`),\n CONSTRAINT `seasons_thumbnail_foreign` FOREIGN KEY (`thumbnail`) REFERENCES `images` (`id`),\n CONSTRAINT `seasons_trailer_foreign` FOREIGN KEY (`trailer`) REFERENCES `videos` (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `episodes` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `season_id` bigint(20) unsigned NOT NULL,\n `thumbnail` bigint(20) unsigned NOT NULL,\n `video` bigint(20) unsigned NOT NULL,\n `length` mediumint(8) unsigned NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n `order` smallint(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `episodes_season_id_foreign` (`season_id`),\n KEY `episodes_thumbnail_foreign` (`thumbnail`),\n KEY `episodes_video_foreign` (`video`),\n CONSTRAINT `episodes_season_id_foreign` FOREIGN KEY (`season_id`) REFERENCES `seasons` (`id`),\n CONSTRAINT `episodes_thumbnail_foreign` FOREIGN KEY (`thumbnail`) REFERENCES `images` (`id`),\n CONSTRAINT `episodes_video_foreign` FOREIGN KEY (`video`) REFERENCES `videos` (`id`)\n )\");\n\n //v0.2.0 \n if(!Schema::hasColumn('movies', 'premium'))\n DB::statement(\"ALTER TABLE movies ADD premium BOOLEAN NOT NULL DEFAULT 1\");\n\n if(!Schema::hasColumn('movies', 'auth'))\n DB::statement(\"ALTER TABLE movies ADD auth BOOLEAN NOT NULL DEFAULT 1\");\n \n if(!Schema::hasColumn('episodes', 'premium'))\n DB::statement(\"ALTER TABLE episodes ADD premium BOOLEAN NOT NULL DEFAULT 1\");\n\n if(!Schema::hasColumn('episodes', 'auth'))\n DB::statement(\"ALTER TABLE episodes ADD auth BOOLEAN NOT NULL DEFAULT 1\");\n \n if(!Schema::hasColumn('videos', 'auth')) \n DB::statement(\"ALTER TABLE videos ADD auth BOOLEAN NOT NULL DEFAULT 1\");\n\n if(!Schema::hasColumn('videos', 'premium')) \n DB::statement(\"ALTER TABLE videos ADD premium BOOLEAN NOT NULL DEFAULT 1\");\n \n }", "public function up(){\n $migration_files=dirToArray($this->migrations_dir);\n if(!sizeof($migration_files)){\n die('migration does not exist');\n }\n\n //check MIGRATION_TABLE_NAME\n $this->_check_table();\n\n //check run migrations\n $migration_files=$this->_check_run_migrations($migration_files);\n\n if(sizeof($migration_files)<=0){\n die('migration file does not exist');\n }\n\n $responses = [];\n foreach($migration_files as $file){\n $responses[] = $this->_run($file,'up');\n }\n return $responses;\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE activity_log (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, old_rp INT NOT NULL, new_rp INT NOT NULL, notes VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_FD06F647A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE capabilities (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, title VARCHAR(255) NOT NULL, INDEX IDX_1D3B2DFDA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE exchange_offers (id INT AUTO_INCREMENT NOT NULL, from_user_id INT NOT NULL, to_user_id INT NOT NULL, respect_points INT NOT NULL, description VARCHAR(255) NOT NULL, status VARCHAR(20) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_A25FFAC92130303A (from_user_id), INDEX IDX_A25FFAC929F6EE60 (to_user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE needs (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, title VARCHAR(255) NOT NULL, INDEX IDX_6A59BEEEA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE task (id INT AUTO_INCREMENT NOT NULL, accepted_by_id INT DEFAULT NULL, user_id INT NOT NULL, title VARCHAR(180) NOT NULL, description VARCHAR(255) NOT NULL, due_date DATE NOT NULL, respect_points INT NOT NULL, status VARCHAR(20) NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_527EDB2520F699D9 (accepted_by_id), INDEX IDX_527EDB25A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \\'(DC2Type:json)\\', password VARCHAR(255) NOT NULL, name VARCHAR(180) NOT NULL, respect_point INT NOT NULL, api_token VARCHAR(255) DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('ALTER TABLE activity_log ADD CONSTRAINT FK_FD06F647A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE capabilities ADD CONSTRAINT FK_1D3B2DFDA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE exchange_offers ADD CONSTRAINT FK_A25FFAC92130303A FOREIGN KEY (from_user_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE exchange_offers ADD CONSTRAINT FK_A25FFAC929F6EE60 FOREIGN KEY (to_user_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE needs ADD CONSTRAINT FK_6A59BEEEA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2520F699D9 FOREIGN KEY (accepted_by_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');\n }", "function up() {\n\t\t// Ensure that all the tables are built correctly\n\t\t\\Mojavi\\Util\\StringTools::consoleWrite(' - Index Initialization', 'Building', \\Mojavi\\Util\\StringTools::CONSOLE_COLOR_YELLOW);\n\t\t\n\t\t// Build User Indexes\n\t\ttry {\n\t\t\t\\Ficus\\User::ensureIndexes();\n\t\t} catch (\\Exception $e) {\n\t\t\t\\Mojavi\\Util\\StringTools::consoleWrite('\t - User', $e->getMessage(), \\Mojavi\\Util\\StringTools::CONSOLE_COLOR_RED, true);\n\t\t}\n\n\t\t\\Mojavi\\Util\\StringTools::consoleWrite(' - Index Initialization', 'Done', \\Mojavi\\Util\\StringTools::CONSOLE_COLOR_GREEN, true);\n\t}", "public function migrateJobsDatabase()\n {\n $this->migrationsRepository = $this->app->make('migration.repository');\n $this->migrationsRepository->createRepository();\n\n $migrator = new StructuredMigrator(\n $this->migrationsRepository,\n $this->app->make('db'),\n new JobsMigrationBatch()\n );\n\n $migrator->run();\n }", "protected function registerMigrations(): void\n {\n if (Satifest::$runsMigrations) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n return;\n }\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2019_03_13_181656_create_categories_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2019_03_13_181656_create_failed_jobs_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_03_13_181656_create_links_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_03_13_181656_create_model_has_permissions_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_03_13_181656_create_model_has_roles_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_03_13_181656_create_notifications_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_03_13_181656_create_password_resets_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_03_13_181656_create_permissions_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_03_13_181656_create_replies_table',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_03_13_181656_create_role_has_permissions_table',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_03_13_181656_create_roles_table',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_03_13_181656_create_topics_table',\n 'batch' => 1,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_03_13_181656_create_users_table',\n 'batch' => 1,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_permissions_table',\n 'batch' => 1,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_roles_table',\n 'batch' => 1,\n ),\n 15 => \n array (\n 'id' => 16,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_replies_table',\n 'batch' => 1,\n ),\n 16 => \n array (\n 'id' => 17,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_role_has_permissions_table',\n 'batch' => 1,\n ),\n 17 => \n array (\n 'id' => 18,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_topics_table',\n 'batch' => 1,\n ),\n ));\n \n \n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(ConditionsTableSeeder::class);\n $this->call(DeliveriesTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(AdvertsTableSeeder::class);\n // plaats postcode import in eigen / aparte seeder class ==>> Made migration (else DB:rename doesn't work inside seeder, makes copy)\n }", "public function up()\n {\n $this->batchInsert('{{%phongban}}', [\n 'tenPhongBan', 'ngayTao'\n ], [\n ['Mobile', '2017-04-12'],\n ['Web', '2017-04-12'],\n ['Tích hợp', '2017-04-12'],\n ['Hành chính', '2017-04-12'],\n ['Test', '2017-04-12'],\n ]);\n\n $this->batchInsert('{{%chucvu}}', [\n 'tenChucVu', 'ngayTao'\n ], [\n ['Thực tập sinh', '2017-04-17'],\n ['Nhân viên kiểm thử phần mềm', '2017-04-17'],\n ['Quản lý bộ phận Mobie', '2017-04-17'],\n ['Quản lý bộ phận Tích hợp', '2017-04-17'],\n ['Quản lý bộ phận Web', '2017-04-17'],\n ['Team leader', '2017-04-17'],\n ]);\n\n $this->batchInsert('{{%tinhtranghonnhan}}', [\n 'tinhtranghonnhan', 'ngayTao'\n ], [\n ['Chưa kết hôn', '2017-04-19'],\n ['Đã kết hôn', '2017-04-17'],\n ['Đang độc thân', '2017-04-17'],\n ]);\n }", "private function runTestMigrations()\n {\n $schema = $this->app['db']->connection()->getSchemaBuilder();\n\n if (! $schema->hasTable('users')) {\n $schema->create('users', function (Blueprint $table) {\n $table->increments('id');\n $table->string('name')->nullable();\n $table->string('role_label')->nullable();\n $table->timestamps();\n });\n }\n }", "private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}", "private function handleMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/Migrations');\n\n // Optional: Publish the migrations:\n $this->publishes([\n __DIR__ . '/Migrations' => base_path('database/migrations'),\n ]);\n }", "public function run(){\n \n //product\n if (!Schema::hasColumn('products', 'plus_option')) {\n Schema::table('products', function (Blueprint $table) {\n $table->boolean('plus_option')->default(true)->after('is_active');\n });\n }\n\n //coupons\n if (!Schema::hasColumn('coupons', 'times')) {\n Schema::table('coupons', function (Blueprint $table) {\n $table->integer('times')->default(0)->after('is_active');\n });\n }\n\n //option groups\n if (!Schema::hasColumn('option_groups', 'required')) {\n Schema::table('option_groups', function (Blueprint $table) {\n $table->boolean('required')->default(false)->after('multiple');\n });\n }\n\n //force migration for new tables\n if (!Schema::hasTable('coupon_user')) {\n Artisan::call('migrate --path=database/migrations/2021_08_07_124104_create_coupon_user_pivot_table.php --force');\n }\n\n //vendor min/max orders\n if (!Schema::hasColumn('vendor_types', 'color')) {\n Schema::table('vendor_types', function (Blueprint $table) {\n $table->string('color')->default(\"#000\")->after('name');\n });\n }\n\n //users\n if (!Schema::hasColumn('users', 'country_code')) {\n Schema::table('users', function (Blueprint $table) {\n $table->string('country_code')->nullable()->after('phone');\n });\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('tests', function($table) {\n\t\t\t// first drop old constraint\n\t\t\t$table->drop_foreign('tests_user_id_foreign');\n\t\t\t// then create new one with proper cascade behavior\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_delete('cascade');\n\t\t});\n\n\t\tSchema::table('testlogs', function($table) {\n\t\t\t// first drop old constraint\n\t\t\t$table->drop_foreign('testlogs_test_id_foreign');\n\t\t\t// then create new one with proper cascade behavior\n\t\t\t$table->foreign('test_id')->references('id')->on('tests')->on_delete('cascade');\n\t\t});\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function run(){\n return Artisan::call('migrate');\n }", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE city (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, postal_code INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE site (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE spot (id INT AUTO_INCREMENT NOT NULL, city_id INT NOT NULL, name VARCHAR(255) NOT NULL, street VARCHAR(255) DEFAULT NULL, latitude DOUBLE PRECISION DEFAULT NULL, longitude DOUBLE PRECISION DEFAULT NULL, INDEX IDX_B9327A738BAC62AF (city_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE state (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE tripback (id INT AUTO_INCREMENT NOT NULL, organiser_id INT NOT NULL, state_id INT NOT NULL, spot_id INT NOT NULL, name VARCHAR(255) NOT NULL, start_date_time DATETIME NOT NULL, max_registration INT NOT NULL, informations LONGTEXT DEFAULT NULL, cancel_reason LONGTEXT DEFAULT NULL, end_date_time DATETIME NOT NULL, INDEX IDX_7656F53BA0631C12 (organiser_id), INDEX IDX_7656F53B5D83CC1 (state_id), INDEX IDX_7656F53B2DF1D37C (spot_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE app_user (id INT AUTO_INCREMENT NOT NULL, site_id INT NOT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, firstname VARCHAR(255) NOT NULL, picture VARCHAR(255) DEFAULT NULL, mail VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, administrator TINYINT(1) NOT NULL, active TINYINT(1) NOT NULL, phone_number VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_88BDF3E9F85E0677 (username), INDEX IDX_88BDF3E9F6BD1646 (site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user_trip (user_id INT NOT NULL, trip_id INT NOT NULL, INDEX IDX_CD7B9F2A76ED395 (user_id), INDEX IDX_CD7B9F2A5BC2E0E (trip_id), PRIMARY KEY(user_id, trip_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('ALTER TABLE spot ADD CONSTRAINT FK_B9327A738BAC62AF FOREIGN KEY (city_id) REFERENCES city (id)');\n $this->addSql('ALTER TABLE tripback ADD CONSTRAINT FK_7656F53BA0631C12 FOREIGN KEY (organiser_id) REFERENCES app_user (id)');\n $this->addSql('ALTER TABLE tripback ADD CONSTRAINT FK_7656F53B5D83CC1 FOREIGN KEY (state_id) REFERENCES state (id)');\n $this->addSql('ALTER TABLE tripback ADD CONSTRAINT FK_7656F53B2DF1D37C FOREIGN KEY (spot_id) REFERENCES spot (id)');\n $this->addSql('ALTER TABLE app_user ADD CONSTRAINT FK_88BDF3E9F6BD1646 FOREIGN KEY (site_id) REFERENCES site (id)');\n $this->addSql('ALTER TABLE user_trip ADD CONSTRAINT FK_CD7B9F2A76ED395 FOREIGN KEY (user_id) REFERENCES app_user (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE user_trip ADD CONSTRAINT FK_CD7B9F2A5BC2E0E FOREIGN KEY (trip_id) REFERENCES tripback (id) ON DELETE CASCADE');\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE blog (id INT AUTO_INCREMENT NOT NULL, nombrecliente VARCHAR(255) NOT NULL, asunto VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE cama (id INT AUTO_INCREMENT NOT NULL, tipocama VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE casavacacional (id INT AUTO_INCREMENT NOT NULL, casadireccion VARCHAR(255) NOT NULL, casaprecio INT NOT NULL, cantbannos INT NOT NULL, canthabitaciones INT NOT NULL, patio TINYINT(1) NOT NULL, balcon TINYINT(1) NOT NULL, canthuesped INT NOT NULL, descripcion VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE centrosalud (id INT AUTO_INCREMENT NOT NULL, nombrecentro VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE contacto (id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(255) NOT NULL, correo VARCHAR(255) NOT NULL, asunto TINYINT(1) NOT NULL, descripcion VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE habitaciones (id INT AUTO_INCREMENT NOT NULL, fechainicio DATE NOT NULL, fechafinal DATE NOT NULL, cantcamas INT NOT NULL, descripcion VARCHAR(255) NOT NULL, disponible TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE piso (id INT AUTO_INCREMENT NOT NULL, direccion VARCHAR(255) NOT NULL, precio INT NOT NULL, canthabitaciones INT NOT NULL, cantbannos INT NOT NULL, pisopatio TINYINT(1) NOT NULL, pisobalcon TINYINT(1) NOT NULL, chicas TINYINT(1) NOT NULL, pisocanthuesped INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE reserva (id INT AUTO_INCREMENT NOT NULL, fechainicio DATE NOT NULL, fechafin DATE NOT NULL, pasaporte VARCHAR(255) NOT NULL, sexo TINYINT(1) NOT NULL, telefono VARCHAR(255) NOT NULL, descripcion VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE servicioadicional (id INT AUTO_INCREMENT NOT NULL, nombreservicio VARCHAR(255) NOT NULL, precio INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE supermercado (id INT AUTO_INCREMENT NOT NULL, nombresuper VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE universidad (id INT AUTO_INCREMENT NOT NULL, nombreuniversidad VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE zona (id INT AUTO_INCREMENT NOT NULL, nombrezona VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n }", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n $this->table('borrow_transactions')\n ->dropForeignKey('people_id')\n ->addForeignKey('people_id', 'people', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->table('cms_usergroups')\n ->addForeignKey('created_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n\n ->addForeignKey('modified_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->table('organisations')\n ->addForeignKey('created_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n\n ->addForeignKey('modified_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->execute('UPDATE cms_users p1\n left join cms_users p2 on p2.id=p1.created_by\n SET p1.created_by = NULL \n where p2.id is null');\n $this->execute('UPDATE cms_users p1\n left join cms_users p2 on p2.id=p1.modified_by\n SET p1.modified_by = NULL \n where p2.id is null');\n\n $this->table('cms_users')\n ->addForeignKey('created_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n\n ->addForeignKey('modified_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->table('stock')\n ->addForeignKey('picked_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n\n ->addForeignKey('ordered_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->execute('DELETE FROM transactions WHERE people_id NOT IN (select id from people)');\n\n $this->table('transactions')\n ->addForeignKey('people_id', 'people', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->execute('UPDATE product_categories SET parent_id = null where parent_id = 0');\n\n $this->table('product_categories')\n ->addForeignKey('parent_id', 'product_categories', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE destination (id INT AUTO_INCREMENT NOT NULL, id_pays_id INT NOT NULL, ville VARCHAR(255) NOT NULL, latitude VARCHAR(255) NOT NULL, longitude VARCHAR(255) NOT NULL, created DATETIME NOT NULL, INDEX IDX_3EC63EAA7879EB34 (id_pays_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE pays (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) NOT NULL, created DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE portfolio (id INT AUTO_INCREMENT NOT NULL, id_voyage_id INT NOT NULL, photos VARCHAR(255) NOT NULL, created DATETIME NOT NULL, INDEX IDX_A9ED1062E8FC5988 (id_voyage_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, login VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, created DATETIME NOT NULL, UNIQUE INDEX UNIQ_8D93D649AA08CB10 (login), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE voyage (id INT AUTO_INCREMENT NOT NULL, id_destination_id INT NOT NULL, titre VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, date DATETIME NOT NULL, kilometres INT NOT NULL, created DATETIME NOT NULL, INDEX IDX_3F9D8955BC0ADC46 (id_destination_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('ALTER TABLE destination ADD CONSTRAINT FK_3EC63EAA7879EB34 FOREIGN KEY (id_pays_id) REFERENCES pays (id)');\n $this->addSql('ALTER TABLE portfolio ADD CONSTRAINT FK_A9ED1062E8FC5988 FOREIGN KEY (id_voyage_id) REFERENCES voyage (id)');\n $this->addSql('ALTER TABLE voyage ADD CONSTRAINT FK_3F9D8955BC0ADC46 FOREIGN KEY (id_destination_id) REFERENCES destination (id)');\n }", "protected function makeMigration()\n {\n new MakeMigration($this, $this->files);\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE support (id INT AUTO_INCREMENT NOT NULL, campaign_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, id_video VARCHAR(255) NOT NULL, network VARCHAR(100) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_8004EBA5F639F774 (campaign_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE campaign (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, price INT NOT NULL, view_goal INT NOT NULL, view INT DEFAULT NULL, nb_like INT DEFAULT NULL, nb_comment INT DEFAULT NULL, total_impression INT DEFAULT NULL, cost_per_thousand INT DEFAULT NULL, engagement_rate INT DEFAULT NULL, status TINYINT(1) NOT NULL, finish_at DATETIME NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE campaign_user (campaign_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_8C74EDABF639F774 (campaign_id), INDEX IDX_8C74EDABA76ED395 (user_id), PRIMARY KEY(campaign_id, user_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE tag (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, password VARCHAR(255) NOT NULL, firstname VARCHAR(100) NOT NULL, lastname VARCHAR(100) NOT NULL, status TINYINT(1) NOT NULL, id_instagram VARCHAR(100) DEFAULT NULL, id_facebook VARCHAR(100) DEFAULT NULL, id_youtube VARCHAR(100) DEFAULT NULL, id_snapchat VARCHAR(100) DEFAULT NULL, id_tiktok VARCHAR(100) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, company_name VARCHAR(100) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user_role (user_id INT NOT NULL, role_id INT NOT NULL, INDEX IDX_2DE8C6A3A76ED395 (user_id), INDEX IDX_2DE8C6A3D60322AC (role_id), PRIMARY KEY(user_id, role_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE role (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, label VARCHAR(50) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE `like` (id INT AUTO_INCREMENT NOT NULL, support_id INT DEFAULT NULL, number INT DEFAULT NULL, created_at DATETIME NOT NULL, INDEX IDX_AC6340B3315B405 (support_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE view (id INT AUTO_INCREMENT NOT NULL, support_id INT DEFAULT NULL, number INT DEFAULT NULL, created_at DATETIME NOT NULL, INDEX IDX_FEFDAB8E315B405 (support_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE comment (id INT AUTO_INCREMENT NOT NULL, support_id INT DEFAULT NULL, number INT DEFAULT NULL, created_at DATETIME NOT NULL, INDEX IDX_9474526C315B405 (support_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE commentary (id INT AUTO_INCREMENT NOT NULL, article_id INT NOT NULL, username VARCHAR(80) NOT NULL, body LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_1CAC12CA7294869C (article_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE article (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(100) NOT NULL, subtitle VARCHAR(100) DEFAULT NULL, body LONGTEXT NOT NULL, image VARCHAR(80) DEFAULT NULL, nb_view INT DEFAULT NULL, status TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE article_tag (article_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_919694F97294869C (article_id), INDEX IDX_919694F9BAD26311 (tag_id), PRIMARY KEY(article_id, tag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE article_user (article_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_3DD151487294869C (article_id), INDEX IDX_3DD15148A76ED395 (user_id), PRIMARY KEY(article_id, user_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('ALTER TABLE support ADD CONSTRAINT FK_8004EBA5F639F774 FOREIGN KEY (campaign_id) REFERENCES campaign (id)');\n $this->addSql('ALTER TABLE campaign_user ADD CONSTRAINT FK_8C74EDABF639F774 FOREIGN KEY (campaign_id) REFERENCES campaign (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE campaign_user ADD CONSTRAINT FK_8C74EDABA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3D60322AC FOREIGN KEY (role_id) REFERENCES role (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE `like` ADD CONSTRAINT FK_AC6340B3315B405 FOREIGN KEY (support_id) REFERENCES support (id)');\n $this->addSql('ALTER TABLE view ADD CONSTRAINT FK_FEFDAB8E315B405 FOREIGN KEY (support_id) REFERENCES support (id)');\n $this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526C315B405 FOREIGN KEY (support_id) REFERENCES support (id)');\n $this->addSql('ALTER TABLE commentary ADD CONSTRAINT FK_1CAC12CA7294869C FOREIGN KEY (article_id) REFERENCES article (id)');\n $this->addSql('ALTER TABLE article_tag ADD CONSTRAINT FK_919694F97294869C FOREIGN KEY (article_id) REFERENCES article (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE article_tag ADD CONSTRAINT FK_919694F9BAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE article_user ADD CONSTRAINT FK_3DD151487294869C FOREIGN KEY (article_id) REFERENCES article (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE article_user ADD CONSTRAINT FK_3DD15148A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');\n }", "public function up(Schema $schema)\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() != \"mysql\", \"Migration can only be executed safely on 'mysql'.\");\n \n $this->addSql(\"CREATE TABLE system_alerts (id INT AUTO_INCREMENT NOT NULL, person_id INT DEFAULT NULL, organization_id INT DEFAULT NULL, created_by INT DEFAULT NULL, created_at DATETIME DEFAULT NULL, modified_by INT DEFAULT NULL, modified_at DATETIME DEFAULT NULL, deleted_by INT DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, title VARCHAR(200) DEFAULT NULL, description VARCHAR(5000) DEFAULT NULL, start_date DATETIME DEFAULT NULL, end_date DATETIME DEFAULT NULL, is_enabled TINYINT(1) DEFAULT NULL, INDEX IDX_E7F475AA217BBB47 (person_id), INDEX IDX_E7F475AA32C8A3DE (organization_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"DROP TABLE organizationrole\");\n $this->addSql(\"ALTER TABLE AccessToken DROP FOREIGN KEY FK_B39617F5A76ED395\");\n $this->addSql(\"ALTER TABLE AuthCode DROP FOREIGN KEY FK_F1D7D177A76ED395\");\n $this->addSql(\"ALTER TABLE RefreshToken DROP FOREIGN KEY FK_7142379EA76ED395\");\n $this->addSql(\"ALTER TABLE person_entity DROP FOREIGN KEY FK_928D74DEA38A39E4\");\n $this->addSql(\"ALTER TABLE person_metadata DROP FOREIGN KEY FK_DB529123A38A39E4\");\n $this->addSql(\"ALTER TABLE personcontactinfo DROP FOREIGN KEY FK_2E28DAF837886FBE\");\n $this->addSql(\"ALTER TABLE organizationlang DROP FOREIGN KEY FK_76EFC27BE808A0A6\");\n\n $this->addSql(\"ALTER TABLE person CHANGE personid id INT AUTO_INCREMENT NOT NULL\");\n $this->addSql(\"ALTER TABLE AccessToken ADD CONSTRAINT FK_B39617F5A76ED395 FOREIGN KEY (user_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE AuthCode ADD CONSTRAINT FK_F1D7D177A76ED395 FOREIGN KEY (user_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE contactinfo ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n $this->addSql(\"ALTER TABLE entity ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n $this->addSql(\"ALTER TABLE organization ADD parent_organization_id INT DEFAULT NULL, ADD time_zone VARCHAR(45) DEFAULT NULL, ADD logo_file_name VARCHAR(100) DEFAULT NULL, ADD primary_color VARCHAR(45) DEFAULT NULL, ADD secondary_color VARCHAR(45) DEFAULT NULL, ADD ebi_confidentiality_statement VARCHAR(5000) DEFAULT NULL, ADD irb_confidentiality_statement VARCHAR(5000) DEFAULT NULL, DROP parentorganizationid, DROP timezone, CHANGE subdomain subdomain VARCHAR(45) DEFAULT NULL, CHANGE status status VARCHAR(1) DEFAULT NULL, CHANGE website website VARCHAR(100) DEFAULT NULL, CHANGE organizationid id INT AUTO_INCREMENT NOT NULL\");\n $this->addSql(\"ALTER TABLE organizationlang ADD CONSTRAINT FK_76EFC27BE808A0A6 FOREIGN KEY (organizationid) REFERENCES organization (id)\");\n $this->addSql(\"ALTER TABLE system_alerts ADD CONSTRAINT FK_E7F475AA217BBB47 FOREIGN KEY (person_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE system_alerts ADD CONSTRAINT FK_E7F475AA32C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (id)\");\n $this->addSql(\"ALTER TABLE person_entity ADD CONSTRAINT FK_928D74DEA38A39E4 FOREIGN KEY (Person_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE person_metadata ADD CONSTRAINT FK_DB529123A38A39E4 FOREIGN KEY (Person_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE personcontactinfo ADD CONSTRAINT FK_2E28DAF837886FBE FOREIGN KEY (personid) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE RefreshToken ADD CONSTRAINT FK_7142379EA76ED395 FOREIGN KEY (user_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE role ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n $this->addSql(\"ALTER TABLE rolelang ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n $this->addSql(\"ALTER TABLE upload_file_log ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n }", "public function up()\n {\n $this->table('accounting_entries')\n ->addColumn('association_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('accounting_entry_type_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('event_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('amount', 'decimal', [\n 'default' => null,\n 'null' => true,\n 'precision' => 15,\n 'scale' => 2,\n ])\n ->addColumn('reason', 'text', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('updated', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addIndex(\n [\n 'accounting_entry_type_id',\n ]\n )\n ->addIndex(\n [\n 'association_id',\n ]\n )\n ->create();\n\n $this->table('accounting_entry_type')\n ->addColumn('type_name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->create();\n\n $this->table('associations')\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('association_type', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('adresse', 'text', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('email', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('RNA_number', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('plan_type', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('updated', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('image_name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('image_path', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->create();\n\n $this->table('associations_events')\n ->addColumn('association_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('event_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addIndex(\n [\n 'event_id',\n ]\n )\n ->addIndex(\n [\n 'association_id',\n ]\n )\n ->create();\n\n $this->table('event_type')\n ->addColumn('name', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('icon', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->create();\n\n $this->table('events')\n ->addColumn('event_name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('start_date', 'date', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('end_date', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('start_time', 'time', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('end_time', 'time', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('location', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('updated', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('event_type_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addIndex(\n [\n 'event_type_id',\n ]\n )\n ->create();\n\n $this->table('members')\n ->addColumn('first_name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('last_name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('birth_date', 'date', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('email', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('phone_number', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('contribution_is_paid', 'boolean', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('association_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('inscription_date', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('updated', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addIndex(\n [\n 'association_id',\n ]\n )\n ->create();\n\n $this->table('roles')\n ->addColumn('role', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('updated', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->create();\n\n $this->table('statistics')\n ->addColumn('association_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('statistics_type_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('data', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('updated', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addIndex(\n [\n 'statistics_type_id',\n ]\n )\n ->addIndex(\n [\n 'association_id',\n ]\n )\n ->create();\n\n $this->table('statistics_event')\n ->addColumn('event_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('statistics_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addIndex(\n [\n 'statistics_id',\n ]\n )\n ->addIndex(\n [\n 'event_id',\n ]\n )\n ->create();\n\n $this->table('statistics_type')\n ->addColumn('type', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('updated', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->create();\n\n $this->table('users')\n ->addColumn('first_name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('username', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('last_name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('email', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('password', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('association_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('role_id', 'integer', [\n 'default' => '1',\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('updated', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('image_name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addColumn('image_path', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addIndex(\n [\n 'role_id',\n ]\n )\n ->addIndex(\n [\n 'association_id',\n ]\n )\n ->create();\n\n $this->table('accounting_entries')\n ->addForeignKey(\n 'accounting_entry_type_id',\n 'accounting_entry_type',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->addForeignKey(\n 'association_id',\n 'associations',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->update();\n\n $this->table('associations_events')\n ->addForeignKey(\n 'event_id',\n 'events',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->addForeignKey(\n 'association_id',\n 'associations',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->update();\n\n $this->table('events')\n ->addForeignKey(\n 'event_type_id',\n 'event_type',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->update();\n\n $this->table('members')\n ->addForeignKey(\n 'association_id',\n 'associations',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->update();\n\n $this->table('statistics')\n ->addForeignKey(\n 'statistics_type_id',\n 'statistics_type',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->addForeignKey(\n 'association_id',\n 'associations',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->update();\n\n $this->table('statistics_event')\n ->addForeignKey(\n 'statistics_id',\n 'statistics',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->addForeignKey(\n 'event_id',\n 'events',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->update();\n\n $this->table('users')\n ->addForeignKey(\n 'role_id',\n 'roles',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->addForeignKey(\n 'association_id',\n 'associations',\n 'id',\n [\n 'update' => 'RESTRICT',\n 'delete' => 'RESTRICT',\n ]\n )\n ->update();\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE abonnement (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, date_fin DATE NOT NULL, prix DOUBLE PRECISION NOT NULL, nom_carte VARCHAR(45) NOT NULL, code_postal INT NOT NULL, num_carte INT NOT NULL, cvc INT NOT NULL, UNIQUE INDEX UNIQ_351268BBA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE acteur (id INT AUTO_INCREMENT NOT NULL, nom_prenom VARCHAR(45) NOT NULL, nationalite VARCHAR(45) NOT NULL, date_naissance DATE NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE film (id INT AUTO_INCREMENT NOT NULL, genre_id INT NOT NULL, langue_id INT NOT NULL, titre VARCHAR(45) NOT NULL, date_sortie DATE NOT NULL, duree VARCHAR(20) NOT NULL, description LONGTEXT NOT NULL, video_url LONGTEXT NOT NULL, url_image LONGTEXT NOT NULL, INDEX IDX_8244BE224296D31F (genre_id), INDEX IDX_8244BE222AADBACD (langue_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE film_acteur (film_id INT NOT NULL, acteur_id INT NOT NULL, INDEX IDX_8108EE68567F5183 (film_id), INDEX IDX_8108EE68DA6F574A (acteur_id), PRIMARY KEY(film_id, acteur_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE genre (id INT AUTO_INCREMENT NOT NULL, genre VARCHAR(20) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE langue (id INT AUTO_INCREMENT NOT NULL, langue VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, nom_prenom VARCHAR(45) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('ALTER TABLE abonnement ADD CONSTRAINT FK_351268BBA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE film ADD CONSTRAINT FK_8244BE224296D31F FOREIGN KEY (genre_id) REFERENCES genre (id)');\n $this->addSql('ALTER TABLE film ADD CONSTRAINT FK_8244BE222AADBACD FOREIGN KEY (langue_id) REFERENCES langue (id)');\n $this->addSql('ALTER TABLE film_acteur ADD CONSTRAINT FK_8108EE68567F5183 FOREIGN KEY (film_id) REFERENCES film (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE film_acteur ADD CONSTRAINT FK_8108EE68DA6F574A FOREIGN KEY (acteur_id) REFERENCES acteur (id) ON DELETE CASCADE');\n }", "function _migrate($filename) {\n\t\t$migrations = $this->migration;\n\n\t\t$this->conn->execute(file_get_contents(\"migrations/$filename\"));\n\t\t$migrations->save($migrations->newEntity(['migration_file' => $filename]));\n\t}", "public function migrate($execute = false)\n {\n }", "public function up() \n {\n $db = SiteSpecific::get_mysqli_db();\n \n $createArchiveTableQuery = \"CREATE TABLE `logs_archive` (\n `uuid` binary(16) NOT NULL,\n `message` text NOT NULL,\n `context` longtext NOT NULL,\n `priority` int(1) NOT NULL,\n `when` timestamp NOT NULL,\n PRIMARY KEY (`uuid`),\n KEY `priority` (`priority`),\n KEY `when` (`when`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;\";\n \n $result = $db->query($createArchiveTableQuery);\n \n if ($result === FALSE)\n {\n throw new Exception(\"Failed to convert logs table to utf8.\");\n }\n }", "public function up(Schema $schema): void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE IF NOT EXISTS acteur (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, prenom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, date_naissance DATE NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE IF NOT EXISTS contact (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, firstname VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, sanitary_pass TINYINT(1) DEFAULT NULL, email VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, password VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE IF NOT EXISTS film (id INT AUTO_INCREMENT NOT NULL, realisateur_id INT DEFAULT NULL, titre VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, annee DATETIME NOT NULL, synopsis LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, duree INT NOT NULL, image VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8244BE22F1D8422E (realisateur_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE IF NOT EXISTS film_acteur (film_id INT NOT NULL, acteur_id INT NOT NULL, INDEX IDX_8108EE68567F5183 (film_id), INDEX IDX_8108EE68DA6F574A (acteur_id), PRIMARY KEY(film_id, acteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE IF NOT EXISTS realisateur (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, prenom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, date_naissance DATE NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n }", "public function supportsMigrations();", "public function up()\n\t{\n\t\tSchema::create('step9', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('estudio_id');\n\t\t\t$table->string('presupuesto');\n\t\t\t$table->string('tiene_deudas');\n\t\t\t$table->string('transporte_escuela');\n\t\t\t$table->string('costo_transporte_papa');\n\t\t\t$table->string('costo_transporte_mama');\n\t\t\t$table->string('costo_transporte_hijos');\n\t\t\t$table->string('servicios_luz');\n\t\t\t$table->string('servicios_agua');\n\t\t\t$table->string('servicios_gas');\n\t\t\t$table->string('servicios_telefono');\n\t\t\t$table->string('servicios_internet');\n\t\t\t$table->string('servicios_cable');\n\t\t\t$table->string('hijos_egresados');\n\t\t\t$table->string('hijos_cuantos');\n\t\t\t$table->string('proyecto_familiar');\n\t\t\t$table->string('familia');\n\t\t\t$table->string('anio_reingreso');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_deudas', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('donde');\n\t\t\t$table->string('que');\n\t\t\t$table->string('cuanto');\n\t\t\t$table->string('tiempo');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_hijos', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('egreso');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_semanales', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('consumo');\n\t\t\t$table->string('gasto');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_mensuales', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('gasto');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_gastos', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('gasto');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_otros_salud', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('parentesco');\n\t\t\t$table->string('tipo_enfermedad');\n\t\t\t$table->string('tiempo_padecer');\n\t\t\t$table->string('costo_mensual');\n\t\t\t$table->string('observaciones');\n\t\t\t$table->timestamps();\n\t\t});\n\t}", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "private function migration()\n {\n $location = $this->args['location'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR;\n if (!is_dir($location))\n {\n mkdir($location);\n }\n\n $backtrace = debug_backtrace();\n $calling_function = $backtrace[1]['function'];\n\n if ($calling_function === \"model\")\n {\n $class_name = 'Migration_Add_';\n $filename = 'add_';\n $table_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $dirs = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $dirs = join('_', $dirs);\n $class_name .= strtolower($dirs) . '_';\n $filename .= strtolower($dirs) . '_';\n $table_name .= strtolower($dirs) . '_';\n }\n $args = array(\n 'class_name' => $class_name . Inflector::pluralize($this->args['name']),\n 'table_name' => $table_name . Inflector::pluralize(strtolower($this->args['name'])),\n 'filename' => $filename . Inflector::pluralize(ApplicationHelpers::underscorify($this->args['name'])) . '.php',\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'migration';\n }\n else\n {\n $args = array(\n 'class_name' => 'Migration_' . $this->args['name'],\n 'table_name' => $this->get_table_name_out_of_migration_name(),\n 'filename' => $this->args['filename'],\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'empty_migration';\n }\n\n $template = new TemplateScanner($template_name, $args);\n $migration = $template->parse();\n\n $migration_number = MigrationHelpers::get_migration_number($this->args['location']);\n $filename = $location . $migration_number . '_' . $args['filename'];\n $potential_duplicate_migration_filename = MigrationHelpers::decrement_migration_number($migration_number) . '_' . $args['filename'];\n $potential_duplicate_migration = $location . $potential_duplicate_migration_filename;\n\n $message = \"\\t\";\n if (file_exists($potential_duplicate_migration))\n {\n $message .= 'Migration already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $potential_duplicate_migration_filename;\n }\n else if (file_put_contents($filename, $migration) && MigrationHelpers::add_migration_number_to_config_file($this->args['location'], $migration_number))\n {\n $message .= 'Created Migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $args['filename'];\n }\n else\n {\n $message .= 'Unable to create migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $this->args['filename'];\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n return;\n }", "public function up(Schema $schema) : void\r\n {\r\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\r\n\r\n $this->addSql('CREATE TABLE actividad (id VARCHAR(255) NOT NULL, persona_id INT NOT NULL, inicio DATETIME NOT NULL, fin DATETIME DEFAULT NULL, discr VARCHAR(255) NOT NULL, INDEX IDX_8DF2BD06F5F88DB9 (persona_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\r\n $this->addSql('CREATE TABLE director_instituto (id VARCHAR(255) NOT NULL, instituto_id INT NOT NULL, INDEX IDX_42BB5FD46C6EF28 (instituto_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\r\n $this->addSql('CREATE TABLE persona (id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(255) NOT NULL, apellido VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\r\n $this->addSql('CREATE TABLE instituto (id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\r\n $this->addSql('ALTER TABLE actividad ADD CONSTRAINT FK_8DF2BD06F5F88DB9 FOREIGN KEY (persona_id) REFERENCES persona (id)');\r\n $this->addSql('ALTER TABLE director_instituto ADD CONSTRAINT FK_42BB5FD46C6EF28 FOREIGN KEY (instituto_id) REFERENCES instituto (id)');\r\n $this->addSql('ALTER TABLE director_instituto ADD CONSTRAINT FK_42BB5FD4BF396750 FOREIGN KEY (id) REFERENCES actividad (id) ON DELETE CASCADE');\r\n $this->addSql('ALTER TABLE asambleista CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL');\r\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up() { return $this->run('up'); }", "public static function up()\n {\n $table_name = static::getTableName();\n\n Schema::create($table_name, function (Blueprint $blueprint) {\n $class = static::class;\n $schema = (new $class())->getSchema();\n\n $blueprint->id();\n\n $blueprint->timestamps();\n\n if (isset($schema->datas)) {\n self::addDatasToBlueprint($schema->datas, $blueprint);\n }\n\n if (isset($schema->groups)) {\n foreach ($schema->groups as $group) {\n self::addGroupToBlueprint($group, $blueprint);\n }\n }\n });\n }", "public function up(Schema $schema)\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() != \"mysql\", \"Migration can only be executed safely on 'mysql'.\");\n \n $this->addSql(\"CREATE TABLE authentication_method (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, approved_by INT DEFAULT NULL, email_token VARCHAR(40) NOT NULL, registration_code VARCHAR(8) NOT NULL, approved_at DATETIME NOT NULL, revoked_at DATETIME DEFAULT NULL, requested_at DATETIME NOT NULL, last_used_at DATETIME NOT NULL, type VARCHAR(255) NOT NULL, phone_number VARCHAR(24) DEFAULT NULL, INDEX IDX_17DA06C67E3C61F9 (owner_id), INDEX IDX_17DA06C64EA3CB3D (approved_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"CREATE TABLE organisation (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(100) NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"CREATE TABLE registration_authority (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, contact_info VARCHAR(200) DEFAULT NULL, location VARCHAR(200) DEFAULT NULL, UNIQUE INDEX UNIQ_A9A59499A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, organisation INT DEFAULT NULL, name_id VARCHAR(64) NOT NULL, display_name VARCHAR(150) NOT NULL, email VARCHAR(360) NOT NULL, INDEX IDX_8D93D649E6E132B4 (organisation), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"ALTER TABLE authentication_method ADD CONSTRAINT FK_17DA06C67E3C61F9 FOREIGN KEY (owner_id) REFERENCES user (id)\");\n $this->addSql(\"ALTER TABLE authentication_method ADD CONSTRAINT FK_17DA06C64EA3CB3D FOREIGN KEY (approved_by) REFERENCES user (id)\");\n $this->addSql(\"ALTER TABLE registration_authority ADD CONSTRAINT FK_A9A59499A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)\");\n $this->addSql(\"ALTER TABLE user ADD CONSTRAINT FK_8D93D649E6E132B4 FOREIGN KEY (organisation) REFERENCES organisation (id)\");\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE admin (id INT AUTO_INCREMENT NOT NULL, admin_name VARCHAR(20) NOT NULL, password VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE alumno (id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(50) NOT NULL, apellidos VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE alumnoxpi (id INT AUTO_INCREMENT NOT NULL, pi_id_id INT DEFAULT NULL, alumno_id_id INT DEFAULT NULL, INDEX IDX_249B602E93E294A7 (pi_id_id), INDEX IDX_249B602ED3819735 (alumno_id_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE documento (id INT AUTO_INCREMENT NOT NULL, pi_id_id INT DEFAULT NULL, nombre VARCHAR(50) NOT NULL, formato VARCHAR(50) NOT NULL, INDEX IDX_B6B12EC793E294A7 (pi_id_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE prof (id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE proyecto (id INT AUTO_INCREMENT NOT NULL, prof_id INT DEFAULT NULL, titulacion_id INT DEFAULT NULL, titulo VARCHAR(255) NOT NULL, curso_escolar VARCHAR(50) NOT NULL, descripcion VARCHAR(255) NOT NULL, INDEX IDX_6FD202B9ABC1F7FE (prof_id), INDEX IDX_6FD202B9F471CF55 (titulacion_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE titulacion (id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL, roles TINYINT(1) NOT NULL, password VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE usuario (id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(50) NOT NULL, contrasenya VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('ALTER TABLE alumnoxpi ADD CONSTRAINT FK_249B602E93E294A7 FOREIGN KEY (pi_id_id) REFERENCES proyecto (id)');\n $this->addSql('ALTER TABLE alumnoxpi ADD CONSTRAINT FK_249B602ED3819735 FOREIGN KEY (alumno_id_id) REFERENCES alumno (id)');\n $this->addSql('ALTER TABLE documento ADD CONSTRAINT FK_B6B12EC793E294A7 FOREIGN KEY (pi_id_id) REFERENCES proyecto (id)');\n $this->addSql('ALTER TABLE proyecto ADD CONSTRAINT FK_6FD202B9ABC1F7FE FOREIGN KEY (prof_id) REFERENCES prof (id)');\n $this->addSql('ALTER TABLE proyecto ADD CONSTRAINT FK_6FD202B9F471CF55 FOREIGN KEY (titulacion_id) REFERENCES titulacion (id)');\n }", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function run()\n {\n Artisan::call('migrate:refresh');\n $this->populateUsers();\n $this->populatePosts();\n $this->populateComments();\n }", "function runUp()\n{\n $files = scandir(LIB_ROOT . '/migrations');\n\n $db_migration_version = get_current_migration_version();\n\n $migrations = array();\n\n foreach($files as $file)\n {\n if(preg_match('/migration_([1-9][0-9]*)\\.php/i', $file, $matches))\n {\n $migration_version = $matches[1];\n\n // we only care about this migration if it has not been performed yet\n if($migration_version > $db_migration_version)\n {\n require_once LIB_ROOT . '/migrations/' . $matches[0];\n\n $migrations[$migration_version] = 'Migration_' . $migration_version;\n }\n }\n }\n\n if(count($migrations) == 0)\n echo 'There are no migrations to run; DB is already up to date (at version ' . $db_migration_version . ').' . \"\\n\\n\";\n else\n {\n // sort migrations, so that we execute them in ascending order\n ksort($migrations);\n\n $count = 0;\n\n foreach ($migrations as $id => $class_name)\n {\n $migrationClass = new $class_name();\n\n $count++;\n\n echo 'Running migration ' . $id . ' (' . $count . ' of ' . count($migrations) . ')...' . \"\\n\";\n\n try\n {\n $migrationClass->Up();\n fetch_none('UPDATE migration_version SET version=' . quote_smart($id));\n echo ' done!' . \"\\n\";\n }\n catch(Exception $e)\n {\n echo ' Encountered an exception during migration:' . \"\\n\";\n echo ' ' . $e->getMessage() . \"\\n\";\n echo ' Migration was not completed; the database may be left in a weird state.' . \"\\n\";\n if($count < count($migrations))\n {\n $remaining = (count($migrations) - $count);\n echo $remaining . ' remaining migration' . ($remaining == 1 ? '' : 's') . ' will not be run.' . \"\\n\";\n }\n echo \"\\n\";\n die();\n }\n }\n\n echo 'All done!' . \"\\n\\n\";\n }\n}", "public function createMigrationsTable(): void;", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE staff (id INT AUTO_INCREMENT NOT NULL, lastname VARCHAR(255) NOT NULL, firstname VARCHAR(255) NOT NULL, is_active TINYINT(1) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE reservation_equipement (id INT AUTO_INCREMENT NOT NULL, reservation_id INT NOT NULL, equipement_id INT NOT NULL, quantity INT DEFAULT NULL, INDEX IDX_D81E0F47B83297E7 (reservation_id), INDEX IDX_D81E0F47806F0F5C (equipement_id), UNIQUE INDEX equipementreservation_unique (reservation_id, equipement_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE company (id INT AUTO_INCREMENT NOT NULL, company_name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE reservation (id INT AUTO_INCREMENT NOT NULL, company_id INT NOT NULL, customer_id INT NOT NULL, staff_id INT NOT NULL, comment LONGTEXT DEFAULT NULL, signature LONGTEXT NOT NULL, start_date DATETIME NOT NULL, is_archived TINYINT(1) NOT NULL, end_date DATETIME DEFAULT NULL, INDEX IDX_42C84955979B1AD6 (company_id), INDEX IDX_42C849559395C3F3 (customer_id), INDEX IDX_42C84955D4D57CD (staff_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE reservation_room (reservation_id INT NOT NULL, room_id INT NOT NULL, INDEX IDX_64A69CF3B83297E7 (reservation_id), INDEX IDX_64A69CF354177093 (room_id), PRIMARY KEY(reservation_id, room_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE equipement (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE customer (id INT AUTO_INCREMENT NOT NULL, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255) DEFAULT NULL, phone_number VARCHAR(10) DEFAULT NULL, mail_address VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE room (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, door INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('ALTER TABLE reservation_equipement ADD CONSTRAINT FK_D81E0F47B83297E7 FOREIGN KEY (reservation_id) REFERENCES reservation (id)');\n $this->addSql('ALTER TABLE reservation_equipement ADD CONSTRAINT FK_D81E0F47806F0F5C FOREIGN KEY (equipement_id) REFERENCES equipement (id)');\n $this->addSql('ALTER TABLE reservation ADD CONSTRAINT FK_42C84955979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');\n $this->addSql('ALTER TABLE reservation ADD CONSTRAINT FK_42C849559395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');\n $this->addSql('ALTER TABLE reservation ADD CONSTRAINT FK_42C84955D4D57CD FOREIGN KEY (staff_id) REFERENCES staff (id)');\n $this->addSql('ALTER TABLE reservation_room ADD CONSTRAINT FK_64A69CF3B83297E7 FOREIGN KEY (reservation_id) REFERENCES reservation (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE reservation_room ADD CONSTRAINT FK_64A69CF354177093 FOREIGN KEY (room_id) REFERENCES room (id) ON DELETE CASCADE');\n }", "public function up()\n {\n if(!($customFieldsModule = $this->module->getModule($this->customFieldsModule)))\n {\n echo \" > error: the module $this->customFieldsModule does not exist in module {$this->module->id}.\\n\";\n return false;\n }\n \n ####################### TABLES #######################\n \n //Create the table that stores custom field configurations.\n $this->createTable($customFieldsModule->tableName, [\n 'id' => 'pk',\n 'name' => 'varchar(50) NOT NULL',\n 'title' => 'string NOT NULL',\n 'description' => 'text NOT NULL',\n 'form_group_id' => 'integer NOT NULL default \\'0\\'',\n 'type' => 'varchar(255) NOT NULL',\n 'size' => 'int(3) NOT NULL default \\'0\\'',\n 'min_size' => 'int(3) NOT NULL default \\'0\\'',\n 'required' => 'boolean NOT NULL default \\'0\\'',\n 'configuration' => 'text NOT NULL',\n 'validator' => 'string NOT NULL default \\'\\'',\n 'default' => 'text NOT NULL',\n 'in_forms' => 'boolean NOT NULL default \\'1\\'',\n 'translatable' => 'boolean NOT NULL default \\'0\\'',\n 'position' => 'integer NOT NULL default \\'0\\'',\n 'protected' => 'boolean NOT NULL default \\'0\\'',\n 'dt_crtd' => 'datetime NOT NULL',\n 'ts_updt' => 'timestamp NOT NULL default CURRENT_TIMESTAMP',\n ]);\n \n ####################### FIELD PARAMETERS #######################\n \n echo \" > creating field parameters ...\";\n $time = microtime(true); \n\n foreach($customFieldsModule->getFieldParameters() as $param)\n {\n Yii::$app->db->createCommand()->addColumn($customFieldsModule->tableName, $param->name, $param->getSql())->execute();\n }\n \n Yii::$app->db->schema->refresh(); // Schema changed so we must refresh it.\n \n echo \" done (time: \".sprintf('%.3f', microtime(true)-$time).\"s)\\n\";\n \n ####################### PERMISSIONS #######################\n \n echo \" > creating permissions ...\";\n $time = microtime(true);\n $this->createModelPermissions($customFieldsModule->id, ['CustomField-'.$this->module->id]);\n echo \" done (time: \".sprintf('%.3f', microtime(true)-$time).\"s)\\n\";\n }", "protected function registerMigrations()\n {\n if (TwilioVerify::$runsMigrations && $this->app->runningInConsole()) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE customer (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL, customer_type VARCHAR(50) NOT NULL, place_no VARCHAR(10) NOT NULL, street VARCHAR(100) NOT NULL, city VARCHAR(100) NOT NULL, UNIQUE INDEX UNIQ_81398E09E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE driver (id INT AUTO_INCREMENT NOT NULL, store_id INT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL, work_hours TIME DEFAULT NULL, status VARCHAR(10) NOT NULL, UNIQUE INDEX UNIQ_11667CD9E7927C74 (email), INDEX IDX_11667CD9B092A811 (store_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE driver_assistant (id INT AUTO_INCREMENT NOT NULL, store_id INT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL, work_hours TIME DEFAULT NULL, status VARCHAR(10) NOT NULL, UNIQUE INDEX UNIQ_EDBB77C8E7927C74 (email), INDEX IDX_EDBB77C8B092A811 (store_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE manager (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL, UNIQUE INDEX UNIQ_FA2425B9E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE order_product (orders_id INT NOT NULL, product_id INT NOT NULL, quantity INT NOT NULL, INDEX IDX_2530ADE6CFFE9AD6 (orders_id), INDEX IDX_2530ADE64584665A (product_id), PRIMARY KEY(orders_id, product_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE orders (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, route_id INT NOT NULL, order_status VARCHAR(10) NOT NULL, date_placed DATE NOT NULL, date_completed DATE DEFAULT NULL, INDEX IDX_E52FFDEE9395C3F3 (customer_id), INDEX IDX_E52FFDEE34ECB4E6 (route_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE phone_number (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, phone_number VARCHAR(15) NOT NULL, INDEX IDX_6B01BC5B9395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE product (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, unit_price NUMERIC(8, 2) NOT NULL, size NUMERIC(6, 3) NOT NULL, picture VARCHAR(500) DEFAULT NULL, category VARCHAR(100) NOT NULL, status VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE route (id INT AUTO_INCREMENT NOT NULL, store_id INT NOT NULL, decription VARCHAR(500) NOT NULL, max_time TIME NOT NULL, INDEX IDX_2C42079B092A811 (store_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE store (id INT AUTO_INCREMENT NOT NULL, city VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE train_schedule (id INT AUTO_INCREMENT NOT NULL, destination VARCHAR(50) NOT NULL, capacity NUMERIC(6, 3) NOT NULL, start_time TIME NOT NULL, journey_time TIME NOT NULL, day VARCHAR(10) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE transports (train_schedule_id INT NOT NULL, orders_id INT NOT NULL, date DATE NOT NULL, INDEX IDX_C7BE69E52AAD00B3 (train_schedule_id), INDEX IDX_C7BE69E5CFFE9AD6 (orders_id), PRIMARY KEY(train_schedule_id, orders_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE truck (id INT AUTO_INCREMENT NOT NULL, store_id INT NOT NULL, truck_no VARCHAR(20) NOT NULL, used_hours TIME NOT NULL, status VARCHAR(10) NOT NULL, INDEX IDX_CDCCF30AB092A811 (store_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE truck_order (orders_id INT NOT NULL, truck_schedule_id INT NOT NULL, INDEX IDX_74F22242CFFE9AD6 (orders_id), INDEX IDX_74F222422BAB9317 (truck_schedule_id), PRIMARY KEY(orders_id, truck_schedule_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE truck_schedule (id INT AUTO_INCREMENT NOT NULL, truck_id INT NOT NULL, driver_id INT NOT NULL, driver_assistant_id INT NOT NULL, route_id INT NOT NULL, start_time DATETIME DEFAULT NULL, end_time DATETIME DEFAULT NULL, status VARCHAR(10) NOT NULL, INDEX IDX_36F93539C6957CCE (truck_id), INDEX IDX_36F93539C3423909 (driver_id), INDEX IDX_36F93539C5308710 (driver_assistant_id), INDEX IDX_36F9353934ECB4E6 (route_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('ALTER TABLE driver ADD CONSTRAINT FK_11667CD9B092A811 FOREIGN KEY (store_id) REFERENCES store (id)');\n $this->addSql('ALTER TABLE driver_assistant ADD CONSTRAINT FK_EDBB77C8B092A811 FOREIGN KEY (store_id) REFERENCES store (id)');\n $this->addSql('ALTER TABLE order_product ADD CONSTRAINT FK_2530ADE6CFFE9AD6 FOREIGN KEY (orders_id) REFERENCES orders (id)');\n $this->addSql('ALTER TABLE order_product ADD CONSTRAINT FK_2530ADE64584665A FOREIGN KEY (product_id) REFERENCES product (id)');\n $this->addSql('ALTER TABLE orders ADD CONSTRAINT FK_E52FFDEE9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');\n $this->addSql('ALTER TABLE orders ADD CONSTRAINT FK_E52FFDEE34ECB4E6 FOREIGN KEY (route_id) REFERENCES route (id)');\n $this->addSql('ALTER TABLE phone_number ADD CONSTRAINT FK_6B01BC5B9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');\n $this->addSql('ALTER TABLE route ADD CONSTRAINT FK_2C42079B092A811 FOREIGN KEY (store_id) REFERENCES store (id)');\n $this->addSql('ALTER TABLE transports ADD CONSTRAINT FK_C7BE69E52AAD00B3 FOREIGN KEY (train_schedule_id) REFERENCES train_schedule (id)');\n $this->addSql('ALTER TABLE transports ADD CONSTRAINT FK_C7BE69E5CFFE9AD6 FOREIGN KEY (orders_id) REFERENCES orders (id)');\n $this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30AB092A811 FOREIGN KEY (store_id) REFERENCES store (id)');\n $this->addSql('ALTER TABLE truck_order ADD CONSTRAINT FK_74F22242CFFE9AD6 FOREIGN KEY (orders_id) REFERENCES orders (id)');\n $this->addSql('ALTER TABLE truck_order ADD CONSTRAINT FK_74F222422BAB9317 FOREIGN KEY (truck_schedule_id) REFERENCES truck_schedule (id)');\n $this->addSql('ALTER TABLE truck_schedule ADD CONSTRAINT FK_36F93539C6957CCE FOREIGN KEY (truck_id) REFERENCES truck (id)');\n $this->addSql('ALTER TABLE truck_schedule ADD CONSTRAINT FK_36F93539C3423909 FOREIGN KEY (driver_id) REFERENCES driver (id)');\n $this->addSql('ALTER TABLE truck_schedule ADD CONSTRAINT FK_36F93539C5308710 FOREIGN KEY (driver_assistant_id) REFERENCES driver_assistant (id)');\n $this->addSql('ALTER TABLE truck_schedule ADD CONSTRAINT FK_36F9353934ECB4E6 FOREIGN KEY (route_id) REFERENCES route (id)');\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE pergunta (id INT AUTO_INCREMENT NOT NULL, questionario_id INT DEFAULT NULL, resposta_id INT DEFAULT NULL, descricao VARCHAR(255) NOT NULL, pontuacao INT NOT NULL, dica VARCHAR(255) NOT NULL, INDEX IDX_124A7194664E1225 (questionario_id), INDEX IDX_124A719479F97242 (resposta_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE pergunta_resposta (id INT AUTO_INCREMENT NOT NULL, pergunta_id INT NOT NULL, resposta_id INT NOT NULL, letra VARCHAR(10) NOT NULL, INDEX IDX_158F27FD3C763537 (pergunta_id), INDEX IDX_158F27FD79F97242 (resposta_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE questionario (id INT AUTO_INCREMENT NOT NULL, descricao VARCHAR(255) NOT NULL, pontuacao_total INT NOT NULL, tempo INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE resposta (id INT AUTO_INCREMENT NOT NULL, descricao VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE tentativa (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, questionario_id INT NOT NULL, dica_acionada TINYINT(1) NOT NULL, eliminar_acionado TINYINT(1) NOT NULL, pular_acionado TINYINT(1) NOT NULL, dobrar_acionado TINYINT(1) NOT NULL, desafio_acionado TINYINT(1) NOT NULL, pontuacao INT NOT NULL, INDEX IDX_DCAE46E0A76ED395 (user_id), INDEX IDX_DCAE46E0664E1225 (questionario_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE tentativa_resposta (id INT AUTO_INCREMENT NOT NULL, tentativa_id INT NOT NULL, pergunta_id INT NOT NULL, resposta_id INT DEFAULT NULL, respondida TINYINT(1) NOT NULL, acertou TINYINT(1) NOT NULL, pulou TINYINT(1) NOT NULL, usou_dica TINYINT(1) NOT NULL, INDEX IDX_EBC5128058EE7320 (tentativa_id), INDEX IDX_EBC512803C763537 (pergunta_id), INDEX IDX_EBC5128079F97242 (resposta_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('ALTER TABLE pergunta ADD CONSTRAINT FK_124A7194664E1225 FOREIGN KEY (questionario_id) REFERENCES questionario (id)');\n $this->addSql('ALTER TABLE pergunta ADD CONSTRAINT FK_124A719479F97242 FOREIGN KEY (resposta_id) REFERENCES resposta (id)');\n $this->addSql('ALTER TABLE pergunta_resposta ADD CONSTRAINT FK_158F27FD3C763537 FOREIGN KEY (pergunta_id) REFERENCES pergunta (id)');\n $this->addSql('ALTER TABLE pergunta_resposta ADD CONSTRAINT FK_158F27FD79F97242 FOREIGN KEY (resposta_id) REFERENCES resposta (id)');\n $this->addSql('ALTER TABLE tentativa ADD CONSTRAINT FK_DCAE46E0A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE tentativa ADD CONSTRAINT FK_DCAE46E0664E1225 FOREIGN KEY (questionario_id) REFERENCES questionario (id)');\n $this->addSql('ALTER TABLE tentativa_resposta ADD CONSTRAINT FK_EBC5128058EE7320 FOREIGN KEY (tentativa_id) REFERENCES tentativa (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE tentativa_resposta ADD CONSTRAINT FK_EBC512803C763537 FOREIGN KEY (pergunta_id) REFERENCES pergunta (id)');\n $this->addSql('ALTER TABLE tentativa_resposta ADD CONSTRAINT FK_EBC5128079F97242 FOREIGN KEY (resposta_id) REFERENCES resposta (id)');\n }", "public function up(Schema $schema)\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() != \"mysql\", \"Migration can only be executed safely on 'mysql'.\");\n \n $this->addSql(\"CREATE TABLE icecream_categories (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, title_ca VARCHAR(255) NOT NULL, title_es VARCHAR(255) NOT NULL, title_en VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_44BBAF35E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"CREATE TABLE icecream_flavours (id INT AUTO_INCREMENT NOT NULL, category_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, title_ca VARCHAR(255) NOT NULL, title_es VARCHAR(255) NOT NULL, title_en VARCHAR(255) NOT NULL, INDEX IDX_3213E0E812469DE2 (category_id), UNIQUE INDEX UNIQ_3213E0E85E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"CREATE TABLE special_icecreams (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, title_ca VARCHAR(255) NOT NULL, title_es VARCHAR(255) NOT NULL, title_en VARCHAR(255) NOT NULL, photo VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_AE0801D65E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"ALTER TABLE icecream_flavours ADD CONSTRAINT FK_3213E0E812469DE2 FOREIGN KEY (category_id) REFERENCES icecream_categories (id)\");\n $this->addSql(\"\n INSERT INTO icecream_categories (name, title_ca, title_en, title_es) VALUES\n ('crema', 'crema' ,'crema', 'crema'),\n ('sorbet', 'sorbet' ,'sorbete', 'sorbet'),\n ('toppings', 'toppings' ,'toppings', 'toppings')\n \");\n $this->addSql(\"\n INSERT INTO icecream_flavours (category_id, name, title_ca, title_en, title_es) VALUES\n (1, 'avellanes', 'avellanes', 'hazelnut', 'avellanas'),\n (1, 'cafè', 'cafè' ,'coffee', 'café'),\n (1, 'llet merengada', 'llet merengada' ,'meringued milk', 'leche merengada'),\n (1, 'xocolata', 'xocolata' ,'chocolate', 'chocolate'),\n (1, 'sèsam negre', 'sèsam negre' ,'black sesam', 'sésamo negro'),\n (1, 'crema catalana', 'crema catalana' ,'catalan cream', 'crema catalana'),\n (1, 'plàtan', 'plàtan' ,'banana', 'plátano'),\n (1, 'taro', 'taro (o ube)' ,'taro (or ube)', 'taro (o ube)'),\n (1, 'te matcha', 'te matcha' ,'matcha tea', 'té matcha'),\n (1, 'maduixa', 'maduixa' ,'strawberry', 'fresa'),\n (1, 'stracciatella', 'stracciatella' ,'stracciatella', 'stracciatella'),\n (1, 'festuc', 'festuc' ,'pistachio', 'pistacho'),\n (1, 'coco', 'coco' ,'coconut', 'coco'),\n (1, 'vainilla', 'vainilla' ,'vanilla', 'vainilla'),\n\n (2, 'mango', 'mango' ,'mango', 'mango'),\n (2, 'mandarina', 'mandarina' ,'mandarine', 'mandarina'),\n (2, 'llimona', 'llimona' ,'lemon', 'limón'),\n (2, 'gingebre', 'gingebre' ,'ginger', 'jengibre'),\n (2, 'te matcha 2', 'te matcha' ,'matcha tea', 'té matcha'),\n (2, 'maracujà', 'maracujà' ,'maracuja', 'maracuyà'),\n\n (3, 'bombolles xoco', 'bombolles xoco' ,'choc bubbles', 'burbujas choco'),\n (3, 'fruits secs', 'fruits secs' ,'nuts', 'frutos secos'),\n (3, 'nutella', 'nutella' ,'nutella', 'nutella'),\n (3, 'poppings', 'poppings' ,'poppings', 'poppings'),\n (3, 'gelatines', 'gelatines' ,'gelatines', 'gelatinas')\n \");\n\n $this->addSql(\"\n INSERT INTO texts (name, text_ca, text_en, text_es) VALUES\n ('gelats_especialitats', 'Les especialitats' ,'The specialties', 'Las especialidades'),\n ('per_diabetics', 'Per diabètics', 'For diabetics', 'Para diabéticos'),\n ('restauracio', 'Restauració', 'Restoration', 'Restauración'),\n ('per_diabetics_text', 'Per diabètics text', 'For diabetics text', 'Para diabéticos texto'),\n ('restauracio_text', 'Restauració', 'Restoration text', 'Restauración texto')\n \");\n }", "public function migrate()\n {\n $db = new \\SQLite3(\"ATM.db\");\n\n $query = \"CREATE TABLE IF NOT EXISTS \" . $this->table_name . \" \";\n $fields = array();\n\n foreach($this->fields as $name=>$type) {\n $fields[] = \"$name $type\";\n }\n\n $query .= \"(\" . implode(\", \", $fields) . \")\";\n\n $db->exec($query);\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE application (id INT AUTO_INCREMENT NOT NULL, comment LONGTEXT NOT NULL, create_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE city (id INT AUTO_INCREMENT NOT NULL, jobcity_id INT NOT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_2D5B0234229BA8AD (jobcity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE job (id INT AUTO_INCREMENT NOT NULL, job_statut_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, code VARCHAR(255) NOT NULL, create_at DATETIME NOT NULL, INDEX IDX_FBD8E0F83190D715 (job_statut_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE post (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL, time DATE NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE statut (id INT AUTO_INCREMENT NOT NULL, statut_app_id INT DEFAULT NULL, name_statut VARCHAR(255) NOT NULL, INDEX IDX_E564F0BFCE088079 (statut_app_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('ALTER TABLE city ADD CONSTRAINT FK_2D5B0234229BA8AD FOREIGN KEY (jobcity_id) REFERENCES job (id)');\n $this->addSql('ALTER TABLE job ADD CONSTRAINT FK_FBD8E0F83190D715 FOREIGN KEY (job_statut_id) REFERENCES application (id)');\n $this->addSql('ALTER TABLE statut ADD CONSTRAINT FK_E564F0BFCE088079 FOREIGN KEY (statut_app_id) REFERENCES application (id)');\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE brand (id INT AUTO_INCREMENT NOT NULL, brand VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE subscriber (id INT AUTO_INCREMENT NOT NULL, city_id INT DEFAULT NULL, brand_id INT DEFAULT NULL, model_id INT DEFAULT NULL, email VARCHAR(55) NOT NULL, date_from DATETIME DEFAULT NULL, date_until DATETIME DEFAULT NULL, price_from DOUBLE PRECISION DEFAULT NULL, price_until DOUBLE PRECISION DEFAULT NULL, INDEX IDX_AD005B698BAC62AF (city_id), INDEX IDX_AD005B6944F5D008 (brand_id), INDEX IDX_AD005B697975B7E7 (model_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE renting (id INT AUTO_INCREMENT NOT NULL, car_id INT DEFAULT NULL, rented_from DATETIME NOT NULL, rented_until DATETIME NOT NULL, INDEX IDX_13533C0FC3C6F69F (car_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(50) NOT NULL, name VARCHAR(255) DEFAULT NULL, phone VARCHAR(13) NOT NULL, password VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE car (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, brand_id INT NOT NULL, model_id INT NOT NULL, city_id INT NOT NULL, price DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, address VARCHAR(255) NOT NULL, latitude DOUBLE PRECISION DEFAULT NULL, longitude DOUBLE PRECISION DEFAULT NULL, token VARCHAR(30) DEFAULT NULL, publish TINYINT(1) NOT NULL, confirmed TINYINT(1) NOT NULL, description LONGTEXT NOT NULL, INDEX IDX_773DE69DA76ED395 (user_id), INDEX IDX_773DE69D44F5D008 (brand_id), INDEX IDX_773DE69D7975B7E7 (model_id), INDEX IDX_773DE69D8BAC62AF (city_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE city (id INT AUTO_INCREMENT NOT NULL, city VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE comment (id INT AUTO_INCREMENT NOT NULL, car_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, comment LONGTEXT NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_9474526CC3C6F69F (car_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE image (id INT AUTO_INCREMENT NOT NULL, car_id INT DEFAULT NULL, image VARCHAR(50) NOT NULL, INDEX IDX_C53D045FC3C6F69F (car_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE booking (id INT AUTO_INCREMENT NOT NULL, car_id INT DEFAULT NULL, users_id INT NOT NULL, booked_from DATETIME NOT NULL, booked_until DATETIME NOT NULL, message LONGTEXT DEFAULT NULL, approved TINYINT(1) NOT NULL, token VARCHAR(255) NOT NULL, INDEX IDX_E00CEDDEC3C6F69F (car_id), INDEX IDX_E00CEDDE67B3B43D (users_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE model (id INT AUTO_INCREMENT NOT NULL, brand_id INT NOT NULL, model VARCHAR(255) NOT NULL, INDEX IDX_D79572D944F5D008 (brand_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('ALTER TABLE subscriber ADD CONSTRAINT FK_AD005B698BAC62AF FOREIGN KEY (city_id) REFERENCES city (id)');\n $this->addSql('ALTER TABLE subscriber ADD CONSTRAINT FK_AD005B6944F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');\n $this->addSql('ALTER TABLE subscriber ADD CONSTRAINT FK_AD005B697975B7E7 FOREIGN KEY (model_id) REFERENCES model (id)');\n $this->addSql('ALTER TABLE renting ADD CONSTRAINT FK_13533C0FC3C6F69F FOREIGN KEY (car_id) REFERENCES car (id)');\n $this->addSql('ALTER TABLE car ADD CONSTRAINT FK_773DE69DA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE car ADD CONSTRAINT FK_773DE69D44F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');\n $this->addSql('ALTER TABLE car ADD CONSTRAINT FK_773DE69D7975B7E7 FOREIGN KEY (model_id) REFERENCES model (id)');\n $this->addSql('ALTER TABLE car ADD CONSTRAINT FK_773DE69D8BAC62AF FOREIGN KEY (city_id) REFERENCES city (id)');\n $this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526CC3C6F69F FOREIGN KEY (car_id) REFERENCES car (id)');\n $this->addSql('ALTER TABLE image ADD CONSTRAINT FK_C53D045FC3C6F69F FOREIGN KEY (car_id) REFERENCES car (id)');\n $this->addSql('ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDEC3C6F69F FOREIGN KEY (car_id) REFERENCES car (id)');\n $this->addSql('ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDE67B3B43D FOREIGN KEY (users_id) REFERENCES user (id)');\n $this->addSql('ALTER TABLE model ADD CONSTRAINT FK_D79572D944F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');\n }", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE article (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(100) NOT NULL, prix DOUBLE PRECISION NOT NULL, remise INT NOT NULL, image VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, supp TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE avis (id INT AUTO_INCREMENT NOT NULL, libelle VARCHAR(100) NOT NULL, date DATETIME NOT NULL, note INT NOT NULL, detail LONGTEXT NOT NULL, client VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE categorie (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE commande (id INT AUTO_INCREMENT NOT NULL, date DATETIME NOT NULL, total DOUBLE PRECISION NOT NULL, statut VARCHAR(100) NOT NULL, date_livraison DATETIME NOT NULL, mode_paiement VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE evenement (id INT AUTO_INCREMENT NOT NULL, date_deb DATETIME NOT NULL, date_fin DATETIME NOT NULL, titre VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, image VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE fournisseur (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(100) NOT NULL, mail VARCHAR(100) NOT NULL, tel VARCHAR(100) NOT NULL, adresse VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE pub (id INT AUTO_INCREMENT NOT NULL, titre VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, image VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE rassemblement (id INT AUTO_INCREMENT NOT NULL, date DATETIME NOT NULL, departement INT NOT NULL, titre VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE stock (id INT AUTO_INCREMENT NOT NULL, taille VARCHAR(100) NOT NULL, quantite INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE stock_variation (id INT AUTO_INCREMENT NOT NULL, taille VARCHAR(100) NOT NULL, quantite INT NOT NULL, date DATETIME NOT NULL, description LONGTEXT NOT NULL, entrant TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n }" ]
[ "0.7994496", "0.77984357", "0.77131706", "0.7632165", "0.75700283", "0.7548098", "0.7534535", "0.7510703", "0.747718", "0.7393093", "0.73656654", "0.73245156", "0.73185927", "0.72776496", "0.7274961", "0.72470915", "0.72424245", "0.72185016", "0.71977055", "0.71973526", "0.7171557", "0.71473837", "0.7121475", "0.7108692", "0.708051", "0.7023688", "0.6984477", "0.6954956", "0.69325817", "0.6899697", "0.6899697", "0.6824173", "0.67772603", "0.6769893", "0.67589045", "0.6756321", "0.67525476", "0.6710488", "0.6698643", "0.6682723", "0.66795987", "0.6666506", "0.6660996", "0.6636296", "0.6625549", "0.66104054", "0.6599687", "0.6596428", "0.65960836", "0.6591073", "0.6580874", "0.6574963", "0.65686184", "0.6559371", "0.655804", "0.6555736", "0.6550201", "0.6531814", "0.65200335", "0.649704", "0.649704", "0.6482914", "0.6478983", "0.6478911", "0.6472836", "0.6462633", "0.6461885", "0.6459278", "0.6459277", "0.6456385", "0.6448886", "0.6444906", "0.64326656", "0.6430579", "0.6430483", "0.6429569", "0.6428285", "0.64265615", "0.6424455", "0.6421603", "0.6417706", "0.64136237", "0.6412402", "0.64091504", "0.64074695", "0.6405618", "0.6401438", "0.63964456", "0.6394873", "0.6394673", "0.63937616", "0.6391327", "0.63903195", "0.6382921", "0.6374051", "0.6371328", "0.63712186", "0.6370847", "0.6369107", "0.6358078", "0.6356498" ]
0.0
-1
Ensure that the specified table is present in the destination DB as an empty copy of the source
private function ensureEmptyTargetTable($table, Connection $sourceConnection, Connection $destConnection) { // SchemaManager doesn't do enums! $destConnection->exec('DROP TABLE IF EXISTS ' . $sourceConnection->quoteIdentifier($table)); $driverName = $sourceConnection->getDriver()->getName(); if ($driverName === 'pdo_mysql') { $createSqlRow = $sourceConnection->query('SHOW CREATE TABLE ' . $sourceConnection->quoteIdentifier($table)) ->fetch(\PDO::FETCH_ASSOC); $createSql = $createSqlRow['Create Table']; } elseif ($driverName === 'pdo_sqlite') { $schemaSql = 'SELECT sql FROM sqlite_master WHERE type="table" AND tbl_name=' . $sourceConnection->quoteIdentifier($table); $createSql = $sourceConnection->query($schemaSql)->fetchColumn(); } else { throw new \RuntimeException(__METHOD__ . " not implemented for $driverName yet"); } $destConnection->exec($createSql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function empty_table($table = '')\n\t{\n\t\tif ($table === '')\n\t\t{\n\t\t\tif ( ! isset($this->qb_from[0]))\n\t\t\t{\n\t\t\t\treturn ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;\n\t\t\t}\n\n\t\t\t$table = $this->qb_from[0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t$sql = $this->_delete($table);\n\t\t$this->_reset_write();\n\t\treturn $this->query($sql);\n\t}", "protected function ensureTableExists() {\n try {\n $database_schema = $this->connection->schema();\n $schema_definition = $this->schemaDefinition();\n $database_schema->createTable(static::TABLE_NAME, $schema_definition);\n }\n // If another process has already created the batch table, attempting to\n // recreate it will throw an exception. In this case just catch the\n // exception and do nothing.\n catch (DatabaseException $e) {\n }\n catch (\\Exception $e) {\n return FALSE;\n }\n return TRUE;\n }", "protected function ensureTables() {\n if (!$this->ensured) {\n if (!$this->connection->schema()->tableExists($this->mapTable)) {\n // Generate appropriate schema info for the map and message tables,\n // and map from the source field names to the map/msg field names\n $count = 1;\n $source_key_schema = array();\n $pks = array();\n foreach ($this->sourceKey as $field_schema) {\n $mapkey = 'sourceid' . $count++;\n $source_key_schema[$mapkey] = $field_schema;\n $pks[] = $mapkey;\n }\n\n $fields = $source_key_schema;\n\n // Add destination keys to map table\n // TODO: How do we discover the destination schema?\n $count = 1;\n foreach ($this->destinationKey as $field_schema) {\n // Allow dest key fields to be NULL (for IGNORED/FAILED cases)\n $field_schema['not null'] = FALSE;\n $mapkey = 'destid' . $count++;\n $fields[$mapkey] = $field_schema;\n }\n $fields['needs_update'] = array(\n 'type' => 'int',\n 'size' => 'tiny',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => MigrateMap::STATUS_IMPORTED,\n 'description' => 'Indicates current status of the source row',\n );\n $fields['rollback_action'] = array(\n 'type' => 'int',\n 'size' => 'tiny',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => MigrateMap::ROLLBACK_DELETE,\n 'description' => 'Flag indicating what to do for this item on rollback',\n );\n $fields['last_imported'] = array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 0,\n 'description' => 'UNIX timestamp of the last time this row was imported',\n );\n $schema = array(\n 'description' => t('Mappings from source key to destination key'),\n 'fields' => $fields,\n 'primary key' => $pks,\n );\n $this->connection->schema()->createTable($this->mapTable, $schema);\n\n // Now for the message table\n $fields = array();\n $fields['msgid'] = array(\n 'type' => 'serial',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n );\n $fields += $source_key_schema;\n\n $fields['level'] = array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 1,\n );\n $fields['message'] = array(\n 'type' => 'text',\n 'size' => 'medium',\n 'not null' => TRUE,\n );\n $schema = array(\n 'description' => t('Messages generated during a migration process'),\n 'fields' => $fields,\n 'primary key' => array('msgid'),\n 'indexes' => array('sourcekey' => $pks),\n );\n $this->connection->schema()->createTable($this->messageTable, $schema);\n }\n $this->ensured = TRUE;\n }\n }", "private function prepareSchema()\n {\n $connection = Yii::app()->db;\n if ($connection->schema->getTable($this->table)) {\n try {\n $this->dropTableIfExist($connection, $this->tableMemory);\n $connection->createCommand('CREATE TABLE ' . $connection->quoteTableName($this->tableMemory) . ' LIKE ' . $connection->quoteTableName($this->table) . ';')->execute();\n $connection->createCommand('ALTER TABLE ' . $connection->quoteTableName($this->tableMemory) . ' ENGINE=MEMORY;')->execute();\n return true;\n } catch (Exception $e) {\n $this->dropTableIfExist($connection, $this->tableMemory);\n Yii::log('Schema preparation error: ' . print_r($e->getMessage(), true), 'error', 'extensions.CodMtfs.Mtfs');\n }\n } else {\n Yii::log('Nothing to copy.', 'error', 'extensions.CodMtfs.Mtfs');\n }\n return false;\n }", "private function verifyTableExists(string $table) {\n $stmt = $this->pdo->query(str_replace('%TABLENAME%', $table, self::QUERIES['verifyTableExists']));\n\n if($stmt->rowCount() === 0) {\n die('Connection established, but table \"' . $table . '\" either doesn\\'t exist or is empty');\n }\n\n $this->table = $table;\n }", "public function isMappedToExistingTable()\n {\n if (!empty($this->mapToTable)) {\n return true;\n } else {\n return false;\n }\n }", "public function testMissingTable() {\n\t\t$Article = new ArticleB(false, uniqid());\n\t\t$Article->schema();\n\t}", "public function testCheckTableExist() {\n\n\t}", "public function testValidatorForTableShouldBeExisted()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => '1',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n //Execute -----------------------------\n $updatePostData = [\n 'datasource_name' => '1',\n 'table_id' => 100,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\"選択されたテーブルIDは正しくありません。\"]);\n }", "public function create_missing_tables() {\n\n\t\t/* Create the network snippets table if it doesn't exist */\n\t\tif ( is_multisite() && ! self::table_exists( $this->ms_table ) ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t/* Create the table if it doesn't exist */\n\t\tif ( ! self::table_exists( $this->table ) ) {\n\t\t\t$this->create_table( $this->table );\n\t\t}\n\t}", "public function ensureTableExists()\n {\n $_tableName = DB_PREFIX . \"wr360product\";\n $sqlCreateTable = <<<SQL\nCREATE TABLE IF NOT EXISTS `$_tableName` (\n `product_id` INT NOT NULL ,\n `root_path` VARCHAR(255) NULL DEFAULT NULL ,\n `config_file_url` VARCHAR(255) NULL DEFAULT NULL ,\n `wr360_enabled` TINYINT(1) NOT NULL DEFAULT '1' ,\n PRIMARY KEY (`product_id`) )\nENGINE = MyISAM\nDEFAULT CHARACTER SET = utf8;\nSQL;\n\n $this->db->query($sqlCreateTable);\n }", "public function table_check() {\n\t // check if tables exist then create if not\n\t global $wpdb;\n\t \n\t $required_tables = array (\n\t \"$wpdb->prefix\" . \"tr_ratting_data\",\n\t \"$wpdb->prefix\" . \"tr_characters\",\n\t \"$wpdb->prefix\" . \"tr_structures_income\",\n\t \"$wpdb->prefix\" . \"tr_pvp_chars_kills\",\n\t \"$wpdb->prefix\" . \"tr_users_chars\",\n\t )\n\t \n\t ;\n\t foreach ( $required_tables as $table ) {\n\t $val = $wpdb->get_var ( \"SHOW TABLES LIKE '$table'\" );\n\t if ($val == $table) {\n\t // exists//\n\t } else {\n\t // create non existing\n\t $this->create_table ( $table );\n\t }\n\t }\n\t}", "function pg_copy_from($connection, string $table_name, array $rows, string $delimiter = null, string $null_as = null): void\n{\n error_clear_last();\n if ($null_as !== null) {\n $result = \\pg_copy_from($connection, $table_name, $rows, $delimiter, $null_as);\n } elseif ($delimiter !== null) {\n $result = \\pg_copy_from($connection, $table_name, $rows, $delimiter);\n } else {\n $result = \\pg_copy_from($connection, $table_name, $rows);\n }\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n}", "final protected\tfunction\thasTable($table)\n\t\t{\n\t\t\t$this->_table\t=\t$table;\n\t\t}", "final protected\tfunction\thasTable($table)\n\t\t{\n\t\t\t$this->_table\t=\t$table;\n\t\t}", "public function checkIfTablesExist()\n {\n foreach (self::DB_TABLE_INFO as $tableName => $createSql) {\n try {\n $result = $this->connection->query('SELECT 1 FROM turns LIMIT 1');\n } catch (Exception $e) {\n $result = false;\n }\n\n if ($result === false) {\n $this->connection->exec($createSql);\n }\n }\n }", "public function testTableIsCreated()\n {\n $this->assertFalse($this->connection->tableExists('insight_accounts'));\n $this->insight->getTableName('accounts');\n $this->assertTrue($this->connection->tableExists('insight_accounts'));\n }", "function setDestTableName($destTableName) {\n if ($destTableName !== ($oldDestTableName = $this->destTableName)) {\n if ($this->immutable) throw self::immutableException();\n $this->destTableName = $destTableName;\n $this->destNNIdsRelation = false;\n }\n }", "function empty_facts_and_rules_table($con)\n{\n\t$result1 = mysqli_query($con,\"TRUNCATE tbl_facts\");\n\t$result2 = mysqli_query($con,\"TRUNCATE tbl_rules\");\n\tif(!($result1 && $result2))\n\t\t die(\"Tables not found\");\n}", "protected static function check_table() {\n\t\tglobal $wpdb;\n\n\t\t$storage = new WPSEO_Link_Storage();\n\t\t$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $storage->get_table_name() );\n\t\tif ( $wpdb->get_var( $query ) !== $storage->get_table_name() ) {\n\t\t\tself::set_inaccessible();\n\t\t\treturn false;\n\t\t}\n\n\t\tself::set_accessible();\n\t\treturn true;\n\t}", "public static function checkIfHasTable($table)\n\t {\n\t \t if(is_null($table))\n {\n exit('Table name is required!');\n }\n\t }", "function empty_table($name) {\n\t\t\t$result = $this->checkup(\"\", $name);\n\t\t\tif ($result == false) {\n\t\t\t\treturn $this->error(\"could not truncate.\");\n\t\t\t}\n\n\t\t\t#if ( mysql_query ( \"TRUNCATE TABLE \" . $name, $this->CONN ) ) {\n\t\t\tif ($this->one_query(\"TRUNCATE TABLE \".$name)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->error(\"error truncating table '$name' !\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private function copyData()\n {\n $connection = Yii::app()->db;\n $transaction = $connection->beginTransaction();\n try {\n $connection->createCommand('INSERT INTO ' . $connection->quoteTableName($this->tableMemory) . ' SELECT * FROM ' . $connection->quoteTableName($this->table))->execute();\n $transaction->commit();\n return true;\n } catch (Exception $e) {\n Yii::log('Transaction error: ' . print_r($e->getMessage(), true), 'error', 'extensions.CodMtfs.Mtfs');\n $transaction->rollback();\n }\n }", "public function tableExists($table) {\n if (array_key_exists($table, $this->schema) && is_writable($this->directories['data']['core']['dir'].$table)) {\n return true;\n }\n else return false;\n }", "protected function migrateTables()\n {\n foreach ($this->tables as $table) {\n \\DB::getPdo()->exec(\"INSERT IGNORE INTO {$this->newDbName}.{$table} SELECT * FROM {$this->oldDbName}.{$table}\");\n }\n }", "public static function create_missing_table( $table_name ) {\n\n\t\tif ( self::table_exists( $table_name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::create_table( $table_name );\n\t}", "function tableExists($table);", "protected function resetExistingTables()\n {\n $this->existingTables = null;\n }", "function migrateTable( $table ) {\n\n $query = \"SELECT * FROM \" . $table;\n\n $this->_externalDB->setQuery( $query );\n $object = $this->_externalDB->loadObjectList();\n\n\t\t$db =& JFactory::getDBO();\n $count = count($object);\n\n for ($i=0; $i<$count; $i++) {\n $db->insertObject($table, $object[$i]);\n\t\t\t//echo $db->errorMsg();\n }\n\n\t\t$ret = $db->getErrorNum();\n\n return $ret;\n }", "public function emptyTable($table) {\n try {\n return $this->exec(\"TRUNCATE TABLE $table\");\n } catch (Exception $exc) {\n if (DEBUG == TRUE) {\n Debug::throwException(\"Database error!\", $exc);\n }\n return 0;\n }\n }", "function empty_table( $name )\n\t{\n\t\t$result = $this->checkup( \"\", $name );\n\t\tif ($result==false) {\n\t\t\treturn $this->error( \"could not truncate.\" );\n\t\t}\n\t\t\n\t\tif ( mysql_query ( \"TRUNCATE TABLE \" . $name, $this->CONN ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error ( \"error truncating table '$name' !\" );\n\t\t\treturn false;\n\t\t}\n\t}", "function copyTable($table, $new_table, $data = TRUE, $link = 0) {\n $this->link = $link ? $link : $this->link;\n $r = $this->query(\"CREATE TABLE `{$new_table}` LIKE `{$table}`;\", $link);\n return ($r && $data) ? $this->query(\"INSERT INTO `{$new_table}` SELECT * FROM `{$table}`;\", $link) : $r;\n }", "function checkTableExists($table_name) {\n $sql = sprintf(\"SELECT count(*) FROM sqlite_master WHERE type='table' AND name='%s'\", $table_name);\n\n $ret = $this->query($sql);\n // echo \"<br>\";\n // echo print_r($ret, $return=true);\n // echo \"<br>\";\n if ($ret) {\n $ary = $ret->fetchArray(SQLITE3_NUM);\n if ($ary[0] > 0) {\n return True;\n } else {\n return False;\n }\n }\n }", "function verifyTable($connection) {\n\tif(!tableExists($connection)) \n\t{\n\t\t$query = \"CREATE TABLE `\".TABLE_NAME.\"` (\n\t\t\t`id` int(11) not null auto_increment,\n\t\t\t`title` varchar(255) not null,\n\t\t\t`url` varchar(511) not null,\n\t\t\tprimary key (`id`));\";\n\n\t\tif(!mysqli_query($connection, $query)) echo(\"<p>Error creating table.</p>\");\n\t}\n}", "public function afterImport($table)\n {\n return Yii::$app->db->createCommand(\"DROP TABLE IF EXISTS $table\")->execute();\n }", "private function tableIsEmpty(){\r\n\t\tglobal $TABLEAFILIADOS;\r\n\t\t$sqlquery=\"SELECT * from `$TABLEAFILIADOS`;\";\r\n\t\t$result=mysql_query($sqlquery);\r\n\t\t$int_numRows = mysql_num_rows($result);\r\n\t\tif ($int_numRows==0){\t\t\t\r\n\t\t\treturn true;\t\t\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function testFieldsDontRerequestChanges() {\r\n\t\t$db = DB::getConn();\r\n\t\tDB::quiet();\r\n\t\t\r\n\r\n\t\t// Table will have been initially created by the $extraDataObjects setting\r\n\t\t\r\n\t\t\r\n\t\t// Verify that it doesn't need to be recreated\r\n\t\t$db->beginSchemaUpdate();\r\n\t\t$obj = new DataObjectSchemaGenerationTest_DO();\r\n\t\t$obj->requireTable();\r\n\t\t$needsUpdating = $db->doesSchemaNeedUpdating();\r\n\t\t$db->cancelSchemaUpdate();\r\n\t\t\r\n\t\t$this->assertFalse($needsUpdating);\r\n\t}", "function DB_empty_curMonth_tables()\n{\n global $connection;\n $results = $connection->query(\"TRUNCATE TABLE outcome\");\n if (!$results) {\n print (\"error=\".$connection->get_error().\"<br>\");\n return false;\n }\n $results = $connection->query(\"TRUNCATE TABLE income_and_status\");\n if (!$results) {\n print (\"error=\".$connection->get_error().\"<br>\");\n return false;\n }\n return true;\n}", "public function tableExists( $tablename );", "function tableExists($db, $table = 'settings') {\n try {\n $result = $db->query(\"SELECT 1 FROM $table LIMIT 1\"); \n } catch (Exception $e) {\n return false;\n }\n return $result == true;\n }", "private function checkOrCreateTable(){\n $this->pdo->query(\"CREATE TABLE IF NOT EXISTS k_UserDean(wp_id BIGINT UNSIGNED PRIMARY KEY, dean_id BIGINT UNSIGNED);\");\n }", "function sql_table_exists($table) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\ttry {\n\t\t$result = $sql->query(sql_select($table, '1'));\n\t} catch (Exception $e) {\n\t\treturn FALSE;\n\t}\n\treturn $result !== FALSE;\n}", "function checkTableExists($tableName)\n{\n $mdb2 =& GetMDB2();\n $SQL = \"SELECT count(*) FROM `$tableName` WHERE 1 = 0\";\n $res = $mdb2->queryOne($SQL);\n $err = mdb2ErrorCheck($res, false, false, -18);\n switch($err['code']){\n case 0:\n return true;\n break;\n case -18:\n return false;\n break;\n default:\n mdb2ErrorCheck($res);\n die(\"Error when checking table $tableName.\\n\");\n }\n}", "function empty_kb_tables($con)\n{\n\t$result1 = mysqli_query($con,\"TRUNCATE kb_table_1\");\n\t$result2 = mysqli_query($con,\"TRUNCATE kb_table_2\");\n\tif(!($result1 && $result2))\n\t\t die(\"Tables not found\");\n}", "function checkTablesIntegrity() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = $this->getTables();\n \n // Check the users table..\n if (!isset($tables[$this->prefix.\"users\"])) {\n return false; \n }\n \n \n \n // Check the taxonomy table..\n if (!isset($tables[$this->prefix.\"taxonomy\"])) {\n return false; \n }\n \n // Now, iterate over the contenttypes, and create the tables if they don't exist.\n foreach ($this->config['contenttypes'] as $key => $contenttype) {\n\n $tablename = $this->prefix . makeSlug($key);\n \n if (!isset($tables[$tablename])) {\n return false; \n }\n \n // Check if all the fields are present in the DB..\n foreach($contenttype['fields'] as $field => $values) {\n if (!isset($tables[$tablename][$field])) {\n return false;\n }\n }\n \n }\n\n \n return true; \n \n }", "public function duplicateTableStructure( $table, $newTableName )\n\t{\n\t\treturn $this->query( \"CREATE TABLE `{$this->prefix}{$newTableName}` LIKE `{$this->prefix}{$table}`\" );\n\t}", "public function semiEmpty()\n\t{\n//\t\t$dfp\t= $this->_prename. \"/\".$this->_name.\".db\";\n//\t\t$ret\t= copy($dfp, $this->_prename. \"/bc/\".$this->_name.\".db\".'.bc');\n//\t\tif(!ret) return false;\n//\t\t$this->_dbh($this->_name);\n//\t\t$this->delete('');\n//\t\treturn true;\n\t}", "public function tableExists($table)\n {\n return $this->query($table);\n }", "static function check_exist($table){\n\t\t$db = JFactory::getDbo();\n\t\t$table_name = str_replace('#__', $db->getPrefix(),$table);\n\t\treturn in_array($table_name,$db->getTableList());\t\t\n\t}", "private function populateDummyTable() {}", "function pg_copy_to($connection, string $table_name, string $delimiter = null, string $null_as = null): array\n{\n error_clear_last();\n if ($null_as !== null) {\n $result = \\pg_copy_to($connection, $table_name, $delimiter, $null_as);\n } elseif ($delimiter !== null) {\n $result = \\pg_copy_to($connection, $table_name, $delimiter);\n } else {\n $result = \\pg_copy_to($connection, $table_name);\n }\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n return $result;\n}", "abstract public function tableExists($tableName);", "private function checkTable()\n\t{\n\t\t$erreur = array();\n\t\tinclude (dirname(__FILE__).'/sql/sql-install.php');\n\t\t// the array is called $sql;\n\n\t\tforeach ($sql as $key => $s)\n\t\t{\n\t\t\t// We check if the table allready exist\n\t\t\t$table_exist_sql = 'SHOW TABLES LIKE \\''._DB_PREFIX_.$key.'\\';';\n\t\t\tif (!Db::getInstance()->executeS($table_exist_sql))\n\t\t\t{\n\t\t\t\t//If the table not exist we install it\n\t\t\t\tDb::getInstance()->execute($s);\n\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t$erreur[] = $erreur_sql;\n\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t// If the table exist we verify the structure\n\t\t\t\tpreg_match_all('/`(\\w+)`/mi', $s, $matches); // We catch all the columns name of the table\n\t\t\t\t$final_columns = array_unique($matches[1]); // We erase the duplicate entry\n\t\t\t\t// We search in the array an entry who could be the name of the table\n\t\t\t\t$key_to_unset = array_search(_DB_PREFIX_.$key,$final_columns);\n\t\t\t\tif ($key_to_unset !== FALSE)\n\t\t\t\t\tunset($final_columns[(int)$key_to_unset]); // We unset it\n\t\t\t\t$final_columns = array_values($final_columns);\n\n\t\t\t\t$describe_sql = 'DESCRIBE '._DB_PREFIX_.$key;\n\t\t\t\t$existing_columns = Db::getInstance()->executeS($describe_sql);\n\t\t\t\t$existing_columns = array_column($existing_columns, 'Field');\n\t\t\t\t$nfinal_columns = count($final_columns);\n\t\t\t\tfor ($i = 0; $i < $nfinal_columns; $i++)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($final_columns[$i],$existing_columns)) // If we don't find the item in existing table, we create it\n\t\t\t\t\t{\n\t\t\t\t\t\t$pattern = '/`'.(string)$final_columns[$i].'`(.+),\\n/i';\n\t\t\t\t\t\tpreg_match($pattern, $s, $columns_spec);\n\t\t\t\t\t\t$sql_append_fields = 'ALTER TABLE `'._DB_PREFIX_.$key.'` ADD `'.(string)$final_columns[$i].'` '.$columns_spec[1];\n\t\t\t\t\t\tDb::getInstance()->execute($sql_append_fields);\n\t\t\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t\t\t$erreur[] = $erreur_sql;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// We check if in the existing table is there columns that need to be removed\n\t\t\t\t$nexisting_columns = count($existing_columns);\n\t\t\t\tfor ($j = 0; $j < $nexisting_columns; $j++)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($existing_columns[$j],$final_columns)) // If an existing column is not in the futur table, we delete this field form the db\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_erase_fields = 'ALTER TABLE `'._DB_PREFIX_.$key.'` DROP `'.(string)$existing_columns[$j].'`';\n\t\t\t\t\t\tDb::getInstance()->execute($sql_erase_fields);\n\t\t\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t\t\t$erreur[] = $erreur_sql;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public function copy($tableId, $optParams = array())\n {\n $params = array('tableId' => $tableId);\n $params = array_merge($params, $optParams);\n return $this->call('copy', array($params), \"Google_Service_Fusiontables_Table\");\n }", "function tableExists($tablename);", "public function _table_exists($dbname,$tablename){\n \t$table_files=$this->_table_files($dbname,$tablename);\n foreach ($table_files as $file){\n if (!file_exists($file))\n return FALSE;\n }\n return TRUE;\n }", "public function tableIsPersisted($table)\n {\n return !empty($this->getColumns($table));\n }", "public function tableExists( $table )\n\t{\n\t\treturn $this->writer->tableExists( $table );\n\t}", "public function wipe($connection, $table);", "protected function _validate_insert($table = '')\n\t{\n\t\tif (count($this->qb_set) === 0)\n\t\t{\n\t\t\treturn ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;\n\t\t}\n\n\t\tif ($table !== '')\n\t\t{\n\t\t\t$this->qb_from[0] = $table;\n\t\t}\n\t\telseif ( ! isset($this->qb_from[0]))\n\t\t{\n\t\t\treturn ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {\n $result = true;\n $destination = _drush_policy_parse_alias($destination);\n\n if ($destination == '@prod') {\n $result = _drush_policy_override_validate($destination, 'database');\n }\n\n return $result;\n}", "public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}", "function VerifyPlayersTable($connection, $dbName) {\r\n if(!TableExists(\"players\", $connection, $dbName)) \r\n { \r\n\techo(\"Can't find players table\");\r\n}\r\n}", "function checkUserTableIntegrity() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = $this->getTables();\n \n // Check the users table..\n if (!isset($tables[$this->prefix.\"users\"])) {\n return false; \n }\n \n return true; \n \n }", "function replicate($targetTable, $id = null)\n {\n if (is_null($id)) {\n $id = HTTP_Session::id();\n }\n\n // Check if table row already exists\n $query = sprintf(\"SELECT COUNT(id) FROM %s WHERE id = %s\",\n $targetTable,\n $this->db->quote(md5($id), 'text'));\n $result = $this->db->queryOne($query);\n if (MDB2::isError($result)) {\n $this->db->raiseError($result->code, PEAR_ERROR_DIE);\n return false;\n }\n\n // Insert new row into dest table\n if (0 == intval($result)) {\n $query = sprintf(\"INSERT INTO %s SELECT * FROM %s WHERE id = %s\",\n $targetTable,\n $this->options['table'],\n $this->db->quote(md5($id), 'text'));\n\n } else {\n // Update existing row\n $query = sprintf(\"UPDATE %s dst, %s src SET dst.expiry = src.expiry, dst.data = src.data WHERE dst.id = src.id AND src.id = %s\",\n $targetTable,\n $this->options['table'],\n $this->db->quote(md5($id), 'text'));\n }\n\n $result = $this->db->query($query);\n if (MDB2::isError($result)) {\n $this->db->raiseError($result->code, PEAR_ERROR_DIE);\n return false;\n }\n\n return true;\n }", "function verifyTable($database, $table)\n{\n\t$tableName = (string)$table->attributes()->name;\n\t$previousColumnName = null;\n\t\n\t//get the DB connection\n\t$testDB = gettestConnection();\n\t\n\t//get a description of the table\n\t$sql = \"DESC `$tableName`\";\n\t$desc = $testDB->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n\t\n\t//find the table in the XML master copy\n\tforeach ($database->{'table_structure'} as $t) {\n\t\tif ($tableName == $t->attributes()->name) {\n\t\t\t$masterTable = $t;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t//set master values\n\t$masterColumns = $masterTable->field;\n\t$masterKeys\t = $masterTable->key;\n\t$masterOptions = $masterTable->options;\n\t\n\t//verify columns are in sync using local vs master. Drop extra local columns. \n\tforeach ($desc as $column) {\n\t\t\n\t\t$cName = $column['Field'];\n\t\t$found = false;\n\t\t\n\t\t//find the master column desc\n\t\tforeach ($masterColumns as $c) {\n\t\t\tif ($cName == (string)$c->attributes()->Field) {\n\t\t\t\t\n\t\t\t\t$doesMatch = true;\n\t\t\t\t$found = true;\n\n\t\t\t\tif (trim($column['Field']) != trim((string)$c->attributes()->Field)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Type']) != trim((string)$c->attributes()->Type)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Null']) != trim((string)$c->attributes()->Null)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Key']) != trim((string)$c->attributes()->Key)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Default']) != trim((string)$c->attributes()->Default)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\tif (trim($column['Extra']) != trim((string)$c->attributes()->Extra)) {\n\t\t\t\t\t$doesMatch = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there are differences, call function to alter table\n\t\t\t\tif (!$doesMatch) {\n\t\t\t\t\talterColumn($tableName, $column, $c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if we didn't find the column, drop it\n\t\tif (!$found) {\n\t\t\t$sql = \"ALTER TABLE `$tableName` DROP `$cName`\";\n\t\t\t$testDB->exec($sql);\n\t\t}\n\t}\n\t\n\t//verify columns are in sync using master vs local in case columns don't exist locally. Add missing columns.\n\t$previousColumnName = null;\n\tforeach ($masterColumns as $c) {\n\t\n\t\t$found = false;\n\t\n\t\t//find the master column desc\n\t\tforeach ($desc as $column) {\n\t\t\t$cName = $column['Field'];\n\t\t\tif ($cName == (string)$c->attributes()->Field) {\n\t\n\t\t\t\t$found = true;\n\t\t\t\t\n\t\t\t\t//we already synced up existing columns, so no need to check again. This\n\t\t\t\t//is only to find missing local columns.\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if we didn't find the column, add it\n\t\tif (!$found) {\n\t\t\taddColumn($tableName, (string)$c->attributes()->Field, $c, $previousColumnName);\n\t\t}\n\t\t\n\t\t//track the previous column for alters\n\t\t$previousColumnName = (string)$c->attributes()->Field;\n\t\n\t}\t\n\t\n\t//verify the keys are in sync\n\t$sql = \"SHOW INDEXES FROM `$tableName`;\";\n\t$indexes = $testDB->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n\t\n\t//compare master to local, and add any missing keys\n\tforeach ($masterKeys as $key) {\n\t\t\n\t\t$kName = (string)$key->attributes()->Key_name;\n\t\t$cName = (string)$key->attributes()->Column_name;\n\t\t$found = false;\n\t\t\n\t\tforeach ($indexes as $index) {\n\t\t\t\n\t\t\tif ($index['Key_name'] == $kName) {\n\t\t\t\t$found = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$found) {\n\t\t\t//add the index\n\t\t\tif ($kName == 'PRIMARY') {\n\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD PRIMARY KEY ( `\".$key['Column_name'].\"` )\";\n\t\t\t} elseif (preg_match('/-FK/i', $kName) ||\n\t\t\t\tpreg_match('/FK_/i', $kName)) {\n\t\t\t\t//add the key\n\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD KEY `$kName` ( `$cName` ) \";\n\t\t\t\t$testDB->exec($sql);\n\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD CONSTRAINT `$kName` FOREIGN KEY ( `$cName` ) REFERENCES `\".strtolower($cName).\"` (`$cName`) ON DELETE NO ACTION ON UPDATE CASCADE\";\n\t\t\t}else {\n\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD UNIQUE `$kName` ( `\".$key['Column_name'].\"` ) \";\n\t\t\t}\n\t\t\t\n\t\t\t$testDB->exec($sql);\n\t\t}\n\t\n\t}\n}", "private function createIfNotExists()\n {\n $table = new Table('schema_migration');\n if ($this->info->isTableExists($table)) {\n return;\n }\n $primaryKey = new PrimaryKey(array('version'));\n $primaryKey->disableAutoIncrement();\n\n $table->addConstraint($primaryKey);\n $table\n ->addColumn(new BigIntegerColumn('version'))\n ->addColumn(new DateTimeColumn('created_at', array('nullable' => false, 'default' => 'now()')));\n $this->manipulation->create($table);\n }", "public function cleanCopy();", "function Ensuretable()\n {\n $result = mysqli_query(\"SHOW COLUMNS FROM $this->tablename\"); \n if(!$result || mysqli_num_rows($result) <= 0)\n {\n return $this->CreateTable();\n }\n return true;\n }", "public function dropIfExists(string $table)\n {\n $this->build(tap($this->createBlueprint($table), function (Blueprint $blueprint) {\n $blueprint->dropIfExists();\n }));\n }", "public function checkIfTableExists($tableName, OutputInterface $o)\n {\n $db = new db;\n\n \n try\n\t {\n $db->limit(1)->get($tableName);\n }\n\tcatch(\\Shadowapp\\Sys\\Exceptions\\Db\\WrongQueryException $e)\n\t{\n $o->writeln(\" \\033[41m Table \".$tableName.\" does not exists \\033[0m \"); \n\t}\n }", "function tep_db_table_exists($table, $link = 'db_link') {\n $result = tep_db_query(\"show table status from `\" . DB_DATABASE . \"`\");\n while ($list_tables = tep_db_fetch_array($result)) {\n if ($list_tables['Name'] == $table) {\n return true;\n }\n }\n return false;\n }", "function checkTableExist( $conn, $table_name )\n {\n return mysqli_query( $conn, 'select 1 from ' . $table_name );\n }", "public function isCopyQueueEmpty() {}", "private function createDummyTable() {}", "private function verify ()\n {\n // test if Database exists\n try {\n $db = $this->getDefaultAdapter();\n } catch (Exception $e) {\n throw new Zend_Exception($e->getMessage());\n }\n \n // test if table exists\n try {\n $result = $db->describeTable($this->_name);\n \n if (empty($result)) {\n $this->createTable();\n $this->insertRows();\n }\n } catch (Exception $e) {\n $this->createTable();\n $this->insertRows();\n }\n }", "public static function copyIfNone($from, $to)\n\t{\n\t\tif (self::exists($to)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tself::copy($from, $to);\n\t}", "private function check_head($table, $head)\n {\n $checked_head = $table->columns->filter(function($column) use($head) {\n return !array_key_exists($column->name, $head ? $head : []);\n });\n\n if (!$checked_head->isEmpty())\n throw new RowsImportException(['head' => $checked_head]);\n\n }", "function revert_table() {\r\n $this->_table = $this->_table_org;\r\n $this->_table_org = NULL;\r\n }", "public static function tableExists() {\n self::init();\n return self::$wpdb->get_var(self::$wpdb->prepare(\"SHOW TABLES LIKE '%s'\", self::$table)) === self::$table;\n }", "public function ensureTable($table, $relationship = NULL) {\n return $table;\n }", "public function dropTableIfExists(string $table)\n {\n echo \" > dropping $table if it exists ...\";\n $time = microtime(true);\n $this->db->createCommand()\n ->dropTableIfExists($table)\n ->execute();\n echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . \"s)\\n\";\n }", "function testTableExist()\n{\n\tglobal $db,$conf,$langs;\n\t\n\t$checktable = $db->query(\"SHOW TABLES LIKE '\".MAIN_DB_PREFIX.\"materiels'\");\n\tif (($checktable)&&($db->num_rows($checktable)<=0))\n\t{\n\t\t$db->query(\"CREATE TABLE \".MAIN_DB_PREFIX.\"materiels (rowid INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,ref VARCHAR(50) NOT NULL,socid INT(6),marque VARCHAR(50),model VARCHAR(50),noserie VARCHAR(50),options TEXT,note_public TEXT,date_achat DATE,garantie INT(1))\");\n\t}\n}", "public function testValidatorForRequiredForEmpty()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n 'datasource_name' => '',\n 'table_id' => null,\n 'starting_row_number' => null,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\n \"datasource_name\" => [\"データソース名は必ず指定してください。\"],\n \"starting_row_number\" => [\"開始行は必ず指定してください。\"],\n \"table_id\" => [\"テーブルIDは必ず指定してください。\"],\n ]);\n }", "function getDestTableName() {\n return $this->destTableName;\n }", "private function redirectsTable()\n\t{\n\t\t$table_installed = get_option('replace_media_redirects_table_installed');\n\t\tif ( $table_installed ) return;\n\n\t\tglobal $wpdb;\n\t\t$tablename = $wpdb->prefix . 'replace_media_redirects';\n\t\tif ( $wpdb->get_var('SHOW TABLES LIKE \"' . $tablename . '\"') != $tablename ) :\n\t\t\t$sql = 'CREATE TABLE ' . $tablename . '(\n\t\t\t\tid INTEGER(10) UNSIGNED AUTO_INCREMENT,\n\t\t\t\ttime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\tattachment_id INTEGER(10),\n\t\t\t\tsource MEDIUMTEXT,\n\t\t\t\tdestination MEDIUMTEXT,\n\t\t\t\tuser_id INTEGER(10),\n\t\t\t\tPRIMARY KEY (id) ) \n\t\t\t\tCHARACTER SET utf8;';\n\t\t\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\t\tdbDelta($sql);\n\t\t\tupdate_option('replace_media_redirects_table_installed', true);\n\t\tendif;\n\t}", "public function testSaveDataTableNoDataTable() {\r\n $this->setExpectedException('Exception', 'No data table given.');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', null);\r\n\t}", "public function testInitializeNoTables() {\n $sink = new Sink;\n $result = $sink->initialize();\n $this->assertEquals(0, count($result));\n }", "public function isMigratingUp();", "public function checkForTable( $table );", "protected function excludeTable() {\n\t\t$this\n\t\t\t\t// check if table parameter is set and in session\n\t\t\t->checkTableAccess()\n\t\t\t\t// mark table as excluded\n\t\t\t->removeTableFromExtConf('tablesExclude')\n\t\t\t->addTableToExtConf('tablesExclude');\n\t\techo 'ok-excluded';\n\t\texit;\n\t}", "public function checkDatabaseStructure( );", "protected function createOldTable()\n {\n $this->setUpNewTable();\n $this->getSchemaManager()->createTable($this->getOldTable());\n }", "public function wp_clean_sql()\n\t{\n\t\t$bdd = Bdd::getInstance();\n\n\t\t$sql = $bdd->dbh->prepare(\"SHOW TABLES LIKE '\".$this->_table_prefix.\"%'\");\n\t\t$sql->execute();\n\t\t$tables = $sql->fetchAll();\n\n\t\tforeach ($tables as $table)\t{\n\t\t\t$table_name = $table[0];\n\n\t\t\t// To rename the table\n\t\t\t$sql1 = $bdd->dbh->prepare(\"DROP TABLE `{$table_name}`\");\n\t\t\t$sql1->execute();\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function table_exists($table){\n\t\t$table = strtolower($table);\n\t\t$num = $this->fetch_one(\"select count(*) from information_schema.tables where table_schema = 'public' and table_name='$table'\");\n\t\treturn $num[0];\n\t}", "public function initialized()\n {\n return $this->connection->getSchemaManager()->tablesExist([self::SNAPSHOTS_TABLE]);\n }", "private function compareTables($table, $tableMemory)\n {\n $connection = Yii::app()->db;\n if ($connection->schema->getTable($table) && $connection->schema->getTable($tableMemory)) {\n $tableColumns = $connection->schema->getTable($table)->columns;\n $tableMemoryColumns = $connection->schema->getTable($tableMemory)->columns;\n if (count($tableColumns) !== count($tableMemoryColumns)) {\n return false;\n }\n foreach (array_keys($tableColumns) as $key) {\n if (get_object_vars($tableColumns[$key]) !== get_object_vars($tableMemoryColumns[$key])) {\n return false;\n }\n }\n $sourceCount = $connection->createCommand('SELECT COUNT(*) FROM ' . $connection->quoteTableName($table))->queryScalar();\n $destinationCount = $connection->createCommand('SELECT COUNT(*) FROM ' . $connection->quoteTableName($tableMemory))->queryScalar();\n if ($sourceCount !== $destinationCount) {\n return false;\n }\n } elseif ($connection->schema->getTable($table) === null || $connection->schema->getTable($tableMemory) === null) {\n return false;\n }\n return true;\n }", "public function fullDrop($table)\n\t{\n//\t\tif(is_object($this->_dbh))\t$this->_dbh->closeConnection();\n//\t\treturn unlink($this->_prename. \"/\".$this->_name.\".db\");\n\t}", "function emptyIndexTable(){\n\t\t$this->ecmDBhandle->truncateTable($this->dfs_db-> table_name);\n\t}", "function Sql_Table_Drop($table=\"\")\n {\n if ($this->Sql_Table_Exists($table)>0)\n {\n $this->QueryDB\n (\n $this->Sql_Table_Drop_Query($table)\n );\n $this->AddMsg(\"Table \".$table.\" has been dropped\");\n }\n }" ]
[ "0.5905646", "0.5847931", "0.58424616", "0.57968694", "0.56508213", "0.56473243", "0.5598984", "0.55865467", "0.5556654", "0.5514695", "0.5490318", "0.5481813", "0.540932", "0.54080635", "0.54080635", "0.5397256", "0.5388375", "0.5372643", "0.53482544", "0.5347975", "0.534673", "0.53421044", "0.5326011", "0.53251433", "0.5313063", "0.53122413", "0.5310533", "0.5293625", "0.5289729", "0.52603114", "0.5235959", "0.52079535", "0.5192995", "0.519199", "0.5184135", "0.5180167", "0.5177473", "0.51647854", "0.5156924", "0.5147861", "0.51458144", "0.5137006", "0.51319474", "0.51113075", "0.5107997", "0.5101327", "0.5100151", "0.50990593", "0.5087829", "0.5084639", "0.50703406", "0.50570387", "0.5051739", "0.50479394", "0.50447387", "0.5034044", "0.5031712", "0.50272495", "0.50015354", "0.49967548", "0.49960488", "0.49934563", "0.49871805", "0.49832046", "0.4982392", "0.4980966", "0.49732402", "0.49618685", "0.49539053", "0.49529058", "0.49514255", "0.494976", "0.49456587", "0.49424303", "0.49406743", "0.49378157", "0.49353108", "0.4934052", "0.49337173", "0.49294505", "0.49246112", "0.49245712", "0.49228114", "0.49184114", "0.49116036", "0.49048445", "0.49041134", "0.48984015", "0.48927048", "0.48925635", "0.489052", "0.48893216", "0.4879112", "0.487888", "0.48775822", "0.48758736", "0.4875834", "0.4872734", "0.48682562", "0.48671523" ]
0.7553517
0
Ensure that all table triggers from source are recreated in the destination
private function migrateTableTriggers(string $setName, TablesList $tableCollection): void { foreach ($tableCollection->getTables() as $table => $sampler) { try { $triggerSql = $this->generateTableTriggerSql($table, $this->sourceConnection); foreach ($triggerSql as $sql) { $this->destConnection->exec($sql); } if (count($triggerSql)) { $this->logger->info("$setName: Migrated " . count($triggerSql) . " trigger(s) on $table"); } } catch (\Exception $e) { $this->logger->error( "$setName: failed to migrate '$table' triggers with '" . $sampler->getName() . "': " . $e->getMessage() ); throw $e; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function ensureTables() {\n if (!$this->ensured) {\n if (!$this->connection->schema()->tableExists($this->mapTable)) {\n // Generate appropriate schema info for the map and message tables,\n // and map from the source field names to the map/msg field names\n $count = 1;\n $source_key_schema = array();\n $pks = array();\n foreach ($this->sourceKey as $field_schema) {\n $mapkey = 'sourceid' . $count++;\n $source_key_schema[$mapkey] = $field_schema;\n $pks[] = $mapkey;\n }\n\n $fields = $source_key_schema;\n\n // Add destination keys to map table\n // TODO: How do we discover the destination schema?\n $count = 1;\n foreach ($this->destinationKey as $field_schema) {\n // Allow dest key fields to be NULL (for IGNORED/FAILED cases)\n $field_schema['not null'] = FALSE;\n $mapkey = 'destid' . $count++;\n $fields[$mapkey] = $field_schema;\n }\n $fields['needs_update'] = array(\n 'type' => 'int',\n 'size' => 'tiny',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => MigrateMap::STATUS_IMPORTED,\n 'description' => 'Indicates current status of the source row',\n );\n $fields['rollback_action'] = array(\n 'type' => 'int',\n 'size' => 'tiny',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => MigrateMap::ROLLBACK_DELETE,\n 'description' => 'Flag indicating what to do for this item on rollback',\n );\n $fields['last_imported'] = array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 0,\n 'description' => 'UNIX timestamp of the last time this row was imported',\n );\n $schema = array(\n 'description' => t('Mappings from source key to destination key'),\n 'fields' => $fields,\n 'primary key' => $pks,\n );\n $this->connection->schema()->createTable($this->mapTable, $schema);\n\n // Now for the message table\n $fields = array();\n $fields['msgid'] = array(\n 'type' => 'serial',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n );\n $fields += $source_key_schema;\n\n $fields['level'] = array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 1,\n );\n $fields['message'] = array(\n 'type' => 'text',\n 'size' => 'medium',\n 'not null' => TRUE,\n );\n $schema = array(\n 'description' => t('Messages generated during a migration process'),\n 'fields' => $fields,\n 'primary key' => array('msgid'),\n 'indexes' => array('sourcekey' => $pks),\n );\n $this->connection->schema()->createTable($this->messageTable, $schema);\n }\n $this->ensured = TRUE;\n }\n }", "public function cleanupTriggers() {\n\t\treturn false;\n\t}", "private function activateCreateAlterTables()\n {\n $PluginDbStructure = new \\RdDownloads\\App\\Models\\PluginDbStructure();\n $schemas = $PluginDbStructure->get();\n unset($PluginDbStructure);\n\n if (is_array($schemas) && !empty($schemas) && !is_null($this->getDbVersion())) {\n global $wpdb;\n // require file that needs for use dbDelta() function.\n require_once ABSPATH . '/wp-admin/includes/upgrade.php';\n\n foreach ($schemas as $index => $item) {\n if (isset($item['statement']) && isset($item['tablename'])) {\n $sql = str_replace('%TABLE%', $item['tablename'], $item['statement']);\n\n if (isset($item['is_multisite']) && $item['is_multisite'] === true) {\n // if set to multisite table then it will create prefix_sitenumber_tablename.\n $prefix = $wpdb->prefix;\n } else {\n // if set not to multisite then it will create prefix_tablename.\n $prefix = $wpdb->base_prefix;\n }\n\n $sql = str_replace('%PREFIX%', $prefix, $sql);\n dbDelta($sql);\n unset($sql);\n\n if (function_exists('maybe_convert_table_to_utf8mb4')) {\n maybe_convert_table_to_utf8mb4($prefix . $item['tablename']);\n }\n unset($prefix);\n }\n }// endforeach;\n unset($index, $item);\n }\n\n unset($schemas);\n }", "protected function migrateTables()\n {\n foreach ($this->tables as $table) {\n \\DB::getPdo()->exec(\"INSERT IGNORE INTO {$this->newDbName}.{$table} SELECT * FROM {$this->oldDbName}.{$table}\");\n }\n }", "public function sync($runner)\n {\n $r = $this->getInformationSchema($runner->getDb(), $runner->getDbSchemaName());\n\n // found definition in information schema, check for changes\n if ($r)\n {\n list ($tableName, $event, $action, $body) = $r;\n\n $recreate = false;\n\n // changed table name\n if ($tableName != $this->tableName)\n {\n $recreate = true;\n }\n\n // changed trigger event\n if ($event != $this->getAction())\n {\n $recreate = true;\n }\n\n // changed trigger time\n if ($action != $this->getTime())\n {\n $recreate = true;\n }\n\n // changed trigger body\n if ($body != $this->getTriggerSQLBody())\n {\n $recreate = true;\n }\n\n // definition has been changed, sync in db\n if ($recreate)\n {\n $runner->log(\"SYNC: Recreating trigger {$this->getName()}.\");\n $runner->processQuery(\"DROP TRIGGER `{$this->getName()}`\");\n $runner->processQuery($this->getSQLCreate());\n }\n }\n // definition not found, create new trigger\n else\n {\n $runner->log(\"SYNC: Creating trigger {$this->getName()}.\");\n $runner->processQuery($this->getSQLCreate());\n }\n }", "private function ensureEmptyTargetTable($table, Connection $sourceConnection, Connection $destConnection)\n {\n // SchemaManager doesn't do enums!\n $destConnection->exec('DROP TABLE IF EXISTS ' . $sourceConnection->quoteIdentifier($table));\n\n $driverName = $sourceConnection->getDriver()->getName();\n if ($driverName === 'pdo_mysql') {\n $createSqlRow = $sourceConnection->query('SHOW CREATE TABLE ' . $sourceConnection->quoteIdentifier($table))\n ->fetch(\\PDO::FETCH_ASSOC);\n $createSql = $createSqlRow['Create Table'];\n } elseif ($driverName === 'pdo_sqlite') {\n $schemaSql = 'SELECT sql FROM sqlite_master WHERE type=\"table\" AND tbl_name=' . $sourceConnection->quoteIdentifier($table);\n $createSql = $sourceConnection->query($schemaSql)->fetchColumn();\n } else {\n throw new \\RuntimeException(__METHOD__ . \" not implemented for $driverName yet\");\n }\n\n $destConnection->exec($createSql);\n }", "public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}", "protected function resetExistingTables()\n {\n $this->existingTables = null;\n }", "protected function createOldTable()\n {\n $this->setUpNewTable();\n $this->getSchemaManager()->createTable($this->getOldTable());\n }", "public final function checkTriggers()\n {\n $stmt = self::$globalConnection->prepare('SHOW TRIGGERS FROM `' . self::$database . '`');\n if (! $stmt->execute())\n self::registerErrorOccurence($stmt);\n \n $triggers = array();\n while ($result = $stmt->fetch())\n $triggers[] = $result['trigger'];\n \n if (! in_array('cafet_new_balance_reload', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_balance_reload` \n BEFORE INSERT ON `$this->RELOADS` \n FOR EACH ROW \n BEGIN \t\n SET @user = NEW.user_id;\n UPDATE `$this->CLIENTS` SET balance = balance + NEW.amount WHERE user_id = @user;\n SET NEW.user_balance = (SELECT balance FROM `$this->CLIENTS` WHERE user_id = @user); \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_product_edition', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_product_edition` \n BEFORE INSERT ON `$this->PRODUCTS_EDITS` \n FOR EACH ROW \n BEGIN \n SET @count = (SELECT COUNT(*) FROM `$this->PRODUCTS_EDITS` WHERE product = NEW.product);\n IF NEW.price IS NULL THEN\n IF @count <> 0 THEN\n SET NEW.price = (SELECT price FROM `$this->PRODUCTS_EDITS` WHERE product = NEW.product ORDER BY id DESC LIMIT 1);\n ELSE\n SET NEW.price = 0;\n END IF;\n END IF;\n IF NEW.price < 0 THEN\n SET NEW.price = 0;\n END IF;\n IF NEW.name IS NULL AND @count <> 0 THEN\n SET NEW.name = (SELECT name FROM `$this->PRODUCTS_EDITS` WHERE product = NEW.product ORDER BY id DESC LIMIT 1);\n END IF; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_save_product_edition', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_save_product_edition` \n AFTER INSERT ON `$this->PRODUCTS_EDITS` \n FOR EACH ROW \n BEGIN \n UPDATE `$this->PRODUCTS` SET last_edit = NEW.id WHERE id = NEW.product; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_product_bought', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_product_bought` \n BEFORE INSERT ON `$this->PRODUCTS_BOUGHT` \n FOR EACH ROW \n BEGIN \n SET NEW.edit_id = (SELECT last_edit FROM `$this->PRODUCTS` WHERE id = NEW.product_id);\n SET @price = (SELECT price FROM `$this->PRODUCTS_EDITS` WHERE id = NEW.edit_id);\n UPDATE `$this->PRODUCTS` SET stock = stock - NEW.quantity WHERE id = NEW.product_id;\n UPDATE `$this->CLIENTS` SET balance = balance-@price*NEW.quantity WHERE user_id = NEW.user_id;\n UPDATE `$this->EXPENSES` SET user_balance = (SELECT balance FROM `$this->CLIENTS` WHERE user_id = NEW.user_id) WHERE id = NEW.expense_id; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_replenishment', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_replenishment` \n AFTER INSERT ON `$this->REPLENISHMENTS` \n FOR EACH ROW \n BEGIN \n SET @quantity = NEW.quantity;\n SET @product = NEW.product_id;\n UPDATE `$this->PRODUCTS` SET stock = stock + @quantity WHERE id = @product; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_formula_edition', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_formula_edition` \n BEFORE INSERT ON `$this->FORMULAS_EDITS` \n FOR EACH ROW \n BEGIN \n SET @count = (SELECT COUNT(*) FROM `$this->FORMULAS_EDITS` WHERE formula = NEW.formula);\n IF NEW.price IS NULL THEN\n IF @count <> 0 THEN\n SET NEW.price = (SELECT price FROM `$this->FORMULAS_EDITS` WHERE formula = NEW.formula ORDER BY id DESC LIMIT 1);\n ELSE\n SET NEW.price = 0;\n END IF;\n END IF;\n IF NEW.price < 0 THEN\n SET NEW.price = 0;\n END IF;\n IF NEW.name IS NULL AND @count <> 0 THEN\n SET NEW.name = (SELECT name FROM `$this->FORMULAS_EDITS` WHERE formula = NEW.formula ORDER BY id DESC LIMIT 1);\n END IF; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_save_formula_edition', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_save_formula_edition` \n AFTER INSERT ON `$this->FORMULAS_EDITS` \n FOR EACH ROW \n BEGIN \n UPDATE `$this->FORMULAS` SET last_edit = NEW.id WHERE id = NEW.formula; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_formula_bought', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_formula_bought` \n BEFORE INSERT ON `$this->FORMULAS_BOUGHT` \n FOR EACH ROW \n BEGIN \n SET NEW.edit_id = (SELECT last_edit FROM `$this->FORMULAS` WHERE id = NEW.formula_id);\n SET @price = (SELECT price FROM `$this->FORMULAS_EDITS` WHERE id = NEW.edit_id);\n UPDATE `$this->CLIENTS` SET balance = balance-@price*NEW.quantity WHERE user_id = NEW.user_id;\n UPDATE `$this->EXPENSES` SET user_balance = (SELECT balance FROM `$this->CLIENTS` WHERE user_id = NEW.user_id) WHERE id = NEW.expense_id; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_formula_bought_product', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_formula_bought_product` \n BEFORE INSERT ON `$this->FORMULAS_BOUGHT_PRODUCTS` \n FOR EACH ROW \n BEGIN \n SET NEW.product_edit = (SELECT last_edit FROM `$this->PRODUCTS` WHERE id = NEW.product_id);\n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_save_formula_bought_product', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_save_formula_bought_product` \n AFTER INSERT ON `$this->FORMULAS_BOUGHT_PRODUCTS` \n FOR EACH ROW \n BEGIN \n UPDATE `$this->PRODUCTS` SET stock = stock - 1 WHERE id = NEW.product_id; \n END\nEOSQL\n );\n }\n }", "protected function setUpForeignKey()\n {\n $this->getOldTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldTable()->createColumn('bar', Type::STRING, array('length' => 50));\n $this->getOldTable()->createPrimaryKey(array('foo'), 'pk');\n\n $this->getOldForeignKeyTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldForeignKeyTable()->createColumn('bar', Type::STRING, array('length' => 50));\n $this->getOldForeignKeyTable()->createForeignKey(\n array('foo'),\n 'foo',\n array('foo'),\n ForeignKey::RESTRICT,\n ForeignKey::RESTRICT,\n 'fk_foo'\n );\n\n $this->createOldForeignKeyTable();\n }", "protected function assertAlteration()\n {\n $tableDiff = $this->getComparator()->compare($this->getOldTable(), $this->getNewTable());\n $this->getSchemaManager()->alterTable($tableDiff);\n\n $this->assertEquals(\n $this->getNewTable(),\n $this->getSchemaManager()->getTable($this->getNewTable()->getName())\n );\n }", "protected function createOldForeignKeyTable()\n {\n $this->createOldTable();\n\n $this->setUpNewForeignKeyTable();\n $this->getSchemaManager()->createTable($this->getOldForeignKeyTable());\n }", "protected function setUpCheck()\n {\n $this->getOldTable()->createColumn('foo', Type::INTEGER);\n $this->getOldTable()->createColumn('bar', Type::INTEGER);\n $this->getOldTable()->createCheck('foo > 0', 'ck_foo');\n\n $this->createOldTable();\n }", "public function deleteTablesAndEvents() {\r\n\t\t// drop additional tables for extension module\r\n\t\t$tableNames = ['zasilkovna_weight_rules', 'zasilkovna_shipping_rules', 'zasilkovna_orders'];\r\n\t\tforeach ($tableNames as $shortTableName) {\r\n\t\t\t$sql = 'DROP TABLE `' . DB_PREFIX . $shortTableName . '`;';\r\n\t\t\t$this->db->query($sql);\r\n\t\t}\r\n\t\t// remove events registered for \"zasilkovna\" plugin\r\n\t\t$this->load->model('setting/event');\r\n\t\t$this->model_setting_event->deleteEventByCode(self::EVENT_CODE);\r\n\t}", "public function change()\n {\n $table = $this->table('calendars');\n $hasSource = $table->hasColumn('calendar_source');\n $hasSourceId = $table->hasColumn('calendar_source_id');\n\n if ($hasSource) {\n $table->renameColumn('calendar_source', 'source');\n }\n\n if ($hasSourceId) {\n $table->renameColumn('calendar_source_id', 'source_id');\n }\n }", "private function redirectsTable()\n\t{\n\t\t$table_installed = get_option('replace_media_redirects_table_installed');\n\t\tif ( $table_installed ) return;\n\n\t\tglobal $wpdb;\n\t\t$tablename = $wpdb->prefix . 'replace_media_redirects';\n\t\tif ( $wpdb->get_var('SHOW TABLES LIKE \"' . $tablename . '\"') != $tablename ) :\n\t\t\t$sql = 'CREATE TABLE ' . $tablename . '(\n\t\t\t\tid INTEGER(10) UNSIGNED AUTO_INCREMENT,\n\t\t\t\ttime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\tattachment_id INTEGER(10),\n\t\t\t\tsource MEDIUMTEXT,\n\t\t\t\tdestination MEDIUMTEXT,\n\t\t\t\tuser_id INTEGER(10),\n\t\t\t\tPRIMARY KEY (id) ) \n\t\t\t\tCHARACTER SET utf8;';\n\t\t\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\t\tdbDelta($sql);\n\t\t\tupdate_option('replace_media_redirects_table_installed', true);\n\t\tendif;\n\t}", "protected function assertForeignKeyAlteration()\n {\n $tableDiff = $this->getComparator()->compare($this->getOldForeignKeyTable(), $this->getNewForeignKeyTable());\n $this->getSchemaManager()->alterTable($tableDiff);\n\n $this->assertEquals(\n $this->getNewForeignKeyTable(),\n $this->getSchemaManager()->getTable($this->getNewForeignKeyTable()->getName())\n );\n }", "private function dropAndCreateTables(){\n \n $migration = new MikeMigration($this::genPrefix(10));\n $save = 0;\n\n // Prepare Dropped Tables\n if($this->droppedTables){\n $save++;\n foreach($this->droppedTables as $item){\n\n $migration->up(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n $migration->down($this::prepareTableBlueprint($item));\n\n \n // Delete Model\n Storage::disk('models')->delete($this->appNamePath.'/'.$item[\"name\"].'.php');\n // Delete Controller\n Storage::disk('controllers')->delete($this->appNamePath.'/'.$item[\"name\"].'Controller.php');\n // Delete Routes\n //...\n\n }\n }\n // Prepare New Tables \n if($this->newTables){\n $save++;\n foreach($this->newTables as $item){\n\n\n $migration->up($this::prepareTableBlueprint($item));\n\n $migration->down(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n }\n }\n // If Exist Dropped pr New Tables \n if($save > 0){\n $migration->save();\n }\n \n\n\n }", "protected function applyUpdatesAlertTable()\n\t{\n\t\tif (Configuration::get('ADN_ALTER_TABLE') != 2)\n\t\t{\n\t\t\tif(!$this->isColumnExistInTable('details', 'authorizedotnet_refund_history')) { \n\t\t\t\tDb::getInstance()->Execute(\"ALTER TABLE `\"._DB_PREFIX_.\"authorizedotnet_refund_history` ADD `details` varchar(255) AFTER `amount`\");\n\t\t\t}\n\t\t\t\n\t\t\tif(!$this->isColumnExistInTable('auth_code', 'authorizedotnet_refunds')) { \n\t\t\t\tDb::getInstance()->Execute(\"ALTER TABLE `\"._DB_PREFIX_.\"authorizedotnet_refunds` ADD `auth_code` varchar(10) NOT NULL AFTER `card`\");\n\t\t\t}\n\n\t\t\tif(!$this->isColumnExistInTable('captured', 'authorizedotnet_refunds')) { \n\t\t\t\tDb::getInstance()->Execute(\"ALTER TABLE `\"._DB_PREFIX_.\"authorizedotnet_refunds` ADD `captured` TINYINT(1) NOT NULL DEFAULT '0' AFTER `auth_code`\");\n\t\t\t}\n\n\t\t\tConfiguration::updateValue('ADN_ALTER_TABLE','2');\n\t\t}\n\t}", "function wp_should_upgrade_global_tables()\n {\n }", "public function revertTable(Source $source, AbstractTable $table);", "public function init()\n {\n $destination_table = $this->destination_db->getTables();\n $source_table = $this->source_db->getTables();\n\n $destination_column = [];\n $source_column = [];\n $empty_column = [array_fill(0, 6, '')];\n $source_recoed = [];\n $destination_recoed = [];\n\n // Format data source.\n foreach ($source_table as $key => $table) {\n $row = array_map(function ($item) use ($table) {\n $item[0] = $table . ' - ' . $item[0];\n return $item;\n }, $this->source_db->getColumns($table));\n\n // Add partition of empty array.\n $source_column = $key ?\n array_merge($source_column, $empty_column, $row) :\n array_merge($source_column, $row);\n\n $source_recoed[$table] = $this->source_db->getRecoeds($table);\n }\n\n // Format data destination.\n foreach ($destination_table as $key => $table) {\n $row = array_map(function ($item) use ($table) {\n $item[0] = $table . ' - ' . $item[0];\n return $item;\n }, $this->destination_db->getColumns($table));\n\n $destination_column = $key ?\n array_merge($destination_column, $empty_column, $row) :\n array_merge($destination_column, $row);\n }\n\n // Merge source & destination.\n foreach ($destination_column as $key => &$destination) {\n if (isset($source_column[$key])) {\n $destination = array_merge($destination, [null], $source_column[$key]);\n }\n }\n\n // Submit.\n if (!empty($_POST)) {\n $target_table = '';\n $records = [];\n $uniformity = [];\n\n // Begin db transaction.\n $this->destination_db->beginTransaction();\n\n $params = json_decode($_POST['params'], true);\n\n // Key used to store error message at the time of last data insert.\n $last_key = '';\n\n $error_count = 0;\n\n foreach ($params as $key => &$param) {\n // Init error messages.\n $param[14] = '';\n\n // When a blank line comes,\n // all columns of the corresponding table have been acquired, so insert the data.\n if (!$param[0]) {\n try {\n if ($records) {\n $this->insertData($target_table, $records, $uniformity);\n } else {\n $params[$key - 1][14] = $this->no_data_msg;\n }\n } catch (\\Exception $e) {\n $params[$key - 1][14] = $e->getMessage();\n $error_count++;\n } catch (\\Throwable $e) {\n $params[$key - 1][14] = $e->getMessage();\n $error_count++;\n }\n // Init Table name & data.\n $target_table = '';\n $records = [];\n $uniformity = [];\n continue;\n }\n\n\n if (!$param[7] && !$param[13]) continue;\n\n $destination_str_arr = explode(' - ', $param[0]);\n\n // If there is a value in this cell,\n // that value will be inserted uniformly.\n if ($param[13]) {\n $uniformity[$destination_str_arr[1]] = $param[13];\n } else {\n $source_str_arr = explode(' - ', $param[7]);\n if (!$target_table) {\n $target_table = $destination_str_arr[0];\n }\n\n $rows = $this->source_db->getRecoeds($source_str_arr[0], [$source_str_arr[1]]);\n if ($rows) {\n $records[$destination_str_arr[1]] = array_column($rows, $source_str_arr[1]);\n }\n }\n\n $last_key = $key;\n }\n\n // Insert last data.\n if ($target_table && $records) {\n try {\n $this->insertData($target_table, $records, $uniformity);\n } catch (\\Exception $e) {\n $params[$last_key][14] = $e->getMessage();\n $error_count++;\n } catch (\\Throwable $e) {\n $params[$last_key][14] = $e->getMessage();\n $error_count++;\n }\n } else {\n $params[$key - 1][14] = $this->no_data_msg;\n }\n\n if ($_POST['runtype'] === 'run' && !$error_count) {\n $this->destination_db->commit();\n $done = true;\n } else {\n if (!$error_count) {\n $done = true;\n }\n $this->destination_db->rollback();\n }\n\n $destination_column = $params;\n }\n\n $destination_column = json_encode($destination_column);\n\n require __DIR__ . '/../resources/views/index.php';\n }", "static private function create_tables(){\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n self::create_views_table();\n }", "function insertIntoRevsBasedOnModifiedValues($main_tablename = null, $detail_tablename = null) {\r\n\tglobal $import_date;\r\n\tglobal $imported_by;\r\n\tglobal $atim_controls;\r\n\tglobal $modified_database_tables_list;\r\n\t\r\n\t$tables_sets_to_update = $modified_database_tables_list;\r\n\tif(!is_null($main_tablename)) {\r\n\t\t$key = $main_tablename.'-'.(is_null($detail_tablename)? '' : $detail_tablename);\r\n\t\t$tables_sets_to_update = array($key => array($main_tablename, $detail_tablename));\r\n\t}\r\n\t\r\n\t//Check masters model alone\r\n\t$initial_tables_sets_to_update = $tables_sets_to_update;\r\n\tforeach($initial_tables_sets_to_update as $key => $tmp) {\r\n\t\tif(preg_match('/^([a-z]+_masters)\\-$/', $key, $matches)) {\r\n\t\t\t$master_table_name = $matches[1];\r\n\t\t\t$control_table_name = str_replace('_masters', '_controls', $master_table_name);\r\n\t\t\tif(!isset($atim_controls[$control_table_name])) migrationDie(\"ERR 778894003 #$master_table_name.$control_table_name\");\r\n\t\t\tforeach($atim_controls[$control_table_name] as $control_data) {\r\n\t\t\t\tif(is_array($control_data) && isset($control_data['detail_tablename'])) {\r\n\t\t\t\t\t$detail_table_name = $control_data['detail_tablename'];\r\n\t\t\t\t\t$new_key = \"$master_table_name-$detail_table_name\";\r\n\t\t\t\t\tif(!isset($tables_sets_to_update[$new_key])) $tables_sets_to_update[$new_key] = array(\"$master_table_name\", \"$detail_table_name\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tunset($tables_sets_to_update[$key]);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//Insert Into Revs\r\n\t$insert_queries = array();\r\n\t$set_key_done = array();\r\n\tforeach($tables_sets_to_update as $new_tables_set) {\r\n\t\tlist($main_tablename, $detail_tablename) = $new_tables_set;\r\n\t\tif(!$detail_tablename) {\r\n\t\t\t// *** CLASSICAL MODEL ***\r\n\t\t\t$query = \"DESCRIBE $main_tablename;\";\r\n\t\t\t$results = customQuery($query);\r\n\t\t\t$table_fields = array();\r\n\t\t\twhile($row = $results->fetch_assoc()) {\r\n\t\t\t\tif(!in_array($row['Field'], array('created','created_by','modified','modified_by','deleted'))) $table_fields[] = $row['Field'];\r\n\t\t\t}\r\n\t\t\t$source_table_fields = (empty($table_fields)? '' : '`'.implode('`, `',$table_fields).'`, ').\"`modified_by`, `modified`\";\r\n\t\t\t$revs_table_fields = (empty($table_fields)? '' : '`'.implode('`, `',$table_fields).'`, ').'`modified_by`, `version_created`';\r\n\t\t\t$insert_queries[] = \"INSERT INTO `\".$main_tablename.\"_revs` ($revs_table_fields)\r\n\t\t\t\t(SELECT $source_table_fields FROM `$main_tablename` WHERE `modified_by` = '$imported_by' AND `modified` = '$import_date');\";\r\n\t\t} else {\r\n\t\t\t// *** MASTER DETAIL MODEL ***\r\n\t\t\tif(!preg_match('/^.+\\_masters$/', $main_tablename)) migrationDie(\"ERR_FUNCTION_insertIntoRevsBasedOnModifiedValues(): '$main_tablename' is not a 'Master' table of a MasterDetail model.\");\r\n\t\t\t$foreign_key = str_replace('_masters', '_master_id', $main_tablename);\r\n\t\t\t//Master table\r\n\t\t\t$query = \"DESCRIBE $main_tablename;\";\r\n\t\t\t$results = customQuery($query);\r\n\t\t\t$table_fields = array();\r\n\t\t\twhile($row = $results->fetch_assoc()) {\r\n\t\t\t\tif(!in_array($row['Field'], array('created','created_by','modified','modified_by','deleted'))) $table_fields[] = $row['Field'];\r\n\t\t\t}\r\n\t\t\t$source_table_fields = (empty($table_fields)? '' : 'Master.`'.implode('`, Master.`',$table_fields).'`, ').\"Master.`modified_by`, Master.`modified`\";\r\n\t\t\t$revs_table_fields = (empty($table_fields)? '' : '`'.implode('`, `',$table_fields).'`, ').'`modified_by`, `version_created`';\r\n\t\t\t$insert_queries[] = \"INSERT INTO `\".$main_tablename.\"_revs` ($revs_table_fields)\r\n\t\t\t\t(SELECT $source_table_fields FROM `$main_tablename` AS Master INNER JOIN $detail_tablename AS Detail ON Master.`id` = Detail.`$foreign_key` WHERE Master.`modified_by` = '$imported_by' AND Master.`modified` = '$import_date');\";\r\n\t\t\t//Detail table\r\n\t\t\t$all_detail_tablenames = ($main_tablename != 'sample_masters')? array($detail_tablename) : array($detail_tablename, 'specimen_details', 'derivative_details');\r\n\t\t\tforeach($all_detail_tablenames as $detail_tablename) {\r\n\t\t\t\t$query = \"DESCRIBE $detail_tablename;\";\r\n\t\t\t\t$results = customQuery($query);\r\n\t\t\t\t$table_fields = array();\r\n\t\t\t\twhile($row = $results->fetch_assoc()) $table_fields[] = $row['Field'];\r\n\t\t\t\tif(!in_array($foreign_key, $table_fields)) migrationDie(\"ERR_FUNCTION_insertIntoRevsBasedOnModifiedValues(): Foreign Key '$foreign_key' defined based on 'Master' table name '$main_tablename' is not a field of the 'Detail' table '$detail_tablename'.\");\r\n\t\t\t\t$source_table_fields = (empty($table_fields)? '' : 'Detail.`'.implode('`, Detail.`',$table_fields).'`, ').\"Master.`modified`\";\r\n\t\t\t\t$revs_table_fields = (empty($table_fields)? '' : '`'.implode('`, `',$table_fields).'`, ').'`version_created`';\r\n\t\t\t\t$insert_queries[] = \"INSERT INTO `\".$detail_tablename.\"_revs` ($revs_table_fields)\r\n\t\t\t\t\t(SELECT $source_table_fields FROM `$main_tablename` AS Master INNER JOIN `$detail_tablename` AS Detail ON Master.`id` = Detail.`$foreign_key` WHERE Master.`modified_by` = '$imported_by' AND Master.`modified` = '$import_date');\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tforeach($insert_queries as $query) {\r\n\t\tcustomQuery($query, true);\r\n\t}\r\n}", "function updateExistingTables() {\n \t$changes = array(\n \t \"alter table `\" . TABLE_PREFIX . \"project_objects` add `is_locked` tinyint(0) unsigned null default null after `has_time`\",\n \t \"alter table `\" . TABLE_PREFIX . \"project_objects` change `project_id` `project_id` int(10) unsigned not null default '0'\",\n \t \"alter table `\" . TABLE_PREFIX . \"pinned_projects` change `project_id` `project_id` int(10) unsigned not null default '0'\",\n \t \"alter table `\" . TABLE_PREFIX . \"project_config_options` change `project_id` `project_id` int(10) unsigned not null default '0'\",\n \t \"alter table `\" . TABLE_PREFIX . \"project_users` change `project_id` `project_id` int(10) unsigned not null default '0'\",\n \t);\n \t\n \tforeach($changes as $change) {\n \t $update = $this->utility->db->execute($change);\n \t if(is_error($update)) {\n \t return $update->getMessage();\n \t } // if\n \t} // foreach\n \t\n \treturn true;\n }", "function postCreateTable(){\n\t}", "function alter_tables_if_required() {\r\n global $wpdb;\r\n $options = get_option('nus_altered_table');\r\n $altercolumns = false;\r\n if(!$options) {\r\n $altercolumns = true;\r\n }\r\n\r\n if($altercolumns) {\r\n $wpdb->query(\"ALTER TABLE \" . NUS_TEMP_TABLE .\" MODIFY nus_feed_id varchar(255) NOT NULL\");\r\n $wpdb->query(\"ALTER TABLE \" . NUS_TRACKER_TABLE .\" MODIFY nus_feed_id varchar(255) NOT NULL\");\r\n add_option('nus_altered_table', 'altered');\r\n }\r\n\r\n\r\n}", "protected function silentCacheFrameworkTableSchemaMigration() {}", "public function updateDatabase() {\r\n // All the extra function remove an unnecessary layer of arrays\r\n $tables_in_database = DB::tablesInDatabase();\r\n\r\n // List of matched tables\r\n $matched = [];\r\n\r\n /** @var Table $table */\r\n foreach (DB::tableInstances() as $i => $table) {\r\n $this->table = $table;\r\n $this->table_name = $table::getName();\r\n\r\n if(in_array($this->table_name, $tables_in_database)) {\r\n array_push($matched, $table->class());\r\n\r\n // Go through and check each table\r\n $this->updateExistingTable();\r\n }\r\n }\r\n\r\n // Loops over to see if any new tables have appeared and if so add them\r\n foreach (array_diff(DB::tables(), $matched) as $table) {\r\n DB::createTableIfNotExists($table);\r\n\r\n echo \"Created $table \\n\";\r\n if($this->log_changes) Logger::migration(\"Created $table\");\r\n }\r\n\r\n // Loops over and find tables defined in the Database but not added to the DB::$table_instances array\r\n // If found it removes them from the Database\r\n foreach (array_diff($tables_in_database, DB::tablesByName()) as $table) {\r\n // Checks for reference tables used in Many to Many relationships\r\n // If found continue as they should not be dropped\r\n if(in_array($table, DB::getReferenceTables())) continue;\r\n\r\n // FIXME: drop reference table first to stop foreign key constraint error\r\n\r\n $sql = \"DROP TABLE $table\";\r\n\r\n $q = DB::connection()->query($sql);\r\n\r\n if($q === false) {\r\n //throw new ColumnNotFoundError(\"Error given column(s) do not exist in table\");\r\n throw new SQLQueryError(DB::connection()->error());\r\n } else {\r\n echo \"Dropped $table \\n\";\r\n if ($this->log_changes) Logger::migration(\"Dropped $table\");\r\n }\r\n }\r\n }", "private function updateExistingTable() {\n $statements = []; // this will be a list of alter table statements, but only the stuff AFTER the 'alter table [tablename]' part\n //get the list of current columns in this table\n $existingColumnsFromDb = DbManager::query(\"show columns from $this->tableName\");\n\n //get the list of constraints currently available for the columns in this table. \n $constraints = Table::getConstraints($this->tableName);\n //remove all constraints from the table\n foreach ($constraints as $c) {\n //for now, the only constraints supported are primary key and foreign key\n switch ($c->CONSTRAINT_NAME) {\n case \"PRIMARY\":\n //handled below\n break;\n default:\n //assume the constraint is a foreign key. \n $statements[] = \"drop foreign key $c->CONSTRAINT_NAME\";\n break;\n }\n }\n\n foreach ($existingColumnsFromDb as $colFromDb) {\n //if the column was not found in the list, this column that is \n ////currently in the database will need to be deleted\n if ($this->getColumn($colFromDb->Field) === null) {\n $statements[] = \"drop column $colFromDb->Field\";\n }\n }\n\n //a list of names of columns that make up the primary key\n $keyNameList = [];\n //add any new columns or update existing ones\n foreach ($this->columns as $column) {\n //see if this column does not exist in the table, it is a new column. generate a new column stmt\n if ($this->columnExistsInTable($column->columnName, $existingColumnsFromDb) === false) {\n $statements[] = \"add column $column->columnName $column->dataType $column->extraStuff\";\n } else {\n //these columns exist in the table already. create update statements for each column, even if nothing has changed. it won't harm the column\n $statements[] = \"modify column $column->columnName $column->dataType $column->extraStuff\";\n }\n //add this column to the list of primary keys if it is flagged as such\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n\n //reregister the primary keys\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"\";\n if (Table::HasPrimaryKey($this->dbName, $this->tableName) == true) {\n $primaryKeySql = \"drop primary key,\";\n }\n\n $primaryKeySql .= \"add primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \"$primaryKeySql)\";\n $statements[] = $primaryKeySql;\n }\n\n //\n //apply the alter statements\n $alter = \"alter table $this->tableName\";\n $bTotalSuccess = true;\n foreach ($statements as $s) {\n $bTotalSuccess = $bTotalSuccess && DbManager::nonQuery(\"$alter $s\");\n }\n return $bTotalSuccess;\n }", "public function isMigratingUp();", "protected function seedTablesStructure()\n {\n $getStructureDump = new Process(\"mysqldump -u {$this->user} -p{$this->password} --no-data {$this->oldDbName} > {$this->oldDbName}.dump\");\n $getStructureDump->run();\n\n $fillStructureDump = new Process(\"mysql -u {$this->user} -p{$this->password} {$this->newDbName} < {$this->oldDbName}.dump\");\n $fillStructureDump->run();\n\n $removeDumpFile = new Process(\"rm -f {$this->oldDbName}.dump\");\n $removeDumpFile->run();\n }", "public function change()\n {\n $table = $this->table('notifications');\n $table->addColumn('destination', 'enum', [\n 'values' => [\n 'Global',\n 'Role',\n 'User'\n ]\n ]);\n $table->addColumn('role_id', 'string', [\n 'default' => '',\n 'limit' => 32\n ]);\n $table->changeColumn('user_id', 'string', [\n 'default' => '',\n 'limit' => 36\n ]);\n $table->removeColumn('seen');\n $table->removeColumn('deleted');\n $table->update();\n\n $tableLogs = $this->table('admin_l_t_e_notification_logs');\n $tableLogs->addColumn('notification_id', 'integer');\n $tableLogs->addColumn('user_id', 'string', [\n 'default' => null,\n 'limit' => 36,\n 'null' => false\n ]);\n $tableLogs->addColumn('created', 'datetime');\n $tableLogs->create();\n }", "private function computeScheduleInsertsChangeSets()\n {\n foreach ($this->documentInsertions as $document) {\n $class = $this->dm->getClassMetadata(get_class($document));\n\n $this->computeChangeSet($class, $document);\n }\n }", "public function recreateMapsIfTriggered()\n {\n if ($this->isRecreationTriggered) {\n $this->recreateMaps();\n }\n }", "public function rollout()\n\t{\n\t}", "function testFieldsDontRerequestChanges() {\r\n\t\t$db = DB::getConn();\r\n\t\tDB::quiet();\r\n\t\t\r\n\r\n\t\t// Table will have been initially created by the $extraDataObjects setting\r\n\t\t\r\n\t\t\r\n\t\t// Verify that it doesn't need to be recreated\r\n\t\t$db->beginSchemaUpdate();\r\n\t\t$obj = new DataObjectSchemaGenerationTest_DO();\r\n\t\t$obj->requireTable();\r\n\t\t$needsUpdating = $db->doesSchemaNeedUpdating();\r\n\t\t$db->cancelSchemaUpdate();\r\n\t\t\r\n\t\t$this->assertFalse($needsUpdating);\r\n\t}", "protected function copyTriggerPrototypes(array $srcDiscovery, array $dstDiscovery, array $srcHost, array $dstHost) {\n\t\t$srcTriggers = API::TriggerPrototype()->get(array(\n\t\t\t'discoveryids' => $srcDiscovery['itemid'],\n\t\t\t'output' => API_OUTPUT_EXTEND,\n\t\t\t'selectHosts' => API_OUTPUT_EXTEND,\n\t\t\t'selectItems' => array('itemid', 'type'),\n\t\t\t'selectDiscoveryRule' => API_OUTPUT_EXTEND,\n\t\t\t'selectFunctions' => API_OUTPUT_EXTEND,\n\t\t\t'preservekeys' => true\n\t\t));\n\n\t\tif (!$srcTriggers) {\n\t\t\treturn array();\n\t\t}\n\n\t\tforeach ($srcTriggers as $id => $trigger) {\n\t\t\t// skip triggers with web items\n\t\t\tif (httpItemExists($trigger['items'])) {\n\t\t\t\tunset($srcTriggers[$id]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// save new triggers\n\t\t$dstTriggers = $srcTriggers;\n\t\tforeach ($dstTriggers as $id => $trigger) {\n\t\t\tunset($dstTriggers[$id]['templateid']);\n\t\t\tunset($dstTriggers[$id]['triggerid']);\n\n\t\t\t// update expression\n\t\t\t$dstTriggers[$id]['expression'] = explode_exp($trigger['expression'], false, false, $srcHost['host'], $dstHost['host']);\n\t\t}\n\n\t\t$rs = API::TriggerPrototype()->create($dstTriggers);\n\t\tif (!$rs) {\n\t\t\tself::exception(ZBX_API_ERROR_PARAMETERS, _('Cannot clone trigger prototypes.'));\n\t\t}\n\n\t\treturn $rs;\n\t}", "public function refreshDatabase()\n {\n $this->validateDatabase();\n $this->copySqliteCreate();\n $this->runMigrations();\n\n copy($this->baseSqlite(), $this->copySqlite());\n }", "public function passResetTableMigrate()\r\n\t{\r\n\t\t$isPassResetTableExist = $this->schema->tableExist('password_resets');\r\n\t\tif (!$isPassResetTableExist) {\r\n\r\n\t\t\t$fileName = \"20210408051901_create_password_resets_table.php\";\r\n\t\t\t$dir = $this->migrationFiles . $fileName;\r\n\t\t\t$content = file_get_contents($this->stubsPath . \"password_resets.stubs\");\r\n\r\n\t\t\tif (!file_exists($dir)) {\r\n\t\t\t\t$handle = fopen($dir, 'w+');\r\n\t\t\t\tfwrite($handle, $content);\r\n\t\t\t\tfclose($handle);\r\n\t\t\t\tchmod($dir, 0777);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function modifyTable()\n\t{\n\t\t$table = $this->getTable();\n\t\t// add the aggregate columns if not present\n\t\t$columnNames = $this->getColumnNames();\n\t\tforeach ($columnNames as $columnName) {\n\t\t\tif( ! $table->containsColumn($columnName)) {\n\t\t\t\t$column = $table->addColumn(array(\n\t\t\t\t\t'name' => $columnName,\n\t\t\t\t\t'type' => 'INTEGER',\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\t// add behavior to foreign tables to autoupdate aggregate columns\n\t\t$foreignTables = $this->getForeignTables();\n\t\t$columns = $this->getColumns(); // get aggregate column objects\n\t\tforeach ($foreignTables as $k => $foreignTable) {\n\t\t\t//var_dump($foreignTable); //MARK\n\t\t\tif(!$foreignTable->hasBehavior('concrete_inheritance_parent')) {\n\t\t\t\t$relationBehaviorName = 'aggregate_column_relation_to_' . $table->getName() . '_' . $columnNames[$k];\n\t\t\t\t$relationBehavior = new AggregateColumnRelationBehavior();\n\t\t\t\t$relationBehavior->setName($relationBehaviorName);\n\t\t\t\t// FIXME does this really serve any purpose other than check whether a fk is defined?\n\t\t\t\t$foreignKey = $this->getForeignKey($foreignTable);\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'foreign_table', 'value' => $table->getName()));\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'update_method', 'value' => 'update' . $columns[$k]->getPhpName()));\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'foreign_aggregate_column', 'value' => $columns[$k]->getPhpName()));\n\t\t\t\t$foreignTable->addBehavior($relationBehavior);\n\t\t\t}\n\t\t}\n\t}", "function _postBuildSources() {\n foreach($this->sphinxConfig->default['sources'] as $modelName => &$source) {\n //insert database configuration\n if(isset($source['database'])) {\n $database = $source['database'];\n } else {\n $database = 'default';\n }\n $dbConfig = $this->cakeDbConfigToSphinx($this->DbConfig->{$source['database']});\n $source = Set::merge($dbConfig, $source);\n unset($source['database']);\n\n //move index\n if(isset($source['index'])) {\n $this->sphinxConfig->default['indexes'][$modelName] = $source['index'];\n unset($source['index']);\n }\n\n if(is_array($source['sql_query'])) {\n $source['sql_query']['log'] = true;\n $queryAndAttrs = $this->_getSQLQuery($modelName, $source['sql_query']);\n $source['sql_query'] = $queryAndAttrs['sql_query'];\n }\n\n if(is_array($source['attributes'])) {\n $this->getAttributes($modelName, $source['attributes']);\n }\n }\n }", "function upgrade_230_old_tables()\n {\n }", "protected function createTables()\n {\n $sql = $this->create_table;\n $this->connection->query($sql);\n\n // create again in schema 2\n $sql = str_replace($this->table, \"{$this->schema2}.{$this->table}\", $sql);\n $this->connection->query($sql);\n }", "private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}", "function updateSourceModule() {\n try {\n $commits_table = TABLE_PREFIX . 'source_commits';\n $paths_table = TABLE_PREFIX . 'source_paths';\n $repositories_table = TABLE_PREFIX . 'source_repositories';\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n $source_users_table = TABLE_PREFIX . 'source_users';\n $activity_logs_table = TABLE_PREFIX . 'activity_logs';\n\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='source'\")) {\n DB::execute(\"CREATE TABLE $commits_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n name varchar(255) DEFAULT NULL,\n type varchar(25) DEFAULT NULL,\n revision_number int(11) unsigned DEFAULT '0',\n repository_id int(11) unsigned DEFAULT '0',\n message_title text,\n message_body text,\n authored_on datetime DEFAULT NULL,\n authored_by_name varchar(100) DEFAULT NULL,\n authored_by_email varchar(100) DEFAULT NULL,\n commited_on datetime DEFAULT NULL,\n commited_by_name varchar(100) DEFAULT NULL,\n commited_by_email varchar(100) DEFAULT NULL,\n diff text,\n PRIMARY KEY (id),\n KEY repository_id (repository_id),\n KEY commited_on (commited_on)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE $paths_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n commit_id int(11) unsigned DEFAULT '0',\n is_dir tinyint(1) unsigned NOT NULL DEFAULT '0',\n path varchar(255) DEFAULT NULL,\n action varchar(1) DEFAULT NULL,\n PRIMARY KEY (id),\n KEY commit_id (commit_id)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE $repositories_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n name varchar(255) DEFAULT NULL,\n type varchar(25) DEFAULT NULL,\n created_on datetime DEFAULT NULL,\n created_by_id int(10) unsigned DEFAULT '0',\n created_by_name varchar(100) DEFAULT NULL,\n created_by_email varchar(150) DEFAULT NULL,\n updated_on datetime DEFAULT NULL,\n updated_by_id int(10) unsigned DEFAULT '0',\n updated_by_name varchar(100) DEFAULT NULL,\n updated_by_email varchar(150) DEFAULT NULL,\n repository_path_url varchar(255) DEFAULT NULL,\n username varchar(255) DEFAULT NULL,\n password varchar(255) DEFAULT NULL,\n update_type int(3) DEFAULT '0',\n graph text,\n PRIMARY KEY (id)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n $repositories_link = array();\n $repositories = DB::execute(\"SELECT * FROM $project_objects_table WHERE type = 'Repository'\");\n if (is_foreachable($repositories)) {\n foreach ($repositories as $repository) {\n //insert new source repository\n DB::execute(\"INSERT INTO $repositories_table (name,type,created_on,created_by_id,created_by_name,created_by_email,updated_on,updated_by_id,updated_by_name,updated_by_email,\n repository_path_url,username,password,update_type,graph) VALUES (?, 'SvnRepository', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\",\n $repository['name'],\n $repository['created_on'],\n $repository['created_by_id'],\n $repository['created_by_name'],\n $repository['created_by_email'],\n $repository['updated_on'],\n $repository['updated_by_id'],\n $repository['updated_by_name'],\n $repository['updated_by_email'],\n $repository['text_field_1'],\n $repository['varchar_field_1'],\n $repository['varchar_field_2'],\n $repository['integer_field_2'],\n $repository['text_field_2']\n );\n\n // Update project object repository\n $last_insert_id = DB::lastInsertId();\n DB::execute(\"UPDATE $project_objects_table SET type = 'ProjectSourceRepository', parent_id = ? WHERE id = ?\", $last_insert_id, $repository['id']);\n\n // Update source user links\n DB::execute(\"UPDATE $source_users_table SET repository_id = ? WHERE repository_id = ?\", $last_insert_id, $repository['id']);\n } //foreach\n } //if\n\n\n if (extension_loaded('svn')) {\n $svn_type = 'extension';\n } elseif (extension_loaded('xml') && function_exists('xml_parser_create')) {\n $svn_type = 'exec';\n } else {\n $svn_type = 'none';\n } // if\n\n // Update configuration options\n DB::execute('INSERT INTO ' . TABLE_PREFIX . 'config_options (name, module, value) VALUES (?, ?, ?), (?, ?, ?)',\n 'source_svn_type', 'source', serialize($svn_type),\n 'source_mercurial_path', 'source', serialize('/usr/bin/')\n );\n } //if\n // Delete all commits from project object\n DB::execute(\"DELETE FROM $project_objects_table WHERE type = 'Commit'\");\n\n // Delete all activity logs\n DB::execute(\"DELETE FROM $activity_logs_table WHERE type = 'RepositoryUpdateActivityLog'\");\n\n //delete unnecessary configuration options\n DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"config_options WHERE name = 'source_svn_trust_server_cert' OR name = 'source_svn_use_output_redirect'\");\n\n } catch (Exception $e) {\n return $e->getMessage();\n } //try\n\n return true;\n }", "public static function es_upgrade_database_for_3_4_0() {\n\n\t\tglobal $wpdb;\n\n\t\t// MIGRATION OF TEMPLATE TABLE TO CTP\n\t\t$es_template_table_exists = $wpdb->query( \"SHOW TABLES LIKE '{$wpdb->prefix}es_templatetable'\" );\n\t\tif ( $es_template_table_exists > 0 ) {\n\n\t\t\t$es_migration_success = get_option( 'es_template_migration_done', 'nodata' );\n\t\t\tif( $es_migration_success == 'yes' ) return;\n\n\t\t\t$sSql = \"SELECT es_tt.*,\n\t\t\t\t\t\t\t IFNULL(es_not.es_note_id, '') as es_note_id\n\t\t\t\t\tFROM \".$wpdb->prefix.\"es_templatetable AS es_tt \n\t\t\t\t\tLEFT JOIN \".$wpdb->prefix.\"es_notification AS es_not\n\t\t\t\t\t\tON(es_not.es_note_templ = es_tt.es_templ_id)\";\n\t\t\t$arrRes = $wpdb->get_results($sSql, ARRAY_A);\n\n\t\t\tif( !empty( $arrRes ) ){\n\n\t\t\t\t$es_note_ids = array();\n\n\t\t\t\tforeach ( $arrRes as $tmpl ) {\n\t\t\t\t\t// Create post object\n\t\t\t\t\t$es_post = array(\n\t\t\t\t\t 'post_title' => wp_strip_all_tags( $tmpl['es_templ_heading'] ),\n\t\t\t\t\t 'post_content' => $tmpl['es_templ_body'],\n\t\t\t\t\t 'post_status' => 'publish',\n\t\t\t\t\t 'post_type' => 'es_template',\n\t\t\t\t\t 'meta_input' => array( 'es_template_type' => $tmpl['es_email_type']\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t// Insert the post into the database\n\t\t\t\t\t$last_inserted_id = wp_insert_post( $es_post );\n\n\t\t\t\t\tif($tmpl['es_email_type'] == 'Post Notification' && !empty($tmpl['es_note_id']) ) {\n\t\t\t\t\t\t$es_note_ids[] = 'WHEN es_note_id = '.$tmpl['es_note_id'].' THEN '. $last_inserted_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !empty( $es_note_ids ) ) {\n\t\t\t\t\t// To update the 'es_note_templ' ids\n\t\t\t\t\t$sSql = \"UPDATE \".$wpdb->prefix.\"es_notification SET `es_note_templ` = (CASE \". implode(\" \", $es_note_ids).\" END)\";\n\t\t\t\t\t$wpdb->query( $sSql );\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tupdate_option( 'es_template_migration_done', 'yes' );\n\t\t}\n\t\t// END\n\n\t\t// Keywords in Compose table\n\t\t$keywords_to_rename_in_compose = array(\n\t\t\t\t\t\t\t\t\t\t\t\t'###NAME###' \t\t\t\t=> '{{NAME}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###EMAIL###' \t\t\t\t=> '{{EMAIL}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###DATE###' \t\t\t\t=> '{{DATE}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###POSTTITLE###' \t\t\t=> '{{POSTTITLE}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###POSTIMAGE###' \t\t\t=> '{{POSTIMAGE}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###POSTDESC###' \t\t\t=> '{{POSTDESC}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###POSTFULL###' \t\t\t=> '{{POSTFULL}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###POSTAUTHOR###' \t\t\t=> '{{POSTAUTHOR}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###POSTLINK###' \t\t\t=> '{{POSTLINK}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###POSTLINK-ONLY###' \t\t=> '{{POSTLINK-ONLY}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###POSTLINK-WITHTITLE###' \t=> '{{POSTLINK-WITHTITLE}}',\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t// Keywords in Settings\n\t\t$keywords_in_settings_to_rename = array(\n\t\t\t\t\t\t\t\t\t\t\t\t'###NAME###' \t => '{{NAME}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###EMAIL###' \t => '{{EMAIL}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###GROUP###' \t => '{{GROUP}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###COUNT###' \t => '{{COUNT}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###UNIQUE###' \t => '{{UNIQUE}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###STARTTIME###' => '{{STARTTIME}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###ENDTIME###' => '{{ENDTIME}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###LINK###' \t => '{{LINK}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###DATE###' \t => '{{DATE}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###SUBJECT###'\t => '{{SUBJECT}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###DBID###'\t => '{{DBID}}',\n\t\t\t\t\t\t\t\t\t\t\t\t'###GUID###'\t => '{{GUID}}',\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t// Updating keywords in post_title column where `post_type` = 'es_template'\n\t\t$es_post_title_query = \"UPDATE {$wpdb->prefix}posts SET `post_title` = REPLACE(post_title,'###POSTTITLE###','{{POSTTITLE}}') WHERE `post_type` = 'es_template'\";\n\t\t$wpdb->query( $es_post_title_query );\n\n\t\t// Updating keywords in post_content column where `post_type` = 'es_template'\n\t\t$compose_keywords = array();\n\t\tforeach ($keywords_to_rename_in_compose as $key => $value) {\n\t\t\t$compose_keywords[] = \"post_content = REPLACE(post_content,'\".$key.\"','\".$value.\"')\";\n\t\t}\n\n\t\t$es_post_content_query = \"UPDATE {$wpdb->prefix}posts SET \".implode(\", \",$compose_keywords).\n\t\t\t\t\t\t\t\t\" WHERE post_type = 'es_template'\";\n\t\t$wpdb->query( $es_post_content_query );\n\n\t\t// Updating keywords in options\n\t\t$es_admin_new_sub_content \t= get_option( 'ig_es_admin_new_sub_content', 'nodata' );\n\t\t$es_sent_report_content \t= get_option( 'ig_es_sentreport', 'nodata' );\n\t\t$es_confirm_content \t\t= get_option( 'ig_es_confirmcontent', 'nodata' );\n\t\t$es_welcome_content \t\t= get_option( 'ig_es_welcomecontent', 'nodata' );\n\t\t$es_unsub_content \t\t\t= get_option( 'ig_es_unsubcontent', 'nodata' );\n\t\t$es_cron_admin_mail \t\t= get_option( 'ig_es_cron_adminmail', 'nodata' );\n\t\t$es_optin_link \t\t\t\t= get_option( 'ig_es_optinlink', 'nodata' );\n\t\t$es_unsub_link \t\t\t\t= get_option( 'ig_es_unsublink', 'nodata' );\n\n\t\tforeach ($keywords_in_settings_to_rename as $key => $value) {\n\t\t\tif ( $es_admin_new_sub_content != 'nodata' ) {\n\t\t\t\t$es_admin_new_sub_content = str_replace( $key, $value, $es_admin_new_sub_content );\n\t\t\t\tupdate_option( 'ig_es_admin_new_sub_content', $es_admin_new_sub_content );\n\t\t\t}\n\n\t\t\tif ( $es_sent_report_content != 'nodata' ) {\n\t\t\t\t$es_sent_report_content = str_replace( $key, $value, $es_sent_report_content );\n\t\t\t\tupdate_option( 'ig_es_sentreport', $es_sent_report_content );\n\t\t\t}\n\n\t\t\tif ( $es_confirm_content != 'nodata' ) {\n\t\t\t\t$es_confirm_content = str_replace( $key, $value, $es_confirm_content );\n\t\t\t\tupdate_option( 'ig_es_confirmcontent', $es_confirm_content );\n\t\t\t}\n\n\t\t\tif ( $es_welcome_content != 'nodata' ) {\n\t\t\t\t$es_welcome_content = str_replace( $key, $value, $es_welcome_content );\n\t\t\t\tupdate_option( 'ig_es_welcomecontent', $es_welcome_content );\n\t\t\t}\n\n\t\t\tif ( $es_unsub_content != 'nodata' ) {\n\t\t\t\t$es_unsub_content = str_replace( $key, $value, $es_unsub_content );\n\t\t\t\tupdate_option( 'ig_es_unsubcontent', $es_unsub_content );\n\t\t\t}\n\n\t\t\tif ( $es_cron_admin_mail != 'nodata' ) {\n\t\t\t\t$es_cron_admin_mail = str_replace( $key, $value, $es_cron_admin_mail );\n\t\t\t\tupdate_option( 'ig_es_cron_adminmail', $es_cron_admin_mail );\n\t\t\t}\n\n\t\t\tif ( $es_optin_link != 'nodata' ) {\n\t\t\t\t$es_optin_link \t= str_replace( $key, $value, $es_optin_link );\n\t\t\t\tupdate_option( 'ig_es_optinlink', $es_optin_link );\n\t\t\t}\n\n\t\t\tif ( $es_unsub_link != 'nodata' ) {\n\t\t\t\t$es_unsub_link \t= str_replace( $key, $value, $es_unsub_link );\n\t\t\t\tupdate_option( 'ig_es_unsublink', $es_unsub_link );\n\t\t\t}\n\t\t}\n\n\t\tupdate_option( 'current_sa_email_subscribers_db_version', '3.4.0' );\n\n\t}", "function migrate(){\n\n create_table();\n save_migration_tables();\n\n}", "function tptn_recreate_tables() {\n\tglobal $wpdb;\n\n\t$table_name = $wpdb->base_prefix . 'top_ten';\n\t$table_name_daily = $wpdb->base_prefix . 'top_ten_daily';\n\t$table_name_temp = $table_name . '_temp';\n\t$table_name_daily_temp = $table_name_daily . '_temp';\n\n\t$wpdb->hide_errors();\n\n\t// 1. create temporary tables with the data.\n\t$wpdb->query( \"CREATE TEMPORARY TABLE {$table_name_temp} SELECT * FROM $table_name;\" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\t$wpdb->query( \"CREATE TEMPORARY TABLE {$table_name_daily_temp} SELECT * FROM $table_name_daily;\" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\n\t// 2. Drop the tables.\n\t$wpdb->query( \"DROP TABLE $table_name\" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery\n\t$wpdb->query( \"DROP TABLE $table_name_daily\" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery\n\n\t// 3. Run the activation function which will recreate the tables.\n\ttptn_single_activate();\n\n\t// 4. Reinsert the data from the temporary table.\n\t$sql = \"\n\tINSERT INTO `$table_name` (postnumber, cntaccess, blog_id) (\n\t\tSELECT\n\t\t\tpostnumber,\n\t\t\tcntaccess,\n\t\t\tblog_id\n\t\tFROM `$table_name_temp`\n\t);\n\t\";\n\n\t$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching\n\n\t$sql = \"\n\tINSERT INTO `$table_name_daily` (postnumber, cntaccess, dp_date, blog_id) (\n\t\tSELECT\n\t\t\tpostnumber,\n\t\t\tcntaccess,\n\t\t\tdp_date,\n\t\t\tblog_id\n\t\tFROM `$table_name_daily_temp`\n\t);\n\t\";\n\n\t$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching\n\n\t// 5. Drop the temporary tables.\n\t$wpdb->query( \"DROP TABLE $table_name_temp\" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery\n\t$wpdb->query( \"DROP TABLE $table_name_daily_temp\" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery\n\n\t$wpdb->show_errors();\n}", "function generateCreateTriggerSQL()\n{\n\t$updateSQL = '';\n\t$passValueSQL = '';\n\tforeach($this->ModuleFields as $vName => $value){\n if(!is_object($value)){\n print_r($this->ModuleFields);\n die(\"m. _generateCreateTrigger: Field $vName is not a valid ModuleField.\");\n } else {\n if (strtolower(get_class($value)) == 'tablefield'){\t\t\t\t\t\n if ( !empty( $value->deleteKeys ) ){\n\t\t\t\t\tforeach( $value->deleteKeys as $whereCondition ){\n\t\t\t\t\t\tlist( $whereModuleID, $whereColumn ) = preg_split( '/\\./', $whereCondition);\n\t\t\t\t\t\t$updateSQL .= \"\\t\\tUPDATE `\".$whereModuleID.\"` SET \".$whereModuleID.\"._Deleted = 1 WHERE \".$whereCondition.\" = NEW.\".$vName.\";\\n\";\t\t\t\t\t\t\n\t\t\t\t\t}\n }\n\t\t\t\tif ( !empty( $value->deleteOnIdGlobals ) ){\n\t\t\t\t\tforeach( $value->deleteOnIdGlobals as $whereModuleID ){\n\t\t\t\t\t\t$updateSQL .= \"\\t\\tUPDATE `\".$whereModuleID.\"` SET \".$whereModuleID.\"._Deleted = 1 WHERE \".$whereModuleID.\".RelatedModuleID = '\".$this->ModuleID.\"' AND \".$whereModuleID.\".RelatedRecordID = NEW.\".$vName.\";\\n\";\t\t\t\t\t\t\n\t\t\t\t\t}\n }\n\t\t\t\t if ( !empty( $value->passValueOn ) ){\n\t\t\t\t\t$passValueSQL .= \"\\tIF NEW.\".$vName.\" <> OLD.\".$vName.\" THEN\\n\";\n\t\t\t\t\tforeach( $value->passValueOn as $whereCondition ){\n\t\t\t\t\t\t//xt._TaskStatusID/_ProjectID=xt._ProjectID\n\t\t\t\t\t\tlist( $whereModuleIDColumn, $whereKeysCondition ) = preg_split( '/\\//', $whereCondition);\n\t\t\t\t\t\tlist( $whereModuleID, $whereColumn ) = preg_split( '/\\./', $whereModuleIDColumn);\t\t\t\t\t\t\n\t\t\t\t\t\t$passValueSQL .= \"\\t\\tUPDATE `\".$whereModuleID.\"` SET \".$whereModuleIDColumn.\" = NEW.\".$vName.\" WHERE NEW.\".$whereKeysCondition.\";\\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\t$passValueSQL .= \"\\tEND IF;\\n\";\n }\n }\n }\n }\n\t// No trigger condition found so return nothing\t\n\tif ( empty( $updateSQL ) AND empty( $passValueSQL ) ){ \n\t\treturn ''; \n\t};\t\n\t// Creating SQL\n\t$SQL .= \"DROP TRIGGER IF EXISTS \".$this->ModuleID.\"_afupd ;\\n\"; \n\t$SQL .= 'delimiter //'.\"\\n\";\n\t$SQL .= 'CREATE TRIGGER '.$this->ModuleID.'_afupd AFTER UPDATE ON `'.$this->ModuleID.'` FOR EACH ROW'.\"\\n\";\n\t$SQL .= 'BEGIN'.\"\\n\";\n\tif ( !empty( $updateSQL ) ){\n\t\t$SQL .= \"\\tIF NEW._Deleted = 1 AND OLD._Deleted = 0 THEN\\n\";\n//\t\t$SQL .= \"\\t\\tUPDATE cti SET cti._Deleted = 1 WHERE cti.StateID = StateID;\\n\";\n\t\t$SQL .= $updateSQL;\n\t\t$SQL .= \"\\tEND IF;\\n\";\n\t}\n\tif ( !empty( $passValueSQL ) ){\n\t\t$SQL .= $passValueSQL;\n\t}\n\t$SQL .= 'END;//'.\"\\n\";\n\t$SQL .= \"delimiter ;\\n\\n\";\n\t\n\treturn $SQL;\n}", "public function updateTables()\n {\n $prefix = $this->getPrefix();\n $charset = $this->wpdb->get_charset_collate();\n\n foreach ($this->config['tables'] as $table => $createStatement) {\n $sql = str_replace(\n ['{prefix}', '{charset}'],\n [$prefix, $charset],\n $createStatement\n );\n dbDelta($sql);\n }\n }", "public function safeUp()\n {\n $this->execute(\"\n create table region(\n code_reg integer primary key,\n name_reg text\n );\n \");\n $this->execute(\"\n create table school(\n id integer primary key,\n name text,\n boss text,\n code_reg integer,\n phone text\n );\n \");\n $this->createIndex('school_fk_reg', 'school', 'code_reg');\n }", "public function postRenameTable(DbalSchema $dbal_schema, string $drupal_table_name, string $drupal_new_table_name): void;", "function fatherly_create_generator_tables()\n{\n global $wpdb;\n $charset_collate = $wpdb->get_charset_collate();\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\n // Create table to store names of the generators and have an id associated with it\n $generator = $wpdb->prefix . 'generator';\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$generator'\") != $generator) {\n $sql = \"CREATE TABLE `$generator` (\n `post_id` BIGINT(20) NOT NULL,\n `generator_name` text NOT NULL,\n PRIMARY KEY(`post_id`)\n ) $charset_collate;\";\n dbDelta($sql);\n }\n // Create table with generator output that references the key from the first table\n $generation = $wpdb->prefix . 'generation';\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$generation'\") != $generation) {\n $sql2 = \"CREATE TABLE `$generation` (\n `id` BIGINT(20) NOT NULL AUTO_INCREMENT,\n `generator_post_id` BIGINT(20),\n `generation` text NOT NULL,\n PRIMARY KEY(`id`),\n FOREIGN KEY(`generator_post_id`) REFERENCES `$generator`(`post_id`)\n ) $charset_collate;\";\n dbDelta($sql2);\n }\n}", "private function _alter() {\n\t\t$queries = array();\n\t\t\n\t\t$queries[] = ('BEGIN TRANSACTION');\n\t\t$q = \"SELECT * FROM _ssm_backup\";\n\t\t$r = @sqlite_query($q, $this->_connection);\n\t\t\n\t\tif(!sqlite_last_error($this->_connection)) {\n\t\t\tsqlite_query(\"DROP TABLE _ssm_backup\", $this->_connection);\n\t\t}\n\t\t\n\t\t$export = new export('sql');\n\t\t\n\t\t@sqlite_query(\"CREATE TABLE _ssm_backup AS SELECT * FROM {$this->_name}\", $this->_connection);\n\t\t$t = new table(\"{$this->_db}:_ssm_backup\");\n\t\t\n\t\t$queries[] = \"DROP TABLE {$this->_name}\";\n\n\t\t$sql = $export->structTable($this);\n\t\t$queries[] = $sql;\n\t\t$insertQuery = $this->_alterBuildInsertQuery($t);\n\t\t$queries[] = $insertQuery;\n\t\t$queries[] = \"COMMIT TRANSACTION\";\n\t\t\n\t\t$ret = true;\n\n\t\tforeach($queries as $query) {\n\t\t\t@sqlite_query($query, $this->_connection);\n\t\t\tif(@sqlite_last_error($this->_connection)) {\n\t\t\t\t$ret = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t@sqlite_query(\"DROP TABLE _ssm_backup\", $this->_connection);\n\t\treturn $ret;\n\t}", "private function createNewMigration() {\n // $this->MigrationFieldCollection[$this->getModel()->getShortModelName()];\n $changes = []; //these fields are added or updated if the fieldnames is not in this array delete it.\n foreach ($this->getModel()->getFieldCollection() as $fieldName => $field) {\n //var_dump($this->checkFieldProperties($field)); --mark if the fieldsproperties are default or not\n $this->checkFieldProperties($field);\n var_dump($field);\n\n if (!empty($this->MigrationFieldCollection[$this->getModel()->getShortModelName()][$fieldName])) {\n $reflection = new \\ReflectionObject($field);\n $changes = [];\n $this->checkFieldProperties($field);\n\n foreach ($reflection->getProperties() as $fieldValues) {\n\n }\n //we want to update this field\n } else {\n\n //copy this field since we create\n }\n }\n foreach ($this->MigrationFieldCollection[$this->getModel()->getShortModelName()] as $migrationFieldName => $migrationField) {\n if (!in_array($migrationFieldName, $changes)) {\n $this->newMigrationLines[] = $this->modelFieldToMigrationString($migrationField['dataStructure'], 'delete');\n }\n }\n }", "function call_logs_migration_tables_to_replace_old_links($tables)\n{\n $tables[] = [\n 'table' => db_prefix() . 'call_logs',\n 'field' => 'description',\n ];\n\n return $tables;\n}", "public function truncateTables()\n {\n $tables = [\n 'properties',\n 'users',\n ];\n\n DB::unprepared('TRUNCATE TABLE ' . implode(',', $tables) . ' RESTART IDENTITY CASCADE');\n }", "public function reloadTableNames() {\n\t\t$this->_loadTableNames();\n\t}", "public static function on_activate() {\n self::create_tables();\n }", "private function computeScheduleInsertsChangeSets()\n {\n foreach ($this->entityInsertions as $entity) {\n $class = $this->manager->getClassMetadata(get_class($entity));\n $this->computeChangeSet($class, $entity);\n }\n }", "function migrate()\n {\n if (!$this->object->_columns) {\n throw new E_ColumnsNotDefinedException(\"Columns not defined for {$this->get_table_name()}\");\n }\n $added = FALSE;\n $removed = FALSE;\n // Add any missing columns\n foreach ($this->object->_columns as $key => $properties) {\n if (!in_array($key, $this->object->_table_columns)) {\n if ($this->object->_add_column($key, $properties['type'], $properties['default_value'])) {\n $added = TRUE;\n }\n }\n }\n // Remove any columns not defined\n //\t\tforeach ($this->object->_table_columns as $key) {\n //\t\t\tif (!isset($this->object->_columns[$key])) {\n //\t\t\t\t$this->object->_remove_column($key);\n // $removed = TRUE;\n //\t\t\t}\n //\t\t}\n if ($added or $removed) {\n // var_dump($this->object->_table_columns);\n $this->object->lookup_columns();\n // var_dump($added, $removed);\n }\n }", "public static function update_schema(): void {\n\t\tglobal $wpdb;\n\n\t\t$table_name = static::table_name();\n\t\t$table_fields = static::FIELDS;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t\t$table_fields\n\t\t\tPRIMARY KEY (id)\n\t\t) $charset_collate;\";\n\n\t\tif ( md5( $sql ) === get_option( static::TABLE . '_schemaver', '' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( static::TABLE . '_schemaver', md5( $sql ) );\n\t}", "private function schema2()\n {\n $sql = \"ALTER TABLE teams CHANGE deletable_xp deletable_xp TINYINT(1) NOT NULL DEFAULT '1'\";\n if (!$this->pdo->q($sql)) {\n throw new Exception('Problem updating!');\n }\n }", "public function testPatchAlreadyApplied() {\n $sink = new Sink;\n $sink->table('ut_pop');\n $sink->initialize();\n\n DB::insert('db_deltas', array('file'))\n ->values(\n array('01-ut_pop-add_column'),\n array('02-ut_pop-add_column')\n )->execute();\n $sink->patch($available, $applied);\n\n $this->assertArrayHasKey('ut_pop', $available);\n $this->assertEquals(2, count($available['ut_pop']));\n\n $this->assertEquals(0, count($applied));\n }", "protected function migrateLegacyImportRecords() {}", "private function prepare_create_table($create_table_statement, $import_table_prefix, $supported_engines, $supported_charsets, $supported_collations) {\n\n\t\tglobal $updraftplus, $wpdb;\n\n\t\t$updraft_restorer_collate = isset($this->restore_options['updraft_restorer_collate']) ? $this->restore_options['updraft_restorer_collate'] : '';\n\n\t\t$non_wp_table = false;\n\n\t\t// Legacy, less reliable - in case it was not caught before. We added it in here (CREATE) as well as in DROP because of SQL dumps which lack DROP statements.\n\t\tif (null === $this->old_table_prefix && preg_match('/^([a-z0-9]+)_.*$/i', $this->table_name, $tmatches)) {\n\t\t\t$this->old_table_prefix = $tmatches[1].'_';\n\t\t\t$updraftplus->log(__('Old table prefix:', 'updraftplus').' '.$this->old_table_prefix, 'notice-restore', 'old-table-prefix');\n\t\t\t$updraftplus->log(\"Old table prefix (detected from creating first table): \".$this->old_table_prefix);\n\t\t}\n\n\t\t// MySQL 4.1 outputs TYPE=, but accepts ENGINE=; 5.1 onwards accept *only* ENGINE=\n\t\t$create_table_statement = UpdraftPlus_Manipulation_Functions::str_lreplace('TYPE=', 'ENGINE=', $create_table_statement);\n\n\t\tif ('' === $this->old_table_prefix) {\n\t\t\t$this->new_table_name = $import_table_prefix.$this->table_name;\n\t\t} else {\n\t\t\t$this->new_table_name = $this->old_table_prefix ? UpdraftPlus_Manipulation_Functions::str_replace_once($this->old_table_prefix, $import_table_prefix, $this->table_name) : $this->table_name;\n\t\t\t// if we have a different prefix but the table name has not changed after the replace then we are dealing with a table that does not use the WordPress table prefix, in order for an Atmoic restore to work on this table we need to attach our temporary prefix\n\t\t\tif (!$this->rename_forbidden && $this->old_table_prefix && $this->new_table_name == $this->table_name) {\n\t\t\t\t$non_wp_table = true;\n\t\t\t\t$this->new_table_name = $import_table_prefix.$this->table_name;\n\t\t\t}\n\t\t}\n\n\t\t// This CREATE TABLE command may be the de-facto mark for the end of processing a previous table (which is so if this is not the first table in the SQL dump)\n\t\tif ($this->restoring_table) {\n\n\t\t\t// Attempt to reconnect if the DB connection dropped (may not succeed, of course - but that will soon become evident)\n\t\t\t$updraftplus->check_db_connection($this->wpdb_obj);\n\n\t\t\t// After restoring the options table, we can set old_siteurl if on legacy (i.e. not already set)\n\t\t\tif ($this->restoring_table == $import_table_prefix.'options') {\n\t\t\t\tif ('' == $this->old_siteurl || '' == $this->old_home || '' == $this->old_content) {\n\t\t\t\t\tglobal $updraftplus_addons_migrator;\n\t\t\t\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) switch_to_blog($updraftplus_addons_migrator->new_blogid);\n\n\t\t\t\t\tif ('' == $this->old_siteurl) {\n\t\t\t\t\t\t$this->old_siteurl = untrailingslashit($wpdb->get_row(\"SELECT option_value FROM \".$import_table_prefix.'options'.\" WHERE option_name='siteurl'\")->option_value);\n\t\t\t\t\t\tdo_action('updraftplus_restore_db_record_old_siteurl', $this->old_siteurl);\n\t\t\t\t\t}\n\t\t\t\t\tif ('' == $this->old_home) {\n\t\t\t\t\t\t$this->old_home = untrailingslashit($wpdb->get_row(\"SELECT option_value FROM \".$import_table_prefix.'options'.\" WHERE option_name='home'\")->option_value);\n\t\t\t\t\t\tdo_action('updraftplus_restore_db_record_old_home', $this->old_home);\n\t\t\t\t\t}\n\t\t\t\t\tif ('' == $this->old_content) {\n\t\t\t\t\t\t$this->old_content = $this->old_siteurl.'/wp-content';\n\t\t\t\t\t\tdo_action('updraftplus_restore_db_record_old_content', $this->old_content);\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) restore_current_blog();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this->restoring_table != $this->new_table_name) {\n\t\t\t\t$final_table_name = $this->maybe_rename_restored_table();\n\t\t\t\t$this->restored_table($final_table_name, $this->final_import_table_prefix, $this->old_table_prefix, $this->table_engine);\n\t\t\t}\n\n\t\t}\n\n\t\t// Detect this as early as possible so we can turn off atomic restores if needed. If the table prefix has changed and key constraints are found, make sure they are updated\n\t\t$constraint_change_message = '';\n\t\t$constraints = array();\n\t\t$constraint_found = false;\n\t\tif (preg_match_all('/CONSTRAINT ([\\a-zA-Z0-9_\\']+) FOREIGN KEY \\([a-zA-z0-9_\\', ]+\\) REFERENCES \\'?([a-zA-z0-9_]+)\\'? /i', $create_table_statement, $constraint_matches)) {\n\t\t\t$constraints = $constraint_matches;\n\t\t\t$constraint_found = true;\n\t\t} elseif (preg_match_all('/ FOREIGN KEY \\([a-zA-z0-9_\\', ]+\\) REFERENCES \\'?([a-zA-z0-9_]+)\\'? /i', $create_table_statement, $constraint_matches)) {\n\t\t\t$constraints = $constraint_matches;\n\t\t\t$constraint_found = true;\n\t\t}\n\n\t\t// Constraints were found so we need to disable the atomic restore for this table, which means resetting the import table prefix and current table name and finally dropping the original table if it exists\n\t\tif ($constraint_found && !$this->rename_forbidden && !$this->is_dummy_db_restore) {\n\t\t\t\n\t\t\t$import_table_prefix = $this->final_import_table_prefix;\n\t\t\t$this->disable_atomic_on_current_table = true;\n\t\t\t\n\t\t\tif ('' === $this->old_table_prefix) {\n\t\t\t\t$this->new_table_name = $import_table_prefix.$this->table_name;\n\t\t\t} else {\n\t\t\t\t$this->new_table_name = $this->old_table_prefix ? UpdraftPlus_Manipulation_Functions::str_replace_once($this->old_table_prefix, $import_table_prefix, $this->table_name) : $this->table_name;\n\t\t\t}\n\n\t\t\t$updraftplus->log('Constraints found, will disable atomic restore for current table ('.$this->table_name.')', 'notice-restore');\n\n\t\t\t$this->drop_tables(array($this->new_table_name));\n\n\t\t}\n\n\t\t$this->table_engine = \"(?)\";\n\t\t$engine_change_message = '';\n\t\tif (preg_match('/ENGINE=([^\\s;]+)/', $create_table_statement, $eng_match)) {\n\t\t\t$this->table_engine = $eng_match[1];\n\t\t\tif (isset($supported_engines[strtolower($this->table_engine)])) {\n\t\t\t\tif ('myisam' == strtolower($this->table_engine)) {\n\t\t\t\t\t$create_table_statement = preg_replace('/PAGE_CHECKSUM=\\d\\s?/', '', $create_table_statement, 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$engine_change_message = sprintf(__('Requested table engine (%s) is not present - changing to MyISAM.', 'updraftplus'), $this->table_engine).\"<br>\";\n\t\t\t\t$create_table_statement = UpdraftPlus_Manipulation_Functions::str_lreplace(\"ENGINE=$this->table_engine\", \"ENGINE=MyISAM\", $create_table_statement);\n\t\t\t\t$this->table_engine = \"MyISAM\";\n\t\t\t\t// Remove (M)aria options\n\t\t\t\tif ('maria' == strtolower($this->table_engine) || 'aria' == strtolower($this->table_engine) || 'myisam' == strtolower($this->table_engine)) {\n\t\t\t\t\t$create_table_statement = preg_replace('/PAGE_CHECKSUM=\\d\\s?/', '', $create_table_statement, 1);\n\t\t\t\t\t$create_table_statement = preg_replace('/TRANSACTIONAL=\\d\\s?/', '', $create_table_statement, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$charset_change_message = '';\n\t\tif (preg_match('/ CHARSET=([^\\s;]+)/i', $create_table_statement, $charset_match)) {\n\t\t\t$charset = $charset_match[1];\n\t\t\tif (!isset($supported_charsets[strtolower($charset)])) {\n\t\t\t\t$charset_change_message = sprintf(__('Requested table character set (%s) is not present - changing to %s.', 'updraftplus'), esc_html($charset), esc_html($this->restore_options['updraft_restorer_charset']));\n\t\t\t\t$create_table_statement = UpdraftPlus_Manipulation_Functions::str_lreplace(\"CHARSET=$charset\", \"CHARSET=\".$this->restore_options['updraft_restorer_charset'], $create_table_statement);\n\t\t\t\t// Allow default COLLLATE to database\n\t\t\t\tif (preg_match('/ COLLATE=([^\\s;]+)/i', $create_table_statement, $collate_match)) {\n\t\t\t\t\t$collate = $collate_match[1];\n\t\t\t\t\t$create_table_statement = UpdraftPlus_Manipulation_Functions::str_lreplace(\" COLLATE=$collate\", \"\", $create_table_statement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($constraints) && $this->old_table_prefix != $this->final_import_table_prefix) {\n\t\t\tforeach ($constraints[0] as $constraint) {\n\t\t\t\t$updated_constraint = str_replace($this->old_table_prefix, $this->final_import_table_prefix, $constraint);\n\t\t\t\t$create_table_statement = str_replace($constraint, $updated_constraint, $create_table_statement);\n\t\t\t}\n\t\t\t$constraint_change_message = __('Found and replaced existing table foreign key constraints as the table prefix has changed.', 'updraftplus');\n\t\t}\n\n\t\t$collate_change_message = '';\n\t\t$unsupported_collates_in_sql_line = array();\n\t\tif (!empty($updraft_restorer_collate) && preg_match('/ COLLATE=([a-zA-Z0-9._-]+)/i', $create_table_statement, $collate_match)) {\n\t\t\t$collate = $collate_match[1];\n\t\t\tif (!isset($supported_collations[strtolower($collate)])) {\n\t\t\t\t$unsupported_collates_in_sql_line[] = $collate;\n\t\t\t\tif ('choose_a_default_for_each_table' == $updraft_restorer_collate) {\n\t\t\t\t\t$create_table_statement = UpdraftPlus_Manipulation_Functions::str_lreplace(\"COLLATE=$collate\", \"\", $create_table_statement, false);\n\t\t\t\t} else {\n\t\t\t\t\t$create_table_statement = UpdraftPlus_Manipulation_Functions::str_lreplace(\"COLLATE=$collate\", \"COLLATE=\".$updraft_restorer_collate, $create_table_statement, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!empty($updraft_restorer_collate) && preg_match_all('/ COLLATE ([a-zA-Z0-9._-]+) /i', $create_table_statement, $collate_matches)) {\n\t\t\t$collates = array_unique($collate_matches[1]);\n\t\t\tforeach ($collates as $collate) {\n\t\t\t\tif (!isset($supported_collations[strtolower($collate)])) {\n\t\t\t\t\t$unsupported_collates_in_sql_line[] = $collate;\n\t\t\t\t\tif ('choose_a_default_for_each_table' == $updraft_restorer_collate) {\n\t\t\t\t\t\t$create_table_statement = str_ireplace(\"COLLATE $collate \", \"\", $create_table_statement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$create_table_statement = str_ireplace(\"COLLATE $collate \", \"COLLATE \".$updraft_restorer_collate.\" \", $create_table_statement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!empty($updraft_restorer_collate) && preg_match_all('/ COLLATE ([a-zA-Z0-9._-]+),/i', $create_table_statement, $collate_matches)) {\n\t\t\t$collates = array_unique($collate_matches[1]);\n\t\t\tforeach ($collates as $collate) {\n\t\t\t\tif (!isset($supported_collations[strtolower($collate)])) {\n\t\t\t\t\t$unsupported_collates_in_sql_line[] = $collate;\n\t\t\t\t\tif ('choose_a_default_for_each_table' == $updraft_restorer_collate) {\n\t\t\t\t\t\t$create_table_statement = str_ireplace(\"COLLATE $collate,\", \",\", $create_table_statement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$create_table_statement = str_ireplace(\"COLLATE $collate,\", \"COLLATE \".$updraft_restorer_collate.\",\", $create_table_statement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (count($unsupported_collates_in_sql_line) > 0) {\n\t\t\t$unsupported_unique_collates_in_sql_line = array_unique($unsupported_collates_in_sql_line);\n\t\t\t$collate_change_message = sprintf(_n('Requested table collation (%1$s) is not present - changing to %2$s.', 'Requested table collations (%1$s) are not present - changing to %2$s.', count($unsupported_unique_collates_in_sql_line), 'updraftplus'), esc_html(implode(', ', $unsupported_unique_collates_in_sql_line)), esc_html($this->restore_options['updraft_restorer_collate']));\n\t\t}\n\t\t$print_line = sprintf(__('Processing table (%s)', 'updraftplus'), $this->table_engine).\": \".$this->table_name;\n\t\t$logline = \"Processing table ($this->table_engine): \".$this->table_name;\n\t\tif (null !== $this->old_table_prefix && $import_table_prefix != $this->old_table_prefix) {\n\t\t\tif ($this->restore_this_table($this->table_name)) {\n\t\t\t\t$print_line .= ' - '.__('will restore as:', 'updraftplus').' '.htmlspecialchars($this->new_table_name);\n\t\t\t\t$logline .= \" - will restore as: \".$this->new_table_name;\n\t\t\t} else {\n\t\t\t\t$logline .= ' - skipping';\n\t\t\t}\n\t\t\tif ('' === $this->old_table_prefix || $non_wp_table) {\n\t\t\t\t$create_table_statement = UpdraftPlus_Manipulation_Functions::str_replace_once($this->table_name, $this->new_table_name, $create_table_statement);\n\t\t\t} else {\n\t\t\t\t$create_table_statement = UpdraftPlus_Manipulation_Functions::str_replace_once($this->old_table_prefix, $import_table_prefix, $create_table_statement);\n\t\t\t}\n\n\t\t\t$this->restored_table_names[] = $this->new_table_name;\n\t\t}\n\n\t\tif (!empty($this->generated_columns[$this->table_name]) && isset($this->generated_columns[$this->table_name]['columns'])) {\n\n\t\t\t// get all the keys definition in the create table statement if any.\n\t\t\t// preg_match_all('/\\s*[^,]+?key\\s*[^(]+\\(\\s*(`.+?(?:\\)|`))\\s*\\),?/i', $create_table_statement, $key_definitions);\n\t\t\t// https://regex101.com/r/NEXaLy/1/\n\t\t\tpreg_match_all('/(?<![\\S\"\\',])[^\"\\',]+?KEY\\s*[^(]+\\(\\s*(`.+?(?:\\)|`))\\s*\\)\\s*(?:,|\\))(?![\\S\"\\',])/i', $create_table_statement, $key_definitions);\n\n\t\t\t$reversed_generated_columns = array_reverse((array) $this->generated_columns[$this->table_name]['columns']);\n\t\t\tforeach ((array) $reversed_generated_columns as $generated_column) {\n\t\t\t\tif (empty($generated_column)) continue;\n\t\t\t\tif (!isset($this->supported_generated_column_engines[strtolower($this->table_engine)])) $this->supported_generated_column_engines[strtolower($this->table_engine)] = UpdraftPlus_Database_Utility::is_generated_column_supported($this->table_engine);\n\t\t\t\tif ($generated_column_db_info = $this->supported_generated_column_engines[strtolower($this->table_engine)]) {\n\n\t\t\t\t\t$reversed_data_type_definition = array_reverse((array) $generated_column['column_data_type_definition']);\n\t\t\t\t\tforeach ($reversed_data_type_definition as $key => &$data_type_definition) {\n\t\t\t\t\t\tif (in_array($key, array('DATA_TYPE_TOKEN', 'GENERATED_ALWAYS_TOKEN', 'COMMENT_TOKEN'))) continue; // we dont want to replace \"not null\" in the \"generated always as\" expression, neither in the comments' string as well, so we continue\n\t\t\t\t\t\tif (empty($data_type_definition) || 0 === strlen(trim($data_type_definition[0]))) continue;\n\t\t\t\t\t\tif (!$generated_column_db_info['is_not_null_supported']) {\n\t\t\t\t\t\t\t// If the database server doesn't support either null or not null constraint on generated virtual/stored/persistent column then the constraints need to be removed\n\t\t\t\t\t\t\t$replaced_data_type_definition = preg_replace('/\\b(?:not\\s+null|null)\\b/i', '', $data_type_definition[0]);\n\t\t\t\t\t\t\t$create_table_statement = substr_replace($create_table_statement, $replaced_data_type_definition, $data_type_definition[1], strlen($data_type_definition[0]));\n\t\t\t\t\t\t\t$data_type_definition[0] = $replaced_data_type_definition;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$generated_column['is_virtual'] && !$generated_column_db_info['is_persistent_supported']) {\n\t\t\t\t\t\t\t// If the persistent type is not supported it likely means that the currently running db server is MySQL, Mariadb uses persistent as an alias for stored type so if the backup file is taken from MariaDB then it needs to be changed to stored\n\t\t\t\t\t\t\t$replaced_data_type_definition = preg_replace('/\\bpersistent\\b/i', 'STORED', $data_type_definition[0]);\n\t\t\t\t\t\t\t$create_table_statement = substr_replace($create_table_statement, $replaced_data_type_definition, $data_type_definition[1], strlen($data_type_definition[0]));\n\t\t\t\t\t\t\t$data_type_definition[0] = $replaced_data_type_definition;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($generated_column['is_virtual'] && ($generated_column_db_info['can_insert_ignore_to_generated_column'] || (isset($this->generated_columns_exist_in_the_statement[$this->table_name]) && false === $this->generated_columns_exist_in_the_statement[$this->table_name])) && !$generated_column_db_info['is_virtual_index_supported'] && !empty($key_definitions)) {\n\t\t\t\t\t\t// MySQL doesn't support index on MyISAM's virtual generated column, in case that the restoration process is importing from MariaDB backup file which contains create index definition on virtual generated column then it needs to be removed too\n\t\t\t\t\t\t// the column can be defined as a single or composite index, so we have no choice but loop until the end\n\t\t\t\t\t\tforeach ($key_definitions[1] as $array_index => $column_names) {\n\t\t\t\t\t\t\tif (empty($column_names)) continue;\n\t\t\t\t\t\t\tif (empty($key_definitions[0][$array_index])) continue;\n\t\t\t\t\t\t\tif (is_numeric(stripos($column_names, $generated_column['column_name']))) {\n\t\t\t\t\t\t\t\t$replaced_key_definition = preg_replace('/(\\s*,?[^,]+?key\\s*[^(]+\\(.*?)(`'.$generated_column['column_name'].'`\\s*(?:\\([0-9]+\\)\\s*)?,|,\\s*`'.$generated_column['column_name'].'`\\s*(?:\\([0-9]+\\)\\s*)?|\\s*`'.$generated_column['column_name'].'`\\s*(?:\\([0-9]+\\)\\s*)?)(.*\\))/ism', '$1$3', $key_definitions[0][$array_index]);\n\t\t\t\t\t\t\t\t$create_table_statement = str_ireplace($key_definitions[0][$array_index], $replaced_key_definition, $create_table_statement);\n\t\t\t\t\t\t\t\t$key_definitions[0][$array_index] = $replaced_key_definition;\n\t\t\t\t\t\t\t\tif (preg_match('/\\s*,?[^,]+?key\\s*[^(]+\\(\\s*\\)\\s*,?/i', $key_definitions[0][$array_index])) {\n\t\t\t\t\t\t\t\t\t$create_table_statement = preg_replace('/\\s*,?[^,]+?key\\s+[^(]+\\(\\s*\\)\\s*/i', '', $create_table_statement);\n\t\t\t\t\t\t\t\t\t$key_definitions[0][$array_index] = '';\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\n\t\t\t\t\tif (!$generated_column_db_info['can_insert_ignore_to_generated_column'] && isset($this->generated_columns_exist_in_the_statement[$this->table_name]) && true === $this->generated_columns_exist_in_the_statement[$this->table_name]) {\n\t\t\t\t\t\tforeach ($reversed_data_type_definition as $key => &$data_type_definition) {\n\t\t\t\t\t\t\tif (empty($data_type_definition) || 0 === strlen(trim($data_type_definition[0]))) continue;\n\t\t\t\t\t\t\tif ('GENERATED_ALWAYS_TOKEN' === $key) {\n\t\t\t\t\t\t\t\t// if it's not possible to use insert ignore for the generated column even if the sql strict mode has been turned off then first we need to change the generated column to a normal/standard column\n\t\t\t\t\t\t\t\t$create_table_statement = substr_replace($create_table_statement, '', $data_type_definition[1], strlen($data_type_definition[0]));\n\t\t\t\t\t\t\t\t$data_type_definition[0] = '';\n\t\t\t\t\t\t\t} elseif (!in_array($key, array('DATA_TYPE_TOKEN', 'COMMENT_TOKEN'))) {\n\t\t\t\t\t\t\t\t// since \"comments\" and \"generated always as\" could contain a string of these keywords (virtual/stored/persistent), so we can't use preg_replace and $generated_column['column_definition'] var as the subject to replace the keyword to an empty string, but instead we lookup the keyword through column_data_type_definition that has captured data type definitions\n\t\t\t\t\t\t\t\t$replaced_data_type_definition = preg_replace('/\\b(?:virtual|stored|persistent)\\b/i', '', $data_type_definition[0]);\n\t\t\t\t\t\t\t\t$create_table_statement = substr_replace($create_table_statement, $replaced_data_type_definition, $data_type_definition[1], strlen($data_type_definition[0]));\n\t\t\t\t\t\t\t\t$data_type_definition[0] = $replaced_data_type_definition;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// once the create table and also the insert ignore statement for the corresponding table have been executed, we will use alter table statement to change back the columns to STORED type\n\t\t\t\t\t\t// this is the only way to avoid \"value specified for generated column is not allowed\" error, and I think it is the best we can do for now rather than checking the insert statement for virtual columns and replacing the value with DEFAULT\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// generated column is not supported but we found a virtual/stored/persistent column type, so it needs to be changed to a normal/standard column\n\t\t\t\t\t// we need to keep the generated column along with its single key index and composite key index so that the select statement on the upper layer of the application which selects the the virtual column does not break the application itself due to unknown column error\n\t\t\t\t\t$reversed_data_type_definition = array_reverse((array) $generated_column['column_data_type_definition']);\n\t\t\t\t\tforeach ($reversed_data_type_definition as $key => &$data_type_definition) {\n\t\t\t\t\t\tif (empty($data_type_definition) || 0 === strlen(trim($data_type_definition[0]))) continue;\n\t\t\t\t\t\tif ('GENERATED_ALWAYS_TOKEN' === $key) {\n\t\t\t\t\t\t\t$create_table_statement = substr_replace($create_table_statement, '', $data_type_definition[1], strlen($data_type_definition[0]));\n\t\t\t\t\t\t\t$data_type_definition[0] = '';\n\t\t\t\t\t\t} elseif (!in_array($key, array('DATA_TYPE_TOKEN', 'COMMENT_TOKEN'))) {\n\t\t\t\t\t\t\t$replaced_data_type_definition = preg_replace('/\\b(?:virtual|stored|persistent)\\b/i', '', $data_type_definition[0]);\n\t\t\t\t\t\t\t$create_table_statement = substr_replace($create_table_statement, $replaced_data_type_definition, $data_type_definition[1], strlen($data_type_definition[0]));\n\t\t\t\t\t\t\t$data_type_definition[0] = $replaced_data_type_definition;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$updraftplus->log($logline);\n\t\t$updraftplus->log($print_line, 'notice-restore');\n\t\t// If this is a non wp table we don't want to replace our temp prefix with the final prefix, we need to drop our prefix\n\t\tif ($non_wp_table) {\n\t\t\t$this->original_table_name = UpdraftPlus_Manipulation_Functions::str_replace_once($this->import_table_prefix, '', $this->new_table_name);\n\t\t} else {\n\t\t\t$this->original_table_name = UpdraftPlus_Manipulation_Functions::str_replace_once($this->import_table_prefix, $this->final_import_table_prefix, $this->new_table_name);\n\t\t}\n\t\t$this->restoring_table = $this->new_table_name;\n\t\tif ($charset_change_message) $updraftplus->log($charset_change_message, 'notice-restore');\n\t\tif ($constraint_change_message) $updraftplus->log($constraint_change_message, 'notice-restore');\n\t\tif ($collate_change_message) $updraftplus->log($collate_change_message, 'notice-restore');\n\t\tif ($engine_change_message) $updraftplus->log($engine_change_message, 'notice-restore');\n\t\treturn $create_table_statement;\n\t}", "public function reloadSchema()\n {\n $em = $this->getEntityManager();\n $tool = new SchemaTool($em);\n $tool->dropSchema($em->getMetadataFactory()->getAllMetadata());\n $tool->createSchema($em->getMetadataFactory()->getAllMetadata());\n $this->schemaReloaded = true;\n }", "public function testEverythingIsNotChanged()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n 'datasource_name' => 'datasource_name', // not change\n 'table_id' => 1, // not change\n 'starting_row_number' => 2, // not change\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data of 'datasource' table\n $this->assertEquals($updatePostData['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($updatePostData['table_id'], $updatedTable->table_id);\n $this->assertEquals($updatePostData['starting_row_number'], $updatedTable->starting_row_number);\n $this->assertTrue($updatedTable->created_at != null);\n $this->assertTrue($updatedTable->updated_at != null);\n $this->assertTrue($updatedTable->created_by == null);\n $this->assertTrue($updatedTable->updated_by == null);\n\n //Check response\n $updateResponse\n ->assertStatus(200)\n ->assertJsonFragment([\n 'id' => $updatedTable->id,\n 'datasource_name' => $updatePostData['datasource_name'],\n 'table_id' => $updatePostData['table_id'],\n 'starting_row_number' => $updatePostData['starting_row_number'],\n ]);\n }", "protected function dropSchemas()\n {\n }", "function drush_post_sql_sync_extras_post_sql_sync($source = NULL, $destination = NULL) {\n $registry_rebuild = drush_get_option('rr');\n if ($registry_rebuild) {\n drush_log(dt(\"Rebuild the registry post-sql-sync\"), 'ok');\n drush_invoke_process($destination, 'rr');\n }\n $features_revert = drush_get_option('fra');\n if ($features_revert) {\n drush_log(dt(\"Revert all features post-sql-sync\"), 'ok');\n drush_invoke_process($destination, 'fra', array(), array('yes' => TRUE));\n }\n $modules_to_enable = drush_get_option_list('enable');\n if (!empty($modules_to_enable)) {\n drush_log(dt(\"Enable !modules post-sql-sync\", array('!modules' => implode(',', $modules_to_enable))), 'ok');\n drush_invoke_process($destination, 'pm-enable', $modules_to_enable, array('yes' => TRUE));\n }\n $modules_to_disable = drush_get_option_list('disable');\n if (!empty($modules_to_disable)) {\n drush_log(dt(\"Disable !modules post-sql-sync\", array('!modules' => implode(',', $modules_to_disable))), 'ok');\n drush_invoke_process($destination, 'pm-disable', $modules_to_disable, array('yes' => TRUE));\n }\n $permissions_table = drush_get_option('permission');\n if (!empty($permissions_table)) {\n foreach ($permissions_table as $role_name => $actions) {\n if (array_key_exists('add', $actions)) {\n $permissions_to_add = is_array($actions['add']) ? $actions['add'] : explode(', ', $actions['add']);\n foreach ($permissions_to_add as $permission) {\n $values = drush_invoke_process($destination, 'role-add-perm', array($role_name, $permission), array(), array('integrate' => TRUE));\n }\n }\n if (array_key_exists('remove', $actions)) {\n $permissions_to_remove = is_array($actions['remove']) ? $actions['remove'] : explode(', ', $actions['remove']);\n foreach ($permissions_to_remove as $permission) {\n $values = drush_invoke_process($destination, 'role-remove-perm', array($role_name, $permission), array(), array('integrate' => TRUE));\n }\n }\n }\n }\n if ($registry_rebuild) {\n drush_log(dt(\"Rebuild the registry post-sql-sync\"), 'ok');\n drush_invoke_process($destination, 'rr');\n }\n}", "public function safeUp()\n {\n $this->createTable('site', array(\n 'client_id' => self::MYSQL_TYPE_UINT,\n 'domain' => 'string NOT NULL'\n ));\n\n $this->addForeignKey('site_client_id', 'site', 'client_id', 'client', 'id', 'CASCADE', 'RESTRICT');\n\n $this->createTable('site_contract', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'contract_id' => self::MYSQL_TYPE_UINT,\n ));\n\n $this->addForeignKey('site_contract_site_id', 'site_contract', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n $this->addForeignKey('site_contract_contract_id', 'site_contract', 'contract_id', 'contract', 'id', 'CASCADE', 'RESTRICT');\n }", "function upgrade_4_pgsql() { \n $table_domain = table_by_key('domain');\n $table_admin = table_by_key('admin');\n $table_alias = table_by_key('alias');\n $table_domain_admins = table_by_key('domain_admins');\n $table_log = table_by_key('log');\n $table_mailbox = table_by_key('mailbox');\n $table_vacation = table_by_key('vacation');\n $table_vacation_notification = table_by_key('vacation_notification');\n\n if(!_pgsql_field_exists($table_domain, 'quota')) {\n $result = db_query_parsed(\"ALTER TABLE $table_domain ADD COLUMN quota int NOT NULL default '0'\");\n }\n\n $result = db_query_parsed(\"ALTER TABLE $table_domain ALTER COLUMN domain DROP DEFAULT\");\n if(!_pgsql_object_exists('domain_domain_active')) {\n $result = db_query_parsed(\"CREATE INDEX domain_domain_active ON $table_domain(domain,active)\");\n }\n\n $result = db_query_parsed(\"ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT\");\n $result = db_query_parsed(\"ALTER TABLE $table_alias ALTER COLUMN address DROP DEFAULT\");\n $result = db_query_parsed(\"ALTER TABLE $table_alias ALTER COLUMN domain DROP DEFAULT\");\n if(!_pgsql_object_exists('alias_address_active')) {\n $result = db_query_parsed(\"CREATE INDEX alias_address_active ON $table_alias(address,active)\");\n }\n\n $result = db_query_parsed(\"ALTER TABLE $table_domain_admins ALTER COLUMN username DROP DEFAULT\");\n $result = db_query_parsed(\"ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT\");\n\n $result = db_query_parsed(\"\n BEGIN;\n ALTER TABLE $table_log RENAME COLUMN data TO data_old;\n ALTER TABLE $table_log ADD COLUMN data text NOT NULL default '';\n UPDATE $table_log SET data = CAST(data_old AS text);\n ALTER TABLE $table_log DROP COLUMN data_old;\n COMMIT;\");\n\n $result = db_query_parsed(\"ALTER TABLE $table_mailbox ALTER COLUMN username DROP DEFAULT\");\n $result = db_query_parsed(\"ALTER TABLE $table_mailbox ALTER COLUMN domain DROP DEFAULT\");\n\n $result = db_query_parsed(\"\n BEGIN;\n ALTER TABLE $table_mailbox RENAME COLUMN domain TO domain_old;\n ALTER TABLE $table_mailbox ADD COLUMN domain varchar(255) REFERENCES $table_domain (domain);\n UPDATE $table_mailbox SET domain = domain_old;\n ALTER TABLE $table_mailbox DROP COLUMN domain_old;\n COMMIT;\"\n );\n if(!_pgsql_object_exists('mailbox_username_active')) {\n db_query_parsed(\"CREATE INDEX mailbox_username_active ON $table_mailbox(username,active)\");\n }\n\n\n $result = db_query_parsed(\"ALTER TABLE $table_vacation ALTER COLUMN body SET DEFAULT ''\");\n if(_pgsql_field_exists($table_vacation, 'cache')) {\n $result = db_query_parsed(\"ALTER TABLE $table_vacation DROP COLUMN cache\");\n }\n\n $result = db_query_parsed(\"\n BEGIN;\n ALTER TABLE $table_vacation RENAME COLUMN domain to domain_old;\n ALTER TABLE $table_vacation ADD COLUMN domain varchar(255) REFERENCES $table_domain;\n UPDATE $table_vacation SET domain = domain_old;\n ALTER TABLE $table_vacation DROP COLUMN domain_old;\n COMMIT;\n \");\n\n if(!_pgsql_object_exists('vacation_email_active')) {\n $result = db_query_parsed(\"CREATE INDEX vacation_email_active ON $table_vacation(email,active)\");\n }\n\n if(!_pgsql_object_exists($table_vacation_notification)) {\n $result = db_query_parsed(\"\n CREATE TABLE $table_vacation_notification (\n on_vacation character varying(255) NOT NULL REFERENCES $table_vacation(email) ON DELETE CASCADE,\n notified character varying(255) NOT NULL,\n notified_at timestamp with time zone NOT NULL DEFAULT now(),\n CONSTRAINT vacation_notification_pkey primary key(on_vacation,notified));\");\n }\n}", "public function triggers($table, $like = '') {\n\t\t$builder = DB_SQL::select($this->data_source)\n\t\t\t->column('[t4].[NAME]', 'schema')\n\t\t\t->column('[t1].[NAME]', 'table')\n\t\t\t->column('[t0].[NAME]', 'trigger')\n\t\t\t->column(DB_SQL::expr(\"CASE WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsInsertTrigger') = 1 THEN 'INSERT' WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsUpdateTrigger') = 1 THEN 'UPDATE' WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsDeleteTrigger') = 1 THEN 'DELETE' END\"), 'event')\n\t\t\t->column(DB_SQL::expr(\"CASE WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsInsteadOfTrigger') = 1 THEN 'INSTEAD OF' ELSE 'AFTER' END\"), 'timing')\n\t\t\t->column(DB_SQL::expr(\"'ROW'\"), 'per')\n\t\t\t->column('[t2].[TEXT]', 'action')\n\t\t\t->column(DB_SQL::expr('0'), 'seq_index')\n\t\t\t->column(DB_SQL::expr('NULL'), 'created')\n\t\t\t->from('[SYSOBJECTS]', '[t0]')\n\t\t\t->join(NULL, '[SYSOBJECTS]', '[t1]')\n\t\t\t->on('[t1].[ID]', DB_SQL_Operator::_EQUAL_TO_, '[t0].[PARENT_OBJ]')\n\t\t\t->join(NULL, '[SYSCOMMENTS]', '[t2]')\n\t\t\t->on('[t2].[ID]', DB_SQL_Operator::_EQUAL_TO_, '[t0].[ID]')\n\t\t\t->join(DB_SQL_JoinType::_LEFT_, '[SYS].[TABLES]', '[t3]')\n\t\t\t->on('[t3].[OBJECT_ID]', DB_SQL_Operator::_EQUAL_TO_, '[t0].[PARENT_OBJ]')\n\t\t\t->join(DB_SQL_JoinType::_LEFT_, '[SYS].[SCHEMAS]', '[t4]')\n\t\t\t->on('[t4].[SCHEMA_ID]', DB_SQL_Operator::_EQUAL_TO_, '[t3].[SCHEMA_ID]')\n\t\t\t->where('[t0].[XTYPE]', DB_SQL_Operator::_EQUAL_TO_, 'TR')\n\t\t\t->where('[t1].[NAME]', DB_SQL_Operator::_EQUAL_TO_, $table)\n\t\t\t->where(DB_SQL::expr(\"CASE WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsTriggerDisabled') = 1 THEN 0 ELSE 1 END\"), DB_SQL_Operator::_EQUAL_TO_, 1)\n\t\t\t->order_by(DB_SQL::expr('UPPER([t4].[NAME])'))\n\t\t\t->order_by(DB_SQL::expr('UPPER([t1].[NAME])'))\n\t\t\t->order_by(DB_SQL::expr('UPPER([t0].[NAME])'));\n\n\t\tif ( ! empty($like)) {\n\t\t\t$builder->where('[t0].[NAME]', DB_SQL_Operator::_LIKE_, $like);\n\t\t}\n\n\t\treturn $builder->query();\n\t}", "public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }", "protected function setUpIndex()\n {\n $this->getOldTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldTable()->createColumn('bar', Type::STRING, array('length' => 50));\n\n $this->getOldTable()->createIndex(array('foo'), false, 'idx_foo');\n\n $this->createOldTable();\n }", "protected function setUpPrimaryKey()\n {\n $this->getOldTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldTable()->createColumn('bar', Type::STRING, array('length' => 50));\n\n $this->getOldTable()->createPrimaryKey(array('foo'), 'pk');\n\n $this->createOldTable();\n }", "public function triggersToFollowUp()\n {\n $relation = $this->hasMany('Acelle\\Model\\AutoTrigger');\n $relation->getQuery()->whereRaw(sprintf('id NOT IN (SELECT COALESCE(preceded_by, 0) FROM %s)', table('auto_triggers')));\n return $relation;\n }", "public function up()\n {\n $this->table('borrow_transactions')\n ->dropForeignKey('people_id')\n ->addForeignKey('people_id', 'people', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->table('cms_usergroups')\n ->addForeignKey('created_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n\n ->addForeignKey('modified_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->table('organisations')\n ->addForeignKey('created_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n\n ->addForeignKey('modified_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->execute('UPDATE cms_users p1\n left join cms_users p2 on p2.id=p1.created_by\n SET p1.created_by = NULL \n where p2.id is null');\n $this->execute('UPDATE cms_users p1\n left join cms_users p2 on p2.id=p1.modified_by\n SET p1.modified_by = NULL \n where p2.id is null');\n\n $this->table('cms_users')\n ->addForeignKey('created_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n\n ->addForeignKey('modified_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->table('stock')\n ->addForeignKey('picked_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n\n ->addForeignKey('ordered_by', 'cms_users', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->execute('DELETE FROM transactions WHERE people_id NOT IN (select id from people)');\n\n $this->table('transactions')\n ->addForeignKey('people_id', 'people', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n\n $this->execute('UPDATE product_categories SET parent_id = null where parent_id = 0');\n\n $this->table('product_categories')\n ->addForeignKey('parent_id', 'product_categories', 'id', [\n 'delete' => 'RESTRICT', 'update' => 'CASCADE',\n ])\n ->save()\n ;\n }", "public function up(Schema $schema)\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() != \"mysql\", \"Migration can only be executed safely on 'mysql'.\");\n \n $this->addSql(\"CREATE TABLE system_alerts (id INT AUTO_INCREMENT NOT NULL, person_id INT DEFAULT NULL, organization_id INT DEFAULT NULL, created_by INT DEFAULT NULL, created_at DATETIME DEFAULT NULL, modified_by INT DEFAULT NULL, modified_at DATETIME DEFAULT NULL, deleted_by INT DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, title VARCHAR(200) DEFAULT NULL, description VARCHAR(5000) DEFAULT NULL, start_date DATETIME DEFAULT NULL, end_date DATETIME DEFAULT NULL, is_enabled TINYINT(1) DEFAULT NULL, INDEX IDX_E7F475AA217BBB47 (person_id), INDEX IDX_E7F475AA32C8A3DE (organization_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB\");\n $this->addSql(\"DROP TABLE organizationrole\");\n $this->addSql(\"ALTER TABLE AccessToken DROP FOREIGN KEY FK_B39617F5A76ED395\");\n $this->addSql(\"ALTER TABLE AuthCode DROP FOREIGN KEY FK_F1D7D177A76ED395\");\n $this->addSql(\"ALTER TABLE RefreshToken DROP FOREIGN KEY FK_7142379EA76ED395\");\n $this->addSql(\"ALTER TABLE person_entity DROP FOREIGN KEY FK_928D74DEA38A39E4\");\n $this->addSql(\"ALTER TABLE person_metadata DROP FOREIGN KEY FK_DB529123A38A39E4\");\n $this->addSql(\"ALTER TABLE personcontactinfo DROP FOREIGN KEY FK_2E28DAF837886FBE\");\n $this->addSql(\"ALTER TABLE organizationlang DROP FOREIGN KEY FK_76EFC27BE808A0A6\");\n\n $this->addSql(\"ALTER TABLE person CHANGE personid id INT AUTO_INCREMENT NOT NULL\");\n $this->addSql(\"ALTER TABLE AccessToken ADD CONSTRAINT FK_B39617F5A76ED395 FOREIGN KEY (user_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE AuthCode ADD CONSTRAINT FK_F1D7D177A76ED395 FOREIGN KEY (user_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE contactinfo ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n $this->addSql(\"ALTER TABLE entity ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n $this->addSql(\"ALTER TABLE organization ADD parent_organization_id INT DEFAULT NULL, ADD time_zone VARCHAR(45) DEFAULT NULL, ADD logo_file_name VARCHAR(100) DEFAULT NULL, ADD primary_color VARCHAR(45) DEFAULT NULL, ADD secondary_color VARCHAR(45) DEFAULT NULL, ADD ebi_confidentiality_statement VARCHAR(5000) DEFAULT NULL, ADD irb_confidentiality_statement VARCHAR(5000) DEFAULT NULL, DROP parentorganizationid, DROP timezone, CHANGE subdomain subdomain VARCHAR(45) DEFAULT NULL, CHANGE status status VARCHAR(1) DEFAULT NULL, CHANGE website website VARCHAR(100) DEFAULT NULL, CHANGE organizationid id INT AUTO_INCREMENT NOT NULL\");\n $this->addSql(\"ALTER TABLE organizationlang ADD CONSTRAINT FK_76EFC27BE808A0A6 FOREIGN KEY (organizationid) REFERENCES organization (id)\");\n $this->addSql(\"ALTER TABLE system_alerts ADD CONSTRAINT FK_E7F475AA217BBB47 FOREIGN KEY (person_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE system_alerts ADD CONSTRAINT FK_E7F475AA32C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (id)\");\n $this->addSql(\"ALTER TABLE person_entity ADD CONSTRAINT FK_928D74DEA38A39E4 FOREIGN KEY (Person_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE person_metadata ADD CONSTRAINT FK_DB529123A38A39E4 FOREIGN KEY (Person_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE personcontactinfo ADD CONSTRAINT FK_2E28DAF837886FBE FOREIGN KEY (personid) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE RefreshToken ADD CONSTRAINT FK_7142379EA76ED395 FOREIGN KEY (user_id) REFERENCES person (id)\");\n $this->addSql(\"ALTER TABLE role ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n $this->addSql(\"ALTER TABLE rolelang ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n $this->addSql(\"ALTER TABLE upload_file_log ADD created_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD modified_by INT DEFAULT NULL, ADD modified_at DATETIME DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL\");\n }", "public function testTableIsCreated()\n {\n $this->assertFalse($this->connection->tableExists('insight_accounts'));\n $this->insight->getTableName('accounts');\n $this->assertTrue($this->connection->tableExists('insight_accounts'));\n }", "public function migrate()\n\t{\n\t}", "public function resolveToSource() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 2) {\r\n\t\t\t$this->status = self::OUTDATED;\r\n\t\t\t$this->from = &$this->target;\r\n\t\t\t$this->to = &$this->source;\r\n\t\t\t$this->direction = 2;\r\n\t\t}\r\n\t}", "protected function createLoadTables()\n {\n // foreach table, replace it with an empty table\n $tables = $this->schema->getTables();\n foreach ($tables as $table) {\n $this->dbcon->replaceTable($table);\n\n $msg = \"Created table '\".$table->name.\"'\";\n\n // If this table uses the Lookup table, create a view\n if ($table->usesLookup === true) {\n $this->dbcon->replaceLookupView($table, $this->schema->getLookupTable());\n $msg .= '; Lookup table created';\n }\n\n $this->log($msg);\n }\n return true;\n }", "function monitor_vider_tables($nom_meta_base_version) {\n\n\tsql_drop_table('spip_monitor');\n\tsql_drop_table('spip_monitor_log');\n\tsql_drop_table('spip_monitor_stats');\n\tsql_drop_table('spip_monitor_stats_plugins');\n\tsql_drop_table('spip_monitor_evenements');\n\tsql_alter('TABLE spip_syndic DROP COLUMN date_ping');\n\tsql_alter('TABLE spip_syndic DROP COLUMN statut_log');\n\tsql_alter('TABLE spip_syndic DROP COLUMN statut_stats');\n\tsql_alter('TABLE spip_syndic DROP COLUMN monitor_evenements');\n\teffacer_meta('monitor');\n\teffacer_meta($nom_meta_base_version);\n}", "public function migrate()\n {\n $this->prepareWizardsTable();\n\n $this->processProcessing();\n $this->processLogs();\n $this->processConfigData();\n\n $this->prepareOrdersTables();\n $this->prepareOrdersConfigTable();\n $this->processOrdersData();\n }", "public function safeUp()\n\t{\n $this->dropForeignKey('client', Yii::app()->getModule('user')->tableUsersClients);\n $this->addForeignKey('client', Yii::app()->getModule('user')->tableUsersClients, 'clients_id', Yii::app()->getModule('user')->tableClients, 'id', 'SET NULL', 'SET NULL');\n\t}", "public function from($tables, $overwrite = false);", "protected function rollbackToSavePoint(): void\n {\n foreach ($this->getActiveConnections() as $connection) {\n try {\n while ($connection->isTransactionActive()) {\n $connection->rollBack();\n }\n } catch (\\Exception $e) {\n }\n }\n }", "protected function defineDatabaseMigrationsAfterDatabaseRefreshed()\n {\n // Define database migrations after database refreshed.\n }", "function revert_table() {\r\n $this->_table = $this->_table_org;\r\n $this->_table_org = NULL;\r\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function setTableBeingTransferred( $tableName, $tableFields = null );", "public function validate()\n {\n $schema = $this->getTable()->getSchema();\n\n // validate existing reference to target table\n if (!$schema->hasTable($this->getReference()))\n {\n throw new SyncerException(\"Connection reference from table {$this->tableName} to {$this->reference} not found\");\n }\n\n // validate existing connecting table\n if (!$schema->hasTable($this->getConnecting()))\n {\n throw new SyncerException(\"Connecting table {$this->getConnecting()} defined in {$this->tableName} table not found\");\n }\n }", "public function up(Schema $schema) : void\n {\n $this->addSql('DROP INDEX IDX_90651744E92F8F78');\n $this->addSql('DROP INDEX IDX_906517442ADD6D8C');\n $this->addSql('CREATE TEMPORARY TABLE __temp__invoice AS SELECT id, supplier_id, recipient_id FROM invoice');\n $this->addSql('DROP TABLE invoice');\n $this->addSql('CREATE TABLE invoice (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, supplier_id INTEGER NOT NULL, recipient_id INTEGER NOT NULL, CONSTRAINT FK_906517442ADD6D8C FOREIGN KEY (supplier_id) REFERENCES supplier (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_90651744E92F8F78 FOREIGN KEY (recipient_id) REFERENCES recipient (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');\n $this->addSql('INSERT INTO invoice (id, supplier_id, recipient_id) SELECT id, supplier_id, recipient_id FROM __temp__invoice');\n $this->addSql('DROP TABLE __temp__invoice');\n $this->addSql('CREATE INDEX IDX_90651744E92F8F78 ON invoice (recipient_id)');\n $this->addSql('CREATE INDEX IDX_906517442ADD6D8C ON invoice (supplier_id)');\n $this->addSql('DROP INDEX IDX_5904BEADDD842E46');\n $this->addSql('DROP INDEX IDX_5904BEAD2989F1FD');\n $this->addSql('CREATE TEMPORARY TABLE __temp__invoice_position AS SELECT invoice_id, position_id, quantity FROM invoice_position');\n $this->addSql('DROP TABLE invoice_position');\n $this->addSql('CREATE TABLE invoice_position (invoice_id INTEGER NOT NULL, position_id INTEGER NOT NULL, quantity INTEGER NOT NULL, PRIMARY KEY(invoice_id, position_id), CONSTRAINT FK_5904BEAD2989F1FD FOREIGN KEY (invoice_id) REFERENCES invoice (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_5904BEADDD842E46 FOREIGN KEY (position_id) REFERENCES position (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');\n $this->addSql('INSERT INTO invoice_position (invoice_id, position_id, quantity) SELECT invoice_id, position_id, quantity FROM __temp__invoice_position');\n $this->addSql('DROP TABLE __temp__invoice_position');\n $this->addSql('CREATE INDEX IDX_5904BEADDD842E46 ON invoice_position (position_id)');\n $this->addSql('CREATE INDEX IDX_5904BEAD2989F1FD ON invoice_position (invoice_id)');\n }", "private function update_table( $table ) {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t$definition = $this->get_table_definition( $table );\n\t\tif ( $definition ) {\n\t\t\t$updated = dbDelta( $definition );\n\t\t\tforeach ( $updated as $updated_table => $update_description ) {\n\t\t\t\tif ( strpos( $update_description, 'Created table' ) === 0 ) {\n\t\t\t\t\tdo_action( 'wordcamp/queue/table_maker/created_table', $updated_table, $table );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getTablesModify() {}", "public function change()\n {\n $table = $this->table('sales');\n $table\n ->addColumn('seller_id', 'integer', [\n 'null' => false,\n ])\n ->addForeignKey('seller_id', 'sellers', 'id', [\n 'delete' => 'CASCADE',\n 'update' => 'CASCADE',\n ]);\n $table->addColumn('value', 'decimal', [\n 'default' => null,\n 'null' => false\n ]);\n $table->addColumn('comission', 'decimal', [\n 'default' => null,\n 'null' => false,\n ]);\n $table->addTimestamps(null, false);\n $table->addTimestamps(false);\n $table->create();\n }", "public function purgeUndoTable()\n\t{\n\t\t$objDatabase = \\Database::getInstance();\n\n\t\t// Truncate the table\n\t\t$objDatabase->execute(\"TRUNCATE TABLE tl_undo\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the undo table', __METHOD__, TL_CRON);\n\t}" ]
[ "0.6208775", "0.5964488", "0.5728385", "0.5688589", "0.5612853", "0.56117207", "0.54628456", "0.53506875", "0.5331613", "0.53299767", "0.5300898", "0.52745456", "0.5258984", "0.52038085", "0.51554346", "0.5146938", "0.5128618", "0.51167244", "0.50767577", "0.50280434", "0.5016161", "0.5012737", "0.5010828", "0.50075495", "0.49697432", "0.49365467", "0.49235258", "0.49174184", "0.490856", "0.49083865", "0.48818153", "0.4871121", "0.4861865", "0.4848643", "0.4832784", "0.48283663", "0.48167488", "0.4806464", "0.4804496", "0.47873124", "0.47860727", "0.47761565", "0.47760642", "0.47692215", "0.47577524", "0.47515893", "0.47465584", "0.47429675", "0.4741764", "0.47402966", "0.47360757", "0.47345656", "0.4732275", "0.4722164", "0.4714314", "0.46940708", "0.46934882", "0.46928436", "0.46909407", "0.46873593", "0.46786392", "0.46785212", "0.4676434", "0.46653163", "0.4661999", "0.46595782", "0.46580428", "0.46550485", "0.4653313", "0.4647283", "0.46449807", "0.46309116", "0.46283966", "0.4625276", "0.4619294", "0.46128327", "0.46108323", "0.46028706", "0.4599767", "0.4596797", "0.45945987", "0.45941514", "0.45921165", "0.45858777", "0.45818666", "0.4577325", "0.45755833", "0.45740977", "0.45695525", "0.4568762", "0.45677269", "0.456718", "0.45477435", "0.45366675", "0.4534184", "0.45286286", "0.45244893", "0.45238832", "0.4515002", "0.45143595" ]
0.588249
2
Regenerate the SQL to create any triggers from the table
private function generateTableTriggerSql($table, Connection $dbConnection) { $driverName = $dbConnection->getDriver()->getName(); $triggerSql = []; if ($driverName === 'pdo_mysql') { $triggers = $dbConnection->fetchAll('SHOW TRIGGERS WHERE `Table`=' . $dbConnection->quote($table)); if ($triggers && count($triggers) > 0) { foreach ($triggers as $trigger) { $triggerSql[] = 'CREATE TRIGGER ' . $trigger['Trigger'] . ' ' . $trigger['Timing'] . ' ' . $trigger['Event'] . ' ON ' . $dbConnection->quoteIdentifier($trigger['Table']) . ' FOR EACH ROW ' . PHP_EOL . $trigger['Statement'] . '; '; } } } elseif ($driverName === 'pdo_sqlite') { $schemaSql = "select sql from sqlite_master where type = 'trigger' AND tbl_name=" . $dbConnection->quote($table); $triggers = $dbConnection->fetchAll($schemaSql); if ($triggers && count($triggers) > 0) { foreach ($triggers as $trigger) { $triggerSql[] = $trigger['sql']; } } } else { throw new \RuntimeException(__METHOD__ . " not implemented for $driverName yet"); } return $triggerSql; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCreateTriggerSQL()\n{\n\t$updateSQL = '';\n\t$passValueSQL = '';\n\tforeach($this->ModuleFields as $vName => $value){\n if(!is_object($value)){\n print_r($this->ModuleFields);\n die(\"m. _generateCreateTrigger: Field $vName is not a valid ModuleField.\");\n } else {\n if (strtolower(get_class($value)) == 'tablefield'){\t\t\t\t\t\n if ( !empty( $value->deleteKeys ) ){\n\t\t\t\t\tforeach( $value->deleteKeys as $whereCondition ){\n\t\t\t\t\t\tlist( $whereModuleID, $whereColumn ) = preg_split( '/\\./', $whereCondition);\n\t\t\t\t\t\t$updateSQL .= \"\\t\\tUPDATE `\".$whereModuleID.\"` SET \".$whereModuleID.\"._Deleted = 1 WHERE \".$whereCondition.\" = NEW.\".$vName.\";\\n\";\t\t\t\t\t\t\n\t\t\t\t\t}\n }\n\t\t\t\tif ( !empty( $value->deleteOnIdGlobals ) ){\n\t\t\t\t\tforeach( $value->deleteOnIdGlobals as $whereModuleID ){\n\t\t\t\t\t\t$updateSQL .= \"\\t\\tUPDATE `\".$whereModuleID.\"` SET \".$whereModuleID.\"._Deleted = 1 WHERE \".$whereModuleID.\".RelatedModuleID = '\".$this->ModuleID.\"' AND \".$whereModuleID.\".RelatedRecordID = NEW.\".$vName.\";\\n\";\t\t\t\t\t\t\n\t\t\t\t\t}\n }\n\t\t\t\t if ( !empty( $value->passValueOn ) ){\n\t\t\t\t\t$passValueSQL .= \"\\tIF NEW.\".$vName.\" <> OLD.\".$vName.\" THEN\\n\";\n\t\t\t\t\tforeach( $value->passValueOn as $whereCondition ){\n\t\t\t\t\t\t//xt._TaskStatusID/_ProjectID=xt._ProjectID\n\t\t\t\t\t\tlist( $whereModuleIDColumn, $whereKeysCondition ) = preg_split( '/\\//', $whereCondition);\n\t\t\t\t\t\tlist( $whereModuleID, $whereColumn ) = preg_split( '/\\./', $whereModuleIDColumn);\t\t\t\t\t\t\n\t\t\t\t\t\t$passValueSQL .= \"\\t\\tUPDATE `\".$whereModuleID.\"` SET \".$whereModuleIDColumn.\" = NEW.\".$vName.\" WHERE NEW.\".$whereKeysCondition.\";\\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\t$passValueSQL .= \"\\tEND IF;\\n\";\n }\n }\n }\n }\n\t// No trigger condition found so return nothing\t\n\tif ( empty( $updateSQL ) AND empty( $passValueSQL ) ){ \n\t\treturn ''; \n\t};\t\n\t// Creating SQL\n\t$SQL .= \"DROP TRIGGER IF EXISTS \".$this->ModuleID.\"_afupd ;\\n\"; \n\t$SQL .= 'delimiter //'.\"\\n\";\n\t$SQL .= 'CREATE TRIGGER '.$this->ModuleID.'_afupd AFTER UPDATE ON `'.$this->ModuleID.'` FOR EACH ROW'.\"\\n\";\n\t$SQL .= 'BEGIN'.\"\\n\";\n\tif ( !empty( $updateSQL ) ){\n\t\t$SQL .= \"\\tIF NEW._Deleted = 1 AND OLD._Deleted = 0 THEN\\n\";\n//\t\t$SQL .= \"\\t\\tUPDATE cti SET cti._Deleted = 1 WHERE cti.StateID = StateID;\\n\";\n\t\t$SQL .= $updateSQL;\n\t\t$SQL .= \"\\tEND IF;\\n\";\n\t}\n\tif ( !empty( $passValueSQL ) ){\n\t\t$SQL .= $passValueSQL;\n\t}\n\t$SQL .= 'END;//'.\"\\n\";\n\t$SQL .= \"delimiter ;\\n\\n\";\n\t\n\treturn $SQL;\n}", "public function triggers($table, $like = '') {\n\t\t$builder = DB_SQL::select($this->data_source)\n\t\t\t->column('[t4].[NAME]', 'schema')\n\t\t\t->column('[t1].[NAME]', 'table')\n\t\t\t->column('[t0].[NAME]', 'trigger')\n\t\t\t->column(DB_SQL::expr(\"CASE WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsInsertTrigger') = 1 THEN 'INSERT' WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsUpdateTrigger') = 1 THEN 'UPDATE' WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsDeleteTrigger') = 1 THEN 'DELETE' END\"), 'event')\n\t\t\t->column(DB_SQL::expr(\"CASE WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsInsteadOfTrigger') = 1 THEN 'INSTEAD OF' ELSE 'AFTER' END\"), 'timing')\n\t\t\t->column(DB_SQL::expr(\"'ROW'\"), 'per')\n\t\t\t->column('[t2].[TEXT]', 'action')\n\t\t\t->column(DB_SQL::expr('0'), 'seq_index')\n\t\t\t->column(DB_SQL::expr('NULL'), 'created')\n\t\t\t->from('[SYSOBJECTS]', '[t0]')\n\t\t\t->join(NULL, '[SYSOBJECTS]', '[t1]')\n\t\t\t->on('[t1].[ID]', DB_SQL_Operator::_EQUAL_TO_, '[t0].[PARENT_OBJ]')\n\t\t\t->join(NULL, '[SYSCOMMENTS]', '[t2]')\n\t\t\t->on('[t2].[ID]', DB_SQL_Operator::_EQUAL_TO_, '[t0].[ID]')\n\t\t\t->join(DB_SQL_JoinType::_LEFT_, '[SYS].[TABLES]', '[t3]')\n\t\t\t->on('[t3].[OBJECT_ID]', DB_SQL_Operator::_EQUAL_TO_, '[t0].[PARENT_OBJ]')\n\t\t\t->join(DB_SQL_JoinType::_LEFT_, '[SYS].[SCHEMAS]', '[t4]')\n\t\t\t->on('[t4].[SCHEMA_ID]', DB_SQL_Operator::_EQUAL_TO_, '[t3].[SCHEMA_ID]')\n\t\t\t->where('[t0].[XTYPE]', DB_SQL_Operator::_EQUAL_TO_, 'TR')\n\t\t\t->where('[t1].[NAME]', DB_SQL_Operator::_EQUAL_TO_, $table)\n\t\t\t->where(DB_SQL::expr(\"CASE WHEN OBJECTPROPERTY([t0].[ID], 'ExecIsTriggerDisabled') = 1 THEN 0 ELSE 1 END\"), DB_SQL_Operator::_EQUAL_TO_, 1)\n\t\t\t->order_by(DB_SQL::expr('UPPER([t4].[NAME])'))\n\t\t\t->order_by(DB_SQL::expr('UPPER([t1].[NAME])'))\n\t\t\t->order_by(DB_SQL::expr('UPPER([t0].[NAME])'));\n\n\t\tif ( ! empty($like)) {\n\t\t\t$builder->where('[t0].[NAME]', DB_SQL_Operator::_LIKE_, $like);\n\t\t}\n\n\t\treturn $builder->query();\n\t}", "protected function getSQLCreate()\n {\n $sql = \"CREATE TRIGGER `{$this->getName()}` {$this->getTime()} {$this->getAction()} ON `{$this->tableName}` FOR EACH ROW\" . PHP_EOL;\n $sql .= $this->getTriggerSQLBody();\n return $sql;\n }", "public function compileTriggerExists()\n {\n return 'select * from information_schema.triggers where trigger_schema = ? and trigger_name = ?';\n }", "public static function at()\n\t{\n\t\t\n\t\t$alter_info = array(\n\t\t\t// deleted columns, simple 1d array\n\t\t\t//'drop' => array('ii'),\n\t\t\t\n\t\t\t// old name => new name and definition\n\t\t\t//'change' => array(\n\t\t\t//\t'thing' => 'trong INT( 11 ) NOT NULL'\n\t\t\t//),\n\t\t\t\n\t\t\t// new column definitions\n\t\t\t'add' => array(\n\t\t\t\t'mpc_convs smallint unsigned not null default 0',\n\t\t\t\t'vt_convs smallint unsigned not null default 0'\n\t\t\t)\n\t\t);\n\t\t$ta = new table_alterer('g_data', 'keywords_11', $alter_info);\n\t\t$ta->go();\n\t}", "private function activateCreateAlterTables()\n {\n $PluginDbStructure = new \\RdDownloads\\App\\Models\\PluginDbStructure();\n $schemas = $PluginDbStructure->get();\n unset($PluginDbStructure);\n\n if (is_array($schemas) && !empty($schemas) && !is_null($this->getDbVersion())) {\n global $wpdb;\n // require file that needs for use dbDelta() function.\n require_once ABSPATH . '/wp-admin/includes/upgrade.php';\n\n foreach ($schemas as $index => $item) {\n if (isset($item['statement']) && isset($item['tablename'])) {\n $sql = str_replace('%TABLE%', $item['tablename'], $item['statement']);\n\n if (isset($item['is_multisite']) && $item['is_multisite'] === true) {\n // if set to multisite table then it will create prefix_sitenumber_tablename.\n $prefix = $wpdb->prefix;\n } else {\n // if set not to multisite then it will create prefix_tablename.\n $prefix = $wpdb->base_prefix;\n }\n\n $sql = str_replace('%PREFIX%', $prefix, $sql);\n dbDelta($sql);\n unset($sql);\n\n if (function_exists('maybe_convert_table_to_utf8mb4')) {\n maybe_convert_table_to_utf8mb4($prefix . $item['tablename']);\n }\n unset($prefix);\n }\n }// endforeach;\n unset($index, $item);\n }\n\n unset($schemas);\n }", "public final function checkTriggers()\n {\n $stmt = self::$globalConnection->prepare('SHOW TRIGGERS FROM `' . self::$database . '`');\n if (! $stmt->execute())\n self::registerErrorOccurence($stmt);\n \n $triggers = array();\n while ($result = $stmt->fetch())\n $triggers[] = $result['trigger'];\n \n if (! in_array('cafet_new_balance_reload', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_balance_reload` \n BEFORE INSERT ON `$this->RELOADS` \n FOR EACH ROW \n BEGIN \t\n SET @user = NEW.user_id;\n UPDATE `$this->CLIENTS` SET balance = balance + NEW.amount WHERE user_id = @user;\n SET NEW.user_balance = (SELECT balance FROM `$this->CLIENTS` WHERE user_id = @user); \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_product_edition', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_product_edition` \n BEFORE INSERT ON `$this->PRODUCTS_EDITS` \n FOR EACH ROW \n BEGIN \n SET @count = (SELECT COUNT(*) FROM `$this->PRODUCTS_EDITS` WHERE product = NEW.product);\n IF NEW.price IS NULL THEN\n IF @count <> 0 THEN\n SET NEW.price = (SELECT price FROM `$this->PRODUCTS_EDITS` WHERE product = NEW.product ORDER BY id DESC LIMIT 1);\n ELSE\n SET NEW.price = 0;\n END IF;\n END IF;\n IF NEW.price < 0 THEN\n SET NEW.price = 0;\n END IF;\n IF NEW.name IS NULL AND @count <> 0 THEN\n SET NEW.name = (SELECT name FROM `$this->PRODUCTS_EDITS` WHERE product = NEW.product ORDER BY id DESC LIMIT 1);\n END IF; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_save_product_edition', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_save_product_edition` \n AFTER INSERT ON `$this->PRODUCTS_EDITS` \n FOR EACH ROW \n BEGIN \n UPDATE `$this->PRODUCTS` SET last_edit = NEW.id WHERE id = NEW.product; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_product_bought', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_product_bought` \n BEFORE INSERT ON `$this->PRODUCTS_BOUGHT` \n FOR EACH ROW \n BEGIN \n SET NEW.edit_id = (SELECT last_edit FROM `$this->PRODUCTS` WHERE id = NEW.product_id);\n SET @price = (SELECT price FROM `$this->PRODUCTS_EDITS` WHERE id = NEW.edit_id);\n UPDATE `$this->PRODUCTS` SET stock = stock - NEW.quantity WHERE id = NEW.product_id;\n UPDATE `$this->CLIENTS` SET balance = balance-@price*NEW.quantity WHERE user_id = NEW.user_id;\n UPDATE `$this->EXPENSES` SET user_balance = (SELECT balance FROM `$this->CLIENTS` WHERE user_id = NEW.user_id) WHERE id = NEW.expense_id; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_replenishment', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_replenishment` \n AFTER INSERT ON `$this->REPLENISHMENTS` \n FOR EACH ROW \n BEGIN \n SET @quantity = NEW.quantity;\n SET @product = NEW.product_id;\n UPDATE `$this->PRODUCTS` SET stock = stock + @quantity WHERE id = @product; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_formula_edition', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_formula_edition` \n BEFORE INSERT ON `$this->FORMULAS_EDITS` \n FOR EACH ROW \n BEGIN \n SET @count = (SELECT COUNT(*) FROM `$this->FORMULAS_EDITS` WHERE formula = NEW.formula);\n IF NEW.price IS NULL THEN\n IF @count <> 0 THEN\n SET NEW.price = (SELECT price FROM `$this->FORMULAS_EDITS` WHERE formula = NEW.formula ORDER BY id DESC LIMIT 1);\n ELSE\n SET NEW.price = 0;\n END IF;\n END IF;\n IF NEW.price < 0 THEN\n SET NEW.price = 0;\n END IF;\n IF NEW.name IS NULL AND @count <> 0 THEN\n SET NEW.name = (SELECT name FROM `$this->FORMULAS_EDITS` WHERE formula = NEW.formula ORDER BY id DESC LIMIT 1);\n END IF; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_save_formula_edition', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_save_formula_edition` \n AFTER INSERT ON `$this->FORMULAS_EDITS` \n FOR EACH ROW \n BEGIN \n UPDATE `$this->FORMULAS` SET last_edit = NEW.id WHERE id = NEW.formula; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_formula_bought', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_formula_bought` \n BEFORE INSERT ON `$this->FORMULAS_BOUGHT` \n FOR EACH ROW \n BEGIN \n SET NEW.edit_id = (SELECT last_edit FROM `$this->FORMULAS` WHERE id = NEW.formula_id);\n SET @price = (SELECT price FROM `$this->FORMULAS_EDITS` WHERE id = NEW.edit_id);\n UPDATE `$this->CLIENTS` SET balance = balance-@price*NEW.quantity WHERE user_id = NEW.user_id;\n UPDATE `$this->EXPENSES` SET user_balance = (SELECT balance FROM `$this->CLIENTS` WHERE user_id = NEW.user_id) WHERE id = NEW.expense_id; \n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_new_formula_bought_product', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_new_formula_bought_product` \n BEFORE INSERT ON `$this->FORMULAS_BOUGHT_PRODUCTS` \n FOR EACH ROW \n BEGIN \n SET NEW.product_edit = (SELECT last_edit FROM `$this->PRODUCTS` WHERE id = NEW.product_id);\n END\nEOSQL\n );\n }\n \n if (! in_array('cafet_save_formula_bought_product', $triggers)) {\n self::query(\n <<<EOSQL\n CREATE TRIGGER `cafet_save_formula_bought_product` \n AFTER INSERT ON `$this->FORMULAS_BOUGHT_PRODUCTS` \n FOR EACH ROW \n BEGIN \n UPDATE `$this->PRODUCTS` SET stock = stock - 1 WHERE id = NEW.product_id; \n END\nEOSQL\n );\n }\n }", "function getTriggers($table) {\n return mysql_query(sprintf('SHOW TRIGGERS FROM %s LIKE \\'%s\\'', $this->config[\"database\"], $table));\n }", "public function alterTableStatementProvider()\n {\n return [\n 'alter table add contraints 1 trigger' => [\n 'ALTER_TABLE NAME ADD_CONSTRAINT NAME FOREIGN_KEY ( NAME ) REFERENCES NAME ( NAME ) ON ACTION TRIGGER_ACTION ',\n 'ALTER_TABLE ADD_FOREIGN_KEY '\n ],\n 'alter table add contraints 2 triggers' => [\n 'ALTER_TABLE NAME ADD_CONSTRAINT NAME FOREIGN_KEY ( NAME ) REFERENCES NAME ( NAME ) ON ACTION TRIGGER_ACTION ON ACTION TRIGGER_ACTION',\n 'ALTER_TABLE ADD_FOREIGN_KEY '\n ],\n 'alter table tutti frutti'=> [\n 'ALTER_TABLE NAME ADD_COLUMN NAME DATATYPE ADD_CONSTRAINT NAME FOREIGN_KEY ( NAME ) REFERENCES NAME ( NAME )',\n 'ALTER_TABLE ADD_COLUMN COLUMN ADD_FOREIGN_KEY '\n ]\n ];\n }", "public function getCreateSql() {\n $sql = \"\";\n foreach ($this->tables as $tableName => $sqlTemplate) {\n $tmp = self::formatSql($sqlTemplate, $this->db->getTableSet());\n $sql .= (substr($tmp, -1) === ';') ? $tmp : $tmp . ';';\n } \n return $sql;\n }", "public function compileAdminTables() {}", "private function sqlstatements() {\n $this->select = array( );\n $this->insert = array( 'INSERT INTO :entity (xxx) VALUES (yyy)' );\n $this->update = array( );\n $this->delete = array( );\n }", "function makeTriggerSQL($condition_ix)\n{\n $triggerSQLs = array();\n $joins = array();\n foreach($this->triggers as $trg_ix => $triggerFields){\n $defSnips = array();\n foreach($triggerFields as $triggerField){\n $def = $triggerField->getDef();\n $defSnips[] = $def['snippet'];\n $joins = array_merge($joins, $def['joins']);\n }\n $SQL = \"CASE WHEN \";\n $SQL .= join(' AND ', $defSnips);\n //$SQL .= \" THEN 1 ELSE NULL END\";\n $SQL .= \" THEN 'C{$condition_ix}Tr{$trg_ix}' ELSE NULL END\";\n $triggerSQLs[] = $SQL;\n }\n\n if(count($this->triggers) > 1){\n //$SQL = \"COALESCE(\".join(',', $triggerSQLs).\")\";\n $SQL = \"CONCAT_WS(',', \".join(',', $triggerSQLs).\")\";\n }\n $SQL .= \" AS Condition_$condition_ix\";\n return array('triggerExpr' => $SQL, 'joins' => $joins);\n}", "public function run()\n {\n DB::unprepared(\"CREATE DEFINER=`\" . env('DB_USERNAME') . \"`@`\" . env('DB_HOST') . \"` TRIGGER `TipoMensajeInsert` BEFORE INSERT ON `tipo_mensajes` FOR EACH ROW BEGIN\n SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'No se permiten cambios';\nEND\");\n DB::unprepared(\"CREATE DEFINER=`\" . env('DB_USERNAME') . \"`@`\" . env('DB_HOST') . \"` TRIGGER `TipoMensaje_before_update` BEFORE UPDATE ON `tipo_mensajes` FOR EACH ROW BEGIN\n SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'No se permiten cambios';\nEND\");\n DB::unprepared(\"CREATE DEFINER=`\" . env('DB_USERNAME') . \"`@`\" . env('DB_USERNAME') . \"` TRIGGER `TipoMensaje_before_delete` BEFORE DELETE ON `tipo_mensajes` FOR EACH ROW BEGIN\n SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'No se permiten cambios';\nEND\");\n }", "public function loadTriggersFromDb()\n {\n return $this->getQueryBuilder()\n ->select('name')\n ->from('SQLite_Master', 'main')\n ->where('name IN(:trigger_name)')\n ->setParameter('trigger_name', array_keys($this->triggers), Connection::PARAM_STR_ARRAY)\n ->execute()\n ->fetchAll(PDO::FETCH_ASSOC);\n }", "public static function on_activate() {\n self::create_tables();\n }", "public function setTableDefinition()\n {\n $this->addListener(new Doctrine_Template_Listener_Loggable($this->_options), 'loggable');\n }", "function postCreateTable(){\n\t}", "public function modifyTable()\n\t{\n\t\t$table = $this->getTable();\n\t\t// add the aggregate columns if not present\n\t\t$columnNames = $this->getColumnNames();\n\t\tforeach ($columnNames as $columnName) {\n\t\t\tif( ! $table->containsColumn($columnName)) {\n\t\t\t\t$column = $table->addColumn(array(\n\t\t\t\t\t'name' => $columnName,\n\t\t\t\t\t'type' => 'INTEGER',\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\t// add behavior to foreign tables to autoupdate aggregate columns\n\t\t$foreignTables = $this->getForeignTables();\n\t\t$columns = $this->getColumns(); // get aggregate column objects\n\t\tforeach ($foreignTables as $k => $foreignTable) {\n\t\t\t//var_dump($foreignTable); //MARK\n\t\t\tif(!$foreignTable->hasBehavior('concrete_inheritance_parent')) {\n\t\t\t\t$relationBehaviorName = 'aggregate_column_relation_to_' . $table->getName() . '_' . $columnNames[$k];\n\t\t\t\t$relationBehavior = new AggregateColumnRelationBehavior();\n\t\t\t\t$relationBehavior->setName($relationBehaviorName);\n\t\t\t\t// FIXME does this really serve any purpose other than check whether a fk is defined?\n\t\t\t\t$foreignKey = $this->getForeignKey($foreignTable);\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'foreign_table', 'value' => $table->getName()));\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'update_method', 'value' => 'update' . $columns[$k]->getPhpName()));\n\t\t\t\t$relationBehavior->addParameter(array('name' => 'foreign_aggregate_column', 'value' => $columns[$k]->getPhpName()));\n\t\t\t\t$foreignTable->addBehavior($relationBehavior);\n\t\t\t}\n\t\t}\n\t}", "public function createSQL() {\n $sql = '';\n\n foreach($this->tables as $table) {\n \t$create = $table->createSQL();\n \tif($create !== null) {\n\t\t $sql .= $create . \"\\n\";\n\t }\n }\n\n foreach($this->makers as $maker) {\n $sql .= $maker->createSQL() . \"\\n\";\n }\n\n return $sql;\n }", "public static function generate_trigger_table() {\n global $PAGE;\n\n $headers = array(\n get_string('table_header_rule_name', 'local_extension'),\n get_string('table_header_rule_action', 'local_extension'),\n get_string('table_header_rule_actionable', 'local_extension'),\n get_string('table_header_rule_parent', 'local_extension'),\n get_string('table_header_rule_datatype', 'local_extension'),\n get_string('table_header_rule_priority', 'local_extension'),\n get_string('table_header_rule_data', 'local_extension'),\n '',\n );\n\n $columns = array('name', 'action', 'role', 'parent', 'datatype', 'priority', 'data', '');\n\n $table = new \\flexible_table('local_extension_triggers');\n $table->define_columns($columns);\n $table->define_headers($headers);\n\n $table->define_baseurl($PAGE->url);\n $table->set_attribute('id', 'local_extension_table');\n $table->set_attribute('class', 'generaltable admintable');\n $table->setup();\n\n return $table;\n }", "public function getUpSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 0;\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n 'blog' => '\n SET FOREIGN_KEY_CHECKS = 0;\n SET FOREIGN_KEY_CHECKS = 1;\n '\n );\n }", "public function getUpSQL()\n\t{\n\t\treturn array (\n 'propel' => '\nSET FOREIGN_KEY_CHECKS = 0;\nALTER TABLE `command` CHANGE `std_out_file` `std_out_file` VARCHAR(200);\nALTER TABLE `command` CHANGE `std_err_file` `std_err_file` VARCHAR(200);\nALTER TABLE `command` CHANGE `exit_file` `exit_file` VARCHAR(200);\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}", "public function sync($runner)\n {\n $r = $this->getInformationSchema($runner->getDb(), $runner->getDbSchemaName());\n\n // found definition in information schema, check for changes\n if ($r)\n {\n list ($tableName, $event, $action, $body) = $r;\n\n $recreate = false;\n\n // changed table name\n if ($tableName != $this->tableName)\n {\n $recreate = true;\n }\n\n // changed trigger event\n if ($event != $this->getAction())\n {\n $recreate = true;\n }\n\n // changed trigger time\n if ($action != $this->getTime())\n {\n $recreate = true;\n }\n\n // changed trigger body\n if ($body != $this->getTriggerSQLBody())\n {\n $recreate = true;\n }\n\n // definition has been changed, sync in db\n if ($recreate)\n {\n $runner->log(\"SYNC: Recreating trigger {$this->getName()}.\");\n $runner->processQuery(\"DROP TRIGGER `{$this->getName()}`\");\n $runner->processQuery($this->getSQLCreate());\n }\n }\n // definition not found, create new trigger\n else\n {\n $runner->log(\"SYNC: Creating trigger {$this->getName()}.\");\n $runner->processQuery($this->getSQLCreate());\n }\n }", "function __alter_table($table, $alterdefs)\r\n{\r\n global $g_current_db;\r\n\r\n $sql = \"SELECT sql,name,type FROM sqlite_master WHERE tbl_name = '\" . $table . \"' ORDER BY type DESC\";\r\n $result = sqlite_query($g_current_db, $sql);\r\n\r\n if (($result === false) || (sqlite_num_rows($result) <= 0)) {\r\n trigger_error('no such table: ' . $table, E_USER_WARNING);\r\n return false;\r\n }\r\n // ------------------------------------- Build the queries\r\n $row = sqlite_fetch_array($result);\r\n $tmpname = 't' . time();\r\n $origsql = trim(preg_replace(\"/[\\s]+/\", \" \", str_replace(\",\", \", \", preg_replace(\"/[\\(]/\", \"( \", $row['sql'], 1))));\r\n $createtemptableSQL = 'CREATE TEMPORARY ' . substr(trim(preg_replace(\"'\" . $table . \"'\", $tmpname, $origsql, 1)), 6);\r\n $origsql = substr($origsql, 0, strlen($origsql)-1); // chops the ) at end\r\n $createindexsql = array();\r\n $i = 0;\r\n $defs = preg_split(\"/[,]+/\", $alterdefs, -1, PREG_SPLIT_NO_EMPTY);\r\n $prevword = $table;\r\n $oldcols = preg_split(\"/[,]+/\", substr(trim($createtemptableSQL), strpos(trim($createtemptableSQL), '(') + 1), -1, PREG_SPLIT_NO_EMPTY);\r\n $oldcols = preg_split(\"/[,]+/\", substr(trim($origsql), strpos(trim($origsql), '(') + 1), -1, PREG_SPLIT_NO_EMPTY);\r\n $newcols = array();\r\n\r\n for($i = 0;$i < sizeof($oldcols);$i++) {\r\n $colparts = preg_split(\"/[\\s]+/\", $oldcols[$i], -1, PREG_SPLIT_NO_EMPTY);\r\n $oldcols[$i] = $colparts[0];\r\n $newcols[$colparts[0]] = $colparts[0];\r\n }\r\n\r\n $newcolumns = '';\r\n $oldcolumns = '';\r\n reset($newcols);\r\n\r\n while (list($key, $val) = each($newcols)) {\r\n $newcolumns .= ($newcolumns?', ':'') . $val;\r\n $oldcolumns .= ($oldcolumns?', ':'') . $key;\r\n }\r\n\r\n $copytotempsql = 'INSERT INTO ' . $tmpname . '(' . $newcolumns . ') SELECT ' . $oldcolumns . ' FROM ' . $table;\r\n $dropoldsql = 'DROP TABLE ' . $table;\r\n $createtesttableSQL = $createtemptableSQL;\r\n\r\n $newname = \"\";\r\n\r\n foreach($defs as $def) {\r\n $defparts = preg_split(\"/[\\s]+/\", $def, -1, PREG_SPLIT_NO_EMPTY);\r\n $action = strtolower($defparts[0]);\r\n\r\n switch ($action) {\r\n case 'add':\r\n\r\n if (sizeof($defparts) <= 2) {\r\n /**\r\n * * mySQL gives no such user_warning\r\n * trigger_error('near \"' . $defparts[0] . ($defparts[1]?' ' . $defparts[1]:'') . '\": SQLITE syntax error', E_USER_WARNING);\r\n *\r\n * //\r\n */\r\n return false;\r\n }\r\n $createtesttableSQL = substr($createtesttableSQL, 0, strlen($createtesttableSQL)-1) . ',';\r\n for($i = 1;$i < sizeof($defparts);$i++)\r\n $createtesttableSQL .= ' ' . $defparts[$i];\r\n $createtesttableSQL .= ')';\r\n break;\r\n\r\n case 'change':\r\n\r\n if (sizeof($defparts) <= 2) {\r\n trigger_error('near \"' . $defparts[0] . ($defparts[1]?' ' . $defparts[1]:'') . ($defparts[2]?' ' . $defparts[2]:'') . '\": SQLITE syntax error', E_USER_WARNING);\r\n return false;\r\n }\r\n if ($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ' ')) {\r\n if ($newcols[$defparts[1]] != $defparts[1]) {\r\n trigger_error('unknown column \"' . $defparts[1] . '\" in \"' . $table . '\"', E_USER_WARNING);\r\n return false;\r\n }\r\n $newcols[$defparts[1]] = $defparts[2];\r\n $nextcommapos = strpos($createtesttableSQL, ',', $severpos);\r\n $insertval = '';\r\n for($i = 2;$i < sizeof($defparts);$i++)\r\n $insertval .= ' ' . $defparts[$i];\r\n if ($nextcommapos)\r\n $createtesttableSQL = substr($createtesttableSQL, 0, $severpos) . $insertval . substr($createtesttableSQL, $nextcommapos);\r\n else\r\n $createtesttableSQL = substr($createtesttableSQL, 0, $severpos - (strpos($createtesttableSQL, ',')?0:1)) . $insertval . ')';\r\n } else {\r\n trigger_error('unknown column \"' . $defparts[1] . '\" in \"' . $table . '\"', E_USER_WARNING);\r\n return false;\r\n }\r\n break;\r\n\r\n case 'drop';\r\n\r\n if (sizeof($defparts) < 2) {\r\n trigger_error('near \"' . $defparts[0] . ($defparts[1]?' ' . $defparts[1]:'') . '\": SQLITE syntax error', E_USER_WARNING);\r\n return false;\r\n }\r\n /**\r\n * if ($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ' ')) {\r\n * could end with , or ) if no type!!!!\r\n *\r\n * //\r\n */\r\n if (($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ' ')) || ($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ',')) || ($severpos = strpos($createtesttableSQL, ' ' . $defparts[1] . ')'))) {\r\n $nextcommapos = strpos($createtesttableSQL, ',', $severpos);\r\n if ($nextcommapos)\r\n $createtesttableSQL = substr($createtesttableSQL, 0, $severpos) . substr($createtesttableSQL, $nextcommapos + 1);\r\n else\r\n $createtesttableSQL = substr($createtesttableSQL, 0, $severpos - (strpos($createtesttableSQL, ',')?0:1)) . ')';\r\n unset($newcols[$defparts[1]]);\r\n /* RUBEM */ $createtesttableSQL = str_replace(\",)\", \")\", $createtesttableSQL);\r\n } else {\r\n trigger_error('unknown column \"' . $defparts[1] . '\" in \"' . $table . '\"', E_USER_WARNING);\r\n return false;\r\n }\r\n break;\r\n\r\n case 'rename'; // RUBEM\r\n if (sizeof($defparts) < 2) {\r\n trigger_error('near \"' . $defparts[0] . ($defparts[1]?' ' . $defparts[1]:'') . '\": SQLITE syntax error', E_USER_WARNING);\r\n return false;\r\n }\r\n $newname = $defparts[2];\r\n break;\r\n\r\n default:\r\n\r\n trigger_error('near \"' . $prevword . '\": SQLITE syntax error', E_USER_WARNING);\r\n return false;\r\n } // switch\r\n $prevword = $defparts[sizeof($defparts)-1];\r\n } // foreach\r\n // This block of code generates a test table simply to verify that the columns specifed are valid\r\n // in an sql statement. This ensures that no reserved words are used as columns, for example\r\n sqlite_query($g_current_db, $createtesttableSQL);\r\n $err = sqlite_last_error($g_current_db);\r\n if ($err) {\r\n trigger_error(\"Invalid SQLITE code block: \" . sqlite_error_string($err) . \"\\n\", E_USER_WARNING);\r\n return false;\r\n }\r\n $droptempsql = 'DROP TABLE ' . $tmpname;\r\n sqlite_query($g_current_db, $droptempsql);\r\n // End test block\r\n // Is it a Rename?\r\n if (strlen($newname) > 0) {\r\n // $table = preg_replace(\"/([a-z]_)[a-z_]*/i\", \"\\\\1\" . $newname, $table);\r\n // what do want with the regex? the expression should be [a-z_]! hans\r\n // why not just\r\n $table = $newname;\r\n }\r\n $createnewtableSQL = 'CREATE ' . substr(trim(preg_replace(\"'\" . $tmpname . \"'\", $table, $createtesttableSQL, 1)), 17);\r\n\r\n $newcolumns = '';\r\n $oldcolumns = '';\r\n reset($newcols);\r\n\r\n while (list($key, $val) = each($newcols)) {\r\n $newcolumns .= ($newcolumns?', ':'') . $val;\r\n $oldcolumns .= ($oldcolumns?', ':'') . $key;\r\n }\r\n $copytonewsql = 'INSERT INTO ' . $table . '(' . $newcolumns . ') SELECT ' . $oldcolumns . ' FROM ' . $tmpname;\r\n // ------------------------------------- Perform the actions\r\n if (sqlite_query($g_current_db, $createtemptableSQL) === false) return false; //create temp table\r\n if (sqlite_query($g_current_db, $copytotempsql) === false) return false; //copy to table\r\n if (sqlite_query($g_current_db, $dropoldsql) === false) return false; //drop old table\r\n if (sqlite_query($g_current_db, $createnewtableSQL) === false) return false; //recreate original table\r\n if (sqlite_query($g_current_db, $copytonewsql) === false) return false; //copy back to original table\r\n if (sqlite_query($g_current_db, $droptempsql) === false) return false; //drop temp table\r\n return true;\r\n}", "public static function generateDatabase()\n\t{\n\t\t$entities\t=\tself::getEntities();\n\t\t$query\t\t=\tself::$current_db->query('SHOW TABLES');\n\t\t$tables\t\t=\tarray();\n\n\t\twhile($table = $query->fetch(\\PDO::FETCH_NUM))\n\t\t\t$tables[]\t=\tstrtolower($table[0]);\n\n\t\tforeach($entities as $entity)\n\t\t{\n\t\t\tif( ! in_array(strtolower($entity::getTableName()), $tables))\n\t\t\t\t$entity::createTable();\n\t\t\telse\n\t\t\t\t$entity::updateTable();\n\t\t}\n\t}", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getName() .\" \n JOIN \".$this->_getPessoa()->getModel()->getTableName().\" cliente ON ( ca_cliente_contrato.id_cliente = cliente.id ) \n JOIN \".$this->_getContrato()->getModel()->getTableName().\" contrato ON ( ca_cliente_contrato.id_contrato = contrato.id ) \"; \n return $sql;\n }", "final public function generateSQL()\n {\n return implode(self::STATEMENTS_DELIMITER, array_map(function ($part) {\n return current($part);\n }, $this->generateOrderedSQLParts()));\n }", "public function getUpSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n );\n }", "public function export_trigger($id){\n $trigger = DB::table('triggers')->leftJoin('tables', 'tables.id', '=', 'triggers.id_table')\n ->select('triggers.*', 'tables.nama_table')->where('triggers.id_database',$id)->get();\n$query = \"\";\n\n foreach($trigger as $triggers){\n //drop triggernya jika ada\n $query .= \" DROP TRIGGER IF EXISTS `\".$triggers->nama_trigger.\"`;\nDELIMITER $$\";\n //create trigger \n $query .= \" CREATE TRIGGER `\".$triggers->nama_trigger.\"` \".$triggers->waktu_trigger.\" \".$triggers->event_trigger.\" ON `\".$triggers->nama_table.\"` FOR EACH ROW BEGIN \".$triggers->isi_trigger.\" END$$ DELIMITER ;\";\n\n\n \n }\n\n$content = str_split($query, 65536);\nforeach ($content as $part) {\n echo $part;\n}\n\n\n \n\n }", "public function getDownSQL()\n\t{\n\t\treturn array (\n 'propel' => '\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\nALTER TABLE `command` CHANGE `std_out_file` `std_out_file` VARCHAR(50);\nALTER TABLE `command` CHANGE `std_err_file` `std_err_file` VARCHAR(50);\nALTER TABLE `command` CHANGE `exit_file` `exit_file` VARCHAR(50);\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}", "private function migrateTableTriggers(string $setName, TablesList $tableCollection): void\n {\n foreach ($tableCollection->getTables() as $table => $sampler) {\n try {\n $triggerSql = $this->generateTableTriggerSql($table, $this->sourceConnection);\n foreach ($triggerSql as $sql) {\n $this->destConnection->exec($sql);\n }\n if (count($triggerSql)) {\n $this->logger->info(\"$setName: Migrated \" . count($triggerSql) . \" trigger(s) on $table\");\n }\n } catch (\\Exception $e) {\n $this->logger->error(\n \"$setName: failed to migrate '$table' triggers with '\" . $sampler->getName() . \"': \" . $e->getMessage()\n );\n throw $e;\n }\n }\n }", "public function getDatabaseTableDefinitions()\n {\n $sql = '';\n foreach ($this->getExtensionKeys() as $extensionKey) {\n $sql .= $this->getDatabaseTableDefinition($extensionKey);\n }\n return $sql;\n }", "public function change()\n {\n $this->table('news', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'biginteger', ['identity' => true])\n ->addColumn('title', 'string', ['limit' => 255])\n ->create();\n\n $this->table('news1', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'biginteger', ['identity' => true])\n ->addColumn('title', 'string', ['limit' => 255])\n ->create();\n }", "static private function regenerate_database()\n {\n self::$quick = false; // Disable quick mode.\n\n self::greeting();\n self::database_backup(); // Backup database, just in case.\n\n if(self::check_duplicates()) {\n self::link_naked_arxiv(); // Link naked arXiv IDs.\n\n self::log(\"Initiating database regeneration from INSPIRE.\");\n $stats = self::inspire_regenerate(\"SELECT inspire FROM records WHERE (inspire != '' AND inspire IS NOT NULL)\");\n\n if (sizeof($stats->found) > 0)\n self::log(sizeof($stats->found) . \" records were regenerated.\");\n if (sizeof($stats->lost) > 0)\n self::log(sizeof($stats->lost) . \" records were not found on INSPIRE: \" . implode(\", \", $stats->lost) . \".\");\n\n self::fetch_missing_bibtex();\n }\n\n self::wrapup();\n }", "public function buildDeleteSql() {\r\n $this->sql .= ' FROM ' . $this->sqlStrTables;\r\n $this->setConditions();\r\n $this->setLimit();\r\n }", "public function getTriggerSQLBody()\n {\n $body = self::TRIGGER_BEGIN;\n $body .= PHP_EOL;\n $body .= $this->body;\n $body .= PHP_EOL;\n $body .= self::TRIGGER_END;\n\n return $body;\n }", "protected function defineDatabaseMigrationsAfterDatabaseRefreshed()\n {\n // Define database migrations after database refreshed.\n }", "public function getUpSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` VARCHAR(32);\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` VARCHAR(32);\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DOUBLE;\r\n\r\nALTER TABLE `promocion`\r\n ADD `activo` TINYINT(1) DEFAULT 1 AFTER `id`;\r\n\r\nALTER TABLE `promocion` DROP `descripcion`;\r\n\r\nALTER TABLE `promocion` DROP `estado`;\r\n\r\nALTER TABLE `promocion` DROP `promocion_global`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "private function genColModifyScripts($stmts)\n {\n $query = \"\";\n $i = 0;\n foreach ($stmts as $name => $stmt) {\n $query .= \"\\nCHANGE `$name` `$name` $stmt\";\n if ($i < count($stmts) - 1) {\n $query .= ',';\n }\n $i++;\n }\n return $query;\n }", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getAlias() .\" \n LEFT JOIN \".$this->_getPagamento()->getModel()->getTableName().\" pagto_pedido ON ( cv_pagto_lanc.id_pagto_pedido = pagto_pedido.id ) \n LEFT JOIN \".$this->_getLancamento()->getModel()->getTableName().\" lancamento ON ( cv_pagto_lanc.id_lancamento = lancamento.id ) \"; \n return $sql;\n }", "protected function buildGrammar()\n {\n $sql = $this->operation->getBase();\n foreach ($this->operation->getGrammar() as $fn => $args) {\n $sql .= forward_static_call_array(['WpSqlBuilder\\Grammar',$fn], $this->getArguments($args));\n }\n return $sql;\n }", "protected function silentCacheFrameworkTableSchemaMigration() {}", "public function change()\n {\n $table = $this->table('sales');\n $table\n ->addColumn('seller_id', 'integer', [\n 'null' => false,\n ])\n ->addForeignKey('seller_id', 'sellers', 'id', [\n 'delete' => 'CASCADE',\n 'update' => 'CASCADE',\n ]);\n $table->addColumn('value', 'decimal', [\n 'default' => null,\n 'null' => false\n ]);\n $table->addColumn('comission', 'decimal', [\n 'default' => null,\n 'null' => false,\n ]);\n $table->addTimestamps(null, false);\n $table->addTimestamps(false);\n $table->create();\n }", "public function getUpSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nCREATE TABLE `movimiento`\r\n(\r\n `id` INTEGER NOT NULL AUTO_INCREMENT,\r\n `proveedor_id` INTEGER,\r\n `cliente_id` INTEGER,\r\n `tipo_movimiento` VARCHAR(10),\r\n `producto_id` INTEGER,\r\n `cantidad` INTEGER,\r\n `fecha` VARCHAR(250),\r\n PRIMARY KEY (`id`),\r\n INDEX `movimiento_FI_1` (`proveedor_id`),\r\n INDEX `movimiento_FI_2` (`cliente_id`),\r\n INDEX `movimiento_FI_3` (`producto_id`),\r\n CONSTRAINT `movimiento_FK_1`\r\n FOREIGN KEY (`proveedor_id`)\r\n REFERENCES `proveedor` (`id`),\r\n CONSTRAINT `movimiento_FK_2`\r\n FOREIGN KEY (`cliente_id`)\r\n REFERENCES `cliente` (`id`),\r\n CONSTRAINT `movimiento_FK_3`\r\n FOREIGN KEY (`producto_id`)\r\n REFERENCES `producto` (`id`)\r\n) ENGINE=InnoDB;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function run()\n {\n //DB::statement('ALTER TABLE distributors DISABLE TRIGGER ALL;');\n\n for ($cont=1;$cont<=1;$cont++){\n DB::table('order')->insert([\n 'idDistributor' => \"$cont\",\n 'id' => \"$cont\",\n 'name' => str_random(10),\n 'contact' => '111222333',\n 'commision' => 444555666,\n 'medium' => \"1\",\n 'remember_token' => \"'\".$cont.\"'\",\n 'created_at' => \"'2018-11-07 23:27:59'\",\n 'updated_at' => \"'2018-11-07 23:28:00'\",\n 'transaction_id' => \"$cont\",\n 'transaction_date' => \"'2018-11-07 23:28:01'\",\n 'transaction_host' => \"'host tx'\",\n 'transaction_user' => \"'usuario tx'\"\n ]);\n }\n\n //DB::statement('ALTER TABLE distributors ENABLE TRIGGER ALL;');\n\n }", "private function genCreateScripts($tables)\n {\n $query = '';\n foreach ($tables as $table) {\n $query .= $this->getTableStmt($this->conn1, $table) . \"; \\n\";\n }\n return $query;\n }", "public function cleanupTriggers() {\n\t\treturn false;\n\t}", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getAlias() .\" \n JOIN \".$this->_getPedido()->getModel()->getTableName().\" pedido ON ( cv_pagto_pedido.id_pedido = pedido.id ) \n LEFT JOIN \".$this->_getFormaPagamento()->getModel()->getTableName().\" forma_pagto ON ( cv_pagto_pedido.id_forma_pagto = forma_pagto.id ) \n LEFT JOIN \".$this->_getParcela()->getModel()->getTableName().\" parcela ON ( cv_pagto_pedido.id_parcela = parcela.id ) \"; \n return $sql;\n }", "function on_activate() {\n\t\t\tglobal $wpdb;\n\t\t\t$wpdb->query(\"CREATE TABLE IF NOT EXISTS {$this->table_name} (\n\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t`time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\t`category` varchar(50) DEFAULT NULL,\n\t\t\t\t`log_type` varchar(10) DEFAULT NULL,\n\t\t\t\t`message` varchar(255) DEFAULT NULL,\n\t\t\t\tPRIMARY KEY (`id`),\n\t\t\t\tKEY `time_stamp` (`time_stamp`),\n\t\t\t\tKEY `category` (`category`)\n\t\t\t)\");\n\t\t}", "protected function _createTableSql()\n\t{\n\t\treturn 'CREATE TABLE ' . $this->getTable() . ' (pgt_iou VARCHAR(255) NOT NULL PRIMARY KEY, pgt VARCHAR(255) NOT NULL)';\n\t}", "private function create_migration(){\n $file = $this->path('migrations') . date('Y_m_d_His') . '_create_slender_table.php';\n $this->write_file($file, static::$migrationCode);\n }", "public static function update_schema(): void {\n\t\tglobal $wpdb;\n\n\t\t$table_name = static::table_name();\n\t\t$table_fields = static::FIELDS;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t\t$table_fields\n\t\t\tPRIMARY KEY (id)\n\t\t) $charset_collate;\";\n\n\t\tif ( md5( $sql ) === get_option( static::TABLE . '_schemaver', '' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( static::TABLE . '_schemaver', md5( $sql ) );\n\t}", "private function getSchemaSQL(): string\n {\n return <<<EOF\ncreate table if not exists companies\n(\n id integer not null\n constraint companies_pk\n primary key autoincrement,\n name text not null,\n registration_code text not null,\n email text not null,\n phone text not null,\n comment text\n) \nEOF;\n }", "protected function toBaseSQL() {\r\n\t\t$sql=' FROM '.$this->resolveTable();\r\n\r\n\t\t$sql.=$this->buildJoinClause();\r\n\t\t$sql.=$this->buildWhereClause();\r\n\r\n\t\t$sql.=$this->buildGroupClause();\r\n\r\n\t\treturn $sql;\r\n\t}", "private function updateExistingTable() {\n $statements = []; // this will be a list of alter table statements, but only the stuff AFTER the 'alter table [tablename]' part\n //get the list of current columns in this table\n $existingColumnsFromDb = DbManager::query(\"show columns from $this->tableName\");\n\n //get the list of constraints currently available for the columns in this table. \n $constraints = Table::getConstraints($this->tableName);\n //remove all constraints from the table\n foreach ($constraints as $c) {\n //for now, the only constraints supported are primary key and foreign key\n switch ($c->CONSTRAINT_NAME) {\n case \"PRIMARY\":\n //handled below\n break;\n default:\n //assume the constraint is a foreign key. \n $statements[] = \"drop foreign key $c->CONSTRAINT_NAME\";\n break;\n }\n }\n\n foreach ($existingColumnsFromDb as $colFromDb) {\n //if the column was not found in the list, this column that is \n ////currently in the database will need to be deleted\n if ($this->getColumn($colFromDb->Field) === null) {\n $statements[] = \"drop column $colFromDb->Field\";\n }\n }\n\n //a list of names of columns that make up the primary key\n $keyNameList = [];\n //add any new columns or update existing ones\n foreach ($this->columns as $column) {\n //see if this column does not exist in the table, it is a new column. generate a new column stmt\n if ($this->columnExistsInTable($column->columnName, $existingColumnsFromDb) === false) {\n $statements[] = \"add column $column->columnName $column->dataType $column->extraStuff\";\n } else {\n //these columns exist in the table already. create update statements for each column, even if nothing has changed. it won't harm the column\n $statements[] = \"modify column $column->columnName $column->dataType $column->extraStuff\";\n }\n //add this column to the list of primary keys if it is flagged as such\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n\n //reregister the primary keys\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"\";\n if (Table::HasPrimaryKey($this->dbName, $this->tableName) == true) {\n $primaryKeySql = \"drop primary key,\";\n }\n\n $primaryKeySql .= \"add primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \"$primaryKeySql)\";\n $statements[] = $primaryKeySql;\n }\n\n //\n //apply the alter statements\n $alter = \"alter table $this->tableName\";\n $bTotalSuccess = true;\n foreach ($statements as $s) {\n $bTotalSuccess = $bTotalSuccess && DbManager::nonQuery(\"$alter $s\");\n }\n return $bTotalSuccess;\n }", "public function getTableTriggers(string $table)\n {\n $status = $this->status($table);\n if(!\\adminer\\support('trigger'))\n {\n return null;\n }\n\n // From table.inc.php\n $triggers = \\adminer\\triggers($table);\n $main_actions = [\n \\adminer\\lang('Add trigger'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n '&nbsp;',\n '&nbsp;',\n '&nbsp;',\n ];\n\n if(!$triggers)\n {\n $triggers = [];\n }\n $details = [];\n // From table.inc.php\n foreach($triggers as $key => $val)\n {\n $details[] = [\n \\adminer\\h($val[0]),\n \\adminer\\h($val[1]),\n \\adminer\\h($key),\n \\adminer\\lang('Alter'),\n ];\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public static function trigger(array $cfg){\n if ( !isset($cfg['run']) ){\n $cfg['run'] = 1;\n }\n if ( !isset($cfg['trig']) ){\n $cfg['run'] = 1;\n }\n if (self::$disabled) {\n return $cfg;\n }\n self::firstCall();\n if (self::check() &&\n (count($cfg['tables']) === 1) &&\n ($table = self::$db->tfn(current($cfg['tables']))) &&\n \\in_array($table, self::$tables, true)\n ){\n if ( $cfg['moment'] === 'after' ){\n // Case where we actually delete or restore through the $hcol column\n $values = [];\n if ( !empty($cfg['fields']) && !empty($cfg['values']) ){\n foreach ( $cfg['fields'] as $i => $f ){\n $values[$f] = $cfg['values'][$i];\n }\n }\n self::$dbs->insert(self::$dbs_table, [\n 'db' => self::$db->getCurrent(),\n 'tab' => self::$db->tsn($table),\n 'action' => $cfg['kind'],\n 'chrono' => microtime(true),\n 'rows' => empty($cfg['where']) ? '[]' : bbn\\X::jsonBase64Encode($cfg['where']),\n 'vals' => empty($values) ? '[]' : bbn\\X::jsonBase64Encode($values)\n ]);\n }\n }\n return $cfg;\n }", "public function generateDatabase()\n {\n $this->generateUserTable();\n $this->generateEmployerTable();\n $this->generateCandidateTable();\n $this->generateGuidTable();\n $this->generateWorkExperienceTable();\n $this->generateShortListTable();\n $this->generateQualTypeTable();\n $this->generateQualLevelTable();\n $this->generateQualificationsTable();\n $this->generateFieldTable();\n $this->generateSubFieldTable();\n $this->generateSkillTable();\n $this->generatePreferencesTable();\n }", "public function getDownSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 0;\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n 'blog' => '\n SET FOREIGN_KEY_CHECKS = 0;\n SET FOREIGN_KEY_CHECKS = 1;\n '\n );\n }", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function getForUpdateSQL();", "function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }", "public function getDownSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n );\n }", "static private function create_tables(){\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n self::create_views_table();\n }", "protected function buildSql() {\r\n if( !$this->sql ) {\r\n $this->sql = $this->sqlAction;\r\n if( count($this->sqlFields) === 0 ) {\r\n $this->sqlFields[] = '*';\r\n }\r\n $this->sqlStrTables = join(', ', $this->sqlTables);\r\n $this->sqlStrFields = join(', ', $this->sqlFields);\r\n $this->sqlStrConditions = join(' ', $this->sqlConditions);\r\n switch ($this->sqlAction) {\r\n case 'SELECT': $this->buildSelectSql();\r\n break;\r\n case 'UPDATE': $this->buildUpdateSql();\r\n break;\r\n case 'INSERT': $this->buildInsertSql();\r\n break;\r\n case 'DELETE': $this->buildDeleteSql();\r\n break;\r\n }\r\n }\r\n }", "public function getUpSQL()\n {\n return ['default' => \"\n INSERT INTO actions (name, needed_class, is_ajax, base_template, include_page) values\n ('sortear', 'Sortear', false, null, 'sorteio.php' )\n ;\"];\n }", "public function createMigrationsTable(): void;", "protected function getSaveSql()\n {\n $fieldNames = array_keys($this->fields);\n $sqlFields = array();\n foreach ($fieldNames as $fieldName) {\n $sqlFields[] = \"`{$fieldName}`='#{$fieldName}#'\";\n }\n\n return \"REPLACE INTO {$this->tableName} SET \" . implode(', ', $sqlFields);\n }", "function migrate(){\n\n create_table();\n save_migration_tables();\n\n}", "private function gen_provSQL() {\n\t\t\t$this -> Retun_val = true;\n\t\t}", "public function autoSetTableNames()\n\t{\n\t\t$db = $this->getDatabaseInstance();\n\t\t$query = \"SHOW TABLE STATUS LIKE 'event\\_log%'\";\n\t\t\n\t\t$result = $db->prepare($query);\n\t\t$result->execute();\n\t\t\n\t\t$table_names = array();\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\tif (strcasecmp($row['Engine'], 'MRG_MyISAM'))\n\t\t\t{\n\t\t\t\t$table_names[] = $row['Name'];\n\t\t\t}\n\t\t}\n\t\t\n\t\trsort($table_names);\n\t\t\n\t\t$this->setTableNames($table_names);\n\t\tif (isset($table_names[0]))\n\t\t{\n\t\t\t$this->setTableName($table_names[0]);\n\t\t}\n\t}", "public function change()\n {\n $table = $this->table('reset_codes');\n $table->addColumn('uuid', 'string')\n ->addColumn('code', 'text')\n ->addColumn('created_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP'])\n ->addColumn('updated_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP'])\n ->addColumn('expiration', 'datetime', ['default' => 'CURRENT_TIMESTAMP'])\n ->addIndex(['uuid'], ['unique' => true])\n ->addForeignKey('uuid', 'users', 'uuid', ['delete'=> 'CASCADE', 'update'=> 'NO_ACTION'])\n ->create();\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n DELETE FROM actions WHERE name ILIKE \\'sortear\\'\n ');\n }", "public function getUpSQL()\n {\n return array (\n 'cungfoo' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `destination_i18n`\n ADD `seo_title` VARCHAR(255) DEFAULT \\'\\' AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`;\n\nALTER TABLE `metadata_i18n`\n ADD `seo_title` VARCHAR(255) DEFAULT \\'\\' AFTER `accroche`,\n ADD `seo_description` TEXT AFTER `seo_title`;\n\nALTER TABLE `destination_i18n`\n ADD `seo_h1` VARCHAR(255) DEFAULT \\'\\' AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `metadata_i18n`\n ADD `seo_h1` VARCHAR(255) DEFAULT \\'\\' AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `destination_i18n` CHANGE `seo_title` `seo_title` VARCHAR(255);\n\nALTER TABLE `destination_i18n` CHANGE `seo_h1` `seo_h1` VARCHAR(255);\n\nALTER TABLE `metadata_i18n` CHANGE `seo_title` `seo_title` VARCHAR(255);\n\nALTER TABLE `metadata_i18n` CHANGE `seo_h1` `seo_h1` VARCHAR(255);\n\nCREATE TABLE `seo`\n(\n `id` INTEGER(5) NOT NULL AUTO_INCREMENT,\n `table_ref` VARCHAR(255) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB;\n\nCREATE TABLE `seo_i18n`\n(\n `id` INTEGER(5) NOT NULL,\n `locale` VARCHAR(5) DEFAULT \\'fr\\' NOT NULL,\n `seo_title` VARCHAR(255),\n `seo_description` TEXT,\n `seo_h1` VARCHAR(255),\n `seo_keywords` TEXT,\n PRIMARY KEY (`id`,`locale`),\n CONSTRAINT `seo_i18n_FK_1`\n FOREIGN KEY (`id`)\n REFERENCES `seo` (`id`)\n ON DELETE CASCADE\n) ENGINE=InnoDB;\n\nALTER TABLE `activite_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `avantage_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `baignade_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `bon_plan_categorie_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `bon_plan_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `categorie_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `category_type_hebergement_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `departement_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `edito_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `etablissement_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `event_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `idee_weekend_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `mise_en_avant_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `multimedia_etablissement_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `multimedia_type_hebergement_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `pays_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `personnage_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `point_interet_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `region_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `region_ref_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `service_complementaire_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `situation_geographique_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `tag_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `thematique_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `theme_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `type_hebergement_capacite_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `type_hebergement_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `ville_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nALTER TABLE `vos_vacances_i18n`\n ADD `seo_title` VARCHAR(255) AFTER `active_locale`,\n ADD `seo_description` TEXT AFTER `seo_title`,\n ADD `seo_h1` VARCHAR(255) AFTER `seo_description`,\n ADD `seo_keywords` TEXT AFTER `seo_h1`;\n\nCREATE TABLE `demande_identifiant_i18n`\n(\n `id` INTEGER NOT NULL,\n `locale` VARCHAR(5) DEFAULT \\'fr\\' NOT NULL,\n `seo_title` VARCHAR(255),\n `seo_description` TEXT,\n `seo_h1` VARCHAR(255),\n `seo_keywords` TEXT,\n PRIMARY KEY (`id`,`locale`),\n CONSTRAINT `demande_identifiant_i18n_FK_1`\n FOREIGN KEY (`id`)\n REFERENCES `demande_identifiant` (`id`)\n ON DELETE CASCADE\n) ENGINE=InnoDB;\n\nCREATE TABLE `top_camping_i18n`\n(\n `id` INTEGER NOT NULL,\n `locale` VARCHAR(5) DEFAULT \\'fr\\' NOT NULL,\n `seo_title` VARCHAR(255),\n `seo_description` TEXT,\n `seo_h1` VARCHAR(255),\n `seo_keywords` TEXT,\n PRIMARY KEY (`id`,`locale`),\n CONSTRAINT `top_camping_i18n_FK_1`\n FOREIGN KEY (`id`)\n REFERENCES `top_camping` (`id`)\n ON DELETE CASCADE\n) ENGINE=InnoDB;\n\nCREATE TABLE `demande_annulation_i18n`\n(\n `id` INTEGER NOT NULL,\n `locale` VARCHAR(5) DEFAULT \\'fr\\' NOT NULL,\n `seo_title` VARCHAR(255),\n `seo_description` TEXT,\n `seo_h1` VARCHAR(255),\n `seo_keywords` TEXT,\n PRIMARY KEY (`id`,`locale`),\n CONSTRAINT `demande_annulation_i18n_FK_1`\n FOREIGN KEY (`id`)\n REFERENCES `demande_annulation` (`id`)\n ON DELETE CASCADE\n) ENGINE=InnoDB;\n\nINSERT INTO seo (id, table_ref) VALUES (1, \\'pays\\');\nINSERT INTO seo (id, table_ref) VALUES (2, \\'region\\');\nINSERT INTO seo (id, table_ref) VALUES (3, \\'departement\\');\nINSERT INTO seo (id, table_ref) VALUES (4, \\'ville\\');\nINSERT INTO seo (id, table_ref) VALUES (5, \\'destination\\');\nINSERT INTO seo (id, table_ref) VALUES (6, \\'etablissement\\');\nINSERT INTO seo (id, table_ref) VALUES (7, \\'bon_plan\\');\nINSERT INTO seo (id, table_ref) VALUES (8, \\'top_camping\\');\nINSERT INTO seo (id, table_ref) VALUES (9, \\'poi\\');\nINSERT INTO seo (id, table_ref) VALUES (10, \\'event\\');\nINSERT INTO seo (id, table_ref) VALUES (11, \\'bon_plan_categorie\\');\nINSERT INTO seo (id, table_ref) VALUES (12, \\'category_type_hebergement\\');\nINSERT INTO seo (id, table_ref) VALUES (13, \\'type_hebergement_capacite\\');\nINSERT INTO seo (id, table_ref) VALUES (14, \\'type_hebergement\\');\nINSERT INTO seo (id, table_ref) VALUES (15, \\'region_ref\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (1, \\'fr\\', \\'Camping %pays% pas cher\\', \\'Vacances directes : découvrez nos offres de location de mobil home pas cher en %pays% pour des vacances ensoleillés en camping et réserver en ligne.\\', \\'Camping en %item% pas cher\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (1, \\'de\\', \\'günstiger Campingplatz %pays%\\', \\'Vacances Directes: Entdecken Sie unsere günstigen Angebote für die Vermietung von Wohnwagen in %pays% für einen sonnigen Urlaub auf dem Campingplatz und buchen Sie online.\\', \\'Günstig campen in %item%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (2, \\'fr\\', \\'Location mobil home %region% pas cher, camping %region%\\', \\'Réserver en ligne vos futures vacances dans la région %region% en %pays% avec Vacances directes (location de mobil-homes pas cher en camping).\\', \\'Location mobil home %item%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (2, \\'de\\', \\'Günstige Vermietung von Wohnwagen %region%, Campingplatz %region%\\', \\'Buchen Sie Ihren künftigen Urlaub in der Region %region% in %pays% mit Vacances Directes online (günstige Vermietung von Wohnwagen auf dem Campingplatz).\\', \\'Vermietung Wohnwagen %item%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (3, \\'fr\\', \\'Location mobil home %departement% pas cher, camping %departement%\\', \\'Réserver en ligne vos futures vacances dans le département %departement% en %pays% avec Vacances directes (location de mobil-homes pas cher en camping).\\', \\'Location mobil home %item%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (3, \\'de\\', \\'Vermietung von günstigen Mobilhomes %departement%, Camping %departement%\\', \\'Reservieren Sie Ihren nächsten Urlaub online im Departement %departement% in %pays% mit Vacanes directes (Vermietung von günstigen Camping-Mobilhomes).\\', \\'Vermietungsangebot Mobilhome %item%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (4, \\'fr\\', \\'Camping %ville% pas cher, location mobil home %ville% pas cher\\', \\'Découvrez l\\'\\'ensemble des campings à %ville% (%region%) proposés par Vacances Directes (location de mobil home pas cher) et réserver votre séjour en ligne.\\', \\'Camping %item% pas cher (location mobil home)\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (4, \\'de\\', \\'Günstiger Campingplatz %ville%, günstige Vermietung von Wohnwagen %ville%\\', \\'Entdecken Sie alle von Vacances Directes (günstige Vermietung von Wohnwagen) angebotenen Campingplätze in %ville% (%region%) und buchen Sie Ihren Aufenthalt online.\\', \\'Günstig campen %item% (Vermietung Wohnwagen)\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (5, \\'fr\\', \\'Camping en %destination% pas cher\\', \\'Vacances directes : découvrez nos offres de location de mobil home pas cher en %pays% pour des vacances ensoleillés en camping et réserver en ligne.\\', \\'Camping en %item% pas cher\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (5, \\'de\\', \\'Günstiger Campingplatz in %destination%\\', \\'Vacances Directes: Entdecken Sie alle unsere Angebote für die günstige Vermietung von Wohnwagen in %pays% für einen sonnigen Urlaub auf dem Campingplatz und buchen Sie online.\\', \\'Günstiger Campingplatz in %item%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (6, \\'fr\\', \\'Camping %nom%, camping %ville%\\', \\'Avec Vacances Directes, réserver en ligne votre futur séjour dans le camping %nom% : un camping %nbEtoiles% avec piscine à %ville%.\\', \\'Camping %ville%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (6, \\'de\\', \\'Campingplatz %nom%, Campingplatz %ville%\\', \\'Buchen Sie Ihren künftigen Urlaub auf dem Campingplatz %nom% mit Vacances Directes online: ein %nbEtoiles% Campingplatz mit Swimmingpool in %ville%.\\', \\'Campingplatz %ville%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (7, \\'fr\\', \\'Camping %bonPlan%, location mobil-homes %bonPlan%\\', \\'Découvrez toutes nos offres de camping : \"%bonPlan%\" et réservez en ligne vos futures vacances sur le site Vacances Directes.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (7, \\'de\\', \\'Campingplatz %bonPlan%, Vermietung Wohnwagen %bonPlan%\\', \\'Entdecken Sie alle unsere Campingangebote: \"%bonPlan%\" und buchen Sie Ihren künftigen Urlaub auf der Internetseite Vacances Directes online.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (8, \\'fr\\', \\'Top camping France, top destination vacances\\', \\'Découvrez notre top 10 des destinations pour des vacances en campings réussies avec Vacances Directes, le spécialiste de la location de mobil-home.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (8, \\'de\\', \\'Top Campingplätze Frankreich, beste Urlaubsziele\\', \\'Entdecken Sie unsere 10 besten Reiseziele für einen perfekten Campingurlaub mit Vacances Directes, der Spezialist für die Vermietung von Wohnwagen.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (9, \\'fr\\', \\'Visiter %poi% : %ville%\\', \\'%poi% à %ville%, venez visiter ce lieu et passez vos vacances dans nos campings à proximité avec Vacances Directes.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (9, \\'de\\', \\'%poi% besichtigen: %ville%\\', \\'%poi% in %ville%, besichtigen Sie diesen Ort und verbringen Sie Ihren Urlaub mit Vacances Directes auf unseren nahegelegenen Campingplätzen.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (10, \\'fr\\', \\'%event% : %ville%\\', \\'%event% à %ville%. Ne rater pas cet événement et passez vos vacances dans nos campings à proximité avec Vacances Directes.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (10, \\'de\\', \\'%event% : %ville%\\', \\'%event% in %ville%. Verpassen Sie nicht dieses Event und verbringen Sie Ihren Urlaub mit Vacances Directes auf unseren nahegelegenen Campingplätzen.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (11, \\'fr\\', \\'Camping %bonPlan%, location mobil-homes %bonPlan%\\', \\'Découvrez toutes nos offres de camping : \"%bonPlan%\" et réservez en ligne vos futures vacances sur le site Vacances Directes.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (11, \\'de\\', \\'Campingplatz %bonPlan%, Vermietung Wohnwagen %bonPlan%\\', \\'Entdecken Sie alle unsere Campingangebote: \"%bonPlan%\" und buchen Sie Ihren künftigen Urlaub auf der Internetseite Vacances Directes online.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (12, \\'fr\\', \\'Location %type% camping France, Italie, Espagne\\', \\'Vous souhaitez louer un(e) %type% pour vos futures vacances ? Découvrez tous nos campings proposant cet hébergement en France, en Espagne et en Italie.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (12, \\'de\\', \\'Vermietung %type% Campingplatz Frankreich, Italien, Spanien\\', \\'Sie möchten für Ihren künftigen Urlaub eine(n) %type% mieten? Entdecken Sie alle unsere Campingplätze, die diese Art Unterkunft in Frankreich, Spanien und Italien anbieten.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (13, \\'fr\\', \\'Location camping %type% France, Italie, Espagne\\', \\'Location de vacances pour %type% dans de nombreux campings de qualité en France, en Espagne et en Italie avec Vacances Directes.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (13, \\'de\\', \\'Vermietung Campingplatz %type% Frankreich, Italien, Spanien\\', \\'Urlaubsvermietung für %type% auf zahlreichen erstklassigen Campingplätzen in Frankreich, Spanien und Italien mit Vacances Directes.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (14, \\'fr\\', \\'Location %type% %personnes% personnes camping : %name%\\', \\'Passez vos prochaines vacances en %type% %name% dans de nombreux campings de qualité avec Vacances Directes.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (14, \\'de\\', \\'Vermietung %type% %personnes% Personen Campingplatz: %name%\\', \\'Verbringen Sie Ihren nächsten Urlaub mit Vacances Directes im %type% %name% auf zahlreichen erstklassigen Campingplätzen.\\', \\'\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (15, \\'fr\\', \\'Location mobil home %region% pas cher, camping %region%\\', \\'Réserver en ligne vos futures vacances dans la région %region% en %pays% avec Vacances directes (location de mobil-homes pas cher en camping).\\', \\'Location mobil home %item%\\', \\'\\');\nINSERT INTO seo_i18n (id, locale, seo_title, seo_description, seo_h1, seo_keywords) VALUES (15, \\'de\\', \\'Location mobil home %region% pas cher, camping %region%\\', \\'Réserver en ligne vos futures vacances dans la région %region% en %pays% avec Vacances directes (location de mobil-homes pas cher en camping).\\', \\'Location mobil home %item%\\', \\'\\');\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function alterTable()\n\t{\n\t\treturn $this->getColumnSql();\n\t}", "public function getVmPluginCreateTableSQL() {\r\n\t\t\r\n\t\t$this->getVmPluginDropTableSQL();\r\n\t\treturn $this->createTableSQL('Payment HellasPay Table');\r\n\t}", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getAlias() .\" \n JOIN \".$this->_getPedido()->getModel()->getTableName().\" pedido ON ( cv_item_pedido.id_pedido = pedido.id ) \n JOIN \".$this->_getProduto()->getModel()->getTableName().\" produto ON ( cv_item_pedido.id_produto = produto.id ) \n JOIN \".$this->_getConta()->getModel()->getTableName().\" usu_inc ON ( cv_item_pedido.id_usu_inc = usu_inc.id ) \n JOIN \".$this->_getConta()->getModel()->getTableName().\" usu_alt ON ( cv_item_pedido.id_usu_alt = usu_alt.id ) \"; \n return $sql;\n }", "public function createUpdateSql(): \\Hx\\Db\\Sql\\UpdateInterface;", "protected function buildSQL(): string\n {\n $sql = 'INSERT' . PHP_EOL;\n\n $sql .= $this->buildTable();\n $sql .= $this->buildFields();\n $this->buildBindings();\n $sql .= $this->buildValues();\n $sql .= $this->buildValuesFromSelect();\n $sql .= $this->buildReturning();\n\n\n return $sql;\n }", "public function _makeAutoincrement($name, $table, $start = 1)\r\n {\r\n $sql = array();\r\n\r\n if ( ! $this->conn->getAttribute(Doctrine_Core::ATTR_QUOTE_IDENTIFIER)) {\r\n \t$table = strtoupper($table);\r\n }\r\n $indexName = $table . '_AI_PK';\r\n $definition = array(\r\n 'primary' => true,\r\n 'fields' => array($name => true),\r\n );\r\n\t\t\r\n $sql[] = 'DECLARE\r\n constraints_Count NUMBER;\r\nBEGIN\r\n SELECT COUNT(CONSTRAINT_NAME) INTO constraints_Count FROM USER_CONSTRAINTS WHERE TABLE_NAME = \\''.$table.'\\' AND CONSTRAINT_TYPE = \\'P\\';\r\n IF constraints_Count = 0 THEN\r\n EXECUTE IMMEDIATE \\''.$this->createConstraintSql($table, $indexName, $definition).'\\';\r\n END IF;\r\nEND;'; \r\n\t\t\r\n if (is_null($start)) {\r\n $query = 'SELECT MAX(' . $this->conn->quoteIdentifier($name, true) . ') FROM ' . $this->conn->quoteIdentifier($table, true);\r\n $start = $this->conn->fetchOne($query);\r\n\r\n ++$start;\r\n }\r\n\r\n $sql[] = $this->createSequenceSql($table, $start);\r\n\r\n $sequenceName = $this->conn->formatter->getSequenceName($table);\r\n $triggerName = $this->conn->quoteIdentifier($table . '_AI_PK', true);\r\n $table = $this->conn->quoteIdentifier($table, true);\r\n $name = $this->conn->quoteIdentifier($name, true);\r\n $sql[] = 'CREATE TRIGGER ' . $triggerName . '\r\n BEFORE INSERT\r\n ON ' . $table . '\r\n FOR EACH ROW\r\nDECLARE\r\n last_Sequence NUMBER;\r\n last_InsertID NUMBER;\r\nBEGIN\r\n IF (:NEW.' . $name . ' IS NULL OR :NEW.'.$name.' = 0) THEN\r\n SELECT ' . $this->conn->quoteIdentifier($sequenceName) . '.NEXTVAL INTO :NEW.' . $name . ' FROM DUAL;\r\n ELSE\r\n SELECT NVL(Last_Number, 0) INTO last_Sequence\r\n FROM User_Sequences\r\n WHERE UPPER(Sequence_Name) = UPPER(\\'' . $sequenceName . '\\');\r\n SELECT :NEW.' . $name . ' INTO last_InsertID FROM DUAL;\r\n WHILE (last_InsertID > last_Sequence) LOOP\r\n SELECT ' . $this->conn->quoteIdentifier($sequenceName) . '.NEXTVAL INTO last_Sequence FROM DUAL;\r\n END LOOP;\r\n END IF;\r\nEND;';\r\n return $sql;\r\n }", "protected function _getSqlBase() {\n $sql = parent::_getSqlBase();\n return $sql;\n }", "function fatherly_create_generator_tables()\n{\n global $wpdb;\n $charset_collate = $wpdb->get_charset_collate();\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\n // Create table to store names of the generators and have an id associated with it\n $generator = $wpdb->prefix . 'generator';\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$generator'\") != $generator) {\n $sql = \"CREATE TABLE `$generator` (\n `post_id` BIGINT(20) NOT NULL,\n `generator_name` text NOT NULL,\n PRIMARY KEY(`post_id`)\n ) $charset_collate;\";\n dbDelta($sql);\n }\n // Create table with generator output that references the key from the first table\n $generation = $wpdb->prefix . 'generation';\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$generation'\") != $generation) {\n $sql2 = \"CREATE TABLE `$generation` (\n `id` BIGINT(20) NOT NULL AUTO_INCREMENT,\n `generator_post_id` BIGINT(20),\n `generation` text NOT NULL,\n PRIMARY KEY(`id`),\n FOREIGN KEY(`generator_post_id`) REFERENCES `$generator`(`post_id`)\n ) $charset_collate;\";\n dbDelta($sql2);\n }\n}", "public function upgrade2005010Step1()\n {\n $this->createTableFromInternalArr('xf_smodders_tgcore_command');\n }", "public function change()\n {\n $table = $this->table('notifications');\n $table->addColumn('destination', 'enum', [\n 'values' => [\n 'Global',\n 'Role',\n 'User'\n ]\n ]);\n $table->addColumn('role_id', 'string', [\n 'default' => '',\n 'limit' => 32\n ]);\n $table->changeColumn('user_id', 'string', [\n 'default' => '',\n 'limit' => 36\n ]);\n $table->removeColumn('seen');\n $table->removeColumn('deleted');\n $table->update();\n\n $tableLogs = $this->table('admin_l_t_e_notification_logs');\n $tableLogs->addColumn('notification_id', 'integer');\n $tableLogs->addColumn('user_id', 'string', [\n 'default' => null,\n 'limit' => 36,\n 'null' => false\n ]);\n $tableLogs->addColumn('created', 'datetime');\n $tableLogs->create();\n }", "public function getUpSQL()\n\t{\n\t\treturn array (\n 'propel' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP INDEX `facebook_id` ON `collector`;\nDROP INDEX `collector_FI_1` ON `collector`;\nDROP INDEX `collector_U_1` ON `collector`;\nDROP INDEX `collector_U_2` ON `collector`;\n\nCREATE UNIQUE INDEX `collector_U_1` ON `collector` (`graph_id`);\nCREATE UNIQUE INDEX `collector_U_2` ON `collector` (`facebook_id`);\nCREATE UNIQUE INDEX `collector_U_3` ON `collector` (`username`);\nCREATE UNIQUE INDEX `collector_U_4` ON `collector` (`display_name`);\nCREATE UNIQUE INDEX `collector_U_5` ON `collector` (`slug`);\nCREATE UNIQUE INDEX `collector_U_6` ON `collector` (`email`);\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}", "public static function get_table_queries_for_addons(){\n $sqls = [];\n $sqls = apply_filters('latepoint_addons_sqls', $sqls);\n return $sqls;\n }", "protected function generateDbTables()\n\t{\n\t\t$dbTables = $this->getDbTables();\n\t\t\n\t\t//get the describe of the table\n\t\tforeach ($dbTables as $table) {\n\t\t\t$describeTable = $this->describeTable($table);\n\t\t\t\n\t\t\tif ($describeTable) {\n\t\t\t\t$primaryKey = $this->getPrimaryKey($describeTable);\n\t\t\t\t$code = $this->generateDbTableCode($table, $primaryKey);\n\t\t\t\t$this->saveDbTableFile($code);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function triggersToFollowUp()\n {\n $relation = $this->hasMany('Acelle\\Model\\AutoTrigger');\n $relation->getQuery()->whereRaw(sprintf('id NOT IN (SELECT COALESCE(preceded_by, 0) FROM %s)', table('auto_triggers')));\n return $relation;\n }", "protected function setUpForeignKey()\n {\n $this->getOldTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldTable()->createColumn('bar', Type::STRING, array('length' => 50));\n $this->getOldTable()->createPrimaryKey(array('foo'), 'pk');\n\n $this->getOldForeignKeyTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldForeignKeyTable()->createColumn('bar', Type::STRING, array('length' => 50));\n $this->getOldForeignKeyTable()->createForeignKey(\n array('foo'),\n 'foo',\n array('foo'),\n ForeignKey::RESTRICT,\n ForeignKey::RESTRICT,\n 'fk_foo'\n );\n\n $this->createOldForeignKeyTable();\n }", "protected function setUpCheck()\n {\n $this->getOldTable()->createColumn('foo', Type::INTEGER);\n $this->getOldTable()->createColumn('bar', Type::INTEGER);\n $this->getOldTable()->createCheck('foo > 0', 'ck_foo');\n\n $this->createOldTable();\n }", "public function run()\n {\n if (DB::connection()->getDriverName() == 'pgsql') {\n\t\t\tDB::statement(\"update pg_class set relhastriggers=false where relname = 'configuracions';\");\n\t\t}\n\n\t\tif (DB::connection()->getDriverName() == 'pgsql') {\n //For PostgreSQL or anything else\n DB::statement('TRUNCATE TABLE configuracions CASCADE');\n }\n\n\t\t$types = [\n\t\t\t[\n 'id' => 'seo_titulo',\n 'valor' => ''\n ],\n [\n 'id' => 'seo_descripcion',\n 'valor' => ''\n ],\n [\n 'id' => 'seo_palabras_clave',\n 'valor' => ''\n ],\n [\n 'id' => 'sitio_titulo',\n 'valor' => ''\n ],\n [\n 'id' => 'sitio_descripcion',\n 'valor' => ''\n ],\n [\n 'id' => 'sitio_email',\n 'valor' => ''\n ],\n [\n 'id' => 'sitio_name',\n 'valor' => ''\n ],\n [\n 'id' => 'sitio_url',\n 'valor' => ''\n ],\n [\n 'id' => 'sitio_estado',\n 'valor' => ''\n ],\n [\n 'id' => 'sitio_slogan',\n 'valor' => 'Bienvenidos al Sitio de AASANA'\n ],\n [\n 'id' => 'sitio_logo',\n 'valor' => 'logo.png'\n ],\n [\n 'id' => 'sitio_logo_secundario',\n 'valor' => 'logo2.jpg'\n ],\n \n\t\t];\n\n\t\tDB::table('configuracions')->insert($types);\n\n\t\tif (DB::connection()->getDriverName() == 'pgsql') {\n\t\t\tDB::statement(\"update pg_class set relhastriggers = true from pg_trigger where\n pg_class.oid=tgrelid and relname='configuracions';\");\n\t\t}\n }", "function my_hook_monitor_activation_callback_function($keyword)\n{\n // create your table here, etc., and...\n // exec_query('create table if not exists `unknown_sms_data`(id int(10) not null auto_increment, primary key(id)) engine=MyISAM');\n return true; \n}", "protected function _getCreateTablesStatement() {\n\t\t$models = $this->getGarpModels();\n\t\t$statement = '';\n\n\t\tforeach ($models as $model) {\n\t\t\t$statement .= $model->getCreateStatement();\n\t\t}\n\t\t\n\t\t$statement .= $this->getBindingModel()->getCreateStatement();\n\n\t\treturn $statement;\n\t}", "abstract public function installSQL();" ]
[ "0.6392817", "0.6369824", "0.61431664", "0.59306437", "0.5834529", "0.5744326", "0.5735135", "0.56830174", "0.5567802", "0.5501619", "0.5479135", "0.54452044", "0.5441543", "0.5427446", "0.5386488", "0.53601205", "0.5355811", "0.5352981", "0.5338086", "0.5325748", "0.52895874", "0.5275398", "0.5269796", "0.5245246", "0.5218585", "0.5202531", "0.51842004", "0.51672834", "0.51656955", "0.5157793", "0.5149237", "0.5135814", "0.511465", "0.51066345", "0.509265", "0.5086031", "0.50837404", "0.50816494", "0.5080002", "0.50753224", "0.506506", "0.5051527", "0.5042037", "0.5034052", "0.50334966", "0.5027997", "0.50243396", "0.50214624", "0.5016369", "0.50099397", "0.49903935", "0.49887416", "0.49868426", "0.49860153", "0.49728677", "0.49713245", "0.49698648", "0.49650618", "0.496143", "0.496143", "0.496143", "0.496143", "0.49590933", "0.49587283", "0.49534833", "0.4952292", "0.4939728", "0.49363717", "0.49272415", "0.49249595", "0.49239153", "0.48995093", "0.48875463", "0.48869157", "0.48850435", "0.4883114", "0.48730126", "0.48601255", "0.48592445", "0.4856606", "0.48564765", "0.48550257", "0.48534203", "0.4847406", "0.4840092", "0.48389345", "0.48379254", "0.48316738", "0.48259848", "0.48227006", "0.4822135", "0.48197466", "0.48194617", "0.48089427", "0.47928476", "0.47914568", "0.47872132", "0.47770324", "0.47748327", "0.47726065" ]
0.5957945
3
Migrate a view from source to dest DB
protected function migrateView(string $view, string $setName): void { $sourceConnection = $this->sourceConnection; $destConnection = $this->destConnection; $destConnection->exec('DROP VIEW IF EXISTS ' . $sourceConnection->quoteIdentifier($view)); $driverName = $sourceConnection->getDriver()->getName(); if ($driverName === 'pdo_mysql') { $createSqlRow = $sourceConnection->query('SHOW CREATE VIEW ' . $sourceConnection->quoteIdentifier($view)) ->fetch(\PDO::FETCH_ASSOC); $createSql = $createSqlRow['Create View']; $currentDestUser = $destConnection->fetchColumn('SELECT CURRENT_USER()'); if ($currentDestUser) { //Because MySQL. SELECT CURRENT_USER() returns an unescaped user $currentDestUser = implode('@', array_map(function ($p) use ($destConnection) { return $destConnection->getDatabasePlatform()->quoteSingleIdentifier($p); }, explode('@', $currentDestUser))); $createSql = preg_replace('/\bDEFINER=`[^`]+`@`[^`]+`(?=\s)/', "DEFINER=$currentDestUser", $createSql); } } elseif ($driverName === 'pdo_sqlite') { $schemaSql = 'SELECT SQL FROM sqlite_master WHERE NAME=' . $sourceConnection->quoteIdentifier($view); $createSql = $sourceConnection->query($schemaSql)->fetchColumn(); } else { throw new \RuntimeException(__METHOD__ . " not implemented for $driverName yet"); } $destConnection->exec($createSql); $this->logger->info("$setName: migrated view '$view'"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renameView($from, $to)\n {\n $view = $this->connection->selectOne(\n \"select * from sqlite_master where type = 'view' and name = ?\",\n [$this->connection->getTablePrefix().$from]\n );\n\n $this->dropView($from);\n\n $query = Str::replaceFirst(\n $this->grammar->wrapTable($from),\n $this->grammar->wrapTable($to),\n $view->sql\n );\n\n $this->connection->statement($query);\n }", "public function migrateDb();", "function migrate(){\n\n create_table();\n save_migration_tables();\n\n}", "public function migrateDatabase();", "public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }", "function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }", "public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}", "public function migrate() {}", "function recreateSdeCompatViews() {\n global $LM_EVEDB; \n \n //blueprints\n if (!checkIfTableExists('yamlBlueprintTypes')) db_uquery(\"CREATE OR REPLACE VIEW `$LM_EVEDB`.`yamlBlueprintTypes` AS\n SELECT `typeID` as `blueprintTypeID`, `maxProductionLimit` FROM `$LM_EVEDB`.`industryBlueprints`\");\n \n if (!checkIfTableExists('yamlBlueprintProducts')) db_uquery(\"CREATE OR REPLACE VIEW `$LM_EVEDB`.`yamlBlueprintProducts` AS\n SELECT \n iap.`typeID` AS `blueprintTypeID`,\n iap.`productTypeID`,\n iap.`activityID`,\n iapr.`probability`,\n iac.`time`\n FROM `$LM_EVEDB`.`industryActivityProducts` iap\n LEFT JOIN `$LM_EVEDB`.`industryActivityProbabilities` iapr\n ON iap.`typeID`=iapr.`typeID` AND iap.`activityID`=8\n JOIN `$LM_EVEDB`.`industryActivity` iac\n ON iap.`typeID`=iac.`typeID` AND iac.`activityID`=iap.`activityID`;\");\n \n if (!checkIfTableExists('yamlBlueprintMaterials')) db_uquery(\"CREATE OR REPLACE VIEW `$LM_EVEDB`.`yamlBlueprintMaterials` AS\n SELECT `typeID` AS `blueprintTypeID`,\n `materialTypeID`,\n `quantity`,\n `activityID`,\n 0 AS `consume`\n FROM `$LM_EVEDB`.`industryActivityMaterials`;\");\n \n if (!checkIfTableExists('yamlBlueprintSkills')) db_uquery(\"CREATE OR REPLACE VIEW `$LM_EVEDB`.`yamlBlueprintSkills` AS\n SELECT `typeID` AS `blueprintTypeID`,\n `activityID`,\n `skillID` AS `skillTypeID`,\n `level`\n FROM `$LM_EVEDB`.`industryActivitySkills`;\");\n \n if (!checkIfTableExists('invBlueprintTypes')) recreateLegacyTables();\n if (!checkIfTableExists('ramTypeRequirements')) recreateLegacyTables();\n \n //graphics\n if (!checkIfTableExists('yamlGraphicIDs')) db_uquery(\"CREATE OR REPLACE VIEW `$LM_EVEDB`.`yamlGraphicIDs` AS SELECT\n `graphicID`,\n `description`, \n `graphicFile`, \n `sofFactionName`, \n `sofHullName`,\n `sofRaceName`\n FROM `$LM_EVEDB`.`eveGraphics`;\");\n \n if (!checkIfTableExists('yamlTypeIDs')) db_uquery(\"CREATE OR REPLACE VIEW `$LM_EVEDB`.`yamlTypeIDs` AS SELECT\n `typeID`,\n `graphicID`, \n `iconID`, \n 0 AS `radius`, \n `soundID`\n FROM `$LM_EVEDB`.`invTypes`;\");\n \n if (!checkIfTableExists('yamlInvTraits')) db_uquery(\"CREATE OR REPLACE VIEW `$LM_EVEDB`.`yamlInvTraits` AS SELECT\n `typeID`,\n `skillID`,\n `bonus`,\n `bonusText`,\n `unitID`\n FROM `$LM_EVEDB`.`invTraits`;\");\n \n //skins - SDE tables are compatible - no need to update\n //updateYamlSkins(FALSE);\n //updateYamlSkinLicenses(FALSE);\n //updateYamlSkinMaterials(FALSE);\n if (!checkIfTableExists('skinMaterialSets')) updateYamlSkinMaterialSets(TRUE,'../data/graphicMaterialSets.yaml');\n if (!checkIfTableExists('skinMaterialsRGB')) createSkinMaterialsRGBview();\n return TRUE;\n}", "public function execute(string $setName, TablesList $tableCollection, ViewsList $viewCollection): void\n {\n foreach ($tableCollection->getTables() as $table => $sampler) {\n try {\n $this->ensureEmptyTargetTable($table, $this->sourceConnection, $this->destConnection);\n $sampler->setTableName($table);\n $sampler->setSourceConnection($this->sourceConnection);\n $sampler->setDestConnection($this->destConnection);\n $rows = $sampler->execute();\n $this->logger->info(\"$setName: migrated '$table' with '\" . $sampler->getName() . \"': $rows rows\");\n } catch (\\Exception $e) {\n $this->logger->error(\n \"$setName: failed to migrate '$table' with '\" . $sampler->getName() . \"': \" . $e->getMessage()\n );\n throw $e;\n }\n }\n\n foreach ($viewCollection->getViews() as $view) {\n $this->migrateView($view, $setName);\n }\n\n $this->migrateTableTriggers($setName, $tableCollection);\n }", "public function migrate()\n\t{\n\t\treturn $this->getAdapter()->migrate($this->getTable(), $this->fields);\n\t}", "public function migrate()\n\t{\n\t}", "function tripal_views_views_data_alter(&$data) {\n\n // ADD IN NODE JOINS & RELATIONSHIPS\n // D7 @todo: Create custom handler to allow join from Node => Base (ie: organism)\n // with the addition of a single relationship\n // D7 @todo: Create custom handler to allow join from Base (ie: organism)\n // with the addition of a single relationship\n // D7 @todo: Add support for Mview <-> Node joins and relationships\n $tvi_query = db_query('SELECT * FROM {tripal_views} WHERE base_table=1');\n foreach ($tvi_query as $tvi_row) {\n\n //ids we'll use for queries\n $setup_id = $tvi_row->setup_id;\n $base_table = $tvi_row->table_name;\n $linker_table = 'chado_' . $base_table;\n $base_title = ucwords(str_replace('_', ' ', $base_table));\n\n // add in joins to the node tables if the Chado schema is local\n if (chado_is_local()) {\n // if a node linking table exists then add in the joins\n if (db_table_exists($linker_table)) {\n\n // Adds content (node) fields to chado base table field lists automatically\n $data['node']['table']['join'][$linker_table] = array(\n 'left_field' => 'nid',\n 'field' => 'nid',\n );\n $data[$linker_table]['table']['join'][$base_table] = array(\n 'left_field' => $base_table . '_id',\n 'field' => $base_table . '_id',\n );\n $data['node']['table']['join'][$base_table] = array(\n 'left_table' => $linker_table,\n 'left_field' => 'nid',\n 'field' => 'nid',\n );\n\n // Adds in a chado base table => node relationship\n // This allows controlled joining to multiple nodes per line\n // Use Case: link to feature and organism nodes on a feature listing\n // D7 todo: a custom relationship handler to get from feature.organism_id => organism node\n // without 1st needing to add relationship to organism table\n $base_field = $base_table . '_id';\n $data[$linker_table][$base_field] = array(\n 'group' => $base_title,\n 'title' => $base_title . 'Node',\n 'help' => t(\"Links @base_title to it's node.\", array('@base_title' => $base_title)),\n 'relationship' => array(\n 'handler' => 'views_handler_relationship',\n 'title' => t(\"@base_title => Node\", array('@base_title' => $base_title)),\n 'label' => t(\"@base_title => Node\", array('@base_title' => $base_title)),\n 'real field' => 'nid',\n 'base' => 'node',\n 'base field' => 'nid'\n ),\n );\n\n // Add Chado fields to a node-based view\n // This will only be done with relationships\n $base_field = $base_table . '_id';\n $data['node'][$base_field] = array(\n 'group' => $base_title,\n 'title' => $base_title,\n 'help' => t(\"Links node to chado @base_title.\", array('@base_title' => $base_title)),\n 'relationship' => array(\n 'handler' => 'views_handler_relationship',\n 'title' => t(\"Node => @base_title\", array('@base_title' => $base_title)),\n 'label' => t(\"Node => @base_title\", array('@base_title' => $base_title)),\n 'real field' => 'nid',\n 'base' => $linker_table,\n 'base field' => 'nid'\n ),\n );\n\n }\n }\n }\n\n return $data;\n}", "protected function migrateTables()\n {\n foreach ($this->tables as $table) {\n \\DB::getPdo()->exec(\"INSERT IGNORE INTO {$this->newDbName}.{$table} SELECT * FROM {$this->oldDbName}.{$table}\");\n }\n }", "public static function viewCopy(string $from, string $to): void\n {\n $from_path = self::viewPath($from);\n $to_path = self::viewPath($to);\n self::copy($from_path, $to_path);\n }", "function migrate()\r\n\t{\r\n\t\treturn '';\r\n\t}", "public function isMigratingUp();", "function ead_import_views_query_alter(&$view, &$query){\n if ($view->name === \"collection_search\"){\n\n\t// create inner join on the child-ancestor table\n\t// to get all ancestors for a node\n\t$join = new views_join();\n\t$join->table = 'ead_import_child_ancestor';\n\t$join->field = 'child_nid';\n\t$join->left_table = 'node';\n\t$join->left_field = 'nid';\n\t$join->type = 'INNER';\n\n\t// add the join to the query\n\t$alias = $query->ensure_table(\"ead_import_child_ancestor\", NULL, $join);\n\n }\n}", "private function moveMigration($arguments){\n\n $migrationPathWillBeMoved=staticPathModel::getProjectPath($arguments['move']).'/'.utils::getAppVersion($arguments['move']).'/migrations/schemas/'.$arguments['schema'];\n $newPath=root.'/'.staticPathModel::$storeMigrationsPath.'/schemas/'.$arguments['schema'];\n\n\n $migrationPurePath=str_replace(root.'/','',$migrationPathWillBeMoved);\n $migrationNamespace=str_replace('/','\\\\',$migrationPurePath);\n $newMigrationNamespace=str_replace('/','\\\\',str_replace(root.'/','',$newPath));\n\n\n if(rename($migrationPathWillBeMoved,$newPath)){\n\n foreach (glob($newPath.\"/*.php\") as $filename) {\n utils::changeClass($filename,[\n $migrationNamespace=>$newMigrationNamespace\n ]);\n }\n\n echo 'migration named '.$arguments['schema'].' in '.$arguments['move'].' project has been successfully moved';\n echo PHP_EOL;\n }\n\n\n $migrationSeedPathWillBeMoved=staticPathModel::getProjectPath($arguments['move']).'/'.utils::getAppVersion($arguments['move']).'/migrations/seeds';\n $newSeedPath=root.'/'.staticPathModel::$storeMigrationsPath.'/seeds';\n\n\n $migrationSeedPurePath=str_replace(root.'/','',$migrationSeedPathWillBeMoved);\n $migrationSeedNamespace=str_replace('/','\\\\',$migrationSeedPurePath);\n $newMigrationSeedNamespace=str_replace('/','\\\\',str_replace(root.'/','',$newSeedPath));\n\n if(rename($migrationSeedPathWillBeMoved,$newSeedPath)){\n\n foreach (glob($newSeedPath.\"/*.php\") as $filename) {\n utils::changeClass($filename,[\n $migrationSeedNamespace=>$newMigrationSeedNamespace\n ]);\n }\n\n echo 'migration seeds named '.$arguments['schema'].' in '.$arguments['move'].' project has been successfully moved';\n\n }\n }", "function db_clone($source, $target, $debug = false) {\n\t$source = db_input($source);\n\t$target = db_input($target);\n\n\tif(true == $debug) {\n\t\techo \"Cloning `$source` to `$target`\";\n\t}\n\n\t$sql = \"SHOW TABLES FROM `\" . $source . \"`\";\n\t$tables_query = db_query($sql);\n\twhile($tables_query->num_rows > 0 && $t = $tables_query->fetch_array()) {\n\t\tif(true == $debug) {\n\t\t\techo \".\";\n\t\t}\n\t\t$table = $t[0];\n\t\t$sql = \"DROP TABLE IF EXISTS `\" . $target . \"`.`\" . $table . \"`\";\n\t\tdb_query($sql);\n\t\t$sql = \"CREATE TABLE `\" . $target . \"`.`\" . $table . \"`\n\t\t\t\tLIKE `\" . $source . \"`.`\" . $table . \"`\";\n\t\tdb_query($sql);\n\t\t$sql = \"INSERT INTO `\" . $target . \"`.`\" . $table . \"`\n\t\t\t\tSELECT *\n\t\t\t\tFROM `\" . $source . \"`.`\" . $table . \"`\";\n\t\tdb_query($sql);\n\t}\n\tif(true == $debug) {\n\t\techo \"done!\\n\";\n\t}\n}", "public function migrate()\n {\n $this->prepareWizardsTable();\n\n $this->processProcessing();\n $this->processLogs();\n $this->processConfigData();\n\n $this->prepareOrdersTables();\n $this->prepareOrdersConfigTable();\n $this->processOrdersData();\n }", "protected function migrateLegacyImportRecords() {}", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "public function change()\n {\n $table = $this->table('calendars');\n $hasSource = $table->hasColumn('calendar_source');\n $hasSourceId = $table->hasColumn('calendar_source_id');\n\n if ($hasSource) {\n $table->renameColumn('calendar_source', 'source');\n }\n\n if ($hasSourceId) {\n $table->renameColumn('calendar_source_id', 'source_id');\n }\n }", "public function mergeRepoFilesToFullDump(string $db) : void\n {\n $repo_files = $this->getDatabaseRepoFiles($db);\n $sqlfiles = [];\n $viewfiles = [];\n\n foreach ($repo_files as $file) {\n if (preg_match('/^([a-zA-Z0-9_\\-]+)\\.([0-9]+)\\-([a-z0-9]+)\\.([a-z0-9]+)\\.sql/', $file->getFileName(), $sqlmatch)) {\n if ($sqlmatch[4] == 'view') {\n array_push($viewfiles, $this->backupRepository . '/' . $db . '/' . $file->getFileName());\n } else {\n array_push($sqlfiles, $this->backupRepository . '/' . $db . '/' . $file->getFileName());\n }\n }\n }\n\n /* Add all sql dumps in database */\n foreach ($sqlfiles as $f) {\n $this->chunkedCopyTo($f, $this->backupDir . '/' . $this->backupFormat . '/' . $db . '.sql');\n }\n\n /* Add View tables after */\n foreach ($viewfiles as $f) {\n $this->chunkedCopyTo($f, $this->backupDir . '/' . $this->backupFormat . '/' . $db . '.sql');\n }\n }", "public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}", "public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}", "public static function webMigrateAll()\n {\n ob_start();\n $controller = new self('migrate', Yii::$app);\n $controller->db = Yii::$app->db;\n $controller->interactive = false;\n $controller->includeModuleMigrations = true;\n $controller->color = false;\n $controller->runAction('up');\n\n\t\treturn ob_get_clean();\n }", "public function dropView($viewName, $schemaName, $ifExists=null){ }", "static private function create_tables(){\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n self::create_views_table();\n }", "function run($source_db,$dest_db,$dest_charset='utf8',$dest_collation='utf8_unicode_ci',$icov_source='ISO-8859-7',$icov_dest='UTF-8'){\n\t\t@$mysqli_s=new xmysqli();//make a connection \n\t\t@$mysqli_d=new xmysqli();//make a connection \n\t\t$mysqli_s->debug=$this->debug_s;//ka8orizi an 8a enfanizontai ta la8i\n\t\t$mysqli_d->debug=$this->debug_d;//ka8orizi an 8a enfanizontai ta la8i\n\t\t$mysqli_s->charset=$this->charset_s;//dilonei to proepilegmeno charset\n\t\t$mysqli_d->charset=$this->charset_d;//dilonei to proepilegmeno charset\n\t\t$mysqli_s->connect($this->host_s,$this->username_s,$this->passwd_s,$this->dbname_s);//sintaiete me tin database\n\t\t$mysqli_d->connect($this->host_d,$this->username_d,$this->passwd_d,$this->dbname_d);//sintaiete me tin database\n\t\t\n\t\t$sql=\"USE `\".$source_db.\"` ;\\n\";//xrisimopih tin proti database\n\t\t$mysqli_s->query($sql);\n\t\t\n\t\t$sql =\"DROP DATABASE IF EXISTS `\".$dest_db.\"`;\\n\";// diagrafi tin vasi an iparxei\n\t\t$sql.=\"CREATE DATABASE `\".$dest_db.\"` DEFAULT CHARACTER SET \".$dest_charset.\" COLLATE \".$dest_collation.\" ;\\n\";//dimiourgi mia kainouria me charset kai collation auto pou exoumai epileksi\n\t\t$sql.=\"USE `\".$dest_db.\"` ;\";//xrisimopih tin vasi\n\t\t$mysqli_d->query($sql,'multi');//ektailh ena polaplo erotima\n\t\t\n\t\t$source_db_struct=$mysqli_s->get_db_struct($source_db);//perno tous pinakes tis vasis\n\t\tfor($i=0;$i<count($source_db_struct);$i++){//gia ka8e pinaka\n\t\t\t$ddl=$mysqli_s->get_ddl($source_db,$source_db_struct[$i]['TABLE_NAME']);//perno tin domi tou pinaka \n\t\t\t\n\t\t\t$sql=\"DROP TABLE IF EXISTS `\".$source_db_struct[$i]['TABLE_NAME'].\"` ;\\n\";//an iparxh idi ton diagrafo \n\t\t\t$sql.=$ddl.\"\\n\";//dimiourgo ena kainourgio\n\t\t\t$sql.=\"ALTER TABLE `\".$source_db_struct[$i]['TABLE_NAME'].\"` CONVERT TO CHARACTER SET \".$dest_charset.\" COLLATE \".$dest_collation.\" ;\\n\";//allazo ta charset kai collate se auta pou exh dilosh o xristis \n\t\t\t$mysqli_d->query($sql,'multi');//ektrelh auto to polaplo erotima\n\t\t\t\n\t\t\t$sql='';//midenizo ti metavliti\n\t\t\t$qresult=$mysqli_s->query(\"SELECT * FROM `\".$source_db_struct[$i]['TABLE_NAME'].\"` ;\");//perno olla ta data apo tin vasi apo ton sigekrimeno pinaka\n\t\t\tif($mysqli_s->qresult->num_rows){//an iparxoun egrafes \n\t\t\t\t$rows=$mysqli_s->fetch_all(MYSQL_NUM);//perni oles tis engrafes\n\t\t\t\t\n\t\t\t\t//added v2.32\n\t\t\t\t//perno tin esoteriki domi ka8e field\n\t\t\t\t//giati autes i plirofories 8a xristoun parakato\n\t\t\t\t//gia na ksero ti dedomena mpori na kataxori8oun sto ka8e field\n\t\t\t\t$sqresult=$mysqli_s->qresult;\n\t\t\t\tforeach($mysqli_s->qresult->fields as $fvalue){\n\t\t\t\t\t$field_struct[$source_db_struct[$i]['TABLE_NAME']][$fvalue['orgname']]=$mysqli_s->get_field_struct($source_db,$source_db_struct[$i]['TABLE_NAME'],$fvalue['orgname']);\n\t\t\t\t}\n\t\t\t\t$mysqli_s->qresult=$sqresult;\n\t\t\t\t\n\t\t\t\tfor($j=0;$j<count($rows);$j++){//gia ka8e row\n\t\t\t\t\t$sql='INSERT INTO `'.$source_db_struct[$i]['TABLE_NAME'].'` VALUES (';//stini tin sql gia tin egrafh\n\t\t\t\t\tfor($k=0;$k<count($mysqli_s->qresult->fields);$k++){//gia ka8e field\n\t\t\t\t\t\tif((is_string($rows[$j][$k])||is_float($rows[$j][$k])) && (!preg_match('/\\\\A(?<!\\\\S)\\\\d++(?!\\\\S)\\\\Z/',$rows[$j][$k]))){//an einai string h an einai float kai den einai integer bugfix 2.21\n\t\t\t\t\t\t\t//metatrepi tin kodikopihsi apo tin kodikopihsh pou exoumai se autin pou exoumai dialeksi\n\t\t\t\t\t\t\t//an vri xaraktires pou den einai anagnosimh tous kanh ignore\n\t\t\t\t\t\t\t//vgazi ta slashes kai gia logous asfalias ta ksanavazi \n\t\t\t\t\t\t\t$sql.='\"'.addslashes(stripslashes(iconv($icov_source, $icov_dest.'//IGNORE',$rows[$j][$k]))).'\"';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//an to timh einai adia tote elenxo an to sigkekrimeno field dexetai NULL an nai tote perni timi NULL allios perni ena adio string ''\n\t\t\t\t\t\t\tif($rows[$j][$k]==''){\n\t\t\t\t\t\t\t\tif($field_struct[$source_db_struct[$i]['TABLE_NAME']][$mysqli_s->qresult->fields[$k]['orgname']]['IS_NULLABLE']=='YES'){\n\t\t\t\t\t\t\t\t\t$rows[$j][$k]='NULL';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$rows[$j][$k]='';\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//an einai int kataxorite opos einai\n\t\t\t\t\t\t\t$sql.=$rows[$j][$k];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//an den einai to teleuteo pedio vazi ena ',' gia na domi8i kala to sql string mas\n\t\t\t\t\t\tif(($mysqli_s->qresult->field_count-1)!=$k){\n\t\t\t\t\t\t\t$sql.=\" ,\";\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$sql.=') ;';//klini to sql mas\n\t\t\t\t\t$mysqli_d->query($sql);//ekteli to erotima tis egrafis\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function transfer_data()\n\t{\n\t\t$num_rows = db::select_one(\"select count(*) from {$this->table}\");\n\t\t\n\t\tfor ($i = 0; $i < $num_rows; $i += BATCH_SIZE)\n\t\t{\n\t\t\techo \"$i / $num_rows (select {$this->before_alter_select_query} from {$this->table})\\n\";\n\t\t\t$r = mysql_query(\"select {$this->before_alter_select_query} from {$this->table} limit $i, \".BATCH_SIZE);\n\t\t\twhile ($d = mysql_fetch_assoc($r))\n\t\t\t{\n\t\t\t\tif ($this->renamed_cols)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->renamed_cols as $before_key => $after_key)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d[$after_key] = $d[$before_key];\n\t\t\t\t\t\tunset($d[$before_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdb::insert($this->temp_table, $d);\n\t\t\t}\n\t\t}\n\t}", "function migrate_books_build_new_image($source_repository, $destination_repository, $source_pid, $destination_dir_pid) {\n\n $source_image_object = $source_repository->getObject($source_pid);\n $new_image_object = $destination_repository->constructObject('islandora');\n $new_image_object->label = $source_image_object->label;\n foreach ($source_image_object as $dsid => $content) {\n $new_image_object->ingestDatastream($content);\n }\n $new_image_object->relationships->changeObjectID($new_image_object->id);\n $new_image_object->relationships->remove(FEDORA_RELS_EXT_URI, 'isMemberOfCollection', NULL);\n $new_image_object->relationships->add(FEDORA_RELS_EXT_URI, 'isMemberOfCollection', $destination_dir_pid);\n $ingested_object = islandora_add_object($new_image_object);\n return $ingested_object->id;\n}", "public function action_up_migration_get()\n {\n $this->load->library('migration');\n $this->migration->current();\n }", "public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }", "protected function exportViews()\n {\n foreach ($this->views as $key => $value) {\n $path = base_path('resources/views/'.$value);\n $this->line('<info>Created View:</info> '.$path);\n copy(__DIR__.'/../../stubs/views/'.$key, $path);\n }\n }", "protected function exportViews()\n {\n foreach ($this->views as $key => $value) {\n if (file_exists($view = $this->getPath($key, 'blade.php'))) {\n $this->error($key . ' already exists!');\n }\n else {\n copy(\n __DIR__.$value,\n $view\n );\n\n $this->replace('{{ heading }}', $this->plural(), $view);\n $this->replace('{{ title }}', $this->argument('name'), $view);\n $this->replace('{{ model }}', $this->camel(), $view);\n\n if ($this->argument('name') == ucfirst($this->argument('package'))) {\n $this->replace('{{ uri }}', $this->kebabPlural(), $view);\n }\n else {\n $this->replace('{{ uri }}', $this->argument('package') . '/' . $this->kebabPlural(), $view);\n }\n }\n }\n }", "function drush_migrate_govcms_migrate_build() {\n drush_log(dt('Start creating the migration.'), 'ok');\n // Reset the file_get_stream_wrappers static cache.\n $wrappers_storage = &drupal_static('file_get_stream_wrappers', NULL, TRUE);\n\n module_load_include('inc', 'migrate_ui', 'migrate_ui.wizard');\n\n // Prepare custom content.\n $site_info = migrate_govcms_site_info();\n $site_info['wxr_file'] = $site_info['wxr_path'] . \"/\" . $site_info['wxr_filename'];\n $site_info['default_author'] = 'Site Factory admin';\n $site_info['attachment_field'] = 'field_image';\n\n drush_log(dt('Try to get XML file object information.'));\n $file_info = _migrate_govcms_file_object($site_info['wxr_file']);\n\n drush_log(dt('Ready to build migration instance.'));\n $_FILES['files']['tmp_name']['wxr_file'] = $file_info->uri;\n $_FILES['files']['name']['wxr_file'] = $file_info->filename;\n $_FILES['files']['error']['wxr_file'] = 0;\n $_FILES['files']['size']['wxr_file'] = $file_info->filesize;\n\n // Add custom bundles.\n foreach ($site_info['bundles'] as $bundle => $bundle_values) {\n $site_info[$bundle . '_type'] = $bundle;\n }\n\n $form_state['values'] = $site_info;\n $form_state_values = $form_state['values'];\n\n // Build the import form.\n $form = drupal_get_form('migrate_ui_wizard', 'GovCMSMigrateWordPressWizard');\n $form = migrate_ui_wizard($form, $form_state, 'GovCMSMigrateWordPressWizard');\n // Create a Migrate Wizard object.\n $form_state['wizard'] = new GovCMSMigrateWordPressWizard();\n // Add migration extender.\n $form_state['wizard']->addExtender('GovCMSMigrateWordPressWizardExtender');\n drush_log(dt('Start building migration instance file.'));\n $form_state['wizard']->sourceDataFormValidate($form_state);\n drush_log(dt('Start adding migration bundles classes file.'));\n $form_state['wizard']->authorFormValidate($form_state);\n $form_state['wizard']->contentSelectFormValidate($form_state);\n $form_state['wizard']->contentBlogPostFormValidate($form_state);\n $form_state['wizard']->contentPageFormValidate($form_state);\n $form_state['wizard']->customContentSelectFormValidate($form_state);\n drush_log(dt('Start building migration instance classes.'));\n $form_state['wizard']->reviewForm($form_state);\n\n // Submit the form.\n drush_log(dt('Final step to save the migration settings.'));\n drupal_form_submit('migrate_ui_wizard', $form_state);\n // Save the settings into the wizard object.\n $form_state['wizard']->formSaveSettings();\n // Display success message.\n drush_log(dt('The migration is created successfully.'), 'ok');\n}", "function _migrate($filename) {\n\t\t$migrations = $this->migration;\n\n\t\t$this->conn->execute(file_get_contents(\"migrations/$filename\"));\n\t\t$migrations->save($migrations->newEntity(['migration_file' => $filename]));\n\t}", "public function refreshDatabase()\n {\n $this->validateDatabase();\n $this->copySqliteCreate();\n $this->runMigrations();\n\n copy($this->baseSqlite(), $this->copySqlite());\n }", "function upgradeTableDb( $from_version )\n {\n // $from_version is the current version of this game database, in numerical form.\n // For example, if the game was running with a release of your game named \"140430-1345\",\n // $from_version is equal to 1404301345\n\n // Example:\n// if( $from_version <= 1404301345 )\n// {\n// $sql = \"ALTER TABLE xxxxxxx ....\";\n// self::DbQuery( $sql );\n// }\n// if( $from_version <= 1405061421 )\n// {\n// $sql = \"CREATE TABLE xxxxxxx ....\";\n// self::DbQuery( $sql );\n// }\n// // Please add your future database scheme changes here\n//\n//\n\n\n }", "public function migrate()\n {\n $db = new \\SQLite3(\"ATM.db\");\n\n $query = \"CREATE TABLE IF NOT EXISTS \" . $this->table_name . \" \";\n $fields = array();\n\n foreach($this->fields as $name=>$type) {\n $fields[] = \"$name $type\";\n }\n\n $query .= \"(\" . implode(\", \", $fields) . \")\";\n\n $db->exec($query);\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public static function dbMigrate(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Migrate the database\n\t\t\tArtisan::call('migrate');\n\t\t}\n\t}", "private function createNewMigration() {\n // $this->MigrationFieldCollection[$this->getModel()->getShortModelName()];\n $changes = []; //these fields are added or updated if the fieldnames is not in this array delete it.\n foreach ($this->getModel()->getFieldCollection() as $fieldName => $field) {\n //var_dump($this->checkFieldProperties($field)); --mark if the fieldsproperties are default or not\n $this->checkFieldProperties($field);\n var_dump($field);\n\n if (!empty($this->MigrationFieldCollection[$this->getModel()->getShortModelName()][$fieldName])) {\n $reflection = new \\ReflectionObject($field);\n $changes = [];\n $this->checkFieldProperties($field);\n\n foreach ($reflection->getProperties() as $fieldValues) {\n\n }\n //we want to update this field\n } else {\n\n //copy this field since we create\n }\n }\n foreach ($this->MigrationFieldCollection[$this->getModel()->getShortModelName()] as $migrationFieldName => $migrationField) {\n if (!in_array($migrationFieldName, $changes)) {\n $this->newMigrationLines[] = $this->modelFieldToMigrationString($migrationField['dataStructure'], 'delete');\n }\n }\n }", "public function migrate()\n\t{\n\t\t$old_scorecards = $this->old->table(self::SCORECARD_TABLE_NAME)->where('scorecard_type', 'MASTER')->get();\n\t\t$new_scorecards = $this->new->table(self::SCORECARD_TABLE_NAME)->where('type', 'MASTER')->get();\n\n\t\tforeach($old_scorecards as $key => $old)\n\t\t{\n\t\t \t$this->updateScorecard($old, $new_scorecards[$key]);\n\t\t}\n\n\t\t$this->updateItems();\n\n\t\treturn true;\n\t}", "function migrate($migrateTo){\n\t$settingsModel = new Settings;\n\t(int) $currentVersion = $settingsModel->getVersion();\n\t\n\t//Display current database version\n\tif($migrateTo == 'version'){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database is currently at version #\".$currentVersion.\"\\n\\n\");\n\t}\n\t\n\t//Die if trying to migrate to current version - duh!\n\tif($migrateTo == $currentVersion){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database already at version #\".$migrateTo.\"\\n\\n\");\n\t}\n\t\n\t//Get migration scripts\n\t$migrations = scandir(APPLICATION_PATH.\"/../scripts/migrations\");\n\t\n\t//Get latest migration number and filter .. and .\n\tforeach($migrations AS $migration){\n\t\tif($migration<> '.' && $migration <> '..'){\n\t\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$migration));\n\t\t\t\n\t\t\t$latestMigration = $number;\n\t\t}\n\t}\n\t\n\t//decide whether to take user input or migrate to most recent version\n\tif(isset($migrateTo)){\n\t\t(int)$migrateTo = $migrateTo;\n\t} else {\n\t\t(int)$migrateTo = $latestMigration;\n\t}\n\t\n\t//Die if trying to migrate to current version - duh!\n\tif($latestMigration == $currentVersion){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database already at version #\".$migrateTo.\"\\n\\n\");\n\t}\n\t\n\t//decide whether we are migrating up or down and order scripts accordingly\n\tif($migrateTo <= $currentVersion){\n\t\t$direction = 'down';\n\t\t$migrations = array_reverse($migrations);\n\t} else {\n\t\t$direction = 'up';\n\t}\n\t\n\t//build runFiles array\n\t$runFiles = array();\n\tforeach($migrations AS $migration){\n\t\tif($migration<> '.' && $migration <> '..'){\n\t\t\t//get only the version number\n\t\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$migration));\n\t\t\tif($direction == 'up'){\n\t\t\t\tif($currentVersion < $number && $number <= $migrateTo){\n\t\t\t\t\t//add to runFiles array\n\t\t\t\t\t$runFiles[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($direction == 'down'){\n\t\t\t\tif($currentVersion >= $number && $number > $migrateTo){\n\t\t\t\t\t//add to runFiles array\n\t\t\t\t\t$runFiles[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\t//start counter at 0\n\t$migratedTo = 0;\n\n\t//cycle through scripts\n\tforeach($runFiles AS $file){\n\t\t//get only the version number\n\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$file));\n\t\t\n\t\t//get migration class name\n\t\t$className = ucwords(str_replace(\".php\",'',$file));\n\t\t\n\t\t//include dependencies\n\t\tinclude APPLICATION_PATH.'/../scripts/migrations/'.$file;\n\t\t\n\t\t//instantiate migration class\n\t\t$migration = new $className;\n\t\t\n\t\tif($direction == 'up'){\n\t\t\t//run up() migration method\n\t\t\t$migration->up();\n\t\t\t//mark as last migration run\n\t\t\t$migratedTo = $number;\n\t\t}\n\t\tif($direction == 'down'){\n\t\t\t//run down migration method\n\t\t\t$migration->down();\n\t\t\t//mark as lat migration run\n\t\t\t$migratedTo = $number - 1;\n\t\t}\n\t\t\n\t\t\n\t}\n\t//update db with new version number\n\t$settingsModel->setVersion($migratedTo);\n\t\n\t//output results to terminal\n\techo \"\\n\\n\";\n\techo \"Database Migrated to Version #\".$migratedTo;\n\techo \"\\n\\n\";\n\n}", "public function change()\n {\n\t\t$table=$this->table('comp_front_sources')\n\t\t\t\t\t->addColumn('main_title','string',array('null'=>true,'default'=>'标题','comment'=>'主标题'))\n\t\t\t\t\t->addColumn('sub_title','string',array('null'=>true,'comment'=>'副标题'))\n\t\t\t\t\t->addColumn('main_pic','string',array('null'=>true,'comment'=>'主要图片'))\n\t\t\t\t\t->addColumn('secondary_pic','string',array('null'=>true,'comment'=>'次要图片'))\n\t\t\t\t\t->addColumn('main_content','string',array('null'=>true,'default'=>'暂时没有内容','comment'=>'主要内容'))\n\t\t\t\t\t->addColumn('secondary_content','string',array('null'=>true,'comment'=>'次要内容'))\n\t\t\t\t\t->addColumn('main_figure','string',array('null'=>true,'comment'=>'主要数值'))\n\t\t\t\t\t->addColumn('secondary_figure','string',array('null'=>true,'comment'=>'次要数值'))\n\t\t\t\t\t->addColumn('parameter','string',array('null'=>true,'comment'=>'参数'))\n\t\t\t\t\t->addColumn('category','string',array('null'=>true,'default'=>'未分类','comment'=>'分类'))\n\t\t\t\t\t->addColumn('description','string',array('null'=>true,'comment'=>'备注'))\n\t\t\t\t\t->addColumn('created_at','integer', array('null'=>true))\n\t\t\t\t\t->save();\n\t}", "public function migrateAndSeed()\n {\n return $this->migrate();\n }", "public function doRevertToLive() {\n\t\tif($this->Fields()) {\n\t\t\tforeach($this->Fields() as $field) {\n\t\t\t\t$field->writeToStage('Live', 'Stage');\n\t\t\t}\n\t\t}\n\t\t\n\t\tparent::doRevertToLive();\n\t}", "function getNewTransformationDataSql(\n $pma_transformation_data, array $column_map, $view_name, $db\n ) {\n $cfgRelation = $this->relation->getRelationsParam();\n\n // Need to store new transformation details for VIEW\n $new_transformations_sql = sprintf(\n \"INSERT INTO %s.%s (\"\n . \"`db_name`, `table_name`, `column_name`, \"\n . \"`comment`, `mimetype`, `transformation`, \"\n . \"`transformation_options`) VALUES\",\n Util::backquote($cfgRelation['db']),\n Util::backquote($cfgRelation['column_info'])\n );\n\n $column_count = 0;\n $add_comma = false;\n\n while ($data_row = $this->dbi->fetchAssoc($pma_transformation_data)) {\n\n foreach ($column_map as $column) {\n\n if ($data_row['table_name'] != $column['table_name']\n || $data_row['column_name'] != $column['refering_column']\n ) {\n continue;\n }\n\n $new_transformations_sql .= sprintf(\n \"%s ('%s', '%s', '%s', '%s', '%s', '%s', '%s')\",\n $add_comma ? ', ' : '',\n $db,\n $view_name,\n isset($column['real_column'])\n ? $column['real_column']\n : $column['refering_column'],\n $data_row['comment'],\n $data_row['mimetype'],\n $data_row['transformation'],\n $GLOBALS['dbi']->escapeString(\n $data_row['transformation_options']\n )\n );\n\n $add_comma = true;\n $column_count++;\n break;\n }\n\n if ($column_count == count($column_map)) {\n break;\n }\n }\n\n return ($column_count > 0) ? $new_transformations_sql : '';\n }", "public function migrate() \n {\n\n Masteryl_Migration::createOrUpdateDir(MASTERYL_MIGRATIONS_PATH, $this);\n\n if(!empty($this->modules)) {\n foreach($this->modules as $mod) {\n $dir = $mod['path'].'migrations';\n \n if(file_exists($dir))\n Masteryl_Migration::createOrUpdateDir($dir, $this);\n }\n }\n\n }", "public function update_post_view_table_structure() {\n global $wpdb;\n\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.11.4', '<' ) ) {\n return;\n }\n\n $table = $wpdb->prefix . 'laterpay_post_views';\n $columns = $wpdb->get_results( 'SHOW COLUMNS FROM ' . $table . ';' );\n\n $is_up_to_date = false;\n\n foreach ( $columns as $column ) {\n if ( $column->Field === 'id' ) {\n $is_up_to_date = true;\n }\n }\n\n if ( ! $is_up_to_date ) {\n $wpdb->query( 'ALTER TABLE ' . $table . ' ADD `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;' );\n $wpdb->query( 'ALTER TABLE ' . $table . ' DROP COLUMN `count`;' );\n }\n }", "public function upgradeRecords() {\n foreach ($this->records as $record) {\n $type = $record[$this->Version->Version->alias]['type'];\n $version = $record[$this->Version->Version->alias]['version'];\n\n $mapping = $this->mappings[$type];\n $migration = $mapping[$version];\n\n $this->Version->Version->id = $record[$this->Version->Version->alias]['id'];\n $this->Version->Version->saveField('class', $migration['class']);\n }\n }", "public function convertLegacyViewDefsToLumia() {}", "public function migrate() {\n \n\n /**\n * create table for cities\n */\n if (!Capsule::schema()->hasTable('city')) {\n Capsule::schema()->create('city', function($table)\n {\n $table->integer('id', true);\n $table->string('name');\n $table->string('lat');\n $table->string('lng');\n $table->integer('zoom_level');\n });\n }\n\n /**\n * create table for series\n */\n if (!Capsule::schema()->hasTable('serie')) {\n Capsule::schema()->create('serie', function($table)\n {\n\n $table->integer('id', true);\n $table->string('distance')->default('');\n $table->string('image')->default('');\n $table->string('name')->default('');\n $table->timestamp('updated_at')->default(Capsule::raw('CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP'));\n $table->timestamp('created_at')->default(Capsule::raw('CURRENT_TIMESTAMP'));\n //FK\n $table->integer('city_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('city_id')->references('id')->on('city')->onDelete('cascade');\n // We'll need to ensure that MySQL uses the InnoDB engine to\n // support the indexes, other engines aren't affected.\n $table->engine = 'InnoDB';\n });\n }\n\n /**\n * create table photos\n */\n if (!Capsule::schema()->hasTable('photo')) {\n Capsule::schema()->create('photo', function($table)\n {\n $table->integer('id', true);\n $table->string('url');\n $table->string('description');\n $table->string('lat');\n $table->string('lng');\n //FK\n $table->integer('serie_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('serie_id')->references('id')->on('serie')->onDelete('cascade');\n });\n }\n\t\t\n\t\t/**\n * create table partie\n */\n if (!Capsule::schema()->hasTable('partie')) {\n Capsule::schema()->create('partie', function($table)\n {\n $table->integer('id', true);\n $table->string('token');\n $table->integer('nb_photos');\n $table->integer('state');\n $table->string('player_username');\n $table->integer('score');\n $table->integer('serie_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('serie_id')->references('id')->on('serie')->onDelete('cascade');\n });\n }\n\n /**\n * create table palier\n */\n if (!Capsule::schema()->hasTable('palier')) {\n Capsule::schema()->create('palier', function($table)\n {\n $table->integer('id', true);\n $table->integer('coef');\n $table->integer('points');\n\n //FK\n $table->integer('serie_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('serie_id')->references('id')->on('serie')->onDelete('cascade');\n });\n }\n\n /**\n * create table temps\n */\n if (!Capsule::schema()->hasTable('temps')) {\n Capsule::schema()->create('temps', function($table)\n {\n $table->integer('id', true);\n $table->integer('nb_seconds');\n $table->integer('coef');\n\n //FK\n $table->integer('serie_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('serie_id')->references('id')->on('serie')->onDelete('cascade');\n });\n }\n /**\n * create table temps\n */\n if (!Capsule::schema()->hasTable('user')) {\n Capsule::schema()->create('user', function($table)\n {\n $table->integer('id', true);\n $table->string('username');\n $table->string('password');\n\n $table->engine = 'InnoDB';\n\n });\n }\n\n }", "public function insertView($model)\n {\n\t$modelName= is_object($model) ? $model->getTableName() : $model;\n\t$sql=array();\n\n\t$sql[] = $this->sql('insert into [views] values (null, %s, %s);', $model->getTableName(), $model->getHash() );\n\n\t$this->queue(\n\t PerfORMStorage::VIEW_ADD,\n\t $modelName,\n\t $sql,\n\t array(\n\t\t'model' => $model)\n\t );\n\n\t$key= $model->getHash();\n\tif ( key_exists($key, $this->renamedViews))\n\t{\n\t $array= $this->renamedViews[$key];\n\t $array->counter++;\n\t $array->to= $modelName;\n\t}\n\telse\n\t{\n\t $this->renamedViews[$key]= (object) array(\n\t 'counter' => 1,\n\t 'to' => $modelName,\n\t );\n\t}\n }", "public function onPostRowSave(MigratePostRowSaveEvent $event) {\n $migration = $event->getMigration();\n $migration_id = $migration->id();\n\n // Only act on rows for this migration.\n if (array_key_exists($migration_id, self::getMigrations())) {\n $row = $event->getRow();\n $destination_ids = $event->getDestinationIdValues();\n $reference_id = $destination_ids[0];\n\n // Contributors.\n $authors = $this->createContributors($row, 'author');\n $editors = $this->createContributors($row, 'editor');\n $series_editors = $this->createContributors($row, 'series_editor');\n $translators = $this->createContributors($row, 'translator');\n $src_contributors = $this->createContributors($row, 'contributor');\n $book_authors = $this->createContributors($row, 'book_author');\n $reviewed_authors = $this->createContributors($row, 'reviewed_author');\n\n $contributors = array_merge(\n $authors,\n $editors,\n $series_editors,\n $translators,\n $src_contributors,\n $book_authors,\n $reviewed_authors\n );\n\n // Instance and update reference.\n $item_type = $row->getSourceProperty('item_type');\n $entity_type = self::getZoteroTypeMappings()[$item_type];\n\n $reference = $this->typeManager\n ->getStorage($entity_type)\n ->load($reference_id);\n\n // Use source publication year if empty from publication date.\n $pub_year = trim($row->getSourceProperty('publication_year'));\n $src_year = $row->getSourceProperty('src_publication_year');\n\n if (empty($pub_year)) {\n $pub_year = !empty($src_year) ? $src_year : NULL;\n }\n\n if ((int) $pub_year == 0) {\n $pub_year = NULL;\n }\n\n // Default collection.\n $collection_name = self::getMigrations()[$migration_id];\n\n // If it's a religion migration, add to religion Collection.\n $parts = explode(': ', $collection_name);\n\n if ($parts[0] == 'Religion') {\n $collection_name = $parts[0];\n }\n\n if (!empty($collection_name)) {\n $existing = $this->typeManager->getStorage('yabrm_collection')\n ->getQuery()\n ->condition('name', $collection_name)\n ->accessCheck(FALSE)\n ->execute();\n\n reset($existing);\n $col_id = key($existing);\n\n // Create collection if doesn't exist.\n if (empty($col_id)) {\n $collection = BibliographicCollection::create([\n 'name' => $collection_name,\n ]);\n\n $collection->save();\n $col_id = $collection->id();\n }\n }\n\n $collections[] = $col_id ? $col_id : NULL;\n\n // Archive.\n $arch_name = $row->getSourceProperty('archive');\n\n if (!empty($arch_name)) {\n $existing = $this->typeManager->getStorage('taxonomy_term')\n ->getQuery()\n ->condition('name', $arch_name)\n ->condition('vid', 'nbbib_archives')\n ->accessCheck(FALSE)\n ->execute();\n\n reset($existing);\n $arch_id = key($existing);\n\n // Create archive if doesn't exist.\n if (empty($arch_id)) {\n $archive = Term::create([\n 'name' => $arch_name,\n 'vid' => 'nbbib_archives',\n ]);\n\n $archive->save();\n $arch_id = $archive->id();\n }\n }\n\n $archives[] = $arch_id ? $arch_id : NULL;\n\n // URL.\n $source_url = $row->getSourceProperty('url');\n $uri = substr(trim($source_url), 0, 4) === 'http' ? $source_url : NULL;\n $link_title = strlen($uri) > 125 ? substr($uri, 0, 125) . '...' : $uri;\n\n if ($uri) {\n\n $url = [\n 'uri' => $uri,\n 'title' => $link_title,\n 'options' => [\n 'attributes' => [\n 'target' => '_blank',\n ],\n ],\n ];\n\n $reference->setUrl($url);\n }\n\n $reference->setContributors($contributors);\n $reference->setPublicationYear($pub_year);\n $reference->setCollections($collections);\n $reference->setArchive($archives);\n $reference->setPublished(FALSE);\n $reference->save();\n }\n }", "public function postImport() {\n parent::postImport();\n\n // i18n Translation Set.\n $result = db_query('SELECT n.sourceid1, n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n');\n foreach ($result as $record) {\n $sourceid_tmp = preg_replace('#_fra_#', '_eng_', $record->sourceid1);\n $source_mlid = 0;\n $translated_mlid = 0;\n if (preg_match('/_fra_/i', $record->sourceid1)) {\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $record->sourceid1));\n foreach ($result as $result_row) {\n $translated_mlid = $result_row->destid1;\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $sourceid_tmp));\n foreach ($result as $result_row) {\n $source_mlid = $result_row->destid1;\n break;\n }\n break;\n }\n if (($source_mlid != 0) && ($translated_mlid != 0)) {\n $translation_set = i18n_translation_set_create('menu_link');\n $translation_set->reset_translations();\n $item = menu_link_load($source_mlid);\n $translation_set->add_item($item, 'en');\n $item = menu_link_load($translated_mlid);\n $translation_set->add_item($item, 'fr');\n $translation_set->save(TRUE);\n }\n }\n }\n }", "public function copyContentToTranslation( &$dbObject, $origObject );", "public function down(Schema $schema): void\n {\n $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \\'postgresql\\'.');\n\n $this->addSql(\"\n CREATE OR REPLACE VIEW view_company_transactions AS\n SELECT r.id as id,\n NULL::varchar as client_1c_id,\n r.fc_cbr_id as fc_cbr_id,\n r.amount::bigint as amount,\n r.operation_date as date,\n 'refill'::varchar as type\n FROM refill_balance r\n UNION ALL\n SELECT d.id as id,\n d.client_1c_id as client_1c_id,\n NULL::varchar as fc_cbr_id,\n d.discount_sum::bigint as amount,\n d.operation_date as date,\n 'discount'::varchar as type\n FROM discounts d\n UNION ALL\n SELECT card_transactions.id as id,\n card_transactions.client_1c_id as client_1c_id,\n NULL::varchar as fc_cbr_id,\n sum(card_transactions.debit)::bigint as amount,\n ((date_trunc('day', days.d) + INTERVAL '1 DAY' - INTERVAL '1 SECOND') - INTERVAL '1 DAY') as date,\n 'write-off-cards'::varchar as type\n FROM (\n SELECT min(post_date), max(post_date)\n FROM card_transactions as t\n ) AS minmax\n CROSS JOIN LATERAL generate_series(minmax.min, minmax.max, '1 DAY')\n AS days(d)\n LEFT OUTER JOIN card_transactions ON post_date >= days.d\n AND post_date < (days.d + '1 DAY')\n WHERE id IS NOT NULL\n GROUP BY days.d, id;\n \");\n }", "public function convertLegacyViewDefsToSidecar()\n {\n $client = $this->client == 'wireless' ? 'mobile' : $this->client;\n $this->logUpgradeStatus('Converting ' . $this->client . ' ' . $this->viewtype . ' view defs for ' . $this->module);\n\n // Leave the original legacy viewdefs in tact\n $defs = $this->legacyViewdefs;\n\n // Find out which panel key to use based on viewtype and client\n $panelKey = $this->panelKeys[$this->client.$this->viewtype];\n if (isset($defs[$panelKey])) {\n // Get the converted defs\n $fields = $this->handleConversion($defs, $panelKey);\n\n // If we still don't have new viewdefs then fall back onto the old\n // ones. This shouldn't happen, but we need to make sure we have defs\n $newdefs = $this->loadDefaultMetadata();\n if (empty($newdefs)) {\n $newdefs = $defs;\n }\n\n // Set the new panel defs from the fields that were just converted\n $paneldefs = array(array('label' => 'LBL_PANEL_DEFAULT', 'fields' => $fields));\n\n // Kill the data (old defs) and panels (new defs) elements from the defs\n unset($newdefs['data'], $newdefs['panels']);\n\n // Create, or recreate, the panel defs\n $newdefs['panels'] = $paneldefs;\n\n // Clean up the module name for saving\n $module = $this->getNormalizedModuleName();\n $this->logUpgradeStatus(\"Setting new $client:{$this->type} view defs internally for $module\");\n // Setup the new defs\n $this->sidecarViewdefs[$module][$client]['view'][$this->viewtype] = $newdefs;\n }\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }", "public function __invoke()\n {\n $this->migrate();\n }", "function sfgov_utilities_deploy_06_field_dept_migration() {\n try {\n // migrate to field_departments from field_dept or field_public_body\n $informationPageNodes = Utility::getNodes('information_page');\n $campaignNodes = Utility::getNodes('campaign');\n $deptTableNodes = Utility::getNodes('department_table');\n $eventNodes = Utility::getNodes('event');\n $formConfirmPageNodes = Utility::getNodes('form_confirmation_page');\n $meetingNodes = Utility::getNodes('meeting');\n $newsNodes = Utility::getNodes('news');\n $resourceCollectionNodes = Utility::getNodes('resource_collection');\n $stepByStepNodes = Utility::getNodes('step_by_step');\n\n $fieldMigration = new TopLevelFieldMigration();\n\n $fieldMigration->migrate($informationPageNodes, 'field_public_body', 'field_departments');\n unset($informationPageNodes);\n\n $fieldMigration->migrate($campaignNodes, 'field_dept', 'field_departments');\n unset($campaignNodes);\n\n $fieldMigration->migrate($deptTableNodes, 'field_dept', 'field_departments');\n unset($deptTableNodes);\n\n $fieldMigration->migrate($eventNodes, 'field_dept', 'field_departments');\n unset($eventNodes);\n\n $fieldMigration->migrate($formConfirmPageNodes, 'field_dept', 'field_departments');\n unset($formConfirmPageNodes);\n\n $fieldMigration->migrate($meetingNodes, 'field_dept', 'field_departments');\n unset($meetingNodes);\n\n $fieldMigration->migrate($newsNodes, 'field_dept', 'field_departments');\n unset($newsNodes);\n\n $fieldMigration->migrate($resourceCollectionNodes, 'field_dept', 'field_departments');\n unset($resourceCollectionNodes);\n\n $fieldMigration->migrate($stepByStepNodes, 'field_dept', 'field_departments');\n unset($stepByStepNodes);\n } catch(\\Exception $e) {\n echo $e->getMessage(), \"\\n\";\n } \n}", "private function fileEntityFieldToMedia(MigratePrepareRowEvent $event) {\n $row = $event->getRow();\n $source = $event->getSource();\n\n // Change the type from file to file_entity so it can be processed by\n // a migrate field plugin.\n // @see \\Drupal\\file_entity_migration\\Plugin\\migrate\\field\\FileEntity\n if (in_array($source->getPluginId(), [\n 'd7_field',\n 'd7_field_instance',\n 'd7_field_instance_per_view_mode',\n 'd7_field_instance_per_form_display',\n 'd7_view_mode',\n ])) {\n if ($row->getSourceProperty('type') == 'file') {\n $row->setSourceProperty('type', 'file_entity');\n }\n }\n\n // Skip migrating field instances whose destination bundle does not exist.\n if (in_array($source->getPluginId(), [\n 'd7_field_instance',\n 'd7_field_instance_per_view_mode',\n 'd7_field_instance_per_form_display',\n ])) {\n if ($row->getSourceProperty('entity_type') == 'file') {\n // Don't migrate bundles which don't exist in the destination.\n $media_bundle = $row->getSourceProperty('bundle');\n if (!\\Drupal::entityTypeManager()->getStorage('media_type')->load($media_bundle)) {\n $field_name = $row->getSourceProperty('field_name');\n throw new MigrateSkipRowException('Skipping field ' . $field_name . ' as its target is ' . $media_bundle . ', which does not exist in the destination.');\n }\n }\n }\n\n // Transform entity reference fields pointing to file entities so\n // they point to media ones.\n if (($source->getPluginId() == 'd7_field') && ($row->getSourceProperty('type') == 'entityreference')) {\n $settings = $row->getSourceProperty('settings');\n if ($settings['target_type'] == 'file') {\n $settings['target_type'] = 'media';\n $row->setSourceProperty('settings', $settings);\n }\n }\n\n // File types of type Document need to be mapped to the File media bundle.\n if (in_array($source->getPluginId(), ['d7_file_entity_type', 'd7_file_entity_item']) && ($row->getSourceProperty('type') == 'document')) {\n $row->setSourceProperty('type', 'file');\n }\n\n // Map path alias sources from file/1234 to media/1234.\n if (($source->getPluginId() == 'd7_url_alias') && (strpos($row->getSourceProperty('source'), 'file/') === 0)) {\n $source_url = preg_replace('/^file/', 'media', $row->getSourceProperty('source'));\n $row->setSourceProperty('source', $source_url);\n }\n\n // Map redirections from file/1234 to media/1234.\n if (($source->getPluginId() == 'd7_path_redirect') && (strpos($row->getSourceProperty('redirect'), 'file/') === 0)) {\n $redirect = preg_replace('/^file/', 'media', $row->getSourceProperty('redirect'));\n $row->setSourceProperty('redirect', $redirect);\n }\n\n // Map file menu links to media ones.\n if (($source->getPluginId() == 'menu_link') && (strpos($row->getSourceProperty('link_path'), 'file/') === 0)) {\n $link_path = preg_replace('/^file/', 'media', $row->getSourceProperty('link_path'));\n $row->setSourceProperty('link_path', $link_path);\n }\n }", "function opensky_islandora_view_object_alter (&$object, &$rendered) {\n // dpm (\"VIEW_OBJECT_ALTER\");\n // dpm ($object->models[0]);\n // dpm ($rendered);\n\n}", "private function exportProccess()\n {\n \tset_time_limit(3000);\n\n \ttry {\n\n $pdo = DB::connection()->getPdo();\n\n $queryTables = DB::statement(\"SET NAMES 'utf8'\");\n\n $allTables = DB::select('SHOW TABLES');\n\n $db = $this->getDbName();\n\n foreach ($allTables as $table) {\n\n // ignore backup views table\n if (@$table->{$db}) {\n\n if(strpos($table->{$db}, 'v_') === false){\n\n $targetTables[] = $table->{$db};\n\n }\n\n } else {\n\n return false;\n\n }\n\n }\n \n $content = \"SET SQL_MODE = \\\"NO_AUTO_VALUE_ON_ZERO\\\";\\r\\nSET time_zone = \\\"+00:00\\\";\\r\\n\\r\\n\\r\\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\\r\\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\\r\\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\\r\\n/*!40101 SET NAMES utf8 */;\\r\\n--\\r\\n-- Database: `\" . DB::getDatabaseName() . \"` \\r\\n--\\r\\n\\r\\n\\r\\n\";\n\n foreach ($targetTables as $table) {\n\n if (empty($table)) {\n\n continue;\n\n }\n\n $result = $pdo->prepare('SELECT * FROM `' . $table . '`');\n\n $result->execute();\n\n $fieldsAmount = $result->columnCount();\n\n $rowsNum = $result->rowCount();\n\n $res = $pdo->prepare('SHOW CREATE TABLE ' . $table);\n\n $res->execute();\n\n $TableMLine = $res->fetchAll(\\PDO::FETCH_NUM)[0];\n\n $content .= \"\\n\\n\" . $TableMLine[1] . \";\\n\\n\";\n\n $TableMLine[1] = str_ireplace('CREATE TABLE `', 'CREATE TABLE IF NOT EXISTS `', $TableMLine[1]);\n\n for ($i = 0, $stCounter = 0; $i < $fieldsAmount; $i++, $stCounter = 0) {\n\n foreach ($result->fetchAll(\\PDO::FETCH_NUM) as $row) :\n\n //when started (and every after 100 command cycle):\n if ($stCounter % 100 == 0 || $stCounter == 0) {\n\n $content .= \"\\nINSERT INTO `\" . $table . \"` VALUES\";\n\n }\n\n $content .= \"\\n(\";\n\n for ($j = 0; $j < $fieldsAmount; $j++) {\n\n $row[$j] = str_replace(\"\\n\", \"\\\\n\", addslashes($row[$j]));\n\n if (isset($row[$j])) {\n\n $content .= empty($row[$j]) ? 'NULL' : \"'\" . $row[$j] . \"'\";\n\n } else {\n\n $content .= \"''\";\n }\n \n if ($j < ($fieldsAmount - 1)) {\n\n $content .= ',';\n\n }\n }\n\n $content .= \")\";\n\n //every after 100 command cycle [or at last line] ....p.s. but should be inserted 1 cycle eariler\n if ((($stCounter + 1) % 100 == 0 && $stCounter != 0) || $stCounter + 1 == $rowsNum) {\n\n $content .= \";\";\n\n } else {\n\n $content .= \",\";\n\n }\n\n $stCounter = $stCounter + 1;\n\n endforeach;\n }\n\n $content .= \"\\n\\n\\n\";\n \n }\n\n $content .= \"\\r\\n\\r\\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\\r\\n/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\\r\\n/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\";\n\n $zip = new \\ZipArchive();\n\n // set unique file name\n $fileName = DB::getDatabaseName() . '_' . str_random(7) . microtime(true);\n\n // set file to sql extension\n $fileSql = $fileName . '.sql';\n\n // put to storage\n Storage::put($fileSql, $content);\n\n // then move it to desire folder\n Storage::move($fileSql, 'backup/e-operasional/'. $fileSql); \n\n // now if file sql exist in storage we going to zip this file\n if (file_exists(storage_path('app/backup/e-operasional/' . $fileSql))) {\n\n // set file to zip extension\n $fileZip = $fileName . '.zip';\n\n // create zip file\n if ($zip->open($fileZip, \\ZipArchive::CREATE) !== true) {\n\n exit(\"cannot open $fileName \\n\");\n\n }\n\n // add file to public directory\n $zip->addFile(storage_path('app/backup/e-operasional/' . $fileSql));\n\n // close zipping proccess\n $zip->close();\n\n // lastly we move sql file from public folder to our storage directory\n rename(public_path() . '/' . $fileZip, storage_path('app/backup/e-operasional/' . $fileZip));\n\n return true;\n\n }\n\n return false;\n \n } catch (\\Exception $e) {\n \n return false;\n } \n }", "protected function RetCreateView() {\n\n if (!isset($this->\n tables[0])) {\n\n throw new \\Exception(\"Error: View not properly provided in QueryHelper.\");\n }\n\n $return = \"CREATE OR REPLACE VIEW `{$this->\n tables[0]}`\";\n\n if (count($this->\n columns)) {\n\n $return .= \" (`\" . implode(\"`, `\", $this->\n columns) . \"`)\";\n }\n\n if (!$this->\n viewSelect ||\n !$this->\n viewSelect->\n IsSelect()) {\n\n throw new \\Exception(\"Error: Helper not properly provided in QueryHelper.\");\n }\n\n $return .= \" AS \" . $this->\n viewSelect->\n Generate();\n\n return $return . \";\";\n }", "function _backup_migrate_drush_sources($op = NULL) {\n backup_migrate_include('sources');\n $rows = array(array(dt('ID'), dt('Name'), dt('Operations')));\n foreach (backup_migrate_get_sources($op) as $destination) {\n $rows[] = array(\n $destination->get_id(),\n $destination->get_name(),\n implode(', ', $destination->ops()),\n );\n }\n drush_print_table($rows, TRUE, array(32, 32));\n}", "function testSaveView() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\t\t\r\n\t\t$view = new CAntObjectView();\r\n\t\t$view->name = \"Test\";\r\n\t\t$view->description = \"My Test Description\";\r\n\t\t$view->view_fields = array(\"id\", \"name\");\r\n\t\t$view->conditions[] = new CAntObjectCond(\"and\", \"owner_id\", \"is_equal\", USER_CURRENT);\r\n\t\t$view->sort_order[] = new CAntObjectSort(\"name\", \"desc\");\r\n\t\t$vid = $view->save($dbh, \"customer\");\r\n\r\n\t\tif ($dbh->GetNumberRows($dbh->Query(\"select id from app_object_views where id='$vid'\")))\r\n\t\t\t$this->assertTrue(true);\r\n\t\telse\r\n\t\t\t$this->assertTrue(false);\r\n\r\n\t\t$dbh->Query(\"delete from app_object_views where id='$vid'\");\r\n\t}", "public function import(stdClass $account, stdClass $row) {\n $migration = Migration::currentMigration();\n // Updating previously-migrated content?\n if (isset($row->migrate_map_destid1)) {\n // Make sure is_new is off\n $account->is_new = FALSE;\n if (isset($account->uid)) {\n if ($account->uid != $row->migrate_map_destid1) {\n throw new MigrateException(t(\"Incoming uid !uid and map destination uid !destid1 don't match\",\n array('!uid' => $account->uid, '!destid1' => $row->migrate_map_destid1)));\n }\n }\n else {\n $account->uid = $row->migrate_map_destid1;\n }\n }\n if ($migration->getSystemOfRecord() == Migration::DESTINATION) {\n if (!isset($account->uid)) {\n throw new MigrateException(t('System-of-record is DESTINATION, but no destination uid provided'));\n }\n $old_account = user_load($account->uid, TRUE);\n if (empty($old_account)) {\n throw new MigrateException(t('System-of-record is DESTINATION, but user !uid does not exist',\n array('!uid' => $account->uid)));\n }\n }\n else {\n $old_account = $account;\n }\n\n // Roles must be arrays keyed by the role id, which isn't how the data\n // naturally comes in. Fix them up.\n\n // First, if names instead of IDs are presented, translate them\n if (!empty($account->role_names)) {\n $role_names = is_array($account->role_names) ? $account->role_names : array($account->role_names);\n foreach ($role_names as $role_name) {\n $role = user_role_load_by_name($role_name);\n if ($role) {\n $account->roles[] = $role->rid;\n }\n }\n }\n if (!empty($account->roles)) {\n if (!is_array($account->roles)) {\n $account->roles = array($account->roles);\n }\n $account->roles = drupal_map_assoc($account->roles);\n }\n if (empty($account->roles) && empty($old_account->roles)) {\n $account->roles = array();\n }\n\n $this->prepare($account, $row);\n\n if (isset($account->uid) && !(isset($account->is_new) && $account->is_new)) {\n $updating = TRUE;\n }\n else {\n $updating = FALSE;\n }\n\n // While user_save is happy to see a fid in $account->picture on insert,\n // when updating an existing account it wants a file object.\n if ($updating && isset($account->picture) && ($fid = $account->picture)) {\n $account->picture = file_load($fid);\n }\n\n // Normalize MD5 passwords to lowercase, as generated by Drupal 6 and previous\n if ($this->md5Passwords) {\n $account->pass = drupal_strtolower($account->pass);\n }\n\n // If any datetime values were included, ensure that they're in timestamp format.\n if (isset($account->created)) {\n $account->created = MigrationBase::timestamp($account->created);\n }\n if (isset($account->access)) {\n $account->access = MigrationBase::timestamp($account->access);\n }\n if (isset($account->login)) {\n $account->login = MigrationBase::timestamp($account->login);\n }\n\n migrate_instrument_start('user_save');\n $newaccount = user_save($old_account, (array)$account);\n migrate_instrument_stop('user_save');\n if ($newaccount) {\n if ($this->md5Passwords && !empty($account->pass)) {\n // Ape the Drupal 6 -> Drupal 7 upgrade, which encrypts the MD5 text in the\n // modern way, and marks it with a prepended U so it recognizes and fixes it\n // up at login time.\n $password = 'U' . $newaccount->pass;\n db_update('users')\n ->fields(array('pass' => $password))\n ->condition('uid', $newaccount->uid)\n ->execute();\n }\n // Unlike nodes and taxonomy terms, core does not automatically save an\n // alias in a user entity, we must do it ourselves.\n if (module_exists('path')) {\n if (!empty($account->path['alias'])) {\n $path = array(\n 'source' => 'user/' . $account->uid,\n 'alias' => $account->path['alias'],\n );\n migrate_instrument_start('path_save');\n path_save($path);\n migrate_instrument_stop('path_save');\n }\n }\n if ($updating) {\n $this->numUpdated++;\n }\n else {\n $this->numCreated++;\n }\n $this->complete($newaccount, $row);\n $return = array($newaccount->uid);\n }\n else {\n $return = FALSE;\n }\n return $return;\n }", "public function testViewEntityClone() {\n $edit = [\n 'id' => 'test_view_cloned',\n 'label' => 'Test view cloned',\n ];\n $this->drupalPostForm('entity_clone/view/who_s_new', $edit, t('Clone'));\n\n $views = \\Drupal::entityTypeManager()\n ->getStorage('view')\n ->loadByProperties([\n 'id' => $edit['id'],\n ]);\n $view = reset($views);\n $this->assertTrue($view, 'Test default view cloned found in database.');\n }", "function upgrade_4_pgsql() { \n $table_domain = table_by_key('domain');\n $table_admin = table_by_key('admin');\n $table_alias = table_by_key('alias');\n $table_domain_admins = table_by_key('domain_admins');\n $table_log = table_by_key('log');\n $table_mailbox = table_by_key('mailbox');\n $table_vacation = table_by_key('vacation');\n $table_vacation_notification = table_by_key('vacation_notification');\n\n if(!_pgsql_field_exists($table_domain, 'quota')) {\n $result = db_query_parsed(\"ALTER TABLE $table_domain ADD COLUMN quota int NOT NULL default '0'\");\n }\n\n $result = db_query_parsed(\"ALTER TABLE $table_domain ALTER COLUMN domain DROP DEFAULT\");\n if(!_pgsql_object_exists('domain_domain_active')) {\n $result = db_query_parsed(\"CREATE INDEX domain_domain_active ON $table_domain(domain,active)\");\n }\n\n $result = db_query_parsed(\"ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT\");\n $result = db_query_parsed(\"ALTER TABLE $table_alias ALTER COLUMN address DROP DEFAULT\");\n $result = db_query_parsed(\"ALTER TABLE $table_alias ALTER COLUMN domain DROP DEFAULT\");\n if(!_pgsql_object_exists('alias_address_active')) {\n $result = db_query_parsed(\"CREATE INDEX alias_address_active ON $table_alias(address,active)\");\n }\n\n $result = db_query_parsed(\"ALTER TABLE $table_domain_admins ALTER COLUMN username DROP DEFAULT\");\n $result = db_query_parsed(\"ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT\");\n\n $result = db_query_parsed(\"\n BEGIN;\n ALTER TABLE $table_log RENAME COLUMN data TO data_old;\n ALTER TABLE $table_log ADD COLUMN data text NOT NULL default '';\n UPDATE $table_log SET data = CAST(data_old AS text);\n ALTER TABLE $table_log DROP COLUMN data_old;\n COMMIT;\");\n\n $result = db_query_parsed(\"ALTER TABLE $table_mailbox ALTER COLUMN username DROP DEFAULT\");\n $result = db_query_parsed(\"ALTER TABLE $table_mailbox ALTER COLUMN domain DROP DEFAULT\");\n\n $result = db_query_parsed(\"\n BEGIN;\n ALTER TABLE $table_mailbox RENAME COLUMN domain TO domain_old;\n ALTER TABLE $table_mailbox ADD COLUMN domain varchar(255) REFERENCES $table_domain (domain);\n UPDATE $table_mailbox SET domain = domain_old;\n ALTER TABLE $table_mailbox DROP COLUMN domain_old;\n COMMIT;\"\n );\n if(!_pgsql_object_exists('mailbox_username_active')) {\n db_query_parsed(\"CREATE INDEX mailbox_username_active ON $table_mailbox(username,active)\");\n }\n\n\n $result = db_query_parsed(\"ALTER TABLE $table_vacation ALTER COLUMN body SET DEFAULT ''\");\n if(_pgsql_field_exists($table_vacation, 'cache')) {\n $result = db_query_parsed(\"ALTER TABLE $table_vacation DROP COLUMN cache\");\n }\n\n $result = db_query_parsed(\"\n BEGIN;\n ALTER TABLE $table_vacation RENAME COLUMN domain to domain_old;\n ALTER TABLE $table_vacation ADD COLUMN domain varchar(255) REFERENCES $table_domain;\n UPDATE $table_vacation SET domain = domain_old;\n ALTER TABLE $table_vacation DROP COLUMN domain_old;\n COMMIT;\n \");\n\n if(!_pgsql_object_exists('vacation_email_active')) {\n $result = db_query_parsed(\"CREATE INDEX vacation_email_active ON $table_vacation(email,active)\");\n }\n\n if(!_pgsql_object_exists($table_vacation_notification)) {\n $result = db_query_parsed(\"\n CREATE TABLE $table_vacation_notification (\n on_vacation character varying(255) NOT NULL REFERENCES $table_vacation(email) ON DELETE CASCADE,\n notified character varying(255) NOT NULL,\n notified_at timestamp with time zone NOT NULL DEFAULT now(),\n CONSTRAINT vacation_notification_pkey primary key(on_vacation,notified));\");\n }\n}", "static private function create_views_table(){\n global $wpdb;\n $table_name = self::get_views_table_name();\n $charset_collate = $wpdb->get_charset_collate();\n // $wpdb->query( \"DROP TABLE IF EXISTS $table_name\" );\n $sql = \"CREATE TABLE $table_name (\n view_id int NOT NULL AUTO_INCREMENT,\n post_id int NOT NULL,\n user_remote_addr varchar(50) DEFAULT NULL,\n user_http_x_forwarded_for varchar(50) DEFAULT NULL,\n view_date DATETIME NOT NULL,\n primary key (view_id)\n ) $charset_collate;\";\n\n maybe_create_table($table_name, $sql);\n }", "function migrate_before_db_upgrade()\n {\n global $prli_options, $prli_update, $prli_link, $prli_click, $wpdb;\n $db_version = (int)get_option('prli_db_version');\n\n if(!$db_version)\n return;\n\n // Migration for version 1 of the database\n if($db_version and $db_version < 1)\n {\n $query = \"SELECT * from {$prli_link->table_name}\";\n $links = $wpdb->get_results($query);\n $query_str = \"UPDATE {$prli_link->table_name} SET redirect_type=%s WHERE id=%d\";\n\n foreach($links as $link)\n {\n if(isset($link->track_as_img) and $link->track_as_img)\n {\n $query = $wpdb->prepare($query_str, 'pixel', $link->id);\n $wpdb->query($query);\n }\n else if(isset($link->use_prettybar) and $link->use_prettybar)\n {\n $query = $wpdb->prepare($query_str, 'prettybar', $link->id);\n $wpdb->query($query);\n }\n else if(isset($link->use_ultra_cloak) and $link->use_ultra_cloak)\n {\n $query = $wpdb->prepare($query_str, 'cloak', $link->id);\n $wpdb->query($query);\n }\n }\n\n $query = \"ALTER TABLE {$prli_link->table_name} DROP COLUMN track_as_img, DROP COLUMN use_prettybar, DROP COLUMN use_ultra_cloak, DROP COLUMN gorder\";\n $wpdb->query($query);\n }\n\n if($db_version and $db_version < 2)\n {\n unset($prli_options->prli_exclude_ips);\n unset($prli_options->prettybar_image_url);\n unset($prli_options->prettybar_background_image_url);\n unset($prli_options->prettybar_color);\n unset($prli_options->prettybar_text_color);\n unset($prli_options->prettybar_link_color);\n unset($prli_options->prettybar_hover_color);\n unset($prli_options->prettybar_visited_color);\n unset($prli_options->prettybar_title_limit);\n unset($prli_options->prettybar_desc_limit);\n unset($prli_options->prettybar_link_limit);\n\n // Save the posted value in the database\n update_option( 'prli_options', $prli_options );\n }\n\n // Modify the tables so they're UTF-8\n if($db_version and $db_version < 3)\n { \n $charset_collate = '';\n if( $wpdb->has_cap( 'collation' ) )\n {\n if( !empty($wpdb->charset) )\n $charset_collate = \"CONVERT TO CHARACTER SET $wpdb->charset\";\n if( !empty($wpdb->collate) )\n $charset_collate .= \" COLLATE $wpdb->collate\";\n }\n\n if(!empty($charset_collate))\n {\n $prli_table_names = array( \"{$wpdb->prefix}prli_groups\",\n \"{$wpdb->prefix}prli_clicks\",\n \"{$wpdb->prefix}prli_links\",\n \"{$wpdb->prefix}prli_link_metas\",\n \"{$wpdb->prefix}prli_tweets\",\n \"{$wpdb->prefix}prli_keywords\",\n \"{$wpdb->prefix}prli_reports\",\n \"{$wpdb->prefix}prli_report_links\",\n \"{$wpdb->prefix}prli_link_rotations\",\n \"{$wpdb->prefix}prli_clicks_rotations\" );\n\n foreach($prli_table_names as $prli_table_name)\n {\n $query = \"ALTER TABLE {$prli_table_name} {$charset_collate}\";\n $wpdb->query($query);\n }\n }\n }\n \n // Upgrade the twitter hide badges on pages / posts for pro users\n if($db_version and $db_version < 7)\n {\n if($prli_update->pro_is_installed())\n {\n global $prlipro_options;\n\n if(trim($prlipro_options->twitter_badge_hidden) != '')\n {\n $hidden_post_ids = explode(',',trim($prlipro_options->twitter_badge_hidden));\n foreach($hidden_post_ids as $post_id)\n {\n $prlipro_post_options = PrliProPostOptions::get_stored_object($post_id);\n $prlipro_post_options->hide_twitter_button = 1;\n $prlipro_post_options->store($post_id);\n }\n }\n }\n }\n \n if($db_version and $db_version < 8)\n {\n // Install / Upgrade Pretty Link Pro\n $prlipro_username = get_option( 'prlipro_username' );\n $prlipro_password = get_option( 'prlipro_password' );\n\n if( !empty($prlipro_username) and !empty($prlipro_password) )\n {\n $creds = array('username' => $prlipro_username,\n 'password' => $prlipro_password);\n update_option('prlipro-credentials', $creds);\n }\n } \n\n // Hiding pretty link custom fields\n if($db_version and $db_version < 10)\n {\n $query_str = \"UPDATE {$wpdb->postmeta} SET meta_key=%s WHERE meta_key=%s\";\n\n $query = $wpdb->prepare($query_str, '_pretty-link', 'pretty-link');\n $wpdb->query($query);\n\n $query = $wpdb->prepare($query_str, '_prli-keyword-cached-content', 'prli-keyword-cached-content');\n $wpdb->query($query);\n\n $query = $wpdb->prepare($query_str, '_prlipro-post-options', 'prlipro-post-options');\n $wpdb->query($query);\n }\n\n if($db_version and $db_version < 11)\n {\n /* Too much to handle on larger tweet databases -- this code will still be accessible by going to the following url:\n {$prli_blogurl}/wp-admin/admin.php?page=pretty-link/pro/prlipro-options.php&action=trim_dup_tweets\n // Clearing out duplicate tweets\n if($prli_update->pro_is_installed())\n {\n $block_size = 2000;\n $upper_limit = $block_size - 1;\n $tweet_table = \"{$wpdb->prefix}prli_tweets\";\n\n $query = $wpdb->prepare(\"SELECT count(DISTINCT twid) FROM {$tweet_table}\");\n $twid_count = $wpdb->get_var($query);\n\n for($offset=0; $offset < $twid_count; $offset += $block_size)\n {\n $limit = $offset + $upper_limit;\n $query = $wpdb->prepare(\"SELECT id FROM {$tweet_table} GROUP BY twid LIMIT %d,%d\",$offset,$limit);\n $tweet_ids = $wpdb->get_col($query);\n\n if(is_array($tweet_ids) and count($tweet_ids) > 0)\n {\n $query = $wpdb->prepare(\"DELETE FROM {$tweet_table} WHERE id not in (\" . implode(',', $tweet_ids) . \")\");\n $wpdb->query($query);\n }\n }\n }\n */\n }\n }", "function migrateTable( $table ) {\n\n $query = \"SELECT * FROM \" . $table;\n\n $this->_externalDB->setQuery( $query );\n $object = $this->_externalDB->loadObjectList();\n\n\t\t$db =& JFactory::getDBO();\n $count = count($object);\n\n for ($i=0; $i<$count; $i++) {\n $db->insertObject($table, $object[$i]);\n\t\t\t//echo $db->errorMsg();\n }\n\n\t\t$ret = $db->getErrorNum();\n\n return $ret;\n }", "function migrate(&$model, $key, $to)\r\n\t\t{\r\n\t\t\t//rip out from the passed data only those fields which the model has defined to allow to migrate\r\n\t\t\t$to = array_intersect_key($to, array_flip($this->settings[$model->alias]['fields']));\r\n\t\t\t\r\n\t\t\t//make sure the key field is in the data to migrate\r\n\t\t\tif (!array_key_exists($this->settings[$model->alias]['key'], $to))\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//we cannot migrate id numbers\r\n\t\t\tif (array_key_exists('id', $to))\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//we're going to search for records with the specified value for the key field until we've migrated all of them\r\n\t\t\t$query = array(\r\n\t\t\t\t'fields' => array('id'), \r\n\t\t\t\t'conditions' => array(\"{$this->settings[$model->alias]['key']}\" => $key), \r\n\t\t\t\t'contain' => array()\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t//for an FU05 model that has an unchained index on the key field we're changing, we'll use that index to change data so we get the orphaned records too\r\n\t\t\tif ($model->useDbConfig == 'fu05' && $model->Behaviors->enabled('Chainable') && in_array($this->settings[$model->alias]['key'], $model->Behaviors->Chainable->settings[$model->alias]['unchainedIndexes']))\r\n\t\t\t{\r\n\t\t\t\t$query['unchainedIndex'] = $this->settings[$model->alias]['key'];\r\n\t\t\t}\r\n\t\t\telse if ($model->useDbConfig == 'filepro')\r\n\t\t\t{\r\n\t\t\t\t//for filepro models, we'll choose the proper index to use if one exists for the key field\r\n\t\t\t\t$db = ConnectionManager::getDataSource('filepro');\r\n\t\t\t\t$indexes = $db->describe($model, 'indexes');\r\n\t\t\t\t\r\n\t\t\t\t//look at each index\r\n\t\t\t\tforeach ($indexes as $name => $index)\r\n\t\t\t\t{\r\n\t\t\t\t\t//if it's supported and the first field of the index is our key field, go ahead and use it\r\n\t\t\t\t\tif ($index->isSupported && $index->header['sort_info'][0]['field_name'] == $this->settings[$model->alias]['key'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//we have to rip the 'index.' off of the index name so we only specify the index letter (i.e. 'A' or 'B').\r\n\t\t\t\t\t\t$query['index'] = array_pop(explode('.', $name));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\r\n//TODO - comment out once verified\r\n//pr(Set::flatten($query));\r\n//pr(Set::flatten(array($model->alias => array_merge(array('id' => '[id]'), $to))));\r\n//$model->find('first', $query);\r\n//return true;\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t$migrated = 0;\r\n\t\t\t\t\r\n\t\t\t\t//figure out the save method to use (u05 models we save via filepro so users in filepro can see the changes right away in\r\n\t\t\t\t//case the migrated fields are indexed in filepro)\r\n\t\t\t\t$saveMethod = $model->useDbConfig == 'fu05' ? 'saveViaFilepro' : 'save';\r\n\t\t\t\t\r\n\t\t\t\t//keep searching until we run out\r\n\t\t\t\twhile (($record = $model->find('first', $query)) !== false)\r\n\t\t\t\t{\r\n\t\t\t\t\t//update the record\r\n\t\t\t\t\tif ($model->$saveMethod(array($model->alias => array_merge(array('id' => $record[$model->alias]['id']), $to))) === false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$migrated++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (Exception $ex)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $migrated;\r\n\t\t}", "private function _alter() {\n\t\t$queries = array();\n\t\t\n\t\t$queries[] = ('BEGIN TRANSACTION');\n\t\t$q = \"SELECT * FROM _ssm_backup\";\n\t\t$r = @sqlite_query($q, $this->_connection);\n\t\t\n\t\tif(!sqlite_last_error($this->_connection)) {\n\t\t\tsqlite_query(\"DROP TABLE _ssm_backup\", $this->_connection);\n\t\t}\n\t\t\n\t\t$export = new export('sql');\n\t\t\n\t\t@sqlite_query(\"CREATE TABLE _ssm_backup AS SELECT * FROM {$this->_name}\", $this->_connection);\n\t\t$t = new table(\"{$this->_db}:_ssm_backup\");\n\t\t\n\t\t$queries[] = \"DROP TABLE {$this->_name}\";\n\n\t\t$sql = $export->structTable($this);\n\t\t$queries[] = $sql;\n\t\t$insertQuery = $this->_alterBuildInsertQuery($t);\n\t\t$queries[] = $insertQuery;\n\t\t$queries[] = \"COMMIT TRANSACTION\";\n\t\t\n\t\t$ret = true;\n\n\t\tforeach($queries as $query) {\n\t\t\t@sqlite_query($query, $this->_connection);\n\t\t\tif(@sqlite_last_error($this->_connection)) {\n\t\t\t\t$ret = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t@sqlite_query(\"DROP TABLE _ssm_backup\", $this->_connection);\n\t\treturn $ret;\n\t}", "abstract protected function up();", "public function up()\n {\n ################################ TABLES ################################\n \n //Create the table that stores media.\n $this->createTable('media', array(\n 'id' => 'pk',\n 'view' => 'varchar(63) NOT NULL default \"\"',\n 'type' => 'varchar(63) NOT NULL default \"\"',\n 'dt_crtd' => 'datetime NOT NULL',\n 'ts_updt' => 'timestamp NOT NULL default CURRENT_TIMESTAMP',\n ));\n \n ########################## VIEWS AND CSS FILES #########################\n \n $assets = $this->module->basePath.'/migrations/_'.get_class($this).'_assets';\n \n $files = array();\n if($this->_hasMediaClass('Index'))\n {\n // Default (view + css)\n $files[$this->module->basePath.'/views/media/index/default.php'] = Yii::getAlias('@app/modules/media/views/media/index/default.example.php');\n $files[$assets.'/index/default.css'] = Yii::getAlias('@app/modules/media/assets/media/index/default.css');\n // Model class\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/index/Index.php'] = Yii::getAlias('@app/modules/media/models/Index.php');\n // Model admin controller\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/index/IndexController.php'] = Yii::getAlias('@app/modules/media/controllers/admin/IndexController.php');\n }\n if($this->_hasMediaClass('Page'))\n {\n // Admin index\n $files[$this->module->basePath.'/views/admin/page/index.php'] = Yii::getAlias('@app/modules/media/views/admin/page/index.example.php');\n // 2 columns (view)\n $files[$this->module->basePath.'/views/media/page/2columns.php'] = Yii::getAlias('@app/modules/media/views/media/page/2columns.example.php');\n // 1 column (view)\n $files[$this->module->basePath.'/views/media/page/1column.php'] = Yii::getAlias('@app/modules/media/views/media/page/1column.example.php');\n // Model class\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/page/Page.php'] = Yii::getAlias('@app/modules/media/models/Page.php');\n // Model admin controller\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/page/PageController.php'] = Yii::getAlias('@app/modules/media/controllers/admin/PageController.php');\n }\n if($this->_hasMediaClass('Image'))\n {\n // Admin index\n $files[$this->module->basePath.'/views/admin/image/index.php'] = Yii::getAlias('@app/modules/media/views/admin/image/index.example.php');\n // Thumbnail (view)\n $files[$this->module->basePath.'/views/media/image/_thumbnail.php'] = Yii::getAlias('@app/modules/media/views/media/image/_thumbnail.example.php');\n // Model class\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/image/Image.php'] = Yii::getAlias('@app/modules/media/models/Image.php');\n // Model admin controller\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/image/ImageController.php'] = Yii::getAlias('@app/modules/media/controllers/admin/ImageController.php');\n }\n if($this->_hasMediaClass('Video'))\n {\n // Admin index\n $files[$this->module->basePath.'/views/admin/video/index.php'] = Yii::getAlias('@app/modules/media/views/admin/video/index.example.php');\n // Thumbnail (view)\n $files[$this->module->basePath.'/views/media/video/_thumbnail.php'] = Yii::getAlias('@app/modules/media/views/media/video/_thumbnail.example.php');\n // Iframe (view)\n $files[$this->module->basePath.'/views/media/video/_iframe.php'] = Yii::getAlias('@app/modules/media/views/media/video/_iframe.example.php');\n // Model class\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/video/Video.php'] = Yii::getAlias('@app/modules/media/models/Video.php');\n // Model admin controller\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/video/VideoController.php'] = Yii::getAlias('@app/modules/media/controllers/admin/VideoController.php');\n }\n if($this->_hasMediaClass('Gallery'))\n {\n // Admin index\n $files[$this->module->basePath.'/views/admin/gallery/index.php'] = Yii::getAlias('@app/modules/media/views/admin/gallery/index.example.php');\n // Thumbnail (view)\n $files[$this->module->basePath.'/views/media/gallery/_thumbnail.php'] = Yii::getAlias('@app/modules/media/views/media/gallery/_thumbnail.example.php');\n // Slider (view)\n $files[$this->module->basePath.'/views/media/gallery/_slider.php'] = Yii::getAlias('@app/modules/media/views/media/gallery/_slider.example.php');\n // Model class\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/gallery/Gallery.php'] = Yii::getAlias('@app/modules/media/models/Gallery.php');\n // Model admin controller\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/gallery/GalleryController.php'] = Yii::getAlias('@app/modules/media/controllers/admin/GalleryController.php');\n }\n if($this->_hasMediaClass('Insert'))\n {\n // Admin index\n $files[$this->module->basePath.'/views/admin/insert/index.php'] = Yii::getAlias('@app/modules/media/views/admin/insert/index.example.php');\n // Thumbnail (view)\n $files[$this->module->basePath.'/views/media/insert/_thumbnail.php'] = Yii::getAlias('@app/modules/media/views/media/insert/_thumbnail.example.php');\n // Model class\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/insert/Insert.php'] = Yii::getAlias('@app/modules/media/models/Insert.php');\n // Model admin controller\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/insert/InsertController.php'] = Yii::getAlias('@app/modules/media/controllers/admin/InsertController.php');\n }\n if($this->_hasMediaClass('Document'))\n {\n // Admin index\n $files[$this->module->basePath.'/views/admin/document/index.php'] = Yii::getAlias('@app/modules/media/views/admin/document/index.example.php');\n // Thumbnail (view)\n $files[$this->module->basePath.'/views/media/document/_thumbnail.php'] = Yii::getAlias('@app/modules/media/views/media/document/_thumbnail.example.php');\n // Model class\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/document/Document.php'] = Yii::getAlias('@app/modules/media/models/Document.php');\n // Model admin controller\n $files[$this->module->basePath.'/migrations/_m000000_000001_media_assets/document/DocumentController.php'] = Yii::getAlias('@app/modules/media/controllers/admin/DocumentController.php');\n }\n \n $this->copy($files);\n \n ############################# FORM GROUPS ##############################\n \n echo \" > creating form groups ...\";\n $time = microtime(true);\n \n $customFieldsModule = $this->module->getModule('mediaFields');\n \n FormGroup::$customFieldsModule = $customFieldsModule;\n \n // INDEX\n $fgTextBlock = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Text block', 'fr' => 'Bloc texte'],\n 'level' => 1,\n 'position' => 1,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n $fgIndexContent = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Home page content', 'fr' => 'Contenu de la page accueil'],\n 'level' => 1,\n 'position' => 2,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n $fgBackground = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Background', 'fr' => 'Arrière plan'],\n 'level' => 1,\n 'position' => 3,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]); \n\n // INDEX_BLOCK\n $fgBlockContent = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Block content', 'fr' => 'Contenu du bloc'],\n 'level' => 1,\n 'position' => 1,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]); \n $fgLink = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Link', 'fr' => 'Lien'],\n 'level' => 1,\n 'position' => 2,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]); \n \n // PAGE\n $fgPageContent = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Page content', 'fr' => 'Contenu de la page'],\n 'level' => 1,\n 'position' => 1,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n $fgRightColumn = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Right column', 'fr' => 'Colonne de droite'],\n 'level' => 1,\n 'position' => 2,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n //$fgBackground\n $fgScript = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Script', 'fr' => 'Script'],\n 'level' => 1,\n 'position' => 99,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n \n // IMAGE\n $fgFile = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'File', 'fr' => 'Fichier'],\n 'level' => 1,\n 'position' => 1,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n $fgText = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Text', 'fr' => 'Texte'],\n 'level' => 1,\n 'position' => 2,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n //$fgLink\n \n // VIDEO\n $fgEmbedding = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Embedding', 'fr' => 'Intégration'],\n 'level' => 1,\n 'position' => 1,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n $fgInformations = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Details', 'fr' => 'Informations'],\n 'level' => 1,\n 'position' => 2,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n \n // GALLERY\n $fgGalleryContent = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Gallery content', 'fr' => 'Contenu de la galerie'],\n 'level' => 1,\n 'position' => 1,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n //$fgText\n \n // MODULE\n $fgModuleDescription = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Description', 'fr' => 'Description'],\n 'level' => 1,\n 'position' => 1,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => false\n ]);\n \n // NAVIGATION\n $fgNavigation = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Navigation', 'fr' => 'Navigation'],\n 'level' => 1,\n 'position' => 1,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n $fgMenus = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Menus', 'fr' => 'Menus'],\n 'level' => 1,\n 'position' => 1,\n 'parent_id' => $fgNavigation->id,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]); \n $fgUrlRewriting = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'URL Rewriting Rules', 'fr' => 'Règles de réécriture d\\URLs'],\n 'level' => 1,\n 'position' => 2,\n 'parent_id' => $fgNavigation->id,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n \n $fgMetaData = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Meta data', 'fr' => 'Méta données'],\n 'level' => 2,\n 'position' => 2,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n $fgMetaTags = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Meta tags', 'fr' => 'Balises méta'],\n 'level' => 1,\n 'position' => 1,\n 'parent_id' => $fgMetaData->id,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n $fgThumbnail = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Thumbnail', 'fr' => 'Vignette'],\n 'level' => 1,\n 'position' => 2,\n 'parent_id' => $fgMetaData->id,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n \n $fgParameters = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Parameters', 'fr' => 'Paramètres'],\n 'level' => 2,\n 'position' => 99,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n $fgActivation = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Activation', 'fr' => 'Activation'],\n 'level' => 1,\n 'position' => 1,\n 'parent_id' => $fgParameters->id,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n $fgViews = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Views', 'fr' => 'Vues'],\n 'level' => 1,\n 'position' => 2,\n 'parent_id' => $fgParameters->id,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n $fgPosition = $this->addEntry(new FormGroup(), [\n 'name' => ['en' => 'Position', 'fr' => 'Position'],\n 'level' => 1,\n 'position' => 3,\n 'parent_id' => $fgParameters->id,\n 'owner' => $customFieldsModule->tableName,\n 'collapsed' => true\n ]);\n \n \n echo \" done (time: \".sprintf('%.3f', microtime(true)-$time).\"s)\\n\";\n \n ############################# MEDIA FIELDS #############################\n \n echo \" > creating media fields ...\";\n $time = microtime(true);\n \n # ----------------- HTML FIELD CONFIGURATION HELPER --------------------\n \n $HtmlFieldConfig = [];\n $HtmlFieldConfig['paragraphs'] = \n\"return [\n 'height' => '250px',\n 'options' => [\n 'theme_advanced_blockformats' => [\n 'Paragraph' => 'p'\n ],\n 'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,|,sub,sup,|,bullist,numlist,|,indent,outdent',\n 'theme_advanced_buttons2' => 'removeformat,cleanup,|,link,unlink,anchor,|,code,|,search,replace,|,fullscreen',\n 'theme_advanced_buttons3' => '',\n 'theme_advanced_buttons4' => '',\n ]\n];\";\n \n # ----------------------------- POSITION -------------------------------\n \n $field = $this->addEntry(new \\yiingine\\modules\\media\\models\\MediaPositionField($customFieldsModule), array(\n 'name' => 'position',\n 'title' => array('en' => 'Position', 'fr' => 'Position'),\n 'description' => array(\n 'en' => 'The position of this item relative to its siblings. Click on \"Set on last position\" to get the value of the last position + 1 and put this item at the end of the list.', \n 'fr' => 'La position de cet item est relative à ses semblables. Cliquez sur \"Régler à la dernière position\" pour régler la position à la dernière valeur + 1.',\n ),\n 'required' => 1,\n 'in_forms' => 1,\n 'form_group_id' => $fgPosition->id,\n 'default' => 1,\n 'protected' => 1,\n 'configuration' => var_export(array(), true).';',\n 'owners' => $this->_filterOwners(array('Video', 'Gallery')),\n ));\n \n # ------------------------------ DESCRIPTION --------------------------------\n \n $field = $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'description',\n 'title' => array('en' => 'Description', 'fr' => 'Description'),\n 'description' => array(\n 'en' => 'The description is used for SEO (Search Engine Optimization). If the field is filled, the value will be used in a meta description tag. A description is useful for search engine indexing or sharing on social platforms. This description should contains importants keywords and must not exceed 150 characters.', \n 'fr' => 'La description est utilisée pour optimiser le réfécement ou SEO (Search Engine Optimization). Si le champs est renseigné, sa valeur sera utilisée dans une balise meta description. Celle-ci est utile pour l\\'indexage sur les moteurs de recherches ou pour le partage sur les réseaux sociaux. Cette description doit contenir un maximum de mots clés et ne doit pas dépasser 150 charactères.',\n ),\n 'required' => 0,\n 'translatable' => 1,\n 'configuration' => '',\n 'size' => 150,\n 'in_forms' => 1,\n 'form_group_id' => $fgMetaTags->id,\n 'protected' => 1,\n 'owners' => $this->_filterOwners(array('Index', 'Page', 'Image', 'Video', 'Gallery', 'Insert', 'Document')),\n ));\n \n # ------------------------------ KEYWORDS --------------------------------\n \n $field = $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'keywords',\n 'title' => array('en' => 'Keywords', 'fr' => 'Mots-clés'),\n 'description' => array(\n 'en' => 'The keywords are used for SEO (Search Engine Optimization). If the field is filled, the value will be used in a meta keywords tag. Keywords can be used for search engine indexing. The keywords must be separated by commas.', \n 'fr' => 'Les mots-clés sont utilisés pour optimiser le référencement ou SEO (Search Engine Optimization). Si le champs est renseigné, sa valeur sera utlisée dans une balise meta keywords. Celle-ci est parfois utlisée pour l\\'indexage sur les moteurs de recherches. Les différents mots-clés doivent être séparé par des virgules.',\n ),\n 'required' => 0,\n 'translatable' => 1,\n 'configuration' => '',\n 'size' => 0,\n 'in_forms' => 1,\n 'form_group_id' => $fgMetaTags->id,\n 'protected' => 1,\n 'owners' => $this->_filterOwners(array('Index', 'Page', 'Video', 'Insert', 'Image', 'Gallery', 'Document')),\n ));\n \n # ------------------------------ ENABLED --------------------------------\n \n $field = $this->addEntry(new customFields\\BooleanField($customFieldsModule), array(\n 'name' => 'enabled',\n 'title' => array('en' => 'Enabled', 'fr' => 'Activé'),\n 'description' => array(\n 'en' => 'Enables this item. A disabled item cannot be viewed.', \n 'fr' => 'Active cet item. Un item désactivé n\\'est pas affiché.',\n ),\n 'required' => 1,\n 'in_forms' => 1,\n 'form_group_id' => $fgActivation->id,\n 'default' => 1,\n 'protected' => 1,\n 'owners' => $this->_filterOwners(array('Index', 'Page', 'Image', 'Video', 'Gallery', 'Insert', 'Document')),\n ));\n \n # ----------------------------- THUMBNAIL ------------------------------\n \n $this->addEntry(new customFields\\ImageField($customFieldsModule), array(\n 'name' => 'thumbnail',\n 'title' => array('en' => 'Thumbnail Image file', 'fr' => 'Fichier de l\\'image de la vignette'),\n 'description' => array('en' => 'Image file displayed in the right column or for the social sharing. The optimal image resolution is 600x400px. If this field is not set, the thumbnail image set for the home page will be used by default.', 'fr' => 'Fichier image affiché dans la colonne de droite ou pour le partage social. La résolution optimale de l\\'image est de 600x400px. Si ce champs n\\'est pas renseigné, l\\'image de la vignette renseignée pour la page d\\'acceuil sera utilisé par défault.'),\n 'size' => 0,\n 'position' => 1,\n 'required' => 0,\n 'in_forms' => 1,\n 'form_group_id' => $fgThumbnail->id,\n 'configuration' => var_export(array('maximumNumberOfFiles' => 1), true), // Only one image is permitted.\n 'owners' => $this->_filterOwners(array('Index', 'Page', 'Image', 'Video', 'Gallery', 'Insert', 'Document')),\n ));\n \n # ---------------------------- BACKGROUND ------------------------------\n \n $this->addEntry(new customFields\\ImageField($customFieldsModule), array(\n 'name' => 'background',\n 'title' => array('en' => 'Background Image file', 'fr' => 'Fichier de l\\'image d\\'arrière plan'),\n 'description' => array('en' => 'Image file displayed in the page background. The optimal image width is 1920px but it will be automaticaly cropped to optimize the page loading time. If this field is not set, the page background image set for the home page will be used by default.', 'fr' => 'Fichier image affiché en arrière plan de la page. La largeure optimale de l\\'image est de 1920px. Celle-ci sera automatiquement tronquée pour optimiser la durée de chargement de la page. Si ce champs n\\'est pas renseigné, l\\'image d\\'arrière plan renseignée pour la page d\\'acceuil sera utilisé par défault.'),\n 'form_group_id' => $fgBackground->id,\n 'size' => 0,\n 'position' => 1,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => var_export(array('maximumNumberOfFiles' => 1), true), // Only one image is permitted.\n 'owners' => $this->_filterOwners(array('Index', 'Page')),\n ));\n\n # ------------------------------- PAGE ---------------------------------\n if($this->_hasMediaClass('Page'))\n {\n $this->addEntry(new customFields\\VarcharField($customFieldsModule), array(\n 'name' => 'module_owner_id',\n 'title' => array('en' => 'Owner module ID', 'fr'=> 'ID du module propriétaire'),\n 'size' => 63,\n 'required' => 0,\n 'configuration' => '',\n 'default' => '',\n 'owners' => 'Page',\n 'protected' => 1,\n 'in_forms' => 0,\n ));\n \n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'page_title',\n 'title' => array('en' => 'Title', 'fr' => 'Titre'),\n 'description' => array('en' => 'Title for this page.', 'fr' => 'Titre pour cette page.'),\n 'form_group_id' => $fgPageContent->id,\n 'position' => 1,\n 'required' => 1,\n 'in_forms' => 1,\n 'owners' => 'Page',\n 'translatable' => 1,\n 'configuration' => '',\n ));\n $this->addEntry(new \\yiingine\\modules\\media\\models\\PhpCodeField($customFieldsModule), array(\n 'name' => 'before_render',\n 'title' => array('en' => 'Before render script', 'fr' => 'Script d\\'avant rendu'),\n 'description' => array(\n 'en' => 'This script is executed before the rendering of a page to modify is appearance or for defining rendering variables by by returning an array(name => variable).', \n 'fr' => 'Ce script est exécuté avant le rendu de la page pour modifier son apparence ou pour définir des variables de rendu en retournant un array(nom => variable).'\n ),\n 'form_group_id' => $fgScript->id,\n 'position' => 3,\n 'required' => 0,\n 'in_forms' => 1,\n 'owners' => 'Page',\n 'translatable' => 0,\n ));\n $this->addEntry(new customFields\\HtmlField($customFieldsModule), array(\n 'name' => 'page_content',\n 'title' => array('en' => 'Content', 'fr' => 'Contenu'),\n 'description' => array('en' => 'The content of this page. If this page is a module, the special tag {{$module}} can be used within the content as a placeholder for the module\\'s content.', 'fr' => 'Le contenu de cette page. Si cette page est un module, la balise {{$module}} peut-être utilisée comme emplacement du contenu du module.'),\n 'form_group_id' => $fgPageContent->id,\n 'position' => 2,\n 'required' => 0,\n 'in_forms' => 1,\n 'owners' => 'Page',\n 'translatable' => 1,\n ));\n \n $queryConditions = 'type=\\\"Page\\\"';\n if($this->_hasMediaClass('Image')) $queryConditions .= ' OR type=\\\"Image\\\"';\n if($this->_hasMediaClass('Video')) $queryConditions .= ' OR type=\\\"Video\\\"';\n if($this->_hasMediaClass('Gallery')) $queryConditions .= ' OR type=\\\"Gallery\\\"';\n if($this->_hasMediaClass('Insert')) $queryConditions .= ' OR type=\\\"Insert\\\"';\n if($this->_hasMediaClass('Document')) $queryConditions .= ' OR type=\\\"Document\\\"';\n \n $associatableModelClasses = 'array(\"adminUrl\" => (new \\app\\modules\\media\\models\\Page())->getAdminUrl(), \"model\" => (new \\app\\modules\\media\\models\\Page()))';\n if($this->_hasMediaClass('Image')) $associatableModelClasses .= ', array(\"adminUrl\" => (new \\app\\modules\\media\\models\\Image())->getAdminUrl(), \"model\" => (new \\app\\modules\\media\\models\\Image()))';\n if($this->_hasMediaClass('Video')) $associatableModelClasses .= ', array(\"adminUrl\" => (new \\app\\modules\\media\\models\\Video())->getAdminUrl(), \"model\" => (new \\app\\modules\\media\\models\\Video()))';\n if($this->_hasMediaClass('Gallery')) $associatableModelClasses .= ', array(\"adminUrl\" => (new \\app\\modules\\media\\models\\Gallery())->getAdminUrl(), \"model\" => (new \\app\\modules\\media\\models\\Gallery()))';\n if($this->_hasMediaClass('Insert')) $associatableModelClasses .= ', array(\"adminUrl\" => (new \\app\\modules\\media\\models\\Insert())->getAdminUrl(), \"model\" => (new \\app\\modules\\media\\models\\Insert()))';\n if($this->_hasMediaClass('Document')) $associatableModelClasses .= ', array(\"adminUrl\" => (new \\app\\modules\\media\\models\\Document())->getAdminUrl(), \"model\" => (new \\app\\modules\\media\\models\\Document()))';\n \n $this->addEntry(new customFields\\ManyToManyField($customFieldsModule), array(\n 'name' => 'associated_media',\n 'title' => array('en' => 'Associated objects', 'fr' => 'Objets associés'),\n 'description' => array(\n 'en' => 'Images, videos, galleries, inserts, documents or pages to be associated to this object. The right column is displayed only if the view \"2 Columns\" is chosen for this page.',\n 'fr' => 'Images, vidéos, galeries, encarts, documents ou pages à associer à cet objet. La colonne droite est affichée uniquement si la vue \"2 Colonnes\" est selectionée pour cette page.'\n ),\n 'form_group_id' => $fgRightColumn->id,\n 'position' => 2,\n 'configuration' => var_export(array(\n \"modelClass\" => \"\\yiingine\\modules\\media\\models\\Medium\", \n \"queryConditions\" => '\"'.$queryConditions.'\"',\n \"associatableModelClasses\" => \"array($associatableModelClasses)\"\n ), true),\n 'in_forms' => 1,\n 'owners' => $this->_filterOwners(array('Index', 'Page')),\n ));\n }\n \n # ------------------------------- INDEX -------------------------------\n if($this->_hasMediaClass('Index'))\n {\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'index_title',\n 'title' => array('en' => 'Home page title', 'fr' => 'Titre de la page d\\'accueil'),\n 'description' => array('en' => 'Title for the home page.', 'fr' => 'Titre la page d\\'accueil.'),\n 'form_group_id' => $fgTextBlock->id,\n 'position' => 1,\n 'required' => 1,\n 'in_forms' => 1,\n 'owners' => 'Index',\n 'translatable' => 1,\n 'configuration' => '',\n ));\n $this->addEntry(new customFields\\HtmlField($customFieldsModule), array(\n 'name' => 'index_content',\n 'title' => array('en' => 'Home page text', 'fr' => 'Texte de la page d\\'accueil'),\n 'description' => array('en' => 'The text of the home page.', 'fr' => 'Le texte de la page d\\'accueil.'),\n 'form_group_id' => $fgTextBlock->id,\n 'position' => 2,\n 'required' => 0,\n 'in_forms' => 1,\n 'owners' => 'Index',\n 'translatable' => 1,\n 'configuration' => '',\n ));\n $this->addEntry(new customFields\\ManyToManyField($customFieldsModule), array(\n 'name' => 'associated_index_gallery',\n 'title' => array('en' => 'Associated gallery', 'fr' => 'Galerie associée'),\n 'description' => array(\n 'en' => 'Galleries to be associated to the home page.',\n 'fr' => 'Galeries à associer à la page d\\'acceuil.'\n ),\n 'form_group_id' => $fgIndexContent->id,\n 'position' => 1,\n 'configuration' => var_export(array(\n \"modelClass\" => \"\\yiingine\\modules\\media\\models\\Medium\", \n \"queryConditions\" => \"type=\\\"Gallery\\\"\", \n \"associatableModelClasses\" => 'array(array(\"adminUrl\" => (new \\app\\modules\\media\\models\\Gallery())->getAdminUrl(), \"model\" => (new \\app\\modules\\media\\models\\Gallery())))'\n ), true),\n 'in_forms' => 1,\n 'owners' => 'Index',\n ));\n }\n \n # ------------------------------- IMAGE --------------------------------\n if($this->_hasMediaClass('Image'))\n {\n $this->addEntry(new customFields\\ImageField($customFieldsModule), array(\n 'name' => 'image_image',\n 'title' => array('en' => 'Image file', 'fr' => 'Fichier de l\\'image'),\n 'description' => array('en' => 'File attached to the image object.', 'fr' => 'Fichier attaché à cet objet image.'),\n 'form_group_id' => $fgFile->id,\n 'size' => 0,\n 'position' => 1,\n 'required' => 1,\n 'in_forms' => 1,\n 'configuration' => var_export(array('maximumNumberOfFiles' => 1), true), //Only one image is permitted.\n 'owners' => 'Image',\n ));\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'image_title',\n 'title' => array('en' => 'Title', 'fr' => 'Titre'),\n 'description' => array('en' => 'Title for this image.', 'fr' => 'Titre pour cette image.'),\n 'form_group_id' => $fgText->id,\n 'position' => 1,\n 'size' => 255,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => '',\n 'owners' => 'Image',\n 'translatable' => 1,\n ));\n $this->addEntry(new customFields\\HtmlField($customFieldsModule), array(\n 'name' => 'image_text',\n 'title' => array('en' => 'Texte', 'fr' => 'Texte'),\n 'description' => array('en' => 'The html text displayed with this image.', 'fr' => 'Le texte html affiché avec cette image.'),\n 'form_group_id' => $fgText->id,\n 'position' => 2,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => $HtmlFieldConfig['paragraphs'],\n 'owners' => 'Image',\n 'translatable' => 1,\n ));\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'image_link',\n 'title' => array('en' => 'Link', 'fr' => 'Lien'),\n 'description' => array('en' => 'Link followed when clicking on the image. If this field is not specified, a zoom on the image will be displayed.', 'fr' => 'Lien suivi lorsque l\\'on clic sur l\\'image. Si ce champs n\\'est pas renseigné, un zoom sur l\\'image sera affiché.'),\n 'form_group_id' => $fgLink->id,\n 'position' => 1,\n 'size' => 255,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => '',\n 'owners' => 'Image',\n 'translatable' => 1,\n ));\n }\n \n # ------------------------------- VIDEO --------------------------------\n if($this->_hasMediaClass('Video'))\n {\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'video_iframe',\n 'title' => array('en' => 'Iframe tag', 'fr' => 'Balise iframe'),\n 'description' => array('en' => 'HTML code for the embedding provided by the video hosting (Youtube, Dailymotion, Vimeo,...).', 'fr' => 'Code HTML pour l\\'intégration fournis par l\\'hébergeur de la vidéo (Youtube, Dailymotion, Viméo,...).'),\n 'form_group_id' => $fgEmbedding->id,\n 'position' => 1,\n 'required' => 1,\n 'in_forms' => 1,\n 'configuration' => '',\n 'owners' => 'Video',\n ));\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'video_title',\n 'title' => array('en' => 'Title', 'fr' => 'Titre'),\n 'description' => array('en' => 'Title for this video.', 'fr' => 'Titre pour cette vidéo.'),\n 'form_group_id' => $fgInformations->id,\n 'position' => 1,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => '',\n 'owners' => 'Video',\n 'translatable' => 1,\n ));\n $this->addEntry(new customFields\\HtmlField($customFieldsModule), array(\n 'name' => 'video_text',\n 'title' => array('en' => 'Text', 'fr' => 'Texte'),\n 'description' => array('en' => 'The html text displayed with this video.', 'fr' => 'Le texte html affiché avec cette vidéo.'),\n 'form_group_id' => $fgInformations->id,\n 'position' => 2,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => $HtmlFieldConfig['paragraphs'],\n 'owners' => 'Video',\n 'translatable' => 1,\n ));\n $this->addEntry(new customFields\\DateField($customFieldsModule), array(\n 'name' => 'video_date',\n 'title' => array('en' => 'Date', 'fr' => 'Date'),\n 'description' => array('en' => 'Date displayed with the video, if specified.', 'fr' => 'Date affichée avec la vidéo, si renseignée.'),\n 'form_group_id' => $fgInformations->id,\n 'position' => 3,\n 'required' => 0,\n 'in_forms' => 1,\n 'owners' => 'Video',\n ));\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'video_duration',\n 'title' => array('en' => 'Duration', 'fr' => 'Durée'),\n 'description' => array('en' => 'The duration of the video.', 'fr' => 'La durée de la vidéo.'),\n 'form_group_id' => $fgInformations->id,\n 'position' => 4,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => '',\n 'owners' => 'Video',\n ));\n $this->addEntry(new customFields\\EnumField($customFieldsModule), array(\n 'name' => 'video_language',\n 'title' => array('en' => 'Language', 'fr' => 'Langue'),\n 'description' => array('en' => 'The language of the video.', 'fr' => 'La langue de la vidéo.'),\n 'form_group_id' => $fgInformations->id,\n 'position' => 5,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => \n\"return [\n 'data' => [\n 'en' => 'English',\n 'fr' => 'French',\n 'multi' => 'Multilingual'\n ]\n];\",\n 'owners' => 'Video',\n ));\n }\n \n # ------------------------------ GALLERY -------------------------------\n if($this->_hasMediaClass('Gallery'))\n {\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'gallery_title',\n 'title' => array('en' => 'Title', 'fr' => 'Titre'),\n 'description' => array('en' => 'Title for this gallery.', 'fr' => 'Titre pour cette galerie.'),\n 'form_group_id' => $fgText->id,\n 'position' => 1,\n 'size' => 255,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => '',\n 'owners' => 'Gallery',\n 'translatable' => 1,\n ));\n $this->addEntry(new customFields\\HtmlField($customFieldsModule), array(\n 'name' => 'gallery_text',\n 'title' => array('en' => 'Text', 'fr' => 'Texte'),\n 'description' => array('en' => 'The html text displayed with this gallery.', 'fr' => 'Le texte html affiché avec cette galerie.'),\n 'form_group_id' => $fgText->id,\n 'position' => 2,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => $HtmlFieldConfig['paragraphs'],\n 'owners' => 'Gallery',\n 'translatable' => 1,\n ));\n $this->addEntry(new customFields\\ManyToManyField($customFieldsModule), array(\n 'name' => 'gallery_items',\n 'title' => array('en' => 'Associated items', 'fr' => 'Éléments associés'),\n 'description' => array(\n 'en' => 'Images or Videos to be associated to this gallery.',\n 'fr' => 'Images ou Vidéos à associer à cette galerie.'\n ),\n 'form_group_id' => $fgGalleryContent->id,\n 'position' => 1,\n 'configuration' => var_export(array(\n \"modelClass\" => \"\\yiingine\\modules\\media\\models\\Medium\", \n \"queryConditions\" => \"type=\\\"Image\\\"\", \n \"associatableModelClasses\" => 'array(array(\"adminUrl\" => (new \\app\\modules\\media\\models\\Image())->getAdminUrl(), \"model\" => (new \\app\\modules\\media\\models\\Image())))'\n ), true),\n 'in_forms' => 1,\n 'owners' => 'Gallery',\n ));\n }\n \n # ------------------------------ INSERT --------------------------------\n if($this->_hasMediaClass('Insert'))\n {\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'insert_title',\n 'title' => array('en' => 'Title', 'fr' => 'Titre'),\n 'description' => array('en' => 'Title for this insert. To not display it, select the \"Content only\" view.', 'fr' => 'Titre pour cet encart. Pour ne pas l\\'afficher, selectionner la vue \"Contenu seul\".'),\n 'form_group_id' => $fgText->id,\n 'position' => 1,\n 'size' => 255,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => '',\n 'owners' => 'Insert',\n 'translatable' => 1,\n ));\n $this->addEntry(new customFields\\HtmlField($customFieldsModule), array(\n 'name' => 'insert_text',\n 'title' => array('en' => 'Text', 'fr' => 'Text'),\n 'description' => array('en' => 'The html text displayed in this insert.', 'fr' => 'Le texte html affiché dans cet encart.'),\n 'form_group_id' => $fgText->id,\n 'position' => 2,\n 'required' => 1,\n 'in_forms' => 1,\n 'configuration' => $HtmlFieldConfig['paragraphs'],\n 'owners' => 'Insert',\n 'translatable' => 1,\n ));\n }\n \n # ----------------------------- DOCUMENT -------------------------------\n if($this->_hasMediaClass('Document'))\n {\n $this->addEntry(new customFields\\FileField($customFieldsModule), array(\n 'name' => 'document_file',\n 'title' => array('en' => 'File', 'fr' => 'Fichier'),\n 'description' => array('en' => 'Title for this document. All file formats allowed.', 'fr' => 'Fichier attaché à ce document. Tous les formats de fichiers sont autorisés.'),\n 'form_group_id' => $fgFile->id,\n 'position' => 1,\n 'required' => 1,\n 'in_forms' => 1,\n 'owners' => 'Document',\n 'translatable' => 0,\n 'configuration' => \n'[\n \"maximumNumberOfFiles\" => 1,\n]',\n ));\n $this->addEntry(new customFields\\TextField($customFieldsModule), array(\n 'name' => 'document_title',\n 'title' => array('en' => 'Title', 'fr' => 'Titre'),\n 'description' => array('en' => 'Title for this document.', 'fr' => 'Titre de ce document.'),\n 'form_group_id' => $fgText->id,\n 'position' => 1,\n 'required' => 0,\n 'in_forms' => 1,\n 'owners' => 'Document',\n 'translatable' => 1,\n 'configuration' => '',\n ));\n $this->addEntry(new customFields\\HtmlField($customFieldsModule), array(\n 'name' => 'document_text',\n 'title' => array('en' => 'Text', 'fr' => 'Texte'),\n 'description' => array('en' => 'The html text displayed with this document.', 'fr' => 'Le texte html affiché avec ce document.'),\n 'form_group_id' => $fgText->id,\n 'position' => 2,\n 'required' => 0,\n 'in_forms' => 1,\n 'configuration' => $HtmlFieldConfig['paragraphs'],\n 'owners' => 'Document',\n 'translatable' => 1,\n ));\n }\n \n # ----------------------- ASSOCIATED MENU ITEMS ------------------------\n $this->addEntry(new \\yiingine\\modules\\media\\models\\AssociatedMenuItemsField($customFieldsModule), array(\n 'name' => 'menu_items',\n 'title' => array('en' => 'Associated menu items', 'fr' => 'Items de menu associés'),\n 'description' => array(\n 'en' => 'The menu items associated to this page. Enabling or disabling this model will also enable or disable its menu items. A menu item is positionned in front of the one selectionned in the position input list.', \n 'fr' => 'Les items de menu associés à cette page. Une modification de l\\'activation de ce modèle se répercutera sur ses items de menu. Un item de menu se positionne à l\\'avant de celui qui est sélectionné dans le choix de la position.'\n ),\n 'form_group_id' => $fgMenus->id,\n 'position' => 1,\n 'in_forms' => 0, //Handled in special way by the medium form.\n 'owners' => 'Page,Module,Index',\n ));\n \n echo \" done (time: \".sprintf('%.3f', microtime(true)-$time).\"s)\\n\"; \n \n ############################ MEDIA SAMPLES ############################\n \n echo \" > creating sample media ...\";\n $time = microtime(true);\n \n # ------------------------------ INDEX ------------------------------- \n \n if($this->_hasMediaClass('Index'))\n { \n // Index Background\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test_background_1.jpg'));\n // Index Thumbnail\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test_thumbnail_1.jpg'));\n $model = $this->addEntry(new models\\Index(), array(\n 'index_title' => array('en' => 'The home page main title must be full of keywords', 'fr' => 'Le titre de la page d\\'accueil doit être rempli de mots-clés'),\n 'index_content' => array(\n 'en' => self::getLoremIpsum('en',1,0).\\yii\\helpers\\Html::tag('p','<b>John Doe</b><br /> Manager of this application.', array('class'=>'signature')),\n 'fr' => self::getLoremIpsum('fr',1,0).\\yii\\helpers\\Html::tag('p','<b>John Doe</b><br /> Gérant de cette application.', array('class'=>'signature')),\n ),\n 'background' => '_test_background_1.jpg',\n 'thumbnail' => '_test_thumbnail_1.jpg',\n 'description' => array('en' => 'A meta description for the index page containing keywords like keyword 1, keyword 2 or keyword 3.', 'fr' => 'Une description pour la page index contenant quelques mots clés comme mot-clé 1, mot-clé 2 ou mot-clé 3.'),\n 'keywords' => array('en' => 'keyword 1, keyword 2, keyword 3', 'fr' => 'mot-clé 1, mot-clé 2, mot-clé 3')\n ));\n \n $index = $model;\n \n $this->addEntry(new \\yiingine\\models\\UrlRewritingRule(), array(\n 'pattern' => '',\n 'route' => 'media/default/index',\n 'defaults' => '[\"id\" => \"Index\"]',\n 'system_generated' => 1\n ));\n \n /*$menuItem = $this->addEntry(new MenuItem(), array(\n 'name' => array('en' => 'Home', 'fr' => 'Accueil'),\n 'parent_id' => 1,\n 'position' => 1,\n 'route' => '/media/default/index',\n 'parameters' => '/id/Index',\n 'model_id' => $index->id,\n 'model_class' => models\\Index::className()\n ));*/\n }\n // Use a PAGE for the index.\n else if($this->_hasMediaClass('Page'))\n {\n $model = $this->addEntry(new models\\Page(), array(\n 'page_title' => array('en' => 'The home page main title must be full of keywords', 'fr' => 'Le titre de la page d\\'accueil doit être rempli de mots-clés'),\n 'page_content' => array('en' => self::getLoremIpsum('en'), 'fr' => self::getLoremIpsum('fr')),\n 'description' => array('en' => 'A meta description for the index page', 'fr' => 'Une description pour la page index'),\n 'keywords' => array('en' => 'keyword 1, keyword 2, keyword 3', 'fr' => 'mot-clé 1, mot-clé 2, mot-clé 3')\n ));\n \n $this->addEntry(new MenuItem(), array(\n 'name' => array('en' => 'Home', 'fr' => 'Accueil'),\n 'parent_id' => 1,\n 'position' => 1,\n 'route' => '/media/default/index',\n 'parameters' => '/id/'.$model->id,\n 'model_id' => $model->id,\n 'model_class' => models\\Page::className()\n ));\n }\n \n # ------------------------------- IMAGE --------------------------------\n /* Image 1 (with caption + portrait)\n * Image 2 (without caption + landscape)\n * Image 3 (with caption + landscape + deactivated)\n */\n if($this->_hasMediaClass('Image'))\n {\n $images = [];\n \n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test-image-1.jpg'));\n $images[] = $this->addEntry(new models\\Image(), array(\n 'image_title' => array('en' => 'Image 1', 'fr' => 'Image 1'),\n 'image_text' => array(\n 'en' => '<p>Image 1 caption : Nunc nunc neque, '.Yii::tA(array('en' => 'keyword 3', 'fr' => 'mot-clé 3')).' lacinia quis ultrices id, mollis ac dolor. Suspendisse pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>', \n 'fr' => '<p>Légende de l\\'image 1 :</b> Nunc nunc neque, '.Yii::tA(array('en' => 'keyword 3', 'fr' => 'mot-clé 3')).' lacinia quis ultrices id, mollis ac dolor. Suspendisse pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>'\n ),\n 'image_image' => '_test-image-1.jpg',\n ));\n \n copy($assets.'/test-image-2.jpg', Yii::getAlias('@webroot/user/temp/_test-image-2.jpg'));\n $images[] = $this->addEntry(new models\\Image(), array(\n 'image_title' => array('en' => 'Image 2 without caption', 'fr' => 'Image 2 sans légende'),\n 'image_image' => '_test-image-2.jpg',\n ));\n \n copy($assets.'/test-image-3.jpg', Yii::getAlias('@webroot/user/temp/_test-image-3.jpg'));\n $images[] = $this->addEntry(new models\\Image(), array(\n 'image_text' => array(\n 'en' => '<p>Image 3 with link and without title : Nunc nunc neque, lacinia quis ultrices id, mollis ac dolor. Suspendisse pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus '.Yii::tA(array('en' => 'keyword 2', 'fr' => 'mot-clé 2')).' non congue condimentum, imperdiet pulvinar arcu.</p>',\n 'fr' => '<p>Image 3 avec un lien et sans titre : Nunc nunc neque, lacinia quis ultrices id, mollis ac dolor. Suspendisse pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus '.Yii::tA(array('en' => 'keyword 2', 'fr' => 'mot-clé 2')).' non congue condimentum, imperdiet pulvinar arcu.</p>'\n ),\n 'image_image' => '_test-image-3.jpg',\n 'image_link' => 'http://sample.com',\n ));\n }\n \n # ------------------------------- VIDEO --------------------------------\n /* Video 1 (Youtube)\n * Video 2 (Dailymotion)\n * Video 3 (Vimeo)\n */\n if($this->_hasMediaClass('Video'))\n {\n $videos = [];\n // Video 1 : Youtube\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test-image-1.jpg'));\n $videos[] = $this->addEntry(new models\\Video(), array(\n 'video_title' => array('en' => 'Video 1', 'fr' => 'Vidéo 1'),\n 'video_text' => array(\n 'en' => '<p>Sample for a YouTube video with a thumbnail image and all fields filled :</p>'.self::getLoremIpsum('en', 1, 0), \n 'fr' => '<p>Exemple d\\'une vidéo YouTube avec une image de vignette et tous les champs renseignés :</p>'.self::getLoremIpsum('fr', 1, 0),\n ),\n 'video_iframe' => '<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/UNXUJZfDk90\" frameborder=\"0\" allowfullscreen></iframe>',\n 'video_duration' => '4:06',\n 'video_language' => 'en',\n 'thumbnail' => '_test-image-1.jpg',\n 'position' => 1,\n ));\n // Video 2 : Dailymotion\n $videos[] = $this->addEntry(new models\\Video(), array(\n 'video_title' => array('en' => 'Video 2', 'fr' => 'Vidéo 2'),\n 'video_text' => array(\n 'en' => '<p>Sample for a Dailymotion video without thumbnail image and with all the other fields filled : </p>'.self::getLoremIpsum('en', 1, 0), \n 'fr' => '<p>Exemple d\\'une vidéo Dailymotion sans image de vignette et avec tous autres les champs renseignés : </p>'.self::getLoremIpsum('fr', 1, 0),\n ),\n 'video_iframe' => '<iframe frameborder=\"0\" width=\"480\" height=\"270\" src=\"//www.dailymotion.com/embed/video/x2e6e5l\" allowfullscreen></iframe><br /><a href=\"http://www.dailymotion.com/video/x2e6e5l_honey-bees-feeding-on-flower-nectar_animals\" target=\"_blank\">Honey Bees feeding on flower nectar</a> <i>par <a href=\"http://www.dailymotion.com/tjalex4life\" target=\"_blank\">tjalex4life</a></i>',\n 'video_duration' => '01:01',\n 'video_language' => 'fr',\n 'position' => 2,\n ));\n // Video 3 : Vimeo\n $videos[] = $this->addEntry(new models\\Video(), array(\n 'video_text' => array(\n 'en' => '<p>Sample for a Vimeo video without title, thumbnail image, date, duration and language filled : </p>'.self::getLoremIpsum('en', 1, 0), \n 'fr' => '<p>Exemple d\\'une vidéo Vimeo sans titre, image de vignette, date, durée et langue renseignés : </p>'.self::getLoremIpsum('fr', 1, 0),\n ),\n 'video_iframe' => '<iframe src=\"https://player.vimeo.com/video/62348933\" width=\"500\" height=\"281\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> <p><a href=\"https://vimeo.com/62348933\">Nikon D7100 AF Test</a> from <a href=\"https://vimeo.com/thenikonguy\">PVA</a> on <a href=\"https://vimeo.com\">Vimeo</a>.</p>',\n 'position' => 3,\n )); \n }\n \n # ------------------------------ GALLERY -------------------------------\n if($this->_hasMediaClass('Gallery'))\n {\n $galleries = [];\n $imagesCopy = $images;\n // Creating 3 galleries\n for($i=0; $i<=2; $i++)\n {\n if($i<=1)\n {\n $galleryFields = [\n 'gallery_title' => array('en' => 'Gallery '.($i+1), 'fr' => 'Galerie '.($i+1)),\n 'gallery_text' => array(\n 'en' => '<p><b>Gallery '.($i+1).' text :</b> Nunc nunc neque, lacinia quis ultrices id, mollis ac dolor. '.ucfirst(Yii::tA(array('en' => 'keyword', 'fr' => 'mot-clé'))).'3 pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>',\n 'fr' => '<p><b>Texte de la galerie '.($i+1).' :</b> Nunc nunc neque, lacinia quis ultrices id, mollis ac dolor. '.ucfirst(Yii::tA(array('en' => 'keyword', 'fr' => 'mot-clé'))).'3 pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>'\n )\n ];\n }\n else\n {\n $galleryFields = [\n 'gallery_text' => array(\n 'en' => '<p><b>Gallery '.($i+1).' text (without title) :</b> Nunc nunc neque, lacinia quis ultrices id, mollis ac dolor. '.ucfirst(Yii::tA(array('en' => 'keyword', 'fr' => 'mot-clé'))).'3 pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>',\n 'fr' => '<p><b>Texte de la galerie (sans titre) '.($i+1).' :</b> Nunc nunc neque, lacinia quis ultrices id, mollis ac dolor. '.ucfirst(Yii::tA(array('en' => 'keyword', 'fr' => 'mot-clé'))).'3 pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>'\n )\n ];\n }\n $galleryFields['position'] = ($i+1);\n $galleries[$i] = $this->addEntry(new models\\Gallery(), $galleryFields);\n // Gallery image children\n foreach($imagesCopy as $k => $image)\n {\n $galleries[$i]->link('gallery_items', $image, ['relation_position' => $k + 1]);\n }\n // Each time delete the first image of the children list\n unset($imagesCopy[$i-1]);\n // For the first gallery\n if($i==0)\n {\n // Gallery video child\n $galleries[$i]->link('gallery_items', $videos[0], ['relation_position' => count($images)+1 + 1]);\n if($this->_hasMediaClass('Index'))\n {\n // Index gallery\n $index->link('associated_index_gallery', $galleries[0], ['relation_position' => 1]);\n }\n }\n }\n }\n \n # ------------------------------ INSERT -------------------------------\n if($this->_hasMediaClass('Insert'))\n {\n $inserts = [];\n // Insert 1\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test-image-1_fr.jpg'));\n $imageInTheTextHtmlFr = '<p><img title=\"Image Test dans un encart\" src=\"{{baseURL}}/user/temp/_test-image-1_fr.jpg\" alt=\"Image Test dans un encart\" width=\"280\" height=\"150\" /></p>';\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test-image-1_en.jpg'));\n $imageInTheTextHtmlEn = '<p><img title=\"Test Image in insert\" src=\"{{baseURL}}/user/temp/_test-image-1_en.jpg\" alt=\"Test Image in insert\" width=\"280\" height=\"150\" /></p>';\n $inserts[] = $this->addEntry(new models\\Insert(), [\n 'insert_title' => [\n 'en' => 'Insert 1',\n 'fr' => 'Encart 1',\n ],\n 'insert_text' => [\n 'en' => self::getLoremIpsum('en', 1, 0),\n 'fr' => self::getLoremIpsum('fr', 1, 0),\n ],\n ]);\n // Insert 2\n $inserts[] = $this->addEntry(new models\\Insert(), array(\n 'insert_title' => [\n 'en' => 'Insert 2 with image',\n 'fr' => 'Encart 2 avec image',\n ],\n 'insert_text' => array(\n 'en' => $imageInTheTextHtmlEn.self::getLoremIpsum('en', 1, 0),\n 'fr' => $imageInTheTextHtmlFr.self::getLoremIpsum('fr', 1, 0),\n ),\n ));\n // Insert 3\n $inserts[] = $this->addEntry(new models\\Insert(), array(\n 'insert_text' => array(\n 'en' => '<p>Insert without title : '.strip_tags(self::getLoremIpsum('en', 1, 0)).'</p>',\n 'fr' => '<p>Encart sans titre : '.strip_tags(self::getLoremIpsum('fr', 1, 0)).'</p>'\n ),\n ));\n }\n \n # ------------------------------ DOCUMENT ------------------------------\n if($this->_hasMediaClass('Document'))\n {\n $documents = [];\n // Document 1 (PDF)\n copy($assets.'/document/file.pdf', Yii::getAlias('@webroot/user/temp/_file.pdf'));\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test-image-1.jpg')); \n $documents[] = $this->addEntry(new models\\Document(), array(\n 'document_file' => '_file.pdf',\n 'document_title' => array(\n 'en' => 'Document 1',\n 'fr' => 'Document 1',\n ),\n 'document_text' => array(\n 'en' => '<p>Document description : Nunc nunc neque, '.Yii::tA(array('en' => 'keyword 3', 'fr' => 'mot-clé 3')).' lacinia quis ultrices id, mollis ac dolor. Suspendisse pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>', \n 'fr' => '<p>Description du document : Nunc nunc neque, '.Yii::tA(array('en' => 'keyword 3', 'fr' => 'mot-clé 3')).' lacinia quis ultrices id, mollis ac dolor. Suspendisse pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>'\n ),\n 'thumbnail' => '_test-image-1.jpg',\n ));\n // Document 2 (ZIP)\n copy($assets.'/document/file.zip', Yii::getAlias('@webroot/user/temp/_file.zip'));\n $documents[] = $this->addEntry(new models\\Document(), array(\n 'document_file' => '_file.zip',\n 'document_title' => array(\n 'en' => 'Document 2 without image',\n 'fr' => 'Document 2 sans image',\n ),\n 'document_text' => array(\n 'en' => '<p>Document description : Nunc nunc neque, '.Yii::tA(array('en' => 'keyword 3', 'fr' => 'mot-clé 3')).' lacinia quis ultrices id, mollis ac dolor. Suspendisse pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>', \n 'fr' => '<p>Description du document : Nunc nunc neque, '.Yii::tA(array('en' => 'keyword 3', 'fr' => 'mot-clé 3')).' lacinia quis ultrices id, mollis ac dolor. Suspendisse pretium tellus. Aenean varius bibendum faucibus. Nam in purus fel, non tempus velit. Cras tellus nisl, luctus non congue condimentum, imperdiet pulvinar arcu.</p>'\n ),\n ));\n }\n \n # ------------------------------- PAGE ---------------------------------\n if($this->_hasMediaClass('Page'))\n {\n $pages = $subMenus = [];\n \n // FIRST PAGE\n // Images in the text\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test-image-1_fr.jpg'));\n copy($assets.'/test-image-2.jpg', Yii::getAlias('@webroot/user/temp/_test-image-2_fr.jpg'));\n copy($assets.'/test-image-3.jpg', Yii::getAlias('@webroot/user/temp/_test-image-3_fr.jpg'));\n $imagesInTextFr = '<p><img src=\"{{baseURL}}/user/temp/_test-image-1_fr.jpg\" alt=\"Image test dans le texte 1\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextFr .= '<div class=\"row\">';\n $imagesInTextFr .= '<div class=\"col-sm-6\">';\n $imagesInTextFr .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-2_fr.jpg\" alt=\"Image test dans le texte 2\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextFr .= '</div>';\n $imagesInTextFr .= '<div class=\"col-sm-6\">';\n $imagesInTextFr .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-3_fr.jpg\" alt=\"Image test dans le texte 3\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextFr .= '</div>';\n $imagesInTextFr .= '</div>';\n $imagesInTextFr .= '<div class=\"row\">';\n $imagesInTextFr .= '<div class=\"col-sm-4\">';\n $imagesInTextFr .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-1_fr.jpg\" alt=\"Image test dans le texte 1\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextFr .= '</div>';\n $imagesInTextFr .= '<div class=\"col-sm-4\">';\n $imagesInTextFr .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-2_fr.jpg\" alt=\"Image test dans le texte 2\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextFr .= '</div>';\n $imagesInTextFr .= '<div class=\"col-sm-4\">';\n $imagesInTextFr .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-3_fr.jpg\" alt=\"Image test dans le texte 3\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextFr .= '</div>';\n $imagesInTextFr .= '</div>';\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test-image-1_en.jpg'));\n copy($assets.'/test-image-2.jpg', Yii::getAlias('@webroot/user/temp/_test-image-2_en.jpg'));\n copy($assets.'/test-image-3.jpg', Yii::getAlias('@webroot/user/temp/_test-image-3_en.jpg'));\n $imagesInTextEn = '<p><img src=\"{{baseURL}}/user/temp/_test-image-1_en.jpg\" alt=\"Image in the text 1\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextEn .= '<div class=\"row\">';\n $imagesInTextEn .= '<div class=\"col-sm-6\">';\n $imagesInTextEn .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-2_en.jpg\" alt=\"Image in the text 2\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextEn .= '</div>';\n $imagesInTextEn .= '<div class=\"col-sm-6\">';\n $imagesInTextEn .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-3_en.jpg\" alt=\"Image in the text 3\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextEn .= '</div>';\n $imagesInTextEn .= '</div>';\n $imagesInTextEn .= '<div class=\"row\">';\n $imagesInTextEn .= '<div class=\"col-sm-4\">';\n $imagesInTextEn .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-1_en.jpg\" alt=\"Image test dans le texte 1\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextEn .= '</div>';\n $imagesInTextEn .= '<div class=\"col-sm-4\">';\n $imagesInTextEn .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-2_en.jpg\" alt=\"Image test dans le texte 2\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextEn .= '</div>';\n $imagesInTextEn .= '<div class=\"col-sm-4\">';\n $imagesInTextEn .= '<p><img src=\"{{baseURL}}/user/temp/_test-image-3_en.jpg\" alt=\"Image test dans le texte 3\" width=\"1920\" height=\"750\" /></p>';\n $imagesInTextEn .= '</div>';\n $imagesInTextEn .= '</div>';\n // Page Background\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test_background_1.jpg'));\n // Page Thumbnail\n copy($assets.'/test-image-1.jpg', Yii::getAlias('@webroot/user/temp/_test_thumbnail_1.jpg'));\n // Creating Page\n $pages[] = $model = array($this->addEntry(new models\\Page(), array(\n 'page_title' => array('en' => 'First Page', 'fr' => 'Première Page'),\n 'page_content' => array(\n 'en' => self::getLoremIpsum('en', 2, 2).$imagesInTextEn.self::getLoremIpsum('en', 1, 2),\n 'fr' => self::getLoremIpsum('fr', 2, 2).$imagesInTextFr.self::getLoremIpsum('fr', 1, 2)),\n 'background' => '_test_background_1.jpg',\n 'thumbnail' => '_test_thumbnail_1.jpg',\n 'description' => array(\n 'en' => 'A meta description for the first page : Aliquam erat volutpat. Praesent varius vehicula felis. Pellentesque dictum mauris vitae dictum.',\n 'fr' => 'Une description pour la première page : Aliquam erat volutpat. Praesent varius vehicula felis. Pellentesque dictum mauris vitae dictum.'),\n 'keywords' => array('en' => 'keyword 1', 'fr' => 'mot-clé 1'),\n )), 1, 2, array('en' => 'Page 1', 'fr' => 'Page 1'));\n // Image 1 associated\n if($this->_hasMediaClass('Image'))\n {\n $model[0]->link('associated_media', $images[0], ['relation_position' => 1]);\n }\n // Video 1 associated\n if($this->_hasMediaClass('Video'))\n {\n $model[0]->link('associated_media', $videos[0], ['relation_position' => 2]);\n }\n // Insert 1 associated\n if($this->_hasMediaClass('Insert'))\n {\n $model[0]->link('associated_media', $inserts[0], ['relation_position' => 3]);\n }\n // Document 1 associated\n if($this->_hasMediaClass('Document'))\n {\n $model[0]->link('associated_media', $documents[0], ['relation_position' => 4]);\n }\n // Gallery 1 associated\n if($this->_hasMediaClass('Gallery'))\n {\n $model[0]->link('associated_media', $galleries[0], ['relation_position' => 5]);\n }\n \n // SECOND PAGE\n // Gallery in the text\n $imageGalleryInTheTextHtmlFr = '<div class=\"corpusGallery\"><span class=\"corpusGalleryMarker\">{{gallery}}</span>';\n $imageGalleryInTheTextHtmlEn = '<div class=\"corpusGallery\"><span class=\"corpusGalleryMarker\">{{gallery}}</span>';\n for($i=1;$i<=3;$i++)\n {\n copy($assets.'/test-image-'.$i.'.jpg', Yii::getAlias('@webroot/user/temp/_test-image-'.$i.'_fr.jpg'));\n $imageGalleryInTheTextHtmlFr .= '<img title=\"Image '.$i.' de Galerie Test dans le texte\" src=\"{{baseURL}}/user/temp/_test-image-'.$i.'_fr.jpg\" alt=\"Image '.$i.' de Galerie Test dans le texte\" width=\"1920\" height=\"1440\" />';\n copy($assets.'/test-image-'.$i.'.jpg', Yii::getAlias('@webroot/user/temp/_test-image-'.$i.'_en.jpg'));\n $imageGalleryInTheTextHtmlEn .= '<img title=\"Image '.$i.' of Test Gallery in the text\" src=\"{{baseURL}}/user/temp/_test-image-'.$i.'_en.jpg\" alt=\"Image '.$i.' of Test Gallery in the text\" width=\"1920\" height=\"1440\" />';\n }\n $imageGalleryInTheTextHtmlFr .= '<span class=\"corpusGalleryMarker\">{{/gallery}}</span></div>';\n $imageGalleryInTheTextHtmlEn .= '<span class=\"corpusGalleryMarker\">{{/gallery}}</span></div>';\n // Page Background\n copy($assets.'/test-image-2.jpg', Yii::getAlias('@webroot/user/temp/_test_background_2.jpg'));\n // Page Thumbnail\n copy($assets.'/test-image-2.jpg', Yii::getAlias('@webroot/user/temp/_test_thumbnail_2.jpg'));\n // Creating Page\n $pages[] = $model = array($this->addEntry(new models\\Page(), array(\n 'page_title' => array('en' => 'Second Page', 'fr' => 'Seconde Page'),\n 'page_content' => array(\n 'en' => self::getLoremIpsum('en', 2, 2).$imageGalleryInTheTextHtmlEn.self::getLoremIpsum('en', 1, 2),\n 'fr' => self::getLoremIpsum('fr', 2, 2).$imageGalleryInTheTextHtmlFr.self::getLoremIpsum('fr', 1, 2)),\n 'background' => '_test_background_2.jpg',\n 'thumbnail' => '_test_thumbnail_2.jpg',\n 'description' => array(\n 'en' => 'A meta description for the second page : Aliquam erat volutpat. Praesent varius vehicula felis. Pellentesque dictum mauris vitae dictum.',\n 'fr' => 'Une description pour la seconde page : Aliquam erat volutpat. Praesent varius vehicula felis. Pellentesque dictum mauris vitae dictum.'),\n 'keywords' => array('en' => 'keyword 2', 'fr' => 'mot-clé 2'),\n )), 1, 3, array('en' => 'Page 2', 'fr' => 'Page 2'));\n // Image 2 associated\n if($this->_hasMediaClass('Image'))\n {\n $model[0]->link('associated_media', $images[1], ['relation_position' => 1]);\n }\n // Video 2 associated\n if($this->_hasMediaClass('Video'))\n {\n $model[0]->link('associated_media', $videos[1], ['relation_position' => 2]);\n }\n // Insert 2 associated\n if($this->_hasMediaClass('Insert'))\n {\n $model[0]->link('associated_media', $inserts[1], ['relation_position' => 3]);\n }\n // Document 2 associated\n if($this->_hasMediaClass('Document'))\n {\n $model[0]->link('associated_media', $documents[1], ['relation_position' => 4]);\n }\n // Gallery 2 associated\n if($this->_hasMediaClass('Gallery'))\n {\n $model[0]->link('associated_media', $galleries[1], ['relation_position' => 5]);\n }\n // Page 1 associated\n $model[0]->link('associated_media', $pages[0][0], ['relation_position' => 6]);\n \n // THIRD PAGE\n $pages[] = $model = array($this->addEntry(new models\\Page(), array(\n 'page_title' => array('en' => 'About', 'fr' => 'À propos'),\n 'page_content' => array(\n 'en' => self::getLoremIpsum('en', 1, 1).'{{$test}}'.self::getLoremIpsum('en', 2, 2), \n 'fr' => self::getLoremIpsum('fr', 1, 1).'{{$test}}'.self::getLoremIpsum('fr', 2, 2),\n ),\n 'keywords' => array('en' => 'keyword 3', 'fr' => 'mot-clé 3'),\n 'before_render' => '$test = \"<div class=\\\"jumbotron\\\"><p>\".Yii::tA([\"en\" => \"Before render test succefully passed !\", \"fr\" => \"Test du before render réussit !\"]).\"</p></div>\";'.\"\\n\".'return [\\'test\\' => $test];',\n )), 1, 4, array('en' => 'About', 'fr' => 'À propos'));\n // Image 3 associated\n if($this->_hasMediaClass('Image'))\n {\n $model[0]->link('associated_media', $images[2], ['relation_position' => 1]);\n }\n // Video 3 associated\n if($this->_hasMediaClass('Video'))\n {\n $model[0]->link('associated_media', $videos[2], ['relation_position' => 2]);\n }\n // Insert 3 associated\n if($this->_hasMediaClass('Insert'))\n {\n $model[0]->link('associated_media', $inserts[2], ['relation_position' => 3]);\n }\n // Gallery 3 associated\n if($this->_hasMediaClass('Gallery'))\n {\n $model[0]->link('associated_media', $galleries[2], ['relation_position' => 5]);\n }\n // Page 2 associated\n $model[0]->link('associated_media', $pages[1][0], ['relation_position' => 6]);\n \n // LEGAL NOTICE / MENTIONS LEGALES\n $pages[] = $subMenus[] = array($this->addEntry(new models\\Page(), array(\n 'page_title' => array('en' => '<h1>Legal Notice</h1>', 'fr' => '<h1>Mentions Légales</h1>'),\n 'page_content' => array(\n 'en' => \n'<h2>Owner</h2>\n<ul>\n<li>Name : NAME</li>\n<li>Last Name : LAST_NAME</li>\n<li>Company : COMPANY NAME</li>\n<li>Address : ADDRESS</li>\n</ul>\n<h2>Webmaster</h2>\n<ul>\n<li>Creation, Development and Maintenance : <a href=\"http://example.com\" title=\"EXAMPLE | Interactive and Inovative Communication\">EXAMPLE</a></li>\n</ul>\n</p>',\n 'fr' => \n'<h2>Propriétaire</h2>\n<ul>\n<li>Nom : NOM</li>\n<li>Prénom : PRÉNOM</li>\n<li>Entreprise : NOM DE L\\'ENTREPRISE</li>\n<li>Addresse : ADDRESSE</li>\n</ul>\n<h2>Webmestre</h2>\n<ul>\n<li>Création, Développement et Maintenance : <a href=\"http://www.example.com\" title=\"EXAMPLE | Communication Intéractive et Innovante\">EXAMPLE</a></li>\n</ul>\n</p>'\n )\n )), 2, 1, array('en' => 'Legal Notice', 'fr' => 'Mentions Légales'), array('en' => 'Legal Notice', 'fr' => 'Mentions Légales'));\n \n // GENERAL TERMS OF SALE\n $pages[] = $subMenus[] = $model = array($this->addEntry(new models\\Page(), array(\n 'page_title' => array('en' => '<h1>General terms of sale</h1>', 'fr' => '<h1>Conditions générales de vente</h1>'),\n 'page_content' => array(\n 'en' => self::getLoremIpsum('en', 5, 3),\n 'fr' => self::getLoremIpsum('fr', 5, 3)\n ),\n 'view' => '/media/page/1column'\n )), 2, 2, array('en' => 'General terms of sale', 'fr' => 'Conditions générales de vente'), array('en' => 'General terms of sale', 'fr' => 'Conditions générales de vente'));\n \n // ALL GALLERIES\n if($this->_hasMediaClass('Gallery'))\n {\n $pages[] = $subMenus[] = $model = array($this->addEntry(new models\\Page(), array(\n 'page_title' => array('en' => '<h1>All galleries</h1>', 'fr' => '<h1>Toutes les galleries</h1>'),\n 'page_content' => array(\n 'en' => '<p>{{$galleryList}}</p>'.self::getLoremIpsum('en', 1, 1),\n 'fr' => '<p>{{$galleryList}}</p>'.self::getLoremIpsum('fr', 1, 1)\n ),\n 'view' => '/media/page/1column',\n 'before_render' => '\n\nreturn array(\n \\'galleryList\\' => \\\\yiingine\\\\modules\\\\media\\\\components\\\\widgets\\\\PagedList::widget([\\'model\\' => $model, \\'query\\' => \\\\app\\\\modules\\\\media\\\\models\\\\Gallery::findEnabled()])\n);',\n )), 2, 3, array('en' => 'Galleries', 'fr' => 'Galeries'), array('en' => 'Galleries', 'fr' => 'Galleries'));\n }\n \n // ALL VIDEOS\n if($this->_hasMediaClass('Video'))\n {\n $pages[] = $model = array($this->addEntry(new models\\Page(), array(\n 'page_title' => array('en' => '<h1>All videos</h1>', 'fr' => '<h1>Toutes les vidéos</h1>'),\n 'page_content' => array(\n 'en' => '<p>{{$videoList}}</p>'.self::getLoremIpsum('en', 1, 1),\n 'fr' => '<p>{{$videoList}}</p>'.self::getLoremIpsum('fr', 1, 1)\n ),\n 'view' => '/media/page/1column',\n 'before_render' => '\nreturn [\n \\'videoList\\' => \\\\yiingine\\\\modules\\\\media\\\\components\\\\widgets\\\\PagedList::widget([\\'model\\' => $model, \\'query\\' => \\\\app\\\\modules\\\\media\\\\models\\\\Video::findEnabled()])\n];',\n )), 2, 4, array('en' => 'Videos', 'fr' => 'Vidéos'));\n }\n \n // MENU ITEMS\n foreach($pages as $i => $page) // For each page + 1 copied.\n {\n // Create menu items\n $menuItem = $this->addEntry(new MenuItem(), array(\n 'name' => $page[3],\n 'parent_id' => $page[1],\n 'position' => $page[2],\n 'route' => '/media/default/index',\n 'parameters' => '/id/'.$page[0]->id,\n 'model_id' => $page[0]->id,\n 'model_class' => models\\Page::className() \n ));\n \n // URL rewriting rules for each page.\n $currentLanguage = Yii::$app->language; // Save the current language.\n \n foreach(Yii::$app->params['app.available_languages'] as $lang)\n {\n Yii::$app->language = $lang;\n $this->addEntry(new \\yiingine\\models\\UrlRewritingRule(), array(\n 'pattern' => Functions::encodeFileName($page[0]->getTitle()),\n 'languages' => $lang,\n 'route' => 'media/default/index',\n 'defaults' => '[\"id\"=>'.$page[0]->id.']',\n 'system_generated' => 1\n ));\n }\n \n Yii::$app->language = $currentLanguage; // Restore the current language.\n }\n \n // Create a menu with submenus.\n \n $menuWithSubMenus = $this->addEntry(new MenuItem(), array(\n 'name' => ['fr' => 'Info', 'en' => 'Info'],\n 'parent_id' => 1,\n 'position' => 5,\n 'route' => '',\n ));\n \n foreach($subMenus as $j => $subMenu) // For each subMenus (menu 1, 2 and 3)\n {\n // Create sub menu items\n $this->addEntry(new MenuItem(), array(\n 'name' => $subMenu[4],\n 'parent_id' => $menuWithSubMenus->id,\n 'route' => '/media/default/index',\n 'parameters' => '/id/'.$subMenu[0]->id,\n 'model_id' => $subMenu[0]->id,\n 'model_class' => models\\Page::className()\n ));\n }\n \n // Get last position in footerMenu\n $lastPosition = MenuItem::find()->select('max(position) as max')->where(['parent_id' => 2])->scalar();\n // Create a second menu item in footerMenu for the first page to test double menu locking.\n $menuItem = $this->addEntry(new MenuItem(), array(\n 'name' => array('en' => 'Page 1', 'fr' => 'Page 1'),\n 'parent_id' => 2,\n 'position' => $lastPosition + 1,\n 'route' => '/media/default/index',\n 'parameters' => '/id/'.$pages[0][0]->id,\n 'model_id' => $pages[0][0]->id,\n 'model_class' => models\\Page::className()\n ));\n }\n echo \" done (time: \".sprintf('%.3f', microtime(true)-$time).\"s)\\n\";\n \n # associated_media -----------------------------------------------------\n if($this->_hasMediaClass('Index'))\n {\n $i = 0;\n // Page 1 associated\n if($this->_hasMediaClass('Page'))\n {\n $i++;\n $index->link('associated_media', $pages[0][0], ['relation_position' => $i]);\n }\n // Image 1 associated\n if($this->_hasMediaClass('Image'))\n {\n $i++;\n $index->link('associated_media', $images[0], ['relation_position' => $i]);\n }\n // Video 1 associated\n if($this->_hasMediaClass('Video'))\n {\n $index->link('associated_media', $videos[0], ['relation_position' => $i]);\n }\n // Insert 1 associated\n if($this->_hasMediaClass('Insert'))\n {\n $index->link('associated_media', $inserts[0], ['relation_position' => $i]);\n }\n // Document 1 associated\n if($this->_hasMediaClass('Document'))\n {\n $index->link('associated_media', $documents[0], ['relation_position' => $i]);\n }\n // Gallery 1 associated\n if($this->_hasMediaClass('Gallery'))\n {\n $index->link('associated_media', $galleries[0], ['relation_position' => $i]);\n }\n }\n \n ####################### MENU ITEMS #######################\n \n echo \" > creating media module admin menus ...\";\n $time = microtime(true);\n \n // Find the modules admin menu.\n if($adminMenu = MenuItem::find()->where(array('name' => 'adminMenu'))->one())\n { \n //$route = ($this->_hasMediaClass('Index')) ? '/media/admin/index/index' : '/media/admin/page/index' ;\n $contentMenu = $this->addEntry(new MenuItem(), array(\n 'name' => array('en' => 'Content', 'fr' => 'Contenu'), \n 'parent_id' => $adminMenu->id, \n 'side' => MenuItem::ADMIN,\n 'route' => '/media/admin/page/index', // $route,\n 'position' => 2,\n 'rule' => 'Yii::$app->getModule(\"media\")->checkAccess()'\n ));\n \n // Add a menu entry for each media type.\n $position = 1;\n foreach($this->module->mediaClasses as $class)\n {\n $route = '/media/admin/'.lcfirst($class::shortClassName()).'/index';\n $rule = '(Yii::$app->user->can(\"Medium-view\") || Yii::$app->user->can(\"Medium-'.$class::shortClassName().'-view\"))';\n \n $name = [];\n $currentLanguage = Yii::$app->language;\n foreach(Yii::$app->getParameter('app.supported_languages') as $language)\n {\n Yii::$app->language = $language;\n $name[$language] = $class::getModelLabel();\n }\n Yii::$app->language = $currentLanguage;\n \n $this->addEntry(new MenuItem(), array(\n 'name' => $name, \n 'parent_id' => $contentMenu->id, \n 'side' => MenuItem::ADMIN,\n 'route' => $route,\n 'position' => $position++,\n ));\n }\n \n echo \" done (time: \".sprintf('%.3f', microtime(true)-$time).\"s)\\n\";\n \n //Create the menu items for the custom fields module.\n (new \\yiingine\\modules\\customFields\\migrations\\CustomFieldsAdminMenuItems($contentMenu, $this->module->getModule('mediaFields'), array('fr' => 'Media', 'en' => 'Media')))->up();\n }\n \n ####################### PERMISSIONS #######################\n \n echo \" > creating permissions ...\";\n $time = microtime(true);\n \n $models = array();\n \n foreach($this->module->mediaClasses as $class)\n {\n $models[] = 'Medium-'.$class::shortClassName();\n }\n \n $models[] = 'Module-Page';\n \n $this->createModelPermissions($this->module->id, $models);\n \n echo \" done (time: \".sprintf('%.3f', microtime(true)-$time).\"s)\\n\";\n }", "public function up()\n {\n $result = $this->fetchAll(\"SELECT * FROM `visualisation_settings` WHERE `model` = 'BusinessContinuityPlanAudit' ORDER BY `id` DESC\");\n\n if (!empty($result) && count($result) > 1 && !empty($result[0]['id'])) {\n $this->query(\"DELETE FROM `visualisation_settings` WHERE `id` = {$result[0]['id']}\");\n }\n }", "function wp_migrate_db() {\n\tglobal $wpmdb;\n\n\tif ( ! is_null( $wpmdb ) ) {\n\t\treturn $wpmdb;\n\t}\n\n\t$abspath = dirname( __FILE__ );\n\n\trequire_once $abspath . '/class/wpmdb-base.php';\n\trequire_once $abspath . '/class/wpmdb.php';\n\trequire_once $abspath . '/class/wpmdb-replace.php';\n\trequire_once $abspath . '/class/wpmdb-migration-state.php';\n\trequire_once $abspath . '/class/wpmdb-sanitize.php';\n\trequire_once $abspath . '/class/wpmdb-filesystem.php';\n\trequire_once $abspath . '/class/wpmdb-compatibility-plugin-manager.php';\n\n\t$wpmdb = new WPMDB( __FILE__ );\n\n\t// Remove the compatibility plugin when the plugin is deactivated\n\tregister_deactivation_hook( __FILE__, 'wpmdb_remove_mu_plugin' );\n\n\treturn $wpmdb;\n}", "public function migrate() : void {\r\n\t\t\t$currentSettings = new ConfigContainer();\r\n\r\n\t\t\tif (file_exists($this->settingsFile)) {\r\n\t\t\t\t$currentSettings = new ConfigContainer(file_get_contents($this->settingsFile));\r\n\t\t\t}\r\n\r\n\t\t\tif (!$currentSettings->has('configVersion')) {\r\n\t\t\t\t$currentSettings->set('configVersion', 0, FieldTypes::INTEGER);\r\n\t\t\t}\r\n\r\n\t\t\t$filesToApply = array();\r\n\t\t\t$currentVersion = $currentSettings->get('configVersion');\r\n\r\n\t\t\tforeach ($this->files as $file) {\r\n\t\t\t\tif ($file->origVersion >= $currentVersion) {\r\n\t\t\t\t\t$filesToApply[] = $file;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($filesToApply as $file) {\r\n\t\t\t\tforeach ($file->actions as $action) {\r\n\t\t\t\t\tswitch ($action->operator->getValue()) {\r\n\t\t\t\t\t\tcase MigrationOperators::ADD:\r\n\t\t\t\t\t\t\tif (!$currentSettings->has($action->field)) {\r\n\t\t\t\t\t\t\t\t$currentSettings->set($action->field, $action->value, $action->type->getValue());\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::CHANGE:\r\n\t\t\t\t\t\t\t$currentSettings->set($action->field, $action->value);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::REMOVE:\r\n\t\t\t\t\t\t\t$currentSettings->remove($action->field);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::RENAME:\r\n\t\t\t\t\t\t\t$currentSettings->rename($action->field, $action->value);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// @codeCoverageIgnoreStart\r\n\t\t\t\t\t\tdefault:\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// @codeCoverageIgnoreEnd\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$currentSettings->set('configVersion', intval($file->destVersion));\r\n\t\t\t}\r\n\r\n\t\t\tfile_put_contents($this->settingsFile, json_encode($currentSettings, JSON_PRETTY_PRINT));\r\n\r\n\t\t\treturn;\r\n\t\t}", "static public function preview_production_copy( $blog_id, $direction ) {\n\t\tif ( $direction > 0 ) {\n\t\t\t$content = self::load_content( $blog_id, true );\n\t\t\tself::save_item( $blog_id, false, $content );\n\t\t} else {\n\t\t\t$content = self::load_content( $blog_id, false );\n\t\t\tself::save_item( $blog_id, true, $content );\n\t\t}\n\t}", "public function onPostRowSave(MigratePostRowSaveEvent $event) {\n if ($this->isNodeTranslationsMigration($event)) {\n $row = $event->getRow();\n $source = $row->getSource();\n $destination = $row->getDestination();\n $collection = $this->keyValue->get('node_translation_redirect');\n $collection->set($source['nid'], [$destination['nid'], $destination['langcode']]);\n }\n }", "public static function upgrade_120() {\n global $wpdb;\n\n // Add caps again, has not worked for everyone in 1.1.0\n self::assign_capabilities();\n\n // Clean up duplicate indexes (due to bug in dbDelta)\n self::remove_duplicate_indexes('h5p_contents', 'id');\n self::remove_duplicate_indexes('h5p_contents_libraries', 'content_id');\n self::remove_duplicate_indexes('h5p_results', 'id');\n self::remove_duplicate_indexes('h5p_libraries', 'id');\n self::remove_duplicate_indexes('h5p_libraries_libraries', 'library_id');\n self::remove_duplicate_indexes('h5p_libraries_languages', 'library_id');\n\n // Make sure we use the charset defined in wp-config, and not DB default.\n $charset = self::determine_charset();\n if (!empty($charset)) {\n $wpdb->query(\"ALTER TABLE `{$wpdb->prefix}h5p_contents` {$charset}\");\n $wpdb->query(\"ALTER TABLE `{$wpdb->prefix}h5p_contents_libraries` {$charset}\");\n $wpdb->query(\"ALTER TABLE `{$wpdb->prefix}h5p_results` {$charset}\");\n $wpdb->query(\"ALTER TABLE `{$wpdb->prefix}h5p_libraries` {$charset}\");\n $wpdb->query(\"ALTER TABLE `{$wpdb->prefix}h5p_libraries_libraries` {$charset}\");\n $wpdb->query(\"ALTER TABLE `{$wpdb->prefix}h5p_libraries_languages` {$charset}\");\n }\n }", "public function insertView()\n\t{\n\t\t$viewPath = $this->getViewDirectory() . '/view.' . strtolower($this->current_action) . '.php';\n\t\tif (FileSystem::checkFile($viewPath))\n\t\t{\n\t\t\tEventHandler::trigger(EventTypes::ORION_BEFORE_VIEW, $this);\n\t\t\tinclude($viewPath);\n\t\t\tEventHandler::trigger(EventTypes::ORION_AFTER_VIEW, $this);\n\t\t}\n\t}", "protected function exportMainViews()\n {\n if ($this->option('interactive')) {\n if (! $this->confirm('Install AdminLTE main views?')) {\n return;\n }\n }\n\n CommandHelper::copyDirectory(\n $this->packagePath('resources/views'),\n base_path('resources/views/vendor/laravel-mentor'),\n $this->option('force'),\n true\n );\n\n $this->comment('Main views installed successfully.');\n }", "abstract public function up();", "abstract public function up();", "abstract public function up();", "function processForm()\r\n\t{\r\n\t\t$originalViewId = $this->viewId;\r\n\t\tparent::processForm();\r\n\t\t\r\n\t\t$this->mc->database->query(\"UPDATE \" . $this->mc->config['database_pref'] . \"views SET view_action = view_name WHERE view_id = ?\", array(array($this->viewId, \"i\")));\r\n\t\t\r\n\t\t//if(isset($_REQUEST['view_videoselection']) && $_REQUEST['view_videoselection'] != -1)\r\n\t\t\t// TODO: currently just statically inserted\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'The Superbowl XLVI 2012.mp4', 'Superbowl XLVI Trailer', '4:16', 'superbowl_logo.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Ahmad Bradshaw Touchdown.mp4', 'Ahmad Bradshaw Touchdown', '0:24', 'superbowl_shot.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Jerome Simpson Touchdown Flip.mp4', 'Jerome Simpson Touchdown Flip', '0:26', 'nfl_logo_rasen.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Tom Brady Final Throw.mp4', 'Tom Brady Final Throw', '1:33', 'nfl_logl_original.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Best SuperBowl Moments.mp4', 'Best SuperBowl Moments', '3:19', 'superbowl_moments.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\r\n\t\t// update concept type id for this view\r\n\t\t$conceptQuery = $this->mc->database->query(\"SELECT concept_id FROM \" . $this->mc->config['database_pref'] . \"concepts WHERE concept_key = 'mediacenter'\");\r\n\t\t$this->mc->database->query(\"UPDATE \" . $this->mc->config['database_pref'] . \"views SET view_c_type = ? WHERE view_id = ?\", array(array($conceptQuery->rows[0]->concept_id, \"i\"), array($this->viewId, \"i\")));\r\n\t\t\r\n\t\t$this->cleanUpDirectory();\r\n\t\t$this->createXmlFile();\r\n\t\t\r\n\t\t// re-create main xml file and refresh filelist\r\n\t\t$this->mc->filecreator->createGeneralFiles();\r\n\t\t$configSet = true;\r\n\t\tinclude_once('modules/filemanager.module.php');\r\n\t\t$fileManagerObj = new apdModuleFilemanager($this->mc);\r\n\t\t$fileManagerObj->refreshFilelist();\r\n\t\t\r\n\t\theader(\"Location: index.php?m=mediacenter&view_id=\" . $this->viewId);\r\n\t}", "public function moveContentAndCopyLivePage() {}", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "public function revertTable(Source $source, AbstractTable $table);", "public function cloneView($from, $to = BNULL)\n {\n if (BNULL === $to) {\n $to = $from . '-copy';\n for ($i = 2; !empty($this->_views[$to]); $i++) {\n $to = $from . '-copy' . $i;\n }\n }\n $this->_views[$to] = clone $this->_views[$from];\n $this->_views[$to]->setParam('view_name', $to);\n\n return $this->_views[$to];\n }", "function __migrateJC() {\n\n\t\t$ret = $this->migrateTable('#__jomcomment');\n\t\t$this->migrateTable('#__jomcomment_admin');\n\t\t$this->migrateTable('#__jomcomment_config');\n\t\t$this->migrateTable('#__jomcomment_fav');\n\t\t$this->migrateTable('#__jomcomment_mailq');\n\t\t$this->migrateTable('#__jomcomment_reported');\n\t\t$this->migrateTable('#__jomcomment_reports');\n\t\t$this->migrateTable('#__jomcomment_subs');\n\t\t$this->migrateTable('#__jomcomment_tb');\n\t\t$this->migrateTable('#__jomcomment_tb_sent');\n\t\t$this->migrateTable('#__jomcomment_votes');\n\n\t\treturn $ret;\n }", "public function init()\n {\n $destination_table = $this->destination_db->getTables();\n $source_table = $this->source_db->getTables();\n\n $destination_column = [];\n $source_column = [];\n $empty_column = [array_fill(0, 6, '')];\n $source_recoed = [];\n $destination_recoed = [];\n\n // Format data source.\n foreach ($source_table as $key => $table) {\n $row = array_map(function ($item) use ($table) {\n $item[0] = $table . ' - ' . $item[0];\n return $item;\n }, $this->source_db->getColumns($table));\n\n // Add partition of empty array.\n $source_column = $key ?\n array_merge($source_column, $empty_column, $row) :\n array_merge($source_column, $row);\n\n $source_recoed[$table] = $this->source_db->getRecoeds($table);\n }\n\n // Format data destination.\n foreach ($destination_table as $key => $table) {\n $row = array_map(function ($item) use ($table) {\n $item[0] = $table . ' - ' . $item[0];\n return $item;\n }, $this->destination_db->getColumns($table));\n\n $destination_column = $key ?\n array_merge($destination_column, $empty_column, $row) :\n array_merge($destination_column, $row);\n }\n\n // Merge source & destination.\n foreach ($destination_column as $key => &$destination) {\n if (isset($source_column[$key])) {\n $destination = array_merge($destination, [null], $source_column[$key]);\n }\n }\n\n // Submit.\n if (!empty($_POST)) {\n $target_table = '';\n $records = [];\n $uniformity = [];\n\n // Begin db transaction.\n $this->destination_db->beginTransaction();\n\n $params = json_decode($_POST['params'], true);\n\n // Key used to store error message at the time of last data insert.\n $last_key = '';\n\n $error_count = 0;\n\n foreach ($params as $key => &$param) {\n // Init error messages.\n $param[14] = '';\n\n // When a blank line comes,\n // all columns of the corresponding table have been acquired, so insert the data.\n if (!$param[0]) {\n try {\n if ($records) {\n $this->insertData($target_table, $records, $uniformity);\n } else {\n $params[$key - 1][14] = $this->no_data_msg;\n }\n } catch (\\Exception $e) {\n $params[$key - 1][14] = $e->getMessage();\n $error_count++;\n } catch (\\Throwable $e) {\n $params[$key - 1][14] = $e->getMessage();\n $error_count++;\n }\n // Init Table name & data.\n $target_table = '';\n $records = [];\n $uniformity = [];\n continue;\n }\n\n\n if (!$param[7] && !$param[13]) continue;\n\n $destination_str_arr = explode(' - ', $param[0]);\n\n // If there is a value in this cell,\n // that value will be inserted uniformly.\n if ($param[13]) {\n $uniformity[$destination_str_arr[1]] = $param[13];\n } else {\n $source_str_arr = explode(' - ', $param[7]);\n if (!$target_table) {\n $target_table = $destination_str_arr[0];\n }\n\n $rows = $this->source_db->getRecoeds($source_str_arr[0], [$source_str_arr[1]]);\n if ($rows) {\n $records[$destination_str_arr[1]] = array_column($rows, $source_str_arr[1]);\n }\n }\n\n $last_key = $key;\n }\n\n // Insert last data.\n if ($target_table && $records) {\n try {\n $this->insertData($target_table, $records, $uniformity);\n } catch (\\Exception $e) {\n $params[$last_key][14] = $e->getMessage();\n $error_count++;\n } catch (\\Throwable $e) {\n $params[$last_key][14] = $e->getMessage();\n $error_count++;\n }\n } else {\n $params[$key - 1][14] = $this->no_data_msg;\n }\n\n if ($_POST['runtype'] === 'run' && !$error_count) {\n $this->destination_db->commit();\n $done = true;\n } else {\n if (!$error_count) {\n $done = true;\n }\n $this->destination_db->rollback();\n }\n\n $destination_column = $params;\n }\n\n $destination_column = json_encode($destination_column);\n\n require __DIR__ . '/../resources/views/index.php';\n }" ]
[ "0.60368055", "0.6000249", "0.57004255", "0.5679126", "0.563226", "0.5538272", "0.55204725", "0.5427179", "0.5393425", "0.5355451", "0.5352642", "0.53463316", "0.5085552", "0.5066102", "0.5056065", "0.50042933", "0.49675956", "0.4952908", "0.49258593", "0.48722503", "0.4866681", "0.48655224", "0.48596635", "0.4843058", "0.48377818", "0.48357147", "0.48357147", "0.4826436", "0.47923082", "0.4791664", "0.47909263", "0.47855932", "0.47795755", "0.47767076", "0.47765034", "0.47712097", "0.47618333", "0.47559187", "0.47547588", "0.47479808", "0.47390032", "0.47299054", "0.4709164", "0.47077665", "0.4706767", "0.47027743", "0.46956298", "0.4695174", "0.46816942", "0.46628898", "0.4654151", "0.46486378", "0.464459", "0.4642607", "0.46347585", "0.46343708", "0.46329394", "0.4619888", "0.4611501", "0.46067685", "0.45958886", "0.45790863", "0.4569632", "0.45654407", "0.4565401", "0.4564292", "0.45628196", "0.4561228", "0.45491353", "0.4540851", "0.45373836", "0.45321795", "0.45279324", "0.45253193", "0.45215663", "0.451627", "0.45135662", "0.45107368", "0.4509593", "0.45094386", "0.450916", "0.44940162", "0.4491285", "0.44887543", "0.448865", "0.44866812", "0.44757366", "0.4471444", "0.44668067", "0.4462444", "0.4454331", "0.4454331", "0.4454331", "0.4451887", "0.44476846", "0.44413695", "0.44314772", "0.4424413", "0.44227526", "0.44136783" ]
0.6358101
0
Le asigna la tarea enviada al userId en bonita
public function tomarTarea(){ $id = $this->input->post('id'); $rsp = $this->bpm->setUsuario($id, userId()); $rsp['status'] ? $rsp['user_id'] = userId() : ''; echo json_encode($rsp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUserId($userId);", "public function setUserId($userId) {\n $this->userId = $userId;\n }", "protected function getUserId() {}", "protected function getUserId() {}", "function setUserId($userId) {\n\t\treturn $this->setData('userId', $userId);\n\t}", "function setUserId($userId)\n {\n $this->userId = $userId;\n }", "public function userId($user);", "abstract protected function getUserId() ;", "public function setUserId() {\n $this->user_id = $user_id;\n }", "private function set_userId(int $userId)\n {\n $this->_id = $userId;\n }", "public function setUserId($userId) {\n $this->userId = $userId;\n }", "public function setUserId($userId) {\n $this->userId = $userId;\n }", "public function setCreatedBy($userID);", "public function setUserId()\n {\n if(isset($_GET['userId']))\n {\n echo 'const userId = '.$_GET['userId'].';';\n }\n else\n {\n $config = new Config;\n echo 'const userId = '.$config->defaultUser.';';\n }\n }", "function activateUser($userId);", "public function setUser($userId) {\n\t\t\t $_SESSION['userId'] = $userId;\n\t\t}", "private function _savePendingUserIdentity($userId)\n {\n $userData = new stdClass();\n $userData->{User::COLUMN_USERID} = $userId;\n $userData->sessionId = session_id();\n $userData->lastLogin = date('Y-m-d H:i:s');\n Zend_Auth::getInstance()->getStorage()->write($userData);\n }", "public function getId_user(){\n return $this->id_user;\n }", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserData($userId);", "public function setUserid($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_90'));\n\t\tif(!Validator::AccountId($value)) throw new Exception(lang('error_90'));\n\t\t\n\t\t$this->_userid = $value;\n\t}", "function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }", "public function getUserId(): string;", "public function getUserId()\n {\n return $this->userId;\n }", "function get_id($user_id){\n\t\t$this->id = $user_id;\n\t}", "public function setUserId($id)\n {\n $this->userId = $id;\n }", "public function getuserId()\n {\n return $this->userId;\n }", "public function agregarUsuario(){\n \n }", "public function getUserId()\n {\n }", "public function getIdUsuario(){\n return $this->idUsuario;\n }", "function get_user_id(){\n return $this->user_id;\n }", "public function __construct($userId)\n\t{\n\t\t$this->userId = $userId;\n\t}", "public function setUserId(int $userId): void\n {\n $this->_userId = $userId;\n }", "public function getUserId(){\n return $this->UserId;\n }", "function getUserId(){\n\t//replace with actual\n\treturn '123';\n}", "public function assignuserAction()\n {\n $user_params=$this->_request->getParams();\n $automail=new Ep_Message_AutoEmails();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $data = array(\"assigned_to\"=>$user_params['userId'], \"assigned_at\"=>date('Y-m-d H:i:s'), \"status\"=>\"pending\", \"closed_at\"=>NULL, \"cancelled_at\"=>NULL);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $deletequery = \"ftvrequest_id= '\".$user_params['requestId'].\"'\";\n $ftvpausetime_obj->deleteFtvPauseTime($deletequery);\n $parameters['ftvType'] = \"chaine\";\n if($user_params['userId'] != '110823103540627') ///supposed to be johny head of BO user for FTV\n $automail->messageToEPMail($user_params['userId'],113,$parameters);//\n }", "function guardar_campos_adicionales_usuario($user_id){\n\tif(isset($_POST['user_coupon_visible'])){\n\t update_user_meta($user_id, 'user_coupon_visible', sanitize_text_field($_POST['user_coupon_visible']));\n\t}\n\tif(isset($_POST['user_es_regalo'])){\n\t\tupdate_user_meta($user_id, 'user_es_regalo', sanitize_text_field($_POST['user_es_regalo']));\n\t }\n }", "Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}", "public function getUser($userId);", "public function getUser($userId);", "function getIdusuario(){\n\t\treturn $this->idusuario;\n\t}", "public function getUserId()\r\n {\r\n return $this->userId;\r\n }", "public function userId($userId = null)\n\t{\n\t\treturn $this->getSet(\"userId\", $userId, self::VALUE_INT);\n\t}", "public function getUserId(): int\n {\n return $this->userId;\n }", "public function get_user_id();", "public function setIduser($value)\n {\n $this->iduser = $value;\n }", "public function getIduser()\n {\n return $this->iduser;\n }", "public function AddMentoratUser($id){\n if($user = User::where(['id' => $id,'mentorat' => User::not_mentorat,'type' => User::user])->first()){\n $this->mail->ID840231($user->id,Session::get('userData'));\n toastr()->success('This user has been emailed to approve mentor');\n\n $user->mentorat = User::in_standby_mentorat;\n $user->save();\n }else{\n toastr()->error('Something is wrong!');\n }\n return Redirect::back();\n }", "private function usrsave() {\n $id = 0;\n $resultado = 0;\n $pass = '';\n if ($this->UTILITY->validate_email($this->email)) {\n $arrjson = $this->UTILITY->error_wrong_email();\n } else {\n if ($this->id > 0) {\n //se verifica que el email está disponible\n $q = \"SELECT usr_id FROM ass_usuario WHERE usr_email = '\" . $this->email . \"' AND usr_id != $this->id \";\n $con = mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $resultado = mysql_num_rows($con);\n if ($resultado == 0) {\n //actualiza la informacion\n $q = \"SELECT usr_id FROM ass_usuario WHERE usr_id = \" . $this->id;\n $con = mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n while ($obj = mysql_fetch_object($con)) {\n $id = $obj->usr_id;\n if (strlen($this->pass) > 2) {\n $pass = $this->UTILITY->make_hash_pass($this->email, $this->pass);\n }\n $table = \"ass_usuario\";\n $arrfieldscomma = array(\n 'usr_nombre' => $this->nombre,\n 'usr_apellido' => $this->apellido,\n 'usr_email' => $this->email,\n 'usr_pass' => $pass,\n 'usr_cargo' => $this->cargo,\n 'usr_identificacion' => $this->identificacion,\n 'usr_celular' => $this->celular,\n 'usr_telefono' => $this->telefono,\n 'usr_habilitado' => $this->habilitado,\n 'usr_contacto' => $this->contacto);\n $arrfieldsnocomma = array('mzt_proveedor_pro_id' => $this->idprov, 'mzt_cliente_cli_id' => $this->idcli, 'usr_dtcreate' => $this->UTILITY->date_now_server());\n $q = $this->UTILITY->make_query_update($table, \"usr_id = '$id'\", $arrfieldscomma, $arrfieldsnocomma);\n mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $arrjson = array('output' => array('valid' => true, 'id' => $id));\n }\n } else {\n $arrjson = $this->UTILITY->error_user_already_exist();\n }\n } else {\n //se verifica que el email está disponible\n $q = \"SELECT usr_id FROM ass_usuario WHERE usr_email = '\" . $this->email . \"'\";\n $con = mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $resultado = mysql_num_rows($con);\n if ($resultado == 0) {\n if (strlen($this->pass) > 2) {\n $pass = $this->UTILITY->make_hash_pass($this->email, $this->pass);\n }\n $this->pass = $pass;\n $q = \"INSERT INTO ass_usuario (usr_dtcreate, mzt_cliente_cli_id, mzt_proveedor_pro_id, usr_habilitado, usr_nombre, usr_apellido, usr_cargo, usr_email, usr_pass, usr_identificacion, usr_celular, usr_telefono, usr_contacto) VALUES (\" . $this->UTILITY->date_now_server() . \", $this->idcli, $this->idprov, '$this->habilitado', '$this->nombre', '$this->apellido', '$this->cargo', '$this->email', '$this->pass', '$this->identificacion', '$this->celular', '$this->telefono', '$this->contacto')\";\n mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $id = mysql_insert_id();\n $arrjson = array('output' => array('valid' => true, 'id' => $id));\n } else {\n $arrjson = $this->UTILITY->error_user_already_exist();\n }\n }\n }\n $this->response = ($arrjson);\n }", "public function get_userId()\n {\n return $this->_userId;\n }", "protected function userId()\n {\n return Auth::id();\n }", "public function getId()\n {\n return $this->userId;\n }", "function get_user_to_edit($user_id)\n {\n }", "public function getUserId()\n {\n return parent::getValue('user_id');\n }", "public function setIdusuario($value){\n $this->idusuario = $value;\n }", "Public Function setUserId($UserId) {\n\t\t$this->userId = $UserId;\n\t\n\t}", "public function baru(){\n $six_digit_random_number = mt_rand(000001, 999999);\n $s=new userId;\n $userid = $s->create($six_digit_random_number);\n return $six_digit_random_number.$userid;\n }", "public function getUserIdCriado() {\n return $this->userIdCriado;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserID(){\n return($this->userID);\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 getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getID()\n {\n return $this->idUsuario;\n }", "public function updateConsumido($userId)\n {\n $update = DB::table('al_token_user')\n ->where('al_user_id', $userId)\n ->update(['consumido' => 1]);\n return $update;\n }", "public function __construct($userId = null)\n {\n $this\n ->setUserId($userId);\n }", "function get_userid() {\n return $this->userid;\n }", "public function getUserId() : int\n {\n return $this->userId;\n }", "public function getIdUserRespuesta()\n {\n return $this->id_user_respuesta;\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}", "public function getUserId()\n {\n return $this->id;\n }", "public function getRUser($post)\n\t{\n\t\ttry {\n\t\t\t$condicion = '';\n\t\t\t$aux_ids = array();\n\t\t\t#Si existe el id del personal, buscar los bienes de la persona\n\t\t\tif ( isset($post['servidor_id']) && !empty($post['servidor_id']) ) \n\t\t\t{\n\t\t\t\t$servidor = $post['servidor_id']; \n\n\t\t\t\t$this->sql = \" SELECT bien_id FROM asignacion WHERE personal_id = ? \";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam( 1,$servidor );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes_ids = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\tforeach ($bienes_ids as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->bien_id);\n\t\t\t\t}\n\t\t\t\t/*Conversion a string*/\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t\n\t\t\t\t/*Buscar en la tabla de bienes , las asignaciones registradas*/\n\t\t\t\t$this->sql = \" SELECT \n\t\t\t\t\tb.id,\n\t\t\t\t\tb.descripcion,\n\t\t\t\t\tb.serie,\n\t\t\t\t\tb.status,\n\t\t\t\t\tb.inventario,\n\t\t\t\t\tb.desc_ub,\n\t\t\t\t\tm.nombre AS marca,\n\t\t\t\t\tg.nombre AS grupo,\n\t\t\t\t\tt.nombre AS tipo,\n\t\t\t\t\tmo.nombre AS modelo,\n\t\t\t\t\tb.fecha_reg AS registro,\n\t\t\t\t\tb.fecha_adq AS adquisicion,\n\t\t\t\t\tUPPER(c.nombre) AS color,\n\t\t\t\t\tma.nombre AS material,\n\t\t\t\t\tp.nombre AS proveedor,\n\t\t\t\t\tCONCAT(\n\t\t\t\t\t pe.nombre,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_pat,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_mat\n\t\t\t\t\t) AS asignadoa\n\t\t\t\t FROM bienes AS b\n\t\t\t\t INNER JOIN marcas AS m\n\t\t\t\t ON\n\t\t\t\t m.id = b.marca_id\n\t\t\t\t INNER JOIN grupos AS g\n\t\t\t\t ON\n\t\t\t\t g.id = b.grupo_id\n\t\t\t\t INNER JOIN t_bienes AS t\n\t\t\t\t ON\n\t\t\t\t t.id = b.tipo_id\n\t\t\t\t INNER JOIN modelos AS mo\n\t\t\t\t ON\n\t\t\t\t mo.id = b.modelo_id\n\t\t\t\t INNER JOIN color AS c\n\t\t\t\t ON\n\t\t\t\t c.id = b.color_id\n\t\t\t\t INNER JOIN materiales AS ma\n\t\t\t\t ON\n\t\t\t\t ma.id = b.material_id\n\t\t\t\t INNER JOIN proveedores AS p\n\t\t\t\t ON\n\t\t\t\t p.id = b.pro_id\n\t\t\t\t INNER JOIN asignacion AS a\n\t\t\t\t ON\n\t\t\t\t a.bien_id = b.id\n\t\t\t\t INNER JOIN personal AS pe\n\t\t\t\t ON\n\t\t\t\t pe.id = a.personal_id WHERE b.id IN ($aux_ids) \";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\t\n\t\t\t\treturn json_encode($bienes) ;\n\t\t\t} \n\t\t\telseif( isset($post['area']) && !empty($post['area']) )\n\t\t\t{\n\t\t\t\t$area = $post['area'];\n\t\t\t\t#Buscar a los usuarios pertenecientes al area\n\t\t\t\t$this->sql = \"SELECT id FROM personal WHERE area_id = ?\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam(1,$area);\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$personas = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\tforeach ($personas as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->id);\n\t\t\t\t}\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t#ubicar los bienes con las personas (En asignaciones)\n\t\t\t\t$this->sql = \"SELECT bien_id FROM asignacion WHERE personal_id IN (?)\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam(1,$aux_ids);\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$asignaciones = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\t#Limpiar arreglo auxiliar\n\t\t\t\tunset($aux_ids);\n\t\t\t\t$aux_ids = array();\n\t\t\t\tforeach ($asignaciones as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->bien_id);\n\t\t\t\t}\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t#Buscar los bienes (Bienes)\n\t\t\t\t$this->sql = \"SELECT \n\t\t\t\t\tb.id,\n\t\t\t\t\tb.descripcion,\n\t\t\t\t\tb.serie,\n\t\t\t\t\tb.status,\n\t\t\t\t\tb.inventario,\n\t\t\t\t\tb.desc_ub,\n\t\t\t\t\tm.nombre AS marca,\n\t\t\t\t\tg.nombre AS grupo,\n\t\t\t\t\tt.nombre AS tipo,\n\t\t\t\t\tmo.nombre AS modelo,\n\t\t\t\t\tb.fecha_reg AS registro,\n\t\t\t\t\tb.fecha_adq AS adquisicion,\n\t\t\t\t\tUPPER(c.nombre) AS color,\n\t\t\t\t\tma.nombre AS material,\n\t\t\t\t\tp.nombre AS proveedor,\n\t\t\t\t\tCONCAT(\n\t\t\t\t\t pe.nombre,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_pat,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_mat\n\t\t\t\t\t) AS asignadoa\n\t\t\t\t FROM bienes AS b\n\t\t\t\t INNER JOIN marcas AS m\n\t\t\t\t ON\n\t\t\t\t m.id = b.marca_id\n\t\t\t\t INNER JOIN grupos AS g\n\t\t\t\t ON\n\t\t\t\t g.id = b.grupo_id\n\t\t\t\t INNER JOIN t_bienes AS t\n\t\t\t\t ON\n\t\t\t\t t.id = b.tipo_id\n\t\t\t\t INNER JOIN modelos AS mo\n\t\t\t\t ON\n\t\t\t\t mo.id = b.modelo_id\n\t\t\t\t INNER JOIN color AS c\n\t\t\t\t ON\n\t\t\t\t c.id = b.color_id\n\t\t\t\t INNER JOIN materiales AS ma\n\t\t\t\t ON\n\t\t\t\t ma.id = b.material_id\n\t\t\t\t INNER JOIN proveedores AS p\n\t\t\t\t ON\n\t\t\t\t p.id = b.pro_id\n\t\t\t\t INNER JOIN asignacion AS a\n\t\t\t\t ON\n\t\t\t\t a.bien_id = b.id\n\t\t\t\t INNER JOIN personal AS pe\n\t\t\t\t ON\n\t\t\t\t pe.id = a.personal_id\n\t\t\t\t WHERE b.id IN ($aux_ids)\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\treturn json_encode($bienes);\n\t\t\t}else{\n\t\t\t\treturn json_encode( array('message'=>'No selecciono ningún criterio') );\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$this->result = array('error' => $e->getMessage() );\n\t\t}\t\n\t}", "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 saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "function inativaUsuario($id){\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\n\t\t\t\t\"UPDATE Usuario\n\t\t\t\t\tSET usuario_ativo = FALSE\n\t\t\t\t\tWHERE usuario_id = :id AND usuario_ativo = TRUE\n\t\t\t\t\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $statm->execute();\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}" ]
[ "0.685299", "0.66359013", "0.6614994", "0.6614994", "0.65699494", "0.6549939", "0.6530877", "0.652304", "0.6479834", "0.6451907", "0.6401829", "0.6401829", "0.63743633", "0.6358955", "0.6298803", "0.62905884", "0.6288275", "0.6238404", "0.61651033", "0.61651033", "0.61651033", "0.61651033", "0.61651033", "0.61651033", "0.61651033", "0.61651033", "0.61651033", "0.615517", "0.6145244", "0.613573", "0.6128857", "0.6121849", "0.61216605", "0.6106159", "0.60917795", "0.6059929", "0.6055149", "0.60388076", "0.603193", "0.6007957", "0.60073274", "0.6007327", "0.59873265", "0.59812903", "0.5972502", "0.5959823", "0.5957018", "0.5957018", "0.5953246", "0.59440076", "0.59432054", "0.59337574", "0.59234023", "0.5921021", "0.59111834", "0.5908632", "0.59059507", "0.58948845", "0.5886224", "0.5884223", "0.5879783", "0.58716106", "0.5870588", "0.58390564", "0.58361393", "0.58345765", "0.5832412", "0.5830651", "0.58289385", "0.58289385", "0.58289385", "0.58289385", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5823718", "0.5822559", "0.5815334", "0.58131397", "0.5811051", "0.5803379", "0.58014536", "0.5792158", "0.5782719", "0.5781869", "0.57715297", "0.57715297", "0.57715297", "0.57711303", "0.57650405" ]
0.6806322
1
Obtener Infomracion de Tarea
public function cerrarTarea($taskId) { $tarea = $this->Procesos->mapeoTarea($this->bpm->getTarea($taskId)['data']); //Formulario desde la Vista $form = $this->input->post(); //Mapeo de Contrato $contrato = $this->getContrato($tarea, $form); //Cerrar Tarea $rsp = $this->bpm->cerrarTarea($taskId, $contrato); echo json_encode($rsp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArea(){}", "abstract protected function getArea();", "function get_duo_areas() {\n \t\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getViewArea() {}", "public function getArea() {\r\n return $this -> lato * $this -> lato ;\r\n }", "public function getTagName ()\n\t{\n\t\treturn 'area';\n\t}", "public function getArea(){\n return $this -> side * $this -> side;\n }", "function getArea(){\r\n return ($this->width * $this->height);\r\n }", "public function getAreaId()\n {\n return $this->area;\n }", "public function asignar_tarea() {\n switch ( $this->tarea ) {\n case 'agregar':\n $this->encargado_tarea->agregar_nuevo( $this->datos_tarea );\n break;\n\n case 'modificar':\n $tipo_elemento = $this->datos_tarea[ 'tipo_elemento' ];\n\n $this->encargado_tarea->modificar( $tipo_elemento, $this->datos_tarea );\n break;\n\n case 'eliminar':\n $tipo_elemento = $this->datos_tarea[ 'tipo_elemento' ];\n $id = $this->datos_tarea[ 'id' ];\n\n $this->encargado_tarea->eliminar( $tipo_elemento, $id );\n break;\n\n case 'generar historial':\n $this->encargado_tarea->generar_historial();\n break;\n\n case 'simular':\n $this->encargado_tarea->simular( $procesos );\n break;\n\n case 'activar proceso':\n $this->encargado_tarea->iniciar_proceso( $id_proceso );\n break;\n\n case 'consultar':\n $this->encargado_tarea->leer_datos( $this->datos_tarea );\n break;\n\n default:\n # code...\n echo \"Tarea invalida\";\n break;\n }\n }", "public function getSource()\n {\n return 'area';\n }", "public function getArea()\n{\n return 2* 3.14*$this->radius*($this->radius + $this->height);\n}", "public function Pareas(){\n if($this->empleado->cargo->permisoscargo->areas) return true;\n return false;\n }", "function area($a,$b,$c){\r\n\t\t$fArea= new fachada_area();\r\n\t\t$oArea=$fArea->area($a,$b,$c);\r\n\t\treturn $oArea;\r\n\t}", "public function getAreaName()\n {\n return $this->area_name;\n }", "public function getMaxArea();", "public function getTypeFeatureArea() {\n return $this->_typeFeature; \n }", "public function area()\n {\n return $this->height * $this->width;\n }", "function getForResumenArea($area){\n\t\t\t$tipos = array(\n\t\t\t\t0=>\"CE\",\n\t\t\t\t1=>\"DS\",\n\t\t\t\t2=>\"Q\",\n\t\t\t\t3=>\"AB\",\n\t\t\t\t4=>\"DM\",\n\t\t\t\t5=>\"M\",\n\t\t\t\t6=>\"R\",\n\t\t\t\t7=>\"D\",\n\t\t\t\t8=>\"P\",\n\t\t\t\t9=>\"PA\",\n\t\t\t\t10=>\"EL\",\n\t\t\t\t11=>\"S\",\n\t\t\t\t12=>\"CI\",\n\t\t\t\t13=>\"IP\",\n\t\t\t\t14=>\"IA\",\n\t\t\t\t15=>\"DI\",\n\t\t\t\t16=>\"IPA\",\n\t\t\t\t17=>\"E\",\n\t\t\t\t18=>\"RE\",\n\t\t\t\t19=>\"C\",\n\t\t\t\t20=>\"L\",\n\t\t\t\t21=>\"LA\",\n\t\t\t\t22=>\"I\",\n\t\t\t\t23=>\"IL\",\n\t\t\t\t24=>\"DL\",\n\t\t\t\t25=>\"DE\",\n\t\t\t\t26=>\"CB\",\n\t\t\t\t27=>\"CA\"\n\t\t\t\t);\n\t\t\t$respuesta = array();\n\t\t\tforeach ($tipos as $value) {\n\t\t\t\t$sql = \"select count(*) as total from $this->tabla \n\t\t\t\t\t\tjoin referencias\n\t\t\t\t\t\t\ton referencias.id_referencia = $this->tabla.id_referencia\n\t\t\t\t\t\tjoin areas\n\t\t\t\t\t\t\ton areas.id_area = referencias.id_area\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t$this->tabla.tipo_discontinuidad = '\".$value.\"' \n\t\t\t\t\t\t\tand areas.id_area=\".$area.\"\n\t\t\t\t\";\n\n\t\t\t\t$resultado = $this->conexion->query($sql);\n\t\t\t\tif($resultado->num_rows > 0){\n\t\t\t\t\t$row=$resultado->fetch_assoc() ;\n\t\t\t\t\tif($row['total']>0){\n\t\t\t\t\t\t$respuesta[$value] = $row['total'] ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn json_encode($respuesta) ;\n\t\t}", "public function edit(Tarea $tarea)\n {\n //\n }", "public function __construct($area)\n {\n parent::__construct(null);\n $this->_area = $area;\n }", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "public function mostrarArea() {\n \n //FUNCION CON LA CONSULTA A REALIZAR\n $sql = \"SELECT * FROM AREA_MAQUINA \";\n $this->_conexion->ejecutar_sentencia($sql);\n return $this->_conexion->retorna_select();\n \n }", "public function getMinArea();", "public function getAreaRegion()\n {\n return $this->area_region;\n }", "public function getAreaId()\n {\n return $this->areaId;\n }", "public function tarea()\n {\n return $this->belongsTo('App\\AlumnoTarea', 'alumno_tarea_id');\n }", "public function show(tareas $tareas)\n {\n //\n }", "public function getIdArea() {\n return $this->_id; \n }", "public function getArea(): ?string\n {\n return $this->Area ?? null;\n }", "public function postArea($areaDetail)\n {\n \n }", "public function getIdprodutoArea()\n {\n return $this->idprodutoArea;\n }", "function getForResumenIntArea($area){\n\t\t\t$tipos = array(\n\t\t\t\t0=>\"CI\",\n\t\t\t\t1=>\"IP\",\n\t\t\t\t2=>\"IA\",\n\t\t\t\t3=>\"DI\",\n\t\t\t\t4=>\"IPA\",\n\t\t\t\t5=>\"E\",\n\t\t\t\t6=>\"RE\",\n\t\t\t\t7=>\"C\",\n\t\t\t\t8=>\"L\",\n\t\t\t\t9=>\"LA\",\n\t\t\t\t10=>\"I\",\n\t\t\t\t11=>\"IL\"\n\t\t\t\t);\n\t\t\t$respuesta = array();\n\t\t\tforeach ($tipos as $value) {\n\t\t\t\t$sql = \"select count(*) as total from $this->tabla \n\t\t\t\t\t\tjoin referencias\n\t\t\t\t\t\t\ton referencias.id_referencia = $this->tabla.id_referencia\n\t\t\t\t\t\tjoin areas\n\t\t\t\t\t\t\ton areas.id_area = referencias.id_area\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t$this->tabla.tipo_discontinuidad = '\".$value.\"' \n\t\t\t\t\t\t\tand areas.id_area=\".$area.\"\n\t\t\t\t\";\n\n\t\t\t\t$resultado = $this->conexion->query($sql);\n\t\t\t\tif($resultado->num_rows > 0){\n\t\t\t\t\t$row=$resultado->fetch_assoc() ;\n\t\t\t\t\tif($row['total']>0){\n\t\t\t\t\t\t$respuesta[$value] = $row['total'] ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn json_encode($respuesta) ;\n\t\t}", "public function getCurrentArea(): AreaContract;", "public function getConfineArea() {\n return $this->_confine; \n }", "public function getAreaShortName()\n {\n return $this->area_short_name;\n }", "function _add_block_template_part_area_info($template_info)\n {\n }", "function getAreaPorDeptoSinAsignar(){\r\n\r\n $cens_id = $this->input->post('id_censo');\r\n $depa_id = $this->input->post('id_depto');\r\n $areas = $this->Areas->ObtenerXDepaSinAsignar($cens_id, $depa_id)->areas->area;\r\n\r\n echo json_encode($areas);\r\n\r\n }", "public function getArea()\n {\n return 1 / 2 * $this->side1 * $this->getHeight();\n }", "function niveles($area){\n\t\tif ($area->cveentidad2=='0') return 1;\n\t\tif ($area->cveentidad3=='0') return 2;\n\t\tif ($area->cveentidad4=='0') return 3;\n\t\tif ($area->cveentidad5=='0') return 4;\n\t\tif ($area->cveentidad6=='0') return 5;\n\t\tif ($area->cveentidad7=='0') return 6;\n\t}", "function grandeArea($a,$b,$c){\r\n\t\t$fGArea= new fachada_grandeArea();\r\n\t\t$oGArea=$fGArea->grandeArea($a,$b,$c);\r\n\t\treturn $oGArea;\r\n\t}", "public function getAreaDeep()\n {\n return $this->area_deep;\n }", "public function getRischioArea() {\n return $this->_rischio; \n }", "function mapFunction($location) \r\n\t\t{\r\n\t\t\treturn $location['area'];\r\n\t\t}", "public function getMapArea()\n {\n return $this->mapArea;\n }", "public function getTYPE_TEXT_AREA()\n {\n return self::TYPE_TEXT_AREA;\n }", "public function show(Tarea $tarea)\n {\n\n \n \n return view('tareas.show', compact('tarea','contar'));\n }", "public function area() : float {}", "private function ts_getAreas()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // #41811, dwildt, 1+\n $currHitsSum = $this->hits_sum[ $this->curr_tableField ];\n\n // Get TS configuration of the current filter / tableField\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Get areas from TS\n // SWITCH area key\n switch ( $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ] )\n {\n case ('strings') :\n $arr_result = $this->pObj->objCal->area_strings( $conf_array, null, $this->curr_tableField );\n break;\n case ('interval') :\n $arr_result = $this->pObj->objCal->area_interval( $conf_array, null, $this->curr_tableField );\n break;\n// case ('from_to_fields') :\n// break;\n default:\n // DRS - Development Reporting System\n if ( $this->pObj->b_drs_error )\n {\n $prompt = 'undefined value in switch: ' .\n '\\'' . $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ] . '\\'.';\n t3lib_div :: devLog( '[ERROR/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 3 );\n $prompt = 'Areas won\\'t handled!';\n t3lib_div :: devLog( '[WARN/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS - Development Reporting System\n return;\n }\n // SWITCH area key\n $areas = $arr_result[ 'data' ][ 'values' ];\n unset( $arr_result );\n // Get areas from TS\n // #41811, dwildt, 1+\n $this->hits_sum[ $this->curr_tableField ] = $currHitsSum;\n\n // DRS\n if ( $this->pObj->b_drs_cal || $this->pObj->b_drs_filter )\n {\n $arr_prompt = null;\n foreach ( ( array ) $areas as $key => $value )\n {\n $arr_prompt[] = '[' . $key . '] = ' . $value;\n }\n $prompt = 'values are: ' . implode( ', ', ( array ) $arr_prompt );\n t3lib_div :: devLog( '[INFO/FILTER+CAL] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN areas\n return $areas;\n }", "function getAreas () {\n return $this->templateParser->getAreas();\n }", "private function _getAreas() \r\n {\r\n $values = explode(\",\", Mage::getStoreConfig('cms/banners/areas'));\r\n $areas = array();\r\n\r\n foreach ($values as $value) {\r\n $areas[] = array('value' => $value, 'label' => $value);\r\n }\r\n $areas[] = array('value' => 'category', 'label' => 'categoria');\r\n\r\n return $areas;\r\n }", "public function getPesoArea() {\n return $this->_peso; \n }", "public function getAreaIdInfo()\n {\n return $this->community_area;\n }", "function _filter_block_template_part_area($type)\n {\n }", "public function getAreaDescription($area)\n {\n $factor_area = DB::select('select al_f.name from al_factor as al_f inner join al_area as al_a on al_f.al_area_id = al_a.al_area_id where al_a.description = \"' . $area . '\"');\n return $factor_area;\n }", "public function set_local_area($local_area)\r\n\t {\r\n\r\n\t }", "public function getAreaID() {\n return $this->get(self::AREAID);\n }", "public function tareas(){\n\t\t\n\t\t$connection = Connection::getInstance();\n\t\t$result \t= $connection->query(\"SELECT tareas.id\n\t\t\t\t\t\t\t\t\t\t FROM tareas, inscripciones\n\t\t\t\t\t\t\t\t\t\t WHERE inscripciones.usuario_id = $this->id AND\n\t\t\t\t\t\t\t\t\t\t inscripciones.grupo_id = tareas.grupo_id\");\n\t\t$res \t\t= array();\n\t\t\n\t\twhile ($id = pg_fetch_array($result)[0]){\n\t\t\t$res[] = new Tarea($id);\n\t\t}\n\t\t\n\t\treturn $res;\n\t}", "function getAreaPorDepto(){\r\n\r\n $depa_id = $this->input->post('id_depto');\r\n $areas = $this->Areas->ObtenerXDepartamentos($depa_id)->areas->area;\r\n echo json_encode($areas);\r\n }", "public function show(Area $area)\n {\n //\n }", "function mapit_get_voting_area_geometry($area, $polygon_type = null) {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.get_voting_area_geometry', $params);\n return $result;\n}", "public function Tarea()\n {\n return $this->hasMany('App\\Tarea','areas_id','id');\n }", "public function getCentroArea() {\n return $this->_centro; \n }", "function area() { return ($this->max->x() - $this->min->x()) * ($this->max->y() - $this->min->y()); }", "public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }", "public function __toString(): string\n {\n return $this->getArea();\n }", "function solicitudes_en_tramite($id_area){\n //Consulta\n $sql =\n \"SELECT\n solicitudes.solicitudes.Pk_Id_Solicitud,\n solicitudes.solicitudes.Fecha_Creacion,\n solicitudes.solicitudes.Radicado_Entrada,\n solicitudes.solicitudes.Nombres,\n solicitudes.solicitudes.Solicitud_Descripcion AS Descripcion,\n solicitudes.tbl_tramos.Nombre AS Tramo\n FROM\n solicitudes.solicitudes\n INNER JOIN apps.usuarios ON solicitudes.solicitudes.Fk_Id_Usuario = apps.usuarios.Pk_Id_Usuario\n INNER JOIN solicitudes.tbl_tramos ON solicitudes.solicitudes.Fk_Id_Tramo = solicitudes.tbl_tramos.Pk_Id_Tramo\n WHERE\n solicitudes.solicitudes.Fk_Id_Solicitud_Estado = 1 AND\n solicitudes.solicitudes.Fk_Id_Area_Encargada = {$id_area}\n ORDER BY\n solicitudes.solicitudes.Fecha_Creacion ASC\";\n\n //Se retorna el resultado de la consulta\n return $this->db->query($sql)->result();\n }", "public function getNomeArea() {\n return $this->_nome; \n }", "public static function ADMIN_AREA_GET_AREA_VIEW_DATA(){\n\t $SQL_String = \"SELECT ano,area_code,area_type,area_name,area_descrip,area_link,area_gates,area_load,accept_max_day,accept_min_day,revise_day,cancel_day,filled_day,wait_list,member_max,auto_pass,time_open,time_close,refer_json,form_json,_open FROM area_main WHERE area_code=:area_code AND _keep=1 ;\";\n\t return $SQL_String;\n\t}", "public function addMapareas( $value){\n return $this->_add(30, $value);\n }", "function dataform_get_file_areas($course, $cm, $context) {\n $areas = array();\n return $areas;\n}", "public function tipo_tarjeta();", "function calcularAreaRect ($base, $altura){\n return $base * $altura;\n\n}", "function getForResumenExtArea($area){\n\t\t\t$tipos = array(\n\t\t\t\t0=>\"CE\",\n\t\t\t\t1=>\"DS\",\n\t\t\t\t2=>\"Q\",\n\t\t\t\t3=>\"AB\",\n\t\t\t\t4=>\"DM\",\n\t\t\t\t5=>\"M\",\n\t\t\t\t6=>\"R\",\n\t\t\t\t7=>\"D\",\n\t\t\t\t8=>\"P\",\n\t\t\t\t9=>\"PA\",\n\t\t\t\t10=>\"EL\",\n\t\t\t\t11=>\"S\",\n\t\t\t\t12=>\"DL\",\n\t\t\t\t13=>\"DE\",\n\t\t\t\t14=>\"CB\",\n\t\t\t\t15=>\"CA\"\n\t\t\t\t);\n\t\t\t$respuesta = array();\n\t\t\tforeach ($tipos as $value) {\n\t\t\t\t$sql = \"select count(*) as total from $this->tabla \n\t\t\t\t\t\tjoin referencias\n\t\t\t\t\t\t\ton referencias.id_referencia = $this->tabla.id_referencia\n\t\t\t\t\t\tjoin areas\n\t\t\t\t\t\t\ton areas.id_area = referencias.id_area\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t$this->tabla.tipo_discontinuidad = '\".$value.\"' \n\t\t\t\t\t\t\tand areas.id_area=\".$area.\"\n\t\t\t\t\";\n\n\t\t\t\t$resultado = $this->conexion->query($sql);\n\t\t\t\tif($resultado->num_rows > 0){\n\t\t\t\t\t$row=$resultado->fetch_assoc() ;\n\t\t\t\t\tif($row['total']>0){\n\t\t\t\t\t\t$respuesta[$value] = $row['total'] ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn json_encode($respuesta) ;\n\t\t}", "public function get_file_areas() {\n return array(ASSIGNSUBMISSION_CIRCLECI_FILEAREA=>$this->get_name());\n }", "public static function area($area)\n\t{\n\t //return the first to the last item :)\n\t\t$clean = explode('/',$area);\n\t\tarray_pop($clean);\n $area = array_pop($clean);\n\t\treturn $area;\n\t\t\n\t}", "function tipoDeLlamada($codInternacional, $codArea)\n{\n if ($codInternacional == 54)\n {\n if ($codArea == 299)\n {\n return \"corta\";\n }\n\n return \"larga\";\n }\n return \"internacional\";\n}", "public function hasMapareas(){\n return $this->_has(30);\n }", "public function getAreaCdArea()\n {\n return $this->area_cd_area;\n }", "public function getNomeMappaArea() {\n return $this->_nomeMappa; \n }", "function calculaAreaCuadrado($valor){\n\t\treturn $valor*$valor;\n\t}", "public function getInterestArea(){\r\n\t\t\treturn $this->interestArea;\r\n\t\t}", "function read()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$q = \"SELECT * FROM map_area WHERE item_id = \".\n\t\t\t$ilDB->quote($this->getItemId(), \"integer\").\n\t\t\t\" AND nr = \".$ilDB->quote($this->getNr(), \"integer\");\n\t\t$area_set = $ilDB->query($q);\n\t\t$area_rec = $ilDB->fetchAssoc($area_set);\n\n\t\t$this->setShape($area_rec[\"shape\"]);\n//echo $area_rec[\"Shape\"];\n\t\t$this->setNr($area_rec[\"nr\"]);\n\t\t$this->setCoords($area_rec[\"coords\"]);\n\t\t$this->setLinkType($area_rec[\"link_type\"]);\n\t\t$this->setTitle($area_rec[\"title\"]);\n\t\t$this->setHref($area_rec[\"href\"]);\n\t\t$this->setTarget($area_rec[\"target\"]);\n\t\t$this->setType($area_rec[\"type\"]);\n\t\t$this->setTargetFrame($area_rec[\"target_frame\"]);\n\t\t$this->setHighlightMode($area_rec[\"highlight_mode\"]);\n\t\t$this->setHighlightClass($area_rec[\"highlight_class\"]);\n\n\t}", "public function getStartCollegamentiArea() {\n return $this->_startCollegamenti; \n }", "public function destroy(Tarea $tarea)\n {\n //\n }", "public function edit(tareas $tareas)\n {\n //\n }", "public function index()\n {\n \n $this->load->view('tareas');\n \n }", "function DatosArea($idArea) {\n\t\t\t$sql=\"SELECT a.id_claveArea, a.nomArea, e.id_claveEdi \n\t\t\t\t FROM area a \n\t\t\t\t INNER JOIN edificio e \n\t\t\t\t ON a.id_claveArea=e.id_claveEdi \n\t\t\t\t WHERE a.id_claveArea=e.id_claveEdi\";\n\t\t\t$result=$this->db->query($sql)->execute();\n\t\t\treturn $result->current();\n\t\t}", "function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }", "public function create()\n {\n $id = Auth::user()->id;\n\n $params = [\n 'titulo' => 'Cadastrar area',\n 'perfil' => Perfil::find($id),\n ];\n return view('membro.area.create')->with($params);\n }", "function getArea($area)\n {\n $areas = array();\n if(isset($this->areas[$area])){\n ksort($this->areas[$area]);\n $areas = $this->areas[$area];\n }\n return $areas;\n }", "public function create()\n {\n //\n return view('area.create');\n }", "function tmiCreateContentAreaPost() {\n\t$labels = array(\n\t\t'name' => _x( 'Content Areas', 'post type general name', 'tmi' ),\n\t\t'singular_name' => _x( 'Content Area', 'post type singular name', 'tmi' ),\n\t\t'menu_name' => _x( 'Content Areas', 'admin menu', 'tmi' ),\n\t\t'name_admin_bar' => _x( 'Content Area', 'add new on admin bar', 'tmi' ),\n\t\t'add_new' => _x( 'Add New', 'Content Area', 'tmi' ),\n\t\t'add_new_item' => __( 'Add New Content Area', 'tmi' ),\n\t\t'new_item' => __( 'New Content Area', 'tmi' ),\n\t\t'edit_item' => __( 'Edit Content Area', 'tmi' ),\n\t\t'view_item' => __( 'View Content Area', 'tmi' ),\n\t\t'all_items' => __( 'All Content Areas', 'tmi' ),\n\t\t'search_items' => __( 'Search Content Areas', 'tmi' ),\n\t\t'parent_item_colon' => __( 'Parent Content Areas:', 'tmi' ),\n\t\t'not_found' => __( 'No Content Areas found.', 'tmi' ),\n\t\t'not_found_in_trash' => __( 'No Content Areas found in Trash.', 'tmi' )\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n 'description' => __( 'Description.', 'tmi' ),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'Content Area' ),\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => true,\n\t\t'hierarchical' => false,\n\t\t'menu_position' => null,\n\t\t'supports' => array( 'title', 'editor')\n\t);\n\tregister_post_type( 'tmi-content-Area', $args );\n}", "function gutenberg_filter_template_part_area( $type ) {\n\t$allowed_areas = array_map(\n\t\tfunction ( $item ) {\n\t\t\treturn $item['area'];\n\t\t},\n\t\tgutenberg_get_allowed_template_part_areas()\n\t);\n\tif ( in_array( $type, $allowed_areas, true ) ) {\n\t\treturn $type;\n\t}\n\n\t/* translators: %1$s: Template area type, %2$s: the uncategorized template area value. */\n\t$warning_message = sprintf( __( '\"%1$s\" is not a supported wp_template_part area value and has been added as \"%2$s\".', 'gutenberg' ), $type, WP_TEMPLATE_PART_AREA_UNCATEGORIZED );\n\ttrigger_error( $warning_message, E_USER_NOTICE );\n\treturn WP_TEMPLATE_PART_AREA_UNCATEGORIZED;\n}", "function getAreaInfo($area = null, $key = null)\n\t{\n\t\t// by default, use the current area\n\t\tif (is_null($area)) {\n\t\t\t$area = $this->area;\n\t\t}\n\t\t\n\t\t// is it a recognized area?\n\t\tif (! isset($this->areaInfo[$area])) {\n\t\t\t// no, should we return an empty array\n\t\t\t// or a boolean false?\n\t\t\tif (is_null($key)) {\n\t\t\t\treturn $this->areas->getBlankRow();\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (is_null($key)) {\n\t\t\treturn $this->areaInfo[$this->area];\n\t\t} elseif (isset($this->areaInfo[$this->area][$key])) {\n\t\t\treturn $this->areaInfo[$this->area][$key];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function Tareas_admin_new()\n{\n\tif (!SecurityUtil::checkPermission('Tareas::', '::', ACCESS_ADMIN)) {\n\t\treturn LogUtil::registerPermissionError();\n\t}\n \t//Lenguaje\n\t$dom = ZLanguage::getModuleDomain('Tareas');\n\t\n\t// Obtener todas las variables del modulo\n\t$modvars = pnModGetVar('Tareas');\n\t\n\t$prioridades = explode(\"/\", $modvars['prioridad']);\n\t$estados \t = explode(\"/\", $modvars['estado']);\n\t\n\t// Construimos y devolvemos la Vista\n\t$render = & pnRender::getInstance('Tareas');\n\t//Pasamos variables a plantilla\n\t$render->assign('prioridades', $prioridades);\n\t$render->assign('estados', $estados);\n\n\treturn $render->fetch('Tareas_admin_new.htm');\n \n}", "public function getPanose() {}", "public function getAllTareas(){\n $stm = Conexion::conector()->prepare(\"SELECT * FROM tareas\");\n $stm->execute();\n return $stm->fetchAll(\\PDO::FETCH_ASSOC); //entrega toda la info de la BD, \n //Lo hace como arreglo asociativo\n }" ]
[ "0.74729306", "0.7189956", "0.66263884", "0.6589897", "0.6589897", "0.6589897", "0.6308647", "0.6303405", "0.6299158", "0.6218957", "0.6216465", "0.6211775", "0.61400783", "0.6103693", "0.6096393", "0.6058221", "0.60245895", "0.60046476", "0.5987118", "0.5968363", "0.58904415", "0.5888466", "0.58882576", "0.5885667", "0.5870815", "0.5865072", "0.58576137", "0.5856983", "0.58430684", "0.5822255", "0.5822081", "0.5809722", "0.58009475", "0.57825714", "0.5760621", "0.57362676", "0.5733367", "0.57261854", "0.57173467", "0.5712958", "0.5709991", "0.5703729", "0.5703725", "0.5699305", "0.569367", "0.5680349", "0.56693935", "0.56685233", "0.5660733", "0.56422377", "0.5612733", "0.5612568", "0.5599608", "0.5593586", "0.5586635", "0.5576413", "0.5571728", "0.55610687", "0.5559818", "0.55546063", "0.5548821", "0.55445987", "0.55165327", "0.5516496", "0.5509848", "0.54993016", "0.54892427", "0.54679435", "0.5458823", "0.54581535", "0.54527617", "0.5452629", "0.5446444", "0.5435341", "0.5434263", "0.5432824", "0.54237705", "0.5422422", "0.5410653", "0.5394486", "0.5386091", "0.53784025", "0.53685594", "0.5359021", "0.5357487", "0.5344246", "0.5336472", "0.5306202", "0.53057957", "0.5305253", "0.5299458", "0.5297695", "0.52917546", "0.5283702", "0.52776456", "0.5264956", "0.5259755", "0.5256843", "0.525002", "0.52463704", "0.5237402" ]
0.0
-1
Validate and update the given user's profile information.
public function update($user, array $input) { Validator::make($input, [ 'phone' => ['required', 'numeric', 'digits_between:1,15'], 'address' => ['required', 'string'], 'city' => ['required', 'string'], 'country' => ['required', 'string'], ])->validate(); $user->forceFill([ 'phone' => $input['phone'], 'address' => $input['address'], 'city' => $input['city'], 'country' => $input['country'], ])->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function update()\n\t{\n\t\t// check whether there is user who has logged in\n\t\tif (!Auth::check())\n\t\t\treturn 'fail';\n\n\t\t//get profile model\n\t\t$user = Auth::user();\n\t\t$profile = Profile::find($user->id);\n\t\t$profile->firstname = Input::get('firstname');\n\t\t$profile->lastname = Input::get('lastname');\n\t\t$profile->number = Input::get('number');\n\t\t$profile->country = Input::get('country');\n\t\t$profile->language = Input::get('language');\n\t\t$profile->city = Input::get('city');\n\t\t$profile->location = Input::get('location');\n\t\t$profile->availability = Input::get('availability');\n\t\t$profile->currency = Input::get('currency');\n\t\t$profile->price = Input::get('price');\n\t\t$profile->about = Input::get('about');\n\n\t\t// update profile and user\n\t\tif ($profile->save() && $user->save())\n\t\t\treturn 'success';\n\t}", "public function updateProfile(ValidProfile $request){\n\n\t\t// Ensure only the logged in user can update their profile. \n $user = User::find(Auth::user()->id); \n \n $user->name = $request->name;\n\t\t$user->traveller_rv_type_id = $request->rvType;\n\t\t$user->traveller_rv_size = $request->rvSize;\n\t\t$user->host_description = $request->description;\n\t\t\n\t\t$user->save();\n \n return Redirect::route('home');\n }", "public function updateprofile()\n\t\t{\n\t\t\t$validator = Validator::make(Input::all(), User::$editrules);\n\t\t\tif(Auth::check()) {\n\t\t\t\t$usertoupdate = Auth::user();\n\t\t\t\t$usertoupdate->firstname = Input::get('firstname');\n\t\t\t\t$usertoupdate->lastname = Input::get('lastname');\n\t\t\t\t$usertoupdate->phone = Input::get('phone');\n\t\t\t\t$checkdbforusername = DB::table('users')->where('username', Input::get('username'))->pluck('username');\n\t\t\t\t$checkdbforemail = DB::table('users')->where('email', Input::get('email'))->pluck('email');\n\n\t\t\t\tif($validator->fails()) {\n\t\t\t\t\tSession::flash('errormessage', 'Sorry, some of your inputs are incorrect');\n\t\t\t\t\treturn Redirect::back()->withInput()->withErrors($validator);\n\t\t\t\t} else {\n\t\t\t\t\tif($checkdbforusername == null || $checkdbforusername == Auth::user()->username) {\n\t\t\t\t\t\tif($checkdbforemail == null || $checkdbforemail == Auth::user()->email) {\n\t\t\t\t\t\t\tif($checkdbforusername != Auth::user()->username) {\n\t\t\t\t\t\t\t\t$usertoupdate->username = Input::get('username');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($checkdbforemail != Auth::user()->email) {\n\t\t\t\t\t\t\t\t$usertoupdate->email = Input::get('email');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$usertoupdate->save();\n\t\t\t\t\t\t\tSession::forget('loggedinuser');\n\t\t\t\t\t\t\tSession::put('loggedinuser', $usertoupdate->username);\n\t\t\t\t\t\t\tSession::flash('successMessage', 'Profile successfully updated!');\n\t\t\t\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSession::flash('errorMessage', 'This email address is already taken');\n\t\t\t\t\t\t\treturn Redirect::back()->withInput();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSession::flash('errorMessage', 'This username is already taken');\n\t\t\t\t\t\treturn Redirect::back()->withInput();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function updateProfile(){\n\t\t\t\t$this->__dataDecode();\n\t\t\t\t//pr($this->data);die;\n\t\t\t\t\n\t\t\t\tif(!empty($this->data)){\n\t\t\t\t\t$data['User']['firstname'] = $this->data['User']['firstName'];\n\t\t\t\t\t$data['User']['wieght'] = $this->data['User']['wieght'];\n\t\t\t\t\t$data['User']['school'] = $this->data['User']['school'];\n\t\t\t\t\t$data['User']['id'] = $this->data['User']['playerId'];\n\t\t\t\t\t$data['User']['secToken'] = $this->data['User']['secToken'];\n\t\t\t$details = $this->User->find('first', array('conditions' => array('User.id' => $data['User']['id'],'User.secToken' => $data['User']['secToken'])));//pr($details);die;\n\t\t\t\tif(!empty($details)){\n\t\t\t\t\t\tif($this->User->save($data)){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile does not updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\telse\n{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'UnAuthorized User';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n}\n}\n\t\t\t}", "public function updateProfile($user, array $profile);", "public function update_profile() {\n\t\tloggedOnly();\n\n\t\t// Busca o usuario\n\t\t$user = auth();\n\n\t\t// Pega o email\n\t\t$email = $this->input->post( 'email' ) ? \n\t\t\t\t $this->input->post( 'email' ) :\n\t\t\t\t $user->email;\n\n\t\t// Verifica se o email foi alterado\n\t\tif( $email !== $user->email ) {\n\n\t\t\t// Verifica se o email é unico\n\t\t\tif( $this->User->email( $email ) ) {\n\t\t\t\treturn reject( 'E-mail ja cadastrado no sistema' );\n\t\t\t}\n\t\t\t\n\t\t\t// Seta o email\n\t\t\t$user->email = $email;\n\t\t}\n\n\t\t// Verifica se a senha foi alterada\n\t\tif( $password = $this->input->post( 'password' ) ) {\n\t\t\t$user->setPassword( $password );\n\t\t}\n\n\t\t// seta o nome\n\t\t$user->name = $this->input->post( 'name' ) ? \n\t\t\t\t\t $this->input->post( 'name' ) : \n\t\t\t\t\t $user->name;\n\n\t\t// Verifica se a foto foi alterada\n\t\tif( $base64 = $this->input->post( 'image' ) ) {\n\n\t\t\t// Guarda a imagem\n\t\t\tif( $midia_id = $this->__saveUserImage( $base64 ) ) {\n\t\t\t\t$user->midia_id = $midia_id;\n\t\t\t} else return reject( 'Erro ao salvar a imagem do usuário' );\n\t\t}\n\n\t\t// salvar a alteração\n\t\tif( $user->save() ) {\n\t\t\treturn resolve( $user->authData() );\n\t\t} else return reject( 'Erro ao realizar a ação' );\n\t}", "public function update_profile(){\n\t\t\t$data = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'zipcode' => $this->input->post('zipcode'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'username' => $this->input->post('username')\n\t\t\t);\n\n\t\t\t$this->db->where('id', $this->input->post('id'));\n \n return $this->db->update('users', $data);\n\t\t}", "public function updateProfile() {\n\t\t\n\t\treturn $this->_post(self::URL_USERS_UPDATE_PROFILE, $this->_query);\n\t}", "public static function edit_profile() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'ur-my-account' );\n\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\n\t\t$profile = user_registration_form_data( $user_id, $form_id );\n\n\t\t$user_data = get_userdata( $user_id );\n\t\t$user_data = $user_data->data;\n\n\t\t$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();\n\n\t\tif ( ! empty( $form_data_array ) ) {\n\n\t\t\tif ( count( $profile ) < 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare values.\n\t\t\tforeach ( $profile as $key => $field ) {\n\t\t\t\t$value = get_user_meta( get_current_user_id(), $key, true );\n\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t$new_key = str_replace( 'user_registration_', '', $key );\n\n\t\t\t\tif ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {\n\t\t\t\t\t$value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t} elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );\n\n\t\t\t\t} elseif ( isset( $user_data->display_name ) && 'user_registration_display_name' === $key ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tur_get_template(\n\t\t\t\t'myaccount/form-edit-profile.php',\n\t\t\t\tarray(\n\t\t\t\t\t'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),\n\t\t\t\t\t'form_data_array' => $form_data_array,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\techo '<h1>' . esc_html__( 'No profile details found.', 'user-registration' ) . '</h1>';\n\t\t}\n\t}", "public function testUpdateValidProfile() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new profile and update it in mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// edit the profile and update it in mySQL\n\t\t$profile->setProfileContent($this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_NAME);\n\t\t$profile->update($this->getPDO());\n\n\t\t// grab the date from mySQL and enforce the fields match out expectations\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$this->assertEquals($pdoProfile->getProfileId(), $profileId);\n\t\t$this->assertEquals($pdoProfile->getProfileActivationToken(), $this->VALID_ACTIVATION_TOKEN);\n\t\t$this->assertEquals($pdoProfile->getProfileEmail(), $this->VALID_PROFILE_EMAIL);\n\t\t$this->assertEquals($pdoProfile->getProfileHash(), $this->VALID_PROFILE_HASH);\n\t\t$this->assertEquals($pdoProfile->getProfileIsOwner(), $this->VALID_PROFILE_IS_OWNER);\n\t\t$this->assertEquals($pdoProfile->getProfileName(), $this->VALID_PROFILE_NAME);\n\t}", "public function profileAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['phone'])){\n $user->setPhone($data['phone']);\n }\n if(isset($data['email'])){\n $user->setPhone($data['email']);\n }\n if(isset($data['workphone'])){\n $user->setWorkPhone($data['workphone']);\n }\n if(isset($data['workemail'])){\n $user->setWorkEmail($data['workemail']);\n }\n if(!$user->save()){\n $this->setErrorResponse('Cannot update user profile');\n }\n $this->_helper->json($user);\n }", "public function updateProfile(Request $request, User $user)\n {\n // dd($request);\n // dd($request->first_name);\n // dd($request->email);\n // dd($user->name);\n\n\t\t// Validate a Unique Key Allowing the Update\n\t\t$this->validate(request(),[\n\t\t\t'first_name' => 'required|min:3' ,\n\t\t\t'last_name' => 'required|min:3' ,\n\t\t\t// 'language_code' => 'required|min:2|exists:languagecodes,languagecode' ,\n\t\t\t// 'country_code' => 'required|min:3|exists:countrycodes,ccn3' ,\n\t\t\t]);\n \n $profileInfo = $user->profile;\n // dd($profileInfo);\n $profileInfo->update($request->all());\n\n // @todo: Update log updated_by / updated timestamp\n\n return back()->with('success', __('Profile Updated') );\n }", "public function updateProfile()\n {\n try {\n $email = Crypt::decryptString(request()->hash);\n $user = Customer::whereEmail($email)->first();\n if ($user) {\n $user->fname = request()->fname;\n $user->lname = request()->lname;\n $user->phone = request()->phone;\n $user->address = request()->address;\n if (request()->image)\n $user->image = $this->uploadBase64Image(request()->image);\n\n $user->save();\n\n $user->access_token = Crypt::encryptString($user->email);\n\n return ['status' => true, 'message' => 'Profile updated successfully.', 'data' => $user];\n }//..... end if() .....//\n\n return ['status' => false, 'message' => 'User details not found!.'];\n } catch (\\Exception $exception) {\n return $exception->getMessage();\n return ['status' => false, 'message' => 'Internal server error occurred, please try later.'];\n }\n }", "public function updateUserinfo()\n\t{\n\t\t$user_array = Session::all();\n\n \t$userID = Session::get('id');\n\t\t$data = $this->request->all();\n\t\t$data['user'] = Auth::user();\n\t\t\t$rules = array(\n \t\t'full_name' => 'required',\n\t\t\t\t'zip_code' => 'required',\n\t\t\t\t'aniversary_date' => 'required',\n\t\t\t\t'phone_number' => 'required',\n\t\t\t\t'dob' => 'required',\n\t\t\t\t'gender' => 'required',\n\t\t\t\t'location_id' => 'required'\t\t\t\t\n\t\t\t);\n\n\t\t\t$message = array(\n\t\t\t\t'required' => 'The :attribute is required', \n\t\t\t);\n\n\t\t\t$validation = Validator::make($data, $rules, $message);\n\n\t\t\tif($validation->fails())\n\t\t\t{\n\t\t\t\treturn Redirect::to('/users/updateinfo')->withErrors($validation);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t$arrResponse=Profile::updateProfileWeb($data, $userID);\n \treturn Redirect::to('/users/myaccount')\n\t\t ->with('flash_notice', '');\n\t\t }\n\t}", "public function profileProcess(Request $request, AccountUser $accountUser)\n {\n if ($accountUser->isDefaulter()) {\n return back()->with('error', 'You can not change Account settings');\n }\n\n $user = $request->user();\n\n if ($user->isPartner()) {\n $request->validate([\n 'email' => [\n 'required',\n 'email',\n Rule::unique('users')->ignore($user->id),\n ],\n 'phone' => [\n 'required',\n 'min:10',\n 'max:14',\n Rule::unique('users')->ignore($user->id),\n ],\n 'gender' => [\n 'required',\n Rule::in(['male', 'female', 'others']),\n ],\n ]);\n\n $data = [\n 'name' => $request->get('name'),\n 'email' => $request->get('email'),\n 'phone' => $request->get('phone'),\n 'dob' => $request->get('dob'),\n 'newsletter' => $request->input('newsletter') ? now() : null,\n 'track_usage' => $request->input('track_usage') ? now() : null,\n 'gender' => $request->input('gender'),\n ];\n }\n else {\n $request->validate([\n 'gender' => [\n 'required',\n Rule::in(['male', 'female', 'others']),\n ],\n ]);\n\n $data = [\n 'newsletter' => $request->input('newsletter') ? now() : null,\n 'track_usage' => $request->input('track_usage') ? now() : null,\n 'gender' => $request->input('gender'),\n ];\n }\n\n\n\n $user->update($data);\n\n $user->save();\n\n event(new UserUpdatedProfile($user));\n\n return back()->with('success', 'Account updated');\n }", "public function update_user_profile($typeOfUser)\n {\n // used for displaying feedback for profile update\n $isProfileUpdated = 'is_' . $typeOfUser . '_profile_updated';\n $_SESSION[$isProfileUpdated] = false;\n\n $email = trim($this->input->post('txtEmail'));\n $phone = trim($this->input->post('txtPhone'));\n\n if ($email != '') {\n $this->CustomModel->updateField($_SESSION['u_id'], 'email', $email);\n $_SESSION[$isProfileUpdated] = true;\n }\n if ($phone != '') {\n $this->CustomModel->updateField($_SESSION['u_id'], 'phone', $phone);\n $_SESSION[$isProfileUpdated] = true;\n }\n\n $filename = 'uploads/' . $this->setUpImageUploadConfig();\n if ($this->upload->do_upload('image')) {\n\n $this->CustomModel->updateUserImage($_SESSION['u_id'], $filename);\n $this->resizeImage($filename, 512, 512);\n $_SESSION[$isProfileUpdated] = true;\n }\n\n // load the corresponding user view\n $this->load_user_view($typeOfUser);\n }", "public function update_user_profile($user_data, $user_id) {\r\n\r\n // Start Backend Validation\r\n if (empty($user_data['name'])) {\r\n $this->errors['name'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n } elseif (strlen($user_data['name']) < 5) {\r\n $this->errors['name'] = 'يجب على اسم المستخدم أن يتكون من 5 أحرف فأكثر';\r\n }\r\n\r\n if (str_word_count($user_data['bio']) > 150) {\r\n $this->errors['bio'] = 'يسمح فقط بـ 150 كلمة أو أقل في النبذة الخاصة بك';\r\n }\r\n\r\n if (!filter_var($user_data['email'], FILTER_VALIDATE_EMAIL)) {\r\n $this->errors['email'] = 'رجاء أدخل بريدا إلكترونيا صالحا';\r\n }\r\n\r\n if (empty($this->errors)) { // If There is No Error\r\n // Sanitize Data\r\n $name = filter_var($user_data['name'], FILTER_SANITIZE_STRING);\r\n $bio = filter_var($user_data['bio'], FILTER_SANITIZE_STRING);\r\n $email = filter_var($user_data['email'], FILTER_SANITIZE_EMAIL);\r\n\r\n // Get Old User Pictures\r\n $avatar = $this->get_user_info('avatar', $user_id);\r\n $cover = $this->get_user_info('cover', $user_id);\r\n\r\n // If The User Uploaded a New Avatar\r\n if (!empty($_FILES['avatar']['tmp_name'])) {\r\n // Get The Avatar\r\n $image = $_FILES['avatar'];\r\n $ext = pathinfo($image['name'], PATHINFO_EXTENSION);\r\n\r\n // If The User Has Not an Image Folder Before\r\n if (in_array($avatar, ['male.png', 'female.png'])) {\r\n // Create a New One\r\n $user_dir = str_replace(' ', '_', $name) . '_' . time() . '/';\r\n } else { // If Not\r\n // Use The Old One\r\n $user_dir = pathinfo($avatar, PATHINFO_DIRNAME) . '/';\r\n }\r\n\r\n // Fill Important Properties\r\n $this->extensions = ['png', 'jpg', 'jpeg', 'gif'];\r\n $this->upload_dir = 'assets/images/profile/' . $user_dir;\r\n $this->upload_name = 'profile.' . $ext;\r\n\r\n // Upload The New Image\r\n if ($this->upload($image)) {\r\n $avatar = $user_dir . $this->upload_name;\r\n }\r\n }\r\n\r\n // If The User Uploaded a New Cover Photo\r\n if (!empty($_FILES['cover']['tmp_name'])) {\r\n // Get The Image\r\n $image = $_FILES['cover'];\r\n $ext = pathinfo($image['name'], PATHINFO_EXTENSION);\r\n\r\n // If The User Has Not an Image Folder Before\r\n if (in_array($avatar, ['male.png', 'female.png'])) {\r\n // Create a New One\r\n $user_dir = str_replace(' ', '_', $name) . '_' . time() . '/';\r\n } else { // If Not\r\n // Use The Old One\r\n $user_dir = pathinfo($avatar, PATHINFO_DIRNAME) . '/';\r\n }\r\n\r\n // Fill Important Properties\r\n $this->extensions = ['png', 'jpg', 'jpeg', 'gif'];\r\n $this->upload_dir = 'assets/images/profile/' . $user_dir;\r\n $this->upload_name = 'cover.' . $ext;\r\n\r\n // Upload The New Image\r\n if ($this->upload($image)) {\r\n $cover = $user_dir . $this->upload_name;\r\n }\r\n }\r\n\r\n // Connect To DB\r\n $connection = DB::connect();\r\n\r\n // Update users Table\r\n $stmt = \"UPDATE users SET\r\n name = '$name',\r\n email = '$email',\r\n bio = '$bio',\r\n avatar = '$avatar',\r\n cover = '$cover' WHERE id = '$user_id'\";\r\n\r\n // If The User Profile Wans't Updated SuccessFully\r\n if ($connection->query($stmt) === false) {\r\n echo '<script>alert(\"لا نستطيع تحديث معلوماتك الآن، يمكنك الإتصال بفريق الدعم أو المحاولة لاحقا\")</script>';\r\n return;\r\n }\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n //header('location: ' . $profile_url);\r\n\r\n }\r\n }", "public function saveProfile()\r\n {\r\n $input = Input::all();\r\n $user = User::find(Auth::user()->id);\r\n $user->user_type = User::TYPE_ADMIN;\r\n $user->email = $input['email'];\r\n $user->first_name = $input['first_name'];\r\n $user->middle_name = $input['middle_name'];\r\n $user->last_name = $input['last_name'];\r\n $user->phone_1 = $input['phone_1'];\r\n $user->phone_2 = $input['phone_2'];\r\n\r\n try {\r\n // check if old password matches\r\n if (!empty($input['old_password']) || !empty($input['new_password']) || !empty($input['repeat_password'])) {\r\n $hashCheck = Hash::check($input['old_password'], $user->getAuthPassword());\r\n if (!$hashCheck) {\r\n Session::flash(\r\n 'systemMessages',\r\n ['errors' => [[Lang::get('pages.users.old_password_incorrect')]]]\r\n );\r\n\r\n return Redirect::action('UserController@profile')->withInput();\r\n }\r\n\r\n if ($input['new_password'] !== $input['repeat_password']) {\r\n Session::flash(\r\n 'systemMessages',\r\n ['errors' => [[Lang::get('pages.users.passwords_dont_match')]]]\r\n );\r\n\r\n return Redirect::action('UserController@profile')->withInput();\r\n }\r\n\r\n $user->password = Hash::make($input['new_password']);\r\n }\r\n\r\n $user->save();\r\n\r\n // upload the new avatar if any\r\n $bm = new \\BaseModel();\r\n $filename = $bm->uploadImage('user', $user->id, Input::file('avatar'));\r\n\r\n // update the user record with the new avatar\r\n if (!empty($filename)) {\r\n $user->avatar = $filename;\r\n $user->save();\r\n }\r\n\r\n Session::flash('systemMessages', ['success' => [Lang::get('pages.profile.saved_success')]]);\r\n } catch (\\Exceptions\\ValidateException $e) {\r\n Session::flash('systemMessages', ['errors' => $e->getErrors()]);\r\n }\r\n\r\n return Redirect::back()->withInput();\r\n }", "public function update_profile_info() {\n\t\t$data = array(\n\t\t\t'first_name' => html_escape($this->input->post('first_name')),\n\t\t\t'last_name' => html_escape($this->input->post('last_name')),\n\t\t\t'biography' => html_escape($this->input->post('biography')),\n\t\t\t'phone' => html_escape($this->input->post('phone')),\n\t\t\t'social_links' => '{\"twitter\":\"' . html_escape($this->input->post('twitter')) . '\",\"facebook\":\"' . html_escape($this->input->post('facebook')) . '\",\"linkedin\":\"' . html_escape($this->input->post('linkedin')) . '\"}',\n\t\t);\n\t\t$this->session->set_userdata('phone', $this->input->post('phone'));\n\t\t$result = $this->user_model->update_user_info($this->session->userdata('user_id'), $data);\n\n\t\tif ($result) {\n\t\t\t$this->session->set_flashdata('profile_info_update_successful', \"Information updated successfully.\");\n\t\t} else {\n\t\t\t$this->session->set_flashdata('failed_to_update_profile_info', \"Failed to update profile info!! Please contact support.\");\n\t\t}\n\n\t\tredirect(site_url('user/profile/info'), 'refresh');\n\t}", "public function profile()\n {\n $id = $this->Auth->user('id');\n $user = $this->Users->get($id, [\n 'contain' => []\n ]);\n\n if ($this->request->is(['patch', 'post', 'put'])) {\n //avoid mass-assignment attack\n $options = [\n 'fieldList' => [\n 'email',\n 'username',\n 'password',\n 'first_name',\n 'last_name',\n 'address_1',\n 'address_2',\n 'suburb',\n 'state',\n 'post_code',\n 'mobile',\n 'phone',\n ]\n ];\n\n $user = $this->Users->patchEntity($user, $this->request->getData(), $options);\n if ($this->Users->save($user)) {\n\n $this->Flash->success(__('Your profile has been updated.'));\n return $this->redirect(\"/\");\n } else {\n $this->Flash->error(__('Your profile could not be updated. Please, try again.'));\n }\n }\n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n\n return null;\n }", "public function updateProfileFor($username, $updatedData)\n {\n $profile = User::whereUsername($username)->firstOrFail()->profile;\n $profile->fill($updatedData)->save();\n }", "public function updateProfile($data) {\n $this->db->query(\"UPDATE \" . DB_PREFIX . \"wkpos_user SET firstname = '\" . $data['firstname'] . \"', lastname = '\" . $data['lastname'] . \"', email = '\" . $data['account_email'] . \"', username = '\" . $data['username'] . \"', salt = '\" . $this->db->escape($salt = token(9)) . \"', password = '\" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['account_npwd'])))) . \"' WHERE user_id = '\" . $this->session->data['user_login_id'] . \"'\");\n }", "function profile()\n\t\t{\n\t\t\tif ( ! $this->data['user'])\n\t\t\t{\n\t\t\t\t$this->flexi_cart->set_error_message('You must login first.', 'public', TRUE);\n\t\t\t\tredirect('login');\n\t\t\t}\n\n\t\t\t$this->load->model('users_model');\n\t\t\t$this->load->library(array('ion_auth', 'form_validation'));\n\n\t\t\t$this->data['user'] = $this->users_model->get_details($this->data['user']->id);\n\n\t\t\t// validate form input\n\t\t\t$this->form_validation->set_rules('username', 'Username', 'required');\n\t\t\t$this->form_validation->set_rules('first_name', 'first name', 'required');\n\t\t\t$this->form_validation->set_rules('last_name', 'last name', 'required');\n\t\t\t$this->form_validation->set_rules('email', 'Email Address', 'required|valid_email');\n\t\t\t$this->form_validation->set_rules('phone', 'Phone Number', 'required');\n\t\t\t$this->form_validation->set_rules('old_password', 'Old password', 'required|callback_password_check');\n\n\t\t\tif ($this->input->post('edit_user'))\n\t\t\t{\n\t\t\t\t// Additional rules.\n\t\t\t\t// Rules for the password if it was posted\n\t\t\t\tif ($this->input->post('password'))\n\t\t\t\t{\n\t\t\t\t\t$this->form_validation->set_rules('password', $this->lang->line('edit_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t\t\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('edit_user_validation_password_confirm_label'), 'required');\n\t\t\t\t}\n\n\n\t\t\t\tif ($this->form_validation->run() === TRUE)\n\t\t\t\t{\n\t\t\t\t\t// Set the user profile data.\n\t\t\t\t\t$user_data = array(\n\t\t\t\t\t\t'username' => $this->input->post('username'),\n\t\t\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t\t\t'email'\t=> $this->input->post('email'),\n\t\t\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t\t\t\t'postal' => $this->input->post('postal'),\n\t\t\t\t\t\t'address' => $this->input->post('address'),\n\t\t\t\t\t);\n\n\t\t\t\t\t// Handle uploaded image(avatar).\n\t\t\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Get the image name.\n\t\t\t\t\t\t$filename = $this->data['user']->avatar;\n\t\t\t\t\t\t$avatar = $this->upload_image($filename);\n\n\t\t\t\t\t\tif ( ! $avatar['error'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$user_data['avatar'] = $avatar['path'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set appropriate messages following user update\n\t\t\t\t if($this->ion_auth->update($this->data['user']->id, $user_data))\n\t\t\t\t {\n\t\t\t\t\t\t$this->flexi_cart->set_status_message($this->ion_auth->messages(), 'public', TRUE);\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t\t$this->flexi_cart->set_error_message($this->ion_auth->errors(), 'public', TRUE);\n\n\t\t\t\t }\n\t\t\t\t\tredirect('profile', 'refresh');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t$this->load->view('public/dashboard/user_profile_view', $this->data);\n\t\t}", "public function updateProfile()\n {\n $fname=Input::get(\"fname\");\n $lname=Input::get(\"lname\");\n $dob=Input::get(\"dob\");\n $contact=Input::get(\"contact\");\n $user=Auth::user();\n if($fname!=NULL && !empty($fname))\n {\n $user->fname=$fname;\n }\n\n if($lname!=NULL && !empty($lname))\n {\n $user->lname=$lname;\n\n }\n if($contact!=NULL && !empty($contact))\n {\n $user->contact=$contact;\n }\n\n\n\n if($dob!=NULL && !empty($dob))\n {\n $user->dob=$dob;\n }\n\n $user->save();\n echo '0';\n \n\n\n\n //\n }", "function updateProfile($data) {\ntry {\n\n if (!$conn = connectDB()) {\n return false;\n }\n\n $userId = $_SESSION[\"userId\"];\n $args = array(\n $data[\"firstName\"], $data[\"lastName\"],\n $data[\"phone\"], $data[\"email\"], $data[\"location\"],\n $userId\n );\n\n $sql = <<<SQL\nUPDATE WebUser\nSET firstName=$1, lastName=$2,\n phonenumber=$3, emailaddress=$4, location=$5\nWHERE userId=$6\nSQL;\n\n $result = executeSQL($conn, $sql, $args);\n\n if (getUpdateCount($result) != 1) {\n /* Update was unsuccessful */\n closeDB($conn);\n return false;\n }\n\n /* Update succeeded */\n closeDB($conn);\n return true;\n\n} catch (Exception $e) {\n error(\"updateProfile\");\n closeDB($conn);\n return false;\n}\n}", "public function update_user_profile_info($user_id,$data)\n\t{\n\t\treturn $this->ci->profile_model->update_user_profile_info($user_id,$data);\n\t}", "public function updateOwnProfile(User $user)\n {\n //Se obtiene el id del usuario en sesion\n $user_id = Auth::user()->id;\n $user = User::find(Auth::user()->id);\n\n if(Auth::user()->type==1 || Auth::user()->type==6){\n //Validaciones a los datos de entrada\n $data = request()->validate([\n 'email' => 'required|max:70',\n 'first_name' => 'required|max:60',\n 'last_name' => 'required|max:60',\n 'username' => 'required|max:128',\n ], [\n 'first_name.required' => ' * Este campo es obligatorio.',\n 'first_name.max' => ' * Este campo debe contener sólo 60 caracteres.',\n 'last_name.required' => ' * Este campo es obligatorio.',\n 'last_name.max' => ' * Este campo debe contener sólo 60 caracteres.',\n 'email.required' => ' * Este campo es obligatorio.',\n 'email.max' => ' * Este campo debe contener sólo 70 caracteres.',\n 'username.required' => ' * Este campo es obligatorio.',\n 'username.max' => ' * Este campo debe contener sólo 128 caracteres.',\n ]);\n\n $user->first_name = filter_var(Input::get('first_name'), FILTER_SANITIZE_STRING);\n $user->last_name = filter_var(Input::get('last_name'), FILTER_SANITIZE_STRING);\n $user->second_last_name = filter_var(Input::get('second_last_name'), FILTER_SANITIZE_STRING);\n $user->username = filter_var(Input::get('username'), FILTER_SANITIZE_STRING);\n $user->address = filter_var(Input::get('address'), FILTER_SANITIZE_STRING);\n $user->phone = filter_var(Input::get('phone'), FILTER_SANITIZE_STRING);\n $user->email = filter_var(Input::get('email'), FILTER_SANITIZE_STRING);\n }else{\n //Validaciones a los datos de entrada\n $data = request()->validate([\n 'email' => 'required|max:70',\n 'username' => 'required|max:128',\n ], [\n 'email.required' => ' * Este campo es obligatorio.',\n 'email.max' => ' * Este campo debe contener sólo 70 caracteres.',\n 'username.required' => ' * Este campo es obligatorio.',\n 'username.max' => ' * Este campo debe contener sólo 128 caracteres.',\n ]);\n $user->username = filter_var(Input::get('username'), FILTER_SANITIZE_STRING);\n $user->email = filter_var(Input::get('email'), FILTER_SANITIZE_STRING);\n }\n\n if(Auth::user()->type==1 || Auth::user()->type==6 || Auth::user()->type==3){\n //Imagen nueva(mandada atraves del file input)\n $image = Input::file('image');\n //Imagen actual(registrada en la base de datos)\n $image2 = Input::get('image_2');\n }\n\n //Se actualiza el usuario\n $user->update();\n\n if(Auth::user()->type==1 || Auth::user()->type==6 || Auth::user()->type==3){\n //Actualizar imagen, eliminando la anterior\n if ($image!=null) {\n if ($image2!=null) {\n //Se realiza el eliminado de la imagen de la direccion fisica de\n //la imagen en el disco duro\n unlink(public_path().\"/storage/\".$image2);\n }\n //Se realiza el almacenado de la nueva imagen(cargada en el file input)\n $path=Input::file('image')->store('/public/images/user-signature/');\n //Se obtiene el nombre de la imagen\n $image_url = '/images/user-signature/'.Input::file('image')->hashName();\n //Se realiza la nueva actualizacion al registro del usuario actual con el\n //nombre de la nueva imagen\n DB::update('UPDATE users SET signature_url = ? WHERE id = ?', [$image_url, $user_id]);\n }\n }\n\n //Si el usuario cambia la contraseña, se actualiza, es caso contrario se queda como estaba guardada\n if (Input::get('password') != null) {\n $password = bcrypt(filter_var(Input::get('password'), FILTER_SANITIZE_STRING));\n DB::update('UPDATE users SET password = ? WHERE id = ?', [$password, $user_id]);\n }\n\n Alert::success('Exitosamente', 'Perfil Modificado');\n return redirect()->route('profile.show_own_profile');\n }", "public function update(ProfileUserRequest $request)\n {\n if( $user = $this->userRepository->updateProfile($request)){\n Session::flash('success', @trans('message.success.user.update_user'));\n }\n\n return redirect()->back();\n }", "public function user_profile_update(UpdateProfileRequest $request) {\n $user = User::where('id', Auth::id())->first();\n $data = [];\n\n // Uploading User's documents\n if ($request->hasFile('id_front')) {\n $fileName = $this->fileNameGenerator($user, $request, 'id_front');\n $request->file('id_front')->storeAs('uploads/documents', $fileName);\n $data['id_front'] = $fileName;\n }\n if ($request->hasFile('id_back')) {\n $fileName = $this->fileNameGenerator($user, $request, 'id_back');\n $request->file('id_back')->storeAs('uploads/documents', $fileName);\n $data['id_back'] = $fileName;\n }\n if ($request->hasFile('passport')) {\n $fileName = $this->fileNameGenerator($user, $request, 'passport');\n $request->file('passport')->storeAs('uploads/documents', $fileName);\n $data['passport'] = $fileName;\n }\n\n $data['ssn'] = $request->ssn;\n $data['dob'] = $request->dob;\n $data['phone'] = $request->phone;\n\n // Update and send redirect with success message\n if ($user->update($data)) {\n return redirect()->back()->with('success', 'Profile updated successfully, account will be activated soon');\n }else {\n return redirect()->back()->with('fail', 'Error occured when updating profile');\n }\n\n }", "public function update($userid)\n {\n $user = \\App\\User::with('profile')->whereId($userid)->firstOrFail();\n $input = Input::only('location', 'bio', 'twitter_username', 'github_username');\n\n $this->validator($input);\n\n //dd($user);\n $user->profile->fill($input)->save();\n \\Session::flash('flash_message','Profile successfully updated!');\n return redirect()->route('profile.edit', $user->id);\n }", "private function updateUser () {\n $sql = \"UPDATE users SET avatar = :avatar,\n biography = :biography,\n birthdate = :birthdate,\n email = :email,\n nickname = :nickname,\n location = :location,\n password = :password,\n activated = :activated,\n phone = :phone,\n username = :username,\n website = :website WHERE id_user = :id_user\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':avatar', $this->avatar);\n $query->bindParam(':biography', $this->biography);\n $query->bindParam(':birthdate', $this->birthdate);\n $query->bindParam(':email', $this->email);\n $query->bindParam(':nickname', $this->nickname);\n $query->bindParam(':location', $this->location);\n $query->bindParam(':password', $this->password);\n $query->bindParam(':phone', $this->phone);\n $query->bindParam(':username', $this->username);\n $query->bindParam(':website',$this->website);\n $query->bindParam(':activated',$this->activated);\n $query->bindParam(':id_user',$_SESSION['auth']['id_user']);\n $query->execute();\n }", "public function updateProfileProcess(UserProfileUpdateRequest $request)\n {\n $processReaction = $this->userEngine\n ->processUpdateProfile(\n $request->only(\n 'first_name',\n 'last_name'\n )\n );\n\n return __processResponse($processReaction, [\n 1 => __('Profile updated successfully.'),\n 14 => __('Nothing updated.'),\n ], [], true);\n }", "public function profile()\n {\n if (isset($_REQUEST['submit'])) {\n\n $fullname = $_POST['fullname'];\n\n $phone = $_POST['phone'];\n\n $username = $_POST['username'];\n\n $des = $_POST['des'];\n\n $user = $_POST['user'];\n\n\n //Checking for User login or not\n $change = $this->getChange($username, $fullname, $phone ,$des, $user);\n\n if ($change) {\n $success = 'Change profile successful!';\n echo \"<p><span class='error' style='color: green'>\" . $success . \"</span></p><br>\";\n } else {\n // Registration Failed\n $fail = 'Change profile failed. Account already not exits, please try again.';\n echo \"<p><span class='error' style='color: red;'>\" . $fail . \"</span></p><br>\";\n };\n }\n }", "public function postUpdate()\n {\n $user=User::find(Auth::user()->id);\n\n $this->validate($this->request, [\n 'name' => 'required|max:255',\n ]);\n $user->name = $this->request->input('name');\n if($this->request->input('email') != Auth::user()->email) {\n $this->validate($this->request, [\n 'email' => 'required|email|max:255|unique:users',\n ]);\n $user->email = strtolower($this->request->input('email'));\n }\n if($this->request->input('password') != \"\" ) {\n $this->validate($this->request, [\n 'password' => 'min:6',\n ]);\n $user->password = bcrypt( $this->request->input('password') );\n }\n $user->update();\n Auth::setUser($user);\n return redirect('profile');\n }", "public function testUpdateUserProfileErrorValidations()\n {\n // Prepare\n $user = factory(User::class)->create();\n\n $requestData = [\n 'user' => [],\n 'usermeta' => [\n 'twitter' => '@geekytheory',\n 'instagram' => 'geekytheory',\n 'facebook' => 'GeekyTheory',\n 'biography' => 'This text is longer than 255 characters and will not pass the validation. The \n biography cannot have more than 255 characters and this text has more than that\n quantity so the validation will fail showing an error message in the \n biography attribute.',\n ],\n ];\n\n // Request\n $response = $this->actingAs($user)->call('POST', $this->accountProfilePostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountProfilePageUrl);\n $response->assertSessionHasErrors([\n 'name',\n 'username',\n 'email',\n 'twitter',\n 'instagram',\n 'facebook',\n 'biography',\n ]);\n\n // Check that user and user meta haven't been modified\n $this->assertDatabaseHas('users', $user->attributesToArray());\n $this->assertDatabaseMissing('user_meta', ['user_id' => $user->id,]);\n }", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "public function updateUserProfile(Request $request)\n {\n $this->validateUserProfile($request);\n\n if (kAuth::$updateProfilesWith) {\n $this->callCustomUpdater(kAuth::$updateProfilesWith, $request);\n } else {\n Auth::user()->fill($request->all())->save();\n }\n\n event(new ProfileUpdated(Auth::user()));\n\n return $this->users->getCurrentUser();\n }", "public function updateprofileAction()\n\t{\n\t\t$this->view->headTitle(\"Update Your Profile\");\n\t\t\n\t\t//if not logged in, user can't edit profile\n\t\tif(!$this->loggedEmail){\n\t\t\t$this->_redirect('/'); \n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$user = new Default_Model_User();\n\t\t$resultRow = $user->getUserByEmail($this->loggedEmail);\n\t\t\n\t\tif($this->getRequest()->isPost()){\n\t\t\t\n\t\t\t$resultRow->email = $this->getRequest()->getPost('email');\n\t\t\t$resultRow->first_name = $this->getRequest()->getPost('first_name');\n\t\t\t$resultRow->last_name = $this->getRequest()->getPost('last_name');\n\t\t\t$resultRow->gender = $this->getRequest()->getPost('gender');\n\t\t\t$resultRow->address = $this->getRequest()->getPost('address');\n\t\t\t\n\t\t\tif(strlen($this->getRequest()->getPost('password'))){\n\t\t\t\t$resultRow->password = $this->getRequest()->getPost('password');\n\t\t\t}\n\t\t\t$resultRow->updated_at = date('Y-m-d H:i:s');\n\t\t\t$resultRow->save();\n\t\t\t\n\t\t} \n\t\t\t\n\t\t$this->view->email = $resultRow->email;\n\t\t$this->view->first_name = $resultRow->first_name;\n\t\t$this->view->last_name = $resultRow->last_name;\n\t\t$this->view->gender = $resultRow->gender;\n\t\t$this->view->address = $resultRow->address;\n\t\t$this->view->handle = $resultRow->handle;\n\t\n\t}", "public function updateUserProfile(UpdateUserRequest $request)\n {\n $updated = $this->repository->updateUserProfile($request->validated());\n\n if(!$updated)\n throw new Exception(__('controller.auth.profile_failed'), 500);\n\n return $this->respondWithMessage( __('controller.auth.profile_success'));\n }", "public function action_profile() {\n\t\tif (!Auth::instance()->has_permission('update_profile', $this->_model_name)) {\n\t\t\tthrow new Oxygen_Access_Exception;\n\t\t}\n\t\t$this->_init_model();\n\t\t$this->_load_model();\n\t\t$this->_create_nonce();\n\n\t\t// Hooks\n\t\tOHooks::instance()\n\t\t\t->add(get_class($this).'.profile.view_data', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'profile_view_data'\n\t\t\t))\n\t\t\t->add(get_class($this).'.profile.model_post_save', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'profile_model_post_save'\n\t\t\t))\n\t\t\t->add(get_class($this).'.profile.model_saved', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'profile_model_saved'\n\t\t\t))\n\t\t\t->add('profile_edit.form.header_data', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'user_edit_form_header_data',\n\t\t\t));\n\n\t\t// Form posted?\n\t\tif (Arr::get($_POST, 'save')) {\n\t\t\ttry {\n\t\t\t\t// Validation\n\t\t\t\tNonce::check_fatal($this->_nonce_action, $this->_model->id);\n\t\t\t\t$this->_model->check();\n\n\t\t\t\t// Check collision\n\t\t\t\tif (!$this->_model->no_collision($this->_model->id, $this->_nonce_action)) {\n\t\t\t\t\t$this->_model->validation()->error('username', 'collision');\n\t\t\t\t\tthrow new ORM_Validation_Exception($this->_model->object_name, $this->_model->validation());\n\t\t\t\t}\n\n\t\t\t\t// Save the profile\n\t\t\t\t$this->_model->values_via_fieldgroup($_POST, 'profile');\n\t\t\t\t$this->_model->update();\n\n\t\t\t\tforeach ($this->_model->fieldgroup('preferences') as $key => $field) {\n\t\t\t\t\t$value = Arr::get($_POST, $key);\n\t\t\t\t\tif (!is_null($value)) {\n\t\t\t\t\t\t$this->_model->preference($key, $value);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Set the confirmation message\n\t\t\t\tMsg::add('confirm', 'Profile successfully updated.');\n\n\t\t\t\t// Hooks\n\t\t\t\t$this->_model = OHooks::instance()->filter(get_class($this).'.profile.model_post_save', $this->_model);\n\t\t\t\tOHooks::instance()->event(get_class($this).'.profile.model_saved', $this->_model);\n\n\t\t\t\t// All done!\n\t\t\t\t$this->request->redirect('profile');\n\t\t\t}\n\t\t\tcatch (ORM_Validation_Exception $e) {\n\t\t\t\tMsg::add('error', $e->errors('validation'));\n\t\t\t}\n\t\t}\n\n\t\t// Add additional fields\n\t\t$this->_model->fields_init();\n\t\t$this->_model->set_field_values();\n\t\t$fields = array(\n\t\t\tOField::factory('hidden')\n\t\t\t\t->model($this->_model)\n\t\t\t\t->name('updated')\n\t\t\t\t->value($this->_model->updated),\n\n\t\t\tNonce::field($this->_nonce_action, $this->_model->id),\n\t\t\t$this->_model->field('name'),\n\t\t\t$this->_model->field('email'),\n\t\t);\n\n\t\t// Initialize the form\n\t\t$form = OForm::factory()\n\t\t\t->title('Edit Profile')\n\t\t\t->name('profile_edit')\n\t\t\t->fields($fields)\n\t\t\t->button('save',\n\t\t\t\tOField::factory('submit')\n\t\t\t\t\t->model($this->_model)\n\t\t\t\t\t->name('save')\n\t\t\t\t\t->default_value('Save')\n\t\t\t)\n\t\t\t->view('header', 'form/header/tabs/default')\n\t\t\t->attributes(array(\n\t\t\t\t'class' => 'edit'\n\t\t\t))\n\t\t\t->add_css_class('base', true)\n\t\t\t->add_css_class('box-tabs', true);\n\t\t// add preferences\n\t\tforeach ($this->_model->fieldgroup('preferences') as $key => $field) {\n\t\t\t$value = $this->_model->preference($key);\n\t\t\tif (is_null($value)) {\n\t\t\t\t$value = Oxygen::config('oxygen')->get($key, null);\n\t\t\t}\n\t\t\t$form->field($key, $field->value($value));\n\t\t}\n\n\t\t// Favorite\n\t\t$title = 'User Profile';\n\t\t$this->favorites->title($title);\n\n\t\t// Get the hook to modify data.\n\t\t$data = OHooks::instance()->filter(get_class($this).'.profile.view_data', array(\n\t\t\t'controller' => $this,\n\t\t\t'model' => $this->_model,\n\t\t\t'form' => $form\n\t\t));\n\n\t\t// Set template content\n\t\t$this->template->set(array(\n\t\t\t'title' => $title,\n\t\t\t'content' => View::factory('user/profile', array(\n\t\t\t\t'model' => $data['model'],\n\t\t\t\t'form' => $data['form']\n\t\t\t))\n\t\t));\n\t}", "function updateMyProfile($data){\r\n global $pdo;\r\n\t\t$update = $pdo->prepare(\"UPDATE users SET `email`= ? WHERE id= ?\");\r\n $update->execute(array($data['email'], $this->user_id));\r\n\t\t$preparedProfileParam = prepareProfileParams($data);\r\n\t\tupdateProfileParameters($this->user_id,$preparedProfileParam);\r\n\t\t$log = debug_backtrace();\r\n\t\t$this->createActionLog($log);\r\n\t\treturn true;\r\n\t}", "public function updateProfile(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'full_name' => 'required',\n ]);\n if ($validator->fails()) {\n \n $errors = $validator->errors()->toArray();\n return $this->responseData->httpbadREQUEST(reset($errors)[0]);\n }\n\n $user = Auth::user();\n $user_id = $user->id;\n \n if (!empty($request->file('image'))) {\n\n $image = $request->file('image');\n $imgName = time() . '.' . $image->getClientOriginalExtension();\n $destinationPath = public_path('/uploads/user-profile/');\n $image->move($destinationPath, $imgName);\n $user->image = $imgName;\n }\n\n $google_map_link = ($request->google_map_link)?$request->google_map_link:$user->google_map_link; \n $user->full_name = $request->full_name;\n $user->google_map_link = $google_map_link; \n $user->save();\n\n if($user){\n\n return $this->responseData->objectHTTPOK(trans('lang.user_detail'),$user);\n } else {\n\n return $this->responseData->httpbadREQUEST(trans('lang.user_not_found'));\n }\n\n }", "function update_profile($firstname, $lastname, $email, $password, $session_id) {\n\t$user_id = get_user_id($session_id);\n\t\n\tif ($user_id) {\n\t\t$query = \"UPDATE \" . $GLOBALS['db_name'] . \".users SET firstname='$firstname', lastname='$lastname', password='$password', email='$email' WHERE user_id='$user_id' LIMIT 1\";\n\t\t//$result = $GLOBALS['db_connection'] -> query($query);\n\t\t\n\t\tif ($GLOBALS['db_connection'] -> query($query) === TRUE) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\tdisplay_sql_error();\n\t\t}\n\t\t\n\t} else {\n\t\treturn \"Error: User not found.\";\n\t}\n}", "public static function checkProfileUpdate(Auth $user)\n {\n if (!$person = $user->getPerson()) {\n return false;\n }\n\n if (is_null($person->getEmail())) {\n return false;\n }\n\n // Check if for any field, no PersonValue is assigned\n // if so, the profile needs to be updated\n return $person->getKeyValues()->exists(function ($key, $x) { return is_null($x['value']); });\n }", "public static function profile($profile){\n $pro = Profile::where('user_id',Auth::id())->first();\n if ($pro){\n $pro->update($profile);\n }else{\n Profile::create($profile);\n }\n }", "public function saveProfile()\n {\n if ($this->validate()) {\n $user = $this->user;\n\n $graph = Yii::$container\n ->get(\\common\\components\\Graph::class, [$this->user]);\n\n if ($this->timezone) {\n $user->timezone = $this->timezone;\n }\n if ($this->expose_graph) {\n $user->expose_graph = true;\n\n // generate behaviors graph image\n $checkins_last_month = (Yii::$container->get(\\common\\interfaces\\UserBehaviorInterface::class))\n ->getCheckInBreakdown();\n\n // if they haven't done a check-in in the last month this will explode\n // because $checkins_last_month is an empty array\n if ($checkins_last_month) {\n $graph->create($checkins_last_month, true);\n }\n } else {\n $user->expose_graph = false;\n // remove behaviors graph image\n $graph->destroy();\n }\n\n if ($this->send_email) {\n $user->send_email = true;\n $user->email_category = $this->email_category;\n $user->partner_email1 = $this->partner_email1;\n $user->partner_email2 = $this->partner_email2;\n $user->partner_email3 = $this->partner_email3;\n } else {\n $user->send_email = false;\n $user->email_category = 4; // default to \"Speeding Up\"\n $user->partner_email1 = null;\n $user->partner_email2 = null;\n $user->partner_email3 = null;\n }\n $user->save();\n return $user;\n }\n\n return null;\n }", "protected function saveProfile($user)\n\t{\n\t}", "function itstar_save_extra_user_profile_fields( $user_id ) {\n $saved = false;\n if ( current_user_can( 'edit_user', $user_id ) ) {\n update_user_meta( $user_id, 'birthday', $_POST['birthday'] );\n update_user_meta( $user_id, 'birthmonth', $_POST['birthmonth'] );\n update_user_meta( $user_id, 'birthyear', $_POST['birthyear'] );\n update_user_meta( $user_id, 'phone', $_POST['phone'] );\n update_user_meta( $user_id, 'job', $_POST['job'] );\n $saved = true;\n }\n return true;\n}", "public function updateProfile(UpdateUserProfileRequest $request, User $user)\n {\n\n $user = auth()->user();\n\n $data = $request->only(['name', 'email', 'about', 'address', 'phone', 'mobile', 'status']);\n\n $user->update($data);\n\n session()->flash('success', 'Your Profile updated sucessfully.');\n\n return redirect(route('home'));\n }", "public function updateUserProfile($profile) {\r\n\r\n if (!is_array($profile) || !isset($profile['email'])) {\r\n RestoLogUtil::httpError(500, 'Cannot update user profile - invalid user identifier');\r\n }\r\n\r\n /*\r\n * The following parameters cannot be updated :\r\n * - email\r\n * - userid \r\n * - activationcode\r\n * - registrationdate\r\n */\r\n $values = array();\r\n foreach (array_values(array('username', 'givenname', 'lastname', 'groups', 'country', 'organization', 'topics', 'organizationcountry', 'flags')) as $field) {\r\n if (isset($profile[$field])) {\r\n switch ($field) {\r\n case 'password':\r\n $values[] = 'password=\\'' . RestoUtil::encrypt($profile['password']) . '\\'';\r\n break;\r\n case 'activated':\r\n $values[] = 'activated=' . $profile['activated'];\r\n break;\r\n default:\r\n $values[] = $field . '=\\'' . pg_escape_string($profile[$field]) . '\\'';\r\n }\r\n }\r\n }\r\n\r\n $results = array();\r\n if (count($values) > 0) {\r\n $results = $this->dbDriver->fetch($this->dbDriver->query('UPDATE usermanagement.users SET ' . join(',', $values) . ' WHERE email=\\'' . pg_escape_string(trim(strtolower($profile['email']))) . '\\' RETURNING userid'));\r\n }\r\n\r\n return count($results) === 1 ? $results[0]['userid'] : null;\r\n }", "public function update_profile(Request $data) {\n if (Auth::guest()) {\n redirect(url('/login'));\n } else {\n if (Auth::user()->id == $data->user_id) {\n // Get user \n $user = User::find($data->user_id);\n\n if (($data->username != $user->username) && (User::where('username', strtolower($data->username))->count() > 0)) {\n return redirect()->back();\n }\n\n if (($data->email != $user->email) && (User::where('email', strtolower($email))->count() > 0)) {\n return redirect()->back();\n }\n\n // Upload picture if needed\n if ($data->hasFile('profile_image')) {\n $upload_helper = new UploadHelper();\n $profile_image = $data->file('profile_image');\n $file_path = \"users/\" . $user->id . \"/profile-image\" . $profile_image->getClientOriginalExtension();\n $image_url = $upload_helper->upload_to_s3($profile_image, $file_path);\n $user->profile_image_url = $image_url;\n }\n\n $user->first_name = $data->first_name;\n $user->last_name = $data->last_name;\n $user->username = $data->username;\n $user->email = $data->email;\n $user->facebook_link = $data->facebook_link;\n $user->twitter_link = $data->twitter_link;\n $user->instagram_link = $data->instagram_link;\n $user->youtube_link = $data->youtube_link;\n $user->github_link = $data->github_link;\n $user->dribbble_link = $data->dribbble_link;\n $user->website_link = $data->website_link;\n\n $user->save();\n\n return redirect()->back();\n }\n }\n }", "public function updateProfile(array $data){\n $user = App_Auth::getInstance()->getIdentity();\n $data['id'] = $user->id;\n\n $this->save($data);\n }", "public function update()\n {\n //check login\n if(!$this->session->userdata('logged_in'))\n {\n redirect('users/login');\n }\n $this->user_model->update_user();\n\n //set message\n $this->session->set_flashdata('profile_updated', 'Profile updated.');\n //redirect page to profile\n redirect('profile'); \n }", "public function update_profile(Request $request) {\n //type can be: mobile/phone/email\n $type = $request->type;\n //this new value is already validated in javascript\n $new_value = $request->new_value;\n $user = User::find($request->user_id);\n //dd($user);\n switch ($type) {\n case 'mobile':\n $user->gsm = $new_value;\n break;\n case 'phone':\n $user->tel = $new_value;\n break;\n case 'email':\n $user->email = $new_value;\n break;\n }\n\n $user->save();\n return 'success';\n }", "function save_profile() {\n global $wpdb;\n\n // Get the current subscriber, fail if not found\n $user = $this->get_user_from_request(true);\n\n // Conatains the cleaned up user data to be saved\n $data = array();\n $data['id'] = $user->id;\n\n $options_profile = get_option('newsletter_profile', array());\n $options_main = get_option('newsletter_main', array());\n\n // Not an elegant interaction between modules but...\n $subscription_module = NewsletterSubscription::instance();\n\n if (!$this->is_email($_REQUEST['ne'])) {\n $user->alert = $this->options['profile_error'];\n return $user;\n }\n\n $email = $this->normalize_email(stripslashes($_REQUEST['ne']));\n $email_changed = ($email != $user->email);\n\n // If the email has been changed, check if it is available\n if ($email_changed) {\n $tmp = $this->get_user($email);\n if ($tmp != null && $tmp->id != $user->id) {\n // TODO: Move the label on profile setting panel\n $user->alert = $this->options['error'];\n return $user;\n }\n $data['status'] = Newsletter::STATUS_NOT_CONFIRMED;\n }\n\n // General data\n $data['email'] = $email;\n if (isset($_REQUEST['nn'])) {\n $data['name'] = $this->normalize_name(stripslashes($_REQUEST['nn']));\n if ($subscription_module->is_spam_text($data['name'])) {\n die();\n }\n }\n if (isset($_REQUEST['ns'])) {\n $data['surname'] = $this->normalize_name(stripslashes($_REQUEST['ns']));\n if ($subscription_module->is_spam_text($data['surname'])) {\n die();\n }\n }\n if ($options_profile['sex_status'] >= 1) {\n $data['sex'] = $_REQUEST['nx'][0];\n // Wrong data injection check\n if ($data['sex'] != 'm' && $data['sex'] != 'f' && $data['sex'] != 'n') {\n die('Wrong sex field');\n }\n }\n\n // Lists. If not list is present or there is no list to choose or all are unchecked.\n $nl = array();\n if (isset($_REQUEST['nl']) && is_array($_REQUEST['nl'])) {\n $nl = $_REQUEST['nl'];\n }\n\n // Every possible list shown in the profile must be processed\n $lists = $this->get_lists_for_profile();\n foreach ($lists as $list) {\n $field_name = 'list_' . $list->id;\n $data[$field_name] = in_array($list->id, $nl) ? 1 : 0;\n }\n\n // Profile\n for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {\n // Private fields cannot be changed by the subscriber\n if ($options_profile['profile_' . $i . '_status'] == 0) {\n continue;\n }\n $data['profile_' . $i] = stripslashes($_REQUEST['np' . $i]);\n }\n\n\n // Feed by Mail service is saved here\n $data = apply_filters('newsletter_profile_save', $data);\n\n if ($user->status == TNP_User::STATUS_NOT_CONFIRMED) {\n $data['status'] = TNP_User::STATUS_CONFIRMED;\n }\n\n $user = $this->save_user($data);\n $this->add_user_log($user, 'profile');\n\n // Send the activation again only if we use double opt-in, otherwise it has no meaning\n // TODO: Maybe define a specific email for that and not the activation email\n if ($email_changed && $subscription_module->is_double_optin()) {\n $subscription_module->send_activation_email($user);\n // TODO: Move this option on new profile configuration panel\n $alert = $this->options['profile_email_changed'];\n }\n\n if (isset($alert)) {\n $user->alert = $alert;\n } else {\n // TODO: Move this label on profile settings panel\n $user->alert = $this->options['saved'];\n }\n return $user;\n }", "public function actionUpdate() {\r\n\r\n //common view data\r\n $mainCategories = $this->mainCategories;\r\n $brands = $this->brands;\r\n \r\n $errors = [];\r\n $success = null;\r\n \r\n //check if the user is logged in and get User $user properties from the database\r\n $userID = $this->checkLogged();\r\n \r\n $user = new User;\r\n $user = $user->getUserById($userID);\r\n \r\n if(!$user) {\r\n $errors['firstname'][0] = 'Unable to find user. Please, try again later';\r\n } else {\r\n //user properties\r\n $firstname = $user->firstname;\r\n $lastname = $user->lastname;\r\n $email = $user->email;\r\n } \r\n \r\n //check if the form has been submitted\r\n if($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n \r\n $firstname = $this->test_input($_POST['firstname']);\r\n $lastname = $this->test_input($_POST['lastname']);\r\n $email = $this->test_input($_POST['email']);\r\n \r\n //create form model, validate it and if success - update user profile\r\n $model = new EditProfileForm($userID, $firstname, $lastname, $email);\r\n \r\n if(!$model->validate()) {\r\n $errors = $model->errors;\r\n } else {\r\n #!!!!!!!!!!!!!\r\n $success = $model->updateProfile() ? 'USER DATA SUCCESFULLY UPDATED': 'UNABLE TO UPDATE USER PROFILE. TRY AGAIN LATER';\r\n }\r\n }\r\n \r\n include_once ROOT . '/views/profile/update.php';\r\n }", "public function update(Request $request) {\n\n// if (!Auth::check()) {\n// return redirect('admin');\n// }\n $userInfo = Auth::user();\n $User = User::findOrFail($userInfo->id);\n\n\n\n // validate\n $validator = Validator::make($request->only(['name', 'email', 'mobile']), [\n 'name' => 'required',\n 'email' => 'required|unique:users,email,' . $userInfo->id,\n 'mobile' => 'sometimes|numeric|digits:8',\n ]);\n\n \n // validation failed \n if ($validator->fails()) {\n return redirect('admin/user/profile')\n ->withErrors($validator)->withInput();\n } else {\n\n $input = $request->only(['name', 'email', 'civilid', 'mobile']);\n\n\n $User->fill($input)->save();\n\n //logActivity\n LogActivity::addToLog('User - ' . $userInfo->username, 'updated profile');\n\n Session::flash('message', config('global.updatedRecords'));\n return redirect('admin/user/profile');\n }\n }", "public function update_user_profile( $user_id ) {\n\t\tif ( ! current_user_can( 'edit_user', $user_id ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! empty( $_POST['phone'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing\n\t\t\tupdate_user_meta( $user_id, 'phone', intval( $_POST['phone'] ) ); //phpcs:ignore WordPress.Security.NonceVerification.Missing\n\t\t}\n\t}", "private function __setProfileFormData() {\n\t\t$adminUser = $this->Auth->user();\n\n\t\t$this->request->data['User'] = $adminUser;\n\t\t$this->request->data['User']['old_email'] = $adminUser['email'];\n\n\t\t$dob = $adminUser['date_of_birth'];\n\t\tif (!is_null($dob) && ($dob !== '')) {\n\t\t\tlist($dobYear, $dobMonth, $dobDay) = explode('-', $dob);\n\t\t\t$formattedDob = sprintf('%s-%s-%s', $dobMonth, $dobDay, $dobYear);\n\t\t\t$this->request->data['User']['date_of_birth'] = $formattedDob;\n\t\t}\n\n\t\t$gender = $adminUser['gender'];\n\n\t\t$profileImg = Common::getUserThumb($adminUser['id'], $adminUser['type'], 'medium', 'user_pic');\n\n\t\t$superAdminStatus = __('No');\n\t\tif (intval($adminUser['type']) === User::ROLE_SUPER_ADMIN) {\n\t\t\t$superAdminStatus = __('Yes');\n\t\t}\n\n\t\t$timezoneList = $this->Timezone->get_timezone_list();\n\n\t\t// form details\n\t\t$formId = 'AdminProfileEditForm';\n\t\t$changePasswordFormId = 'AdminChangePasswordForm';\n\t\t$changePasswordFields = $this->__listAdminUserChangePasswordFormFields();\n\t\t$inputDefaults = array(\n\t\t\t'label' => false,\n\t\t\t'div' => false\n\t\t);\n\n\t\t// validation\n\t\t$modelName = 'User';\n\t\t$this->JQValidator->addValidation($modelName, $this->AdminChangePasswordForm->validate, $changePasswordFormId);\n\t\t$this->JQValidator->addValidation($modelName, $this->AdminProfileForm->validate, $formId);\n\n\t\t$title_for_layout = 'Edit Profile';\n\n\t\t$this->set(compact('title_for_layout', 'modelName', 'changePasswordFields', 'formId', 'changePasswordFormId', 'timezoneList', 'inputDefaults', 'gender', 'profileImg', 'superAdminStatus'));\n\t}", "function ajax_update_profile() {\n $_POST['nonce'] = empty($_POST['nonce']) ? '' : trim($_POST['nonce']);\n $member = wp_get_current_user();\n\n if( !wp_verify_nonce($_POST['nonce'], 'member_action') ) {\n die(json_encode(array(\n 'status' => 'fail',\n 'message' => '<div class=\"alert alert-danger\">'.__('<strong>Error:</strong> wrong data given.', 'tst').'</div>',\n )));\n } else if($member->user_email != $_POST['email'] && email_exists($_POST['email'])) {\n die(json_encode(array(\n 'status' => 'fail',\n 'message' => '<div class=\"alert alert-danger\">'.__('Email already exists!', 'tst').'</div>',\n )));\n } else {\n $params = array(\n 'ID' => $_POST['id'],\n 'user_email' => $_POST['email'],\n 'first_name' => $_POST['first_name'],\n 'last_name' => $_POST['last_name'],\n );\n if( !empty($_POST['pass']) )\n $params['user_pass'] = $_POST['pass'];\n\n $user_id = wp_update_user($params);\n if(is_wp_error($user_id)) {\n die(json_encode(array(\n 'status' => 'fail',\n 'message' => '<div class=\"alert alert-danger\">'.__('We are very sorry :( Some error occured while updating your profile.', 'tst').'</div>',\n )));\n } else {\n\n // Update another fields...\n update_user_meta($member->ID, 'description', htmlentities($_POST['bio'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_city', htmlentities($_POST['city'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_workplace', htmlentities(@$_POST['user_workplace'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_speciality', htmlentities($_POST['spec'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_professional', htmlentities($_POST['pro'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_contacts', htmlentities($_POST['user_contacts_text'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_website', htmlentities($_POST['user_website'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'twitter', htmlentities($_POST['twitter'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'facebook', htmlentities($_POST['facebook'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'vk', htmlentities($_POST['vk'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'googleplus', htmlentities($_POST['googleplus'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_skills', @$_POST['user_skills']);\n\n die(json_encode(array(\n 'status' => 'ok',\n 'message' => '<div class=\"alert alert-success\">'.sprintf(__('Your profile is successfully updated! <a href=\"%s\" class=\"alert-link\">View it</a>', 'tst'), tst_get_member_url($member)).'</div>',\n )));\n }\n }\n}", "function updateProfile($mysqli,$profile){\r\n $query = \"UPDATE `profiles` SET FirstName = '\".$profile->firstName.\"', LastName = '\".$profile->lastName.\"', Gender = '\".$profile->gender.\"', Birthday = '\".$profile->birthday.\"', Weight = '\".$profile->weight.\"', \r\n Height = '\".$profile->height.\"', Bio = '\".$profile->bio.\"', Prof_Pic_URL = '\".$profile->profPicURL.\"' WHERE UserID = \".$profile->userID;\r\n $mysqli->query($query);\r\n }", "function profile_update($user_id = null) {\n\t\t\tglobal $wpdb, $Db, $Subscriber;\n\t\t\t\n\t\t\tif (!empty($user_id)) {\t\t\t\n\t\t\t\tif ($newuserdata = $this -> userdata($user_id)) {\n\t\t\t\t\t$Db -> model = $Subscriber -> model;\n\t\t\t\t\t\n\t\t\t\t\tif ($subscriber = $Db -> find(array('user_id' => $user_id))) {\n\t\t\t\t\t\t$Db -> model = $Subscriber -> model;\n\t\t\t\t\t\t$Db -> save_field('email', $newuserdata -> user_email, array('id' => $subscriber -> id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "public function profileAction()\n {\n // Fetch the current logged in user. It's always present, since the firewall denies anonymous logins\n $user = $this->get('security.context')->getToken()->getUser();\n\n // Create form\n $form = $this->createForm(new UserType(), $user);\n $form->remove('username');\n\n// //@TODO We must make sure that the password fields are optional!\n// foreach ($form->get('password')->getChildren() as $item) {\n// $item->setRequired(true);\n// }\n\n $request = $this->getRequest();\n if ($request->getMethod() == 'POST') {\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $factory = $this->get('security.encoder_factory');\n $encoder = $factory->getEncoder($user);\n $password = $encoder->encodePassword($user->getPassword(), $user->getSalt());\n $user->setPassword($password);\n\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($user);\n $em->flush();\n\n $this->get('session')->setFlash('notice', 'Your profile has been updated!');\n\n // Redirect - This is important to prevent users re-posting\n // the form if they refresh the page\n return $this->redirect($this->generateUrl('WygUserBundle_user_profile'));\n }\n }\n\n return $this->render('WygUserBundle:User:form.html.twig', array(\n 'form' => $form->createView(),\n 'user' => $user,\n 'mode' => 'edit',\n ));\n }", "function updateProfile()\n\t\t{\n\t \t$pass = \"\";\n\t\t \tif(strlen($this->updProfile['password'])){\n\t\t\t\t$pass=\", password ='\".$this->updProfile['password'].\"'\";\n\t\t \t} \n\t\t \n\t\t\t$query = \"UPDATE tbl_member SET first_name='\".$this->updProfile['firstName'].\"',\n\t\t last_name = '\".$this->updProfile['lastName'].\"',\n\t\t email = '\".$this->updProfile['email'].\"',\n\t\t user_name = '\".$this->updProfile['UserName'].\"'{$pass}\n\t\t WHERE member_id = '\".$this->updProfile['ID'].\"'\";\n\t\t \n\t\t\t$this->Execute($query);\n\t\t \n\t\t\t$query = \"UPDATE tbl_subscriber \n\t\t\tSET mail_street_address ='\".$this->updProfile['streetAddress'].\"',\n\t\t mail_city='\".$this->updProfile['City'].\"',\n\t\t bill_street_address ='\".$this->updProfile['billingAddress'].\"' ,\n\t\t bill_city ='\".$this->updProfile['billCity'].\"',\n\t\t mail_state ='\".$this->updProfile['state'].\"',\n\t\t mail_zip_code ='\".$this->updProfile['zipCode'].\"',\n\t\t bill_state ='\".$this->updProfile['billState'].\"',\n\t\t bill_zip_code ='\".$this->updProfile['billZipCode'].\"',\n\t\t is_address_changed ='\".$this->updProfile['is_address_changed'].\"',\n\t\t secondary_affiliates ='\".$this->updProfile['secondary_afflliates'].\"'\n\t\t \n\t\t WHERE subscriber_id = '\".$this->updProfile['ID'].\"'\";\n\t\t \n\t\t return $this->Execute($query);\n\t\t //return $this->_getPageArray($rs, 'Subscriber');*/\n\t\t}", "public function update_profile($username,$email,$surname,$finame,$status,$address,$state,$dob){\r\n $update_profile = \"UPDATE student_registration SET username='$username', email='$email', surname='$surname', firstname='$finame', status='$status', address='$address', state='$state', dob='$dob' WHERE email='$email'\";\r\n $update_query = $this->conn->query($update_profile);\r\n if($update_query){\r\n echo \"<script>\r\n alert('Your profile has been updated successfully');\r\n window.location = 'my_profile.php';\r\n </script>\";\r\n }\r\n \r\n }", "function oid_update_user($user, $sreg)\n{\n $profile = $user->getProfile();\n\n $orig_profile = clone($profile);\n\n if (!empty($sreg['fullname']) && strlen($sreg['fullname']) <= 255) {\n $profile->fullname = $sreg['fullname'];\n }\n\n if (!empty($sreg['country'])) {\n if ($sreg['postcode']) {\n // XXX: use postcode to get city and region\n // XXX: also, store postcode somewhere -- it's valuable!\n $profile->location = $sreg['postcode'] . ', ' . $sreg['country'];\n } else {\n $profile->location = $sreg['country'];\n }\n }\n\n // XXX save language if it's passed\n // XXX save timezone if it's passed\n\n if (!$profile->update($orig_profile)) {\n // TRANS: OpenID plugin server error.\n common_server_error(_m('Error saving the profile.'));\n return false;\n }\n\n $orig_user = clone($user);\n\n if (!empty($sreg['email']) && Validate::email($sreg['email'], common_config('email', 'check_domain'))) {\n $user->email = $sreg['email'];\n }\n\n if (!$user->update($orig_user)) {\n // TRANS: OpenID plugin server error.\n common_server_error(_m('Error saving the user.'));\n return false;\n }\n\n return true;\n}", "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "public function updateProfile(UserModel $user)\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->updateProfile($user);\n }", "public function postProfile(Request $request)\n {\n \t$user = Auth::user(); \n\n \t$id = $user->id; \n\n \t// dd($request->all());\n\n \t// post updates to this user profile \n \t$rules = [\n\n \t\t'name' => 'required|max:255',\n 'email' => 'required|unique:users,email,'.$id,\n 'password' => 'sometimes|confirmed',\n\n \t]; \n\n \t$this->validate($request, $rules); \n\n \t$user->username = $request->name;\n $user->first_name = $request->first_name;\n $user->last_name = $request->last_name;\n $user->email = $request->email;\n if(!empty($request->password)){\n\n \t$user->password = crypt($request->password, '');\n \t\n }\n $user->country = $request->country;\n $user->city = $request->city;\n $user->street = $request->street;\n $user->mobile_number = $request->mobile_number;\n $user->user_type = 0;\n\n $user->save(); \n\n session()->flash('message','Profile has been updated successfully');\n\n return back(); \n\n\n \n }", "public function updateProfile(Request $request, UserAccount $userAccount)\n {\n $userInfo = UserAccount::find($request->get('uIdx'));\n\n if ($request->get('password') != '') {\n // Validate for request\n $validatedData = $request->validate([\n 'password' => ['required'],\n ]);\n \n $userInfo->password = Hash::make($request->get('password'));\n }\n\n $validatedData = $request->validate([\n 'uEmail' => ['required', 'max:250'],\n 'uFirstName' => ['required'],\n 'uLastName' => ['required'],\n ]);\n \n $userInfo->uFirstName = $request->get('uFirstName');\n $userInfo->uLastName = $request->get('uLastName');\n $userInfo->contactNum = $request->get('contactNum');\n \n // Update to DB\n $userInfo->save();\n\n return response()->json(['success'=>'Update Profile']);\n }", "public function profile_update(ProfileRequest $request)\n {\n if ($request->email != auth()->user()->email) {\n $user = User::whereEmail($request->email)->get();\n if (!empty($user)) {\n alert('El email ingresado ya existe', 'danger');\n return redirect()->back();\n }\n }\n\n $state = State::findOrFail($request->state);\n\n $user = auth()->user();\n $user->state()->associate($state);\n $user->update($request->all());\n\n alert('Se modificaron los datos con éxito');\n return redirect()->back();\n }", "public function complete_profile(Request $request, $user)\n {\n $data = $request->all();\n $data['password'] = Hash::make($data['password']);\n\n try {\n $update = user()->update($data);\n $return = $update\n ? array(\n 'error' => false,\n 'message' => 'Successfully updated your account ',\n 'data' => $user,\n )\n : array(\n 'error' => true,\n 'message' => 'Failed to update user account ',\n );\n } catch (\\Exception $e) {\n $return = array(\n 'error' => true,\n 'message' => $e->getMessage(),\n );\n }\n\n return $return;\n }", "public function profileEdit($username, $withPassword = false,Request $request){\n\n $userManager = new UserManager();\n $securityHelper = new SH();\n\n $profileUser = $userManager->findByUsername($username);\n $loggedUser = $securityHelper->getUser($request);\n \n if (!$profileUser){\n route('fourofour','This user does not exist');\n }\n elseif (!$loggedUser){\n SH::forbid();\n }\n elseif($loggedUser->getUsername() != $profileUser->getUsername()){\n SH::forbid();\n }\n\n $skillManager = new SkillManager();\n $latestActivity = $skillManager->getLatestActivity($profileUser);\n\n $uploadErrors = false; \n $errors = false;\n //profile form submitted\n if (!empty($_POST) && $loggedUser){\n\n $newUsername = $_POST['username'];\n $newEmail = $_POST['email'];\n $bio = $_POST['bio'];\n $interests = $_POST['interests'];\n $languages = $_POST['languages'];\n $country = $_POST['country'];\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validateUsername($newUsername);\n //changing username ?\n if ($newUsername != $loggedUser->getUsername()){\n $validator->validateUniqueUsername($newUsername);\n }\n $validator->validateEmail($newEmail);\n //changing email ?\n if ($newEmail != $loggedUser->getEmail()){\n $validator->validateUniqueEmail($newEmail);\n }\n\n if ($validator->isValid()){\n\n //hydrate user obj\n $user = $securityHelper->getUser($request);\n\n $user->setUsername( $newUsername );\n $user->setEmail( $newEmail );\n $user->setInterests( $interests );\n $user->setLanguages( $languages );\n $user->setCountry( $country );\n $user->setBio( $bio );\n\n\n /*\n * @TODO: Add profile picture\n */\n// if (!empty($_FILES['picture']['tmp_name'])){\n//\n// $errCode = $_FILES['picture']['error'];\n//\n// if ($errCode != 4){\n// if ($errCode == 1 || $errCode == 2){\n// $uploadErrors[] = _(\"Your picture is too large!\");\n// }\n// else if ($errCode == 3){\n// $uploadErrors[] = _(\"An error occured while uploading your picture!\");\n// }\n//\n// //HANDLE UPLOAD\n// $tmp_name = $_FILES['picture']['tmp_name'];\n//\n// $finfo = finfo_open(FILEINFO_MIME_TYPE);\n// $mime = finfo_file($finfo, $tmp_name);\n//\n// if (substr($mime, 0, 5) != \"image\"){\n// $uploadErrors[] = _(\"Your picture is invalid!\");\n// }\n// else {\n// $img = new \\abeautifulsite\\SimpleImage($tmp_name);\n// if ($img->get_width() < 180 || $img->get_height() < 180){\n// $uploadErrors[] = _(\"Your picture is too small!\");\n// }\n// }\n//\n// if (empty($uploadErrors)){\n// $filename = uniqid() . \".jpg\";\n// $img->thumbnail(180,180)->save(\"img/uploads/\" . $filename, 100); //quality as second param\n// $user->setPicture( $filename );\n// }\n// }\n// }\n\n $userManager->update($user);\n $securityHelper->putUserDataInSession($request, $user);\n return view('profile',['username'=> $user->getUsername()]);\n// Router::redirect( Router::url('viewProfile', array('username' => $user->getUsername())) );\n }\n else {\n $errors = $validator->getErrors();\n }\n }\n\n $params = array();\n $params['errors'] = $errors;\n $params['uploadErrors'] = $uploadErrors;\n $params['latestActivity'] = $latestActivity;\n\n if ($withPassword){ $params['showPasswordResetForm'] = true; }\n $params['profileUser'] = $profileUser;\n\n $usernameEncoded = SH::encode($username);\n $params['title'] = sprintf(_(\"%s's Profile\"), $usernameEncoded);\n\n //csrf token for delete account link\n// $params['csrfToken'] = SH::setNewCsrfToken();\n\n return view('pages.profile', ['params'=> $params]);\n// $view = new View(\"profile.php\", $params);\n//\n// $view->send();\n\n }", "public function update_profile_of_the_user(Request $request)\n\t{\t\n\t\t// the id of the user\n\t\t$id = request()->input('form.id');\n\n\t\t$user = User::where('id',$id)->pluck('password');\n\t\t$logged_on_users_password = $user[0];\n\t\t$password = request()->input('form.password');\n\t\t$confirm_password = request()->input('form.confirm_password');\n\n\t\tif (is_null($password) || is_null($confirm_password)) {\n\t\t\treturn response()->json(['error' => 'Then no need to setup'], 401);\n\t\t}\n\n\t\t/*if the two passwords don't match then issue a response*/\n\t\tif ( $password != $confirm_password) {\n\t\t\treturn response()->json(['error' => 'Your Passwords do not match, try to fix it out'], 401);\n\t\t}\n\t\t// if the passwords match \n\t\telse { \n\t\t\tif(Hash::check($password, $logged_on_users_password)) {\n\t\t\t\treturn response()->json(['error' => 'Try using a different password since you have the same inputted password'], 401);\n\t\t\t} else { \n\t\t\t\t$validator = Validator::make($request->input('form'), [\n\t\t\t\t\t'display_name' => 'required|min:3|max:100',\n\t\t\t\t\t'username' => 'required|unique:users|min:4|max:15',\n\t\t\t\t\t'email' \t => 'required|email|unique:users',\n\t\t\t\t\t'phone_number' => 'required|min:3',\n\t\t\t\t\t'password' \t => 'min:6',\n\t\t\t\t\t'country_id' => 'required|integer',\n\t\t\t\t\t'avatar' => 'required'\n\t\t\t\t]);\n\n\t\t\t\tif(request()->input('form.avatar')){\n\t\t\t\t\t$image = request()->input('form.avatar');\n\t\t\t\t\t$photo = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\t\\Image::make(request()->input('form.avatar'))->resize(100,100)->save(public_path('avatars\\users').$photo);\n\n\t\t\t\t}\n\n\t\t\t// return response(request()->all());\n\n\t\t\t\t$user = User::findOrFail($id)->update([\n\t\t\t\t\t'username' => request()->input('form.username'),\n\t\t\t\t\t'email' => request()->input('form.email'),\n\t\t\t\t\t'display_name' => request()->input('form.display_name'),\n\t\t\t\t\t'password' => bcrypt($password),\n\t\t\t\t\t'phone_number' => request()->input('form.phone_number'),\n\t\t\t\t\t'country_id' => intval(request()->input('form.country_id')),\n\t\t\t\t\t'avatar' => $photo,\n\t\t\t\t]);\n\n\t\t\t\treturn response()->json(['success' => 'You have successfully updated your profile'], 200);\t\n\t\t\t}\n\t\t/*\telse { \n\t\t\t\treturn response()->json(['error' => 'Your Password is incorrect and does not match with the current logged on user, try to fix it out'], 401);\n\t\t\t}*/\n\t\t}\n\t\t/*}*/\n\t}", "public function editprofile_action()\n {\n Auth::checkAuthentication();\n \n \n $postname = Request::post('user_name');\n $postemail = Request::post('user_email');\n $postbio = Request::post('user_bio');\n\n\n if(Session::get('user_name') != $postname && $postname != null)\n {\n UserModel::editUserName($postname);\n }\n \n if(Session::get('user_email') != $postemail && $postemail != null)\n {\n UserModel::editUserEmail($postemail);\n }\n \n //null is checked in this method\n AvatarModel::createAvatar();\n \n if(Session::get('user_bio') != $postbio && $postbio != null)\n {\n UserModel::editBio($postbio);\n }\n\n return true;\n }", "public function updated(User $user)\n {\n Userprofile::create([\n 'users_id' => $user->id,\n 'address' => 'Your Address',\n 'phone_number' => 'Your Number',\n 'city' => 'Your City',\n 'country' => 'Your Country',\n 'body' => 'Something About Yourself',\n 'user_img' => 'Your image here'\n ]);\n }", "public function updateProfile(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'dob' => 'required|date',\n 'gender' => 'required | in:' . strtolower(implode(',', array_diff(UserProfileRepository::getUserGender(), [0 => \"--Select Gender--\"]))),\n 'nationality' => 'required',\n 'street_address' => 'required',\n 'city' => 'required',\n 'state' => 'required',\n 'zip' => 'required',\n 'country' => 'required',\n 'bio' => 'required'\n ]);\n\n if ($validator->fails()) {\n $this->updateRequestStatus(RequestStatusEnum::DATA_VALIDATION_ERROR);\n return $this->sendResponse($validator->failed());\n }\n $managerProfile = ManagerProfile::where('user_id', '=', session(SiteSessions::USER_ID))->first();\n $managerProfile->UpdateManagerProfile($request);\n return $this->sendResponse($managerProfile->toArray());\n }", "public function update(Request $request, $user_id)\n {\n if (auth()->user()->id == $user_id || auth()->user()->role == 'admin') {\n $profile = User::find($user_id)->profile;\n $profile->update([\n 'name' => $request->get('name'),\n 'surname' => $request->get('surname'),\n 'patronymic' => $request->get('patronymic'),\n 'is_male' => $request->get('is_male') != null ? intval($request->get('is_male')) : null,\n 'date_of_birth' => $request->get('date_of_birth')\n ]);\n\n return response()->json([\n 'profile' => $profile,\n 'message' => 'You have updated your profile'\n ], 200);\n } else {\n return response()->json([\n 'message_error' => 'Forbidden Error'\n ], 403);\n }\n }", "public function p_profile_edit() {\n $duplicate = DB::instance(DB_NAME)->select_field(\"SELECT email FROM users WHERE email = '\" . $_POST['email'] . \"' AND email != '\" . $this->user->email . \"'\");\n\n //If email already exists \n if($duplicate){ \n \n //Redirect to error page \n Router::redirect('/users/profile/?duplicate=true');\n }\n\n\n // Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n // Create an encrypted token via their email address and a random string\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n $q = \"UPDATE users\n SET first_name = '\".$_REQUEST['first_name'].\"',\n last_name = '\".$_REQUEST['last_name'].\"',\n email = '\".$_REQUEST['email'].\"'\n WHERE id = '\".$this->user->id.\"'\";\n\n DB::instance(DB_NAME)->query($q);\n Router::redirect(\"/users/profile\");\n\n \n }", "public function Save() {\n $this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n $this->session->SetAuthenticatedUser($this->profile);\n return $this->db->RowCount() === 1;\n }", "public function postEdit()\n {\n // If we are not authentified, redirect to the login page.\n if(Auth::guest()) return Redirect::action('frontend\\UserController@getLogin');\n\n $loggedUser = Auth::user();\n\n $user = API::put('api/v1/user/' . $loggedUser->id, Input::all());\n\n // If the API throws a ValidationException $user will be a JSON string with our errors.\n if(is_string($user)) {\n $errors = json_decode($user, true);\n return Redirect::action('frontend\\UserController@getIndex')\n ->withErrors($errors);\n } else {\n return Redirect::action('frontend\\UserController@getIndex')\n ->with('success', 'Profile edited!');\n }\n }", "function profileUpdated($user_id, $old_user_data) {\n \tif(isSet($_POST)) {\n \t\t$user_data = get_userdata($user_id);\n\t\t\t$first_name = $user_data->first_name;\n\t\t\t$last_name = $user_data->last_name;\n\t\t\t$email = $user_data->user_email;\n\t\t\tif(!empty($email) && (!empty($first_name) || !empty($last_name))) {\n\t\t\t\t$courses = $this->subscriptions->getApproved();\n\n\t\t\t\t//Send out update info to all the subscribed courses - teacher blog database update.\n\t\t\t\tforeach($courses as $course) {\n\t\t\t\t\t$studentRequest = new LePressRequest(2, 'profileUpdated');\n\t\t\t\t\t$studentRequest->addParams(array('first_name' => $first_name, 'last_name' => $last_name, 'new_email' => $email, 'old_email' => $old_user_data->user_email, 'accept-key' => $course->accept_key));\n\t\t\t\t\t$studentRequest->doPost($course->course_url, false); //Do request without blocking\n\t\t\t\t\t//Keeping fingers crossed that request is successful\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "public function updateProfile(Request $request) {\n\n $user = auth('api')->user();\n\n $this->validate($request, [\n 'nickname' => 'required|string|max:191',\n 'email' => 'required|string|email|max:191|ends_with:rsudcibinong.com|unique:users,email,'.$user->id,\n 'password' => 'sometimes|required|min:6|confirmed',\n 'role' => 'sometimes',\n ]);\n\n // $currentPhoto = $user->photo;\n // if($request->photo != $currentPhoto){\n\n // $name = time().'.' . explode('/', explode(':', substr($request->photo, 0, strpos($request->photo, ';')))[1])[1];\n\n // \\Image::make($request->photo)->fit(1000, 1400)->save(public_path('img/avatar/').$name);\n // $request->merge(['photo' => $name]);\n\n // $userPhoto = public_path('img/avatar/').$currentPhoto;\n // if(file_exists($userPhoto) && $currentPhoto !=\"avatar.png\"){\n // @unlink($userPhoto);\n // }\n // }\n\n if(!empty($request->password)){\n $request->merge(['password' => Hash::make($request ['password'])]);\n }\n\n // $user->update($request->has('password') ? array_merge($request->except('password'), ['password' => bcrypt($request->input('password'))]) : $request->except('password'));\n $user->update($request->all());\n return ['message' => \"success\"];\n // return Redirect::route('/home');\n\n }", "public function updateUser( UserDataInf $user )\n {\n \n $userName = $user->getName();\n \n $userId = $this->getUserId( $userName );\n $passwd = Password::passwordHash( $user->getPasswd() );\n \n $sqlUser = <<<SQL\nUPDATE wbfsys_role_user\nSET\n name = '{$userName}', \n inactive = FALSE, \n non_cert_login = TRUE,\n profile = '{$user->getProfile()}',\n level = '{$user->getLevel()}',\n password = '{$passwd}'\nWHERE rowid = {$userId}\n;\nSQL;\n \n $this->db->update( $sqlUser );\n \n $personId = $this->db->select( 'SELECT id_person from wbfsys_role_user where rowid = '.$userId );\n \n \n $sqlPerson = <<<SQL\nUPDATE core_person\nSET\nfirstname = '{$user->getFirstname()}', \nlastname = '{$user->getLastname()}'\nWHERE rowid = {$personId};\nSQL;\n\n $this->db->update( $sqlPerson );\n \n }", "public function updateprofile(Request $request)\n{\n\n \n //VALIDATE INPUT FIELDS\n $this->validate($request, [\n 'name' => 'sometimes|required',\n 'email' => 'sometimes|required|email',\n 'phone' => 'nullable',\n 'city' => 'nullable',\n 'image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n 'state' => 'nullable',\n 'country' => 'nullable',\n 'zip' => 'nullable',\n // 'status'=>'required'\n ]);\n\n\n //find user\n $user = User::find(\\Auth::user()->id);\n\n //CHECK IF USER IMAGE INOUT IS NOT NULL AND UPLOAD IMAGE\n if($request->image != null){\n\n $profileImage = Str::slug($request['name'], '-'). '.' . $request->image->getClientOriginalExtension();\n\n $destinationPath = public_path('/app/images/avatars/');\n\n $resizeImage = Image::make($request->image->getRealPath());\n\n $resizeImage->resize(150, 150, function($constraint){\n\n $constraint->aspectRatio();\n\n })->save($destinationPath . '/' . $profileImage);\n\n\n //UPDATE USER DETAILS\n $user->name = $request->name;\n $user->email = $request->email;\n // $user->status = \\Auth::user()->status;\n $user->image = $profileImage;\n\n }else{\n\n $user->name = $request->name;\n // $user->status = $request->status;\n $user->email = $request->email;\n }\n \n\n if($user->save()){\n\n $address = Address::find($user->id);\n\n if($address != null){\n $address->phone = $request->phone;\n $address->country = $request->country;\n $address->state = $request->state;\n $address->city = $request->city;\n $address->zip = $request->zip;\n $address->save();\n\n }else{\n $address = new Address();\n\n $address->phone = $request->phone;\n $address->country = $request->country;\n $address->state = $request->state;\n $address->city = $request->city;\n $address->zip = $request->zip;\n $address->user_id = $user->id;\n $address->save();\n }\n \n \n\n //REDIRECT USER BACK WITH SUCCESS MESSAGE\n return redirect()->back()->with('success','User profile updated successfully');\n }\n\n //REDIRECT USER BACK WITH ERROR MESSAGE\n return redirect()->back()->with('error','An Error please try again');\n\n}", "public function update(UpdateProfileRequest $request)\n {\n $this->bcryptPassword($request);\n\n auth()->user()->update($request->all());\n\n return back()->withSuccess(trans('account::messages.profile_updated'));\n }", "public function profile_update(Request $request)\n {\n if(Setting::get('demo_mode', 0) == 1) {\n return back()->with('flash_error', 'Disabled for demo purposes! Please contact us at [email protected]');\n }\n\n $this->validate($request,[\n 'name' => 'required|max:255',\n 'mobile' => 'required|digits_between:6,13',\n ]);\n\n try{\n $account = Auth::guard('account')->user();\n $account->name = $request->name;\n $account->mobile = $request->mobile;\n $account->save();\n\n return redirect()->back()->with('flash_success','Profile Updated');\n }\n\n catch (Exception $e) {\n return back()->with('flash_error','Something Went Wrong!');\n }\n \n }", "public function update(UpdateProfileRequest $request)\n {\n // Update user profile\n // FIXME\n // Kada se pravi profil moze da se napravi sa space-om\n auth()->user()->update(request(['username', 'email']));\n\n session()->flash('flash_success', 'Uspesno izmenjen profil');\n\n return redirect()->route('user.index')->with('user', auth()->user());\n }", "public function updateProfile(Request $request)\n {\n $data = $request->only([\n 'name',\n 'username',\n 'phone',\n 'userId',\n 'avatar'\n ]);\n\n DB::beginTransaction();\n try {\n $result = $this->userService->updateUserProfileService($data);\n } catch (Exception $e) {\n DB::rollback();\n return $this->sendError($e->getMessage());\n }\n DB::commit();\n return $this->sendResponse(null, $result);\n }", "public function UpdateProfile(\n\t\t$id, $_nick, $_phone, $_age, $_address\n\t) {\n //Get Database\n $_database = $this->ConnectDatabase();\n //Create Data\n $_data = array($_nick, $_phone, $_age, $_address, $id);\n //Call and return Database Function\n return $this->CallDatabase(\n\t\t\t$_database, $_data, function($_pdo, $_parameters) {\n\t\t\t\t$set = \"\n\t\t\t\t\tnick_name = ?,\n\t\t\t\t\tphone = ?, \n\t\t\t\t\tage = ?,\n\t\t\t\t\thome_address = ?\n\t\t\t\t\";\n\t\t\t\t//Create Query\n\t\t\t\t$_query = $_pdo->prepare(\"\n\t\t\t\t\tUPDATE `Users`\n\t\t\t\t\tSET \" . $set . \"\n\t\t\t\t\tWHERE id = ?\n\t\t\t\t\");\n\t\t\t\t//Execute Query\n\t\t\t\t$_query->execute($_parameters);\n\t\t\t\t//Tratamento da resposta\n\t\t\t\tif (is_null($_query->errorInfo())) {\n\t\t\t\t\t$this->_response[\"status\"] = false;\n\t\t\t\t\t$this->_response[\"error\"] = $_query->errorInfo();\n\t\t\t\t} else {\n\t\t\t\t\t$this->_response[\"status\"] = true;\n\t\t\t\t}\n\t\t\t\treturn $this->_response;\n\t\t\t}\n );\n\t}", "public function updateProfile($data)\n {\n $this->name = $data['name'];\n $this->email = $data['email'];\n\n //Solo valida y actualiza el password si fue solicitado\n if ($data['password'] != '') {\n $this->password = $data['password'];\n }\n \n\n $this->validate();\n \n //Si no hay errores de validación actualiza la DB\n if (empty($this->errors)) {\n \n $sql = 'UPDATE users\n SET name = :name,\n email = :email';\n\n //Agrega el password si está seteado\n if (isset($this->password)) {\n $sql .= ', password_hash = :password_hash';\n }\n\n\n $sql .= \"\\nWHERE id = :id\";\n\n $db = static::getDB();\n $stmt = $db->prepare($sql);\n\n $stmt->bindValue(':name', $this->name, PDO::PARAM_STR);\n $stmt->bindValue(':email', $this->email, PDO::PARAM_STR);\n $stmt->bindValue(':id', $this->id, PDO::PARAM_INT);\n\n if (isset($this->password)) {\n $password_hash = password_hash($this->password, PASSWORD_DEFAULT);\n $stmt->bindValue(':password_hash', $password_hash, PDO::PARAM_STR);\n }\n\n return $stmt->execute();\n\n }\n //Si hay errores de validacion\n return false;\n }", "public function updateUser(Request $request) {\n\n \tif(User::where('email', $request['email'])->where('id', '!=', $request['id'])->count() > 0) {\n \t\tSession::flash('error', 'Email Already Exists.');\n \t\treturn redirect()->back();\n \t} else if(User::where('username', $request['username'])->where('id', '!=', $request['id'])->count() > 0) {\n \t\tSession::flash('error', 'Username Already Exists.');\n \t\treturn redirect()->back();\n \t} else {\n\t \tif($request['profile']) {\n\t \t\t$file = $request->file('profile');\n\t \t\t$image = User::uploadProfile($file);\n\t \t\tUser::where('id', $request['id'])->update([ 'profile' => $image ]);\n\t \t}\n\t \t\n\t \tUser::where('id', $request['id'])->update([ 'name' => $request['name'], 'email' => $request['email'], 'username' => $request['username'], 'type' => $request['type'] ]);\n\n\t \tSession::flash('success', 'User Updated Successfully.');\n \t\treturn redirect()->back();\n\t }\n }", "public function update(UserProfileRequest $request)\n {\n\n auth()->user()->name = $request->name;\n\n if ($request->filled('old-password')) {\n\n if (!Hash::check($request->get('old-password'), auth()->user()->getAuthPassword())) {\n return response()->json(['errors' => ['A senha atual informada é inválida']], 400);\n }\n\n auth()->user()->password = bcrypt($request->get('new-password'));\n auth()->user()->save();\n }\n\n if ($request->has('avatar')) {\n $this->saveAvatar($request);\n }\n\n\n return response()->json(['message' => 'Perfil atualizado']);\n }", "public function profileAction()\n {\n //Get session info\n $auth = $this->session->get('auth');\n\n //Query the active user\n $user = Users::findFirst($auth['id']);\n if ($user == false) {\n $this->_forward('index/index');\n }\n\n $request = $this->request;\n\n if (!$request->isPost()) {\n Tag::setDefault('name', $user->name);\n Tag::setDefault('email', $user->email);\n } else {\n\t //1)get all the input fields\n\t //2) if password fields are empty then do normal saving stuff\n\t //3)if password fields are not empty then match it with the database, then check the new password and retyped password fields. the save everything\n $name = $request->getPost('name', 'string');\n $email = $request->getPost('email', 'email');\n\t $currentPassword= $request->getPost('password');\n $newPassword= $request->getPost('newpassword');\n\t $repeatPassword= $request->getPost('repeatpassword');\n\t if ($currentPassword=='' && $newPassword=='' && $repeatPassword==''){\n\t\t$name = strip_tags($name);\n \t$user->name = $name;\n \t$user->email = $email;\n\t\tif ($user->save() == false) {\n \tforeach ($user->getMessages() as $message) {\n \t$this->flash->error((string) $message);\n\t }\n\t\t} else {\n $this->flash->success('Your profile information was updated successfully');\n }\t\t\n\t }else {\n\t\tif (sha1($currentPassword) != $user-> password){\n\t\t\t $this->flash->error(\"The current password is wrong\" );\n\t\t}else{ \n\t\t\tif ($newPassword != $repeatPassword){\n\t\t\t\t$this->flash->error('The new password does not match with retyped password');\n\t\t\t}elseif ($newPassword=='' && $repeatPassword==''){\n\t\t\t\t$this->flash->error('New password should not be empty');\n\t\t\t}elseif (strlen($newPassword) < 8 ){\n\t\t\t\t$this->flash->error('New password length should be not less than 8 characters');\n\t\t\t}else{\n\t\t\t\t$name = strip_tags($name);\n \t\t\t$user->name = $name;\n \t\t\t$user->email = $email;\n\t\t\t\t$user->password= sha1($newPassword);\n\t\t\t\tif ($user->save() == false) {\n \t\t\tforeach ($user->getMessages() as $message) {\n \t\t\t\t$this->flash->error((string) $message);\n \t\t\t}\n \t\t\t} else {\n \t\t\t$this->flash->success('Your profile information/password was updated successfully');\n \t\t\t }\n }\n\t\t}\n\t \n\t }\n\n }\n }", "public function saveProfile()\n\t{\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = trim($_REQUEST['username']);\n\t\t\t$fbuid = $this->getFBUID();\n\t\t\tif (isset($_POST['sub_clear'])) { $username = ''; }\n\t\t\tif ($username) {\n\t\t\t\t$result = $this->db->exec(\"INSERT IGNORE INTO selective_status_users (fbuid, twitterid) VALUES (\" . $this->db->quote($fbuid) . \", \" . $this->db->quote($username) . \");\");\n\t\t\t}\n\t\t\t$result = $this->db->exec(\"UPDATE selective_status_users SET twitterid = \" . $this->db->quote($username) . \", is_page = 0 WHERE fbuid = \" . $this->db->quote($fbuid) . \" LIMIT 1\");\n\t\t\treturn true;\n\t\t}\n\t}", "public function load_profile() { \n\n $this->form_validation->set_rules('firstName', 'First Name', 'required|trim|max_length[30]|xss_clean');\n $this->form_validation->set_rules('lastName', 'Last Name', 'required|trim|max_length[30]|xss_clean');\n $this->form_validation->set_rules('mobile', 'Mobile', 'required|trim|min_length[10]|max_length[10]|numeric|xss_clean');\n\n if($this->form_validation->run() == false) {\n $data['title']= \"User Profile\";\n $this->load->view('template/header');\n $this->load->view('profile');\n $this->load->view('template/footer');\n }\n else \n {\n $data = array(\n\t\t\t\t'firstName'\t\t\t=>\t$this->input->post('firstName', TRUE),\n\t\t\t\t'lastName'\t\t\t=>\t$this->input->post('lastName', TRUE),\n\t\t\t\t'mobile'\t\t\t=> \t$this->input->post('mobile', TRUE)\n );\n $result = $this->user_model->update_profile($this->session->userdata('id'), $data);\n if($result > 0)\n {\n $this->session->set_userdata($data);\n $this->session->set_flashdata('success', 'Your profile has been updated');\n return redirect('profile');\n }\n else\n {\n $this->session->set_flashdata('error', 'Your profile update was unsuccessful');\n return redirect('profile');\n \n }\n }\n \n }", "public function update(Request $request, User $user)\n {\n // dd($request);\n // dd($request->name);\n\t\t// Validate a Unique Key Allowing the Update\n\t\t$this->validate(request(),[\n\t\t\t'name' => 'required|min:3' ,\n\t\t\t// 'language_code' => 'required|min:2|exists:languagecodes,languagecode' ,\n\t\t\t// 'country_code' => 'required|min:3|exists:countrycodes,ccn3' ,\n\t\t\t'email' => 'required|min:3|email',\n\t\t\t]);\n \n $user->update($request->all());\n $this->profileUpdate($user,['created_by' => $user->profile->created_by]);\n\n return back()->with('success', 'User Updated');\n }", "function updateProfile($name, $phone, $email, $username, $userid) {\n $query = \"UPDATE users_account SET fullname = ?,mobileno = ?,email = ?,username WHERE userid = ?\";\n $paramType = \"ssssi\";\n $paramValue = array(\n $name,\n $phone,\n $email,\n $username,\n $userid\n );\n \n $this->db_handle->update($query, $paramType, $paramValue);\n }", "public function testUpdateValidUser() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"user\");\n\n\t\t// create a new user and insert to into mySQL\n\t\t$user = new User(null, $this->VALID_SALT, $this->VALID_HASH, $this->VALID_EMAIL, $this->VALID_NAME);\n\t\t$user->insert($this->getPDO());\n\n\t\t// edit the user and update it in mySQL\n\t\t$user->setHash($this->VALID_HASH);\n\t\t$user->update($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoUser = User::getUserByUserId($this->getPDO(), $user->getUserId());\n\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"user\"));\n\t\t$this->assertLessThan($pdoUser->getUserId(), 0);\n\t\t$this->assertSame($pdoUser->getSalt(), $this->VALID_SALT);\n\t\t$this->assertSame($pdoUser->getHash(), $this->VALID_HASH);\n\t\t$this->assertSame($pdoUser->getEmail(), $this->VALID_EMAIL);\n\t\t$this->assertSame($pdoUser->getName(), $this->VALID_NAME);\n\t}", "public function getUserProfile() {\n\n\t\t$data = $this->api->get( 'people/~:('. implode(',', $this->config['fields']) .')?format=json' );\n\n\t\t// if the provider identifier is not received, we assume the auth has failed\n\t\tif ( ! isset( $data->id ) ) {\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} api returned an invalid response: \" . Hybrid_Logger::dumpData( $data ), 6 );\n\t\t}\n\n\t\t// # store the user profile.\n\t\t$this->user->profile->identifier = ( property_exists ( $data, 'id' ) ) ? $data->id : '';\n\t\t$this->user->profile->firstName = ( property_exists ( $data, 'firstName' ) ) ? $data->firstName : '';\n\t\t$this->user->profile->lastName = ( property_exists ( $data, 'lastName' ) ) ? $data->lastName : '';\n\t\t$this->user->profile->profileURL = ( property_exists ( $data, 'publicProfileUrl' ) ) ? $data->publicProfileUrl : '';\n\t\t$this->user->profile->email = ( property_exists ( $data, 'emailAddress' ) ) ? $data->emailAddress : '';\n\t\t$this->user->profile->emailVerified = ( property_exists ( $data, 'emailAddress' ) ) ? $data->emailAddress : '';\n\t\t$this->user->profile->photoURL = ( property_exists ( $data, 'pictureUrl' ) ) ? $data->pictureUrl : '';\n\t\t$this->user->profile->description = ( property_exists ( $data, 'summary' ) ) ? $data->summary : '';\n\t\t$this->user->profile->country = ( property_exists ( $data, 'country' ) ) ? strtoupper( $data->country ) : '';\n\t\t$this->user->profile->displayName = trim( $this->user->profile->firstName . ' ' . $this->user->profile->lastName );\n\n\t\tif ( property_exists( $data, 'phoneNumbers' ) && property_exists( $data->phoneNumbers, 'phoneNumber' ) ) {\n\t\t\t$this->user->profile->phone = (string) $data->phoneNumbers->phoneNumber;\n\t\t} else {\n\t\t\t$this->user->profile->phone = null;\n\t\t}\n\n\t\tif ( property_exists( $data, 'dateOfBirth' ) ) {\n\t\t\t$this->user->profile->birthDay = (string) $data->dateOfBirth->day;\n\t\t\t$this->user->profile->birthMonth = (string) $data->dateOfBirth->month;\n\t\t\t$this->user->profile->birthYear = (string) $data->dateOfBirth->year;\n\t\t}\n\n\t\treturn $this->user->profile;\n\t}" ]
[ "0.7989228", "0.77397007", "0.7591132", "0.7435734", "0.7418118", "0.7357499", "0.72397995", "0.7197651", "0.7185962", "0.7153487", "0.709571", "0.70422924", "0.7036621", "0.6997763", "0.6959068", "0.69059414", "0.6905044", "0.6888269", "0.6879857", "0.6842498", "0.68406165", "0.6817268", "0.6816832", "0.6798244", "0.6774941", "0.67579997", "0.67383", "0.6727003", "0.67242825", "0.6719706", "0.66947836", "0.66791785", "0.6678211", "0.6672354", "0.6669319", "0.6666718", "0.66589665", "0.663443", "0.662476", "0.66246516", "0.6615006", "0.6597523", "0.65972406", "0.6592285", "0.65905637", "0.65734404", "0.6528713", "0.65279937", "0.65279716", "0.65194166", "0.6517039", "0.6514169", "0.6513336", "0.65027654", "0.6498642", "0.6492302", "0.6488603", "0.6488393", "0.6473705", "0.6464079", "0.64636624", "0.64631623", "0.64630765", "0.64613086", "0.646029", "0.6458042", "0.64394915", "0.642244", "0.6422397", "0.6417356", "0.6416858", "0.641479", "0.6411107", "0.6410385", "0.64043623", "0.6395951", "0.6386842", "0.6384094", "0.63824254", "0.63796264", "0.6376736", "0.6365961", "0.63603973", "0.6357395", "0.6354286", "0.6351504", "0.6349644", "0.63454723", "0.6343636", "0.6340599", "0.6336328", "0.6334659", "0.6333257", "0.6332585", "0.6330798", "0.63284343", "0.6328053", "0.63221925", "0.63163567", "0.63079387", "0.6300142" ]
0.0
-1
Possible file types: txt, pdf Possible document_query status: review, agreed, tiebreak, solved
public function judgments() { return $this->hasMany(Judgment::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}", "function availableFileTypes($ext) {\n //checking file type extension\n switch ($ext) {\n //checking txt extention\n case \"txt\":\n $type[0] = \"text/plain\";\n break;\n\n //checking xml extention\n case \"xml\":\n $type[0] = \"text/xml\";\n $type[1] = \"application/xml\";\n break;\n\n //checking csv extention\n case \"csv\":\n $type[0] = \"text/x-comma-separated-values\";\n $type[1] = \"application/octet-stream\";\n $type[2] = \"text/plain\";\n break;\n\n //checking zip extention\n case \"zip\":\n $type[0] = \"application/zip\";\n break;\n\n //checking tar extention\n case \"tar\":\n $type[0] = \"application/x-gzip\";\n break;\n\n //checking ctar extention\n case \"ctar\":\n $type[0] = \"application/x-compressed-tar\";\n break;\n\n //checking pdf extention\n case \"pdf\":\n $type[0] = \"application/pdf\";\n break;\n\n //checking doc extention\n case \"doc\":\n $type[0] = \"application/msword\";\n $type[1] = \"application/octet-stream\";\n break;\n\n //checking xls extention\n case \"xls\":\n $type[0] = \"application/vnd.ms-excel\";\n $type[1] = \"application/vnd.oasis.opendocument.spreadsheet\";\n break;\n\n //checking ppt extention\n case \"ppt\":\n $type[0] = \"application/vnd.ms-powerpoint\";\n break;\n\n //checking jpg extention\n case \"jpg\":\n $type[0] = \"image/jpg\";\n $type[1] = \"image/jpeg\";\n $type[2] = \"image/pjpeg\";\n break;\n\n //checking gif extention\n case \"gif\":\n $type[0] = \"image/gif\";\n break;\n\n //checking png extention\n case \"png\":\n $type[0] = \"image/png\";\n break;\n\n //checking bmp extention\n case \"bmp\":\n $type[0] = \"image/bmp\";\n break;\n\n //checking icon extention\n case \"icon\":\n $type[0] = \"image/x-ico\";\n break;\n\n //checking tfontt extention\n case \"font\":\n $type[0] = \"application/x-font-ttf\";\n break;\n }\n\n return $type;\n }", "function fileTypes($extension){\r\n $fileTypes['pdf'] = 'application/pdf';\r\n \r\n $fileTypes['zip'] = 'application/zip';\r\n $fileTypes['doc'] = 'application/msword';\r\n $fileTypes['rar'] = 'application/rar';\r\n\r\n \r\n return $fileTypes[$extention];\r\n }", "static function get_mime_type($file) {\n $mime_types = array(\n \"pdf\" => \"application/pdf\"\n , \"exe\" => \"application/octet-stream\"\n , \"zip\" => \"application/zip\"\n // ,\"docx\"=>\"application/msword\"\n , \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n , \"doc\" => \"application/msword\"\n , \"rtf\" => \"text/rtf\"\n , \"txt\" => \"text/plain\"\n , \"xls\" => \"application/vnd.ms-excel\"\n , \"ppt\" => \"application/vnd.ms-powerpoint\"\n , \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n , \"gif\" => \"image/gif\"\n , \"png\" => \"image/png\"\n , \"jpeg\" => \"image/jpg\"\n , \"jpg\" => \"image/jpg\"\n , \"mp3\" => \"audio/mpeg\"\n , \"wav\" => \"audio/x-wav\"\n , \"mpeg\" => \"video/mpeg\"\n , \"mpg\" => \"video/mpeg\"\n , \"mpe\" => \"video/mpeg\"\n , \"mov\" => \"video/quicktime\"\n , \"avi\" => \"video/x-msvideo\"\n , \"3gp\" => \"video/3gpp\"\n , \"css\" => \"text/css\"\n , \"jsc\" => \"application/javascript\"\n , \"js\" => \"application/javascript\"\n , \"php\" => \"text/html\"\n , \"htm\" => \"text/html\"\n , \"html\" => \"text/html\"\n , \"xlsx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n , \"xltx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.template\"\n , \"potx\" => \"application/vnd.openxmlformats-officedocument.presentationml.template\"\n , \"ppsx\" => \"application/vnd.openxmlformats-officedocument.presentationml.slideshow\"\n , \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n , \"sldx\" => \"application/vnd.openxmlformats-officedocument.presentationml.slide\"\n , \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n , \"dotx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.template\"\n , \"xlam\" => \"application/vnd.ms-excel.addin.macroEnabled.12\"\n , \"xlsb\" => \"application/vnd.ms-excel.sheet.binary.macroEnabled.12\"\n );\n $extention = explode('.', $file);\n $extension = end($extention);\n $extension = strtolower($extension);\n return $mime_types[$extension];\n }", "function file_tester($file){\n if (htmlentities($file['filename']['type']) == 'text/plain')\n return true;\n else {\n echo \"Please submit correct file type (.txt)\";\n return false;\n }\n}", "public function getFileTypeFromDocument($index)\n {\n $documents = $this->getField('documents');\n $document = $documents[$index];\n $result = GeneralUtility::split_fileref($document);\n $ext = strtolower($result['realFileext']);\n if (empty($ext)) {\n $ext = strtolower($result['fileext']);\n }\n if (empty($ext)) {\n $result = false;\n } else {\n switch ($ext) {\n case 'pdf':\n $result = 'application/pdf';\n break;\n case 'doc':\n $result = 'application/msword';\n break;\n case 'htm':\n case 'html':\n $result = 'text/html';\n break;\n default:\n $result = false;\n }\n }\n return $result;\n }", "function getFileTypeRestrictions() ;", "static function getValidContentTypes() {\n return array(\n 'image/',\n 'text/',\n 'application/pdf',\n );\n }", "public function file_check($str){\n \t$allowed_mime_type_arr = array('application/pdf');\n \tif(isset($_FILES['file']['name']) && $_FILES['file']['name']!=\"\"){\n \t\t$mime = get_mime_by_extension($_FILES['file']['name']);\n \t\tif(in_array($mime, $allowed_mime_type_arr)){\n \t\t\treturn true;\n \t\t}else{\n \t\t\t$this->form_validation->set_message('file_check', 'Extension File Hanya Boleh PDF');\n \t\t\treturn false;\n \t\t}\n \t}else{\n \t\t// $this->form_validation->set_message('file_check', 'Silahkan Pilih File PDF nya.');\n \t\t// return false;\n \t\treturn true;\n \t}\n }", "function wp_check_filetype($filename, $mimes = null) {\n\t$mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array(\n\t\t'jpg|jpeg|jpe' => 'image/jpeg',\n\t\t'gif' => 'image/gif',\n\t\t'png' => 'image/png',\n\t\t'bmp' => 'image/bmp',\n\t\t'tif|tiff' => 'image/tiff',\n\t\t'ico' => 'image/x-icon',\n\t\t'asf|asx|wax|wmv|wmx' => 'video/asf',\n\t\t'avi' => 'video/avi',\n\t\t'mov|qt' => 'video/quicktime',\n\t\t'mpeg|mpg|mpe' => 'video/mpeg',\n\t\t'txt|c|cc|h' => 'text/plain',\n\t\t'rtx' => 'text/richtext',\n\t\t'css' => 'text/css',\n\t\t'htm|html' => 'text/html',\n\t\t'php|php3|' => 'application/php',\n\t\t'mp3|mp4' => 'audio/mpeg',\n\t\t'ra|ram' => 'audio/x-realaudio',\n\t\t'wav' => 'audio/wav',\n\t\t'ogg' => 'audio/ogg',\n\t\t'mid|midi' => 'audio/midi',\n\t\t'wma' => 'audio/wma',\n\t\t'rtf' => 'application/rtf',\n\t\t'js' => 'application/javascript',\n\t\t'pdf' => 'application/pdf',\n\t\t'doc' => 'application/msword',\n\t\t'pot|pps|ppt' => 'application/vnd.ms-powerpoint',\n\t\t'wri' => 'application/vnd.ms-write',\n\t\t'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',\n\t\t'mdb' => 'application/vnd.ms-access',\n\t\t'mpp' => 'application/vnd.ms-project',\n\t\t'swf' => 'application/x-shockwave-flash',\n\t\t'class' => 'application/java',\n\t\t'tar' => 'application/x-tar',\n\t\t'zip' => 'application/zip',\n\t\t'gz|gzip' => 'application/x-gzip',\n\t\t'exe' => 'application/x-msdownload',\n\t\t// openoffice formats\n\t\t'odt' => 'application/vnd.oasis.opendocument.text',\n\t\t'odp' => 'application/vnd.oasis.opendocument.presentation',\n\t\t'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n\t\t'odg' => 'application/vnd.oasis.opendocument.graphics',\n\t\t'odc' => 'application/vnd.oasis.opendocument.chart',\n\t\t'odb' => 'application/vnd.oasis.opendocument.database',\n\t\t'odf' => 'application/vnd.oasis.opendocument.formula',\n\n\t));\n\n\t$type = false;\n\t$ext = false;\n\n\tforeach ($mimes as $ext_preg => $mime_match) {\n\t\t$ext_preg = '!\\.(' . $ext_preg . ')$!i';\n\t\tif (preg_match($ext_preg, $filename, $ext_matches)) {\n\t\t\t$type = $mime_match;\n\t\t\t$ext = $ext_matches[1];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn compact('ext', 'type');\n}", "function get_file_format($file) {\n if(function_exists('finfo_open')) {\n $file_info = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($file_info, $file);\n finfo_close($file_info);\n if($mime_type) {\n return $mime_type;\n }\n }\n\n if(function_exists('mime_content_type')) {\n if($mime_type = @mime_content_type($file)) {\n return $mime_type;\n }\n }\n\n if($extension = get_file_extension($file)) {\n switch($extension) {\n case 'js' :\n return 'application/x-javascript';\n case 'json' :\n return 'application/json';\n case 'jpg' :\n case 'jpeg' :\n case 'jpe' :\n return 'image/jpg';\n case 'png' :\n case 'gif' :\n case 'bmp' :\n case 'tiff' :\n return 'image/'.$extension;\n case 'css' :\n return 'text/css';\n case 'xml' :\n return 'application/xml';\n case 'doc' :\n case 'docx' :\n return 'application/msword';\n case 'xls' :\n case 'xlt' :\n case 'xlm' :\n case 'xld' :\n case 'xla' :\n case 'xlc' :\n case 'xlw' :\n case 'xll' :\n return 'application/vnd.ms-excel';\n case 'ppt' :\n case 'pps' :\n return 'application/vnd.ms-powerpoint';\n case 'rtf' :\n return 'application/rtf';\n case 'pdf' :\n return 'application/pdf';\n case 'html' :\n case 'htm' :\n case 'php' :\n return 'text/html';\n case 'txt' :\n return 'text/plain';\n case 'mpeg' :\n case 'mpg' :\n case 'mpe' :\n return 'video/mpeg';\n case 'mp3' :\n return 'audio/mpeg3';\n case 'wav' :\n return 'audio/wav';\n case 'aiff' :\n case 'aif' :\n return 'audio/aiff';\n case 'avi' :\n return 'video/msvideo';\n case 'wmv' :\n return 'video/x-ms-wmv';\n case 'mov' :\n return 'video/quicktime';\n case 'zip' :\n return 'application/zip';\n case 'tar' :\n return 'application/x-tar';\n case 'swf' :\n return 'application/x-shockwave-flash';\n default:\n return 'unknown/'.trim($extension,'.');\n }\n }\n return false;\n}", "public function file_extensions_for_case_studies(){\n\t\t$filetype_arr = array();\n\t\t$filetype_arr['ppt'] = \"PowerPoint\";\n\t\t$filetype_arr['pptx'] = \"PowerPoint\";\n\t\t$filetype_arr['pdf'] = \"PDF file\";\n\t\treturn $filetype_arr;\n\t}", "function issuu_document_types() {\n return array(\n '000000' => 'Unknown',\n '001000' => 'Article or Essay',\n '002000' => 'Book',\n '003000' => 'Catalog',\n '004000' => 'Journal',\n '005000' => 'Magazine',\n '006000' => 'Manual or Resource',\n '007000' => 'Newspaper',\n '008000' => 'Paper',\n '009000' => 'Photo album',\n '010000' => 'Portfolio',\n '011000' => 'Presentation',\n '012000' => 'Report',\n '013000' => 'Other',\n );\n}", "function getMimeType($file) {\n\t\t$len = strlen($file);\n\t\t$ext = substr($file,strrpos($file,\".\")+1,$len);\n\t\t$extArray['pdf'] = array(\textension \t=> \t'pdf',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Adobe PDF File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/pdf');\n\t\t$extArray['zip'] = array(\textension \t=> \t'zip',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'ZIP-File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/zip');\n\t\t$extArray['xls'] = array(\textension \t=> \t'xls',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Excel File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/vnd.ms-excel');\n\t\t$extArray['xlt'] = array(\textension \t=> \t'xlt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Excel Vorlagen File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/vnd.ms-excel');\n\t\t$extArray['doc'] = array(\textension \t=> \t'doc',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Word File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/word');\n\t\t$extArray['dot'] = array(\textension \t=> \t'dot',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Word Vorlagen File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/word');\n\t\t$extArray['jpg'] = array(\textension \t=> \t'jpg',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'JPEG Picture File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/jpg');\n\t\t$extArray['vsd'] = array(\textension \t=> \t'vsd',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Visio File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['ppt'] = array(\textension \t=> \t'ppt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Powerpoint File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['pot'] = array(\textension \t=> \t'pot',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Powerpoint Template File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['tif'] = array(\textension \t=> \t'tif',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Tagged Image File - TIF',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/tiff');\n\t\t$extArray['eps'] = array(\textension \t=> \t'eps',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Encasulated Postscript - EPS',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/postscript');\n\t\t$extArray['txt'] = array(\textension \t=> \t'txt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Plaintext',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'text/pain');\n\t\t$extArray['swf'] = array(\textension \t=> \t'swf',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'ShockWave Flash',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-shockwave-flash');\n\t\t$extArray['gif'] = array(\textension \t=> \t'gif',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Compuserve Graphics Interchange Format',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/gif');\n\t\t$extArray['png'] = array(\textension \t=> \t'png',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Portable Network Graphics',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/png');\n\t\t$extArray['flv'] = array(\textension \t=> \t'flv',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Flash Video',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'video/mp4');\n\t\t$extArray['mp3'] = array(\textension \t=> \t'mp3',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'MPEG-1 Audio Layer 3',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'audio/mpeg');\n\t\t$extArray['unknown'] = array(\textension \t=> \t'unknown',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Unknown Filetype',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\tif (array_key_exists($ext,$extArray)) {\n\t\t\treturn $extArray[$ext];\n\t\t} else {\n\t\t\treturn $extArray['unknown'];\n\t\t}\n\t}", "function get_displayable_file_types() {\n return array( \n 'ada',\n 'adb',\n 'adp',\n 'ads',\n 'ans',\n 'as',\n 'asc',\n 'asm',\n 'asp',\n 'aspx',\n 'atom',\n 'au3',\n 'bas',\n 'bat',\n 'bmax',\n 'bml',\n 'c',\n 'cbl',\n 'cc',\n 'cfm',\n 'cgi',\n 'cls',\n 'cmd',\n 'cob',\n 'cpp',\n 'cs',\n 'css',\n 'csv',\n 'cxx',\n 'd',\n 'dif',\n 'dist',\n 'dtd',\n 'e',\n 'efs',\n 'egg',\n 'egt',\n 'f',\n 'f77',\n 'for',\n 'frm',\n 'frx',\n 'ftn',\n 'ged',\n 'gitattributes',\n 'gitignore',\n 'gm6',\n 'gmd',\n 'gml',\n 'h',\n 'hpp',\n 'hs',\n 'hta',\n 'htaccess',\n 'htm',\n 'html',\n 'hxx',\n 'ici',\n 'ictl',\n 'ihtml',\n 'inc',\n 'inf',\n 'info',\n 'ini',\n 'install',\n 'java',\n 'js',\n 'jsfl',\n 'json',\n 'l',\n 'las',\n 'lasso',\n 'lassoapp',\n 'less',\n 'log',\n 'lua',\n 'm',\n 'm4',\n 'makefile',\n 'manifest',\n 'md',\n 'met',\n 'metalink',\n 'ml',\n 'module',\n 'mrc',\n 'n',\n 'ncf',\n 'nfo',\n 'nut',\n 'p',\n 'pas',\n 'php',\n 'php3',\n 'php4',\n 'php5',\n 'phps',\n 'phtml',\n 'piv',\n 'pl',\n 'pm',\n 'pp',\n 'properties',\n 'ps1',\n 'ps1xml',\n 'psc1',\n 'psd1',\n 'psm1',\n 'py',\n 'pyc',\n 'pyi',\n 'rb',\n 'rdf',\n 'resx',\n 'rss',\n 's',\n 'scm',\n 'scpt',\n 'sh',\n 'shtml',\n 'spin',\n 'sql',\n 'ss',\n 'stk',\n 'svg',\n 'tab',\n 'tcl',\n 'tpl',\n 'txt',\n 'vb',\n 'vbp',\n 'vbs',\n 'xht',\n 'xhtml',\n 'xml',\n 'xsl',\n 'xslt',\n 'xul',\n 'y',\n 'yml'\n );\n }", "function isValidDocument($docFormat, $document){\n $name = $document['name'];\n $ext = explode('.', $name);\n $ext = '.' . $ext[1];\n\n if($ext == $docFormat){\n if($document['error'] === 0){\n return true;\n }\n else{\n echo \"error uploading document\";\n return false;\n }\n }\n else{\n echo \"doc type does not match documents true extension\";\n }\n }", "function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}", "function textUpload($tF){\n // php is disable on server for this directory\n global $uploadOk, $uploadStatus;\n\n $textFileType = strtolower(pathinfo($tF,PATHINFO_EXTENSION));\n\n // Allow certain file formats\n if($textFileType != \"html\" && $textFileType != \"css\") {\n $uploadStatus .= \"<br>Sorry, only HTML and CSS files are allowed.\";\n $uploadOk = 0;\n }\n}", "public function getFileTypeRestrictions() {}", "function _file_get_type($file) {\n $ext = file_ext($file);\n if (preg_match(\"/$ext/i\", get_setting(\"image_ext\")))\n return IMAGE;\n if (preg_match(\"/$ext/i\", get_setting(\"audio_ext\")))\n return AUDIO;\n if (preg_match(\"/$ext/i\", get_setting(\"video_ext\")))\n return VIDEO;\n if (preg_match(\"/$ext/i\", get_setting(\"document_ext\")))\n return DOCUMENT;\n if (preg_match(\"/$ext/i\", get_setting(\"archive_ext\")))\n return ARCHIVE;\n }", "function check_mime_type($source)\n{\n $mime_types = array(\n // images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n // adobe\n 'pdf' => 'application/pdf',\n // ms office\n 'doc' => 'application/msword',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'ppt' => 'application/vnd.ms-powerpoint',\n // open office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n $arrext = explode('.', $source['name']);\n $jml = count($arrext) - 1;\n $ext = $arrext[$jml];\n $ext = strtolower($ext);\n //$ext = strtolower(array_pop(explode(\".\", $source['name'])));\n if (array_key_exists($ext, $mime_types)) {\n return $mime_types[$ext];\n } elseif (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimetype = finfo_file($finfo, $source['tmp_name']);\n finfo_close($finfo);\n return $mimetype;\n } else {\n return false;\n }\n}", "private function get_mime_type($fn) {\r\n \r\n $mime_types = array(\r\n \r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n \r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n \r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n \r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n \r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n \r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n \r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n \r\n $ext = strtolower(array_pop(explode('.',$fn)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n }\r\n elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimetype = finfo_file($finfo, $fn);\r\n finfo_close($finfo);\r\n return $mimetype;\r\n }\r\n else {\r\n return 'application/octet-stream';\r\n }\r\n }", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "private function get_mime_type(string $file_path) {\n //MIME Types\n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-unic',\n 'flv' => 'video/x-flv',\n\n //Images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n\n //Archives\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n\n //Audio/Video\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n\n //Adobe\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n\n //MS Office\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'docx' => 'application/msword',\n 'xlsx' => 'application/vnd.ms-excel',\n 'pptx' => 'application/vnd.ms-powerpoint',\n\n //Open Office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n\n $ext_array = explode('.', $file_path);\n $extension = strtolower(end($ext_array));\n if(isset($mime_types[$extension])) {\n return $mime_types[$extension];\n } else {\n return mime_content_type($file_path);\n }\n }", "function viewer_general ( $fp, $filename, $ext, $dir, $query_string ) {\r\n switch ( $ext ) {\r\n case \"gif\":\r\n $file[0] = \"image/gif\";\r\n break;\r\n case \"jpeg\":\r\n case \"jpg\":\r\n $file[0] = \"image/jpeg\";\r\n break;\r\n case \"tiff\":\r\n $file[0] = \"image/tiff\";\r\n break;\r\n case \"png\":\r\n $file[0] = \"image/png\";\r\n break;\r\n case \"html\":\r\n case \"htm\":\r\n case \"shtml\":\r\n $file[0] = \"text/html\";\r\n break;\r\n case \"mp3\":\r\n case \"mpeg\":\r\n $file[0] = \"audio/mpeg\";\r\n break;\r\n default:\r\n $file[0] = \"application/octet-stream\";\r\n }\r\n\r\n $file[1] = $fp;\r\n/*\r\n return array ( \"mimetype\" , \"fp\" );\r\n*/\r\n return $file;\r\n}", "function get_available_post_mime_types($type = 'attachment')\n {\n }", "public function getSupportedFileTypes(){\n\t\t$_url = $this->constants['SERVICE_ENTRY_POINT'].$this->constants['SERVICE_VERSION'].'/'.$this->constants['MISC_PATH'].'/supported-file-types';\n\t\t$response = $this->getRequests($_url)['response'];\n\t\treturn $response;\n\t}", "public function provider_mime_type() {\n\t\treturn array(\n\t\t\tarray( 'not-found.txt', false ),\n\t\t\tarray( 'empty.txt', version_compare( PHP_VERSION, '7.4', '>=' ) ? 'application/x-empty' : 'inode/x-empty' ),\n\t\t\tarray( 'file.aac', 'audio/aac' ),\n\t\t\tarray( 'file.css', 'text/css' ),\n\t\t\tarray( 'file.csv', 'text/plain' ),\n\t\t\tarray( 'file.flac', 'audio/flac' ),\n\t\t\tarray( 'file.gif', 'image/gif' ),\n\t\t\tarray( 'file.htm', 'text/html' ),\n\t\t\tarray( 'file.html', 'text/html' ),\n\t\t\tarray( 'file.jpe', 'image/jpeg' ),\n\t\t\tarray( 'file.jpeg', 'image/jpeg' ),\n\t\t\tarray( 'file.jpg', 'image/jpeg' ),\n\t\t\tarray( 'file.js', 'application/javascript' ),\n\t\t\tarray( 'file.m4a', 'audio/m4a' ),\n\t\t\tarray( 'file.mp3', 'audio/mpeg' ),\n\t\t\tarray( 'file.png', 'image/png' ),\n\t\t\tarray( 'file.svg', 'image/svg+xml' ),\n\t\t\tarray( 'file.txt', 'text/plain' ),\n\t\t\tarray( 'file.wav', 'audio/wav' ),\n\t\t\tarray( 'file.xml', 'application/xml' ),\n\t\t\tarray( 'no-extension-text', 'text/plain' ),\n\t\t\tarray( 'no-extension-media', 'application/octet-stream' ),\n\t\t\tarray( 'upper-case.JPG', 'image/jpeg' ),\n\t\t);\n\t}", "function isFileType($files) {\n $allowedExts = array(\"jpg\", \"jpeg\", \"gif\", \"png\", \"doc\", \"docx\", \"txt\", \"rtf\", \"pdf\", \"xls\", \"xlsx\", \"ppt\", \"pptx\");\n $temp = explode(\".\", $files);\n $extension = end($temp);\n if (in_array($extension, $allowedExts))\n return true;\n else\n return false;\n}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('pdf_file', 'file', 'types'=>'pdf'),\n\t\t);\n\t}", "function get_content_type($url){\n\t\t\t\t\t\t$mime_types = array(\n\t\t\t\t\t\t\t\"pdf\"=>\"application/pdf\"\n\t\t\t\t\t\t\t,\"exe\"=>\"application/octet-stream\"\n\t\t\t\t\t\t\t,\"zip\"=>\"application/zip\"\n\t\t\t\t\t\t\t,\"docx\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"doc\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"xls\"=>\"application/vnd.ms-excel\"\n\t\t\t\t\t\t\t,\"ppt\"=>\"application/vnd.ms-powerpoint\"\n\t\t\t\t\t\t\t,\"gif\"=>\"image/gif\"\n\t\t\t\t\t\t\t,\"png\"=>\"image/png\"\n\t\t\t\t\t\t ,\"ico\"=>\"image/ico\"\n\t\t\t\t\t\t ,\"jpeg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"jpg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"mp3\"=>\"audio/mpeg\"\n\t\t\t\t\t\t ,\"wav\"=>\"audio/x-wav\"\n\t\t\t\t\t\t ,\"mpeg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpe\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mov\"=>\"video/quicktime\"\n\t\t\t\t\t\t ,\"avi\"=>\"video/x-msvideo\"\n\t\t\t\t\t\t ,\"3gp\"=>\"video/3gpp\"\n\t\t\t\t\t\t ,\"css\"=>\"text/css\"\n\t\t\t\t\t\t ,\"jsc\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"js\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"php\"=>\"text/html\"\n\t\t\t\t\t\t ,\"htm\"=>\"text/html\"\n\t\t\t\t\t\t ,\"html\"=>\"text/html\"\n\t\t\t\t\t\t ,\"xml\"=>\"application/xml\"\n\t\t\t\t\t\t \n\t\t\t\t\t\t);\n\t\t\t\t\t\t$var = explode('.', $url);\n\t\t\t\t\t\t$extension = strtolower(end($var));\n\t\t\t\t\t\tif(isset($mime_types[$extension])){\n\t\t\t\t\t\t return $mime_types[$extension];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn 'other';\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function mime2ext($mime){\n\t $all_mimes = '{\"png\":[\"image\\/png\",\"image\\/x-png\"],\"bmp\":[\"image\\/bmp\",\"image\\/x-bmp\",\n\t \"image\\/x-bitmap\",\"image\\/x-xbitmap\",\"image\\/x-win-bitmap\",\"image\\/x-windows-bmp\",\n\t \"image\\/ms-bmp\",\"image\\/x-ms-bmp\",\"application\\/bmp\",\"application\\/x-bmp\",\n\t \"application\\/x-win-bitmap\"],\"gif\":[\"image\\/gif\"],\"jpeg\":[\"image\\/jpeg\",\n\t \"image\\/pjpeg\"],\"xspf\":[\"application\\/xspf+xml\"],\"vlc\":[\"application\\/videolan\"],\n\t \"wmv\":[\"video\\/x-ms-wmv\",\"video\\/x-ms-asf\"],\"au\":[\"audio\\/x-au\"],\n\t \"ac3\":[\"audio\\/ac3\"],\"flac\":[\"audio\\/x-flac\"],\"ogg\":[\"audio\\/ogg\",\n\t \"video\\/ogg\",\"application\\/ogg\"],\"kmz\":[\"application\\/vnd.google-earth.kmz\"],\n\t \"kml\":[\"application\\/vnd.google-earth.kml+xml\"],\"rtx\":[\"text\\/richtext\"],\n\t \"rtf\":[\"text\\/rtf\"],\"jar\":[\"application\\/java-archive\",\"application\\/x-java-application\",\n\t \"application\\/x-jar\"],\"zip\":[\"application\\/x-zip\",\"application\\/zip\",\n\t \"application\\/x-zip-compressed\",\"application\\/s-compressed\",\"multipart\\/x-zip\"],\n\t \"7zip\":[\"application\\/x-compressed\"],\"xml\":[\"application\\/xml\",\"text\\/xml\"],\n\t \"svg\":[\"image\\/svg+xml\"],\"3g2\":[\"video\\/3gpp2\"],\"3gp\":[\"video\\/3gp\",\"video\\/3gpp\"],\n\t \"mp4\":[\"video\\/mp4\"],\"m4a\":[\"audio\\/x-m4a\"],\"f4v\":[\"video\\/x-f4v\"],\"flv\":[\"video\\/x-flv\"],\n\t \"webm\":[\"video\\/webm\"],\"aac\":[\"audio\\/x-acc\"],\"m4u\":[\"application\\/vnd.mpegurl\"],\n\t \"pdf\":[\"application\\/pdf\",\"application\\/octet-stream\"],\n\t \"pptx\":[\"application\\/vnd.openxmlformats-officedocument.presentationml.presentation\"],\n\t \"ppt\":[\"application\\/powerpoint\",\"application\\/vnd.ms-powerpoint\",\"application\\/vnd.ms-office\",\n\t \"application\\/msword\"],\"docx\":[\"application\\/vnd.openxmlformats-officedocument.wordprocessingml.document\"],\n\t \"xlsx\":[\"application\\/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\"application\\/vnd.ms-excel\"],\n\t \"xl\":[\"application\\/excel\"],\"xls\":[\"application\\/msexcel\",\"application\\/x-msexcel\",\"application\\/x-ms-excel\",\n\t \"application\\/x-excel\",\"application\\/x-dos_ms_excel\",\"application\\/xls\",\"application\\/x-xls\"],\n\t \"xsl\":[\"text\\/xsl\"],\"mpeg\":[\"video\\/mpeg\"],\"mov\":[\"video\\/quicktime\"],\"avi\":[\"video\\/x-msvideo\",\n\t \"video\\/msvideo\",\"video\\/avi\",\"application\\/x-troff-msvideo\"],\"movie\":[\"video\\/x-sgi-movie\"],\n\t \"log\":[\"text\\/x-log\"],\"txt\":[\"text\\/plain\"],\"css\":[\"text\\/css\"],\"html\":[\"text\\/html\"],\n\t \"wav\":[\"audio\\/x-wav\",\"audio\\/wave\",\"audio\\/wav\"],\"xhtml\":[\"application\\/xhtml+xml\"],\n\t \"tar\":[\"application\\/x-tar\"],\"tgz\":[\"application\\/x-gzip-compressed\"],\"psd\":[\"application\\/x-photoshop\",\n\t \"image\\/vnd.adobe.photoshop\"],\"exe\":[\"application\\/x-msdownload\"],\"js\":[\"application\\/x-javascript\"],\n\t \"mp3\":[\"audio\\/mpeg\",\"audio\\/mpg\",\"audio\\/mpeg3\",\"audio\\/mp3\"],\"rar\":[\"application\\/x-rar\",\"application\\/rar\",\n\t \"application\\/x-rar-compressed\"],\"gzip\":[\"application\\/x-gzip\"],\"hqx\":[\"application\\/mac-binhex40\",\n\t \"application\\/mac-binhex\",\"application\\/x-binhex40\",\"application\\/x-mac-binhex40\"],\n\t \"cpt\":[\"application\\/mac-compactpro\"],\"bin\":[\"application\\/macbinary\",\"application\\/mac-binary\",\n\t \"application\\/x-binary\",\"application\\/x-macbinary\"],\"oda\":[\"application\\/oda\"],\n\t \"ai\":[\"application\\/postscript\"],\"smil\":[\"application\\/smil\"],\"mif\":[\"application\\/vnd.mif\"],\n\t \"wbxml\":[\"application\\/wbxml\"],\"wmlc\":[\"application\\/wmlc\"],\"dcr\":[\"application\\/x-director\"],\n\t \"dvi\":[\"application\\/x-dvi\"],\"gtar\":[\"application\\/x-gtar\"],\"php\":[\"application\\/x-httpd-php\",\n\t \"application\\/php\",\"application\\/x-php\",\"text\\/php\",\"text\\/x-php\",\"application\\/x-httpd-php-source\"],\n\t \"swf\":[\"application\\/x-shockwave-flash\"],\"sit\":[\"application\\/x-stuffit\"],\"z\":[\"application\\/x-compress\"],\n\t \"mid\":[\"audio\\/midi\"],\"aif\":[\"audio\\/x-aiff\",\"audio\\/aiff\"],\"ram\":[\"audio\\/x-pn-realaudio\"],\n\t \"rpm\":[\"audio\\/x-pn-realaudio-plugin\"],\"ra\":[\"audio\\/x-realaudio\"],\"rv\":[\"video\\/vnd.rn-realvideo\"],\n\t \"jp2\":[\"image\\/jp2\",\"video\\/mj2\",\"image\\/jpx\",\"image\\/jpm\"],\"tiff\":[\"image\\/tiff\"],\n\t \"eml\":[\"message\\/rfc822\"],\"pem\":[\"application\\/x-x509-user-cert\",\"application\\/x-pem-file\"],\n\t \"p10\":[\"application\\/x-pkcs10\",\"application\\/pkcs10\"],\"p12\":[\"application\\/x-pkcs12\"],\n\t \"p7a\":[\"application\\/x-pkcs7-signature\"],\"p7c\":[\"application\\/pkcs7-mime\",\"application\\/x-pkcs7-mime\"],\"p7r\":[\"application\\/x-pkcs7-certreqresp\"],\"p7s\":[\"application\\/pkcs7-signature\"],\"crt\":[\"application\\/x-x509-ca-cert\",\"application\\/pkix-cert\"],\"crl\":[\"application\\/pkix-crl\",\"application\\/pkcs-crl\"],\"pgp\":[\"application\\/pgp\"],\"gpg\":[\"application\\/gpg-keys\"],\"rsa\":[\"application\\/x-pkcs7\"],\"ics\":[\"text\\/calendar\"],\"zsh\":[\"text\\/x-scriptzsh\"],\"cdr\":[\"application\\/cdr\",\"application\\/coreldraw\",\"application\\/x-cdr\",\"application\\/x-coreldraw\",\"image\\/cdr\",\"image\\/x-cdr\",\"zz-application\\/zz-winassoc-cdr\"],\"wma\":[\"audio\\/x-ms-wma\"],\"vcf\":[\"text\\/x-vcard\"],\"srt\":[\"text\\/srt\"],\"vtt\":[\"text\\/vtt\"],\"ico\":[\"image\\/x-icon\",\"image\\/x-ico\",\"image\\/vnd.microsoft.icon\"],\"csv\":[\"text\\/x-comma-separated-values\",\"text\\/comma-separated-values\",\"application\\/vnd.msexcel\"],\"json\":[\"application\\/json\",\"text\\/json\"]}';\n\t $all_mimes = json_decode($all_mimes,true);\n\t foreach ($all_mimes as $key => $value) {\n\t if(array_search($mime,$value) !== false) return $key;\n\t }\n\t return false;\n\t}", "private function getMimeTypes()\n {\n return apply_filters('wplms_assignments_upload_mimes_array',array(\n 'JPG' => array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap'),\n 'GIF' => array(\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_'),\n 'PNG' => array(\n 'image/png',\n 'application/png',\n 'application/x-png'),\n 'DOCX'=> 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'RAR'=> 'application/x-rar',\n 'ZIP' => array(\n 'application/zip',\n 'application/x-zip',\n 'application/x-zip-compressed',\n 'application/x-compress',\n 'application/x-compressed',\n 'multipart/x-zip'),\n 'DOC' => array(\n 'application/msword',\n 'application/doc',\n 'application/text',\n 'application/vnd.msword',\n 'application/vnd.ms-word',\n 'application/winword',\n 'application/word',\n 'application/x-msw6',\n 'application/x-msword'),\n 'PDF' => array(\n 'application/pdf',\n 'application/x-pdf',\n 'application/acrobat',\n 'applications/vnd.pdf',\n 'text/pdf',\n 'text/x-pdf'),\n 'PPT' => array(\n 'application/vnd.ms-powerpoint',\n 'application/mspowerpoint',\n 'application/ms-powerpoint',\n 'application/mspowerpnt',\n 'application/vnd-mspowerpoint',\n 'application/powerpoint',\n 'application/x-powerpoint',\n 'application/x-m'),\n 'PPTX'=> 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'PPS' => 'application/vnd.ms-powerpoint',\n 'PPSX'=> 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'PSD' => array('application/octet-stream',\n 'image/vnd.adobe.photoshop'\n ),\n 'ODT' => array(\n 'application/vnd.oasis.opendocument.text',\n 'application/x-vnd.oasis.opendocument.text'),\n 'XLS' => array(\n 'application/vnd.ms-excel',\n 'application/msexcel',\n 'application/x-msexcel',\n 'application/x-ms-excel',\n 'application/vnd.ms-excel',\n 'application/x-excel',\n 'application/x-dos_ms_excel',\n 'application/xls'),\n 'XLSX'=> array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'),\n 'MP3' => array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio'),\n 'M4A' => array(\n 'audio/mp4a-latm',\n 'audio/m4a',\n 'audio/mp4'),\n 'OGG' => array(\n 'audio/ogg',\n 'application/ogg'),\n 'WAV' => array(\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav'),\n 'WMA' => 'audio/x-ms-wma',\n 'MP4' => array(\n 'video/mp4v-es',\n 'audio/mp4',\n 'video/mp4'),\n 'M4V' => array(\n 'video/mp4',\n 'video/x-m4v'),\n 'MOV' => array(\n 'video/quicktime',\n 'video/x-quicktime',\n 'image/mov',\n 'audio/aiff',\n 'audio/x-midi',\n 'audio/x-wav',\n 'video/avi'),\n 'WMV' => 'video/x-ms-wmv',\n 'AVI' => array(\n 'video/avi',\n 'video/msvideo',\n 'video/x-msvideo',\n 'image/avi',\n 'video/xmpg2',\n 'application/x-troff-msvideo',\n 'audio/aiff',\n 'audio/avi'),\n 'MPG' => array(\n 'video/avi',\n 'video/mpeg',\n 'video/mpg',\n 'video/x-mpg',\n 'video/mpeg2',\n 'application/x-pn-mpg',\n 'video/x-mpeg',\n 'video/x-mpeg2a',\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'image/mpg'),\n 'OGV' => 'video/ogg',\n '3GP' => array(\n 'audio/3gpp',\n 'video/3gpp'),\n '3G2' => array(\n 'video/3gpp2',\n 'audio/3gpp2'),\n 'FLV' => 'video/x-flv',\n 'WEBM'=> 'video/webm',\n 'APK' => 'application/vnd.android.package-archive',\n ));\n }", "public function testSupportedMIMETypes()\n {\n $this->assertContains('application/x-pdf', self::$client->getSupportedMIMETypes());\n }", "function extension2fileType( $extension )\n{\n $file_types = '' ; # initialize\n switch ( strtolower( $extension ) )\n {\n case '.jpg':\n case '.jpeg':\n $file_types = 'image/pjpeg,image/jpeg' ;\n break ;\n case '.gif':\n $file_types = 'image/gif' ;\n break ;\n case '.png':\n $file_types = 'image/x-png' ;\n break ;\n case '.doc':\n $file_types = 'application/msword' ;\n break ;\n case '.zip':\n $file_types = 'application/x-zip-compressed' ;\n break ;\n case '.pdf':\n $file_types = 'application/pdf' ;\n break ;\n case '.xls':\n $file_types = 'application/vnd.ms-excel' ;\n break ;\n case '.mp3':\n $file_types = 'audio/mpeg' ;\n break ;\n case '.txt':\n $file_types = 'text/plain' ;\n break ;\n case '.htm':\n case '.html':\n $file_types = 'text/html' ;\n break ;\n case '.wma':\n $file_types = 'audio/x-ms-wma' ;\n break ;\n default:\n $file_types = 'image/pjpeg,image/jpeg' ; # default to .jpg\n }\n return $file_types ; # return matching file type!\n}", "public static function _mime_types($ext = '')\n {\n $mimes = array(\n 'xl' => 'application/excel',\n 'js' => 'application/javascript',\n 'hqx' => 'application/mac-binhex40',\n 'cpt' => 'application/mac-compactpro',\n 'bin' => 'application/macbinary',\n 'doc' => 'application/msword',\n 'word' => 'application/msword',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',\n 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',\n 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n 'class' => 'application/octet-stream',\n 'dll' => 'application/octet-stream',\n 'dms' => 'application/octet-stream',\n 'exe' => 'application/octet-stream',\n 'lha' => 'application/octet-stream',\n 'lzh' => 'application/octet-stream',\n 'psd' => 'application/octet-stream',\n 'sea' => 'application/octet-stream',\n 'so' => 'application/octet-stream',\n 'oda' => 'application/oda',\n 'pdf' => 'application/pdf',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'smi' => 'application/smil',\n 'smil' => 'application/smil',\n 'mif' => 'application/vnd.mif',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'wbxml' => 'application/vnd.wap.wbxml',\n 'wmlc' => 'application/vnd.wap.wmlc',\n 'dcr' => 'application/x-director',\n 'dir' => 'application/x-director',\n 'dxr' => 'application/x-director',\n 'dvi' => 'application/x-dvi',\n 'gtar' => 'application/x-gtar',\n 'php3' => 'application/x-httpd-php',\n 'php4' => 'application/x-httpd-php',\n 'php' => 'application/x-httpd-php',\n 'phtml' => 'application/x-httpd-php',\n 'phps' => 'application/x-httpd-php-source',\n 'swf' => 'application/x-shockwave-flash',\n 'sit' => 'application/x-stuffit',\n 'tar' => 'application/x-tar',\n 'tgz' => 'application/x-tar',\n 'xht' => 'application/xhtml+xml',\n 'xhtml' => 'application/xhtml+xml',\n 'zip' => 'application/zip',\n 'mid' => 'audio/midi',\n 'midi' => 'audio/midi',\n 'mp2' => 'audio/mpeg',\n 'mp3' => 'audio/mpeg',\n 'mpga' => 'audio/mpeg',\n 'aif' => 'audio/x-aiff',\n 'aifc' => 'audio/x-aiff',\n 'aiff' => 'audio/x-aiff',\n 'ram' => 'audio/x-pn-realaudio',\n 'rm' => 'audio/x-pn-realaudio',\n 'rpm' => 'audio/x-pn-realaudio-plugin',\n 'ra' => 'audio/x-realaudio',\n 'wav' => 'audio/x-wav',\n 'bmp' => 'image/bmp',\n 'gif' => 'image/gif',\n 'jpeg' => 'image/jpeg',\n 'jpe' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'eml' => 'message/rfc822',\n 'css' => 'text/css',\n 'html' => 'text/html',\n 'htm' => 'text/html',\n 'shtml' => 'text/html',\n 'log' => 'text/plain',\n 'text' => 'text/plain',\n 'txt' => 'text/plain',\n 'rtx' => 'text/richtext',\n 'rtf' => 'text/rtf',\n 'vcf' => 'text/vcard',\n 'vcard' => 'text/vcard',\n 'xml' => 'text/xml',\n 'xsl' => 'text/xml',\n 'mpeg' => 'video/mpeg',\n 'mpe' => 'video/mpeg',\n 'mpg' => 'video/mpeg',\n 'mov' => 'video/quicktime',\n 'qt' => 'video/quicktime',\n 'rv' => 'video/vnd.rn-realvideo',\n 'avi' => 'video/x-msvideo',\n 'movie' => 'video/x-sgi-movie'\n );\n if (array_key_exists(strtolower($ext), $mimes)) {\n return $mimes[strtolower($ext)];\n }\n return 'application/octet-stream';\n }", "public static function mimeTypeExtensions ()\r\n\t{\r\n\t\t# Define the MIME Types; list taken from www.mimetype.org\r\n\t\t$mimeTypes = '\r\n\t\tapplication/SLA\tstl\r\n\t\tapplication/STEP\tstep\r\n\t\tapplication/STEP\tstp\r\n\t\tapplication/acad\tdwg\r\n\t\tapplication/andrew-inset\tez\r\n\t\tapplication/clariscad\tccad\r\n\t\tapplication/drafting\tdrw\r\n\t\tapplication/dsptype\ttsp\r\n\t\tapplication/dxf\tdxf\r\n\t\tapplication/excel\txls\r\n\t\tapplication/i-deas\tunv\r\n\t\tapplication/java-archive\tjar\r\n\t\tapplication/mac-binhex40\thqx\r\n\t\tapplication/mac-compactpro\tcpt\r\n\t\tapplication/vnd.ms-powerpoint\tpot\r\n\t\tapplication/vnd.ms-powerpoint\tpps\r\n\t\tapplication/vnd.ms-powerpoint\tppt\r\n\t\tapplication/vnd.ms-powerpoint\tppz\r\n\t\tapplication/msword\tdoc\r\n\t\tapplication/octet-stream\tbin\r\n\t\tapplication/octet-stream\tclass\r\n\t\tapplication/octet-stream\tdms\r\n\t\tapplication/octet-stream\texe\r\n\t\tapplication/octet-stream\tlha\r\n\t\tapplication/octet-stream\tlzh\r\n\t\tapplication/oda\toda\r\n\t\tapplication/ogg\togg\r\n\t\tapplication/ogg\togm\r\n\t\tapplication/pdf\tpdf\r\n\t\tapplication/pgp\tpgp\r\n\t\tapplication/postscript\tai\r\n\t\tapplication/postscript\teps\r\n\t\tapplication/postscript\tps\r\n\t\tapplication/pro_eng\tprt\r\n\t\tapplication/rtf\trtf\r\n\t\tapplication/set\tset\r\n\t\tapplication/smil\tsmi\r\n\t\tapplication/smil\tsmil\r\n\t\tapplication/solids\tsol\r\n\t\tapplication/vda\tvda\r\n\t\tapplication/vnd.mif\tmif\r\n\t\tapplication/vnd.ms-excel\txlc\r\n\t\tapplication/vnd.ms-excel\txll\r\n\t\tapplication/vnd.ms-excel\txlm\r\n\t\tapplication/vnd.ms-excel\txls\r\n\t\tapplication/vnd.ms-excel\txlw\r\n\t\tapplication/vnd.rim.cod\tcod\r\n\t\tapplication/x-arj-compressed\tarj\r\n\t\tapplication/x-bcpio\tbcpio\r\n\t\tapplication/x-cdlink\tvcd\r\n\t\tapplication/x-chess-pgn\tpgn\r\n\t\tapplication/x-cpio\tcpio\r\n\t\tapplication/x-csh\tcsh\r\n\t\tapplication/x-debian-package\tdeb\r\n\t\tapplication/x-director\tdcr\r\n\t\tapplication/x-director\tdir\r\n\t\tapplication/x-director\tdxr\r\n\t\tapplication/x-dvi\tdvi\r\n\t\tapplication/x-freelance\tpre\r\n\t\tapplication/x-futuresplash\tspl\r\n\t\tapplication/x-gtar\tgtar\r\n\t\tapplication/x-gunzip\tgz\r\n\t\tapplication/x-gzip\tgz\r\n\t\tapplication/x-hdf\thdf\r\n\t\tapplication/x-ipix\tipx\r\n\t\tapplication/x-ipscript\tips\r\n\t\tapplication/x-javascript\tjs\r\n\t\tapplication/x-koan\tskd\r\n\t\tapplication/x-koan\tskm\r\n\t\tapplication/x-koan\tskp\r\n\t\tapplication/x-koan\tskt\r\n\t\tapplication/x-latex\tlatex\r\n\t\tapplication/x-lisp\tlsp\r\n\t\tapplication/x-lotusscreencam\tscm\r\n\t\tapplication/x-mif\tmif\r\n\t\tapplication/x-msdos-program\tbat\r\n\t\tapplication/x-msdos-program\tcom\r\n\t\tapplication/x-msdos-program\texe\r\n\t\tapplication/x-netcdf\tcdf\r\n\t\tapplication/x-netcdf\tnc\r\n\t\tapplication/x-perl\tpl\r\n\t\tapplication/x-perl\tpm\r\n\t\tapplication/x-rar-compressed\trar\r\n\t\tapplication/x-sh\tsh\r\n\t\tapplication/x-shar\tshar\r\n\t\tapplication/x-shockwave-flash\tswf\r\n\t\tapplication/x-stuffit\tsit\r\n\t\tapplication/x-sv4cpio\tsv4cpio\r\n\t\tapplication/x-sv4crc\tsv4crc\r\n\t\tapplication/x-tar-gz\ttar.gz\r\n\t\tapplication/x-tar-gz\ttgz\r\n\t\tapplication/x-tar\ttar\r\n\t\tapplication/x-tcl\ttcl\r\n\t\tapplication/x-tex\ttex\r\n\t\tapplication/x-texinfo\ttexi\r\n\t\tapplication/x-texinfo\ttexinfo\r\n\t\tapplication/x-troff-man\tman\r\n\t\tapplication/x-troff-me\tme\r\n\t\tapplication/x-troff-ms\tms\r\n\t\tapplication/x-troff\troff\r\n\t\tapplication/x-troff\tt\r\n\t\tapplication/x-troff\ttr\r\n\t\tapplication/x-ustar\tustar\r\n\t\tapplication/x-wais-source\tsrc\r\n\t\tapplication/x-zip-compressed\tzip\r\n\t\tapplication/zip\tzip\r\n\t\taudio/TSP-audio\ttsi\r\n\t\taudio/basic\tau\r\n\t\taudio/basic\tsnd\r\n\t\taudio/midi\tkar\r\n\t\taudio/midi\tmid\r\n\t\taudio/midi\tmidi\r\n\t\taudio/mpeg\tmp2\r\n\t\taudio/mpeg\tmp3\r\n\t\taudio/mpeg\tmpga\r\n\t\taudio/ulaw\tau\r\n\t\taudio/x-aiff\taif\r\n\t\taudio/x-aiff\taifc\r\n\t\taudio/x-aiff\taiff\r\n\t\taudio/x-mpegurl\tm3u\r\n\t\taudio/x-ms-wax\twax\r\n\t\taudio/x-ms-wma\twma\r\n\t\taudio/x-pn-realaudio-plugin\trpm\r\n\t\taudio/x-pn-realaudio\tram\r\n\t\taudio/x-pn-realaudio\trm\r\n\t\taudio/x-realaudio\tra\r\n\t\taudio/x-wav\twav\r\n\t\tchemical/x-pdb\tpdb\r\n\t\tchemical/x-pdb\txyz\r\n\t\timage/cmu-raster\tras\r\n\t\timage/gif\tgif\r\n\t\timage/ief\tief\r\n\t\timage/jpeg\tjpe\r\n\t\timage/jpeg\tjpeg\r\n\t\timage/jpeg\tjpg\r\n\t\timage/png\tpng\r\n\t\timage/tiff\ttif tiff\r\n\t\timage/tiff\ttif\r\n\t\timage/tiff\ttiff\r\n\t\timage/x-cmu-raster\tras\r\n\t\timage/x-portable-anymap\tpnm\r\n\t\timage/x-portable-bitmap\tpbm\r\n\t\timage/x-portable-graymap\tpgm\r\n\t\timage/x-portable-pixmap\tppm\r\n\t\timage/x-rgb\trgb\r\n\t\timage/x-xbitmap\txbm\r\n\t\timage/x-xpixmap\txpm\r\n\t\timage/x-xwindowdump\txwd\r\n\t\tmodel/iges\tiges\r\n\t\tmodel/iges\tigs\r\n\t\tmodel/mesh\tmesh\r\n\t\tmodel/mesh\tmsh\r\n\t\tmodel/mesh\tsilo\r\n\t\tmodel/vrml\tvrml\r\n\t\tmodel/vrml\twrl\r\n\t\ttext/css\tcss\r\n\t\ttext/html\thtm\r\n\t\ttext/html\thtml htm\r\n\t\ttext/html\thtml\r\n\t\ttext/plain\tasc txt\r\n\t\ttext/plain\tasc\r\n\t\ttext/plain\tc\r\n\t\ttext/plain\tcc\r\n\t\ttext/plain\tf90\r\n\t\ttext/plain\tf\r\n\t\ttext/plain\th\r\n\t\ttext/plain\thh\r\n\t\ttext/plain\tm\r\n\t\ttext/plain\ttxt\r\n\t\ttext/richtext\trtx\r\n\t\ttext/rtf\trtf\r\n\t\ttext/sgml\tsgm\r\n\t\ttext/sgml\tsgml\r\n\t\ttext/tab-separated-values\ttsv\r\n\t\ttext/vnd.sun.j2me.app-descriptor\tjad\r\n\t\ttext/x-setext\tetx\r\n\t\ttext/xml\txml// This is disabled because XML has several different MIME Types\r\n\t\tvideo/dl\tdl\r\n\t\tvideo/fli\tfli\r\n\t\tvideo/flv\tflv\r\n\t\tvideo/gl\tgl\r\n\t\tvideo/mpeg\tmp2\r\n\t\tvideo/mpeg\tmpe\r\n\t\tvideo/mpeg\tmpeg\r\n\t\tvideo/mpeg\tmpg\r\n\t\tvideo/quicktime\tmov\r\n\t\tvideo/quicktime\tqt\r\n\t\tvideo/vnd.vivo\tviv\r\n\t\tvideo/vnd.vivo\tvivo\r\n\t\tvideo/x-fli\tfli\r\n\t\tvideo/x-ms-asf\tasf\r\n\t\tvideo/x-ms-asx\tasx\r\n\t\tvideo/x-ms-wmv\twmv\r\n\t\tvideo/x-ms-wmx\twmx\r\n\t\tvideo/x-ms-wvx\twvx\r\n\t\tvideo/x-msvideo\tavi\r\n\t\tvideo/x-sgi-movie\tmovie\r\n\t\twww/mime\tmime\r\n\t\tx-conference/x-cooltalk\tice\r\n\t\tx-world/x-vrml\tvrm\r\n\t\tx-world/x-vrml\tvrml';\r\n\t\t\r\n\t\t# Parse the list as array ($extension => $mimeType, ... )\r\n\t\t$list = array ();\r\n\t\t$mimeTypes = explode (\"\\n\", trim ($mimeTypes));\r\n\t\tforeach ($mimeTypes as $index => $line) {\r\n\t\t\tlist ($mimeType, $extension) = explode (\"\\t\", trim ($line), 2);\r\n\t\t\tif (substr_count ($extension, ' ')) {continue;}\t// Limit of 2 for some extensions in the source listing have two listed, e.g. \"asc txt\"\r\n\t\t\t$list[$extension] = $mimeType;\r\n\t\t}\r\n\t\t\r\n\t\t# Return the list\r\n\t\treturn $list;\r\n\t}", "function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}", "public function wrongTypeFile()\n {\n return 'This type of file is not allowed';\n }", "public function it_shows_file_input_on_type_of_file()\n {\n // configure\n $inputs = [\n [\n 'type' => 'file',\n 'name' => 'tc',\n 'label' => 'Upload Terms and Conditions'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('type=\"file\"', false);\n }", "function get_file_type($file_mimetype)\n{\n // Get mimetype from file\n $mimetype = explode('/', $file_mimetype);\n\n switch ($mimetype[0]) {\n case 'image':\n return 'image';\n break;\n case 'video':\n return 'video';\n break;\n case 'audio':\n return 'audio';\n break;\n default:\n return 'file';\n }\n}", "function _mimetype($virtualpath) \r\n {\r\n\t\t\t$this->tx_cbywebdav_devlog(1,\"_mimetype: $virtualpath \",\"cby_webdav\",\"_mimetype\");\r\n\t\t\t$t3io=$this->CFG->t3io;\r\n\r\n if (@$t3io->T3IsDir($virtualpath)) {\r\n // directories are easy\r\n return \"httpd/unix-directory\"; \r\n } else if (function_exists(\"mime_content_type\")) {\r\n // use mime magic extension if available\r\n $mime_type = mime_content_type($virtualpath);\r\n } else if ($this->_can_execute(\"file\")) {\r\n // it looks like we have a 'file' command, \r\n // lets see it it does have mime support\r\n $fp = popen(\"file -i '$virtualpath' 2>/dev/null\", \"r\");\r\n $reply = fgets($fp);\r\n pclose($fp);\r\n \r\n // popen will not return an error if the binary was not found\r\n // and find may not have mime support using \"-i\"\r\n // so we test the format of the returned string \r\n \r\n // the reply begins with the requested filename\r\n if (!strncmp($reply, \"$virtualpath: \", strlen($virtualpath)+2)) { \r\n $reply = substr($reply, strlen($virtualpath)+2);\r\n // followed by the mime type (maybe including options)\r\n if (preg_match('|^[[:alnum:]_-]+/[[:alnum:]_-]+;?.*|', $reply, $matches)) {\r\n $mime_type = $matches[0];\r\n }\r\n }\r\n } \r\n \r\n if (empty($mime_type)) {\r\n // Fallback solution: try to guess the type by the file extension\r\n // TODO: add more ...\r\n // TODO: it has been suggested to delegate mimetype detection \r\n // to apache but this has at least three issues:\r\n // - works only with apache\r\n // - needs file to be within the document tree\r\n // - requires apache mod_magic \r\n // TODO: can we use the registry for this on Windows?\r\n // OTOH if the server is Windos the clients are likely to \r\n // be Windows, too, and tend do ignore the Content-Type\r\n // anyway (overriding it with information taken from\r\n // the registry)\r\n // TODO: have a seperate PEAR class for mimetype detection?\r\n switch (strtolower(strrchr(basename($virtualpath), \".\"))) {\r\n case \".html\":\r\n case \".textpic\":\r\n case \".txt\":\r\n case \".[unknown]\":\r\n $mime_type = \"text/html\";\r\n break;\r\n case \".gif\":\r\n $mime_type = \"image/gif\";\r\n break;\r\n case \".jpg\":\r\n $mime_type = \"image/jpeg\";\r\n break;\r\n default: \r\n $mime_type = \"application/octet-stream\";\r\n break;\r\n }\r\n }\r\n\t\t\t\t$this->tx_cbywebdav_devlog(1,\"_mimetype>: $mime_type \",\"cby_webdav\",\"_mimetype\");\r\n \r\n return $mime_type;\r\n }", "function atkGetMimeTypeFromFileExtension($filename)\n {\n $ext = strtolower(end(explode('.',$filename )));\n\n $mimetypes = array(\n 'ai' =>'application/postscript',\n 'aif' =>'audio/x-aiff',\n 'aifc' =>'audio/x-aiff',\n 'aiff' =>'audio/x-aiff',\n 'asc' =>'text/plain',\n 'atom' =>'application/atom+xml',\n 'avi' =>'video/x-msvideo',\n 'bcpio' =>'application/x-bcpio',\n 'bmp' =>'image/bmp',\n 'cdf' =>'application/x-netcdf',\n 'cgm' =>'image/cgm',\n 'cpio' =>'application/x-cpio',\n 'cpt' =>'application/mac-compactpro',\n 'crl' =>'application/x-pkcs7-crl',\n 'crt' =>'application/x-x509-ca-cert',\n 'csh' =>'application/x-csh',\n 'css' =>'text/css',\n 'dcr' =>'application/x-director',\n 'dir' =>'application/x-director',\n 'djv' =>'image/vnd.djvu',\n 'djvu' =>'image/vnd.djvu',\n 'doc' =>'application/msword',\n 'dtd' =>'application/xml-dtd',\n 'dvi' =>'application/x-dvi',\n 'dxr' =>'application/x-director',\n 'eps' =>'application/postscript',\n 'etx' =>'text/x-setext',\n 'ez' =>'application/andrew-inset',\n 'gif' =>'image/gif',\n 'gram' =>'application/srgs',\n 'grxml' =>'application/srgs+xml',\n 'gtar' =>'application/x-gtar',\n 'hdf' =>'application/x-hdf',\n 'hqx' =>'application/mac-binhex40',\n 'html' =>'text/html',\n 'html' =>'text/html',\n 'ice' =>'x-conference/x-cooltalk',\n 'ico' =>'image/x-icon',\n 'ics' =>'text/calendar',\n 'ief' =>'image/ief',\n 'ifb' =>'text/calendar',\n 'iges' =>'model/iges',\n 'igs' =>'model/iges',\n 'jpe' =>'image/jpeg',\n 'jpeg' =>'image/jpeg',\n 'jpg' =>'image/jpeg',\n 'js' =>'application/x-javascript',\n 'kar' =>'audio/midi',\n 'latex' =>'application/x-latex',\n 'm3u' =>'audio/x-mpegurl',\n 'man' =>'application/x-troff-man',\n 'mathml' =>'application/mathml+xml',\n 'me' =>'application/x-troff-me',\n 'mesh' =>'model/mesh',\n 'mid' =>'audio/midi',\n 'midi' =>'audio/midi',\n 'mif' =>'application/vnd.mif',\n 'mov' =>'video/quicktime',\n 'movie' =>'video/x-sgi-movie',\n 'mp2' =>'audio/mpeg',\n 'mp3' =>'audio/mpeg',\n 'mpe' =>'video/mpeg',\n 'mpeg' =>'video/mpeg',\n 'mpg' =>'video/mpeg',\n 'mpga' =>'audio/mpeg',\n 'ms' =>'application/x-troff-ms',\n 'msh' =>'model/mesh',\n 'mxu m4u' =>'video/vnd.mpegurl',\n 'nc' =>'application/x-netcdf',\n 'oda' =>'application/oda',\n 'ogg' =>'application/ogg',\n 'pbm' =>'image/x-portable-bitmap',\n 'pdb' =>'chemical/x-pdb',\n 'pdf' =>'application/pdf',\n 'pgm' =>'image/x-portable-graymap',\n 'pgn' =>'application/x-chess-pgn',\n 'php' =>'application/x-httpd-php',\n 'php4' =>'application/x-httpd-php',\n 'php3' =>'application/x-httpd-php',\n 'phtml' =>'application/x-httpd-php',\n 'phps' =>'application/x-httpd-php-source',\n 'png' =>'image/png',\n 'pnm' =>'image/x-portable-anymap',\n 'ppm' =>'image/x-portable-pixmap',\n 'ppt' =>'application/vnd.ms-powerpoint',\n 'ps' =>'application/postscript',\n 'qt' =>'video/quicktime',\n 'ra' =>'audio/x-pn-realaudio',\n 'ram' =>'audio/x-pn-realaudio',\n 'ras' =>'image/x-cmu-raster',\n 'rdf' =>'application/rdf+xml',\n 'rgb' =>'image/x-rgb',\n 'rm' =>'application/vnd.rn-realmedia',\n 'roff' =>'application/x-troff',\n 'rtf' =>'text/rtf',\n 'rtx' =>'text/richtext',\n 'sgm' =>'text/sgml',\n 'sgml' =>'text/sgml',\n 'sh' =>'application/x-sh',\n 'shar' =>'application/x-shar',\n 'shtml' =>'text/html',\n 'silo' =>'model/mesh',\n 'sit' =>'application/x-stuffit',\n 'skd' =>'application/x-koan',\n 'skm' =>'application/x-koan',\n 'skp' =>'application/x-koan',\n 'skt' =>'application/x-koan',\n 'smi' =>'application/smil',\n 'smil' =>'application/smil',\n 'snd' =>'audio/basic',\n 'spl' =>'application/x-futuresplash',\n 'src' =>'application/x-wais-source',\n 'sv4cpio' =>'application/x-sv4cpio',\n 'sv4crc' =>'application/x-sv4crc',\n 'svg' =>'image/svg+xml',\n 'swf' =>'application/x-shockwave-flash',\n 't' =>'application/x-troff',\n 'tar' =>'application/x-tar',\n 'tcl' =>'application/x-tcl',\n 'tex' =>'application/x-tex',\n 'texi' =>'application/x-texinfo',\n 'texinfo' =>'application/x-texinfo',\n 'tgz' =>'application/x-tar',\n 'tif' =>'image/tiff',\n 'tiff' =>'image/tiff',\n 'tr' =>'application/x-troff',\n 'tsv' =>'text/tab-separated-values',\n 'txt' =>'text/plain',\n 'ustar' =>'application/x-ustar',\n 'vcd' =>'application/x-cdlink',\n 'vrml' =>'model/vrml',\n 'vxml' =>'application/voicexml+xml',\n 'wav' =>'audio/x-wav',\n 'wbmp' =>'image/vnd.wap.wbmp',\n 'wbxml' =>'application/vnd.wap.wbxml',\n 'wml' =>'text/vnd.wap.wml',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmls' =>'text/vnd.wap.wmlscript',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wrl' =>'model/vrml',\n 'xbm' =>'image/x-xbitmap',\n 'xht' =>'application/xhtml+xml',\n 'xhtml' =>'application/xhtml+xml',\n 'xls' =>'application/vnd.ms-excel',\n 'xml xsl' =>'application/xml',\n 'xpm' =>'image/x-xpixmap',\n 'xslt' =>'application/xslt+xml',\n 'xul' =>'application/vnd.mozilla.xul+xml',\n 'xwd' =>'image/x-xwindowdump',\n 'xyz' =>'chemical/x-xyz',\n 'zip' =>'application/zip'\n );\n\n $ext = trim(strtolower($ext));\n if (array_key_exists($ext,$mimetypes))\n {\n atkdebug(\"Filetype for $filename is {$mimetypes[$ext]}\");\n return $mimetypes[$ext];\n }\n else\n {\n atkdebug(\"Filetype for $filename could not be found. Returning application/octet-stream.\");\n return \"application/octet-stream\";\n }\n }", "function provide_file($filename) {\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n $MODE = 'txt';\n $attachment = \"attachment; \";\n if ($ext != '') {\n $MODE = $ext;\n }\n switch ($MODE) {\n case \"bz2\": $ctype=\"application/x-bzip2\"; break;\n case \"css\": $ctype=\"text/css\"; break;\n case \"gz\": $ctype=\"application/x-gzip\"; break;\n case \"gzip\": $ctype=\"application/x-gzip\"; break;\n case \"java\": $ctype=\"text/x-java-source\"; $attachment=\"\"; break;\n case \"tgz\": $ctype=\"application/x-compressed\"; break;\n case \"pdf\": $ctype=\"application/pdf\"; $attachment=\"\"; break;\n case \"zip\": $ctype=\"application/zip\"; break;\n case \"doc\": $ctype=\"application/msword\"; break;\n case \"docx\": $ctype=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"; break;\n case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\n case \"xlsx\": $ctype=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"; break;\n case \"ppt\": $ctype=\"application/vnd.ms-powerpoint\"; break;\n case \"pptx\": $ctype=\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"; break;\n case \"svg\": $ctype=\"image/svg+xml\"; $attachment=\"\"; break;\n case \"gif\": $ctype=\"image/gif\"; $attachment=\"\"; break;\n case \"png\": $ctype=\"image/png\"; $attachment=\"\"; break;\n case \"jpe\": case \"jpeg\":\n case \"jpg\": $ctype=\"image/jpg\"; $attachment=\"\"; break;\n case \"sql\":\n case \"txt\": $ctype=\"text/plain\"; $attachment=\"\"; break;\n case \"htm\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"html\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"htmls\": $ctype=\"text/html\"; $attachment=\"\"; break;\n default: $ctype=\"application/octet-stream\";\n }\n\n header(\"Content-Type: $ctype\");\n header('Content-Disposition: '.$attachment.'filename=\"'.basename($filename).'\"');\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\n echo file_get_contents($filename);\n\n }", "public function get_allowed_content_object_types()\n {\n return array(File::class);\n }", "public function getFile($type = 'document')\n {\n return $this->files()->where('type' , '=', $type)->get()->first();\n }", "function get_translatable_documents($icl_post_types)\n {\n }", "function getMIMEType( $sFileName = \"\" ) { \r\n $sFileName = strtolower( trim( $sFileName ) ); \r\n if( ! strlen( $sFileName ) ) return \"\"; \r\n \r\n $aMimeType = array( \r\n \"txt\" => \"text/plain\" , \r\n \"pdf\" => \"application/pdf\" , \r\n \"zip\" => \"application/x-compressed\" , \r\n \r\n \"html\" => \"text/html\" , \r\n \"htm\" => \"text/html\" , \r\n \r\n \"avi\" => \"video/avi\" , \r\n \"mpg\" => \"video/mpeg \" , \r\n \"wav\" => \"audio/wav\" , \r\n \r\n \"jpg\" => \"image/jpeg \" , \r\n \"gif\" => \"image/gif\" , \r\n \"tif\" => \"image/tiff \" , \r\n \"png\" => \"image/x-png\" , \r\n \"bmp\" => \"image/bmp\" \r\n ); \r\n $aFile = split( \"\\.\", basename( $sFileName ) ) ; \r\n $nDiminson = count( $aFile ) ; \r\n $sExt = $aFile[ $nDiminson - 1 ] ; // get last part: like \".tar.zip\", return \"zip\" \r\n \r\n return ( $nDiminson > 1 ) ? $aMimeType[ $sExt ] : \"\"; \r\n}", "public function test_listUnsupportedFileTypes() {\n\n }", "function my_custom_mime_types( $mimes ) {\n\t$mimes['svg'] = 'image/svg+xml';\n\t$mimes['svgz'] = 'image/svg+xml';\n\t$mimes['doc'] = 'application/msword';\n\t \n\t// Optional. Remove a mime type.\n\tunset( $mimes['exe'] );\n\t \n\treturn $mimes;\n\t}", "function getMime($ext) {\n\t\t$knownExts = array(\n\t\t'gif' => 'image/gif',\n\t\t'jpg' => 'image/jpeg',\n\t\t'jpeg' => 'image/jpeg',\n\t\t'png' => 'image/png',\n\t\t'psd' => 'image/psd',\n\t\t'zip' => 'application/x-zip-compressed',\n\t\t'rar' => 'application/x-rar-compressed',\n\t\t'7z' => 'application/x-7z-compressed',\n\t\t'doc' => 'application/msword',\n\t\t'docx' => 'application/msword',\n\t\t'odt' => 'application/vnd.oasis.opendocument.text',\n\t\t'rtf' => 'text/richtext',\n\t\t'swf' => 'application/x-shockwave-flash',\n\t\t'tif' => 'image/tiff',\n\t\t'au' => 'audio/basic',\n\t\t'pdf' => 'application/pdf',\n\t\t'mp3' => 'audio/mpeg',\n\t\t'ogg' => 'audio/ogg',\n\t\t'ico' => 'image/x-icon',\n\t\t'mpg' => 'application/mpeg',\n\t\t'mpeg' => 'application/mpeg',\n\t\t'qt' => 'video/quicktime',\n\t\t'mov' => 'video/quicktime',\n\t\t'mp4' => 'video/mpeg',\n\t\t'avi' => 'video/avi',\n\t\t'mkv' => 'video/x-matroska',\n\t\t'txt' => 'text/plain',\n\t\t'bat' => 'text/plain',\n\t\t'html' => 'text/html',\n\t\t'htm' => 'text/html',\n\t\t'xml' => 'application/xml',\n\t\t'xls' => 'application/vnd.ms-excel',\n\t\t'wmv' => 'video/x-ms-wmv',\n\t\t'pps' => 'application/vnd.ms-powerpoint',\n\t\t'ppt' => 'application/vnd.ms-powerpoint',\n\t\t'exe' => 'application/octet-stream',\n\t\t'msi' => 'application/x-ole-storage',\n\t\t'ps' => 'application/postscript',\n\t\t'qif' => 'image/x-quicktime',\n\t\t'ai' => 'application/postscript',\n\t\t'wma' => 'audio/x-ms-wma',\n\t\t'css' => 'text/css',\n\t\t'js' => 'text/javascript',\n\t\t'rss' => 'application/rss+xml',\n\t\t'json' => 'text/javascript'\n\t\t);\n\t\treturn isset($knownExts[$ext])?$knownExts[$ext]:\"\";\n\t}", "public function files();", "public function files();", "public function files();", "function modify_post_mime_types( $post_mime_types ) {\n\t // then we define an array with the label values\n\t $post_mime_types['application/pdf'] = array( __( 'PDFs', 'SKEL_THEME_PREFIX' ), __( 'Manage PDFs', 'SKEL_THEME_PREFIX' ), _n_noop( 'PDF <span class=\"count\">(%s)</span>', 'PDFs <span class=\"count\">(%s)</span>' ) );\n\t // then we return the $post_mime_types variable\n\t return $post_mime_types;\n\t}", "function add_file_resume()\n\t{\n\t\t$this->load->library('upload');\n\t\t$this->load->helper('username_folder_helper');\n\t\t\n\t\t$username = $this->session->userdata(\"username\");\n\t\t\n\t\t//$type = explode(\"/\",$_FILES['file_resume']['type']);\n\t\t$new_file_name = strtolower(str_replace(\" \",\"-\",$_FILES['file_resume']['name']));\n\t\t\n\t\t$mime_types = array(\n\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n /* 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-flash',\n 'flv' => 'video/x-flv',*/\n\n /* // images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n\n // archives\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n\n // audio/video\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n\n // adobe*/\n 'pdf' => 'application/pdf',\n /*'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript', */\n\n // ms office\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n //'xls' => 'application/vnd.ms-excel',\n //'ppt' => 'application/vnd.ms-powerpoint',\n\n // open office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n //'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n\t\t\n\t\t//cari nama file untuk nama folder \n\t\t$type = array_search($_FILES['file_resume']['type'],$mime_types);\n\t\t\n\t\t$configupload['upload_path'] = pathup(\"document/$username/$type\"); // uplaod path itu gak usah pake nama filenya segala \n\t\t$configupload['file_name'] = $new_file_name;\n\t\t$configupload['allowed_types'] = \"pdf|doc|docx|html\";\n\t\t$configupload['max_size']\t= 1024 * 1024 * 1024 * 100; // 10MB;\n\t\t//echo $_FILES['picture']['size']; exit;\n\t\t//$configupload['max_width'] = '1024';\n\t\t//$configupload['max_height'] = '1024';\n\t\t\n\t\t\n\t\t\n\t\t//print $configupload['upload_path'];\n\t\t$this->upload->initialize($configupload);\n\t\t//print_r($configupload); exit;\n\t\t$file_resume = 'file_resume'; // name dari form file\n\t\t\n\t\t// buat foldernya dahulu\n\t\t// dari username_folder_helper\n\t\tmake_username_folder_doc($username,$type);\n\t\t\n\t\t/*check folder selesai */\n\t\t\n\t\t$this->upload->do_upload($file_resume);\n\t\t$dt_resume = $this->upload->data();\n\t\t\n\t\t\n\t\t//var_dump(is_dir(\"../infrasset/document/alhusna_99/\"));\n\t\t//echo \"<hr>\";\n\t\t//print_r($_FILES['file_resume']);\n\t\t//echo \"<hr>\";\n\t\t//print_r($configupload);\n\t\t//echo \"<hr>\";\n\t\t//print_r($dataphoto);\n\t\techo $error_upload = $this->upload->display_errors('<p class=\"alert alert-danger\"> Upload : ', '</p>');\n\t\t\n\t\tif(empty($error_upload))\n\t\t{\n\t\t\t$id_pelaut = $this->session->userdata(\"id_user\");\n\t\t\t$this->resume_model->add_file_resume($id_pelaut,$dt_resume);\n\t\t\t//header(\"location:\".base_url(\"seaman/resume/resume_upload\"));\n\t\t\techo \"<script>location.reload()</script>\";\n\t\t}\n\t}", "function typeoffile($file){ //list( $mutes, $date, $type, $ext) = explode( '.', $file );\n $type= explode( '.', $file )[2];\n return $type;\n}", "function mime2ext($mime){\n $all_mimes = '{\n \"png\":[\"image\\/png\",\"image\\/x-png\"],\n \"bmp\":[\"image\\/bmp\",\"image\\/x-bmp\",\"image\\/x-bitmap\",\"image\\/x-xbitmap\",\"image\\/x-win-bitmap\",\"image\\/x-windows-bmp\",\"image\\/ms-bmp\",\"image\\/x-ms-bmp\",\"application\\/bmp\",\"application\\/x-bmp\",\"application\\/x-win-bitmap\"],\n \"gif\":[\"image\\/gif\"],\n \"jpeg\":[\"image\\/jpeg\",\"image\\/pjpeg\"],\n \"xspf\":[\"application\\/xspf+xml\"],\n \"vlc\":[\"application\\/videolan\"],\n \"wmv\":[\"video\\/x-ms-wmv\",\"video\\/x-ms-asf\"],\n \"au\":[\"audio\\/x-au\"],\n \"ac3\":[\"audio\\/ac3\"],\n \"flac\":[\"audio\\/x-flac\"],\n \"ogg\":[\"audio\\/ogg\",\"video\\/ogg\",\"application\\/ogg\"],\n \"kmz\":[\"application\\/vnd.google-earth.kmz\"],\n \"kml\":[\"application\\/vnd.google-earth.kml+xml\"],\n \"rtx\":[\"text\\/richtext\"],\n \"rtf\":[\"text\\/rtf\"],\n \"jar\":[\"application\\/java-archive\",\"application\\/x-java-application\",\"application\\/x-jar\"],\n \"zip\":[\"application\\/x-zip\",\"application\\/zip\",\"application\\/x-zip-compressed\",\"application\\/s-compressed\",\"multipart\\/x-zip\"],\n \"7zip\":[\"application\\/x-compressed\"],\n \"xml\":[\"application\\/xml\",\"text\\/xml\"],\n \"svg\":[\"image\\/svg+xml\"],\n \"3g2\":[\"video\\/3gpp2\"],\n \"3gp\":[\"video\\/3gp\",\"video\\/3gpp\"],\n \"mp4\":[\"video\\/mp4\"],\n \"m4a\":[\"audio\\/x-m4a\"],\n \"f4v\":[\"video\\/x-f4v\"],\n \"flv\":[\"video\\/x-flv\"],\n \"webm\":[\"video\\/webm\"],\n \"aac\":[\"audio\\/x-acc\"],\n \"m4u\":[\"application\\/vnd.mpegurl\"],\n \"pdf\":[\"application\\/pdf\",\"application\\/octet-stream\"],\n \"pptx\":[\"application\\/vnd.openxmlformats-officedocument.presentationml.presentation\"],\n \"ppt\":[\"application\\/powerpoint\",\"application\\/vnd.ms-powerpoint\",\"application\\/vnd.ms-office\",\n \"application\\/msword\"],\n \"docx\":[\"application\\/vnd.openxmlformats-officedocument.wordprocessingml.document\"],\n \"xlsx\":[\"application\\/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\"application\\/vnd.ms-excel\"],\n \"xl\":[\"application\\/excel\"],\n \"xls\":[\"application\\/msexcel\",\"application\\/x-msexcel\",\"application\\/x-ms-excel\",\"application\\/x-excel\",\"application\\/x-dos_ms_excel\",\"application\\/xls\",\"application\\/x-xls\"],\n \"xsl\":[\"text\\/xsl\"],\"mpeg\":[\"video\\/mpeg\"],\n \"mov\":[\"video\\/quicktime\"],\n \"avi\":[\"video\\/x-msvideo\",\"video\\/msvideo\",\"video\\/avi\",\"application\\/x-troff-msvideo\"],\n \"movie\":[\"video\\/x-sgi-movie\"],\n \"log\":[\"text\\/x-log\"],\n \"txt\":[\"text\\/plain\"],\n \"css\":[\"text\\/css\"],\n \"html\":[\"text\\/html\"],\n \"wav\":[\"audio\\/x-wav\",\"audio\\/wave\",\"audio\\/wav\"],\n \"xhtml\":[\"application\\/xhtml+xml\"],\n \"tar\":[\"application\\/x-tar\"],\n \"tgz\":[\"application\\/x-gzip-compressed\"],\n \"psd\":[\"application\\/x-photoshop\",\n \"image\\/vnd.adobe.photoshop\"],\n \"exe\":[\"application\\/x-msdownload\"],\n \"js\":[\"application\\/x-javascript\"],\n \"mp3\":[\"audio\\/mpeg\",\"audio\\/mpg\",\"audio\\/mpeg3\",\"audio\\/mp3\"],\n \"rar\":[\"application\\/x-rar\",\"application\\/rar\",\"application\\/x-rar-compressed\"],\n \"gzip\":[\"application\\/x-gzip\"],\n \"hqx\":[\"application\\/mac-binhex40\",\"application\\/mac-binhex\",\"application\\/x-binhex40\",\"application\\/x-mac-binhex40\"],\n \"cpt\":[\"application\\/mac-compactpro\"],\n \"bin\":[\"application\\/macbinary\",\"application\\/mac-binary\",\"application\\/x-binary\",\"application\\/x-macbinary\"],\n \"oda\":[\"application\\/oda\"],\n \"ai\":[\"application\\/postscript\"],\n \"smil\":[\"application\\/smil\"],\n \"mif\":[\"application\\/vnd.mif\"],\n \"wbxml\":[\"application\\/wbxml\"],\n \"wmlc\":[\"application\\/wmlc\"],\n \"dcr\":[\"application\\/x-director\"],\n \"dvi\":[\"application\\/x-dvi\"],\n \"gtar\":[\"application\\/x-gtar\"],\n \"php\":[\"application\\/x-httpd-php\",\"application\\/php\",\"application\\/x-php\",\"text\\/php\",\"text\\/x-php\",\"application\\/x-httpd-php-source\"],\n \"swf\":[\"application\\/x-shockwave-flash\"],\n \"sit\":[\"application\\/x-stuffit\"],\n \"z\":[\"application\\/x-compress\"],\n \"mid\":[\"audio\\/midi\"],\n \"aif\":[\"audio\\/x-aiff\",\"audio\\/aiff\"],\n \"ram\":[\"audio\\/x-pn-realaudio\"],\n \"rpm\":[\"audio\\/x-pn-realaudio-plugin\"],\n \"ra\":[\"audio\\/x-realaudio\"],\n \"rv\":[\"video\\/vnd.rn-realvideo\"],\n \"jp2\":[\"image\\/jp2\",\"video\\/mj2\",\"image\\/jpx\",\"image\\/jpm\"],\n \"tiff\":[\"image\\/tiff\"],\n \"eml\":[\"message\\/rfc822\"],\n \"pem\":[\"application\\/x-x509-user-cert\",\"application\\/x-pem-file\"],\n \"p10\":[\"application\\/x-pkcs10\",\"application\\/pkcs10\"],\n \"p12\":[\"application\\/x-pkcs12\"],\n \"p7a\":[\"application\\/x-pkcs7-signature\"],\n \"p7c\":[\"application\\/pkcs7-mime\",\"application\\/x-pkcs7-mime\"],\n \"p7r\":[\"application\\/x-pkcs7-certreqresp\"],\n \"p7s\":[\"application\\/pkcs7-signature\"],\n \"crt\":[\"application\\/x-x509-ca-cert\",\"application\\/pkix-cert\"],\n \"crl\":[\"application\\/pkix-crl\",\"application\\/pkcs-crl\"],\n \"pgp\":[\"application\\/pgp\"],\n \"gpg\":[\"application\\/gpg-keys\"],\n \"rsa\":[\"application\\/x-pkcs7\"],\n \"ics\":[\"text\\/calendar\"],\n \"zsh\":[\"text\\/x-scriptzsh\"],\n \"cdr\":[\"application\\/cdr\",\"application\\/coreldraw\",\"application\\/x-cdr\",\"application\\/x-coreldraw\",\"image\\/cdr\",\"image\\/x-cdr\",\"zz-application\\/zz-winassoc-cdr\"],\n \"wma\":[\"audio\\/x-ms-wma\"],\n \"vcf\":[\"text\\/x-vcard\"],\n \"srt\":[\"text\\/srt\"],\n \"vtt\":[\"text\\/vtt\"],\n \"ico\":[\"image\\/x-icon\",\"image\\/x-ico\",\"image\\/vnd.microsoft.icon\"],\n \"csv\":[\"text\\/x-comma-separated-values\",\"text\\/comma-separated-values\",\"application\\/vnd.msexcel\"],\n \"json\":[\"application\\/json\",\"text\\/json\"]\n }';\n $all_mimes = json_decode($all_mimes,true);\n foreach ($all_mimes as $key => $value) {\n if(array_search($mime,$value) !== false) return $key;\n }\n return false;\n}", "public function verifyFile(){\n if (isset($_POST[\"submitbutton\"])){//if submit button is pressed\n if ($_FILES[\"fileSelectField\"][\"type\"] != \"application/pdf\"){//checks file type\n return \"File must be a pdf file\";\n }\n else if ($_FILES[\"fileSelectField\"][\"size\"] > 100000){//checks file size\n return \"File is too big\";\n }\n else {//runs function to add file if no problems\n return $this->addFile();\n }\n }\n }", "private function isGoogleDocFile($file) {\n\t\treturn $this->getGoogleDocExtension($file->getMimeType()) !== '';\n\t}", "function hook_file_type_alter(&$types, $file) {\n // Choose a specific, non-first, file type.\n $types = array($types[4]);\n}", "public function document_by_type(){\n $folders = Folder::orderBy('id', 'desc')->get();\n\n //print_r(\"<pre>\");var_dump($folders); die();\n\n\n $files[] = DB::table('files')\n ->select(DB::raw('count(*) as file_id, files.id'))\n ->groupBy('files.id')\n ->get();\n\n\n $users = User::orderBy('id','desc')->get();\n\n $posts = DB::table('posts')\n ->leftJoin('users', 'posts.user_id', '=', 'users.id')\n ->leftJoin('iso_management_systems', 'posts.iso_management_id', '=', 'iso_management_systems.id')\n ->select('posts.*', 'users.first_name', 'users.last_name', 'users.profile_image', 'iso_management_systems.name')\n ->orderBy('posts.id', 'desc')\n ->get();\n\n $tasks = DB::table('tasks')\n ->leftJoin('users', 'tasks.user_id', '=', 'users.id')\n ->leftJoin('projects', 'tasks.project_id', '=', 'projects.id')\n ->select('tasks.*', 'users.first_name', 'users.last_name', 'users.profile_image', 'projects.project_name')\n ->orderBy('tasks.id', 'desc')\n ->get();\n\n $notes = DB::table('notes')\n ->leftJoin('users', 'notes.user_id', '=', 'users.id')\n ->select('notes.*', 'users.first_name', 'users.last_name', 'users.profile_image')\n ->orderBy('notes.id', 'desc')\n ->get();\n\n $colors = ColorSettings::orderBy('id', 'desc')->limit('1')->get();\n\n $iso_management_systems = IsoManagementSystem::orderBy('id', 'desc')->get();\n\n $logos = WorkspaceLogoSetting::orderBy('id', 'desc')->limit('1')->get();\n\n $comments = DB::table('comments')\n ->leftJoin('users', 'comments.user_id', '=', 'users.id')\n ->leftJoin('posts', 'comments.post_id', '=', 'posts.id')\n ->select('comments.*', 'users.first_name', 'users.last_name', 'users.profile_image', 'posts.id')\n ->orderBy('comments.id', 'desc')\n ->get();\n $comment = Comment::find('id');\n\n $doc_by_type = DB::table('document_control_reviews')\n ->leftJoin('files', 'document_control_reviews.file_id', '=', 'files.id')\n ->leftJoin('document_life_cycle_phases', 'document_control_reviews.phase_id', '=', 'document_life_cycle_phases.id')\n ->select('files.category', 'files.department', 'document_control_reviews.assigned_to', 'document_control_reviews.due_date', 'document_life_cycle_phases.name')\n ->get();\n\n return view('document_control.document_by_type', [\n 'users' => $users,\n 'folders' => $folders,\n 'posts' => $posts,\n 'tasks' => $tasks,\n 'notes' => $notes,\n 'colors' => $colors,\n 'iso_management_systems' => $iso_management_systems,\n 'logos' => $logos,\n 'comments' => $comments,\n 'doc_by_type' => $doc_by_type\n ]);\n }", "protected function getDocuments() {\n return array(\n 'tika.pdf' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'PDF',\n 'keywords' => array('hostingcheck', 'pdf'),\n ),\n 'tika.doc' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Word Document (DOC)',\n 'keywords' => array('hostingcheck', 'doc'),\n ),\n 'tika.docx' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Word Document (DOCX)',\n 'keywords' => array('hostingcheck', 'docx'),\n ),\n 'tika.xls' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Excel Spreadsheet (XLS)',\n 'keywords' => array('hostingcheck', 'xls'),\n ),\n 'tika.xlsx' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Excel Spreadsheet (XLSX)',\n 'keywords' => array('hostingcheck', 'xlsx'),\n ),\n 'tika.ppt' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Powerpoint Presentation (PPT)',\n 'keywords' => array('hostingcheck', 'ppt'),\n ),\n 'tika.pptx' => array(\n 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'Tika' . DIRECTORY_SEPARATOR,\n 'type' => 'Microsoft Powerpoint Presentation (PPTX)',\n 'keywords' => array('hostingcheck', 'pptx'),\n ),\n );\n }", "protected function isFile() {}", "function mimeType ($s_extension) {\n\t//you can pass a full filename if you want to be lazy (saves extra code elsewhere)\n\tswitch (pathinfo (strtolower ($s_extension), PATHINFO_EXTENSION)) {\n\t\t//images\n\t\tcase 'gif':\t\t\t\treturn 'image/gif';\t\t\tbreak;\n\t\tcase 'jpg': case 'jpeg': \t\treturn 'image/jpeg';\t\t\tbreak;\n\t\tcase 'png':\t\t\t\treturn 'image/png';\t\t\tbreak;\n\t\t//code\n\t\tcase 'asp':\t\t\t\treturn 'text/asp';\t\t\tbreak;\n\t\tcase 'css':\t\t\t\treturn 'text/css';\t\t\tbreak;\n\t\tcase 'html':\t\t\t\treturn 'text/html';\t\t\tbreak;\n\t\tcase 'js':\t\t\t\treturn 'application/javascript';\tbreak;\n\t\tcase 'php':\t\t\t\treturn 'application/x-httpd-php';\tbreak;\n\t\t//documents\n\t\tcase 'pdf':\t\t\t\treturn 'application/pdf';\t\tbreak;\n\t\tcase 'txt': case 'do': case 'log':\treturn 'text/plain';\t\t\tbreak;\n\t\tcase 'rem':\t\t\t\treturn 'text/remarkable';\t\tbreak;\n\t\t//downloads\n\t\tcase 'exe': case 'dmg':\t\t\treturn 'application/octet-stream';\tbreak;\n\t\tcase 'sh':\t\t\t\treturn 'application/x-sh';\t\tbreak;\n\t\tcase 'zip':\t\t\t\treturn 'application/zip';\t\tbreak;\n\t\t//media\n\t\tcase 'mp3':\t\t\t\treturn 'audio/mpeg';\t\t\tbreak;\n\t\tcase 'oga':\t\t\t\treturn 'audio/ogg';\t\t\tbreak;\n\t\tcase 'ogv':\t\t\t\treturn 'video/ogg';\t\t\tbreak;\n\t\t//fonts\n\t\tcase 'ttf':\t\t\t\treturn 'font/ttf';\t\t\tbreak;\n\t\tcase 'otf':\t\t\t\treturn 'font/otf';\t\t\tbreak;\n\t\tcase 'woff':\t\t\t\treturn 'font/x-woff';\t\t\tbreak;\n\t\tdefault:\t\t\t\treturn 'application/octet-stream';\tbreak;\n\t}\n}", "public function testInboundDocumentUploadFilePdf()\n {\n }", "function get_file_type($file)\n {\n global $image_types, $movie_types;\n \n $pos = strrpos($file, \".\");\n if ($pos === false) {\n return \"Unknown File\";\n }\n \n $ext = rtrim(substr($file, $pos + 1), \"~\");\n if (in_array($ext, $image_types)) {\n $type = \"Image File\";\n \n } elseif (in_array($ext, $movie_types)) {\n $type = \"Video File\";\n \n } elseif (in_array($ext, $archive_types)) {\n $type = \"Compressed Archive\";\n \n } elseif (in_array($ext, $document_types)) {\n $type = \"Type Document\";\n \n } elseif (in_array($ext, $font_types)) {\n $type = \"Type Font\";\n \n } else {\n $type = \"File\";\n }\n \n return (strtoupper($ext) . \" \" . $type);\n }", "function get_post_mime_types()\n {\n }", "function getDocument($authentication, $modulepart, $file, $refname = '')\n{\n\tglobal $db,$conf,$langs,$mysoc;\n\n\tdol_syslog(\"Function: getDocument login=\".$authentication['login'].' - modulepart='.$modulepart.' - file='.$file);\n\n\tif ($authentication['entity']) $conf->entity=$authentication['entity'];\n\n\t$objectresp=array();\n\t$errorcode='';$errorlabel='';\n\t$error=0;\n\n\t// Properties of doc\n\t$original_file = $file;\n\t$type=dol_mimetype($original_file);\n\t//$relativefilepath = $ref . \"/\";\n\t//$relativepath = $relativefilepath . $ref.'.pdf';\n\n\t$accessallowed=0;\n\n\t$fuser=check_authentication($authentication, $error, $errorcode, $errorlabel);\n\n\tif ($fuser->societe_id) $socid=$fuser->societe_id;\n\n\t// Check parameters\n\tif (! $error && ( ! $file || ! $modulepart ) )\n\t{\n\t\t$error++;\n\t\t$errorcode='BAD_PARAMETERS'; $errorlabel=\"Parameter file and modulepart must be both provided.\";\n\t}\n\n\tif (! $error)\n\t{\n\t\t$fuser->getrights();\n\n\t\t// Suppression de la chaine de caractere ../ dans $original_file\n\t\t$original_file = str_replace(\"../\", \"/\", $original_file);\n\n\t\t// find the subdirectory name as the reference\n\t\tif (empty($refname)) $refname=basename(dirname($original_file).\"/\");\n\n\t\t// Security check\n\t\t$check_access = dol_check_secure_access_document($modulepart, $original_file, $conf->entity, $fuser, $refname);\n\t\t$accessallowed = $check_access['accessallowed'];\n\t\t$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];\n\t\t$original_file = $check_access['original_file'];\n\n\t\t// Basic protection (against external users only)\n\t\tif ($fuser->societe_id > 0)\n\t\t{\n\t\t\tif ($sqlprotectagainstexternals)\n\t\t\t{\n\t\t\t\t$resql = $db->query($sqlprotectagainstexternals);\n\t\t\t\tif ($resql)\n\t\t\t\t{\n\t\t\t\t\t$num=$db->num_rows($resql);\n\t\t\t\t\t$i=0;\n\t\t\t\t\twhile ($i < $num)\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj = $db->fetch_object($resql);\n\t\t\t\t\t\tif ($fuser->societe_id != $obj->fk_soc)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$accessallowed=0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Security:\n\t\t// Limite acces si droits non corrects\n\t\tif (! $accessallowed)\n\t\t{\n\t\t\t$errorcode='NOT_PERMITTED';\n\t\t\t$errorlabel='Access not allowed';\n\t\t\t$error++;\n\t\t}\n\n\t\t// Security:\n\t\t// On interdit les remontees de repertoire ainsi que les pipe dans\n\t\t// les noms de fichiers.\n\t\tif (preg_match('/\\.\\./', $original_file) || preg_match('/[<>|]/', $original_file))\n\t\t{\n\t\t\tdol_syslog(\"Refused to deliver file \".$original_file);\n\t\t\t$errorcode='REFUSED';\n\t\t\t$errorlabel='';\n\t\t\t$error++;\n\t\t}\n\n\t\tclearstatcache();\n\n\t\tif(!$error)\n\t\t{\n\t\t\tif(file_exists($original_file))\n\t\t\t{\n\t\t\t\tdol_syslog(\"Function: getDocument $original_file $filename content-type=$type\");\n\n\t\t\t\t$file=$fileparams['fullname'];\n\t\t\t\t$filename = basename($file);\n\n\t\t\t\t$f = fopen($original_file, 'r');\n\t\t\t\t$content_file = fread($f, filesize($original_file));\n\n\t\t\t\t$objectret = array(\n\t\t\t\t\t'filename' => basename($original_file),\n\t\t\t\t\t'mimetype' => dol_mimetype($original_file),\n\t\t\t\t\t'content' => base64_encode($content_file),\n\t\t\t\t\t'length' => filesize($original_file)\n\t\t\t\t);\n\n\t\t\t\t// Create return object\n\t\t\t\t$objectresp = array(\n\t\t\t\t\t'result'=>array('result_code'=>'OK', 'result_label'=>''),\n\t\t\t\t\t'document'=>$objectret\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdol_syslog(\"File doesn't exist \".$original_file);\n\t\t\t\t$errorcode='NOT_FOUND';\n\t\t\t\t$errorlabel='';\n\t\t\t\t$error++;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($error)\n\t{\n\t\t$objectresp = array(\n\t\t'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)\n\t\t);\n\t}\n\n\treturn $objectresp;\n}", "function accouk_is_valid_text_file($path) {\n\n // Use finfo to detect mime type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime = finfo_file($finfo, $path);\n finfo_close($finfo);\n if($mime !== \"text/plain\") return false;\n\n // Check file extension\n $filename_length = strlen($path);\n if(substr($path, $filename_length-4, $filename_length) !== \".txt\") return false;\n\n return true;\n}", "function data_of_page_type( array $files, string $type ) {\n\n // Recursively lookup files that match the page type.\n return array_filter($files, function($file) use ($type) {\n\n // Filter out files that don't match the page type.\n return (isset($file['data']) ? array_get($file, 'data.data.template') == $type : data_of_page_type($file, $type));\n\n });\n\n}", "function modify_post_mime_types( $post_mime_types ) {\n\t // then we define an array with the label values\n\t $post_mime_types['application/pdf'] = array( __( 'PDFs', 'customtheme' ), __( 'Manage PDFs', 'customtheme' ), _n_noop( 'PDF <span class=\"count\">(%s)</span>', 'PDFs <span class=\"count\">(%s)</span>' ) );\n\t // then we return the $post_mime_types variable\n\t return $post_mime_types;\n\t}", "function add_document_medical(){\n\t\t\n\t\t$this->load->model('document_model');\n\t\t$this->load->library('form_validation');\n\t\t\n\t\t$type \t= $this->input->post('document_type');\n\n\t\tif($type == \"other\"){\n\t\t\t\n\t\t\t$type = $this->input->post('type');\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$this->form_validation->set_rules('document_type','Medical','required');\n\t\t}\n\n\t\t$place \t\t= $this->input->post('place');\n\t\t$source \t = $this->input->post('source');\n\t\t$number \t = $this->input->post('number');\n\t\t$date_issued = $this->input->post('date_issued');\n\t\t$date_expired = $this->input->post('date_expired');\n\t\t$id_pelaut = $this->input->post('pelaut_id',true);\n\t\t$country \t = '';\n\n\t\t$this->form_validation->set_rules(\"place\",\"Place\",\"\");\n $this->form_validation->set_rules(\"number\",\"Number\",\"\");\n// $this->form_validation->set_rules(\"date_issued\",\"Date Issued\",\"required\");\n $this->form_validation->set_rules(\"date_expired\",\"Expired Date\",\"required\");\n\t\t\n $hasil = $this->form_validation->run() ? \"berhasil\":\"gagal\";\n\n if($hasil == \"berhasil\"){\n\t\t\t\n\t\t\tif(!empty($_FILES[\"attachment\"][\"name\"]))\n\t\t\t{\n \t\t$this->load->helper(\"upload_file_document\");\n \t\t$username = $this->session->userdata(\"username\");\n \t\t$attachment = $_FILES['attachment'];\n\t\t\t\t\n\t\t\t\t// buat foldernya dahulu\n\t\t\t\t// dari username_folder_helper\n\t\t\t\tmake_username_folder_doc($username,\"doc\");\n\t\t\t\t\n \t\t$nama_file = (str_replace(' ', '_', strtolower($type))).\".\";\n \t\t$nama_file .= end(explode('.', $attachment['name']));\n \t\t$attachment['name'] = $nama_file;\n \t\t$upload_file = upload_document_pelaut($attachment, $username, \"medical_record\");\n\n \t\tif($upload_file[\"pesan\"] == \"sukses\")\n\t\t\t\t{\n\t\t\t\t\t$data_upload = $upload_file['data'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$result[\"message\"] = $data_upload = \"<div class='alert alert-danger'>\".$upload_file[\"data\"].\"</div>\";\n\t\t\t\t\t$result[\"status\"] = \"error\";\n\t\t\t\t\texit;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$q = $this->document_model->add_document_process($id_pelaut, \n\t\t\t$type, \n\t\t\t$number, \n\t\t\t$place, \n\t\t\t$date_issued, \n\t\t\t$date_expired, \n\t\t\t$source,\n\t\t\t$country, \n\t\t\t$data_upload['file_name']) or die(\"gagal di query tambah document tr nih\");\n\t// \n\t\t\t\tif (!$q) {\n\t\t\t\t\t$this->db->_error_message();\n\t\t\t\t} else {\n\t\t\t\t\t$result[\"message\"] = \"<div class='alert alert-success'> Data document Successfully Added </div>\";\n\t\t\t\t\t$result[\"message\"] .= \"<script> setTimeout(function() { location.reload(); }, 3000); </script>\";\n\t\t\t\t\t$result[\"status\"] = \"success\";\n\t\t\t\t}\n\t\n\t\t\t} \n\t\t\telse {\n\t\t\t\t$result[\"message\"] = \"<div class='alert alert-danger'>\" . validation_errors() . \" </div>\";\n\t\t\t\t$result[\"status\"] = \"error\";\n\t\t\t}\n\t\t\t\n\t\t\techo json_encode($result);\n\t}", "function pretty_filetype($ext)\n{\n\tswitch ($ext)\n\t{\n\t\tcase \"png\": $extn=\"PNG Image\"; break;\n\t\tcase \"jpg\": $extn=\"JPEG Image\"; break;\n\t\tcase \"jpeg\": $extn=\"JPEG Image\"; break;\n\t\tcase \"svg\": $extn=\"SVG Image\"; break;\n\t\tcase \"gif\": $extn=\"GIF Image\"; break;\n\t\tcase \"ico\": $extn=\"Windows Icon\"; break;\n\n\t\tcase \"txt\": $extn=\"Text File\"; break;\n\t\tcase \"log\": $extn=\"Log File\"; break;\n\t\tcase \"htm\": $extn=\"HTML File\"; break;\n\t\tcase \"html\": $extn=\"HTML File\"; break;\n\t\tcase \"xhtml\": $extn=\"HTML File\"; break;\n\t\tcase \"shtml\": $extn=\"HTML File\"; break;\n\t\tcase \"php\": $extn=\"PHP Script\"; break;\n\t\tcase \"js\": $extn=\"Javascript File\"; break;\n\t\tcase \"css\": $extn=\"Stylesheet\"; break;\n\n\t\tcase \"pdf\": $extn=\"PDF Document\"; break;\n\t\tcase \"xls\": $extn=\"Spreadsheet\"; break;\n\t\tcase \"xlsx\": $extn=\"Spreadsheet\"; break;\n\t\tcase \"doc\": $extn=\"Microsoft Word Document\"; break;\n\t\tcase \"docx\": $extn=\"Microsoft Word Document\"; break;\n\n\t\tcase \"zip\": $extn=\"ZIP Archive\"; break;\n\t\tcase \"htaccess\": $extn=\"Apache Config File\"; break;\n\t\tcase \"exe\": $extn=\"Windows Executable\"; break;\n\n\t\tdefault:\n\t\tif($ext!=\"\")\n\t\t{\n\t\t\t$extn=strtoupper($ext).\" File\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$extn=\"Unknown\";\n\t\t}\n\t}\n\n\treturn $extn;\n}", "public function isFile();", "public function getExtendedType()\n {\n return 'file';\n }", "function type_url_form_file()\n {\n }", "function prettyType($mimeType, $ext) {\n\t$mimeType = strtolower($mimeType);\n\n\t// Order by most unique first.\n\t// Do NOT do html because \"text/html\" is often misused for other types. We catch it below.\n\tforeach(array(\"font\", \"css\", \"image\", \"script\", \"video\", \"audio\", \"xml\") as $type) {\n\t\tif ( false !== strpos($mimeType, $type) ) {\n\t\t\treturn $type;\n\t\t}\n\t}\n\n\t// Special cases I found by manually searching.\n\tif ( false !== strpos($mimeType, \"json\") || \"js\" === $ext || \"json\" === $ext ) {\n\t\treturn \"script\";\n\t}\n\telse if ( \"eot\" === $ext || \"ttf\" === $ext || \"woff\" === $ext || \"woff2\" === $ext || \"otf\" === $ext ) {\n\t\treturn \"font\";\n\t}\n\telse if ( \"png\" === $ext || \"gif\" === $ext || \"jpg\" === $ext || \"jpeg\" === $ext || \"webp\" === $ext || \"ico\" === $ext || \"svg\" === $ext || \"avif\" === $ext || \"jxl\" === $ext || \"heic\" === $ext || \"heif\" === $ext ) {\n\t\treturn \"image\";\n\t}\n\telse if ( \"css\" === $ext ) {\n\t\treturn \"css\";\n\t}\n\telse if ( \"xml\" === $ext ) {\n\t\treturn \"xml\";\n\t}\n //Video extensions mp4, webm, ts, m4v, m4s, m4v, mov, ogv\n\telse if ( false !== strpos($mimeType, \"flash\") || false !== strpos($mimeType, \"webm\") || false !== strpos($mimeType, \"mp4\") || false !== strpos($mimeType, \"flv\")\n || \"mp4\" === $ext || \"webm\" === $ext || \"ts\" == $ext || \"m4v\" === $ext || \"m4s\" === $ext || \"mov\" === $ext || \"ogv\" === $ext\n || \"swf\" === $ext || \"f4v\" === $ext || \"flv\" === $ext ) {\n\t\treturn \"video\";\n\t}\n\telse if ( false !== strpos($mimeType, \"html\") || \"html\" === $ext || \"htm\" === $ext ) {\n\t\t// Here is where we catch \"text/html\" mime type.\n\t\treturn \"html\";\n\t}\n\telse if ( false !== strpos($mimeType, \"text\") ) {\n\t\t// Put \"text\" LAST because it's often misused so $ext should take precedence.\n\t\treturn \"text\";\n\t}\n\n\treturn \"other\";\n}", "function modify_post_mime_types( $post_mime_types ) {\n\n\t// select the mime type, here: 'application/pdf'\n\t// then we define an array with the label values\n\n\t$post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF <span class=\"count\">(%s)</span>', 'PDFs <span class=\"count\">(%s)</span>' ) );\n\n\t// then we return the $post_mime_types variable\n\treturn $post_mime_types;\n\n}", "protected function getMimeContentType($filename)\r\n {\r\n $mime_types = array(\r\n\r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n\r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n\r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n\r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n\r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n\r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n\r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n\r\n $ext = strtolower(array_pop(explode('.',$filename)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n } elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimeType = finfo_file($finfo, $filename);\r\n finfo_close($finfo);\r\n return $mimeType;\r\n } else {\r\n return 'application/octet-stream';\r\n }\r\n }", "function _mime_content_type($filename) {\n $finfo = finfo_open();\n $fileinfo = finfo_file($finfo, $filename, FILEINFO_MIME);\n finfo_close($finfo);\n return reset(explode(\";\",$fileinfo));\n \n \n //hiphop workaround hiphop does not work with inotify\n //exec(\"file \".str_replace(\" \",\"\\ \",$filename).\" --mime\",$output);\n \n $half = explode(\": \",$output[0]);\n $done = explode(\"; \",$half[1]);\n return $done[0];\n }", "public function do_upload()\n {\n if(isset($_FILES['userFile']))\n {\n $a = new PDF2Text();\n $a->setFilename($_FILES['userFile']['tmp_name']);\n $a->decodePDF();\n $data= $a->output();\n $filename = $_FILES['userFile']['name'];\n $file = basename($filename, '.pdf').'.txt';\n fopen('./uploads/'.$file, 'w');\n file_put_contents('./uploads/'.$file, $data);\n $size=filesize('./uploads/'.$file);\n $this->load->model('doc_model');\n $this->doc_model->add_doc($file,$size);\n\n //////1% Percentage handling\n $this->load->model('doc_model');\n $unindex_size=$this->doc_model->get_unindex_doc_size();\n $index_size=$this->doc_model->get_index_doc_size();\n $percent=( $unindex_size/$index_size)*100;\n if ($percent == 1 ) {\n require('token.php');\n $token = new Token();\n $token->getIndex();\n }\n //call grid page\n $this->index();\n } \n }", "public function post_file_action() {\n Utils\\verifyPostRequest();\n $this->verifyUnsafeRequest();\n\n // store uploaded files as StudIP documents\n $response = array(); // data for HTTP response\n $folder_id = Utils\\getFolderId(\n 'RichText',\n studip_utf8decode(_('Durch das RichText-Plugin hochgeladene Dateien.')));\n\n foreach (Utils\\FILES() as $file) {\n try {\n $newfile = Utils\\uploadFile($file, $folder_id);\n $response['files'][] = Array(\n 'name' => utf8_encode($newfile['filename']),\n 'type' => $file['type'],\n 'url' => GetDownloadLink($newfile->getId(), $newfile['filename']));\n } catch (AccessDeniedException $e) { // creation of Stud.IP doc failed\n $response['files'][] = Array(\n 'name' => $file['name'],\n 'type' => $file['type'],\n 'error' => $e->getMessage());\n }\n }\n Utils\\sendAsJson($response);\n }", "function add_document_process()\n {\n /*print_r($this->input->post()); \n\t\tprint_r($_FILES);\n\t\texit;*/\n \t\n $this->load->model('document_model');\n $this->load->library('form_validation');\n \t\n\t\t$type_document \t\t= \"Seaman Book\";\n $country\t\t\t = $this->input->post('national');\n $type \t\t\t\t = $type_document;\n $place \t\t\t\t= $this->input->post(\"place\");\n $source \t\t\t = $this->input->post(\"source\");\n $number \t\t\t = $this->input->post(\"number\");\n $date_issued\t\t = $this->input->post(\"date_issued\");\n $date_expired\t\t = $this->input->post(\"date_expired\");\n $id_pelaut\t\t\t= $this->input->post(\"pelaut_id\",true);\n\n // $this->form_validation->set_rules(\"doc_type\",\"Type Document\",'required');\n // if($type == \"\") $this->form_validation->set_rules(\"type\",\"Type Document\",'');\n $this->form_validation->set_rules('national','Nationality','required');\n $this->form_validation->set_rules(\"place\",\"Place\",\"\");\n $this->form_validation->set_rules(\"number\",\"Number\",\"\");\n// $this->form_validation->set_rules(\"date_issued\",\"Date Issued\",\"required\");\n $this->form_validation->set_rules(\"date_expired\",\"Expired Date\",\"required\");\n\n $hasil = $this->form_validation->run() ? \"berhasil\":\"gagal\";\n\n// echo $type.\" -> \".$place.\" -> \".$number.\" -> \".$date_issued.\" -> \".$date_expired.\"<br>\".$hasil;\n if($hasil == \"berhasil\") {\n\t\t\t\n\t\t\tif(!empty($_FILES['attachment'][\"name\"]))\n\t\t\t{\n\t\t\t $this->load->helper(\"upload_file_document\");\n\t\t\t $username = $this->session->userdata(\"username\");\n\t\t\t $attachment = $_FILES['attachment'];\n \n\t\t\t $nama_file = (str_replace(' ', '_', strtolower($country))).\"_seaman_book.\";\n\t\t\t $nama_file .= end(explode('.', $attachment['name']));\n\t\t\t \n\t\t\t // buat foldernya dahulu\n\t\t\t // dari username_folder_helper\n\t\t\t make_username_folder_doc($username,\"doc\");\n\t\t\t \n\t\t\t $attachment['name'] = $nama_file;\n\t\t\t $upload_file = upload_document_pelaut($attachment, $username, \"document_record\");\n\t\t\t \n\t\t\t if($upload_file[\"pesan\"] == \"sukses\")\n\t\t\t {\n\t\t\t\t $data_upload = $upload_file['data'];\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t $result[\"message\"] = $data_upload = \"<div class='alert alert-danger'>\".$upload_file[\"data\"].\"</div>\";\n\t\t\t\t $result[\"status\"] = \"error\";\n\t\t\t\t exit;\t\n\t\t\t }\n\t\t\t \n\t\t\t}\n\n \t\n // $tb_name = $show_source(e.\"_ms\";\n // $table = strpos('cert', $tb_name) ? str_replace('_cert','', $tb_name) : $tb_name;\n // $jml = $this->document_model->check_table_ms($table,$type);// or die(\"<br>gagal di query search = $jml\");\n // if ($jml == 0) //artinya belum ada medical di medical_ms\n // {\n // $this->document_model->add_table_ms($table,$type);// or die(\"Gagal di query tambah document ms\");\n // }\n $q = $this->document_model->add_document_process($id_pelaut, \n\t\t\t$type, \n\t\t\t$number, \n\t\t\t$place, \n\t\t\t$date_issued, \n\t\t\t$date_expired, \n\t\t\t$source, \n\t\t\t$country, \n\t\t\t$data_upload['file_name']) or die(\"gagal di query tambah document tr nih\");\n\t\t\t\n// echo \"<br>berhasil lewat\";\n if (!$q) {\n $this->db->_error_message();\n } else {\n $result[\"message\"] = \"<div class='alert alert-success'> Data document Successfully Added </div>\";\n $result[\"message\"] .= \"<script> setTimeout(function() { location.reload(); }, 3000); </script>\";\n\t\t\t\t$result[\"status\"] = \"success\";\n }\n\n }\n else {\n \t\n $result[\"message\"] = \"<div class='alert alert-danger'>\" . validation_errors() . \" </div>\";\n\t\t\t$result[\"status\"] = \"error\";\n \n }\n\t\t\n\t\techo json_encode($result);\n }", "public function valid_document($str) {\n if (count($_FILES) == 0 || !array_key_exists('document', $_FILES)) {\n $this->form_validation->set_message('valid_document', 'CSV file is required');\n return false;\n }\n\n if ($_FILES['document']['size'] == 0) {\n $this->form_validation->set_message('valid_document', 'CSV file is required');\n return false;\n }\n\n if ($_FILES['document']['error'] != UPLOAD_ERR_OK) {\n $this->form_validation->set_message('valid_document', 'Upload of CSV failed');\n return false;\n }\n\n $validfile = array('.csv');\n $ext = strtolower(strrchr($_FILES['document']['name'], \".\"));\n if (!in_array($ext, $validfile)) {\n $this->form_validation->set_message('valid_document', 'Only .csv file allowed');\n return false;\n }\n return true;\n }", "public static function _mime_types($ext = '')\n {\n }", "public function documentaries()\n\t{\n\t\tif (preg_match('/^#sterntuary - (.+? - \".+?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//(08/25) \"Wild Russia 5 of 6 The Secret Forest 2009.part06.rar\" - 47.68 MB - 771.18 MB - yEnc\n\t\t//(01/24) \"ITV Wild Britain With Ray Mears 1 of 6 Deciduous Forest 2011.nfo\" - 4.34 kB - 770.97 MB - yEnc\n\t\t//(24/24) \"BBC Great British Garden Revival 03 of 10 Cottage Gardens And House Plants 2013.vol27+22.PAR2\" - 48.39 MB - 808.88 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/(\\d+\\)) \"((BBC|ITV) )?(.+?)(\\.part\\d+)?(\\.(par2|(vol.+?))\"|\\.[a-z0-9]{3}\"|\") - \\d.+? - (\\d.+? -)? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t} //\"Fat Head 2009 Tom Naughton (why we get fat documentary) XVID.par2\" (01/66) Paleo Low Carb Gluten-Free Diet yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\(\\d+\\/\\d+\\).+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[David.Attenboroughs.Natural.Curiosities.2013.5of5.Seeing.the.Pattern.720p.HDTV.x264.AAC-MVGroup]-[03/21] - \"danc-e05.r00\" yEnc\n\t\tif (preg_match('/^\\[(.+?MVGroup)\\]-\\[\\d+\\/\\d+\\] - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Battlefield S1 S01E04 \"Battlefield.104.The.Battle.of.Stalingrad.nfo\" yEnc\n\t\tif (preg_match('/^Battlefield S\\d S\\d+E\\d+ \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //BBC The Space Race 1to4of4 (2005) <docu-drama> - \"BBC.SR01.par2\" yEnc\n\t\tif (preg_match('/^(.+?) <docu-drama> - \".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //[ BBC.Time.Machine.Part.1.of.3.2004.DVDRip.x264.AAC.Cht-Eng-Sub.D5799E84-GFC ] [01/17] - \"gfc-tm1.sfv\" yEnc\n\t\t//[ Discovery.Channel.Discovery.Atlantis.1996.DVDRip.X264.AC3-xslidian ] [01/12] - \"d-da.sfv\" yEnc\n\t\t//[ Mount.Fuji.2008.blu-ray.x264.720p.AC3-CHD ] [01/48] - \"chd-mfj.sfv\" yEnc\n\t\tif (preg_match('/^\\[ (.+?) \\] \\[\\d+\\/\\d+\\] - \".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //Rough Cut - Woodworking with Tommy Mac - Pilgrim Blanket Chest (1600s) DVDrip DivX - (02-17) \"Rough.Cut-Woodworking.with.Tommy.Mac-Pilgrim.Blanket.Chest.1600s-DVDrip.DivX.2010.par2\" - yEnc yEnc\n\t\tif (preg_match('/.*[\\(\\[]\\d+-(\\d+[\\)\\]])[-_\\s]{0,3}(\"|#34;)(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}(\"|#34;)).+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t}\n\t\t//Asia This Week (NHK World, 19 & 20 July 2013) - 'Malala's movement for girls' education + Japan seeks imports from Southeast Asia - soccer players' - (02|14) - \"ATW-2013-07-20.par2\" yEnc\n\t\t//Asia Biz Forecast (NHK World, 6 & 7 July 2013) - 'China: limits of growth + Japan: remote access' - (05|14) - \"ABF-2013-07-07.part3.rar\" yEnc\n\t\tif (preg_match('/(Asia.+) - [\\(\\[]\\d+(\\|\\d+[\\)\\]])[-_\\s]{0,3}(\"|#34;).+?(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}(\"|#34;)).+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Asia Biz Forecast (NHK World, 16-17 June 2012) - \"Japan seeks energy options\" - File 01 of 14 - ABF-2012-06-16.nfo (yEnc\n\t\tif (preg_match('/(Asia.+) - File \\d+ of (\\d+)[-_\\s]{0,3}.+?(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}).+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Dark MatterDark Energy S02E06 - \"Dark Matter_Dark Energy S02E06 - The Universe - History Channel.part1.rar\" 51.0 MBytes yEnc\n\t\tif (preg_match('/^.+? S\\d+E\\d+ - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' (\\d+[,.]\\d+ [kKmMgG][bB]ytes) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //-'- Doc2011 -'- 01/16 - Glorious.Accidents.2011.par2 yEnc\n\t\tif (preg_match('/^.+Doc2011.+ \\d+\\/\\d+ - (.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"BBC.The.Treasures.of.Ancient.Rome.1of3.Warts.n.All.720p.HDTV.x264.AAC.MVGroup.org.mkv.025\" yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . ' {1,2}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn preg_replace('/MVGroup.+/', 'MVGroup', $match[1]);\n\t\t} //\"Time Team - 2012 - 05 - Beadnell, Northumbria.par2\" - [01 of 84 - 64 kb] yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\[\\d+ of \\d+ - \\d+([,.]\\d+)? [kKmMgG][bB]\\] yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Lang Lang - Mendelssohn.m4v\" [2/9] yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(06/24) \"BBC Upgrade Me 2009.part04.rar\" - 47.68 MB - 807.79 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+[.,]\\d+ [kKmMgG][bB] .+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(35/45) - Keating Pt4 - \"Keating Pt4.part34.rar\" - 1.77 GB - yEnc\n\t\tif (preg_match('/\\(\\d+\\/(\\d+\\) - .+) - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' - \\d+[.,]\\d+ [kKmMgG][bB] - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(World Air Routes - WESTJET - B737-700) [028/109] - \"World Air Routes - WESTJET - B737-700.part027.rar\" yEnc\n\t\tif (preg_match('/^\\(.+?\\)\\[\\d+\\/(\\d+\\][-_\\s]{0,3}.+?)[-_\\s]{0,3}(\"|#34;)(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}(\"|#34;))[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //Beyond Vanilla (2010) Documentary DVDrip XviD-Uncut - (02/22) \"Beyond.Vanilla.2010.Documentary.DVDrip.XviD-Uncut.par2\" - yenc yEnc\n\t\tif (preg_match('/(.+?) - [\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}(\"|#34;).+?(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4})(\"|#34;)(.+?)yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Michael Woods, The Story Of India - Beginnings 1of6.avi.013 - [14/62] yEnc\n\t\tif (preg_match('/^(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) - \\[\\d+\\/\\d+\\] yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //PBS Nature The Private Life of Deer (01/23) - \"PBS Nature 2013 The Private Life of Deer 720p x264 AAC.part01.rar\" - 1.41 GB yEnc\n\t\tif (preg_match('/^PBS.+\\(\\d+\\/\\d+\\) - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //PBS - Inside Nature's Giants - Big Cats [100 of 101] \"PBS - Inside Nature's Giants - Big Cats.m4v.vol970+143.par2\" yEnc\n\t\tif (preg_match('/^PBS.+\\[\\d+ of \\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //59/63 \"Gates Of Heaven.vol023+19.PAR2\" yEnc\n\t\tif (preg_match('/^\\d+\\/\\d+ \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Asia Biz Forecast (NHK World, 9 & 10 November 2013) - 'Mizuho: Shadow banking' (01|14) - \"ABF-2013-11-09.nfo\" yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\|\\d+\\) - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //TG1 \"Top.gear.the.perfect.road.trip.2013.vol0000+128.PAR2\" :: [01/10] yEnc\n\t\tif (preg_match('/^[\\w ]+\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '(.+[\\(\\[]\\d+\\/\\d+[\\)\\]])?[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[Walmart - The High Cost of Low Prices]-[28/59] - \"wthcolp.part26.rar\" yEnc\n\t\tif (preg_match('/^\\[([\\w- ]+)\\]-\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[SR09-0013] - \"America Revealed E02 Nation On The Move (2012) x264 720p AC3 5.1.nfo\" yEnc\n\t\tif (preg_match('/^\\[[\\w- ]+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Panzer III - Medium Tank The German War Files - Panzer III - Germany's WWII Medium Tank.part05.rar\" yEnc\n\t\tif (preg_match('/^([\\w- ]+.+?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(World Air Routes - Turkish Airlines B777-300ER) [001/114] - \"World Air Routes - Turkish Airlines B777-300ER.par2\" yEnc\n\t\tif (preg_match('/^\\(World Air Routes.+\\) \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [001/137] - \"BBC.Attenborough.Zoo.Quest.Assorted.WebRips.par2\" yEnc\n\t\tif (preg_match('/\\(\\?+\\) \\[\\d+\\/\\d+\\] - \"(.+)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //dokus4alle presents (01/52) \"BBC.Tweed.1of3.Trouble.Looms.H264.AAC.nfo\" - 603.24 MB - yEnc\n\t\tif (preg_match('/^dokus4alle presents \\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[U4A]-[After Porn Ends DOCU WEBRip X264 AAC]-[01/65] - \"after.porn.ends.par2\" yEnc\n\t\tif (preg_match('/^\\[U4A\\]-\\[(.+)\\]-\\[\\d+\\/\\d+\\] - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function custom_mime_types($existing_mimes = array()) {\n\n //For example, the following line allows PDF uploads\n //$existing_mimes['pdf'] = 'application/pdf';\n \n return $existing_mimes;\n}", "public function getExternalDocumentsStatistic() {}", "public function upload_tripartite_docs(Request $request){\n // dd($request->all());\n $applicationId = $request->application_id;\n $uploadPath = '/uploads/society_tripartite_agreement_documents';\n $destinationPath = public_path($uploadPath);\n\n $society = SocietyOfferLetter::where('user_id', auth()->user()->id)->first();\n $application = OlApplication::where('id',$applicationId)->where('society_id', $society->id)\n ->first();\n\n $documents = OlSocietyDocumentsMaster::where('application_id', $application->application_master_id)->where('is_admin', 0)->with(['documents_uploaded' => function($q) use ($society){\n $q->where('society_id', $society->id)->get();\n }])->get();\n\n foreach ($documents as $key => $value) {\n $document_ids[] = $value->id;\n }\n $documents_uploaded = OlSocietyDocumentsStatus::where('society_id', $society->id)->whereIn('document_id', $document_ids)->get();\n $documents_comment = OlSocietyDocumentsComment::where('society_id', $society->id)->first();\n\n if($request->file('document_name'))\n {\n $file = $request->file('document_name');\n $file_name = time().$file->getFileName().'.'.$file->getClientOriginalExtension();\n $extension = $request->file('document_name')->getClientOriginalExtension();\n if ($extension == \"pdf\") {\n $time = time();\n $name = File::name($request->file('document_name')->getClientOriginalName()) . '_' . $time . '.' . $extension;\n $folder_name = \"society_tripartite_agreement_documents\";\n $path = $folder_name.'/'.$name;\n $fileUpload = $this->CommonController->ftpFileUpload($folder_name,$request->file('document_name'),$name);\n\n }else{\n return redirect()->back()->with('error_'.$request->input('document_id'), 'Invalid type of file uploaded (only pdf allowed)');\n }\n }\n\n //$input = array(\n // 'society_id' => $society->id,\n //'document_id' => $request->input('document_id'),\n //'society_document_path' => $path,\n //);\n //OlSocietyDocumentsStatus::create($input);\n\n\n $role_id = Role::where('name', config('commanConfig.ree_junior'))->first();\n $user_ids = RoleUser::where('role_id', $role_id->id)->pluck('user_id')->toArray();\n $layout_user_ids = LayoutUser::where('layout_id', $application->layout_id)->whereIn('user_id', $user_ids)->get();\n foreach ($layout_user_ids as $key => $value) {\n $select_user_ids[] = $value['user_id'];\n }\n $users = User::whereIn('id', $select_user_ids)->get();\n $insert_arr = array(\n 'users' => $users\n );\n $input = array(\n 'society_id' => $society->id,\n 'application_id' => $applicationId,\n 'document_id' => $request->input('document_id'),\n 'society_document_path' => $path,\n );\n OlSocietyDocumentsStatus::create($input);\n// $this->CommonController->tripartite_application_status_society($insert_arr, config('commanConfig.applicationStatus.forwarded'), $application);\n return redirect()->back();\n }", "public function rules()\n {\n return array(\n array('bmFile', 'file', 'types'=>'html,htm'),\n );\n }", "function choose_image($file_name)\n{\n static $type, $image;\n\n /* TABLES INITIALISATION */\n if (!$type || !$image) {\n $type['word'] = array(\n 'doc',\n 'dot',\n 'rtf',\n 'mcw',\n 'wps',\n 'psw',\n 'docm',\n 'docx',\n 'dotm',\n 'dotx',\n );\n $type['web'] = array(\n 'htm',\n 'html',\n 'htx',\n 'xml',\n 'xsl',\n 'php',\n 'xhtml',\n );\n $type['image'] = array(\n 'gif',\n 'jpg',\n 'png',\n 'bmp',\n 'jpeg',\n 'tif',\n 'tiff',\n );\n $type['image_vect'] = array('svg', 'svgz');\n $type['audio'] = array(\n 'wav',\n 'mid',\n 'mp2',\n 'mp3',\n 'midi',\n 'sib',\n 'amr',\n 'kar',\n 'oga',\n 'au',\n 'wma',\n );\n $type['video'] = array(\n 'mp4',\n 'mov',\n 'rm',\n 'pls',\n 'mpg',\n 'mpeg',\n 'm2v',\n 'm4v',\n 'flv',\n 'f4v',\n 'avi',\n 'wmv',\n 'asf',\n '3gp',\n 'ogv',\n 'ogg',\n 'ogx',\n 'webm',\n );\n $type['excel'] = array(\n 'xls',\n 'xlt',\n 'xls',\n 'xlt',\n 'pxl',\n 'xlsx',\n 'xlsm',\n 'xlam',\n 'xlsb',\n 'xltm',\n 'xltx',\n );\n $type['compressed'] = array('zip', 'tar', 'rar', 'gz');\n $type['code'] = array(\n 'js',\n 'cpp',\n 'c',\n 'java',\n 'phps',\n 'jsp',\n 'asp',\n 'aspx',\n 'cfm',\n );\n $type['acrobat'] = array('pdf');\n $type['powerpoint'] = array(\n 'ppt',\n 'pps',\n 'pptm',\n 'pptx',\n 'potm',\n 'potx',\n 'ppam',\n 'ppsm',\n 'ppsx',\n );\n $type['flash'] = array('fla', 'swf');\n $type['text'] = array('txt', 'log');\n $type['oo_writer'] = array('odt', 'ott', 'sxw', 'stw');\n $type['oo_calc'] = array('ods', 'ots', 'sxc', 'stc');\n $type['oo_impress'] = array('odp', 'otp', 'sxi', 'sti');\n $type['oo_draw'] = array('odg', 'otg', 'sxd', 'std');\n $type['epub'] = array('epub');\n $type['java'] = array('class', 'jar');\n $type['freemind'] = array('mm');\n\n $image['word'] = 'word.gif';\n $image['web'] = 'file_html.gif';\n $image['image'] = 'file_image.gif';\n $image['image_vect'] = 'file_svg.png';\n $image['audio'] = 'file_sound.gif';\n $image['video'] = 'film.gif';\n $image['excel'] = 'excel.gif';\n $image['compressed'] = 'file_zip.gif';\n $image['code'] = 'icons/22/mime_code.png';\n $image['acrobat'] = 'file_pdf.gif';\n $image['powerpoint'] = 'powerpoint.gif';\n $image['flash'] = 'file_flash.gif';\n $image['text'] = 'icons/22/mime_text.png';\n $image['oo_writer'] = 'file_oo_writer.gif';\n $image['oo_calc'] = 'file_oo_calc.gif';\n $image['oo_impress'] = 'file_oo_impress.gif';\n $image['oo_draw'] = 'file_oo_draw.gif';\n $image['epub'] = 'file_epub.gif';\n $image['java'] = 'file_java.png';\n $image['freemind'] = 'file_freemind.png';\n }\n\n $extension = array();\n if (!is_array($file_name)) {\n if (preg_match('/\\.([[:alnum:]]+)(\\?|$)/', $file_name, $extension)) {\n $extension[1] = strtolower($extension[1]);\n\n foreach ($type as $generic_type => $extension_list) {\n if (in_array($extension[1], $extension_list)) {\n return $image[$generic_type];\n }\n }\n }\n }\n\n return 'defaut.gif';\n}", "abstract protected function supports($document);", "abstract protected function supports($document);", "public function externalDocumentsAction() {}", "protected function _getMimeType()\n\t{\n\t\treturn 'text/text';\n\t}" ]
[ "0.6634816", "0.6476062", "0.6333395", "0.63221014", "0.6274313", "0.6269018", "0.6197613", "0.61707574", "0.60676694", "0.6043531", "0.6015121", "0.6004839", "0.60003906", "0.5984214", "0.59627056", "0.59413475", "0.592991", "0.5919376", "0.5905667", "0.59018683", "0.5899051", "0.5883349", "0.5805535", "0.57867867", "0.57867867", "0.57867867", "0.57866275", "0.57863575", "0.575814", "0.5746199", "0.570866", "0.570233", "0.5692585", "0.5674725", "0.56656665", "0.5664804", "0.56468636", "0.5646028", "0.56141275", "0.56106985", "0.5610552", "0.5583925", "0.5582888", "0.5582525", "0.5564136", "0.55596304", "0.5557006", "0.55355555", "0.5533716", "0.55240744", "0.5521427", "0.5496671", "0.549438", "0.54917914", "0.5451964", "0.5448743", "0.54192364", "0.54192364", "0.54192364", "0.5415103", "0.5403175", "0.5400347", "0.53992045", "0.53940946", "0.53879267", "0.5374028", "0.5369465", "0.5360781", "0.5360165", "0.5358754", "0.53465825", "0.5344821", "0.53429276", "0.53400743", "0.532829", "0.53272164", "0.5318084", "0.5310547", "0.53098756", "0.5308054", "0.5305692", "0.5301418", "0.52992445", "0.5295049", "0.5289775", "0.52888316", "0.5287915", "0.5286167", "0.5285641", "0.5282972", "0.52825886", "0.52808803", "0.5279434", "0.526893", "0.526237", "0.5261303", "0.5260156", "0.5258142", "0.5258142", "0.52574164", "0.5256402" ]
0.0
-1
Status of the documentquery pair
public function statusByQueryPair($queryId) { foreach ($this->queries as $query) if($query->id == $queryId) return ucfirst($query->pivot->status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function status(): mixed\n\t{\n\t\treturn self::$query->status;\n\t}", "public function status();", "public function status();", "protected function getReferenceIndexStatus() {}", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "function getStatus($id_tesdoc_ref)\n {\n global $gTables;\n $sqlquery= \"SELECT SUM(amount*(id_rigmoc_doc>0)- amount*(id_rigmoc_pay>0)) AS diff_paydoc, SUM(amount*(id_rigmoc_pay>0)) AS pay, SUM(amount*(id_rigmoc_doc>0))AS doc \n FROM \".$gTables['paymov'].\"\n WHERE id_tesdoc_ref = '\".$id_tesdoc_ref.\"' GROUP BY id_tesdoc_ref\";\n $rs = gaz_dbi_query($sqlquery);\n $this->Status=gaz_dbi_fetch_array($rs);\n }", "public function hadSuccess(){\n\n\t\t\treturn $this->failedQuery;\n\t\t}", "public function getStatusDoc()\n {\n return $this->status_doc;\n }", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "public function issetDocumentStatus(): bool\n {\n return isset($this->documentStatus);\n }", "function getStatus() ;", "function getStatus() ;", "function getStatus() ;", "abstract public function getStatus();", "private function transactionStatus(){\n $data = [\n 'Initiator' => ' ',\n 'SecurityCredential' => ' ',\n 'CommandID' => 'TransactionStatusQuery',\n 'TransactionID' => ' ',\n 'PartyA' => ' ',\n 'IdentifierType' => '1',\n 'QueueTimeOutURL' => $this->apiBaseUrl.'/mobilepay/tran_status/time_out',\n 'ResultURL' => $this->apiBaseUrl.'/mobilepay/tran_status/result',\n 'Remarks' => ' ',\n 'Occasion' => ' '\n ];\n return $this->remotePostCall('mpesa/transactionstatus/v1/query', $data);\n }", "public function status(): int;", "protected function _publish_status()\n\t{\n\t\t//$fields = $this->fields();\n\t\t$fields = $fields = array_keys($this->table_info()); // used to prevent an additional query that the fields() method would create\n\n\t\tif (in_array('published', $fields))\n\t\t{\n\t\t\tif (in_array('published', $this->boolean_fields))\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.published' => 1));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.published' => 'yes'));\n\t\t\t}\n\t\t}\n\n\t\tif (in_array('active', $fields))\n\t\t{\n\t\t\tif (in_array('active', $this->boolean_fields))\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.active' => 1));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.active' => 'yes'));\n\t\t\t}\n\t\t}\n\n\t\tif (in_array('publish_date', $fields))\n\t\t{\n\t\t\t$this->db->where(array($this->table_name.'.publish_date <=' => datetime_now()));\n\t\t}\n\t}", "public function supports_transaction_status_query()\n\t\t{\n\t\t\treturn true;\n\t\t}", "public function status() {\n\t\treturn $this->_status;\n\t}", "function getQueryInstance() {\n // Call the parent getQueryInstance method.\n parent::getQueryInstance();\n // We only what permanent files.\n $this->query->propertyCondition('status', FILE_STATUS_PERMANENT);\n }", "public function getStatus()\n {\n $this->execute();\n \n return $this->status;\n }", "function query() {}", "function query() {\n }", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function hasResults();", "public function status()\n {\n return $this->_status;\n }", "public static function status()\n {\n return plexcel_status(self::getConnection());\n }", "function getStatus() \r\n\t{\r\n\t\treturn $this->reply;\r\n\t}", "function getBooleanQuery(){\n return $this->_query;\n }", "function getStatus() \n {\n return $this->instance->getStatus();\n }", "function query_info()\r\n\t\t{\r\n\t\t\techo \"<u>Your Previous Query Consisted of:</u><br>\";\r\n\t\t\techo \"SQL = '\".$this->last_query[\"sql\"].\"'<br>\";\r\n\t\t\t$temp = ($this->last_query[\"end_time\"] - $this->last_query[\"start_time\"]);\r\n\t\t\t$temp *= 1000;\r\n\t\t\t$temp = number_format($temp, 3);\r\n\t\t\techo \"Time Elapsed: \".$temp.\"(ms)<br>\";\r\n\t\t\techo \"Number of Records: \".$this->numrows.\"<br>\";\r\n\t\t\techo \"Number of Rows Affected: \".$this->affected_rows;\r\n\t\t}", "function getStatus() {\n\t\treturn $this->_Status;\n\t}", "function apachesolr_index_status($env_id) {\n $remaining = 0;\n $total = 0;\n\n foreach (entity_get_info() as $entity_type => $info) {\n $bundles = apachesolr_get_index_bundles($env_id, $entity_type);\n if (empty($bundles)) {\n continue;\n }\n\n $table = apachesolr_get_indexer_table($entity_type);\n $query = db_select($table, 'aie')\n ->condition('aie.status', 1)\n ->condition('aie.bundle', $bundles)\n ->addTag('apachesolr_index_' . $entity_type);\n\n $total += $query->countQuery()->execute()->fetchField();\n\n $query = _apachesolr_index_get_next_set_query($env_id, $entity_type);\n $remaining += $query->countQuery()->execute()->fetchField();\n }\n return array('remaining' => $remaining, 'total' => $total);\n}", "function getStatus();", "public function getStatus(){\n return $this->film['status'];\n }", "public function getRetrievalStatus(): RetrievalStatus {\n return $this->_retrievalStatus;\n }", "function Status()\n\t{\n\t\treturn $this->status;\n\t}", "function getDetailedStatus() ;", "public function retrieveReindexStatus()\n {\n return $this->start()->uri(\"/api/system/reindex\")\n ->get()\n ->go();\n }", "public function get_status() {\n return $this->_status;\n }", "public function status()\r\n {\r\n return $this->status;\r\n }", "abstract public function GetStatus();", "public function status(){\n\t\t$pidForm = sprintf(\"%7s\",$this->pid);\n\t\t$command = QSTAT.' -u '.$this->username.' | grep \"^'.$pidForm.'\"';\n\t\texec($command,$op);\n\n\t\tif (!isset($op[0]))return false;\n\t\telse return true;\n\t}", "public function GetStatus()\n\t{\n\t\t// Demnach ist der Status in IPS der einzige der vorliegt.\t\t\n\t}", "public function execute() {\n\t\t$resultCoreData = $this->fetchCurrentCoreData();\n\t\t$resultDocsData = $this->fetchCurrentDocumentationData();\n\t\treturn $resultCoreData && $resultDocsData;\n\t}", "public function getStatus()\n {\n return $this->status = $this->get()->post_status;\n }", "public function get_status(){\n return $this->status;\n }", "public function status()\n {\n return $this->status;\n }", "function getStatus() {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->result->getStatus();\n }", "function updateStatus(){\n\t\t$this->setPost();\n\n\t\t$postData = $_POST;\n\n\t\tif($postData->status_id == 1){\n\t\t\t$updateData = array('status_id' => 2);\n\t\t}else{\n\t\t\t$updateData = array('status_id' => 1);\n\t\t}\n\n\t\t$where = array('id' => $postData->id);\n\n\t\t$result = $this->base_model->updateCommon($this->primaryTable, $updateData, $where);\n\n\t\t$response = array('status' => TRUE, 'message' => 'Document status updated successfully.');\n\n\t\techo json_encode($response);\n\t}", "public function getStatus()\n { \n return ! empty($this->result) ? $this->result->getStatus() : '';\n }", "function documentIsPublished($iDocumentID) {\n\t\tglobal $default;\n\t\t$sQuery = \"SELECT id FROM $default->web_documents_table WHERE document_id = ? AND status_id = 2\";/*ok*/\n $aParams = array($iDocumentID);\n\t\t$sql = $default->db;\n\t\t$sql->query(array($sQuery, $aParams));\n\t\tif ($sql->next_record()) {\n\t\t\treturn true;;\n\t\t}\n\t\treturn false;\n\t}", "public function getStatus(){\n\t\treturn $this->status;\n\t}", "function &getQueryCount( $query )\n {\n $this->dbInit();\n $link_array = 0;\n\n $query = new eZQuery( array( \"KeyWords\", \"Title\", \"Description\" ), $query );\n \n $query_str = \"SELECT count(ID) AS Count FROM eZLink_Link WHERE (\" .\n $query->buildQuery() .\n \") AND Accepted='Y' ORDER BY Title\";\n\n $this->Database->array_query( $link_array, $query_str );\n\n $ret = 0;\n if ( count( $link_array ) == 1 )\n $ret = $link_array[0][\"Count\"];\n\n return $ret;\n }", "function getStatus()\n {\n return $this->status;\n }", "function get_status() {\n return $this->status;\n }", "public function countquery(){ \n\t\treturn $this->query_total; \n\t}", "public function update_status();", "public function status()\n {\n return $this->getStatus();\n }", "public function _query()\n {\n }", "protected function getMediaStatusQuery()\n {\n return $this->mediaStatusQuery;\n }", "public function hasResult(){\n return $this->_has(2);\n }", "public function status()\n {\n return $this->previousStatus;\n }", "public function query();", "public function query();", "public function query();", "public function Status() {\n return (in_array($this->todo, $this->store_todo->AllActiveTodos()));\n }", "public function hasStatus(){\n return $this->_has(10);\n }", "function tidy_get_status(tidy $object) {}", "public function getStatus() {\n\t\tif(!$this->server) {\n\t\t\treturn false;\n\t\t}\n\t\tif(!$this->status_new) {\n\t\t\t$this->update();\n\t\t}\n\t\treturn $this->status_new;\n\t}" ]
[ "0.6192141", "0.57779527", "0.57779527", "0.5744369", "0.56586426", "0.56586426", "0.56586426", "0.56586426", "0.56586426", "0.56586426", "0.56586426", "0.56586426", "0.56586426", "0.56586426", "0.5647641", "0.5600128", "0.5550364", "0.54632735", "0.54632735", "0.5452703", "0.5449406", "0.5449406", "0.54471284", "0.542742", "0.54143643", "0.5404348", "0.5389797", "0.53655845", "0.5332649", "0.5331902", "0.5328395", "0.5319624", "0.5316747", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.53104913", "0.531048", "0.531048", "0.531048", "0.531048", "0.5283404", "0.5283182", "0.52815855", "0.52757317", "0.5247525", "0.5224985", "0.51889896", "0.51821274", "0.51713026", "0.5169598", "0.5166553", "0.5161778", "0.5151128", "0.51482075", "0.51480025", "0.5143817", "0.5143375", "0.51282007", "0.51277506", "0.5118901", "0.51182276", "0.51077104", "0.51076204", "0.5106541", "0.5104504", "0.5095097", "0.5083793", "0.5082153", "0.5081758", "0.5080975", "0.5079844", "0.5078602", "0.5076664", "0.50715536", "0.5056173", "0.50542647", "0.50456315", "0.50410926", "0.50340784", "0.5032238", "0.5029127", "0.5029127", "0.5029127", "0.5026807", "0.5019858", "0.50191206", "0.5013461" ]
0.0
-1
Calculate Total of OrderItem
public function getTotal() { return $this->getAmount() * $this->getPrice(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calculateOrderTotal($items)\n {\n $total = 0;\n foreach ($items as $key => $item) {\n $total += $item['quoted_price'];\n }\n return $total;\n }", "public function itemTotal(): float;", "public function getTotal()\n {\n return $this->service()->getTotalOfOrder();\n }", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "public function totalWithDependentItems()\n {\n $depItemTotal = $this->dependentItems()->sum('total');\n return $this->total + $this->dependentItems()->sum('total');\n\n }", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "public function calcTotal()\n {\n\n $productBusinessService = new ProductBusinessService();\n\n // create an array to hold all subtotals\n $subtotals_array = array();\n $this->total_price = 0;\n\n foreach ($this->items as $item => $qty) {\n\n // get the price of the product from the database\n $product = $productBusinessService->getProductByID($item);\n\n // calculate the total (price * quantity)\n $product_subtotal = $product->getPrice() * $qty;\n\n // add that subtotal to the subtotal array\n $subtotals_array = $subtotals_array + array($item => $product_subtotal);\n\n // add the item subtotal to the cart total\n $this->total_price += $product_subtotal;\n }\n\n // set the subtotals array\n $this->subtotals = $subtotals_array;\n }", "public function getOrdertotal()\n {\n return $this->ordertotal;\n }", "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 }", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }", "public function calculateTotalPrice($items){\n $total = 0;\n foreach($items as $item){\n $total += $item['subtotal'];\n }\n return $total;\n }", "public function getTotalQtyOrdered();", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function addOrderItemsCount()\r\n {\r\n $itemTable = $this->_helper()->getSql()->getTable('sales_flat_order_item');\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n $this->getSelect()\r\n ->join(array('item' => $itemTable), \"(item.order_id = main_table.entity_id AND item.parent_item_id IS NULL)\",\r\n array(\r\n 'sum_qty' => 'SUM(item.qty_ordered)',\r\n 'sum_total' => 'SUM(item.base_row_total)',\r\n ))\r\n ->where(\"main_table.entity_id = item.order_id\");\r\n } else {\r\n $this->getSelect()\r\n ->join(array('item' => $itemTable), \"(item.order_id = e.entity_id AND item.parent_item_id IS NULL)\",\r\n array(\r\n 'sum_qty' => 'SUM(item.qty_ordered)',\r\n 'sum_total' => 'SUM(item.base_row_total)',\r\n ))\r\n ->where(\"e.entity_id = item.order_id\");\r\n }\r\n return $this;\r\n }", "public function getTotalAttribute() {\n return $this->cartItems->map(function ($item, $key) {\n return $item->subtotal;\n })->sum();\n }", "protected function calculatetotal()\n {\n $total = $this->UnitPrice() * $this->Quantity;\n $this->extend('updateTotal', $total);\n $this->CalculatedTotal = $total;\n return $total;\n }", "public function getTotalEstimated() {\n\t\t$total = 0;\n\t\t$this->costitem->get();\n\t\tforeach($this->costitem->all as $item) {\n\t\t\tif ($item->item_type == 'price') {\n\t\t\t\t$total += $item->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t\t\n\t}", "public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }", "public function getTotalItems()\n {\n $total = 0;\n \n foreach ($this->items as $item) {\n $total += ($item->Quantity) ? $item->Quantity : 1;\n }\n\n return $total;\n }", "public function Total()\n {\n if ($this->Order()->IsCart()) { //always calculate total if order is in cart\n return $this->calculatetotal();\n }\n return $this->CalculatedTotal; //otherwise get value from database\n }", "public function getTotalPrice()\n\t{\n\t\t$total = 0.0;\n\n\t\tforeach ($this->items as $item)\n\t\t{\n $total += $item->getPrice() + $item->getExtrasPrice();\n }\n\n\t\treturn $total;\n\t}", "public function testTotalAmountCalculation(): void\n {\n $order = new Order('consumerIdTest123', '845126849', new \\DateTimeImmutable('midnight'), 'OrderNumber123', 7);\n $order->addOrderLine('productIdTest1', 2, 4.9);\n $order->addOrderLine('productIdTest2', 3, 10.5);\n\n static::assertEquals(41.3, $order->getAmount());\n }", "public function total()\n {\n return $this->subtotal() + $this->shipping() + $this->vat()->sum();\n }", "public static function getTotalValueOfOrder()\n {\n \ttry\n \t{\n\t \t$storage = My_Zend_Globals::getStorage();\n\t \n\t \t$table = self::_TABLE_PRODUCT_ORDER_DETAIL;\n\t \n\t \t//Query data from database\n\t \t$select = $storage->select()\n\t\t\t\t\t \t->from($table,'sum(amount_total)')\n\t\t\t\t\t \t->where('order_status = ?', 2);\n\t \t \n\t \t$total = $storage->fetchCol($select);\n\t \t \n\t \t$total = intval($total['total']);\n\t \t\n\t \treturn $total;\n \t}\n \tcatch(Exception $e)\n \t{\n \t\treturn false;\n \t}\t \t\n }", "public function getBaseTotalQtyOrdered();", "public function getMinOrderTotal();", "protected function getTotalOrders()\n {\n\n if (auth()->user()) {\n $userId = auth()->user()->id;\n return \\Cart::session($userId)->getTotal();\n }\n return \\Cart::getTotal();\n }", "public function TotalItemShipping() {\n\treturn $this->nTotShItm;\n }", "public function total(): float\n {\n return $this->itemsPrice()->sum(fn (array $item) => $item['price']);\n }", "public function total()\n {\n $total = 0;\n foreach($this->_data as &$product) {\n $total += ($product['price'] * $product['quantity']);\n }\n\n return $total;\n }", "public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }", "public function total(){\n return $this->cart_contents['cart_total'];\n }", "public function calculateTotalAmount()\n {\n\n $total = 0;\n $base_currency_total = 0;\n $items_in_bag = Session::get('items');\n\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n $priceAccessoiresMust = 0;\n $priceAccessoires = 0;\n if (!empty($item['orderItemAccessories'])) {\n foreach ($item['orderItemAccessories'] as $orderItemAccessorie) {\n if (Session::get('cur_currency') === 'USD') {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n } else {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n }\n }\n }\n\n if (Session::get('cur_currency') === 'USD') {\n $price = $item['quantity'] * ($item['price'] * Session::get('amount_per_unit'));\n } else {\n $price = $item['quantity'] * $item['price'];\n }\n\n $base_currency_total = $base_currency_total + ($item['price'] * $item['quantity']) + $priceAccessoiresMust + $priceAccessoires;\n $total = round($total + $price + $priceAccessoiresMust + $priceAccessoires, 2);\n\n }\n }\n\n Session::put('total', $total);\n Session::put('bc_currency_total', $base_currency_total);\n return $total;\n }", "function wpap_get_total_woocommerce_order_fees($order)\n{\n $total_fee = 0;\n $order_fee_items = $order->get_fees();\n if(!is_array($order_fee_items)){\n return $total_fee;\n }\n \n foreach ( $order_fee_items as $fee_item ) {\n $total_fee += $fee_item['line_total'];\n }\n return $total_fee;\n}", "public function getTotalAmount();", "public function subtotal()\n {\n $subTotal = 0;\n foreach($this->items as $item) {\n $subTotal += $item->get(Cart\\Item::KEY_AMOUNT);\n }\n return $subTotal;\n }", "function btce_get_active_order_total($key, $secret) {\n $orders = btce_active_orders($key, $secret);\n $_total = 0;\n foreach ($orders->return as $order) {\n if ($order->type == 'sell') {\n $_total += $order->amount;\n }\n }\n return $_total;\n}", "public function calculateTotal() {\n $result = 0;\n\n if(isset($_SESSION['user']['basket']))\n foreach ($_SESSION['user']['basket'] as $item)\n $result += $item['product']['price']*$item['quantity'];\n\n return $result;\n }", "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 getTotalPrice() {\n return $this->getQuantity()*$this->getPrice();\n }", "function getTotalItems() { return $this->m_totalItems; }", "public function getTotalById($idOrder)\n {\n //Gets the total for an order\n \treturn $this->mgrOrder->getTotalById($idOrder) . \"$\";\n }", "public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}", "public function get_total()\n {\n }", "public function originalTotal(): float\n {\n return $this->content()->sum(fn (CartItem $item) => $item->originalTotal());\n }", "function calculateOrderAmount(): int {\n // Calculate the order total on the server to prevent\n // customers from directly manipulating the amount on the client\n $oldCart=Session::get('cart');\n $cart = new Cart($oldCart);\n $total = $cart->totalPrice;\n return $total * 100;\n }", "public function total()\n {\n $total = 0;\n\n foreach ($this->contents() as $item) $total += (float)$item->total();\n\n return (float)$total;\n }", "public function get_order_total_item_quantity(WC_Order $order)\n {\n $total = 0;\n foreach ($order->get_items() as $item_id => $item ) {\n $total += $item->get_quantity();\n }\n\n return $total;\n }", "function line_demand_total($line_orders) {\n $line_demand_total = array_reduce(\n $line_orders,\n function ($sum, $line) {\n return $sum + intval($line[QUANTITY]);\n },\n 0);\n return $line_demand_total;\n}", "public function getTotal()\n {\n return ($this->amount + $this->tax_amount)* $this->currency_converter;\n }", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function totalQuantity(): int\n {\n return $this->items->sum(function ($item) {\n return $item->quantity;\n });\n }", "public function getTotalQty()\n {\n $qty = 0;\n foreach ($this->lineItems as $item) {\n $qty += $item->qty;\n }\n\n return $qty;\n }", "public function __itemTotals() {\n\n //$this->request->data['items'] = array_values($this->request->data['items']);\n\n $itemsCount = isset($this->request->data['items']) ? count($this->request->data['items']) : 0;\n\n// pr($this->request->data['Item']);\n// die('asdas');\n\n\n\n for ($i = 0; $i < $itemsCount; $i++) {\n\n\n\n\n\n\n\n $this->request->data['items'][$i]['total'] = $this->__lineItemTotal($this->request->data['items'][$i]['qty'], $this->request->data['items'][$i]['price'], $this->request->data['items'][$i]['rate']);\n\n\n\n // collect unit name from unit model\n\n $unit = $this->Papers->Items->Units->find()\n ->where(['id'=>$this->request->data['items'][$i]['unit_id']])\n ->select(['name'])\n ->first()\n ->toArray();\n\n $this->request->data['items'][$i]['name'] = $unit['name'];\n }\n }", "protected function calculate_item_totals() {\n\t\t$this->get_items_from_cart();\n\t\t$this->calculate_item_subtotals();\n\t\t$this->calculate_discounts();\n\n\t\tforeach ( $this->items as $item_key => $item ) {\n\t\t\t$item->total = $this->get_discounted_price_in_cents( $item_key );\n\t\t\t$item->total_tax = 0;\n\n\t\t\tif ( has_filter( 'woocommerce_get_discounted_price' ) ) {\n\t\t\t\t/**\n\t\t\t\t * Allow plugins to filter this price like in the legacy cart class.\n\t\t\t\t *\n\t\t\t\t * This is legacy and should probably be deprecated in the future.\n\t\t\t\t * $item->object is the cart item object.\n\t\t\t\t * $this->cart is the cart object.\n\t\t\t\t */\n\t\t\t\t$item->total = wc_add_number_precision(\n\t\t\t\t\tapply_filters( 'woocommerce_get_discounted_price', wc_remove_number_precision( $item->total ), $item->object, $this->cart )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $this->calculate_tax && $item->product->is_taxable() ) {\n\t\t\t\t$total_taxes = WC_Tax::calc_tax( $item->total, $item->tax_rates, $item->price_includes_tax );\n\t\t\t\t$item->taxes = $total_taxes;\n\t\t\t\t$item->total_tax = array_sum( array_map( array( $this, 'round_line_tax' ), $item->taxes ) );\n\n\t\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\t\t// Use unrounded taxes so we can re-calculate from the orders screen accurately later.\n\t\t\t\t\t$item->total = $item->total - array_sum( $item->taxes );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax_data']['total'] = wc_remove_number_precision_deep( $item->taxes );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_total'] = wc_remove_number_precision( $item->total );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax'] = wc_remove_number_precision( $item->total_tax );\n\t\t}\n\n\t\t$this->set_total( 'items_total', array_sum( array_map( 'round', array_values( wp_list_pluck( $this->items, 'total' ) ) ) ) );\n\t\t$this->set_total( 'items_total_tax', array_sum( array_values( wp_list_pluck( $this->items, 'total_tax' ) ) ) );\n\n\t\t$this->cart->set_cart_contents_total( $this->get_total( 'items_total' ) );\n\t\t$this->cart->set_cart_contents_tax( array_sum( $this->get_merged_taxes( false, 'items' ) ) );\n\t\t$this->cart->set_cart_contents_taxes( $this->get_merged_taxes( false, 'items' ) );\n\t}", "function fix_order_amount_item_total( $price, $order, $item, $inc_tax = false, $round = true ) {\n $qty = ( ! empty( $item[ 'qty' ] ) && $item[ 'qty' ] != 0 ) ? $item[ 'qty'] : 1;\n if( $inc_tax ) {\n $price = ( $item[ 'line_total' ] + $item[ 'line_tax' ] ) / $qty;\n } else {\n $price = $item[ 'line_total' ] / $qty;\n }\n $price = $round ? round( $price, 2 ) : $price;\n return $price;\n}", "protected function _getTotal()\n {\n return $this->formatPriceWithComma($this->_getOrder()->getGrandTotal());\n }", "public function total()\n {\n if ($this->_isCartArray($this->cart()) === TRUE)\n {\n $price = 0;\n $vat = 0;\n foreach ($this->cart() as $key)\n {\n $item_price = ($key['price'] * $key['qty']);\n $item_vat = (($item_price/100)*$key['vat']);\n // $price =+ ($price + ($key['price'] * $key['qty']));\n $price += $item_price;\n $vat += $item_vat;\n }\n\n // $params = $this->_config['vat'];\n // $vat = $this->_formatNumber((($price / 100) * $params));\n\n return array(\n 'sub-total' => $this->_formatNumber($price),\n 'vat' \t\t=> $this->_formatNumber($vat),\n 'total' \t=> $this->_formatNumber($price + $vat)\n );\n }\n }", "public function getTotal()\n {\n return $this->totalCalculator->getCartTotal($this->cart);\n }", "public function total();", "public function total();", "public function total();", "public function getRowTotal() {\n return $this->item->getRowTotal();\n }", "public function getCurrentMonthTotalOrder() : int;", "function getTotalPrice(){\n \treturn $this->myCart->total();\n }", "function inventory_total($inventory) {\n $inventory_total = 0;\n foreach ($inventory as $product_id => $quantity) {\n $inventory_total += $quantity;\n }\n return $inventory_total;\n}", "public function getCartTotal()\n {\n }", "public function total()\n {\n return $this->calculateTotal();\n }", "function getOverallOrderPrice(){\n\t\t$t=0;\n\t\t$a = Order::where('payment', 'verified')->get();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t\n\t\t$r = intVal($n->qty)*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "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}", "public function getTotal():int{\r\n\t return (int)$this->_vars['total_items']??0;\r\n\t}", "public function getTotal()\n {\n $subTotal = $this->getSubTotal(false);\n\n $newTotal = 0.00;\n\n $process = 0;\n\n $conditions = $this\n ->getConditions()\n ->filter(function (CartCondition $cond) {\n return $cond->getTarget() === 'total';\n });\n\n // if no conditions were added, just return the sub total\n if (!$conditions->count()) {\n return Helpers::formatValue($subTotal, $this->config['format_numbers'], $this->config);\n }\n\n $conditions\n ->each(function (CartCondition $cond) use ($subTotal, &$newTotal, &$process) {\n $toBeCalculated = ($process > 0) ? $newTotal : $subTotal;\n\n $newTotal = $cond->applyCondition($toBeCalculated);\n\n $process++;\n });\n\n return Helpers::formatValue($newTotal, $this->config['format_numbers'], $this->config);\n }", "public function _apply()\n {\n $order = $this->_entity;\n $data = $order->getArrayCopy();\n\n $orderTotal = $data['grand_total'] - $data['shipping_total'];\n foreach (Order::getNonCashPaymentCodes() as $code) {\n $orderTotal += $data[$code];\n }\n\n return array('order_total'=> $orderTotal);\n }", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "function get_cart_total() {\n\t\t\tif (!$this->prices_include_tax) :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total);\n\t\t\telse :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total + $this->tax_total);\n\t\t\tendif;\n\t\t}", "public function subtotal()\n {\n return $this->getCartItemCollection()->sum(function (CartItem $item) {\n return $item->subtotal();\n });\n }", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "function total( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the items or not? If $zcarriage='NO' exclude the zcarriage from the total cost\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND sku<>'zcarriage'\" : '';\n\n\t\t// The pu already contains vat\n\t\t$res = $this->db->query( \"SELECT SUM(ci.qty*ci.pu) price FROM cart_items ci INNER JOIN cart c ON c.id=ci.cart_id WHERE cart_id='\".$cart_id.\"' AND user='\".$user_no.\"' AND qty>0\".$zcarriage )->row_array();\n\t\treturn $res[ 'price' ];\n\t}", "static public function get_shipping_line_total( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \t$total = $order->get_total_shipping(); \n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\tforeach( $shippings as $shipping ){\n \t\t\t\t\t\n \t\t\t\t$total = $shipping->get_total();\n \t\t\t\t\t\n\t\t\t\t} \t\n\n \t}\n\n \treturn $total;\n\n \t}", "public static function getCartTotal(){\n $totalAmount=0;\n $cart = self::getCartContent();\n foreach ($cart as $key => $value) {\n if(is_numeric($value['amount']))\n $totalAmount += $value['amount'];\n }\n return $totalAmount;\n }", "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 }", "function get_order_total(){\n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n\t$max=count($_SESSION[$cart]);\n\t$sum=0;\n\tfor($i=0;$i<$max;$i++){\n\t\t$pid=$_SESSION[$cart][$i]['bookid'];\n\t\t$q=$_SESSION[$cart][$i]['qty'];\n\t\t$price=get_price($pid);\n\t\t$sum+=$price*$q;\n\t}\n\treturn $sum;\n}", "public function total()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.cart_total', 0);\n\t}", "function getTotalWeight()\n { $total = 0 ;\n if (count($this->items) > 0) \n { \n for ($p=0; $p<count($this->items); $p++) \n {\n $total = $total + $this->items[$p];\n }\n }\n return $total;\n }", "public function getTotalAmount()\n {\n return $this->subtotal() + $this->shippingCost() + $this->tax() - $this->discounts();\n }", "public function TotalItems()\n {\n return $this->getTotalItems();\n }", "public function total(): float\n {\n $price = $this->price;\n\n /* if ($this->hasOptions()) {\n foreach ($this->data['options'] as $item) {\n if (array_key_exists('price', $item)) {\n $price += $item['price'];\n }\n }\n }\n\n if ($includeTax) {\n $price = $this->tax->add($price);\n }*/\n\n return (float)($price * $this->quantity);\n }", "public function getTotalCost()\n {\n $this->loadItems();\n return $this->calculator->getCost($this->items);\n }", "public function total(){\n\t\treturn $this->total;\n\t}", "public static function getTotalValueOfOrderDashboard()\n {\n \ttry\n \t{\n\t \t$storage = My_Zend_Globals::getStorage();\n\t \n\t \t$table = self::_TABLE_PRODUCT_ORDER_DETAIL;\n\t \n\t \t//Query data from database\n\t \t$select = $storage->select()\n\t\t\t\t\t \t->from($table,'sum(amount_total)')\n\t\t\t\t\t \t->where('order_status = ?', 0);\n\t \t \n\t \t$total = $storage->fetchCol($select);\n\t \t \n\t \t$total = intval($total['total']);\n\t \t\n\t \treturn $total;\n \t}\n \tcatch(Exception $e)\n \t{\n \t\treturn false;\n \t}\t \t\n }", "public function getOrderBaseGrandTotal(){\n return $this->_getData(self::ORDER_BASE_GRAND_TOTAL);\n }", "public function calculate_cart_total()\r\n\t{\r\n\t\t$cart_total = 0;\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['item_summary_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['shipping_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['surcharge_total'];\r\n\t\t$cart_total += (! $this->flexi_cart->cart_prices_inc_tax()) ? $this->flexi->cart_contents['summary']['tax_total'] : 0; \r\n\t\t\r\n\t\t$this->flexi->cart_contents['summary']['total'] = $this->format_calculation($cart_total);\r\n\t\t\t\t\r\n\t\treturn TRUE; \r\n\t}", "public function total()\n {\n return $this->total;\n }", "public function total()\n {\n return $this->total;\n }", "public function total_items()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.total_items', 0);\n\t}", "protected function calculate_item_subtotals() {\n\t\tforeach ( $this->items as $item_key => $item ) {\n\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\tif ( $this->cart->get_customer()->get_is_vat_exempt() ) {\n\t\t\t\t\t$item = $this->remove_item_base_taxes( $item );\n\t\t\t\t} elseif ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {\n\t\t\t\t\t$item = $this->adjust_non_base_location_price( $item );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$item->subtotal = $item->price;\n\t\t\t$subtotal_taxes = array();\n\n\t\t\tif ( $this->calculate_tax && $item->product->is_taxable() ) {\n\t\t\t\t$subtotal_taxes = WC_Tax::calc_tax( $item->subtotal, $item->tax_rates, $item->price_includes_tax );\n\t\t\t\t$item->subtotal_tax = array_sum( array_map( array( $this, 'round_line_tax' ), $subtotal_taxes ) );\n\n\t\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\t\t// Use unrounded taxes so we can re-calculate from the orders screen accurately later.\n\t\t\t\t\t$item->subtotal = $item->subtotal - array_sum( $subtotal_taxes );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax_data'] = array( 'subtotal' => wc_remove_number_precision_deep( $subtotal_taxes ) );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_subtotal'] = wc_remove_number_precision( $item->subtotal );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_subtotal_tax'] = wc_remove_number_precision( $item->subtotal_tax );\n\t\t}\n\t\t$this->set_total( 'items_subtotal', array_sum( array_map( 'round', array_values( wp_list_pluck( $this->items, 'subtotal' ) ) ) ) );\n\t\t$this->set_total( 'items_subtotal_tax', array_sum( array_values( wp_list_pluck( $this->items, 'subtotal_tax' ) ) ) );\n\n\t\t$this->cart->set_subtotal( $this->get_total( 'items_subtotal' ) );\n\t\t$this->cart->set_subtotal_tax( $this->get_total( 'items_subtotal_tax' ) );\n\t}", "public function getAmount()\r\n {\r\n $amount = $this->getDeliveryGrossAmount();\r\n foreach ($this->_items as $item)\r\n {\r\n $amount += $item->getTotalGrossAmount();\r\n }\r\n return $amount;\r\n }", "public function get_cart_total() {\n\t\treturn apply_filters( 'woocommerce_cart_contents_total', wc_price( wc_prices_include_tax() ? $this->get_cart_contents_total() + $this->get_cart_contents_tax() : $this->get_cart_contents_total() ) );\n\t}" ]
[ "0.7544279", "0.744409", "0.73381084", "0.7333466", "0.7150177", "0.7108031", "0.7074462", "0.70557106", "0.6990477", "0.69810516", "0.69407475", "0.685851", "0.6846683", "0.68316746", "0.68219024", "0.67971474", "0.6762665", "0.6759001", "0.6746418", "0.67287326", "0.6724299", "0.6700715", "0.6690516", "0.66890997", "0.66874415", "0.66499996", "0.6634928", "0.6630271", "0.66295874", "0.662709", "0.6603285", "0.65920895", "0.6586461", "0.6559341", "0.6558335", "0.655389", "0.6546579", "0.6529458", "0.65276825", "0.6524432", "0.65195316", "0.65186083", "0.64923245", "0.6470773", "0.64635295", "0.6461416", "0.64558315", "0.64497197", "0.64485216", "0.6429719", "0.64243656", "0.64174664", "0.64008796", "0.639312", "0.63927215", "0.6391378", "0.63906145", "0.6390384", "0.6383419", "0.63814694", "0.6379893", "0.63789093", "0.63789093", "0.63789093", "0.6375449", "0.6360453", "0.6351342", "0.6342043", "0.63353634", "0.6332423", "0.63312066", "0.6322623", "0.6310421", "0.630993", "0.63084126", "0.63061917", "0.63038665", "0.63029647", "0.62979496", "0.62966865", "0.62887025", "0.62821424", "0.62765765", "0.6275129", "0.62731797", "0.6263743", "0.6260608", "0.62565833", "0.62514323", "0.625027", "0.62438756", "0.6239401", "0.62373877", "0.6237122", "0.62335294", "0.62335294", "0.622854", "0.62249696", "0.6221571", "0.62204826" ]
0.6584413
33
Get Order for OrderItem
public function getOrder() { $parent = $this->getParent(); do { if ($parent instanceof CoreShopOrder) { return $parent; } $parent = $parent->getParent(); } while ($parent != null); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function orderItem(): OrderItem\n {\n return $this->order_item;\n }", "protected function getOrderItem()\n\t{\n\t\t$search = $this->object->createSearch();\n\n\t\t$expr = [];\n\t\t$expr[] = $search->compare( '==', 'order.base.rebate', 14.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.sitecode', 'unittest' );\n\t\t$expr[] = $search->compare( '==', 'order.base.price', 53.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.editor', $this->editor );\n\t\t$search->setConditions( $search->combine( '&&', $expr ) );\n\t\t$results = $this->object->searchItems( $search );\n\n\t\tif( ( $item = reset( $results ) ) === false ) {\n\t\t\tthrow new \\RuntimeException( 'No order found' );\n\t\t}\n\n\t\treturn $item;\n\t}", "public function getCustomerOrderItem()\n {\n return $this->customerOrderItem;\n }", "public function getOrder()\n {\n return $this->getItem()->getOrder();\n }", "public function getOrder() { \n if ($this->hasOrder()) {\n return $this->getData('order');\n }\n if (Mage::registry('current_order')) {\n return Mage::registry('current_order');\n }\n if (Mage::registry('order')) {\n return Mage::registry('order');\n }\n Mage::throwException(Mage::helper('sales')->__('Can\\'t get order instance'));\n }", "public function getOrder()\n {\n return $this->orderFactory->create()->load($this->getReservedOrderId(), 'increment_id');\n }", "public function getOrder()\n {\n $orderId = $this->getData(self::ORDER_ID);\n\n return $this->order->load($orderId);\n }", "public function item($order)\n {\n return SiteMaintenanceItem::where('main_id', $this->id)->where('order', $order)->first();\n }", "public function processOrderItem(OrderItem $item)\n {\n // since we are create a subscription, we delegate the subscription creation to that model\n Subscription::createFromOrderItem($item);\n\n return $item;\n }", "public function getOrder()\n {\n return $this->hasOne(Orders::className(), ['id' => 'order_id']);\n }", "protected function _getOrder()\n {\n if (empty($this->_order)) {\n // get proper order\n $id = $this->_request['track_id'];\n $this->_order = Mage::getModel('sales/order')->loadByIncrementId($id);\n if (!$this->_order->getId()) {\n $this->_debugData['exception'] = sprintf('Wrong order ID: \"%s\".', $id);\n $this->_debug();\n Mage::app()->getResponse()\n ->setHeader('HTTP/1.1','503 Service Unavailable')\n ->sendResponse();\n exit;\n }\n }\n return $this->_order;\n }", "public function get_order() {\n return wc_get_order( $this->get_order_id() );\n }", "public function getOrder()\n {\n return $this->hasOne(Order::className(), ['id' => 'order_id']);\n }", "public function getOrder()\n {\n return $this->hasOne(Order::className(), ['id' => 'order_id']);\n }", "public function orderItem()\n {\n return $this->belongsTo(OrderItem::class)->withTrashed();\n }", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder($id) {\n return Order::fetch($id);\n }", "public function getOrder()\n {\n return $this->__get(\"order\");\n }", "protected function _getOrder()\n {\n if ($this->getOrder()) {\n $order = $this->getOrder();\n } else if ($this->getCheckout()->getLastRealOrderId()) {\n $order = Mage::getModel('sales/order')->loadByIncrementId($this->getCheckout()->getLastRealOrderId());\n } else {\n return null;\n }\n return $order;\n }", "protected function getOrder($orderId) {\n $order = Order::with('items.catalog.product')->where('id', '=', $orderId)->where('status', '=', Order::PENDING)->first();\n return $order;\n }", "public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;", "private function getOrder($order_id){\r\n\r\n if($this->flow_woocommerce_version_check()){\r\n return new WC_Order($order_id);\r\n }\r\n else{\r\n return wc_get_order($order_id);\r\n }\r\n }", "public function getInvoiceOrder();", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return $this->order;\n }", "public function getOrder()\n {\n $order = Mage::registry('current_order');\n if ($order == null) {\n $lastOrderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();\n $order = Mage::getModel('sales/order')->loadByIncrementId($lastOrderId);\n }\n return $order;\n }", "public function getOrderItems()\n {\n return $this->hasMany(OrderItems::class, ['oi_order_id' => 'id']);\n }", "public function getOrderId();", "public function getOrder() {\n return $this->order;\n }", "public function getOrder()\n {\n \treturn $this->_order;\n }", "function getOrder(){\n\t\treturn $this->order;\n\t}", "public function getOrder()\n {\n return $this->_order;\n }", "public function getOrder()\n {\n\n }", "protected function getShopOrder(){\n if($this->oShopOrder===null){\n $this->oShopOrder = new Order($this->get('current_orders_id'));\n }\n if(!$this->oShopOrder instanceof Order){\n throw new Exception(\"order is not found. shop order id : \".$this->get('current_orders_id'));\n }\n return $this->oShopOrder;\n }", "private function getOrder($orderoid){\n $rs = selectQuery('select * from WTSORDER where KOID=\"'.$orderoid.'\"');\n if ($rs->rowcount() == 1){\n $ors = $rs->fetch();\n foreach($ors as $k=>$v){\n\t$order->{$k} = $v;\n }\n } else {\n $order = null;\n XLogs::critical(get_class($this), 'Impossible de trouver la commande ayant pour KOID : '.$orderoid);\n }\n return $order;\n }", "public function getOrder()\n {\n return $this->getQuote();\n }", "public function getOrder ()\r\n\t{\r\n\t\treturn $this->order;\r\n\t}", "private function _getOrder()\n {\n if (!is_null($this->_order)) {\n return $this->_order;\n }\n \n $orderId = $this->getRequest()->getParam('orderId');\n if (!empty($orderId)) {\n $this->_order = Mage::getSingleton('sales/order')->loadByIncrementId($orderId);\n return $this->_order;\n }\n \n Mage::throwException('Forbidden');\n }", "public function getOrder()\n {\n return $this->coreRegistry->registry('current_order');\n }", "public function getOrderByReference(string $order_reference): OrderInterface;", "static public function getOrderById($order_id) {\n $order = DB::table('orders')->where('id', $order_id)->get();\n return $order;\n }", "public function getOrderItems()\n {\n return $this->hasMany(OrderItem::className(), ['order_id' => 'id'])->inverseOf('order');\n }", "public function order()\n {\n return $this->hasOne('App\\Models\\Order');\n }", "function getOrder();", "public function getOneOrder($orderId) {\n\n $this->load->model('account/order');\n return $this->model_account_order->getOrder($orderId);\n }", "public function getOrder()\n {\n if ($this->_order === false) {\n $items = $this->items;\n $first = reset($items);\n $this->_order = $first !== null ? $first->order : null;\n }\n return $this->_order;\n }", "public function getOrderId() {\n return $this->item->getOrderId();\n }", "function getOrder()\n{\n\n}", "public function order(){\n\t\treturn $this->hasOne(Order::class);\n\t}", "public function model()\n {\n return OrderItem::class;\n }", "public function model()\n {\n return OrderItem::class;\n }", "public function getOrder()\n\t{\n\t\treturn $this->order;\n\t}", "protected function getOrderItemObjectByIdOrUuid($id)\n {\n \n if ($this->orderItem == null) {\n \n if (preg_match('/^\\d{1,}$/', $id, $res)) {\n $orderItem = OrderItemPeer::retrieveById($id);\n }\n else {\n $orderItem = OrderItemPeer::retrieveByUuid($id);\n }\n \n $this->forward404Unless($orderItem);\n $this->forward404Unless($orderItem->getMemberId() == $this->getUser()->getUserId());\n $this->orderItem = $orderItem;\n }\n \n return $this->orderItem;\n }", "public function show(OrderItem $orderItem)\n {\n return OrderItemResource($orderItem);\n }", "public function getOrder() \n\t{\n\t\treturn $this->order;\n\t}", "public function getOrderById($id_order)\n {\n return $this->orderRepository->getOrderById($id_order);\n }", "public function getOrderFromSession(): Order\n {\n $id = Session::pull('mall.payment.order');\n\n return Order::findOrFail($id);\n }", "public function getOrderId()\r\n {\r\n return $this->object;\r\n }", "abstract public function getOrderAble();", "public function getOrder()\n\t\t{\n\t\t\treturn $this->order;\n\t\t}", "protected function getOrderProduct()\n\t{\n\t\t$priceManager = \\Aimeos\\MShop\\Factory::createManager( $this->context, 'price' );\n\t\t$productManager = \\Aimeos\\MShop\\Factory::createManager( $this->context, 'product' );\n\t\t$orderProductManager = \\Aimeos\\MShop\\Factory::createManager( $this->context, 'order/base/product' );\n\n\t\t$price = $priceManager->createItem();\n\t\t$price->setValue( '20.00' );\n\n\t\t$product = $productManager->createItem();\n\t\t$product->setCode( 'test' );\n\n\t\t$orderProduct = $orderProductManager->createItem();\n\t\t$orderProduct->copyFrom( $product );\n\t\t$orderProduct->setPrice( $price );\n\n\t\treturn $orderProduct;\n\t}", "private function getOrder()\n {\n // get the last real order id\n $lastOrderId = $this->_checkoutSession->getLastRealOrderId();\n if ($lastOrderId) {\n // load and return the order instance\n return $this->_orderFactory->create()->loadByIncrementId($lastOrderId);\n }\n return false;\n }", "public static function order($orderId) {\n //Return an object with the information about $orderId\n\t\t\treturn self::get(self::order_index() . '/' . $orderId);\n\t\t}", "public function getOrder()\n\t{\n\t\treturn $this->_order;\n\t}", "public function getDeliveryOrder();", "function get_order() {\n return $this->get_mapped_property('order');\n }", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "public function getOrderItems()\n {\n return $this->hasMany(OrderItem::className(), ['product_id' => 'id']);\n }", "protected function _getOrder()\n {\n $sOrderId = $this->_getContainer()->getConfig()->getRequestParameter('oxid');\n\n if ($sOrderId !== null) {\n /** @var oxOrder $oOrder */\n $oOrder = $this->_getContainer()->getObjectFactory()->createOxidObject('oxOrder');\n\n if ($oOrder->load($sOrderId) === true) {\n return $oOrder;\n }\n }\n\n return null;\n }", "public function getOrderItemNumber() {\n\t\treturn $this->orderItemNumber;\n\t}", "public function Order()\n {\n return $this->order;\n }", "static public function getOrderById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"sales.`order` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n \n return $aItem[0];\n }", "private function getOrderById(int $orderId): OrderInterface\n {\n return $this->orderRepository->get($orderId);\n }", "private function insertOrdemItem($item, $orderID) {\n $ordemItem = new OrderItem();\n $ordemItem->orderID = $orderID;\n $ordemItem->ISBN = $item['ISBN'];\n $ordemItem->qty = $item['quantity'];\n $ordemItem->price = $item['price'];\n $ordemItem->save();\n }", "function get_order()\n{\n\n}", "public function getOrder()\n {\n if($this->getShipment()) {\n return $this->getShipment()->getOrder();\n }\n return null;\n }", "public function orderItem()\n {\n /* @var $customerAccount MagentoComponents_Pages_CustomerAccount */\n $customerAccount = Menta_ComponentManager::get('MagentoComponents_Pages_CustomerAccount');\n $customerAccount->login();\n\n /* @var $cart MagentoComponents_Pages_Cart */\n $cart = Menta_ComponentManager::get('MagentoComponents_Pages_Cart');\n $cart->clearCart();\n\n /* @var $productSingleView MagentoComponents_Pages_ProductSingleView */\n $productSingleView = Menta_ComponentManager::get('MagentoComponents_Pages_ProductSingleView');\n $productSingleView->putProductsIntoCart($this->getConfiguration()->getValue('testing.simple.product.id'));\n\n /* @var $onePageCheckout MagentoComponents_Pages_OnePageCheckout */\n $onePageCheckout = Menta_ComponentManager::get('MagentoComponents_Pages_OnePageCheckout');\n\n $onePageCheckout->goThroughCheckout();\n\n $this->getHelperAssert()->assertTextNotPresent(\"There was an error capturing the transaction.\");\n $orderNumber = $onePageCheckout->getOrderNumberFromSuccessPage();\n\n return $orderNumber;\n }", "public function getOrder($user_id, $order_id)\n {\n $where = [\n 'user_id' => $user_id,\n 'order_id' =>$order_id,\n ];\n $result = $this->where($where)->find(); \n\n return $result;\n }", "public function get_order_by_id($id) {\n if(!$id) {\n throw new Exception('id should not be empty');\n }\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/orders/$id.json\");\n }", "public function getOrderItemCompositeWithJoin()\n {\n return $this->hasOne(self::className(), ['item_id' => 'item_id', 'order_id' => 'order_id'])\n ->joinWith('item');\n }", "public function order() {\n return $this->belongsTo('App\\Entity\\Order');\n }", "public function getOrderById($orderId)\n {\n }", "public function find(int $id): Order\n {\n return Order::find($id);\n }", "public function getOrderId()\n {\n return $this->orderId;\n }", "public function getOrderId()\n {\n return $this->orderId;\n }" ]
[ "0.81829226", "0.7612418", "0.7026369", "0.6917325", "0.6857079", "0.68304247", "0.67461914", "0.67441154", "0.6713446", "0.66755724", "0.66699594", "0.6651202", "0.66321176", "0.66321176", "0.6598792", "0.6555995", "0.6555995", "0.6555995", "0.6555995", "0.6555995", "0.6555995", "0.6547597", "0.64432174", "0.6442255", "0.64352137", "0.6419267", "0.63893723", "0.63872087", "0.6384493", "0.6384493", "0.6384493", "0.6384493", "0.6384493", "0.6384493", "0.6384493", "0.6384493", "0.6384493", "0.6384493", "0.6384493", "0.6376704", "0.6349376", "0.63360935", "0.6332783", "0.63295627", "0.63156027", "0.62738526", "0.6258163", "0.62547046", "0.6250833", "0.62491155", "0.6246477", "0.6242124", "0.62367994", "0.6230124", "0.6228009", "0.62231666", "0.6185509", "0.6184332", "0.61795074", "0.617731", "0.61758024", "0.61583704", "0.6138115", "0.61272043", "0.61272043", "0.6113949", "0.61102235", "0.6109572", "0.6105341", "0.6104389", "0.6095053", "0.6088137", "0.60851634", "0.6070301", "0.6061637", "0.6048628", "0.60343987", "0.60330397", "0.6027939", "0.6026224", "0.60212135", "0.60212135", "0.60212135", "0.6009776", "0.60089374", "0.60023266", "0.60009116", "0.59968066", "0.59760505", "0.5966792", "0.5960499", "0.5957543", "0.59572643", "0.59446156", "0.59363794", "0.59237117", "0.59195524", "0.5907789", "0.58972156", "0.5878078", "0.5878078" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->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 view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\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 $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\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 }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\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 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 permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function 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 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 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.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
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 &eacute;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
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(Request $request) { $request->validate([ 'background' => 'mimes:jpeg,bmp,png' // Only allow .jpg, .bmp and .png file types. ]); $user = User::find($request->id); if($request->name != ""){ $user->name = $request->name; } if($request->email != ""){ $user->email = $request->email; } if($request->password != ""){ $user->password = Hash::make($request->password); } if($request->background != ""){ $imgName = time().'.'.$request->background->extension(); $request->background->move(public_path('images/background'), $imgName); $image_path = public_path('images/background/' . $user->background); if(file_exists($image_path)){ File::delete($image_path); } $user->background = $imgName; } $user->save(); return redirect('update'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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(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() {\n return view('routes::edit');\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 edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\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 $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(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\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 \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 $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($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.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
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(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "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
Get height If no "height" value has been set, this method will set and return a default "height" value, if any such value is available
public function getHeight() : ?float ;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function get_height()\n {\n return $this->height;\n }", "public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }", "public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }", "protected function height() {\n return $this->height;\n }", "public function getDefaultHeight() : ?float;", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "public function getHeight()\n {\n return $this->data->height;\n }", "function\tgetHeight() {\n\t\treturn $this->height ;\n\t}", "public function getHeight() {\n\t\treturn $this->_height;\n\t}", "function getHeight() {\n\t\treturn $this->_Height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight() {\n $height = false;\n if (isset($this->_height)) {\n $height = $this->_height;\n }\n\n return $height;\n }", "function getHeight() {\n // return $originalHeight;\n\t\t\n return $this->height;\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function r_height($value = null)\n {\n $this->r_height = $value;\n }", "public function getHeight()\n\t{\n\t\tif (substr($this->getContainerStyle('height'), -2, 2) != 'px')\n\t\t\treturn false;\n\n\t\treturn intval(substr($this->getContainerStyle('height'), 0, -2));\n\t}", "public function getHeight(): int\n {\n return $this->height;\n }", "public function setHeight($height) {}", "public function setHeightAttribute($height = null)\n\t{\n\t\t$this->attributes['height'] = intval($height);\n\t}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function height(){\n\t\t\t\treturn\t$this->_actual_height + $this->_titleHeight + $this->_spacing;\n\t\t}", "public function getHeight()\n {\n if (null === $this->height && !$this->initialised) {\n $this->refreshDimensions();\n }\n\n if (null === $this->height) {\n $height = getenv('LINES');\n if (false !== $height) {\n $this->height = (int) trim($height);\n }\n }\n\n return $this->height ?: static::DEFAULT_HEIGHT;\n }", "public function setHeight($height);", "public function setHeight($height);", "function getHeight() {\n\t\t}", "function get_height() {\n //based on image height\n return $this->_height;\n }", "function getHeight() {\n\t\t$myHeight = $this->getElementText(DOMIT_RSS_ELEMENT_HEIGHT);\n\n\t\tif ($myHeight == '') {\n\t\t\t$myHeight = '31';\n\t\t}\n\t\telse if (intval($myHeight) > 400) {\n\t $myHeight = '400';\n\t\t}\n\n\t\treturn $myHeight;\n\t}", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "function set_height($height) {\n $this->height = $height;\n }", "public function getHeight() {\n return $this->h;\n }", "public function getHeight($width = null) {}", "public function getHeight($width = null) {}", "public function setHeight($value)\n {\n return $this->setProperty(\"Height\", $value, true);\n }", "public function height()\n {\n return $this->setRightOperand(PVar::HEIGHT);\n }", "function height() {\n if (empty($this->bodyheight)) {\n if ($this->page[\"Bio\"] == \"\") $this->openpage (\"Bio\",\"person\");\n if (preg_match(\"/Height<\\/h5>\\s*\\n(.*?)\\s*\\((.*?)\\)/m\",$this->page[\"Bio\"],$match)) {\n $this->bodyheight[\"imperial\"] = trim($match[1]);\n $this->bodyheight[\"metric\"] = trim($match[2]);\n }\n }\n return $this->bodyheight;\n }", "public function getHeight()\n {\n if (!isset($this->height)) {\n $this->height = ps_get_value($this->document->resource, \"imageheight\", $this->id);\n }\n\n return $this->height;\n }", "public function getHeight(): int\n {\n return (int) $this->height;\n }", "public function setHeight($val)\n {\n $this->_propDict[\"height\"] = floatval($val);\n return $this;\n }", "public function getHeightT()\n {\n if (! isset($this->heightT)) {\n $this->heightT = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightTQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightT;\n }", "public function getHeight(): int\n {\n $height = getenv('LINES');\n if (false !== $height) {\n return (int) trim($height);\n }\n\n if (null === self::$height) {\n self::initDimensions();\n }\n\n return self::$height ?: 50;\n }", "public function initialHeight()\n {\n return $this->setRightOperand(PVar::INITIAL_HEIGHT);\n }", "public function height() : int;", "public function setHeight($var)\n {\n GPBUtil::checkUint32($var);\n $this->height = $var;\n\n return $this;\n }", "public function height() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$height = 0;\n\n\t\t\tif ($dims = $file->dimensions()) {\n\t\t\t\t$height = $dims['height'];\n\t\t\t}\n\n\t\t\treturn $height;\n\t\t});\n\t}", "public function setHeight($value) {\n $this->settings['height'] = $value;\n // Return for chaining\n return $this;\n }", "function getHeight();", "public function getHeight() { return 0; }", "public function getHeight()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_v($this->h);\n }", "public function getHeightM()\n {\n if (! isset($this->heightM)) {\n $this->heightM = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightMQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightM;\n }", "public function testDefaultHeight()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $height = $view->get('height');\n \n $this->assertNull($height);\n }", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getTextHeight() {}", "public function getFrameHeight() {}", "public function setHeight($height) {\n\t\t$height = (int) $height;\n\t\t$this->height = (($height > 0) && ($height <= self::MAX_HEIGHT)) ? $height : self::DEFAULT_HEIGHT;\n\t}", "public function getHeightS()\n {\n if (! isset($this->heightS)) {\n $this->heightS = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightSQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightS;\n }", "public function getHeightN()\n {\n if (! isset($this->heightN)) {\n $this->heightN = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightNQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightN;\n }", "public function getPixelHeight()\n {\n return isset($this->pixel_height) ? $this->pixel_height : null;\n }", "public function Height(int $height)\n {\n return $this->setOption('h', $height);\n }", "private function getGraphHeight() {\n\t\treturn $this->graphHeight;\n\t}", "public function setHeight($height)\r\n {\r\n if (is_numeric($height))\r\n {\r\n $this->height = (int)$height;\r\n }\r\n }", "public function setHeight($height = 40)\n {\n $this->height = $height;\n $this->setAttributes(\"Height\");\n }", "public function getHeightO()\n {\n if (! isset($this->heightO)) {\n $this->heightO = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightOQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightO;\n }", "public function getMaxHeight()\n {\n return $this->maxHeight;\n }", "public function getMaxHeight()\n {\n return $this->maxHeight;\n }", "#[@fromDia(xpath= 'dia:attribute[@name=\"height\"]/dia:real/@val', value= 'real')]\n public function setHeight($height) {\n $this->setReal('height', $height);\n }", "public function getMaxHeight()\n {\n return $this->_maxHeight;\n }", "final public function set_height($height)\n {\n $this->height = $height;\n return $this;\n }", "public function height($manipulation_name = '')\n\t{\n\t\treturn $this->row_field('height');\n\t}", "public function height()\r\n {\r\n if (is_null($this->height)) {\r\n $this->height = imagesy($this->image);\r\n }\r\n\r\n return $this->height;\r\n }", "public function get_image_height()\n {\n }" ]
[ "0.8027314", "0.79231095", "0.7860998", "0.7807732", "0.7713141", "0.7666182", "0.7649829", "0.7649184", "0.7624303", "0.7624303", "0.7624303", "0.7624303", "0.7624303", "0.7624303", "0.7624303", "0.7624303", "0.7624303", "0.7624303", "0.76231384", "0.7594182", "0.7515678", "0.75086796", "0.74881476", "0.7473281", "0.7473281", "0.7473281", "0.74685353", "0.73798496", "0.7338085", "0.7338085", "0.7338085", "0.7338085", "0.728461", "0.72845054", "0.7279097", "0.7273953", "0.7263263", "0.72577584", "0.72565925", "0.72565925", "0.72565925", "0.72565925", "0.72565925", "0.7256098", "0.7242134", "0.7217922", "0.7176956", "0.7176956", "0.7171202", "0.7149992", "0.71217555", "0.70910054", "0.70910054", "0.70910054", "0.70910054", "0.70910054", "0.70627606", "0.7039663", "0.7005809", "0.7005809", "0.6993521", "0.6981563", "0.695899", "0.6939875", "0.6895082", "0.68815273", "0.68690354", "0.6867912", "0.68528557", "0.683074", "0.6819841", "0.6797475", "0.67893654", "0.67786276", "0.6761516", "0.673987", "0.6720386", "0.6719554", "0.6702854", "0.6702854", "0.6702854", "0.66868323", "0.667854", "0.66769576", "0.6669912", "0.6668159", "0.6667795", "0.6666292", "0.6651711", "0.66345316", "0.6628615", "0.6625089", "0.6623068", "0.6623068", "0.6606526", "0.65805364", "0.6571403", "0.6570558", "0.65690356", "0.6555326" ]
0.703083
58
Check if "height" has been set
public function hasHeight() : bool;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasHeight()\n {\n return $this->height !== null;\n }", "public function hasImageHeight()\n {\n return $this->image_height !== null;\n }", "public function isAutoHeight() {\n\t\tif ($this->_height==0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setHeight($height)\n {\n if(is_numeric($height) && $height > 0)\n {\n $this->height = (int)$height;\n \n return true;\n }\n \n return false;\n }", "public function setHeight($height) {}", "function set_height($height) {\n $this->height = $height;\n }", "public function setHeight($height);", "public function setHeight($height);", "protected function checkHeight(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_Height) && $this->_Height !== null && $this->_Height !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_Height} is not a valid value for Height\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "public function getHeight()\n\t{\n\t\tif (substr($this->getContainerStyle('height'), -2, 2) != 'px')\n\t\t\treturn false;\n\n\t\treturn intval(substr($this->getContainerStyle('height'), 0, -2));\n\t}", "function getHeight() {\n\t\t}", "public function r_height($value = null)\n {\n $this->r_height = $value;\n }", "public function testHeightWithInteger()\n {\n $this->box->setHeight(300);\n static::assertEquals(300, $this->box->getHeight());\n }", "public function isManualHeightMode()\n {\n return ($this->HeightMode == self::HEIGHT_MANUAL);\n }", "function getHeight();", "public function getDefaultHeight() : ?float;", "public function getHeight() {\n $height = false;\n if (isset($this->_height)) {\n $height = $this->_height;\n }\n\n return $height;\n }", "final public function get_height()\n {\n return $this->height;\n }", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function setHeightAttribute($height = null)\n\t{\n\t\t$this->attributes['height'] = intval($height);\n\t}", "function get_height() {\n //based on image height\n return $this->_height;\n }", "public function setHeight($value)\n {\n return $this->setProperty(\"Height\", $value, true);\n }", "public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }", "public function testDefaultHeight()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $height = $view->get('height');\n \n $this->assertNull($height);\n }", "public function getHeight($width = null) {}", "public function getHeight($width = null) {}", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function checkMaxHeight()\n {\n if (!isset($this->maxHeight)) {\n return true;\n }\n if (false !== $dimension = getimagesize($this->mediaTmpName)) {\n if ($dimension[1] > $this->maxHeight) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_HEIGHT_TO_LARGE, $this->maxHeight, $dimension[1]));\n return false;\n }\n } else {\n trigger_error(sprintf(\\XoopsLocale::EF_IMAGE_SIZE_NOT_FETCHED, $this->mediaTmpName), E_USER_WARNING);\n }\n return true;\n }", "protected function height() {\n return $this->height;\n }", "#[@fromDia(xpath= 'dia:attribute[@name=\"height\"]/dia:real/@val', value= 'real')]\n public function setHeight($height) {\n $this->setReal('height', $height);\n }", "public function getFrameHeight() {}", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }", "public function height() : int;", "public function setHeight($height) {\n\t\t$height = (int) $height;\n\t\t$this->height = (($height > 0) && ($height <= self::MAX_HEIGHT)) ? $height : self::DEFAULT_HEIGHT;\n\t}", "public function setHeight($height)\r\n {\r\n if (is_numeric($height))\r\n {\r\n $this->height = (int)$height;\r\n }\r\n }", "public function hasWidth()\n {\n return $this->width !== null;\n }", "public function setHeight($height)\n\t{\n\t\tif (preg_match ( '/^\\d+$/', $height ))\n\t\t{\n\t\t\tif ($height > 0)\n\t\t\t{\n\t\t\t\t$this->_height = $height;\n\t\t\t} else\n\t\t\t{\n\t\t\t\tthrow new Lumia_Placeholder_Exception(__METHOD__ . '() Height must be greater than zero.');\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tthrow new Lumia_Placeholder_Exception(__METHOD__ . '() Height must be an integer.');\n\t\t}\n\t}", "public function hasSizes() {\n if (!empty($this->cropBox['width'])) {\n return TRUE;\n }\n\n if (!empty($this->cropBox['height'])) {\n return TRUE;\n }\n\n return FALSE;\n }", "public function testHeightWithNumericString()\n {\n $this->box->setHeight('300');\n static::assertEquals(300, $this->box->getHeight());\n }", "public function testHeightWithFloat()\n {\n $this->box->setHeight(300.10);\n static::assertEquals(300, $this->box->getHeight());\n }", "function\tgetHeight() {\n\t\treturn $this->height ;\n\t}", "public function getHeight() : ?float ;", "public function getHeight()\n {\n return $this->height;\n }", "public function setHeight($height)\n {\n $this->height = $height;\n }", "public function setHeight($height)\n {\n $this->height = $height;\n }", "public function validDimensions() {\n\t\tlist($width, $height) = getimagesize($this->file['tmp_name']);\n\t\n\t\tif($height <= $this->max_height && $width <= $this->max_width) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\t\t\t\t\n\t}", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "function getHeight() {\n\t\treturn $this->_Height;\n\t}", "public function hasCollisionHeightM()\n {\n return $this->collision_height_m !== null;\n }", "public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }", "public function setHeight($height = 40)\n {\n $this->height = $height;\n $this->setAttributes(\"Height\");\n }", "public function setHeight($height)\n {\n $this->height = (int) $height;\n }", "public function hasHardSizes() {\n return (!empty($this->cropBox['width']) && !empty($this->cropBox['height'])) ? TRUE : FALSE;\n }", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "public function height()\n {\n return $this->setRightOperand(PVar::HEIGHT);\n }", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getHeight()\n {\n return $this->data->height;\n }", "function height() {\n if (empty($this->bodyheight)) {\n if ($this->page[\"Bio\"] == \"\") $this->openpage (\"Bio\",\"person\");\n if (preg_match(\"/Height<\\/h5>\\s*\\n(.*?)\\s*\\((.*?)\\)/m\",$this->page[\"Bio\"],$match)) {\n $this->bodyheight[\"imperial\"] = trim($match[1]);\n $this->bodyheight[\"metric\"] = trim($match[2]);\n }\n }\n return $this->bodyheight;\n }", "public function height(){\n\t\t\t\treturn\t$this->_actual_height + $this->_titleHeight + $this->_spacing;\n\t\t}", "public function getTextHeight() {}", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function testHeightenWithZeroHeight()\n {\n $this->box->setWidth(0);\n static::setExpectedExceptionRegExp('InvalidArgumentException');\n $this->box->heighten(20);\n }", "public function setHeight($height) {\n $this->h = $height;\n }", "public function initialHeight()\n {\n return $this->setRightOperand(PVar::INITIAL_HEIGHT);\n }", "public function hasSize() {\n return $this->_has(2);\n }", "public function testSetMaxDimensionsNotNumericHeight() {\n $this->assertFalse($this->up->setMaxDimensions(640, \"world\"));\n }", "function getHeight() {\n // return $originalHeight;\n\t\t\n return $this->height;\n }", "public function setHeight($height) {\n\t\t$this->_height=$height;\n\t\t$this->_autoHeight=$height;\n\t}", "function height($h) {\r\n\t\treturn ((!empty($h)) ? ' height:'.$h. 'px;' : '');\r\n\t}", "private function getPlotHeight() {\n\t\treturn $this->plotHeight;\n\t}", "protected function update_size($width = \\false, $height = \\false)\n {\n }", "public function setHeight($value)\n {\n $this->height = (int) $value;\n\n if ($this->height < 1) {\n throw new \\RuntimeException('Height must be greater than 0: ' . $this->height);\n }\n }", "public function get_image_height()\n {\n }", "public function testSetHeightProduct()\n {\n $product = new Product();\n $value = 9;\n $product->setHeight($value);\n $this->assertEquals($value, $product->getHeight());\n }", "public function getHeight() {\n\t\treturn $this->_height;\n\t}" ]
[ "0.79277056", "0.7188172", "0.7042197", "0.69540477", "0.69267553", "0.6717599", "0.67155147", "0.67155147", "0.6697209", "0.6588197", "0.6493271", "0.6438556", "0.6433856", "0.6419823", "0.6398155", "0.6343338", "0.63297224", "0.62741965", "0.62739795", "0.62729853", "0.62729853", "0.62729853", "0.62729853", "0.62729853", "0.6272496", "0.62608916", "0.6246483", "0.6245865", "0.6243967", "0.62245077", "0.62236315", "0.62236315", "0.6203089", "0.6203089", "0.6203089", "0.6203089", "0.6203089", "0.6197136", "0.6175905", "0.6152071", "0.61259556", "0.6086309", "0.6086309", "0.6086309", "0.6086309", "0.6067782", "0.60607046", "0.6059273", "0.6029829", "0.6027363", "0.60218316", "0.601892", "0.6016738", "0.6010795", "0.60024506", "0.5991593", "0.5989534", "0.598656", "0.598656", "0.598553", "0.59736174", "0.5964985", "0.5964357", "0.59568423", "0.59564227", "0.59442157", "0.5943172", "0.59318316", "0.59288436", "0.5922183", "0.5922183", "0.5922183", "0.5918573", "0.590161", "0.58946675", "0.5888514", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5879392", "0.5878623", "0.5867618", "0.586678", "0.58572525", "0.5840509", "0.5833864", "0.58243966", "0.5821984", "0.57967395", "0.5790262", "0.5786838", "0.57788944", "0.5774611", "0.57689" ]
0.7917462
1
Get a default "height" value, if any is available
public function getDefaultHeight() : ?float;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }", "public function testDefaultHeight()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $height = $view->get('height');\n \n $this->assertNull($height);\n }", "public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }", "final public function get_height()\n {\n return $this->height;\n }", "function getHeight() {\n\t\t$myHeight = $this->getElementText(DOMIT_RSS_ELEMENT_HEIGHT);\n\n\t\tif ($myHeight == '') {\n\t\t\t$myHeight = '31';\n\t\t}\n\t\telse if (intval($myHeight) > 400) {\n\t $myHeight = '400';\n\t\t}\n\n\t\treturn $myHeight;\n\t}", "public function initialHeight()\n {\n return $this->setRightOperand(PVar::INITIAL_HEIGHT);\n }", "public function getHeight()\n\t{\n\t\tif (substr($this->getContainerStyle('height'), -2, 2) != 'px')\n\t\t\treturn false;\n\n\t\treturn intval(substr($this->getContainerStyle('height'), 0, -2));\n\t}", "public function r_height($value = null)\n {\n $this->r_height = $value;\n }", "public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }", "public function getStyleHeight()\n\t{\n\t\tif (!$this->getBox()->isForMeasurement()) {\n\t\t\treturn '0';\n\t\t}\n\t\t$height = $this->getBox()->getStyle()->getRules('height');\n\t\tif ('auto' === $height) {\n\t\t\treturn null;\n\t\t}\n\t\t$percentPos = strpos($height, '%');\n\t\tif (false !== $percentPos) {\n\t\t\t$widthInPercent = substr($height, 0, $percentPos);\n\t\t\t$closestBoxDimensions = $this->getBox()->getClosestBox()->getDimensions();\n\t\t\tif (null !== $closestBoxDimensions->getHeight()) {\n\t\t\t\t$parentHeight = $closestBoxDimensions->getInnerHeight();\n\t\t\t\tif ($parentHeight) {\n\t\t\t\t\treturn Math::percent($widthInPercent, $parentHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn $height;\n\t\t}\n\t\treturn null;\n\t}", "public function getHeight($width = null) {}", "public function getHeight($width = null) {}", "protected function height() {\n return $this->height;\n }", "public function getHeight() : ?float ;", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->data->height;\n }", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "function getHeight() {\n\t\t}", "public function getHeight()\n {\n if (null === $this->height && !$this->initialised) {\n $this->refreshDimensions();\n }\n\n if (null === $this->height) {\n $height = getenv('LINES');\n if (false !== $height) {\n $this->height = (int) trim($height);\n }\n }\n\n return $this->height ?: static::DEFAULT_HEIGHT;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight() {\n $height = false;\n if (isset($this->_height)) {\n $height = $this->_height;\n }\n\n return $height;\n }", "function get_height() {\n //based on image height\n return $this->_height;\n }", "public function height() : int;", "public function getHeightN()\n {\n if (! isset($this->heightN)) {\n $this->heightN = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightNQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightN;\n }", "public function getHeight()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_v($this->h);\n }", "public function height(){\n\t\t\t\treturn\t$this->_actual_height + $this->_titleHeight + $this->_spacing;\n\t\t}", "public function getHeight() { return 0; }", "function getHeight();", "public function getHeight(): int\n {\n return $this->height;\n }", "public function height($manipulation_name = '')\n\t{\n\t\treturn $this->row_field('height');\n\t}", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "function getHeight() {\n // return $originalHeight;\n\t\t\n return $this->height;\n }", "function getHeight() {\n\t\treturn $this->_Height;\n\t}", "function height() {\n if (empty($this->bodyheight)) {\n if ($this->page[\"Bio\"] == \"\") $this->openpage (\"Bio\",\"person\");\n if (preg_match(\"/Height<\\/h5>\\s*\\n(.*?)\\s*\\((.*?)\\)/m\",$this->page[\"Bio\"],$match)) {\n $this->bodyheight[\"imperial\"] = trim($match[1]);\n $this->bodyheight[\"metric\"] = trim($match[2]);\n }\n }\n return $this->bodyheight;\n }", "public function getHeightS()\n {\n if (! isset($this->heightS)) {\n $this->heightS = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightSQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightS;\n }", "public function getHeight() {\n\t\treturn $this->_height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "function\tgetHeight() {\n\t\treturn $this->height ;\n\t}", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function getHeightO()\n {\n if (! isset($this->heightO)) {\n $this->heightO = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightOQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightO;\n }", "public function height() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$height = 0;\n\n\t\t\tif ($dims = $file->dimensions()) {\n\t\t\t\t$height = $dims['height'];\n\t\t\t}\n\n\t\t\treturn $height;\n\t\t});\n\t}", "public function getPixelHeight()\n {\n return isset($this->pixel_height) ? $this->pixel_height : null;\n }", "public function getHeightT()\n {\n if (! isset($this->heightT)) {\n $this->heightT = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightTQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightT;\n }", "public function getHeightM()\n {\n if (! isset($this->heightM)) {\n $this->heightM = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightMQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightM;\n }", "public function height()\n {\n return $this->setRightOperand(PVar::HEIGHT);\n }", "public function getPixelHeightUnwrapped()\n {\n return $this->readWrapperValue(\"pixel_height\");\n }", "public function getHeight(): int\n {\n $height = getenv('LINES');\n if (false !== $height) {\n return (int) trim($height);\n }\n\n if (null === self::$height) {\n self::initDimensions();\n }\n\n return self::$height ?: 50;\n }", "public function getTextHeight() {}", "public function getHeightZ()\n {\n if (! isset($this->heightZ)) {\n $this->heightZ = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightZQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightZ;\n }", "public function getHeight()\n {\n if (!isset($this->height)) {\n $this->height = ps_get_value($this->document->resource, \"imageheight\", $this->id);\n }\n\n return $this->height;\n }", "function iver_select_set_default_logo_height_for_header_types() {\n\t\t$logo_height_meta = iver_select_filter_px( iver_select_options()->getOptionValue( 'logo_area_height' ) );\n\t\t$logo_height = !empty($logo_height_meta) ? intval( $logo_height_meta ) : 74;\n\t\t\n\t\treturn apply_filters('iver_select_set_default_logo_height_value_for_header_types', $logo_height);\n\t}", "function height($h) {\r\n\t\treturn ((!empty($h)) ? ' height:'.$h. 'px;' : '');\r\n\t}", "public function getHeight(): int\n {\n return (int) $this->height;\n }", "public function getPreviewPixelHeightUnwrapped()\n {\n return $this->readWrapperValue(\"preview_pixel_height\");\n }", "public function getFrameHeight() {}", "public function get_image_height()\n {\n }", "public function getHeightQ()\n {\n if (! isset($this->heightQ)) {\n $this->heightQ = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightQQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightQ;\n }", "function pxlz_edgtf_set_default_logo_height_for_header_types() {\n $logo_height_meta = pxlz_edgtf_filter_px(pxlz_edgtf_options()->getOptionValue('logo_area_height'));\n $logo_height = !empty($logo_height_meta) ? intval($logo_height_meta) : 70;\n\n return apply_filters('pxlz_edgtf_set_default_logo_height_value_for_header_types', $logo_height);\n }", "function wpex_header_logo_img_height() {\n\t$height = apply_filters( 'logo_height', wpex_get_mod( 'logo_height' ) );\n\treturn $height ? intval( $height ) : ''; // can't be 0\n}", "public function getMaxHeight()\n {\n return $this->maxHeight;\n }", "public function getMaxHeight()\n {\n return $this->maxHeight;\n }", "public function getHeightC()\n {\n if (! isset($this->heightC)) {\n $this->heightC = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightCQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightC;\n }", "function iver_select_set_default_menu_height_for_header_types() {\n\t\t$menu_height_meta = iver_select_filter_px( iver_select_options()->getOptionValue( 'menu_area_height' ) );\n\t\t$menu_height = !empty($menu_height_meta) ? intval( $menu_height_meta ) : 74;\n\t\t\n\t\treturn apply_filters('iver_select_set_default_menu_height_value_for_header_types', $menu_height);\n\t}", "function spectra_block_height ()\n\t{\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT MAX(`height`) as `height` FROM `\".$GLOBALS[\"tables\"][\"block\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\treturn $result[\"height\"];\n\t}", "public function getHeightSq()\n {\n if (! isset($this->heightSq)) {\n $this->heightSq = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightSqQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightSq;\n }", "function pxlz_edgtf_set_default_menu_height_for_header_types() {\n $menu_height_meta = pxlz_edgtf_filter_px(pxlz_edgtf_options()->getOptionValue('menu_area_height'));\n $menu_height = !empty($menu_height_meta) ? intval($menu_height_meta) : 70;\n\n return apply_filters('pxlz_edgtf_set_default_menu_height_value_for_header_types', $menu_height);\n }", "public function getXHeight() {}", "public function getMaxHeight()\n {\n return $this->_maxHeight;\n }", "public function testSetBarcodeHeightDefault()\n {\n $this -> printer -> setBarcodeHeight();\n $this -> checkOutput(\"\\x1b@\\x1dh\\x08\");\n }", "public function getXHeight() {}", "public function getHeight() {\n return $this->h;\n }" ]
[ "0.7458024", "0.71031207", "0.7059774", "0.69578683", "0.6941431", "0.69215465", "0.69151694", "0.68585867", "0.6852155", "0.6851212", "0.68489146", "0.68489146", "0.6848284", "0.68094987", "0.6799212", "0.6799121", "0.6799121", "0.6799121", "0.6799121", "0.6799121", "0.67986935", "0.6751598", "0.6751598", "0.6751598", "0.6744383", "0.6724125", "0.670683", "0.66799605", "0.66637063", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66302216", "0.66217387", "0.66217387", "0.66217387", "0.66217387", "0.66217387", "0.65812397", "0.65770364", "0.65603286", "0.6555769", "0.65521103", "0.65518916", "0.6550399", "0.65367454", "0.65303713", "0.65235144", "0.65204656", "0.6505687", "0.65003777", "0.6499704", "0.6493124", "0.6482031", "0.6476264", "0.6476264", "0.6476264", "0.6462818", "0.6462017", "0.6462017", "0.6462017", "0.6462017", "0.6459596", "0.64480066", "0.6441704", "0.6439773", "0.64258397", "0.64213616", "0.6406937", "0.6406221", "0.63809836", "0.63630944", "0.63416684", "0.6297085", "0.6294309", "0.627356", "0.62548125", "0.62471944", "0.6240943", "0.6234241", "0.62333524", "0.6219109", "0.62122643", "0.62122643", "0.6211205", "0.6199246", "0.6197991", "0.6194984", "0.618342", "0.6165001", "0.61646414", "0.61627877", "0.61625713", "0.61404073" ]
0.83512485
0
Base constructor for ACL, make acl_user table if exists
public function __construct(array $params = []) { $this->getConnect(); if (!empty($params['groupTable'])) { $this->groupTable = $params['groupTable']; } if (!$this->conn->tableExists('acl_user')) { $this->conn->createTable('acl_user', [ '`id` int(10) unsigned NOT NULL AUTO_INCREMENT', '`user` int(11) unsigned NOT NULL', '`role` int(11) unsigned DEFAULT NULL', '`perm` int(11) unsigned DEFAULT NULL', 'PRIMARY KEY (`id`)' ], 'ENGINE=MyISAM DEFAULT CHARSET=utf8'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n parent::__construct();\n\n $this->setTable(Auth::table('role-user', 'role_user', false));\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->set_table('users');\n\t}", "public function __construct() {\n parent::__construct();\n Session::tiempo();\n $this->_aclm = $this->loadModel('acl');\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->tableName = \"user\";\n\t\t$this->keyField = \"user_id\";\n\t\t$this->columnNames = array(\"username\", \"password\", \"description\", \"quote\");\n\t}", "public function init()\n {\n parent::init();\n\n foreach ($this->rules as $rule) {\n if (isset($rule['roles']) && !empty($rule['roles'])) {\n $this->user = Instance::ensure($this->user, User::class);\n break;\n }\n }\n\n foreach ($this->rules as $i => $rule) {\n if (is_array($rule)) {\n $this->rules[$i] = \\Yii::createObject(array_merge([\n 'class' => AccessControlRule::class\n ], $rule));\n }\n }\n }", "public function __construct()\n\t\t{\n\t\t\t$this->tableName = 'users';\n\t\t\t//$this->id=$id;\n\t\t\tparent::__construct();\n\t\t}", "public function __construct($table) {\n if(strcmp($table, \"user\") == 0){\n $this->_dbTable = new Application_Model_DbTable_User();\n }\n else{\n $this->_dbTable = new Application_Model_DbTable_Organization();\n }\n \n }", "public function createAcl() {\r\n\t\t\r\n\t\t// create authorization adapter and load with roles from database\r\n\t\tZend_Registry::set('_acl', new Zend_Acl());\r\n\t\t\r\n\t\t$this->setRoles();\r\n\t\t\r\n\t\t$this->setResources();\r\n\t\t\r\n\t\t$this->setPermissions();\r\n\t}", "public function __construct()\n\t{\n\t\t/** Parse fields **/\n\t\t//$this->fields = include TABLEBASE.DS.'table_user.php';\n\t\t/** Set primary key **/\n\t\t$this->pk\t = 'id';\n\t\t/** Set name,parent call**/\n\t\tparent::__construct();\n\t}", "public function __construct()\n {\n $this->addRole(new Zend_Acl_Role('unregistered'))\n ->add(new Zend_Acl_Resource('public'))\n ->add(new Zend_Acl_Resource('error'))\n ->add(new Zend_Acl_Resource('index'))\n ->allow('unregistered', array('public', 'error', 'index'));\n\n // ACL for user\n $this->addRole(new Zend_Acl_Role('user'), 'unregistered')\n ->add(new Zend_Acl_Resource('user'))\n ->allow('user', 'user');\n\n\n // ACL for operatore\n $this->addRole(new Zend_Acl_Role('operatore'), 'unregistered')\n ->add(new Zend_Acl_Resource('operatore'))\n ->allow('operatore', 'operatore');\n\n }", "public function __construct(Laradmin $laradmin){\n $this->perm=$laradmin->permission;\n \n //Get table access info\n $temp=new UserGroup();\n $this->tableSourceId=Source::getTableSourceIdFromModel($temp);\n unset($temp);\n }", "public function __construct($options, $authClass = false)\n {\n if ( $authClass !== false ) {\n $this->_authClass = $authClass;\n }\n \n $pattern = '/^tbl/';\n foreach ($this->_cfg['acl'] as $key=>$tbl) {\n if ( preg_match($pattern, $key) ) {\n $options = $this->_fixOptions($key, $options);\n }\n }\n \n // user configuration\n $this->_cfg = self::_arrayMerge($this->_cfg, $options);\n \n // fill names of tables\n $this->tables['user'] = $this->_cfg['auth']['table'];\n $this->tables['group'] = $this->_cfg['acl']['tblgroup'];\n $this->tables['usergroup'] = $this->_cfg['acl']['tblusergroup'];\n $this->tables['resource'] = $this->_cfg['acl']['tblresource'];\n $this->tables['resourceuser'] = $this->_cfg['acl']['tblresourceuser'];\n $this->tables['resourcegroup'] = $this->_cfg['acl']['tblresourcegroup'];\n \n /**\n * constants of system groups\n */\n if ( !defined('AUTHACL_GROUP_SUPERUSER') ) {\n define('AUTHACL_GROUP_SUPERUSER', $this->_cfg['acl']['superuser']);\n }\n if ( !defined('AUTHACL_GROUP_NOTREGISTERED') ) {\n define('AUTHACL_GROUP_NOTREGISTERED', $this->_cfg['acl']['notregisteredusers']);\n }\n if ( !defined('AUTHACL_GROUP_REGISTERED') ) {\n define('AUTHACL_GROUP_REGISTERED', $this->_cfg['acl']['registeredusers']);\n }\n if ( !defined('AUTHACL_ROOTPATH') ) {\n define('AUTHACL_ROOTPATH', $this->_cfg['acl']['rootpath']);\n }\n if ( !defined('AUTHACL_ROOT_DIR') ) {\n define('AUTHACL_ROOT_DIR', dirname(__FILE__));\n }\n \n $_driverPath = AUTHACL_ROOT_DIR . \"/Driver/{$this->_cfg['acl']['driver']}.php\";\n \n if ( !file_exists($_driverPath) ) {\n throw new Exception('Not found driver file ' . $_driverPath);\n }\n \n $_driverClass = \"AuthAcl_Driver_{$this->_cfg['acl']['driver']}\";\n \n $this->_driver = new $_driverClass($this->_cfg);\n $this->_authObj = new $this->_authClass($this->_cfg['auth']['driver'], $this->_cfg['auth'], $this->loginFunction);\n }", "public function __construct()\n\t{\n\t\t$this->addRole(new Zend_Acl_Role('liv1'))\n\t\t\t ->add(new Zend_Acl_Resource('liv1'))\n\t\t\t ->add(new Zend_Acl_Resource('error'))\n\t\t\t ->add(new Zend_Acl_Resource('index'))\n\t\t\t ->allow('liv1', array('liv1','error','index'));\n\t\t\t \n\t\t// ACL per utente liv2\n\t\t$this->addRole(new Zend_Acl_Role('liv2'), 'liv1')\n\t\t\t ->add(new Zend_Acl_Resource('liv2'))\n\t\t\t ->allow('liv2','liv2')\n ->deny('liv2','liv1',array('login','registrazione'));\n \n // ACL per organizzazione (liv3)\n\t\t$this->addRole(new Zend_Acl_Role('liv3'), 'liv1')\n\t\t\t ->add(new Zend_Acl_Resource('liv3'))\n\t\t\t ->allow('liv3','liv3')\n ->deny('liv3','liv1',array('login','registrazione'));\n\t\t\t\t \n\t\t// ACL per amministratore (liv4)\n\t\t$this->addRole(new Zend_Acl_Role('liv4'), 'liv1')\n\t\t\t ->add(new Zend_Acl_Resource('liv4'))\n ->deny('liv4','liv1',array('login','registrazione'))\n\t\t\t ->allow('liv4','liv4');\n\t}", "function __construct() {\n // Initialize the dbms pointer.\n AbstractMapper::__construct();\n\n // Initialize table name.\n $this->tableName = \"user_sub_users\";\n }", "public function __construct()\n {\n parent::__construct();\n\n log_message('debug', 'Auth Model Loaded');\n \n $this->config->load('ag_auth');\n $this->load->database();\n\n $this->user_table = $this->config->item('auth_user_table');\n $this->group_table = $this->config->item('auth_group_table');\n }", "function __construct() {\r\n parent::__construct();\r\n $this->auth->no_cache();\r\n $this->auth->is_logged_in();\r\n $this->load->model('service_model');\r\n $this->load->model('company_model');\r\n\r\n define(\"USER_ROLE\", $this->auth->get_user_role());\r\n }", "function __construct()\n\t\t{\n\t\t\tparent::__construct('users', 'user_id');\n\t\t}", "public function __construct()\n {\n $this->acl = new Zend_Acl();\n }", "public function __construct() {\n //parent::__construct();\n\n $model = new AclModel();\n //$sections = new Sections();\n $privileges = new PrivilegesModel();\n $roles = new Roles();\n\n $this->recursiveRolesFill($roles->getTree());\n\n foreach($privileges->getResourcesArray() as $name)\n {\n $this->addResource($name);\n }\n\n foreach($model->getRules() as $rule)\n {\n $this->allow($rule->role, $rule->resource, $rule->privilege);\n }\n }", "public function __construct() {\n if (($this->role = self::$cache->get_value(self::ROLE_KEY)) === false) {\n self::$db->prepared_query(\"\n SELECT slug, artist_role_id, sequence, name, title, collection\n FROM artist_role\n ORDER BY artist_role_id\n \");\n $this->role = self::$db->to_array('slug', MYSQLI_ASSOC, false);\n self::$cache->cache_value(self::ROLE_KEY, $this->role, 86400 * 30);\n }\n }", "protected function __construct() {\r\n\r\n\t\tself::$_bUseCache = (Kwgl_Config::get(array('mode', 'cache', 'acl')) == 1);\r\n\r\n\t\t$this->_initRoles();\r\n\t\t$this->_initResources();\r\n\t\t$this->_initPermissions();\r\n\t}", "public function __construct($table = \"users\") {\n\t\tparent::__construct();\n\n\t\tif(DataBase::tableExists(PREFIX . $table))\n\t\t\t$this->_table = PREFIX . $table;\n\t\telse\n\t\t\t$this->errorTableDontExist(PREFIX . $table);\n\t}", "function __construct()\n {\n\t\tparent::__construct();\n\t if(!$this->session->userdata('uid'))\n\t { \n\t\t\tredirect('home');\n\t }\n\t\telse\n\t\t{\n\t\t\t$this->loginuser = $this->Admin_mo->getrow('users',array('uid'=>$this->session->userdata('uid')));\n\t\t}\n\t}", "public function __construct() {\n $this->sessionManager = new SessionManager;\n $this->router = new Router;\n\n $config = Config::auth();\n $this->setIdUserColumn($config['idUserColumn']);\n $this->setnameUserColumn($config['nameUserColumn']);\n $this->setUserColumn($config['userColumn']);\n $this->setPassColumn($config['passColumn']);\n $this->setLoginController($config['afterAuth']);\n $this->setLogoutController('auth');\n $this->setSessionUserAuth('userAuth');\n $this->setSessionUserInfo('userInfo');\n\n return $this;\n }", "function __construct()\n {\n $this->tablename = 'tmst_admin';\n \n\t\t$this->fieldlist = array('id_admin','user','pass');\n \n\t\t$this->sql_orderby = 'user';\n\t\t\n\t\t$this->fieldlist['id_admin'] = array('pkey' => 'y');\n\t\t$this->fieldlist['user'] = array('pkey' => 'y');\n\t\t \n\t\t\t\t\n }", "public function __construct(){\n\t\t\tglobal $db_user;\n\t\t\tparent::__construct($db_user['module']);\n\t\t\t\n\t\t}", "function __construct()\n {\n $this ->user = User::createInstance();\n }", "public function __construct() {\n\n $conn = new UserAccount();\n\n if(!$conn->access()) {\n\n $log = new AppLog();\n\n $log->database_log();\n\n }\n\n }", "public function __construct(){\n $this->table=\"usuarios\";\n parent::__construct($this->table);\n }", "public function __construct()\n\t{\n\t\tparent::__construct(\"user\");\n\t}", "public function __construct()\n {\n parent::init();\n $this->setColumnsList(array(\n 'id'=>'Id',\n 'username'=>'Username',\n 'password'=>'Password',\n 'email'=>'Email',\n 'id_role'=>'IdRole',\n 'status'=>'Status',\n 'recorddate'=>'Recorddate',\n 'luta'=>'Luta',\n ));\n\n $this->setParentList(array(\n ));\n\n $this->setDependentList(array(\n ));\n }", "public function __construct()\r\n\t{\r\n\t\t$db=Zend_Registry::get('connectDb');\r\n\t\t\r\n\t\t$sql='\tSELECT admin_role.role_id,privilege.module_name,privilege.controller_name,privilege.action_name \r\n\t\t\t\tFROM privilege, rule, admin_role\r\n\t\t\t\tWHERE admin_role.role_id = rule.object_id\r\n\t\t\t\tAND rule.privilege_id = privilege.privilege_id';\r\n\t\t$resources=$db->query($sql);\r\n\r\n\t\t//\r\n\t\t$sql='SELECT DISTINCT(controller_name) FROM privilege';\r\n\t\t$allResources=$db->query($sql);\r\n\t\t\r\n\t\t$sql='SELECT role_id, name FROM admin_role';\r\n\t\t$role=$db->query($sql);\r\n\t\t\r\n\t\t//Loop roles and put them in an assoc array by ID\r\n\t\t$roleArray = array();\r\n\t\tforeach ($role as $r)\r\n\t\t{\r\n\t\t\t$role=new Zend_Acl_Role($r['role_id']);\r\n\t\t\t$this->addRole($role);\r\n\t\t\t$roleArray[$r['role_id']] = $role;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tforeach ($allResources as $r)\r\n\t\t{\r\n\t\t\t$allResources=new Zend_Acl_Resource($r['controller_name']);\r\n\t\t\t$this->add($allResources);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($resources as $r)\r\n\t\t{\r\n\t\t\t$resources=new Zend_Acl_Resource($r['controller_name']);\r\n\t\t\t$action=$r['action_name'];\r\n\t\t\t$role=$roleArray[$r['role_id']];\r\n\t\t\t$this->allow($role,$resources,$action);\r\n\t\t}\r\n\t\t\r\n\t\t/*$check=null;\r\n\t\t\r\n\t\tforeach ($resources as $r)\r\n\t\t{\r\n\t\t\t$resources=new Zend_Acl_Resource($r['controller_name']);\r\n\t\t\tif($check!=$r['controller_name'])\r\n\t\t\t{\r\n\t\t\t\t$this->add($resources);\r\n\t\t\t\t$check=$r['controller_name'];\r\n\t\t\t}\r\n\t\t\t$action=$r['action_name'];\r\n\t\t\t$role = $roleArray[$r['role_id']];\r\n\t\t\t$this->allow($role,$resources,$action);\r\n\t\t}*/\r\n\t\t//access the ACL variable from anywhere\r\n\t\t//Zend_Registry::set('acl', $this);\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('Contao\\BackendUser', 'User');\n\t}", "public function __construct(DatabaseInterface $db, $user=false)\n {\n $this->permissionDb = new PermissionDb($db);\n\n if ($user !== false) {\n // try to load permissions for users rank\n try {\n $rank = new Rank($db, $user->getRank());\n $this->loadRank($rank);\n } catch (Exception\\InvalidId $e) {\n }\n\n // load users permissions\n $this->loadOnlyUser($user, true);\n }\n }", "public function __construct()\n {\n parent::__construct();\n $this->_checkIfUserIsAdmin();\n }", "function __construct(){\n\t\tparent::__construct('user');\n\t}", "public function __construct()\n {\n $this->roles = 'ROLE_USER';\n $this->createAt = new \\DateTime();\n }", "public function __construct()\n {\n\t\t$this->user=User::find(Auth::id());\n\t\t$this->role_name=$this->user->role->name;\n\t\tif($this->role_name==\"Admin\" || $this->role_name==\"SubAdmin\")\n\t\t\t$this->entrypoints=Entrypoint::whereIn('type',[1,3])->get();\n\t\telseif($this->role_name==\"Receiption\" || $this->role_name==\"Entrypoint\" || $this->role_name==\"Desk\"){\n\t\t\t$this->entrypoints=$this->user->entrypoints()->get();\n\t\t\t$this->entrypoint_sub_type=$this->user->entrypoints()->first()->sub_type;\n\t\t}\n\t\telseif($this->role_name==\"Doctor\" || $this->role_name==\"Nursing\")\n\t\t\t$this->medicalunits=$this->user->medicalunits()->orderBy('type','asc')->get();\n \n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->user = new User;\n\t}", "public function __construct($user=null){\n $this->_db = DB::getInstance();\n // $this->_sessionName = Core::get('session/session_name');\n // $this->_cookieName = Core::get('remember/cookie_name');\n\n if (!$user) {\n if (Session::exists($this->_sessionName)) {\n $user = Session::get($this->_sessionName);\n if ($this->find($user)) {\n $this->_isLoggedIn = true;\n } else {\n // process logout\n }\n }\n } \n else {\n $this->find($user);\n }\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->setTable(Auth::table('socialite-providers', 'socialite_providers'));\n }", "private function __construct() {\n\n $this->\n database = \\FluitoPHP\\Database\\Database::GetInstance();\n\n require_once( dirname(__FILE__) . DS . 'User.class.php' );\n\n $appConfig = \\FluitoPHP\\FluitoPHP::GetInstance()->\n GetConfig('AUTHENTICATION');\n\n $appConfig = $appConfig ? $appConfig : [];\n\n $moduleConfig = \\FluitoPHP\\FluitoPHP::GetInstance()->\n GetModuleConfig('AUTHENTICATION');\n\n $moduleConfig = $moduleConfig ? $moduleConfig : [];\n\n $appConfig = array_replace_recursive($appConfig, $moduleConfig);\n\n $this->\n UpdateConfig($appConfig);\n }", "function __construct() {\n // Initialize the dbms pointer.\n parent::__construct();\n\n // Initialize table name.\n $this->tableName = \"admin\";\n }", "function __construct()\n\t{\t\n\t\t$this ->user;\n\t\t$this ->needLogin = false;\n\t\t$this->categories = array();\n\t}", "public function __construct($tablename, $hasUid=true) {\n $this->tableName = $tablename;\n $this->hasUid = $hasUid;\n }", "public function __construct()\n {\n $this->table = 'ci_users';\n $this->dependents = array(\n array(\n 'table' => 'ci_jobseekers',\n 'key' => 'user_id'\n )\n );\n }", "public function __construct() {\n\t\tparent::__construct(\"system_users\");\n\t}", "public function __construct(){\n $this->loggerM = LoggerMgr::Instance()->getLogger(__CLASS__);\n \n $this->loggerM->trace(\"Enter\");\n parent::__construct();\n\t\t$this->tableDefinitionM = new TableDef(self::TB_UsersTableC);\n\t\t$this->tableDefinitionM->addColumn(new ColumnDef(\n self::IdColumnC,ColumnType::integerC));\n\t\t$this->tableDefinitionM->addColumn(new ColumnDef(\n self::NameColumnC,ColumnType::stringC));\n\t\t$this->tableDefinitionM->addColumn(new ColumnDef(\n self::EmailColumnC,ColumnType::stringC));\n\t\t$this->tableDefinitionM->addColumn(new ColumnDef(\n self::PasswordColumnC,ColumnType::stringC));\n\t\t$this->tableDefinitionM->addKey(self::IdColumnC);\n \n $this->tableMappingM = new TableMapping();\n \n $this->tableMappingM->addTable(self::phisicalTB_USERSC);\n $this->tableMappingM->addColumn(\n self::phisicalTB_USERSC ,\n self::phisicalTB_USERSIdColumnC ,\n self::IdColumnC,\n ColumnType::integerC);\n $this->tableMappingM->addColumn(\n self::phisicalTB_USERSC ,\n self::phisicalTB_USERSNameColumnC ,\n self::NameColumnC,\n ColumnType::stringC);\n $this->tableMappingM->addColumn(\n self::phisicalTB_USERSC ,\n self::phisicalTB_USERSEmailColumnC ,\n self::EmailColumnC,\n ColumnType::stringC);\n $this->tableMappingM->addColumn(\n self::phisicalTB_USERSC ,\n self::phisicalTB_USERSPasswordColumnC ,\n self::PasswordColumnC,\n ColumnType::stringC);\n \n $this->tableMappingM->addKey(self::phisicalTB_USERSC,\n self::phisicalTB_USERSIdColumnC );\n \n \n $this->loggerM->trace(\"Exit\");\n\t}", "public function __construct(array $attributes = []) {\n parent::__construct($attributes);\n\n $this->setTable(config('cani.collections.permissions'));\n }", "function __construct($TableName = \"w_auth\") {\r\n $this->idName = new DB_Field(\"idName\", 0, new DbIntSanitizer());\r\n $this->Role_Id = new DB_Field(\"Role_Id\", \"\", new DbStrSanitizer(3), TRUE, TRUE);\r\n $this->Organization_Id = new DB_Field(\"Organization_Id\", \"\", new DbStrSanitizer(3), TRUE, TRUE);\r\n $this->Policy_id = new DB_Field(\"Policy_id\", 0, new DbIntSanitizer(), TRUE, TRUE);\r\n $this->User_Name = new DB_Field(\"User_Name\", \"\", new DbStrSanitizer(245), TRUE, TRUE);\r\n \r\n $this->Status = new DB_Field(\"Status\", \"\", new DbStrSanitizer(2), TRUE, TRUE);\r\n $this->Updated_By = new DB_Field(\"Updated_By\", \"\", new DbStrSanitizer(45), FALSE);\r\n $this->Last_Updated = new DB_Field(\"Last_Updated\", NULL, new DbDateSanitizer(\"Y-m-d H:i:s\"), FALSE);\r\n $this->Timestamp = new DB_Field(\"Timestamp\", NULL, new DbDateSanitizer(\"Y-m-d H:i:s\"), FALSE);\r\n parent::__construct($TableName);\r\n }", "public function __construct(array $attributes = [])\n {\n $this->table = Helper::getPermissionTable();\n\n parent::__construct($attributes);\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}", "function __construct() \n {\n // Creation de la table\n self::createTableIfNeeded();\n }", "public function __construct()\r\n\t{\r\n\t\tparent::__construct();\r\n\t\t$this->import('BackendUser', 'User');\r\n\t}", "public function __construct()\n {\n\t\tparent::__construct();\n if($this->session->userdata('login') == 0 || $this->session->userdata('user_level') != '2' && $this->session->userdata('group_id') != '2') redirect('auth/logout');\n\t\t$this->session->set_userdata('menu','finance');\n\t\t$this->load->model('finance/finance_model', 'dbObject');\n\t\t$this->user_id = $this->session->userdata('user_id');\n }", "public function __construct()\n {\n if((strpos(\\Helpers\\Session::get('ROLES'),'A')||strpos(\\Helpers\\Session::get('ROLES'),'Z'))===false)\n \\Helpers\\Url::redirect('login');\n parent::__construct();\n $this -> _model_ = new \\Models\\Admin();\n }", "public function __construct(array $attributes = [])\n {\n parent::__construct($attributes);\n $this->table = Config::get('laratrust.tables.permissions');\n }", "public function __construct()\n\t{\n\t\t$this->table = \"applicant\";\n\t\t$this->as = \"applicant\";\n\t\tparent::__construct();\n\t}", "function __construct()\n {\n parent::__construct();\n check_access('admin');\n }", "function __construct()\n {\n parent::__construct();\n check_access('admin');\n }", "function __construct()\r\n\t{\r\n\t\tparent::__construct();\r\n\t\t//$this->pdo_connect = new database_connection();\r\n\r\n\t\t//Declaration \r\n\t\t$accounts_tbl = new app_tables();\r\n\t\t$accounts_tbl->create_profile_table();\r\n\r\n\t}", "public function __construct() {\n $this->checkAccess();\n }", "public function __construct()\r\r\n\t{\r\r\n\t\t$this->import('BackendUser', 'User');\r\r\n\t\tparent::__construct();\r\r\n\r\r\n\t\t$this->User->authenticate();\r\r\n\t}", "protected function _construct()\n {\n $this->_init(self::TABLE_NAME, self::TABLE_ID);\n }", "function __construct() \n {\n parent::__construct();\n\t\tis_logged_in();\n\t\t $this->load->model('administrations/SecurityModel');\n\t}", "public function __construct( $args )\n {\n parent::__construct( 'access', $args );\n \n $this->add_column( 'user.name', 'string', 'User', true );\n $this->add_column( 'role.name', 'string', 'Role', true );\n $this->add_column( 'site.name', 'string', 'Site', true );\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->import('\\BackendUser', 'User');\n\t}", "function __construct()\n {\n parent::__construct();\n $this->load->model('User_model','User_model');\n $this->load->model('CRUD','CRUD');\n\t\t\t//$this->load->model('CRUD');\n/* \t\t\tif($this->User_Auth())\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tredirect('/Adminlogin/index');\n\t\t\t\t\n\t\t\t} */\t\n }", "public function __construct() {\n\t\t$this -> beforeFilter('check_admin');\n\t\t$this -> beforeFilter('csrf', array('on' => 'post'));\n\t\t$this -> beforeFilter('detectLang');\n\t\t$this -> beforeFilter('auth');\n\t\t$this -> beforeFilter('before');\n\t\t\n\t\tif(!defined('ASSETS_PATH_FULL')){\n\t\t\t define('ASSETS_PATH_FULL', '\\public\\assets\\site');\n \t}\n\t\t$settings = Setting::whereIn('varname', \n\t\t\t\t\t\tarray('usegravatar'))->get();\n\t\tforeach ($settings as $v) {\n\t\t\t\tView::share($v -> varname, $v -> value);\n\t\t} \n\t\t$user = Auth::user();\t\t\t\n\t\tif(!empty($user)){\n\t\t\t$user2 = new User;\t\n\t\t\t$user = $user2;\t\n\t\t\t$this -> user = $user;\n\t\t\t$roles = $user->currentRoleIds();\n\t\t\tif($roles['allow_admin']=='0'){\n\t\t\t\tURL::to('/');\n\t\t\t}\n\t\t\t$this->roles = $roles['roleIds'];\t\n\t\t}\t\t\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\t\t\n\t\t$this->load->model('category_model');\n\t\t$this->load->model('users_model');\t\t\n\t\t$this->load->model('membershiplevel_model');\t\t\n\t\t$this->load->model('purchase_membership_model');\t\t\n\t\t$this->load->model('setting_model');\n\t\t$this->load->helper('url_helper');\n\t\t$this->load->library('session');\n\n\t\t//UserData\n\t\tif($this->session->userdata(\"isLoggedIn\"))\n\t\t{\n\t\t\t$user_data=$this->users_model->getUserData('',$this->session->userdata(\"user_id\"));\n\t\t\tif($user_data->role==2)\n\t\t\t\tredirect(\"auth/login\");\n\t\t}\n\t\telse{\n\t\t\tredirect(\"auth/login\");\n\t\t}\n\t}", "public function __construct(){\n\t\t$this->uid = null;\n\t\t$this->fields = array('username'=>'', 'emailAddr'=>'', 'isActive'=> false);\n\t}", "public function __construct() {\n// $group = new \\App\\Models\\Group;\n// $permission = new \\App\\Models\\Permission;\n// $this->repository = new \\App\\Repositories\\AclRepository($user, $group, $permission);\n// $this->faker = \\Faker\\Factory::create();\n }", "protected function _initAcls()\n {\n $acl = new Zend_Acl();\n\n $acl->addRole(new Zend_Acl_Role('guest'));\n $acl->addRole(new Zend_Acl_Role('developer', 'guest'));\n $acl->addRole(new Zend_Acl_Role('manager', 'guest'));\n\n $moduleResource = new Zend_Acl_Resource('logs');\n $acl->add($moduleResource)\n ->add(new Zend_Acl_Resource('logs:index'), $moduleResource)\n ->add(new Zend_Acl_Resource('default:index'), $moduleResource)\n ->add(new Zend_Acl_Resource('user:index'), $moduleResource);\n\n $acl->allow(\n array('developer'),\n 'logs:index',\n array('add-log', 'edit-log', 'delete-log', 'list-logs')\n );\n\n $acl->allow(\n array('manager'), 'logs:index', array('user')\n );\n\n $acl->allow(null, 'default:index');\n $acl->allow('developer', 'user:index');\n $acl->allow('manager', 'user:index');\n\n Zend_Registry::set('acl', $acl);\n\n $front = Zend_Controller_Front::getInstance();\n\n // add the auth setup plugin\n $front->registerPlugin(\n new Common_Controller_Plugin_Acl()\n );\n\n return $acl;\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($uid = 0)\n {\n // Init translation of valid search criteria to actual field list\n $this->uid = intval($uid);\n\n parent::__construct();\n\n $this->Tbl['adb_address'] = $this->DB['db_pref'].'adb_adr';\n $this->Tbl['adb_adr_group'] = $this->DB['db_pref'].'adb_adr_group';\n $this->Tbl['adb_attach'] = $this->DB['db_pref'].'adb_attachemnts';\n $this->Tbl['adb_freefield'] = $this->DB['db_pref'].'adb_freefield';\n $this->Tbl['adb_freefield_type'] = $this->DB['db_pref'].'adb_freefield_type';\n $this->Tbl['adb_group'] = $this->DB['db_pref'].'adb_group';\n $this->Tbl['user'] = $this->DB['db_pref'].'user';\n $this->Tbl['user_foldersettings'] = $this->DB['db_pref'].'user_foldersettings';\n\n $this->DB['ServerVersionString'] = $this->serverinfo();\n $this->DB['ServerVersionNum'] = preg_replace('![^0-9\\.]!', '', $this->DB['ServerVersionString']);\n\n try {\n $dbSh = new DB_Controller_Share();\n $allShares = $dbSh->getFolderList($this->uid, 'contacts');\n $this->allShares = (!empty($allShares[$this->uid]['contacts'])) ? $allShares[$this->uid]['contacts'] : array();\n } catch (Exception $e) {\n $this->allShares = array();\n }\n }", "function __construct() {\n\t\t\tparent::__construct();\n\t\t\t$user = $this->session->userdata;\n\t\t\tif(isset($user['USER_NAME'])){\n\t\t\t \t$this->load->model('userdata');\n\t\t\t \t$this->load->model('itemdata');\n\t\t\t \t$this->load->model('categorydata');\n\t\t\t}else{\n\t\t\t\tredirect('login', 'refresh');\n\t\t\t}\n\t\t}", "public function __construct()\n {\n parent::__construct();\n $this\n ->load\n ->helper(\"url\");\n\n $this\n ->load\n ->model(\"MEmpresa\");\n $this\n ->load\n ->model(\"MCups\");\n\n if ($this\n ->session\n ->userdata('rol_user') == 2 || $this\n ->session\n ->userdata('rol_user') == 3)\n {\n echo \"<p><b>ACCESO DENEGADO.</b> Señor usuario, se encuentra intentando acceder\" . \" a un sitio al cual no tiene permiso de acceso.</p>\";\n exit;\n }\n\n }", "public function __construct() {\n $this->db = Database::getDatabase();\n $this->dbConnection = $this->db->getConnection();\n $this->tblUser = $this->db->getUserTable();\n $this->tblLibrary = $this->db->getLibraryTable();\n $this->tblMovie = $this->db->getMovieTable();\n $this->tblEpisode = $this->db->getEpisodeTable();\n $this->tblTv = $this->db->getTvTable();\n }", "public function __construct(array $attributes = [])\n {\n parent::__construct($attributes);\n\n $this->setTable(config('admin.permission.table_names.roles'));\n }", "function __construct()\n {\n if (empty($this->table)) {\n $this->table = get_called_class();\n }\n }", "function __construct(){\r\n\t\t\t$dbHelper = new DBhelper();\r\n\t\t\t$validation = new ValidationUser();\r\n\t\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model('UserModel');\n $this->load->library('session');\n $this->load->helper('security');\n }", "public function __construct()\r\n\t{\r\n\t\tparent::__construct();\r\n\r\n\t\t$this->load->model(ADMIN_PREFIX . '/admin_auth_model');\r\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->timestamps = FALSE;\n $this->return_as = 'array';\n $this->has_one[\"auth_role\"] = array(\"auth_role\", \"role_id\", \"role_id\"); \n }", "private function buildACL()\n\t{\n\t\t//first, get the rules for the user's role\n\t\tif(count($this->user_roles) > 0){\n\t\t\t$this->perms = array_merge($this->perms, $this->getRolePerms($this->user_roles));\n\t\t}\n\t\t//then, get the individual user permissions\n\t\t$this->perms = array_merge($this->perms, $this->getUserPerms());\n\t}", "public function __construct($user = null){\n\n\t\t//$this->_db = DB::getInstance();\n\n\t\t$this->_db = DB::getInstance();\n\n\n\n\t\t$this->_sessionName = Config::get('session/session_name');\n\n\t\t$this->_cookieName = Config::get('remember/cookies_name');\n\n\n\n\t\tif(!$user){\n\n\t\t\tif(Session::exists($this->_sessionName)){\n\n\t\t\t\t$user = Session::get($this->_sessionName);\n\n\t\t\t\tif($this->find($user)){\n\n\t\t\t\t\t$this->_isLoggedin = true;\n\n\t\t\t\t}else{\n\n\t\t\t\t\t$this->_isLoggedin = false;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}else {\n\n\t\t\t$this->find($user);\n\n\t\t}\n\n\t}", "public function __construct(){\n $this->userDAO = new UserDAOBD();\n }", "public function __construct($route, $db)\n\t{\n\t\tparent::__construct($route, $db);\n\t\t$this->user = new userModel($this->db);\n\t}", "public function __construct() {\n // und lädt das zugehörige Model\n $this->userModel = $this->model('User');\n }", "public function __construct(MFW_Db_Table $table)\n {\n $table->setTable('users');\n\n $this->table = $table;\n }", "function __construct() {\n parent::__construct();\n $this->id = $this->getUserID(Session::get('user'));\n $this->FirstName = $this->getUserFirstName($this->id);\n $this->email = $_SESSION['user'];\n }", "function __construct() {\n //$this->load->helper('login_helper');\n\t\tparent::__construct();\n\t\tis_admin();\n // then execute the parent constructor anyway\n }", "public function __construct($db, $user, $id = null)\n {\n $this->_user = $user;\n parent::__construct($db, $id);\n }" ]
[ "0.72143686", "0.69024247", "0.67649955", "0.6761334", "0.6641306", "0.66311324", "0.6613149", "0.6567813", "0.6566103", "0.6546025", "0.6545018", "0.65067434", "0.6463405", "0.6455936", "0.6453794", "0.6449627", "0.64205694", "0.6415868", "0.6403942", "0.6382757", "0.6358371", "0.62853837", "0.62823564", "0.62698954", "0.6249002", "0.6208624", "0.61992747", "0.6187561", "0.6185866", "0.61857796", "0.6162272", "0.6145019", "0.6140202", "0.613902", "0.61371744", "0.6135043", "0.61319923", "0.61264956", "0.61131823", "0.61112815", "0.6105798", "0.6094189", "0.6093438", "0.60914254", "0.60827726", "0.6081282", "0.60770124", "0.60654676", "0.60595095", "0.6054996", "0.60363007", "0.6019654", "0.6019654", "0.6019654", "0.6019654", "0.6019654", "0.6019654", "0.6019654", "0.6019654", "0.6010361", "0.60084116", "0.600265", "0.59967", "0.599095", "0.59826434", "0.59810585", "0.59810585", "0.5977652", "0.5971883", "0.5965067", "0.59610206", "0.59558016", "0.5948099", "0.5943988", "0.5941066", "0.59294385", "0.5929108", "0.5923405", "0.59202707", "0.59154725", "0.58931017", "0.58919024", "0.5886509", "0.587648", "0.5872333", "0.5865472", "0.58612484", "0.5851641", "0.58504957", "0.5848739", "0.5835545", "0.58352727", "0.5832974", "0.5831357", "0.5829352", "0.5827075", "0.5823573", "0.58216786", "0.5820513", "0.5819116" ]
0.6976669
1
Get current connection from registry
public function getConnect() { $this->conn = Registry::get('db'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_current_connection()\n {\n }", "static private function connection($name) { return self::$connections[$name]['connection']; }", "public function getConnection()\n\t{\n\t\treturn static::$instances[$this->_instance];\n\t}", "function getConnection() {\n\t\tself::createConnection( $this->_connectionName );\n\t\treturn Kwerry::$_connections[ $this->_connectionName ];\n\t}", "public function get_connection()\n {\n return $this->connection();\n }", "function connection()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn Db::getConnection($this->conn_name);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function get_connection()\n {\n return $this->connection;\n }", "public function get_connection()\n {\n }", "public function getConnection(){\n\t\treturn $this->connection;\n\t}", "public function get_connection() {\n return $this->_connection;\n }", "public function get_connection() {\n return $this->_connection;\n }", "abstract protected function getActiveConnection();", "public function getConnection()\n {\n return($this->connx);\n }", "function getCONN(){\n return $this ->CONN;\n }", "public function getConnection(){\n\t\treturn $this->_connection;\n\t}", "function getConnection() {\r\n\r\n\t\treturn $this->connection;\r\n\r\n\t}", "public function getConnection()\n {\n return config('ring_central.connection.name');\n }", "private function getActiveConnection() \n {\n \n return $this->con;\n }", "public function getConnection()\n {\n return static::resolveConnection($this->getConnectionName());\n }", "public function getConnection()\n {\n return static::resolveConnection($this->getConnectionName());\n }", "public function connection()\n {\n return $this->connection;\n }", "public function connection()\n {\n return $this->connection;\n }", "public function connection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->mc[self::LOCAL_MC];\n }", "public function getConnection() {\n return $this->connection;\n }", "public function getConnection() {\n return $this->connection;\n }", "public function _getConnection(){\n return $this->_connection;\n }", "public function getConnection() {\n\t\treturn $this->_connection;\n\t}", "public function getConnection() {\n return $this->_connection;\n }", "public function getConnection() {\n return $this->connection;\n }", "public function getConnection()\n {\n $this->connection = db($this->connectionName);\n\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->_connection;\n }", "public static function getConnection() {\n return self::$defaultConnection;\n }", "public function get(): ConnectionInterface;", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function getConn(){\n\t\treturn $this->conn;\n\t}", "public function getConnection() {\n return $this->connection;\n }", "public function getConnectionName()\n {\n return array_search($this, self::$connections, true) ?: null;\n }", "protected function getConnection()\n {\n return $this->connection;\n }", "protected function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n\t{\n\t\treturn $this->connection;\n\t}", "public function getConnection()\n\t{\n\t\treturn $this->connection;\n\t}", "public function getConnection()\r\n\t{\r\n\t\treturn $this->connection;\r\n\t}", "public function getConn() {\n\n return $this->conn;\n }", "public function getConnection()\n {\n return $this->resolver->connection();\n }", "public function getConn()\n\t{\n\t\treturn $this->conn;\n\t}", "public function getConn(){\n return $this->conn;\n }", "public function getConnection()\n {\n return $this->__connection;\n }", "public function getConnection() {\n return $this->redis;\n }", "public function connection()\n {\n return $this->redis->connection('horizon');\n }", "protected function getConnection()\n {\n return $this->_connection;\n }", "public function getConn()\n {\n return $this->conn;\n }", "protected function connection()\n {\n return $this->redis->connection('horizon');\n }", "public function getConnection()\n {\n return $this->conn;\n }", "public function getConnection()\n {\n return $this->conn;\n }", "public function getConnectionName()\n {\n return $this->connection;\n }", "public function getConnectionName()\n {\n return $this->connection;\n }", "public function getConn() {\n\t\tif ($this->conn) {\n\t\t\treturn $this->conn;\n\t\t}\n\t}", "static public function getConnection()\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function get() {\n if($this->connected) {\n return $this->conn;\n }\n else {\n return $this->connect();\n }\n }", "public function getConnection() {\n return $this->conexion;\n }", "function getDefaultConnection()\n{\n\tglobal $cman;\n\treturn $cman->getDefault();\n}", "public static function conn()\n {\n return (static::inst())::$_db;\n }", "public function GetConn() {\n\n return $this->\n config['dbconn'];\n }", "public function current()\n {\n if (empty($this->currentConnection)) {\n $configs = ($this->Config) ? $this->Config->getConfigs() : null;\n\n if (count($configs) == 0) throw new \\Exception('No connections are available.');\n\n $default = $this->Config->getDefault();\n\n $name = is_null($default) ?\n @end(array_keys($configs ?: [])) :\n $default;\n\n $this->open($name);\n }\n\n return $this->currentConnection;\n }", "public static function getConnection()\n {\n return static::getInstance();\n }", "public function GetRedisConn() {\n\t\treturn $this->redis_conn;\n\t}", "private function connection()\n {\n return Database::connection($this->connectionName);\n }", "public static function getActiveConnection()\n {\n if (!self::$connection instanceof Connection) {\n return self::connect();\n }\n \n return self::$connection;\n }", "public function getConnection(){\n\t\tif(!isset($this->connection)){\n\t\t\t$this->connection = $this->connect($this->connectionParams);\n\t\t}\n\n\t\treturn $this->connection;\n\t}", "public function getConnectionName();", "public function getConnectionName();", "public function getConnectionName();", "public function getConnection(): Connection\n {\n return $this->_connection;\n }", "private function getConnection()\n {\n if (!$this->getChanel()) {\n $this->_connect = new \\PhpAmqpLib\\Connection\\AMQPConnection($this->host, $this->port, $this->login, $this->password, $this->vhost);\n }\n\n return $this->getChanel();\n }", "protected static function getConn() {\n return self::Conectar();\n }", "public function connection(){ return $this->connection; }", "public function getConnection(): Connection\n {\n return $this->connection;\n }", "public function getConnection()\n\t{\n\t\treturn empty($this->db_conn) ? Db::getConnection($this->getConnectionName()) : $this->db_conn;\n\t}", "abstract function getConnect();", "public function connection()\n {\n return static::$DB;\n }", "public function getConnectionName()\n {\n return $this->connectionName;\n }", "public function getConnection() {\n return $this->objDBConnection;\n }", "public function getConnection() {\n return $this->objDBConnection;\n }", "function findConnection(string $name);", "public function connection($name = 'default')\n {\n return Arr::get($this->clients, $name ?: 'default');\n }", "public function getConnection()\n {\n return Database::getConnection($this->connection);\n }", "public function connection($name = null)\n {\n $name = $name ?: 'default';\n $pid_name =getmypid().\"_\".$name;\n\n if (isset($this->connections[$pid_name])) {\n return $this->connections[$pid_name];\n }\n\n return $this->connections[$pid_name] = $this->resolve($name);\n }", "static public function activeConnectionName()\n {\n return self::$activeConnectionName;\n }" ]
[ "0.734824", "0.70336175", "0.69898206", "0.69358647", "0.67996067", "0.67443836", "0.6742806", "0.67117923", "0.6683121", "0.6678", "0.6678", "0.66763365", "0.6647009", "0.66380507", "0.66358525", "0.66316575", "0.6629875", "0.6619804", "0.6615401", "0.6615401", "0.66022086", "0.66022086", "0.66022086", "0.6571112", "0.6553649", "0.6553649", "0.6537176", "0.65361667", "0.6530989", "0.6524732", "0.65101373", "0.6495036", "0.6484052", "0.64817226", "0.6480508", "0.6480508", "0.6480508", "0.6480508", "0.6480508", "0.6480508", "0.6480508", "0.6480508", "0.6480508", "0.6480508", "0.6472583", "0.6472583", "0.6466503", "0.6460301", "0.6455845", "0.64553964", "0.64553964", "0.64546543", "0.64546543", "0.6449548", "0.6444514", "0.6444107", "0.6442322", "0.64407927", "0.6424975", "0.64239717", "0.6413902", "0.6400457", "0.63959175", "0.63943744", "0.63927054", "0.63927054", "0.63679093", "0.63679093", "0.63602686", "0.6338105", "0.632435", "0.6282215", "0.6278338", "0.62652993", "0.6256425", "0.62257713", "0.62194985", "0.62165266", "0.62134904", "0.6210148", "0.62025356", "0.61945647", "0.61945647", "0.61945647", "0.6194375", "0.6194083", "0.61748666", "0.6157337", "0.6146573", "0.61331975", "0.6122086", "0.611877", "0.6112237", "0.60931444", "0.60931444", "0.60710865", "0.60664225", "0.60613817", "0.60452855", "0.6037464" ]
0.63951313
63
Get permissions in role
abstract protected function rolePerms($role);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRolePermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $role_name = $this->argument('needle');\n\n $role = $this->permission->findBy('role_name', $role_name);\n if ($role) {\n $permissions = json_to_array($role->permission);\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n\n foreach ($permission as $ability=>$perm) {\n $vals = [$module, $ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No role found!\");\n }\n }", "public function getAllPermissionsForRole(string $role): array;", "protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }", "public function getPermissionsViaRole()\n {\n return $this->roles->map(function (Role $role) {\n return $role->getAllPermissions();\n })->flatten();\n }", "private function getUserRolePermissions()\n {\n return [];\n }", "public function getPermissions(Roleable $resource = null);", "public function getPermissions()\n {\n\n $roles = Role::where(function($query){\n\n $query->whereIn('id',$this->roles()->pluck('role_id'));\n\n })->with('permissions')->get();\n\n\n $permissions = $roles->map(function($role){\n\n $permissionData = $role->permissions->pluck('permission');\n\n if(sizeOf($permissionData) > 0)\n {\n return $permissionData[0];\n }\n\n })->filter(function($item){\n if($item !== null)\n {\n return $item;\n }\n });\n\n if ($permissions->count() <= 1)\n {\n return $permissions;\n }\n\n return $permissions->unique();\n\n }", "static function getPermissions($role=null){\n\t\t$permissions = Configure::read('App.permissions.options');\n\t\t$controller = '';\n\t\t$action = '';\n\t\t$items = array();\n\n\t\tforeach ($permissions as $perm) {\n\t\t\t$perm = trim($perm);\n\t\t\t$permData = explode(':', $perm);\n\t\t\t$controller = $permData[0];\n\t\t\t$action = $permData[1];\n\n\t\t\tif (!isset($role['Role']['permissions'])) {\n\t\t\t\t$allowed = '0';\n\t\t\t} else {\n\t\t\t\t$allowed = Common::requestAllowed($controller, $action, $role['Role']['permissions'], true);\n\t\t\t}\n\t\t\t$items[$controller][$action] = $allowed;\n\t\t}\n\t\treturn $items;\n\t}", "public function getRolePermissions()\n {\n return self::select(\"r.*, p.*\")\n ->leftJoin('role_permissions rp', 'r.roleID = rp.roleID')\n ->leftJoin('permissions p', 'p.permissionID = rp.permissionID')\n ->get();\n }", "public function getPermissions();", "public static function getAll()\n {\n return Role::with(['permissions'])->get();\n }", "public function permissions()\n {\n return $this->embedsMany(\n config('laravel-permission.table_names.role_has_permissions')\n );\n }", "public function getPermissionAndRoleList()\n {\n $user = $this->user;\n\n if (!$user) {\n throw new RoleAndPriviledgeServiceException(\"The user is not defined\");\n }\n $permissions = $user->directPermissions;\n\n $user->loadMissing(\"roles\", \"roles.permissions\");\n\n $roles = $user->roles;\n\n // $roles = $user->roles()->with(\"permissions\")->get();\n\n $roles->each(function ($role) use (&$permissions) {\n $permissions = $permissions->merge($role->permissions);\n });\n\n $rv = [\n array_unique($permissions->pluck(\"name\")->all()),\n array_unique($roles->pluck(\"name\")->all())\n ];\n\n return $rv;\n }", "function auth_permissions($role)\n {\n $auth = _cfg('auth');\n $perms = isset($auth['permissions']) ? $auth['permissions'] : array();\n\n return isset($perms[$role]) ? $perms[$role] : null;\n }", "public function listPermissionByRole()\n {\n $roles = $this->roleRepository->all();\n $permissions = $this->permissionRepository->all();\n return view('admin.permission.permission_role', compact('roles', 'permissions'));\n }", "public function getPermissions() {}", "public function getPermissions() {}", "public function getAdminPermissions(): array;", "public function permissions()\n {\n return $this->belongsToMany(\n config('laravel-authorisation.models.permission'),\n config('laravel-authorisation.table_names.role_has_permissions')\n );\n }", "public function getPermissions()\n\t{\n\t\tif(!$this->id)\n\t\t\treturn array();\n $role= UserRole::model()->getUserRole($this);\n if(!$role->role_id){\n return array();\n }\n\t\t$permissions = array();\n\t\t$sql = \"SELECT pa.ACTION_ID AS id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_ROLE.\"' and pm.principal_id = {$role->role_id}\";\n\t\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t\t$permissions[$permission['id']] = $permission['key'];\n\t\t\n\n\n\t\t// Direct user permission assignments\n\t\t$sql = \"select pa.ACTION_ID as id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_USER.\"' and pm.principal_id = {$this->id}\";\n\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t$permissions[$permission['id']] = $permission['key'];\n\n\n\t\treturn $permissions;\n\t}", "abstract public function getPermissions();", "public function rolePermissions(): Collection\n {\n return $this->roles?->loadMissing('permissions')->pluck('permissions')->flatten() ?? collect();\n }", "function list_permissions( $role_in ) {\n global $_SESSION;\n if (!isset($_SESSION)) {\n session_start();\n }\n $user_name = check_logged(); /// function checks if visitor is logged in.\n if (!$user_name)\n return;\n\n $allowed = false;\n if (!check_role( \"admin\" )) {\n return false;\n }\n\n // read the permissions database\n $d = loadDB();\n if ($role_in !== null) { // return role names of the current user\n foreach ($d[\"roles\"] as $key => $value) {\n if ( $value[\"name\"] == $role_in ) {\n $permissions_names = array();\n foreach ($value[\"permissions\"] as $perm) {\n foreach ($d[\"permissions\"] as $r) {\n if ($perm == $r[\"id\"])\n $permissions_names[] = $r[\"name\"];\n }\n }\n return $permissions_names;\n }\n }\n } else { // return all role names\n $permissions_names = array();\n foreach ($d[\"permissions\"] as $r) {\n $permissions_names[] = $r['name'];\n }\n return $permissions_names;\n }\n return;\n }", "public function getPermissionByRoleID($id);", "public function permissions($idr) {\n\n $stmt = $this->connection->prepare(\"SELECT id, permission_id FROM role_permissions WHERE role_id = ?\");\n $stmt->bind_param(\"s\", $idr);\n $stmt->execute();\n $result = $stmt->get_result();\n return $result->fetch_array();\n }", "function get_role_permission($role_id) {\n\t\t$sql = \"SELECT p.*, rp.entry_id, rp.allow_deny \"\n\t\t\t. \"FROM system_security.security_permission p \"\n\t\t\t. \"LEFT JOIN system_security.security_role_permission rp ON(rp.permission_id = p.permission_id AND rp.role_id = $role_id) \"\n\t\t\t. \"ORDER BY p.permission_id\";\n\t\treturn $this->db->query($sql);\n\t}", "public function permissions()\n {\n return $this->belongsToMany(\n config('admin.permission.models.permission'),\n config('admin.permission.table_names.role_has_permissions')\n );\n }", "public function & GetPermissions ();", "protected function getPermissions()\n {\n if (!$this->tablePermissionsExists()) {\n return [];\n }\n return Permission::with('roles')->get();\n }", "public function index(Role $role)\n {\n return PermissionResource::collection($role->permissions()->get());\n }", "public function permissions()\n\t{\n\t\treturn $this->get('permissions');\n\t}", "protected abstract function getAllowedRoles();", "public function permissionOfRole($id)\n {\n return $getAllPermissionOfRole = DB::table('role_permission')->where('role_id',$id)->pluck('permission_id');\n }", "public function cachedPermissions()\n {\n $rolePrimaryKey = $this->primaryKey;\n $cacheKey = 'guardian_permissions_for_role_' . $this->$rolePrimaryKey;\n if (Cache::getStore() instanceof TaggableStore) {\n return Cache::tags(Config::get('guardian.permission_role_table'))->remember($cacheKey, Config::get('cache.ttl', 60), function () {\n return $this->perms()->get();\n });\n } else {\n return $this->perms()->get();\n }\n }", "public function perms() {\n return $this->belongsToMany(config('entrust.permission'), config('entrust.permission_role_table'), 'role_id', 'permission_id');\n }", "public function permissions()\n {\n return $this->belongsToMany('bedoke\\LaravelRolePerms\\Models\\Permission', 'role_permissions')\n ->withPivot('id')\n ->withTimestamps();\n }", "function getPermissions(&$record){\n $auth =& Dataface_AuthenticationTool::getInstance();\n $user =& $auth->getLoggedInUser();\n if ( !isset($user) ) return Dataface_PermissionsTool::READ_ONLY();\n // if the user is null then nobody is logged in... read only\n $role = $user->val('Role');\n return Dataface_PermissionsTool::getRolePermissions($role);\n // Returns all of the permissions for the user's current role.\n }", "public function roles()\n {\n return $this->hasManyThrough(Permission::class);\n }", "private function getRolesPermissions()\n {\n return [\n [\n 'name' => 'Roles - List all roles',\n 'description' => 'Allow to list all roles.',\n 'slug' => RolesPolicy::PERMISSION_LIST,\n ],\n [\n 'name' => 'Roles - View a role',\n 'description' => 'Allow to view the role\\'s details.',\n 'slug' => RolesPolicy::PERMISSION_SHOW,\n ],\n [\n 'name' => 'Roles - Add/Create a role',\n 'description' => 'Allow to create a new role.',\n 'slug' => RolesPolicy::PERMISSION_CREATE,\n ],\n [\n 'name' => 'Roles - Edit/Update a role',\n 'description' => 'Allow to update a role.',\n 'slug' => RolesPolicy::PERMISSION_UPDATE,\n ],\n [\n 'name' => 'Roles - Delete a role',\n 'description' => 'Allow to delete a role.',\n 'slug' => RolesPolicy::PERMISSION_DELETE,\n ],\n ];\n }", "public function getAllPermissions(): array;", "public function index()\n {\n return Role::with('permissions')\n ->client()\n ->get();\n }", "function getPermissions() {\n // For eficientcy, we will just store the names, not the objects\n if ( is_null($this->allPermissions) ) {\n $tmpRole = FactoryObject::newObject(\"_Permission\");\n $this->allPermissions = $tmpRole ->getAllPermissionByIdRole($this->getId());\n } \n\n return $this->allPermissions;\n }", "public function getAllPermissions();", "public function getAllPermissions();", "public function getRole();", "public function getRole();", "public function rolesForUser();", "public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }", "public function perms()\n {\n return $this->belongsToMany(Permission::class, 'permission_role', 'role_id', 'permission_id');\n }", "function get_roles_with_capability($capability, $permission=NULL, $context='') {\n\n global $CFG;\n\n if ($context) {\n if ($contexts = get_parent_contexts($context)) {\n $listofcontexts = '('.implode(',', $contexts).')';\n } else {\n $sitecontext = get_context_instance(CONTEXT_SYSTEM);\n $listofcontexts = '('.$sitecontext->id.')'; // must be site\n }\n $contextstr = \"AND (rc.contextid = '$context->id' OR rc.contextid IN $listofcontexts)\";\n } else {\n $contextstr = '';\n }\n\n $selectroles = \"SELECT r.*\n FROM {$CFG->prefix}role r,\n {$CFG->prefix}role_capabilities rc\n WHERE rc.capability = '$capability'\n AND rc.roleid = r.id $contextstr\";\n\n if (isset($permission)) {\n $selectroles .= \" AND rc.permission = '$permission'\";\n }\n return get_records_sql($selectroles);\n}", "public function permissions()\n {\n \t// belongsTo(RelatedModel, foreignKey = _id, keyOnRelatedModel = id)\n \treturn $this->belongsToMany('App\\Permission','permission_role','role_id','permission_id')->withTimestamps();\n }", "public function permissions()\n {\n return $this->belongsToMany(EloquentTestPermission::class, 'permission_roles', 'role_id', 'permission_id');\n }", "static function access () {\n onapp_debug(__CLASS__.' :: '.__FUNCTION__);\n $return = onapp_has_permission( array( 'roles' ) );\n onapp_debug( 'return => '.$return );\n return $return;\n }", "public function getAllPermissionOfRole($role_id)\n {\n try{\n $permissions = DB::table('role_permission')\n ->where('role_id',$role_id)\n ->pluck('permission_id');\n return $permissions;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }", "public function permissions(){ return new manytomany_link($this, 'permission', 'rolepermissions');\n }", "public function role(){\n $obj = $this->hasMany(UserRole::class,'user_id','id')\n ->join('role', 'role.id', '=', 'role_id')->with('permissions');\n return $obj;\n }", "public function perms()\n {\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }", "public function getRole() {}", "public function cachedPermissions()\n {\n $rolePrimaryKey = $this->primaryKey;\n $cacheKey = 'entrust-branch_permissions_for_role_'.$this->$rolePrimaryKey;\n return Cache::tags(Config::get('entrust-branch.permission_role_table'))->remember($cacheKey, Config::get('cache.ttl'), function () {\n return $this->perms()->get();\n });\n }", "public function permissions() {\n\t$this->loadPermissions();\n\treturn $this->permissions;\n}", "public function get_role_permissions($id)\r\n {\r\n $this->db->where('roleid', $id);\r\n $this->db->join('tblpermissions', 'tblpermissions.permissionid = tblrolepermissions.permissionid', 'left');\r\n return $this->db->get('tblrolepermissions')->result_array();\r\n }", "public function providePermissions()\n {\n $category = EcommerceConfig::get(EcommerceRole::class, 'permission_category');\n $perms[EcommerceConfig::get(EcommerceRole::class, 'customer_permission_code')] = [\n 'name' => _t(\n 'EcommerceRole.CUSTOMER_PERMISSION_ANME',\n 'Customers'\n ),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.CUSTOMERS_HELP',\n 'Customer Permissions (usually very little)'\n ),\n 'sort' => 98,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'admin_permission_code')] = [\n 'name' => EcommerceConfig::get(EcommerceRole::class, 'admin_role_title'),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.ADMINISTRATORS_HELP',\n 'Store Manager - can edit everything to do with the e-commerce application.'\n ),\n 'sort' => 99,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'assistant_permission_code')] = [\n 'name' => EcommerceConfig::get(EcommerceRole::class, 'assistant_role_title'),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.STORE_ASSISTANTS_HELP',\n 'Store Assistant - can only view sales details and makes notes about orders'\n ),\n 'sort' => 100,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'process_orders_permission_code')] = [\n 'name' => _t(\n 'EcommerceRole.PROCESS_ORDERS_PERMISSION_NAME',\n 'Can process orders'\n ),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.PROCESS_ORDERS_PERMISSION_HELP',\n 'Can the user progress orders through the order steps (e.g. dispatch orders)'\n ),\n 'sort' => 101,\n ];\n\n return $perms;\n }", "public function permission()\n {\n try {\n $data = [\n 'action' => route('store.permission'),\n 'page_title' => 'Permission',\n 'title' => 'Add permission',\n 'permission_id' => 0,\n 'name' => (old('name')) ? old('name') : '',\n 'description' => (old('description')) ? old('description') : '',\n 'modules' => Module::get(),\n ];\n return $data;\n } catch(\\Exception $err){\n Log::error('message error in permission on RoleRepository :'. $err->getMessage());\n return back()->with('error', $err->getMessage());\n }\n }", "public function show(Role $role)\n {\n $this->authorize('view', $role);\n return $role->permissions;\n }", "public function currentPerms(Role $role)\n {\n $perms = $role->perms()->lists('id');\n return $perms->toArray();\n }", "public function getPossiblePermissions();", "public function permissions()\n {\n return $this->belongsToManyThrough(\n EloquentTestPermission::class,\n EloquentTestRole::class,\n 'role_users',\n 'user_id',\n 'role_id',\n 'permission_roles',\n 'role_id',\n 'permission_id'\n );\n }", "public function getCustomerResultPermissions(): array;", "function getPermissions($company_id = 0, $role_id=0, $project_id=0, $access_id=0, $item_id=0){\n\t\tGLOBAL $AppUI;\n\t\t$rta=Array();\n\n\t\t// set project's filter\n\t\t$whereProject.= \"\\n\\tAND rp.project_id = \";\n\t\t$whereProject .= @$project_id != 0 ? $project_id : \"-1\";\n\t\t$whereCompany .= \"\\n\\tAND rp.company_id = \";\n\t\t$whereCompany .= @$company_id != 0 ? $company_id : \"-1\";\n\t\t// set access's filter\n\t\t$where=\"\";\n\t\tif (@$company_id!=0){\n\t\t\t$where.= \"\\n\\tAND (r.role_type=0 or r.role_type=1 and r.role_company=$company_id)\";\n\t\t}\n\t\t\n\t\t\t\t\t\t\n\t\t// set access's filter\n\t\tif (@$access_id!=0){\n\t\t\t$where.= \"\\n\\tAND rp.access_id = $access_id\";\n\t\t}\n\n\t\t// set permission's filter\n\t\tif (@$item_id!=0){\n\t\t\t$where.= \"\\n\\tAND rp.item_id = $item_id\";\n\t\t}\n\n\t\tif (@$role_id!=0){\n\t\t\t$where.= \"\\n\\tAND (r.role_id=$role_id)\";\n\t\t}\n\t\t$sql=\"\n(select DISTINCT \nr.role_id\n, r.role_name\n, -1 project_id \n, 'All' project_name\n, ta.access_id\n, ta.access_name\n, tpi.item_id\n, tpi.item_name\n, 9 permission_value\nfrom \nroles r\n,task_access ta\n,task_permission_items tpi \nWHERE\t1=1\n\t\t$where\norder by\nrole_id,project_id,access_id,item_id,permission_value)\nunion\n(select DISTINCT \nr.role_id\n, r.role_name\n, rp.project_id \n, 'All' project_name\n, rp.access_id\n, ta.access_name\n, tpi.item_id\n, tpi.item_name\n, rp.permission_value\n\nfrom \nroles r\n,role_permissions rp left join task_access ta on ta.access_id=rp.access_id\n,task_permission_items tpi \nwhere\n\t\trp.role_id = r.role_id \n\tand\ttpi.item_id=rp.item_id\n\tand\t(ta.access_id=rp.access_id or rp.access_id=-1)\n$whereProject\n$whereCompany\n$where\norder by\nrole_id,project_id,access_id,item_id,permission_value\n)\n\t\";\n\t\t//echo \"<pre>$sql</pre>\";\n\t\t$rta=db_loadList( $sql );\t\t\n\t\t$out=array();\n\t\t$r=\"role_id\";\n\t\t$p=\"project_id\";\n\t\t$a=\"access_id\";\n\t\t$i=\"item_id\";\n\t\t$v=\"permission_value\";\n\t\tforeach($rta as $j=>$fila){\n\t\t\t$curval = $out[intval($fila[$r])][intval($fila[$p])][intval($fila[$a])][intval($fila[$i])];\n\t\t\tif (isset($curval)){\n\t\t\t\tif( $curval > $fila[$v]){\n\t\t\t\t\t//echo \"$curval - $fila[$v] {[$fila[$r]][$fila[$p]][$fila[$a]][$fila[$i]]}\";\n\t\t\t\t\t$out[intval($fila[$r])][intval($fila[$p])][intval($fila[$a])][intval($fila[$i])]=$fila[$v];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$out[intval($fila[$r])][intval($fila[$p])][intval($fila[$a])][intval($fila[$i])]=$fila[$v];\n\t\t\t}\n\t\t\tunset($curval);\n\t\t}\n\t\t//$curval =$out[\"4\"][\"-1\"][\"1\"][\"1\"];\n\t\t//$curval =$out[4][-1][1][1];\n\t\t//echo \"PRM= $curval <br>\";\n\t\t\n\t\treturn $out;\t\n\t}", "public function permissions(): BelongsToMany\n {\n return $this->belongsToMany(\n Permission::class,\n 'role_permissions',\n 'role_id',\n 'permission_id'\n );\n }", "public function getRoles(): array;", "public function permissions()\n {\n return $this->permissionModel->findAll();\n }", "public function permissions()\n {\n return $this->belongsToMany(config('rbac.models.permission'))->withTimestamps()->withPivot('granted');\n }", "public function listPermissionIdsForRole(Role $role)\n {\n \treturn $role->permissions->lists('id');\n }", "public function getPermissions()\n {\n return $this->get(self::PERMISSIONS);\n }", "public function roles()\r\n {\r\n return $this->belongsToMany(config('bootstrap-menu.models.role'), config('bootstrap-menu.relations.permission_role'))->withTimestamps();\r\n }", "public function permissions()\n {\n return $this->permissions;\n }", "public function getAvailableRoles() ;", "public function getUserPermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $user = $this->user->find($this->argument('needle'));\n if ($user) {\n $permissions = $user->abilities;\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n foreach ($permission as $ability=>$perm) {\n $vals = [$ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No user found!\");\n }\n }", "public function permissions()\n {\n return $this->belongsToMany('Bican\\Roles\\Permission');\n }", "public function getPermissionsListAttribute()\n {\n return Permission::orderBy('resource')->get();\n }", "public function index()\n {\n $permissions = Permission::with('roles','users')->orderBy('name')->get();\n\n return $permissions;\n }", "private function getPermissions()\n\t{\n\t\tif (!isset($this->permissions)) {\n\t\t\t$this->permissions = $this->permissions()->get();\n\t\t}\n\t\treturn $this->permissions;\n\t}", "function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}", "public function allowedPermissions()\n {\n return $this->permissions()->wherePivot('has_access', true)->orderBy('name');\n }", "public function permissions()\n {\n\n return Permission::all();\n }", "public function getPermissionNames(): array\n {\n return $this->roleManagement->getPermissionNames();\n }", "public function roles();", "public function roles();", "public function roles();", "public function roles();", "public function getAllPermissionOfUser($list_role)\n {\n // TODO: Implement getAllPermissionOfUser() method.\n try{\n $permissionsOfUser = DB::table('role_permission')\n ->join('roles', 'roles.id','=', 'role_permission.role_id')\n ->join('permissions', 'role_permission.permission_id', '=', 'permissions.id')\n ->whereIn('roles.id', $list_role)\n ->select('permissions.id')\n ->get()\n ->pluck('id')\n ->unique();\n return $permissionsOfUser;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }", "function getRoles () {\n return array(\"user.friendRequest.edit\",\"user.friendRequest.view\");\n }", "public function perms()\n {\n return $this->belongsToMany(Config::get('entrust-branch.permission'), Config::get('entrust-branch.permission_role_table'));\n }", "public function & GetRoles ();", "public function roles() {\n $roleClass = config('cani.models.role');\n $rolePropertieInPermission = config('cani.collections.role_permissions_propertie');\n \n return $this->belongsToMany(\n $roleClass, null, $rolePropertieInPermission . '._id'\n );\n }", "public function getAllPermissionsForRole($role)\n {\n return $this->repository->getAllPermissionsForRole($role);\n }", "public function get_role()\n {\n }", "public function permissions()\n {\n $model = config('authorization.permission');\n\n return $this->belongsToMany($model);\n }", "public function getRoles(): array\n {\n return ['admin'];\n }" ]
[ "0.82326144", "0.79449064", "0.79074115", "0.78545773", "0.7652475", "0.75733083", "0.74411196", "0.741256", "0.7406412", "0.73088205", "0.72942674", "0.7286569", "0.72841746", "0.72765243", "0.72530854", "0.72427547", "0.72427547", "0.7199471", "0.7181015", "0.71702945", "0.7160697", "0.71283495", "0.7114022", "0.7110351", "0.70976746", "0.70752645", "0.70672596", "0.70556974", "0.70275223", "0.7023475", "0.70045745", "0.69968987", "0.69919604", "0.6984917", "0.6984356", "0.6974825", "0.69717324", "0.69417495", "0.69335586", "0.691925", "0.6905533", "0.6902602", "0.68893224", "0.68893224", "0.68868196", "0.68868196", "0.6859085", "0.6856105", "0.6850968", "0.68378395", "0.6833439", "0.6822632", "0.6815891", "0.68070126", "0.67956066", "0.678033", "0.6779846", "0.677796", "0.67678744", "0.67580295", "0.6756582", "0.6754858", "0.6750178", "0.6744973", "0.6738629", "0.6738367", "0.67189664", "0.67009115", "0.6696816", "0.66848403", "0.667057", "0.66624475", "0.66615075", "0.66596127", "0.6658143", "0.6654025", "0.66425616", "0.6631234", "0.66304207", "0.660617", "0.6602489", "0.66008574", "0.65949994", "0.6591653", "0.65819293", "0.6578541", "0.6577845", "0.657484", "0.657484", "0.657484", "0.657484", "0.65739083", "0.65676874", "0.6559464", "0.6558218", "0.6556363", "0.6555625", "0.6554688", "0.6554612", "0.65359783" ]
0.6688388
69
Check user access to permission
abstract public function check($userId, $permission, array $data = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkPermissions();", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function hasAccess($permission);", "public function checkAccess()\n {\n // need to be modified for security\n }", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}", "public function checkAccess() {\n // if the user is not allowed access to the ACL, then redirect him\n if (!$this->user->isAllowed(ACL_RESOURCE, ACL_PRIVILEGE)) {\n // @todo change redirect to login page\n $this->redirect('Denied:');\n }\n }", "function checkAccess() ;", "protected function check_permission()\n {\n return true;\n }", "function check_permission()\n {\n // Make sure the user is logged-in\n require_course_login($this->course, true, $this->cm);\n\n add_to_log($this->course->id, 'sloodle', 'view sloodle module', \"view.php?id={$this->cm->id}\", \"{$this->sloodle->id}\", $this->cm->id);\n \n // Check for permissions\n $this->module_context = get_context_instance(CONTEXT_MODULE, $this->cm->id);\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\n if (has_capability('moodle/course:manageactivities', $this->module_context)) $this->canedit = true;\n\n // If the module is hidden, then can the user still view it?\n if (empty($this->cm->visible) && !has_capability('moodle/course:viewhiddenactivities', $this->module_context)) notice(get_string('activityiscurrentlyhidden'));\n }", "function check_has_permissions() {\n $details = $this->get_user_details('1');\n\t\treturn 0 != strcmp(strtoupper($details['StatusInfo']), '\"ACCESS DENIED\"');\n\t}", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "function check_permission()\r\n {\r\n // Ensure the user logs in\r\n require_login($this->course->id);\r\n if (isguestuser()) error(get_string('noguestaccess', 'sloodle'));\r\n add_to_log($this->course->id, 'course', 'view sloodle data', '', \"{$this->course->id}\");\r\n\r\n // Ensure the user is allowed to update information on this course\r\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\r\n require_capability('moodle/course:update', $this->course_context);\r\n }", "function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = 0)\n {\n global $ilUser, $ilAccess;\n\n if ($a_user_id == 0) {\n $a_user_id = $ilUser->getId();\n }\n\n switch ($a_permission) {\n case \"read\":\n /*if (!ilObjUFreibFeedbackAccess::checkOnline($a_obj_id) &&\n !$ilAccess->checkAccessOfUser($a_user_id, \"write\", \"\", $a_ref_id))\n {\n return false;\n }*/\n break;\n }\n\n return true;\n }", "function check_permission( $permission ) {\n global $_SESSION;\n\n // read the permissions database\n $d = loadDB();\n\n // check if the current user\n $user_name = $_SESSION[\"logged\"];\n // is allowed to use permission\n $roles = array();\n foreach ( $d[\"users\"] as $key => $value ) {\n if ($value[\"name\"] == $user_name) {\n $roles = array_merge($roles, $value[\"roles\"]);\n }\n }\n\n // for each role find the list of permissions\n $userpermissions = array();\n foreach ($d[\"roles\"] as $key => $value) { // all known roles \n foreach ($roles as $role) { // roles of the current user\n if ($value[\"id\"] == $role) {\n $userpermissions = array_merge($userpermissions, $value[\"permissions\"]);\n }\n }\n }\n // print_r($userpermissions);\n \n // for each found permission find the name and compare to requested permission\n foreach ($userpermissions as $perm) {\n foreach ($d[\"permissions\"] as $key => $value) {\n if ($perm == $value[\"id\"] && \n $value[\"name\"] == $permission) {\n audit( \"check_permission\", $permission.\" as \".$user_name);\n return true;\n }\n }\n }\n\n audit( \"check_permission failed\", $permission.\" as \".$user_name);\n return false;\n }", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->redirect('contao/main.php?act=error');\n\t}", "public function isAccess();", "static function access () {\n onapp_debug(__CLASS__.' :: '.__FUNCTION__);\n $return = onapp_has_permission( array( 'roles' ) );\n onapp_debug( 'return => '.$return );\n return $return;\n }", "protected function checkAccess() {\n\t\t$hasAccess = static::hasAccess();\n\n\t\tif (!$hasAccess) {\n\t\t\tilUtil::sendFailure($this->pl->txt(\"permission_denied\"), true);\n if (self::version()->is6()) {\n $this->ctrl->redirectByClass(ilDashboardGUI::class, 'jumpToSelectedItems');\n } else {\n\t\t\t$this->ctrl->redirectByClass(ilPersonalDesktopGUI::class, 'jumpToSelectedItems');\n\t\t\t}\n\t\t}\n\t}", "function checkIfUserCanAccessPage()\n{\n $permissionGranted = false;\n\n $request = Request::path();\n $path = $request[\"path\"];\n $currentUrlString = rtrim(str_replace(Request::server('SCRIPT_NAME'), '', $path), '/');\n\n $getUserPermissions = session()->get('user_permissions');\n\n if (in_array($currentUrlString, $getUserPermissions)) {\n $permissionGranted = true;\n }\n\n return $permissionGranted;\n}", "public function performPermission()\n {\n // User Role flags\n // Admin = 20\n // Editor = 40\n // Author = 60 (deprecated)\n // Webuser = 100 (deprecated)\n //\n // Webuser dont have access to edit node data\n //\n if($this->controllerVar['loggedUserRole'] > 40)\n {\n return false;\n }\n\n return true;\n }", "public function has_access() { \n\n\t\tif (!Access::check('interface','25')) { \n\t\t\treturn false; \n\t\t} \n\t\tif ($this->user == $GLOBALS['user']->id) { \n\t\t\treturn true; \n\t\t} \n\t\telse {\n\t\t\treturn Access::check('interface','100'); \n\t\t} \t\n\n\t\treturn false; \n\n\t}", "public function hasAccess(): bool;", "protected function isPermissionCorrect() {}", "function checkPermission($permission) {\n\t$db = DB::getInstance();\n\tglobal $user;\n\t//Grant access if master user\n\t$access = 0;\n\n\tforeach($permission[0] as $perm){\n\t\tif ($access == 0){\n\t\t\t$query = $db->query(\"SELECT id FROM user_permission_matches WHERE user_id = ? AND permission_id = ?\",array($user->data()->id,$perm->permission_id));\n\t\t\t$results = $query->count();\n\t\t\tif ($results > 0){\n\t\t\t\t$access = 1;\n\t\t\t}\n\t\t}\n\t}\n\tif ($access == 1){\n\t\treturn true;\n\t}\n\tif ($user->data()->id == 1){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function isGranted($userOrId, $permission);", "function permission_check($redirect = \"index.php\")\n\t{\n\t\t// make sure they are logged in\n\t\trequire_login($redirect);\n\t\t\n\t\t// makes sure they have permissions\n\t\t$sql = sprintf(\"SELECT permission FROM users WHERE uid=%d\", \n\t\t$_SESSION[\"uid\"]);\n\t\t\n\t\t// apologize if they are not.\n\t\t$perm = mysql_fetch_row(mysql_query($sql));\n\t\tif ($perm[0] == 0)\n\t\t\tapologize(\"You must be logged in and have bidding priveleges in order to do this\");\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\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = \"\")\n\t{\n\t\tglobal $ilUser, $ilAccess;\n\n\t\tif ($a_user_id == \"\")\n\t\t{\n\t\t\t$a_user_id = $ilUser->getId();\n\t\t}\n\n\t\t// add no access info item and return false if access is not granted\n\t\t// $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $a_text, $a_data = \"\");\n\t\t//\n\t\t// for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:\n\t\t// $ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_ref_id)\n\n\t\treturn true;\n\t}", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "public function checkPolicy($permission) {\n $access = true;\n\n /* first check moderator access */\n if ($this->get('moderated')) {\n $moderatorGroups = $this->trimArray($this->get('moderator_group'));\n $moderators = $this->trimArray($this->get('moderators'));\n $inModeratorGroup = !empty($moderatorGroups) && !empty($this->xpdo->user) ? $this->xpdo->user->isMember($moderatorGroups) : false;\n $access = $inModeratorGroup || in_array($this->xpdo->user->get('username'),$moderators);\n } else {\n $access = $this->xpdo->user->isMember('Administrator');\n }\n\n /* now check global access */\n switch ($permission) {\n case 'view':\n $access = $this->xpdo->hasPermission('quip.thread_view');\n break;\n case 'truncate':\n $access = $this->xpdo->hasPermission('quip.thread_truncate');\n break;\n case 'remove':\n $access = $this->xpdo->hasPermission('quip.thread_remove');\n break;\n case 'comment_approve':\n $access = $this->xpdo->hasPermission('quip.comment_approve');\n break;\n case 'comment_remove':\n $access = $this->xpdo->hasPermission('quip.comment_approve');\n break;\n case 'comment_update':\n $access = $this->xpdo->hasPermission('quip.comment_approve');\n break;\n }\n\n return $access;\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-referral', 'manage-referral'], true);\n }", "public function permissions()\n\t{\n\t\t// add any additional custom permission checking here and \n\t\t// return FALSE if user doesn't have permission\n\t\n\t\treturn TRUE;\n\t}", "private function checkAccess() {\n $this->permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed.\n \\Vanilla\\FeatureFlagHelper::ensureFeature(\n 'Import',\n t('Imports are not enabled.', 'Imports are not enabled. Set the config Feature.Import.Enabled = true to enable imports.')\n );\n }", "function check_permission()\n\t{\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}", "public function check_admin() {\n return current_user_can('administrator');\n }", "public function authorize()\n {\n // all who has permission\n return true;\n }", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "function hasPermission($uriPermission){\n\tif(Auth::check() && Auth::user()->hasAnyPermission($uriPermission))\n return true;\n else\n return false;\n}", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'member_edit' );\n\t}", "function hasAccess(): bool\n {\n return isLoggedInAndHasRole($this->ci, [Role::ROLE_ADMIN]);\n }", "private function accessVaildator($permissionAction){\n\n\t\tglobal $db, $lang;\n\t\t\n\t\t#see if user is guest, if so, deny any requests.\n\t\tif($this->user == \"guest\"){\n\t\t\treturn (false);\n\t\t}else{\n\t\t\t#first lets make sure the permission profile used is valid.\n\t\t\t$db->SQL= \"SELECT id FROM ebb_permission_profile WHERE id='\".$this->getGroupProfile().\"'\";\n\t\t\t$permissionProfileChk = $db->affectedRows();\n\n\t\t\t#see if user ID is incorrect or Null.\n\t\t\tif(($permissionProfileChk == 0) and ($this->user !== \"guest\")){\n\t\t\t\t$error = new notifySys($lang['invalidprofile'], false, true, __FILE__, __LINE__);\n\t\t\t\t$error->genericError();\n\t\t\t}\n\n\t\t\t#lets also check to make sure the action requested is valid.\n\t\t\t$db->SQL = \"SELECT id FROM ebb_permission_actions WHERE id='$permissionAction'\";\n\t\t\t$permissionActionChk = $db->affectedRows();\n\n\t\t\tif($permissionActionChk == 0){\n\t\t\t\t$error = new notifySys($lang['invalidaction'], false, true, __FILE__, __LINE__);\n\t\t\t\t$error->genericError();\n\t\t\t}\n\n\t\t\t#see if user has correct permission to access requested permission.\n\t\t\t$db->SQL = \"SELECT set_value FROM ebb_permission_data WHERE profile='\".$this->getGroupProfile().\"' and permission='$permissionAction'\";\n\t\t\t$validatePermission = $db->fetchResults();\n\n\t\t\t#output value in script.\n\t\t\tif($validatePermission['set_value'] == 1){\n\t\t\t return(true);\n\t\t\t}else{\n\t\t\t return(false);\n\t\t\t}\n\t\t}\n\t}", "public function hasUsageRights() {}", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( \"core\",\"members\" );\n\t}", "function user_can_access_admin_page()\n {\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 }", "private function hasPermission()\n { $user = User::getLoggedInUser();\n $has_permission = false;\n if ($user->getCurrentRoleName() == \"instructor\") {\n $instructor = $user->getCurrentRoleData();\n if ($instructor->hasPermission(\"Edit Compliance Status\")) {\n $has_permission = true;\n }\n }\n\n return $has_permission;\n }", "public function has_permission($permission) {\n\t\t\n\t}", "public function authorize()\n {\n return auth()->user()->can('manage-users');\n }", "public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }", "private function wf_user_permission(){\n\t\t$current_user = wp_get_current_user();\n\t\t$user_ok = false;\n\t\tif ($current_user instanceof WP_User) {\n\t\t\tif (in_array('administrator', $current_user->roles) || in_array('shop_manager', $current_user->roles)) {\n\t\t\t\t$user_ok = true;\n\t\t\t}\n\t\t}\n\t\treturn $user_ok;\n\t}", "public function checkPermission(\\App\\Request $request)\n\t{\n\t\t$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif (!$currentUserPriviligesModel->hasModulePermission($request->getModule())) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('ERR_NOT_ACCESSIBLE', 406);\n\t\t}\n\t}", "function check_permission()\n\t{\n\t\t$CFG = $this->config->item('language_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}", "function CheckAccess($perm = 'Modify Stylesheets') {\n\t\treturn $this->CheckPermission($perm);\n\t}", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function adminPermissionCheck() {\n \tif(Permission::check('ADMIN')) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-inventory', 'manage-inventory'], true);\n }", "function hook_permission_check($data) {\n\t\treturn false;\n\t}", "public function hasPermission($action = \"\");", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "function checkAccess( $action, $access = '' ) {\r\n $result = true;\r\n if ( is_array( $access ) && array_key_exists( $action, $access ) ) {\r\n if ( array_key_exists( 'role', $access[$action] ) ) {\r\n if ( in_array( $this->user_role, $access[$action]['role'])) {\r\n $result = false;\r\n }\r\n } else {\r\n if ( !in_array( $this->user_role, $access[$action] ) ) {\r\n $result = false;\r\n }\r\n }\r\n }\r\n return $result;\r\n }", "public function can($permission);", "function is_user_allowed($user, $permission){\n\n \tif($permission == PERMISSION_LOGIN){\n \t\tif($user->is_surveyor == TRUE\n \t\t\t\t&& $user->is_supervisor == FALSE\n \t\t\t\t&& $user->is_manager == FALSE\n \t\t\t\t&& $user->is_general_manager == FALSE\n \t\t\t\t&& $user->is_admin == FALSE){\n \t\t\treturn FALSE;\n \t\t}\n \t}else if($permission == PERMISSION_ADD_SURVEYOR\n \t\t\t|| $permission == PERMISSION_EDIT_SURVEYOR\n \t\t\t|| $permission == PERMISSION_DELETE_SURVEYOR\n \t\t\t|| $permission == PERMISSION_DETAIL_SURVEYOR){\n \t\treturn $user->is_admin;\n \t}\n\n \treturn TRUE;\n }", "public function hasAccess() {\n // This is the TokenAuthUser.\n // The Publisher role is not assigned to the user,\n // it is only used to scope the consumer.\n /** @var \\Drupal\\Core\\Session\\AccountProxyInterface $user */\n $userAccount = $this->currentUser();\n // Verify permission against User entity.\n $userEntity = User::load($userAccount->id());\n if ($userEntity->hasPermission('access publisher')) {\n return new JsonResponse([\n 'access' => TRUE,\n ], 200);\n }\n else {\n return new JsonResponse([\n 'access' => FALSE,\n ], 403);\n }\n }", "public function checkPermission(App\\Request $request)\n\t{\n\t\t$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif (!$currentUserPriviligesModel->hasModulePermission($request->getModule())) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('LBL_PERMISSION_DENIED', 406);\n\t\t}\n\t}", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "private function permissionCheck($action){\n\n\t\tglobal $checkgroup, $checkmod;\n\t\t\n\t\t#autmatically fail check if user is a guest, and its not set to public.\n\t\tif(($this->user == \"guest\") AND ($action != 0)){\n\t\t $permissionChk = false;\n\t\t}else{\n\t\t\tif($checkmod == 1){\n\t\t\t\t$permissionChk = true;\n\t\t\t}else{\n\t\t\t\tif(($action == 1) AND ($this->groupAccessLevel() == 1)){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}elseif(($action == 2) AND ($this->groupAccessLevel() == 1) or ($this->groupAccessLevel() == 2)){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}elseif(($action == 3) AND ($this->groupAccessLevel() == 3) or ($this->groupAccessLevel() == 2) or ($this->groupAccessLevel() == 1)){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}elseif($action == 4){\n\t\t\t\t\t$permissionChk = false;\n\t\t\t\t}elseif(($action == 5) and ($checkgroup == 1) or ($this->groupAccessLevel() == 1) or ($checkmod == 1)){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}elseif($action == 0){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}else{\n\t\t\t\t\t$permissionChk = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn($permissionChk);\n\t}", "public function per_test(){\n if($_SESSION[C('N_ADMIN_AUTH_KEY')]['permission']!=1){\n echo \"<script>alert('你没有权限!');window.location.href='\" . __MODULE__ . \"/Admin/info.html';</script>\";\n exit;\n }\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\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "public function check_admin()\n {\n return current_user_can('administrator');\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 authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = auth()->user()->first();\n $department = Department::findOrFail($this->input('department_id'));\n $semester_type = SemesterType::findOrFail($this->input('semester_type_id'));\n $level = Level::findOrFail($this->input('level_id'));\n return (\n $user->can('view', $department) && \n $user->can('view', $level) &&\n $user->can('view', $semester_type)\n ) &&\n (\n $user->hasRole(Role::ADMIN) || \n ($user->id == $department->hod->first()->user()->first()->id) || // department hod\n ($user->staff()->where('id', $department->faculty()->first()->dean()->first()->id)->exists()) || // faculty dean\n ($user->id == $department->faculty()->first()->school()->first()->owner_id) // school owner\n );\n }", "public function checkPermissions() {\n if ($this->checkIp()) {\n \\BDSCore\\Errors\\Errors::returnError(403);\n }\n }", "protected function checkAuthorized()\n\t{\n\t\tglobal $USER;\n\t\tglobal $APPLICATION;\n\n\t\tif (!$USER->IsAuthorized())\n\t\t\t$APPLICATION->AuthForm(Localization\\Loc::getMessage(\"SPOL_ACCESS_DENIED\"));\n\t}", "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 if(auth('admin')->check()){\n\n return true;\n\n }else{\n\n return false;\n\n }\n }", "function um_user_can( $permission ) {\r\n\t\t\tif ( ! is_user_logged_in() )\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t$user_id = get_current_user_id();\r\n\t\t\t$role = UM()->roles()->get_priority_user_role( $user_id );\r\n\t\t\t$permissions = $this->role_data( $role );\r\n\r\n\t\t\t/**\r\n\t\t\t * UM hook\r\n\t\t\t *\r\n\t\t\t * @type filter\r\n\t\t\t * @title um_user_permissions_filter\r\n\t\t\t * @description Change User Permissions\r\n\t\t\t * @input_vars\r\n\t\t\t * [{\"var\":\"$permissions\",\"type\":\"array\",\"desc\":\"User Permissions\"},\r\n\t\t\t * {\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"}]\r\n\t\t\t * @change_log\r\n\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t * @usage\r\n\t\t\t * <?php add_filter( 'um_user_permissions_filter', 'function_name', 10, 2 ); ?>\r\n\t\t\t * @example\r\n\t\t\t * <?php\r\n\t\t\t * add_filter( 'um_user_permissions_filter', 'my_user_permissions', 10, 2 );\r\n\t\t\t * function my_user_permissions( $permissions, $user_id ) {\r\n\t\t\t * // your code here\r\n\t\t\t * return $permissions;\r\n\t\t\t * }\r\n\t\t\t * ?>\r\n\t\t\t */\r\n\t\t\t$permissions = apply_filters( 'um_user_permissions_filter', $permissions, $user_id );\r\n\r\n\t\t\tif ( isset( $permissions[ $permission ] ) && is_serialized( $permissions[ $permission ] ) )\r\n\t\t\t\treturn unserialize( $permissions[ $permission ] );\r\n\r\n\t\t\tif ( isset( $permissions[ $permission ] ) && $permissions[ $permission ] == 1 )\r\n\t\t\t\treturn true;\r\n\r\n\t\t\treturn false;\r\n\t\t}", "protected function checkUserRights() {\n if( !$this->app->model_user_rights->canSeeTasks() ){\n throw $this->exception('You cannot see this page','Exception_Denied');\n }\n }", "function verificarPermisos($permiso)\n{\n try\n {\n if (logged_user()->tipo != \"A\")\n {\n if (logged_user()->$permiso != 1)\n {\n echo \"No tiene permisos para esta accion\";\n die();\n } else\n {\n return true;\n }\n } else\n {\n return true;\n }\n } catch (Exception $ex)\n {\n Session::instance()->setFlash('ERROR: ' . $ex->getMessage());\n }\n}", "function check_module_access($m) {\r\n /*\r\n @level: int\r\n -2 available even when not authenticated,\r\n -1 always available when authenticated,\r\n 1 highest level of permission,\r\n 2+ lower and lower permission\r\n */\r\n global $user_access; # setted at useraccess.inc.php, then index.php\r\n\r\n if ($_SESSION['login_ok'] != 1 and $level != -2) return;\r\n if ($_SESSION['login_ok'] == 1 and $level != -1 and $_SESSION['login_level'] > $level) return; # level permission, allow if login_level is smaller\r\n if ($_SESSION['login_level'] != 0 and $_SESSION['login_level'] == $level and $group != '') { # check group permission if not '' or empty array\r\n if (is_array($group)) {\r\n $pass = False;\r\n foreach ($group as $grp) {\r\n if ($grp == $_SESSION['login_group']) {\r\n $pass = True;\r\n break;\r\n }\r\n }\r\n if (!$pass) return;\r\n }\r\n elseif ($group != $_SESSION['login_group']) return;\r\n }\r\n\r\n}", "function checkPermissions() {\n\t\t$current_user = wp_get_current_user();\n\t\tif(current_user_can('manage-lepress') || is_super_admin() || (get_bloginfo('admin_email') === $current_user->user_email)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "abstract protected function canAccess();", "public function authorize()\n {\n\n $user = auth()->user();\n return ($user->hasRole(1)&&$user->hasStatus(3));\n }" ]
[ "0.80375946", "0.8016786", "0.8016786", "0.8016786", "0.8016666", "0.8016666", "0.80160636", "0.80160636", "0.80160636", "0.7974683", "0.7921034", "0.7806652", "0.7800539", "0.77713984", "0.7764612", "0.76828146", "0.76681334", "0.7637066", "0.76100653", "0.7590121", "0.756075", "0.7481601", "0.74741244", "0.74672604", "0.74493533", "0.7433949", "0.7414706", "0.7412268", "0.7403181", "0.7397261", "0.7391517", "0.7386688", "0.73648083", "0.73419714", "0.73332465", "0.7325935", "0.7325935", "0.7309763", "0.7254741", "0.7254741", "0.72469074", "0.7238886", "0.7235347", "0.72315145", "0.7166277", "0.71391064", "0.7138855", "0.7138106", "0.7104841", "0.71045184", "0.7101863", "0.7074848", "0.7068294", "0.7063992", "0.7063778", "0.7063133", "0.7058655", "0.70455265", "0.70437664", "0.7039555", "0.7034166", "0.703048", "0.7028299", "0.70275354", "0.70245326", "0.70241493", "0.7018916", "0.7017867", "0.70125026", "0.7010774", "0.6996169", "0.6994868", "0.6993874", "0.69853705", "0.6983377", "0.6981144", "0.6975946", "0.697572", "0.697572", "0.697572", "0.697572", "0.697572", "0.6975639", "0.69748497", "0.6963505", "0.6956498", "0.69553757", "0.6944081", "0.69437885", "0.6943351", "0.69429344", "0.69406796", "0.69403356", "0.6929773", "0.69205046", "0.69193393", "0.6917821", "0.69086474", "0.6907553", "0.6906638", "0.6904029" ]
0.0
-1
Display a listing of the resource.
public function index() { $course = Course::all(); if (!empty($course)) { return view('home', [ "course" => $course, ]); //Esto se puede hacer con compact } return response()->json([ "msg"=> "No existen cursos." ]); }
{ "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 view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\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 $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\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 }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\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 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 permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function 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 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 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.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
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 &eacute;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
Store a newly created resource in storage.
public function store(Request $request) { $course = new Course(); $request->validate([ 'name' => 'required|max:100', 'id_subject' => 'required', ]); $course->name = $request->name; $course->id_subject = $request->id_subject; $course->save(); return redirect('/'); }
{ "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) { $course = Course::find($id); if ($course != NULL) { return response()->json($course); } return "No existe un curso con esa 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(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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(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() {\n return view('routes::edit');\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 edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\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 $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(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\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 \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 $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($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.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $course = Course::find($id); if ($course != NULL) { if ($request->name != NULL) { $course->name = $request->name; } if ($request->id_asignatura != NULL) { $course->id_asignatura = $request->id_asignatura; } $course->save(); return response()->json($course); } return "No existe un curso con esa 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(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $course = Course::find($id); if ($course != NULL) { $course->delete(); return response()->json([ "message" => "Se ha borrado el curso", "id" => $id ]); } return "No existe un curso con esa 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
Public Methods ========================================================================= Get a Digital Product by it's ID.
public function getProductById($id, $localeId = null) { return craft()->elements->getElementById($id, 'DigitalProducts_Product', $localeId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductById(int $id);", "public function getById($id)\n {\n return $this->product->find($id);\n \n }", "public function getProduct( $id ) {\n\t\treturn $this->requester->request('GET', $this->url . '/' . $id);\n\t}", "public function get($id){\n $product=Product::find($id);\n return $product;\n }", "function get_product($product_id){\n\t\t\n\t\treturn $this->_make_api_call($product_id,'products');\n\t}", "public function getById($id)\n {\n return $this->productRepository->getById($id);\n }", "public function getProduct($id)\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table WHERE id = ?;\";\n $product = $this->db->executeFetch($sql, [$id]);\n return $product;\n }", "public function read($id) {\n return $this->product->find($id);\n\t}", "public function getProduct($id)\n {\n }", "public function find($id) {\n return Product::find($id);\n }", "public function findProduct($id)\n {\n return $this->productRepository->findProduct($id);\n }", "public function findById($id)\n {\n \t$product = $this->model->whereId($id)->first();\n \n \treturn $product;\n }", "public function getProductByID($id)\n\t{\t\n\t\t$this->db->where('id', $id);\n\t\treturn $this->db->get('products')->row();\n\t}", "public static function getById($id)\n {\n\t$sth = self::getPdo()->prepare(\"SELECT * FROM product WHERE id = :id\");\n\t$sth->execute(\n\t array(\n\t\t':id' => $id,\n\t )\n\t);\n\n\t$rows = $sth->fetchAll();\n\tif (count($rows) > 0)\n\t{\n\t $row = $rows[0];\n\n\t $product = new Product;\n\t $product->id = $row['id'];\n\t $product->name = $row['name'];\n\t $product->ean = $row['ean'];\n\n\t return $product;\n\t}\n\n\treturn new NullProduct;\n }", "public function show($id)\n {\n $product = Product::find($id);\n return $product;\n }", "public function show($id)\n {\n $product = Product::find($id);\n return $product;\n }", "function get_product_by_id($product_id) {\r\n try {\r\n $params[0] = array(\"name\" => \":prod_id\", \"value\" => &$product_id);\r\n return $this->DBObject->readCursor(\"product_actions.get_product_by_id(:prod_id)\", $params);\r\n } catch (Exception $ex) {\r\n echo \">>\" . ex;\r\n }\r\n }", "public function getProductD($Id)\r\n {\r\n $result = $this->find('first', array('conditions' => array('ProductDeal.id' => $Id)));\r\n return $result;\r\n }", "public function getProduct($_ID)\n {\n $return = $this->getUnique(\"products\", $_ID);\n return $return;\n }", "public function readProduct($id) {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n $product = Product::find_by_id($id);\r\n if ($product) {\r\n return $product;\r\n } else {\r\n throw new RestException(400, 'productct not found');\r\n }\r\n }", "public function show($id)\n {\n return Product::find($id);\n }", "public function getProductById($id){\n $query = $this->db->get_where('product',array('id' => $id));\n return $query->row(); \n }", "public function show($id)\n {\n $product =Product::find($id);\n return $product;\n\n }", "public function getProductbyId($id)\n {\n $this->db->select('*');\n $this->db->where('id', $id);\n $this->db->from($this->product); \n return $this->db->get();\n }", "public function findById($product_id)\n {\n return Product::find($product_id);\n }", "public function getById(int $id)\n {\n return $this->products[$id];\n }", "public function getById(int $id)\n {\n return $this->products[$id];\n }", "public function getProductById($id){\r\n\t\treturn $this->query(\"SELECT * FROM beer WHERE beer_ID = '$id'\"); \r\n\t}", "public function find( $id ){\n \t\t$response = $this->curl->get( $this->api_url . '/' . $id, [ \n\t\t\t'access_token' => $this->token\n\t\t]);\n\t\tif( $response->success ){\n\t\t\t$product = new Product( $this );\n\t\t\t$product->fetch($response->product);\n\n\t\t\treturn $product;\n \t\t}//if\n \t\telse{\n \t\t\treturn FALSE;\n \t\t}//else\n \t}", "public function getProductByProductID($productID)\n {\n return Product::find($productID);\n }", "public static function getProductDetail($id)\n {\n $product = self::with([\n 'imgs' => function($query) {\n $query->with(['imgUrl'])->order('order', 'asc');\n }])\n ->with('properties')\n ->find($id); \n\n return $product;\n }", "public function show($id) {\n\t\t$product = $this->product->getOneProduct($id);\n\t\treturn $this->response([\"data\" => $product], 200);\n\t}", "function getProduct($id) {\n include('db/db.php'); // now we have $db to communicate with database\n include('db/model/Product.php');\n\n // Prepared Statement (prepare, bind, execute) -> prevent SQL injection\n $ready = $db->prepare(\"select name, description, image, time, cost from products where id = ?\");\n $ready->bind_param('d', $id);\n $ready->execute();\n \n $ready->store_result();\n $ready->bind_result($name, $description, $image, $time, $cost);\n\n // Check whether the product is exist or not\n if ($ready->fetch()) {\n $images = explode(';', $image);\n\n $image1 = $images[0];\n $image2 = $images[1];\n $image3 = $images[2];\n\n // return an object Product\n return new Product(\n $id,\n $name,\n $description,\n $image1,\n $image2,\n $image3,\n $time,\n $cost\n );\n }\n else {\n return 0;\n }\n }", "public function getById($id)\n {\n $product = $this->db->queryOne('SELECT * FROM ' . self::TABLE . ' WHERE id = ?;', $id, '\\LRC\\Webshop\\Product');\n if ($product) {\n $product->categoryIds = $this->getCategories($product, true);\n }\n return $product;\n }", "public static function getProductByid($id){\n $sql = \"SELECT products.*, category.cat_name from products inner join category on products.cat_id=category.cat_id where pro_id=\".$id;\n return runQuery($sql);\n }", "public function find($id)\n {\n return QueryBuilder::for($this->product)\n ->allowedFields($this->product->getFillable())\n ->allowedIncludes($this->product->getRelations())\n ->findOrFail($id);\n }", "public function show($id)\n {\n return Product::findOrFail($id);\n }", "function getProductById(Store $s, string $id)\n {\n $curl_url = $s->getApiPath() . \"v2/products/\" . $id;\n $product = CurlHandler::GET($curl_url, $s->getAccessToken());\n return $product;\n }", "function get_product($id) {\n $query = $this->db->where('id', $id)->get('product');\n return $query->result_array();\n }", "public function GetProduct($product_id) {\n\n //set up the query\n $this->sql = \"SELECT *\n FROM products\n WHERE productID = :product_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':product_id' => $product_id,\n ]);\n }", "public function getById(int $id) {\r\n\r\n $product = (new ProductGateway()) -> getById($id);\r\n return $this -> toEntityIterator($product, ProductEntity::class) -> current();\r\n }", "public function getProduct($product_id)\n {\n return $this->with('images','manufacturer', 'category')->find($product_id);\n }", "static function getById($id)\n {\n global $objDatabase;\n\n if (!$id) return NULL;\n $arrSql = \\Text::getSqlSnippets(\n '`product`.`id`', FRONTEND_LANG_ID, 'Shop',\n array(\n 'name' => self::TEXT_NAME,\n 'short' => self::TEXT_SHORT,\n 'long' => self::TEXT_LONG,\n 'keys' => self::TEXT_KEYS,\n 'code' => self::TEXT_CODE,\n 'uri' => self::TEXT_URI,\n )\n );\n $query = \"\n SELECT `product`.`id`, `product`.`category_id`,\n `product`.`ord`, `product`.`active`, `product`.`weight`,\n `product`.`picture`,\n `product`.`normalprice`, `product`.`resellerprice`,\n `product`.`discountprice`, `product`.`discount_active`,\n `product`.`stock`, `product`.`stock_visible`,\n `product`.`distribution`,\n `product`.`date_start`, `product`.`date_end`,\n `product`.`manufacturer_id`,\n `product`.`b2b`, `product`.`b2c`,\n `product`.`vat_id`,\n `product`.`flags`,\n `product`.`usergroup_ids`,\n `product`.`group_id`, `product`.`article_id`, \n `product`.`minimum_order_quantity`, \".\n $arrSql['field'].\"\n FROM `\".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products` AS `product`\".\n $arrSql['join'].\"\n WHERE `product`.`id`=$id\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult) return self::errorHandler();\n if ($objResult->RecordCount() != 1) return false;\n $id = $objResult->fields['id'];\n $strCode = $objResult->fields['code'];\n if ($strCode === null) {\n $strCode = \\Text::getById($id, 'Shop', self::TEXT_CODE)->content();\n }\n $strName = $objResult->fields['name'];\n if ($strName === null) {\n $strName = \\Text::getById($id, 'Shop', self::TEXT_NAME)->content();\n }\n $strShort = $objResult->fields['short'];\n if ($strShort === null) {\n $strShort = \\Text::getById($id, 'Shop', self::TEXT_SHORT)->content();\n }\n $strLong = $objResult->fields['long'];\n if ($strLong === null) {\n $strLong = \\Text::getById($id, 'Shop', self::TEXT_LONG)->content();\n }\n $strUri = $objResult->fields['uri'];\n if ($strUri === null) {\n $strUri = \\Text::getById($id, 'Shop', self::TEXT_URI)->content();\n }\n $strKeys = $objResult->fields['keys'];\n if ($strKeys === null) {\n $strKeys = \\Text::getById($id, 'Shop', self::TEXT_KEYS)->content();\n }\n $objProduct = new Product(\n $strCode,\n $objResult->fields['category_id'],\n $strName,\n $objResult->fields['distribution'],\n $objResult->fields['normalprice'],\n $objResult->fields['active'],\n $objResult->fields['ord'],\n $objResult->fields['weight'],\n $objResult->fields['id']\n );\n $objProduct->pictures = $objResult->fields['picture'];\n $objProduct->resellerprice = floatval($objResult->fields['resellerprice']);\n $objProduct->short = $strShort;\n $objProduct->long = $strLong;\n $objProduct->stock($objResult->fields['stock']);\n $objProduct->stock_visible($objResult->fields['stock_visible']);\n $objProduct->discountprice = floatval($objResult->fields['discountprice']);\n $objProduct->discount_active($objResult->fields['discount_active']);\n $objProduct->b2b($objResult->fields['b2b']);\n $objProduct->b2c($objResult->fields['b2c']);\n $objProduct->date_start($objResult->fields['date_start']);\n $objProduct->date_end($objResult->fields['date_end']);\n $objProduct->manufacturer_id = $objResult->fields['manufacturer_id'];\n $objProduct->uri = $strUri;\n $objProduct->vat_id = $objResult->fields['vat_id'];\n $objProduct->flags = $objResult->fields['flags'];\n $objProduct->usergroup_ids = $objResult->fields['usergroup_ids'];\n $objProduct->group_id = $objResult->fields['group_id'];\n $objProduct->article_id = $objResult->fields['article_id'];\n $objProduct->keywords = $strKeys;\n $objProduct->minimum_order_quantity = $objResult->fields['minimum_order_quantity'];\n // Fetch the Product Attribute relations\n $objProduct->arrRelations =\n Attributes::getRelationArray($objProduct->id);\n//die(\"dfhreh: \".$objProduct->category_id());\n return $objProduct;\n }", "public function getProductById($id){\n $prodDB=$this->promodel->getProductById($id);\n // create a new product\n $product = new Product();\n $product->id=$prodDB->id;\n $product->name=$prodDB->name;\n $product->category=$prodDB->category;\n $product->price=$prodDB->price;\n $product->qty=0;\n return $product;\n }", "public function findOne(int $id): ?Product\n {\n return Product::find($id);\n }", "public function show($id)\n {\n $producto = new Producto();\n $producto->setId($id);\n\n return $this->service->find($producto);\n }", "public function find($id)\n {\n\n $sql = \"SELECT product.*, brand.name AS brand_name, type.name AS type_name, category.name AS category_name\n FROM product\n JOIN brand ON product.brand_id = brand.id \n JOIN type ON product.type_id = type.id \n JOIN category ON product.category_id = category.id \n WHERE product.id = $id \";\n\n $pdo = Database::getPDO();\n $stmt = $pdo->query($sql);\n\n $product = $stmt->fetchObject(self::class);\n return $product;\n }", "public function show(int $id)\n\t{\n\t\tProductResource::withoutWrapping();\n\n\t\t$product = QueryBuilder::for(Product::class)\n\t\t\t->allowedIncludes(['category', 'sales'])\n\t\t\t->allowedFields([\n\t\t\t\t'id', 'sku', 'description', 'price',\n\t\t\t\t'sale_price', 'pst', 'gst', 'image',\n\t\t\t\t'brand', 'model', 'order_number',\n\t\t\t\t'created_at', 'updated_at'\n\t\t\t])\n\t\t\t->where('sku', $id)\n\t\t\t->latest()\n\t\t\t->firstOrFail();\n\n\t\treturn new ProductResource($product);\n\t}", "public function GetProductAccordingToProductID($productID){\n\t\n\ttry\n\t{\n\t\t$conn = DBConnection::GetConnection();\n\t\t$myquery= \"SELECT product_id,product_name,unit_price,image_name,description,category,quantity_in_stock FROM product where product_id='\".$productID.\"' \";\n\t\t$result= $conn->query($myquery);\n\t\t\n\t\t$p1= new Product();\n\t\tforeach($result as $item){\n\t\t\t\t\t\t\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\"];\t\t\t\n\t\t\t\n\t\t}\n\t\t$conn =null;//To close the connection \n\t\treturn $p1;\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo 'Fail to connect';\n\t\techo $e->getMessage();\n\t}\t\n\t\t\n\t}", "public static function getById($id) {\n $SQL = 'Select * from product inner JOIN product_category on product.product_category_id = product_category.product_category_id where product.product_id = ?;';\n $prep = DataBase::getInstance()->prepare($SQL);\n $prep->execute([$id]);\n return $prep->fetch(PDO::FETCH_OBJ);\n }", "public static function getById($ProductID){\r\n\r\n\t\t$query = \"SELECT * FROM products WHERE ProductID = :ProductID LIMIT 1\";\r\n\r\n\t\t$param = [':ProductID' => $ProductID]; // the parameter that will be bind by pdo\r\n\r\n\t\ttry {\r\n\t\t\t// use static method run() from class DB \r\n\t \tif ($stmt = DB::Run($query, $param)) { // this will run the build query\r\n\r\n\t\t\t\t// need to use fetch to retrieve only 1 row of data\r\n\t\t\t\t// this will retrieve the row of data\r\n\t\t\t\t// that is associated to the passed ProductID\r\n\t\t\t\t$products = $stmt->fetch(PDO::FETCH_ASSOC); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t \r\n\t\t\t\t// return the products object\r\n\t\t\t\treturn $products;\r\n\t\t\t};\r\n\t\t} catch (PDOException $e) {\r\n\t\t\treturn $e->getMessage();\r\n\t\t}\r\n\t}", "public function getProductById($product_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"products/$product_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $product_data=json_decode($string);\n \n return $product_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"Get product error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function show($id)\n {\n return new ProductResource(Product::findOrFail($id));\n }", "public function show($id)\n {\n $data = $this->repository->getById($id);\n return new ProductResource($data);\n }", "public function getProdById($id){\n\t\t$pid = $this->fm->validation($id);\n\t\t$pid = mysqli_real_escape_string($this->db->link, $pid);\n\t\t$sql = \"SELECT * FROM tbl_product WHERE pid = '$pid' \";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "function get_product_detail_by_id($id) {\n $query = $this->db->get_where('products', array('id' => $id));\n\n return $query->row_array();\n }", "public function read( $id=NULL ){\n\t\tif( is_null( $id ) ){\n\t\t\treturn $this->productNotFound();\t\n\t\t}\n\t\t\n\t\t//\tload model\n\t\t$this->contentData['product'] = $this->product_model->getProduct( $id );\n\t\tif( !$this->contentData['product'] ){\n\t\t\treturn $this->productNotFound();\n\t\t}\n\t\t\n\t\t//\tview separate elements will be loaded into\n\t\t$aggregated_view = 'product/product_view';\n\t\t\n\t\t//\tcollect separate elements\n\t\t$this->contentData['controls'] = $this->techniart->loadControls($aggregated_view);\n\n\t\t//\tload main template\n\t\t$data['title'] = 'Product';\n\t\t$data['content'] = $this->load->view($aggregated_view, $this->contentData, TRUE);\n\t\t$this->techniart->load( $data );\n\t}", "public function getProduct($id) {\n\n $json = array('success' => true);\n\n $this->load->model('rest/restadmin');\n\n $products = $this->model_rest_restadmin->getProductsByIds(array($id), $this->customer);\n if(!empty($products)) {\n $json[\"data\"] = $this->getProductInfo(reset($products));\n } else {\n $json['success'] = false;\n }\n\n $this->sendResponse($json);\n }", "public function getProduct($id)\n {\n\n $result = $this->call($this->baseUrl.'products/'.$id.'.json',[],\"GET\");\n if ($result['status'] >= 200 && $result['status'] < 300 ) {\n //return the products\n return $result['body']->container['product'];\n }else{\n return [];\n }\n }", "public function getproductdetail($prod_id)\n {\n $product = $this->Dbmodel->getproductdata($prod_id); \n return $product;\n }", "public function fetch($id)\n\t{\n\t\t$product = WooProduct::fetch( $id );\n\n\t\tif ( !$product )\n\t\t\t$product = WooProduct::fetchById( $id );\n\n\t\tabi_r($product, true);\n\t}", "protected function get_get( $id = 0 ) {\n\t\t// Otherwise, a single product will be returned.\n\t\t$con = $id ? array( 'id' => $id ) : '';\n\t\t$products = $this->product->getRows( $con );\n\n\t\t// Check if the product data exists\n\t\tif ( ! empty( $products ) ) {\n\t\t\t// Set the response and exit\n\t\t\t//OK (200) being the HTTP response code\n\t\t\t$this->response( $products, REST_Controller::HTTP_OK );\n\t\t} else {\n\t\t\t// Set the response and exit\n\t\t\t//NOT_FOUND (404) being the HTTP response code\n\t\t\t$this->response( array(\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => 'No product was found.'\n\t\t\t), REST_Controller::HTTP_NOT_FOUND );\n\t\t}\n\t}", "public function getProduct($id)\n {\n $data = ProductPhase::where('product_id', $id)->get();\n return $data;\n }", "public function show($id)\n {\n $product = Product::find($id)->get();\n return new ProductResource($product);\n }", "public function show($id_product)\n {\n return Product::findOrFail($id_product);\n }", "protected function getProduct($productID)\r\n {\r\n // Enter the query into the Data Access Layer\r\n $sql = \"SELECT * FROM tbl_products WHERE id_products = '\" . $productID . \"'\";\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 the product!\";\r\n }\r\n }", "public function findProductById(int $idProduct): ?object {\n\t\t// crete Default Var\n\t\t$objProduct = null;\n\t\ttry {\n\t\t\t// create Query Builder \n\t \t$qb = $this->em->createQueryBuilder();\n\t \t// create Query\n\t \t$objProduct = $qb->select('p')\n\t\t\t ->from(Product::class, 'p')\n\t\t\t ->where('p.id = :id')\n\t\t\t ->andWhere('p.status = :status')\n\t\t\t ->setParameter('id', $idProduct\t)\n\t\t\t ->setParameter('status', 1)\n\t\t\t ->getQuery()\n\t\t\t ->getOneOrNullResult();\n \t\t} catch (\\Exception $ex) {\n \t\t\t//dd($ex);\n \t\t}\n \t\t// default Return\n \t\treturn $objProduct;\n\t}", "public function getProduct() {\r\n\t\t$id = $this->getRequest()->getParam('id');\r\n\t\t$products = Mage::getModel('catalog/product')->load($id);\r\n\t\treturn $products;\r\n\t}", "public function show($id)\n {\n return Products::findOrFail($id);\n }", "function getProductbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock` > 0 AND `id` = ?\");\n\t\t$sth \t->execute(array($id));\n\n\t\treturn \t$sth;\n\t}", "function get_product_by_id($id)\n{\n $db = get_connection();\n\n $sql = <<<SQL\n SELECT *\n FROM products\n WHERE\n id = :id\nSQL;\n\n $statement = $db->prepare($sql);\n $statement->execute([\n ':id' => $id,\n ]);\n\n $product = (array) $statement->fetch(PDO::FETCH_ASSOC);\n $product['images'] = get_images($product['id']);\n\n return $product;\n}", "public function FetchProductById($productid, PDO $DBH) {\n $FindProductQuery = \"SELECT * FROM Products WHERE Products.Id=$productid\";\n $STH = $DBH->prepare($FindProductQuery);\n $STH->setFetchMode(PDO::FETCH_CLASS, \"ProductDTO\");\n $STH->execute();\n $FoundProduct = $STH->fetch(PDO::FETCH_CLASS);\n $STH->closeCursor();\n var_dump($FoundProduct);\n return $FoundProduct;\n }", "public function show($id)\n {\n $product = Product::find($id);\n\n\n if (is_null($product)) {\n return $this->sendError('Product not found.');\n }\n\n\n return $this->sendResponse($product->toArray(), 'Product retrieved successfully.');\n }", "function getProductObjectFromId( $id, $productname ) {\r\n\treturn new Product ($id, $productname );\r\n}", "public function show($id)\n {\n return ProductType::findOrFail($id);\n }", "public function show($id)\n {\n //\n $product = Product::with('productPrice', 'productPicture')->findOrFail($id);\n\n if ($product) {\n return ResponseFormatter::success($product, 'Success get product data');\n } else {\n return ResponseFormatter::error(null, 'No product', 404);\n }\n }", "public function getProduct($productId)\n {\n return $this->productFactory->create()->load($productId);\n }", "public function show($id)\n {\n // TODO: Show the category information\n return Product::findOrFail($id);\n }", "public function show($id)\n {\n\n $product = Product::where('is_deleted', false)->with('productFiles.file')->find($id);\n if ($product != null) {\n return (new ProductResource($product))->additional([\n 'errors' => null,\n ])->response()->setStatusCode(200);\n }\n return (new ProductResource($product))->additional([\n 'errors' => ['product' => ['Product not found!']],\n ])->response()->setStatusCode(404);\n }", "private function productCheck($id)\n {\n return Product::where([\n 'id' => $id,\n 'userId' => Auth::user()->id\n ])->first();\n }", "public function show($id)\n {\n //\n $product = Product::find($id);\n if ($product){\n return response($product,200);\n }else{\n return response(\"No existe ningun producto con el id: \".$id,400);\n }\n }", "public function show(int $id): ProductResource\n {\n return new ProductResource($this->productRepository->findOrFail($id));\n }", "public function getProductById($product_id){\n $query = \"SELECT \n products.id AS id,\n products.name AS name,\n products.description AS description,\n products.price AS price,\n images.image_file_name AS image\n FROM products \n INNER JOIN products_images\n ON products.id = products_images.product_id\n INNER JOIN images\n ON products_images.image_id = images.image_id\n WHERE products.id=? AND images.active = 1 \n AND products.active = 1\";\n $statement = $this -> connection -> prepare( $query );\n $statement -> bind_param( \"i\", $product_id);\n if( $statement -> execute() == false ){\n return false;\n }\n else{\n $result = $statement -> get_result();\n if( $result -> num_rows == 0){\n //product does not exist\n return false;\n }\n else{\n //loop through result\n $product_info = array();\n while( $row = $result -> fetch_assoc() ){\n array_push( $product_info, $row );\n }\n return $product_info;\n }\n }\n $statement -> close();\n }", "public function find($id)\n {\n return $this->cache->remember(\n 'product.by-id-' . $id,\n config('cache.ttl.product'),\n function () use ($id) {\n return $this->repository->find($id);\n }\n );\n }", "public function getProduct();", "public function getProductInformation($id)\n {\n $prod = $this->getDefaultProduct();\n try {\n if (empty($id)) {\n return $prod;\n }\n\n $product = Mage::getModel('catalog/product')->load((int)$id);\n $category = null;\n // get top parent category of current product\n $categoryIds = $product->getCategoryIds();\n if (count($categoryIds) > 0) {\n $category = $this->catalogCategory->load((int)$categoryIds[0]);\n $catParent = $this->getTopParentCategory($category);\n $category = empty($catParent) ? $category->getName() : $catParent->getName();\n }\n\n $imgFullPath = $this->catalogMedia->getMediaUrl($product->getImage());\n $imgPartialPath = $this->catalogMedia->getMediaShortUrl($product->getImage());\n\n $finalPrice = $this->taxHelper->getPrice($product, $product->getFinalPrice(), true);\n $originalPrice = $this->taxHelper->getPrice($product, $product->getPrice(), true);\n $productSku = $product->getData('sku');\n $prod = array(\n 'productId' => !empty($productSku) ? $productSku : $id,\n 'description' => $product->getData('description'),\n 'descriptionShort' => $product->getData('short_description'),\n 'images' => array(\n 'fullImagePath' => $imgFullPath,\n 'partialImagePath' => $imgPartialPath,\n ),\n 'manufacturerName' => null,\n 'name' => $product->getName(),\n 'priceCurrent' => $this->coreHelper->currency($finalPrice, true, false),\n 'priceDiscount' => $this->coreHelper->currency(($originalPrice - $finalPrice), true, false),\n 'priceWithoutDiscount' => $this->coreHelper->currency($originalPrice, true, false),\n 'productLink' => $product->getProductUrl(true),\n 'category' => $category\n );\n } catch (Exception $exception) {\n $this->exceptionHandler->logException($exception);\n }\n\n return $prod;\n }", "public function getProductByID($productID){\n $query = \"SELECT * FROM tbl_shop WHERE productId='$productID'\";\n $select = $this->db->select($query);\n return $select;\n }", "public function show($id)\n {\n return Product::findOrfail($id);\n }", "public function fetchProduct($id)\n {\n if (is_numeric($id))\n {\n $url = $this->url([\n 'scheme' => 'https',\n 'host' => 'live.icecat.biz',\n 'path' => '/api/',\n 'auth' => false,\n 'params' => [\n 'shopname' => $this->username,\n 'lang' => $this->language,\n 'content' => '',\n 'icecat_id' => $id,\n 'appkey' => $this->appkey,\n ],\n ]);\n\n try {\n $client = $this->client()->request(\n 'GET',\n $url,\n [\n 'verify' => true,\n 'auth' => [\n $this->username,\n $this->password,\n ],\n ]\n );\n }\n catch (\\Exception $e)\n {\n // die('<pre>'.print_r($e, 1).'</pre>');\n die('<pre>'.print_r($e->getMessage(), 1).'</pre>');\n }\n\n echo $client->getBody()->getContents();\n exit;\n }\n\n $url = $this->url([\n 'scheme' => 'https',\n 'host' => 'data.icecat.biz',\n 'path' => $id,\n 'appkey' => $this->appkey,\n ]);\n\n try\n {\n $xml = new \\XMLReader();\n $xml->open($url);\n }\n catch(\\Exception $e)\n {\n // throw $e;\n return null;\n }\n\n while ($xml->read() && $xml->name !== 'Product');\n\n $p = xml_parser_create();\n xml_parse_into_struct($p, $xml->readOuterXML(), $vals, $index);\n xml_parser_free($p);\n\n return $vals[0]['attributes'];\n }", "public function show($id)\n {\n try\n {\n $model = resolve('App\\ApiModels\\Product\\GetProductModel');\n $product = $model->getProduct($id);\n\n return response()->json($product);\n }\n catch (Exception $e)\n {\n $this->loger->write(\"Failed to get product\", \"error\", $e);\n\n return response()->json(['error' => 'Failed to get product'], 409);\n }\n }", "public function show($id)\n {\n return ProductPurchaseLog::where('id_product', $id)->get();\n }", "function get_product_detail_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('products', array('id' => $id));\n\t\t//echo $this->db->last_query();die;\n\t\treturn $query->row_array();\t\n\t}", "public function getProduct() {\n\n if (!$this->product) {\n $this->product = $this->productPublicRepository->getById($this->getCartItem()->product_id);\n }\n return $this->product;\n }", "public function get($id) {\n if (Framework::isValidID($id)) {\n try {\n return $this->getResponseObject(Connect\\ServiceProduct::fetch($id));\n }\n catch(Connect\\ConnectAPIErrorBase $e) {\n try {\n return $this->getResponseObject(Connect\\ServiceCategory::fetch($id));\n }\n catch(Connect\\ConnectAPIErrorBase $e) {\n // pass\n }\n }\n }\n return $this->getResponseObject(null, null, new \\RightNow\\Libraries\\ResponseError(null, null, null, \"Invalid ID: No such Service Product or Category with ID = '$id'\"));\n }", "private function load($id = null) {\n\n if (!is_null($id)) {\n\n return $this->search->getProduct($id);\n\n }\n\n return $this->search->getProducts($this->filters);\n\n }", "public function get_one($strID){ \n\t\treturn $this->call('GET', '/admin/products/' . $strID . '.json', array()); \n\t}", "public function findById(int $id): ProductDTO {\n return $this->productRepo->findById($id);\n }", "public function show($id)\n {\n $product = Product::find($id);\n if (!$product) {\n return response()->json([\n 'code' => 404,\n 'message' => 'Product not found.'\n ], 404);\n }\n //return $product->image_url;\n return $product->load('category', 'images', 'tags');\n }", "public function show($id)\n {\n //\n return new ProductoResource(Producto::findOrFail($id));\n }", "public function getConcreteProduct(int $id): ApiItemTransfer;" ]
[ "0.7940686", "0.7890754", "0.77608174", "0.76664346", "0.7580344", "0.7575147", "0.7509049", "0.7508534", "0.74847496", "0.7434686", "0.7415022", "0.73910695", "0.733186", "0.7330298", "0.73048264", "0.73048264", "0.7252955", "0.72439426", "0.72405875", "0.7236139", "0.7221777", "0.7190143", "0.71857744", "0.7162738", "0.7158889", "0.7117854", "0.7117854", "0.7108283", "0.7085391", "0.70473266", "0.70335954", "0.7031073", "0.70207345", "0.69855195", "0.698099", "0.6977994", "0.6944068", "0.6925958", "0.6912544", "0.6911671", "0.6889049", "0.6881845", "0.68799925", "0.68796915", "0.6867597", "0.68576574", "0.6855618", "0.68550485", "0.684918", "0.6842627", "0.6830905", "0.682082", "0.68146825", "0.6805534", "0.68038446", "0.68038404", "0.6798907", "0.6782739", "0.6777352", "0.6775931", "0.67660654", "0.6765529", "0.67568904", "0.6755004", "0.67497265", "0.67295223", "0.67144525", "0.6698162", "0.669773", "0.66901815", "0.6681878", "0.66454667", "0.6640327", "0.6638017", "0.6632096", "0.6625982", "0.6622246", "0.6621475", "0.661155", "0.660238", "0.66006786", "0.6589084", "0.65877426", "0.65844643", "0.6583104", "0.65792435", "0.6565932", "0.65550447", "0.65353733", "0.65248585", "0.65220493", "0.6519955", "0.6513033", "0.6504562", "0.6494978", "0.6491309", "0.6491252", "0.64856595", "0.6484542", "0.64792544" ]
0.6923159
38
Get Products by criteria.
public function getProducts($criteria = []) { if (!$criteria instanceof ElementCriteriaModel) { $criteria = craft()->elements->getCriteria('DigitalProducts_Product', $criteria); } return $criteria->find(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 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 function getBy(array $criteria);", "protected function products()\n {\n return Product::enabled()->withImages()\n ->where('title', 'like', \"%{$this->query}%\")\n ->orWhere('description', 'like', \"%{$this->query}%\")\n ->orderBy('updated_at', 'desc')\n ->get();\n }", "public function getMatchingProduct($request);", "public function getProducts($params, $request);", "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 getProducts($columns=null, $conditions=null){\n return $this->productsRepository->getProducts($columns, $conditions);\n }", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function getProducts(){\n\t\t$user = Auth::user();\n\t\tif($user->hasRole('admin')){\n\t\t\t$products = Product::all();\n\t\t}\n\t\telse if($user->hasRole('distributor') || $user->hasRole('sub_distributor')){\n\t\t\t$products = Product::where('days', '!=', 0)->get();\n\t\t}\n\t\treturn $products;\n\t}", "public function getSpecific()\n {\n $qb = $this->em->createQueryBuilder();\n $results = $qb->select('p')\n ->from('Plugin\\DoctrineExample\\Entity\\Product', 'p')\n ->orderBy('p.title', 'ASC')->getQuery()->execute();\n return $results;\n }", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function findBy($criteria);", "public function findBy($criteria);", "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 static function getProducts($options = array()) {\n $perPage = isset($options['perPage']) ? $options['perPage'] : config('app.paging');\n \n $obj = static::with(['ratingArr'])->where('status', '=', 'active')->orderBy('id')->paginate($perPage);\n return $obj;\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($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'products', $_query);\r\n }", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public static function doSelect(Criteria $criteria, PropelPDO $con = null)\n {\n return GsGeneriekeProductenPeer::populateObjects(GsGeneriekeProductenPeer::doSelectStmt($criteria, $con));\n }", "public function getCriteria();", "public function findProduct(Request $request)\n {\n $user = auth()->user();\n $limite = 3;\n if ($request->limit) {\n $limite = 10;\n }\n $product = '%'.$request->product.'%';\n $products = DB::select('SELECT products.name,products.id,\n products.code,products.price\n FROM products\n INNER JOIN users ON users.id = products.created_by_id\n WHERE products.name LIKE ? OR products.code LIKE ? AND users.organization_id = ? LIMIT ?',\n [$product,$product,$user->organization_id,$limite]);\n if ($request->limit) {\n $returnHTML = view('product.searchedDataModal',['products'=> $products])->render();\n } else {\n $returnHTML = view('product.searchedData',['products'=> $products])->render();\n }\n return response()->json(array('success' => true, 'html'=>$returnHTML));\n }", "public function getMatchingProductForId($request);", "public function get_product($conditions = array()) {\n $this->db->select(array('product.product_id', 'product.name', 'product.url_slug', 'product.description', 'product.price', 'product.image', 'product.product_id', 'product_category.name as category_name', 'product.product_category_id','product_category.url_slug as product_category_url_slug', 'product.product_type_id','product_sizes.size_id as size_id','product_sizes.price as menu_price','sizes.sizes as size'));\n $this->db->from('product');\n $this->db->join('product_category', 'product_category.product_category_id = product.product_category_id');\n $this->db->join('product_sizes', 'product_sizes.product_id = product.product_id','left');\n $this->db->join('sizes', 'product_sizes.size_id = sizes.id','left');\n \n if (!empty($conditions)) {\n $this->db->where($conditions);\n }\n\n $this->db->where(array('product.status' => 1, 'product.deleted' => 0, 'product_category.status' => 1, 'product_category.deleted' => 0));\n\n return $this->db->get()->result_array();\n }", "public function ProductSearch() {\n\t\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$seller_id\t\t\t=\t$search_data['seller_id'];\n\t\t\n\t\t$querydata \t\t= \t$this->_objectManager->create('Webkul\\Marketplace\\Model\\Product')\n\t\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'seller_id',\n\t\t\t\t\t\t\t\t\t['eq' => $seller_id]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'status',\n\t\t\t\t\t\t\t\t\t['eq' =>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->addFieldToSelect('mageproduct_id')\n\t\t\t\t\t\t\t\t->setOrder('mageproduct_id');\n\t\t\t//return \t$querydata->getData();\t\t\t\t\n\t\t\t$collection = $this->_productCollectionFactory->create()->addAttributeToSelect(\n '*'\n );\n\t\t$collection->addAttributeToFilter('entity_id', array('in' => $querydata->getData()));\n\t\t$collection->addAttributeToFilter('name', array('like' => '%'.$search_term.'%'));\n\t\t\t\n\t\treturn $collection->getData();\n\t\t\t\n }", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function getProduct();", "function get_product_by ( $conds = array(), $limit = false, $offset = false ){\n\n\t\t//where clause\n\t\t$this->db->select('rt_products.*, count(rt_touches.type_id) as t_count'); \n \t\t$this->db->from('rt_products');\n \t\t$this->db->join('rt_touches', 'rt_products.id = rt_touches.type_id');\n \t\t$this->db->where('rt_touches.type_name','product');\n \t\t$this->db->where('rt_products.status',1);\n \t\t$this->db->where('rt_touches.shop_id',$conds['shop_id']);\n\n \t\tif ( isset( $conds['cat_id'] )) {\n\t\t\tif ($conds['cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.cat_id', $conds['cat_id'] );\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// sub category id condition \n\t\tif ( isset( $conds['sub_cat_id'] )) {\n\t\t\tif ($conds['sub_cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['sub_cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.sub_cat_id', $conds['sub_cat_id'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n \t\t\n\t\tif ( isset( $conds['search_term'] ) || isset( $conds['date'] )) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t\t\n\t\t\t}\n\t\t\t \n\t }\n\n \t\t$this->db->group_by('rt_touches.type_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n \t\t$this->db->order_by('rt_touches.added_date', \"desc\");\n \t\t\n\n \t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n \t\treturn $this->db->get();\n \t\t//print_r($this->db->last_query());die;\n\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}", "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 }", "public function getProducts()\n {\n\n $categories = ProductCategory::all();\n\n $products = Product::paginate(10);\n return $products;\n }", "public function index()\n {\n $request = request();\n $category_id = $request->input('category_id');\n $keyword = $request->input('q');\n\n $products = Product::when($category_id, function($query, $category_id) {\n return $query->where('category_id', $category_id);\n })\n ->when($keyword, function($query, $keyword) {\n return $query->where('name', 'LIKE', \"%$keyword%\")\n ->orWhere('description', 'LIKE', \"%$keyword%\");\n })\n ->with('category')\n ->paginate();\n\n return $products;\n }", "protected function getProductCollection()\r\n {\r\n $searchCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToSelect('*')\r\n ->addAttributeToFilter('status', 1)\r\n ->addAttributeToFilter('visibility', 4);\r\n $searchCollection->getSelect()->limit($this->getProductsCount());\r\n $searchCollection->getSelect()->where(\"'\" . date('Y-m-d') . \"' BETWEEN special_from_date AND special_to_date\");\r\n $searchCollection->getSelect()->orWhere(\"'\" . date('Y-m-d') . \"' >= special_from_date\");\r\n// echo $searchCollection->getSelect()->__toString();\r\n return $searchCollection->load();\r\n }", "public function getAll()\n {\n if (Auth::user()->id_role == 1) \n {\n $company_id = GetSession::getCompanyId();\n }elseif(Auth::user()->id_role == 2)\n {\n $company_id = Auth::user()->id_company;\n }\n \n return Product::where('id_company', $company_id)->orderBy('created_at','desc')->get();\n }", "public abstract function getCriteriaWhere($criteria);", "function allproducts_get()\n\t{\n\t\t$is_exists=$this->user_model->get_joins('products',array('is_product'=>'Y'),'',array('catg_id','child_id','prod_detail','description','size','unit','mrp'));\n\t\t//print_r($is_exists);exit('u');\n\t\tif(!empty($is_exists))\n\t\t{\n\t\t\t$this->response(array('status'=>'true','message'=>$is_exists));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('status'=>'false','message'=>'No Product Found'),REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "public abstract function getCriteriaFrom($criteria);", "public static function select_products_by_options($data)\n {\n \n $query = new Query;\n $products = $query->select(['core_products.*','core_product_images.*'])\n ->from('core_products')\n ->innerJoin('core_product_images', 'core_product_images.product_id=core_products.product_id');\n \n \n //if product type is set i.e., hire, sale or both\n if(isset($_REQUEST['product_type']) && @$_REQUEST['product_type'] != '')\n {\n if($_REQUEST['product_type'] != '')\n {\n $product_type= $_REQUEST['product_type'];\n if($product_type == 'hire') \n $products = $products->where(['core_products.product_type' => [0,2]]);\n else if($product_type == 'sale') \n $products = $products->where(['core_products.product_type' => [1,2]]);\n else if($product_type == 'both') \n $products = $products->where(['core_products.product_type' => [2]]);\n }\n \n }\n //default product type is hire if product type not set to anything\n else\n {\n \n $products = $products->where(\"core_products.product_type = 0\");\n }\n //if user selects the category\n if(isset($_REQUEST['category']))\n {\n \n if($_REQUEST['category'] != '')\n {\n $category_id = $_REQUEST['category'];\n $products = $products->andWhere(\"core_products.category_id = $category_id\");\n }\n }\n //if user selects sub category\n if(isset($_REQUEST['sub_category_id']) && @$_REQUEST['sub_category_id'] != '')\n {\n \n if($_REQUEST['sub_category_id'] != '')\n {\n $sub_category_id = $_REQUEST['sub_category_id'];\n $products = $products->andWhere(\"core_products.sub_category_id = $sub_category_id\");\n }\n }\n //if user sets current location\n if(@$_REQUEST['current_location'] != '')\n {\n \n $products = $products->andFilterWhere(['LIKE', 'core_products.current_location', $_REQUEST['current_location']]);\n }\n //if user sets price type\n if(@$_REQUEST['price_type'] != '')\n {\n $price_type =$_REQUEST['price_type'];\n $products = $products->andWhere(\"core_products.price_type = $price_type\");\n }\n //if user sets capacity range\n if(@$_REQUEST['capacity'] != '')\n {\n \n $capacity =$_REQUEST['capacity'];\n //if user selects between\n if (strpos($capacity, 'and') !== false) {\n $products = $products->andWhere(\"rtrim(substring_index(core_products.capacity, ' ', 1)) between $capacity\");\n }\n //if user selects morethan\n else if (strpos($capacity, '>') !== false) {\n $products = $products->andWhere(\"rtrim(substring_index(core_products.capacity, ' ', 1)) $capacity\");\n }\n }\n \n $products = $products->orderBy([\"core_products.product_id\" => SORT_DESC])\n ->andWhere(\"core_products.product_status = 1\")\n ->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])\n ->groupBy(['core_products.product_id'])\n ->all();\n return $products;\n }", "public function getAllProducts()\n {\n\n $query = $this->db->get_where('products', array('pro_status' => 1));\n return $query->result();\n }", "function getProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product.json' , $params ),true);\n\t}", "public function findBy(array $criteria);", "public function get()\n {\n $products = $this->productRepository->all();\n foreach($products as $product) {\n\n $product->category = $this->categoryRepository->find($product->category_id)->title;\n $product->section_id = $this->categoryRepository->find($product->category_id)->section_id;\n $product->section = $this->sectionRepository->find($product->section_id)->title;\n }\n return $products;\n\n }", "public function myProducts(){\n return Product::where('seller_id', auth()->user()->id)\n ->orderBy('name')\n ->orderBy('created_at')\n -> get() ?? response()->json(['message'=>__('messages.productsNotFound')], 404);\n }", "public function getCartProductsByHotelIds() {\n\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $hotel_id = func_get_arg(1);\n\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', array())\n ->where('act.user_id = ?', $user_id)\n ->where('act.hotel_id = ?', $hotel_id)\n ->where('p.prod_status = ?', 1)\n ->where('hd.hotel_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 getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function showProducts()\n {\n /** @var ProductFinder $productFinder */\n $productFinder = PersistenceFactory::createFinder(Product::class);\n /** @var array $products */\n\n $criteria = isset($this->request->getGet()['criteria']) ? $this->request->getGet()['criteria'] : 'title';\n $order = isset($this->request->getGet()['order']) ? $this->request->getGet()['order'] : '';\n $search = isset($this->request->getGet()['search']) ? $this->request->getGet()['search'] : null;\n $products = $productFinder->findBy($criteria, $order, $search);\n $renderer = new HomePageRenderer();\n $renderer->render($products);\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 }", "abstract public function findBy($criteria);", "function products_from_request($page, $page_count){\n\tglobal $con;\n\t\n\t$args = [];\n\t$arg_types = \"\";\n\t$query = \"\n\t\tSELECT *\n\t\tFROM `products`\n\t\tINNER JOIN `categories`\n\t\t\tON `categories`.category_id = `products`.product_category\n\t\tINNER JOIN manufacturers\n\t\t\tON `manufacturers`.manufacturer_id = `products`.product_manufacturer\";\n\t\n\t// Now the dynamic part of our query, filtering logic\n\t\n\t$has_w = false;\n\t\n\t// view only products of a certain category.\n\tif(!empty($_GET['c'])){\n\t\t$args [] = &$_GET['c'];\n\t\t$query .= \" WHERE category_id = ? \";\n\t\t$arg_types .= \"i\";\n\t\t$has_w = true;\n\t}\n\t\n\t// view only products of a certain manufacturer\n\tif(!empty($_GET['m'])) {\n\t\t$args [] = &$_GET['m'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" manufacturer_id = ? \";\n\t\t$arg_types .= \"i\";\n\t\t$has_w = true;\n\t}\n\t\n\t// where the name of the product is...\n\tif(!empty($_GET['n'])) {\n\t\t$query_name = \"%\" . $_GET['n'] . \"%\";\n\t\t$args [] = &$query_name;\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_name LIKE ? \";\n\t\t$arg_types .= \"s\";\n\t\t$has_w = true;\n\t}\n\t\n\t// price range...\n\tif(!empty($_GET['p-min'])) {\n\t\t$args [] = &$_GET['p-min'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_price >= ? \";\n\t\t$arg_types .= \"d\";\n\t\t$has_w = true;\n\t}\n\t\n\tif(!empty($_GET['p-max']) ) {\n\t\t$args [] = &$_GET['p-max'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_price <= ? \";\n\t\t$arg_types .= \"d\";\n\t\t$has_w = true;\n\t}\n\t\n\t// ordering\n\t\n\tif(isset($_GET['o'])){\n\t\t$order = intval($_GET['o']);\n\t} else {\n\t\t$order = 1;\n\t}\n\t\n\tswitch($order){\n\t\tcase 1:\n\t\t\t$query .= \" ORDER BY product_name ASC \";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$query .= \" ORDER BY product_price DESC \";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t$query .= \" ORDER BY product_price ASC \";\n\t\t\tbreak;\n\t}\n\t\n\t\n\t// now we want to limit number of rows we're getting.\n\t$from = ($page - 1) * 20;\n\t$query .= \" LIMIT $from, 20 \";\n\t\n\t\n\t// Now put the query together...\n\tif(count($args) > 0){\n\t\t// the input data types string is the first argument to the bind_param \n\t\t// method, so we have to prepend it at the start of the args array\n\t\tarray_unshift($args, $arg_types);\n\t\t\n\t\t$prep = $con->prepare($query);\n\t\t\n\t\t// since the bind_param is a vararg function, we need to use some\n\t\t// funky shit... i.e., we need to be able to call the function by \n\t\t// passing an array of our arguments.\n\t\tcall_user_func_array(array($prep,'bind_param'), $args);\n\t\t\n\t\t$prep->execute();\n\t\t$result = $prep->get_result();\n\t\t$prep->close();\n\t\t\n\t} else {\n\t\t$result = $con->query($query);\n\t}\n\treturn $result;\n\t\n}", "function getProducts()\n {\n $ret = array();\n foreach ($this->getItems() as $item)\n if ($item->item_type == 'product')\n if ($pr = $item->tryLoadProduct())\n $ret[] = $pr;\n return $ret;\n }", "public function getBywhere($condition)\n {\n return $this->productRepository->getBywhere($condition);\n }", "public static function findby($where)\n {\n // obtiene todos los identificadores de productos que cumplan la \n // condicion\n $ids = \\database\\DAOFactory::getDAO(\"product\")->select([\"idProducto\"], $where);\n if (!$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 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 getProduct() {\r\n\t\t$id = $this->getRequest()->getParam('id');\r\n\t\t$products = Mage::getModel('catalog/product')->load($id);\r\n\t\treturn $products;\r\n\t}", "public function get($filters = array())\n {\n if (isset($filters['id']))\n {\n\n $result = $this->database->product_get_by_id($filters['id']);\n \n }\n else if (isset($filters['cat_id']) || isset($filters['p.cat_id']))\n {\n $result = $this->database->product_get_by_category($filters);\n }\n else if (isset($filters['token']))\n {\n $result = $this->database->get_product_by_download_token($filters['token']);\n }\n else if (isset($filters['cart']))\n {\n $result = $this->database->get_cart_products();\n }\n else\n {\n $result = $this->database->product_get_all($filters);\n }\n \n return $result;\n }", "public function searchProfessionals($pCriteria){\n\t\t// \t-> get();\n\n\t// \t return $this -> professional -> join('pros_specs', 'professionals.ID', '=', 'pros_specs.professionalID')\n\t// \t\t -> join('specializations', 'specializations.ID', '=', 'pros_specs.specializationID')\n\t// \t\t-> join('pros_creativefields', 'professionals.ID', '=', 'pros_creativefields.ProfessionalID')\n\t// \t\t-> join('creativefields', 'pros_creativefields.CreativeFieldID', '=', 'creativefields.ID')\n\t// \t\t-> join('pros_platforms', 'professionals.ID', '=', 'pros_platforms.ProfessionalID')\n\t// \t\t-> join('platforms', 'platforms.ID', '=', 'pros_platforms.PlatformID')\n\t// \t\t-> join('cities', 'professionals.CityID', '=', 'Cities.ID')\n\t// \t\t-> where('CompanyName', 'LIKE', '%' . $pCriteria['pCompanyName'] . '%')\n\t// \t\t-> whereIn('specializations.ID', $pCriteria['pSpecializations'])\n\t// \t\t-> whereIn('creativefields.ID', $pCriteria['pCreativeFields'])\n\t// \t\t-> whereIn('platforms.ID', $pCriteria['pPlatforms'])\n\t// \t\t-> whereIn('cities.ID', $pCriteria['pCities']) \n\t// \t\t-> groupBy('professionals.ID')\n\t// \t\t-> distinct() -> get();\n\t// }\n\n\t\t$searchQuery = $this -> professional -> queryJoiningTables();\n\n\t\tif(!is_null($pCriteria['pCompanyName'])){\n\t\t\t$searchQuery = $searchQuery -> queryCompanyName($pCriteria['pCompanyName']);\n\t\t}\n\n\t\tif(!is_null($pCriteria['pSpecializations'])){\n\t\t\t$searchQuery = $searchQuery -> querySpecializations($pCriteria['pSpecializations']);\n\t\t}\n\n\t\tif(!is_null($pCriteria['pCreativeFields'])){\n\t\t\t$searchQuery = $searchQuery -> queryCreativeFields($pCriteria['pCreativeFields']);\n\t\t}\n\n\t\tif(!is_null($pCriteria['pPlatforms'])){\n\t\t\t$searchQuery = $searchQuery -> queryPlatforms($pCriteria['pPlatforms']);\n\t\t}\n\n\t\tif(!is_null($pCriteria['pCities'])){\n\t\t\t$searchQuery = $searchQuery -> queryCities($pCriteria['pCities']);\n\t\t}\n\n\n\n\t\treturn $searchQuery -> groupBy('professionals.ID') \n\t\t\t-> distinct() -> get(array('Professionals.*'));\n\t}", "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 getProductFilter(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria)\n {\n $result = [];\n \n // Collection/products with last filter group removed\n $prevCollection = $this->getPreviousCollection($searchCriteria);\n $prevProducts = $prevCollection->getItems();\n \n // Get the last filter option\n $lastFilter = $this->filterHelper->getLastFilter($searchCriteria);\n \n // Build product collection with search criteria\n $collection = $this->productHelper->buildCollection($searchCriteria);\n $collection->load();\n $collection->addCategoryIds()->addMinimalPrice();\n $products = $collection->getItems();\n \n // Loop through the list of defined filters\n foreach ($this->filterableList AS $filter) \n {\n $attribute = new Attribute();\n $attribute->setHandle($filter->handle);\n $attribute->setName($filter->name);\n if (isset($filter->condition)) $attribute->setCondition($filter->condition);\n \n switch($filter->type) {\n case 'category':\n $parent = $this->getParentFilter($filter);\n $attribute->setField('category_id');\n $attribute->setType('list');\n $attribute->setLogicalAnd(true);\n $this->setAttributeValues($searchCriteria, $attribute, $this->parseCategoryFilter($filter, $products, $parent, $this->productHelper->getFiltersByField($searchCriteria, 'category_id')));\n break;\n \n case 'attribute':\n $attribute->setField($filter->id);\n $attribute->setType('list');\n $attribute->setLogicalAnd($filter->logicalAnd ?? false);\n $isLast = $this->filterBehaviour == 'multiple' && $filter->handle == $lastFilter->getField();\n $attributeProducts = $isLast ? $prevProducts : $products;\n $this->setAttributeValues($searchCriteria, $attribute, $this->parseAttributeFilter($filter, $attributeProducts), $isLast);\n break;\n \n case 'price':\n $attribute->setField('price');\n $attribute->setType('slider');\n $attribute->setLogicalAnd(true);\n $this->setAttributeValues($searchCriteria, $attribute, $this->parsePriceFilter($collection));\n break;\n }\n \n // No values? Then lets not show this attribute\n if (count($attribute->getValues()) == 0) continue;\n \n $result[$filter->handle] = $attribute;\n }\n \n return $result;\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 getProductsList($params){\n\t\ttry {\t\n\t\t\tif(trim($params['start'])==''){ $start = 0; }else{ $start = $params['start'];}\n\t\t\t\n\t\t\t$query = \"select\n\t\t\t\t\tsp.product_id, sp.attributes_group_id, sp.merchant_id, sp.product_sku, sp.product_title, sp.product_small_description,\n\t\t\t\t\t(SELECT product_image FROM store_products_images spi\n\t\t\t\t\twhere spi.product_thumbnail=1 AND spi.statusid=1 AND spi.product_id=sp.product_id) AS product_image,\n\t\t\t\t\t\n\t\t\t\t\t(select spp.product_discount\n\t\t\t\t\tfrom store_products_price spp where spp.product_id=sp.product_id ORDER BY product_price ASC LIMIT 0,1) AS product_discount_details,\n\t\t\t\t\t\n\t\t\t\t\t(select spp.product_price\n\t\t\t\t\tfrom store_products_price spp where spp.product_id=sp.product_id ORDER BY product_price ASC LIMIT 0,1) AS product_price,\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t(select if(spp.product_discount_type='Amount' , (spp.product_price-spp.product_discount), (spp.product_price-(spp.product_price*product_discount)/100))\n\t\t\t\t\tfrom store_products_price spp where spp.product_id=sp.product_id ORDER BY product_price ASC LIMIT 0,1) AS product_price_details\n\n\t\t\t\t\tfrom store_products sp\n\t\t\t\t\tLEFT JOIN store_products_categories spc ON (sp.product_id=spc.product_id)\n\t\t\t\t\twhere\n\t\t\t\t\tsp.statusid=1 \n\t\t\t\t\tAND spc.category_id = \".$params['id'].\" AND sp.statusid=1\n\t\t\t\t\tGROUP BY sp.product_id\n\t\t\t\t\tORDER BY \".$params['orderby'].\" \".$params['ordertype'].\" LIMIT \".$start.\", \".$params['limit'].\"\";\n\t\t\t\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetchAll();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "public function getProducts()\n\t{\n\t\t$context = 'product' . $type;\n\n\t\t$q = 'SELECT a.*, (SELECT b.path FROM #__gazebos_gallery AS b WHERE b.product_id = a.id ' .\n\t\t\t' ORDER BY b.ordering ASC LIMIT 1) AS image FROM #__gazebos_products AS a' .\n\t\t\t' WHERE a.state = 1 AND a.type_id = ' . $this->item->id;\n\n\t\t$filter_material = $this->getState($context . 'filter.material');\n\t\tif (is_array($filter_material) && !empty($filter_material) && !empty($filter_material[0]))\n\t\t{\n\t\t\t$q .= ' AND a.material_id IN (' . implode(',', $filter_material) . ')';\n\t\t}\n\n\t\t$filter_shape = $this->getState($context . 'filter.shape');\n\t\tif (is_array($filter_shape) && !empty($filter_shape) && !empty($filter_shape[0]))\n\t\t{\n\t\t\t$q .= ' AND a.shape_id IN (' . implode(',', $filter_shape) . ')';\n\t\t}\n\n\t\t$filter_style = $this->getState($context . 'filter.style');\n\t\tif (is_array($filter_style) && !empty($filter_style) && !empty($filter_style[0]))\n\t\t{\n\t\t\t$q .= ' AND a.style_id IN (' . implode(',', $filter_style) . ')';\n\t\t}\n\n\t\t$results = $this->getDbo()->setQuery($q)->loadObjectList('id');\n\n\t\tif ($results !== null)\n\t\t{\n\t\t\tforeach ($results as $product)\n\t\t\t{\n\t\t\t\t$Itemid = GazebosHelper::getProductTypeMenuItem($type);\n\t\t\t\t$product->link = JRoute::_('index.php?option=com_gazebos&view=product&id=' . $product->id . '&Itemid=' . $Itemid);\n\n\t\t\t\tif (!empty($product->image))\n\t\t\t\t{\n\t\t\t\t\t$product->image = EEHtml::asset(\"products/{$product->id}/thumbs/199x160_{$product->image}\", 'com_gazebos');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "private function loadAll() {\n\n return $this->search->getProducts();\n\n }", "public function search($params)\n {\n $maxPerPage = isset($params['limit']) && in_array($params['limit'], [12, 24, 36]) ? $params['limit'] : 12; // Products per page\n $currentPage = isset($params['p']) ? $params['p'] : 1;\n\n // Build search query\n $boolQuery = new \\Elastica\\Query\\BoolQuery();\n $this->applyQuery($boolQuery, $params);\n $this->applyCategory($boolQuery, $params);\n $this->applyStatus($boolQuery);\n $this->applyPrice($boolQuery, $params);\n $this->applyAttributes($boolQuery, $params);\n $this->applyUser($boolQuery, $params);\n\n $query = new \\Elastica\\Query($boolQuery);\n $this->applyLocation($query, $params);\n $this->applySortAndOrder($query, $params);\n\n $results = $this->finder->findPaginated($query);\n $results->setMaxPerPage($maxPerPage);\n $results->setCurrentPage($currentPage);\n\n return $results;\n }", "public function getProductById(int $id);", "public function getProducts($params) {\n $productJsonResult = array();\n\n # execute product list query\n try {\n $dbQuery = \"\n SELECT `P`.`product_index`, \n `P`.`product_group` as `product_group_index`,\n `PG`.`product_group_name` as `product_group_name`, \n `PG`.`product_group_priority` as `product_group_priority`,\n `P`.`product_name`, `P`.`product_status`,\n `P`.`product_owner` as `product_owner_index`,\n `UG`.`user_group_name` as `product_owner_name`,\n `P`.`product_rent` as `product_rent_index`,\n `R`.`rent_user` as `product_rent_user_index`,\n `U`.`user_name` as `product_rent_user_name`,\n `U`.`user_id` as `product_rent_user_id`,\n `R`.`rent_status` as `product_rent_status`,\n `R`.`rent_time_start` as `product_rent_start`,\n `R`.`rent_time_end` as `product_rent_end`,\n `R`.`rent_time_return` as `product_rent_return`,\n `P`.`product_barcode`, `P`.`product_created`\n FROM `Products` AS `P`\n LEFT OUTER JOIN `UserGroup` AS `UG` ON (`P`.`product_owner` = `UG`.`user_group_index`) \n LEFT OUTER JOIN `ProductGroup` AS `PG` ON (`P`.`product_group` = `PG`.`product_group_index`) \n LEFT OUTER JOIN `Rents` AS `R` ON (`P`.`product_rent` = `R`.`rent_index`) \n LEFT OUTER JOIN `Users` AS `U` ON (`R`.`rent_user` = `U`.`user_index`)\n WHERE 1=1\";\n if (isset($params[Product::PRODUCT_INDEX])) {\n $dbQuery .= \" AND `product_index` = \".$params[Product::PRODUCT_INDEX];\n }\n if (isset($params[Product::PRODUCT_BARCODE])) {\n $dbQuery .= \" AND `product_barcode` = \".$params[Product::PRODUCT_BARCODE];\n }\n if (isset($params[Product::PRODUCT_GROUP])) {\n $dbQuery .= \" AND `product_group` = \".$params[Product::PRODUCT_GROUP];\n }\n $db = DatabaseManager::getInstance()->getConnection();\n $dbStatement = $db->prepare($dbQuery);\n # database query not ready\n if (!$dbStatement) {\n printOutput(-2, \"DB QUERY FAILURE : \".$db->error);\n exit();\n }\n $dbStatement->execute();\n if ($dbStatement->errno != 0) {\n # product list query error\n printOutput(-4, \"PRODUCT LIST FAILURE : \".$dbStatement->error);\n exit();\n }\n $productData = array();\n $dbStatement->bind_result($productData[Product::PRODUCT_INDEX], $productData[ProductGroup::PRODUCT_GROUP_INDEX], $productData[ProductGroup::PRODUCT_GROUP_NAME], $productData[ProductGroup::PRODUCT_GROUP_PRIORITY], $productData[Product::PRODUCT_NAME], $productData[Product::PRODUCT_STATUS], $productData[UserGroup::USER_GROUP_INDEX], $productData[UserGroup::USER_GROUP_NAME],\n $productData[Product::PRODUCT_RENT], $productData[Rent::RENT_USER], $productData[User::USER_NAME], $productData[User::USER_ID], $productData[Rent::RENT_STATUS], $productData[Rent::RENT_TIME_START], $productData[Rent::RENT_TIME_END], $productData[Rent::RENT_TIME_RETURN], $productData[Product::PRODUCT_BARCODE], $productData[Product::PRODUCT_CREATED]);\n while($dbStatement->fetch()) {\n $productJsonObject = array();\n $productJsonObject[\"product_index\"] = $productData[Product::PRODUCT_INDEX];\n $productJsonObject[\"product_group_index\"] = $productData[ProductGroup::PRODUCT_GROUP_INDEX];\n if (isset($productData[ProductGroup::PRODUCT_GROUP_NAME])) {\n $productJsonObject[\"product_group_name\"] = $productData[ProductGroup::PRODUCT_GROUP_NAME];\n } else {\n $productJsonObject[\"product_group_name\"] = \"\";\n }\n if (isset($productData[ProductGroup::PRODUCT_GROUP_PRIORITY])) {\n $productJsonObject[\"product_group_priority\"] = $productData[ProductGroup::PRODUCT_GROUP_PRIORITY];\n } else {\n $productJsonObject[\"product_group_priority\"] = 0;\n }\n $productJsonObject[\"product_name\"] = $productData[Product::PRODUCT_NAME];\n $productJsonObject[\"product_status\"] = $productData[Product::PRODUCT_STATUS];\n $productJsonObject[\"product_owner_index\"] = $productData[UserGroup::USER_GROUP_INDEX];\n if (isset($productData[UserGroup::USER_GROUP_NAME])) {\n $productJsonObject[\"product_owner_name\"] = $productData[UserGroup::USER_GROUP_NAME];\n } else {\n $productJsonObject[\"product_owner_name\"] = \"\";\n }\n $productJsonObject[\"product_rent_index\"] = $productData[Product::PRODUCT_RENT];\n if (isset($productData[Rent::RENT_USER])) {\n $productJsonObject[\"product_rent_user_index\"] = $productData[Rent::RENT_USER];\n }\n if (isset($productData[User::USER_NAME])) {\n $productJsonObject[\"product_rent_user_name\"] = $productData[User::USER_NAME];\n }\n if (isset($productData[User::USER_ID])) {\n $productJsonObject[\"product_rent_user_id\"] = $productData[User::USER_ID];\n }\n if (isset($productData[Rent::RENT_STATUS])) {\n $productJsonObject[\"product_rent_status\"] = $productData[Rent::RENT_STATUS];\n }\n if (isset($productData[Rent::RENT_TIME_START])) {\n $productJsonObject[\"product_rent_time_start\"] = $productData[Rent::RENT_TIME_START];\n }\n if (isset($productData[Rent::RENT_TIME_END])) {\n $productJsonObject[\"product_rent_time_end\"] = $productData[Rent::RENT_TIME_END];\n }\n if (isset($productData[Rent::RENT_TIME_RETURN])) {\n $productJsonObject[\"product_rent_time_return\"] = $productData[Rent::RENT_TIME_RETURN];\n }\n $productJsonObject[\"product_barcode\"] = $productData[Product::PRODUCT_BARCODE];\n $productJsonObject[\"product_created\"] = $productData[Product::PRODUCT_CREATED];\n array_push($productJsonResult, $productJsonObject);\n }\n $dbStatement->close();\n } catch(Exception $e) {\n # product list query error\n printOutput(-2, \"DB QUERY FAILURE : \".$db->error);\n exit();\n }\n\n return $productJsonResult;\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 getAllProducts()\n {\n return $this->productRepository->all();\n }", "public function getProducts()\n {\n foreach ($this->productIds as $id) {\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new ProductModel())->load($id);\n }\n }", "public function getProducts()\n {\n $query = $this->db->query(\"SELECT * FROM products ORDER BY name ASC \");\n if($query->num_rows() > 0)\n {\n return $query->result();\n }\n else\n {\n return null;\n }\n }", "function get_product_like( $conds = array(), $limit = false, $offset = false )\n\t{\n\t\t$this->db->select('rt_products.*'); \n\t\t$this->db->from('rt_products');\n\t\t$this->db->join('rt_likes', 'rt_likes.product_id = rt_products.id');\n\n\t\tif(isset($conds['user_id'])) {\n\n\t\t\tif ($conds['user_id'] != \"\" || $conds['user_id'] != 0) {\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\t\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n\t\treturn $this->db->get();\n\t\t\n \t}", "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 listMatchingProducts($request);", "public function showCertainAction()\n\t{\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$query = $em->createQuery(\n \t'SELECT p, c\n \tFROM JasonFirstBundle:Product p\n \tJOIN p.category c\n \tWHERE p.price >= :price\n \tORDER BY p.price ASC'\n\t\t)->setParameter('price', '0.01');\n\t\t//->setMaxResults(10);\n\n\t\ttry {\n\t\t $products = $query->getResult();\n\t\t} catch (\\Doctrine\\Orm\\NoResultException $e) {\n\t\t $products = null;\n\t\t}\n\n\t\treturn $this->render(\n\t \t'JasonFirstBundle:Default:showAll.html.twig',\n\t \tarray('products' => $products,\n\t \t)\n\t );\n\t}", "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}", "public function readProducts() {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n $traderId = $this->getTraderID($auth);\r\n $sql = \"SELECT * FROM product WHERE traderid = '{$traderId}'\";\r\n $products = Product::find_by_sql($sql);\r\n if ($products) {\r\n return $products;\r\n } else {\r\n throw new RestEception(400, \"no products found\");\r\n }\r\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}", "private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }", "function getProduct()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`products`\";\n //echo $sql;exit();\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $products = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $product = new ProductEntity();\n $product->setIdProduct($data->id);\n $product->setName($data->name);\n $product->setDomaine_realise($data->domaine_realise);\n $product->setTache_realisee($data->tache_realisee);\n $product->setImage($data->image);\n $product->setCreatedAt($data->createdat);\n\n $products[] = $product;\n }\n\n if ($products) {\n return $products;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null);", "public function getProducts($options = array())\n {\n $return = $this->getListe(\"products\", $options);\n return $return;\n }", "function find_all_products()\n\t{\n\t\tif(!$this->validate())\n\t\t\treturn false;\n\n\t\tif(empty($this->keywords_to_search_for))\n\t\t\t$this->set_keywords_from_search_query();\n\t\t\t\t\t\t\n\t\t$keyword_filter \t= $this->build_keyword_sql_filter($this->keywords_to_search_for);\n\t\t\n\t\t$category_filter \t= $this->build_category_sql_filter($this->in_category_id);\n\n\t\t$limit \t\t\t\t= (int)$this->results_per_page.' OFFSET '. (int)$this->calculate_record_offset();\n\n\t\tif(empty($keyword_filter))\t\n\t\t{\n\t\t\t$this->search_results = array();\n\t\t\t\n\t\t\treturn $this->search_results;\n\t\t}\n\t\t\t\t\n\t\t//Perform a keyword weighted search query to find the most relavent results\n\t\t$sql = 'SELECT product.id, product.name, product.description, product.url_name, image.filename AS image_filename, sum(product_keyword.frequency) AS frequency ' .\n\t\t\t\t'FROM product ' .\n\t\t\t\t'\tINNER JOIN product_keyword ON product_keyword.product_id = product.id ' .\n\t\t\t\t'\tINNER JOIN keyword ON product_keyword.keyword_id = keyword.id ' .\n\t\t\t\t'\tINNER JOIN image ON product.image_id = image.id ' .\n\t\t\t\t'WHERE ('.$keyword_filter.') '.$category_filter . ' AND product.is_active = 1 ' . \n\t\t\t\t'GROUP BY \n\t\t\t\t\tproduct.id,\n\t\t\t\t\tproduct.name,\n \t\t\t\t\tproduct.description,\n \t\t\t\t\tproduct.url_name ' . \n\t\t\t\t'ORDER BY frequency DESC, product.name, product.id ' .\n\t\t\t\t'LIMIT ' . $limit;\n\t\t\n\t\t$this->search_results = $this->_db->query_as_array($sql);\n\t\t\t\t\t\n\t\treturn $this->search_results;\t\t\n\t}", "private function load($id = null) {\n\n if (!is_null($id)) {\n\n return $this->search->getProduct($id);\n\n }\n\n return $this->search->getProducts($this->filters);\n\n }", "function searchProduct($type,$input)\n {\n $products;\n switch($type)\n {\n case 0:\n $products=Product::search($input);\n break;\n case 1:\n $products=Product::searchByName($input);\n break;\n case 2:\n $products=Product::searchByGroup($input);\n break;\n case 3:\n $products=Product::searchBySupplier($input);\n break;\n case 4:\n $products=Product::searchByTag($input);\n break;\n case 5: $products=Product::searchByDescription($input);\n break;\n default:\n break;\n }\n if(!empty($products))\n {\n return $products;\n }else {\n return false;\n }\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}", "public function getByCriteria() {\n $ret = array();\n $sql = \"SELECT DISTINCT C.courseID FROM Course C INNER JOIN Section S ON C.courseID=S.courseID WHERE S.sessionYear = :sessionYear AND S.sessionCode = :sessionCode AND S.term = :term\";\n $params = array(':sessionCode' => $this->code, ':sessionYear' => $this->year, ':term' => $this->term);\n foreach($this->filters as $name => $val) {\n $sql .= ' AND '.$name.'=:'.$name;\n $params[':'.$name] = $val;\n }\n $stmt = $this->conn->prepare($sql);\n $stmt->execute($params);\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $ret[] = new Course($row['courseID'], $this->head);\n echo $row['courseID'];\n }\n return $ret;\n return (!empty($ret)) ? $ret : false;\n }", "public function filterProducts(Request $request) {\n\t\t$genre_id = $request->genreId;\n\t\t$author_id = $request->authorId;\n\n\t\t$filtered_products = Product::where('author_id', $author_id)\n\t\t ->where('genre_id', $genre_id)\n\t\t ->orderBy('created_at', 'desc')\n\t\t ->with('image')\n\t\t\t\t\t\t\t\t\t ->where( 'amount', '>', 0 )\n\t\t\t\t\t\t\t\t\t ->get();\n\t\treturn $filtered_products;\n\t}", "function getProductsbySearch($Search){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `name` LIKE ? OR \n\t\t\t\t\t\t\t\t\t`description` LIKE ? OR\n\t\t\t\t\t\t\t\t\t`large_description` LIKE ? AND `stock`>0\");\n\t\t$Search = '%'.$Search.'%';\n\t\t$Search = str_replace(\" \", \"%\", $Search);\n\t\t$sth \t-> execute(array($Search, $Search, $Search));\n\n\t\treturn \t$sth;\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 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 }", "private function showProductsById()\n { \n $productNum1 = $this->productDao->getById(1);\n $productNum9 = $this->productDao->getById(9);\n \n echo PHP_EOL;\n echo 'Product with id 1: ' . PHP_EOL; print_r($productNum1);\n echo 'Product with id 9: ' . PHP_EOL; print_r($productNum9);\n }", "public function getItems()\n\t{\n\t\t// Connect db\n\t\t\t$db\t\t\t\t\t\t\t\t\t= $this->getDbo();\n\t\t\t$query\t\t\t\t\t\t\t\t= $db->getQuery(true);\n\t\t\t$user\t\t\t\t \t\t\t\t= & JFactory::getUser();\n\n\t\t$query->select('tm.*');\n\t\t$query->from('#__jereverseauction_products AS tm');\n\t\t$query->where('tm.user_id = '.$user->id);\n\t\t$db->setQuery($query);\n\t\t$product\t\t\t\t\t\t\t\t\t= $db->loadObjectList();\n\n\t\tif ($error = $db->getErrorMsg()) {\n\t\t\tthrow new Exception($error);\n\t\t}\n\t\tif( empty($user->id) ) {\n\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PLEASE_LOGIN'));\n\t\t}else if( empty($product) ) {\n\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PRODUCTS_NOT_FOUND'));\n\t\t} else {\n\t\t\t$query->where('tm.published = 1 || tm.published = 0');\n\t\t\t$query->order('tm.id');\n\n\t\t\t// Join over the categories.\n\t\t\t$query->select( 'cat.title AS category_title' );\n\t\t\t$query->join( 'LEFT', '#__categories AS cat ON cat.id = tm.catid' );\n\n\t\t\t$query->select( 'com.id as comm_id' );\n\t\t\t$query->join( 'LEFT', '#__jereverseauction_commission AS com ON com.prod_id = tm.id' );\n\n\t\t\t$products\t\t\t\t\t\t\t\t= $db->loadObjectList();\n\n\t\t\tif( empty( $products )) {\n\t\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PRODUCTS_NOT_PUBLISHED'));\n\t\t\t}\n\n\t\t\t$this->_total\t\t\t\t\t\t= count($products);\n\n\t\t\tif ($this->getState('limit') > 0) {\n\t\t\t\t$this->_data\t\t\t\t\t= array_splice($products, $this->getState('limitstart'), $this->getState('limit'));\n\t\t\t} else {\n\t\t\t\t$this->_data\t\t\t\t\t= $products;\n\t\t\t}\n\n\t\t\treturn $this->_data;\n\t\t}\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('&times;', 'x', $products[$i]['Product']['name']);\n\t\t\t$products[$i]['Product']['short_description'] = str_replace('&times;', 'x', $products[$i]['Product']['short_description']);\n\t\t}\n\n\t\treturn $products;\n\t}", "public function getActiveCartProducts();", "function get_purchased_product_by ( $conds = array(), $limit = false, $offset = false ){\n\n\t\t//$this->custom_conds();\n\t\t//where clause\n\t\t$this->db->select('rt_products.*, count(rt_transactions_counts.product_id) as t_count'); \n \t\t$this->db->from('rt_products');\n \t\t$this->db->join('rt_transactions_counts', 'rt_products.id = rt_transactions_counts.product_id');\n \t\t$this->db->where('rt_products.status',1);\n \t\t$this->db->where('rt_transactions_counts.shop_id',$conds['shop_id']);\n\n \t\tif ( isset( $conds['cat_id'] )) {\n\t\t\tif ($conds['cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.cat_id', $conds['cat_id'] );\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// sub category id condition \n\t\tif ( isset( $conds['sub_cat_id'] )) {\n\t\t\tif ($conds['sub_cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['sub_cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.sub_cat_id', $conds['sub_cat_id'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif ( isset( $conds['search_term'] ) || isset( $conds['date'] ) ) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\t\t\t\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_transactions_counts.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_transactions_counts.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t}\n\t\t\t \n\t }\n\n \t\t$this->db->group_by('rt_transactions_counts.product_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n \t\t$this->db->order_by('rt_transactions_counts.added_date',\"desc\");\n\n \t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n \t\treturn $this->db->get();\n \t\t //print_r($this->db->last_query());die;\n\n\t}", "public function get_featured_product($conditions = array()) {\n $this->db->select(array('product.product_id', 'product.name', 'product.url_slug', 'product.description', 'product.price', 'product.image', 'product_category.name as category_name', 'product.product_category_id', 'product.product_type_id', 'product_category.url_slug as product_category_url_slug'));\n $this->db->from('product');\n $this->db->join('product_category', 'product_category.product_category_id = product.product_category_id');\n $this->db->where(array('product.status' => 1, 'product.deleted' => 0, 'product_category.status' => 1, 'product_category.deleted' => 0));\n\n if (!empty($conditions)) {\n $this->db->where($conditions);\n }\n\n $this->db->order_by('product_category.name');\n $this->db->order_by('product.name');\n\n return $this->db->get()->result_array();\n }", "public function readProductos(){\n $sql='SELECT idProducto, foto, nombre, precio, cantidad, nombreProveedor, producto.estado from producto, proveedor where proveedor.idProveedor=producto.idProveedor and producto.estadoEliminacion= 1';\n $params=array(null);\n return Database::getRows($sql, $params);\n }" ]
[ "0.69840455", "0.6899192", "0.68462396", "0.6755407", "0.64861655", "0.64771706", "0.64566725", "0.64454293", "0.6435958", "0.64082193", "0.6389446", "0.63621557", "0.635936", "0.635936", "0.634835", "0.6339017", "0.6320012", "0.628246", "0.6265285", "0.626525", "0.6254374", "0.62366825", "0.6225268", "0.62247837", "0.6208329", "0.619911", "0.6184802", "0.61792856", "0.6178653", "0.6171265", "0.61643296", "0.6155627", "0.6142551", "0.61197567", "0.6114645", "0.6111113", "0.61034894", "0.6075774", "0.6075706", "0.60658514", "0.605182", "0.60493225", "0.6048306", "0.60442543", "0.6036445", "0.60337645", "0.60329086", "0.6021985", "0.6020952", "0.60170937", "0.60127157", "0.60109437", "0.6008372", "0.5998198", "0.5988714", "0.5982087", "0.5978525", "0.5976928", "0.5973948", "0.5971024", "0.59689814", "0.59655386", "0.59588414", "0.5956999", "0.595568", "0.5951686", "0.5948038", "0.5947058", "0.5928734", "0.5925842", "0.5923886", "0.59234923", "0.5913727", "0.5913457", "0.5911612", "0.5893751", "0.58919364", "0.5887702", "0.5887088", "0.58824", "0.58813107", "0.5878576", "0.5877549", "0.5876747", "0.58731663", "0.5867708", "0.5864685", "0.585272", "0.58512807", "0.5851021", "0.58285993", "0.5823415", "0.5817021", "0.5814997", "0.5814521", "0.5800758", "0.57958335", "0.57925045", "0.5791134", "0.57880867" ]
0.70282626
0
Specify Model class name
protected function model() { return 'App\Activity\Models\ActivityList'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getModelName()\n {\n if (isset($this->options[\"type\"])) {\n $type = ucfirst($this->options[\"type\"]);\n $class = \"\\\\app\\\\models\\\\feeds\\\\\" . $type;\n if (class_exists($class)) {\n return $class;\n }\n }\n \n return \"\\\\app\\\\models\\\\\" . $this->objectName;\n }", "public function getModelNameBasedOnClassName(): string\n {\n $fqn = explode(\"\\\\\", get_class($this));\n\n return strtolower(end($fqn));\n }", "public static function model($className=__CLASS__)\r\n\t{\r\n return parent::className();\r\n\t}", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n \treturn parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) \n { \n return parent::model($className); \n }", "public static function model($className=__CLASS__) \n { \n return parent::model($className); \n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model ($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n\treturn parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) \n\t{\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public function getModelClass(): string\n {\n return static::${'modelClass'};\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model ($className = __CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__){\n return parent::model($className);\n }", "public static function model($className = __CLASS__){\n return parent::model($className);\n }", "public function getModelClass();", "public function getModelClass();", "public function getModelClass();", "public static function model($className = __CLASS__) {\n return parent::model( $className );\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }" ]
[ "0.768929", "0.76618075", "0.7585344", "0.7583571", "0.7583571", "0.7542252", "0.75075734", "0.74778146", "0.74702877", "0.74578375", "0.74578375", "0.7453601", "0.7453601", "0.7447208", "0.7444998", "0.7435527", "0.74304074", "0.7416409", "0.74128395", "0.74125767", "0.74125767", "0.74125767", "0.741222", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.740793", "0.74018055", "0.7400949", "0.739494", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.7390499", "0.7390499", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7383603", "0.7379902", "0.7379902", "0.73766464", "0.73766464", "0.73766464", "0.73750174", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766" ]
0.0
-1
1 categoria tiene muchas habilidades.
public function habilidades() { return $this->hasMany('App\Models\Habilidad'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function HM_CategoCuentas()\n {\n }", "public function categoriaInactivos(){\n if($this->nolaboral->V21_M >= 1)\n {\n return 1;\n }\n if($this->nolaboral->V8_M == 1 && $this->nolaboral->V9_M == 1 && $this->nolaboral->V10_M == 1)\n {\n return 2;\n }\n if($this->caracteristicas->CH10 == 1 && $this->PP01E == 2)\n {\n return 3;\n }\n if($this->PP01E == 2)\n {\n return 4;\n }\n if($this->caracteristicas->CH06 < 6)\n {\n return 5;\n }\n if($this->discapacidad())\n {\n return 6;\n }\n\n}", "function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "public function getHistoryCategoryAttribute()\n {\n if ($this->histories->count() == 0) {\n return 'rendah';\n }\n\n if ($this->histories->count() == 1) {\n return 'sedang';\n }\n\n if ($this->histories->count() >= 2) {\n return 'tinggi';\n }\n }", "public function categoriaOcupacional()\n {\n if ($this->PP05A==1 && $this->PP05D==1){\n return 1;\n }\n if ($this->PP05A==1 && ($this->PP05D==2 || $this->PP05D==3)){\n return 2;\n }\n if ($this->PP05A==3){\n return 3;\n }\n if ($this->PP05A==2 && $this->PP05B==2 && $this->PP05B1==3){\n return 4;\n }\n // #Ns./Nr.\n // (me parece que es si no se completa: pp05a=null)\n }", "public function adicionarCategoria($categoria, $habilitado){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT count(*) as total from tbcategorias where nome='$categoria' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n\n if ($row['total'] == 1) {\n return 0;\n }elseif(empty($categoria) || $habilitado==\"ND\") {\n return 2;\n }else{\n $sql = \"INSERT INTO tbcategorias (nome, habilitado) VALUES ('$categoria','$habilitado')\";\n\n return $this->conexao->query($sql);\n\n \n }\n\n }", "function defineCategoriaCompetidor(string $nome, string $idade) : ?string\n{\n $categorias = ['infantil', 'adulto', 'adolescente' ];\n\n if (validaNome($nome) && validaIdade($idade))\n {\n removerMensagemErro();\n if ($idade >= 0 && $idade <= 12)\n {\n foreach ($categorias as $keys => $value)\n {\n if($value == 'infantil')\n {\n setarMensagemSucesso('O nadador '.$nome.' pertence a categoria '.$value);\n return null;\n }\n }\n }\n elseif ($idade >= 13 && $idade <= 17)\n {\n foreach ($categorias as $keys => $value)\n {\n if ($value == 'adolescente')\n {\n setarMensagemSucesso('O nadador '.$nome.' pertence a categoria '.$value);\n return null;\n }\n }\n }\n else\n {\n foreach ($categorias as $keys => $value)\n {\n if ($value == 'adulto')\n {\n setarMensagemSucesso('O nadador '.$nome.' pertence a categoria '.$value);\n return null;\n }\n }\n }\n\n }\n removerMensagemSucesso();\n return obterMensagemErro();\n}", "function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function getCategorizedTables() {}", "function categorianivel($padre)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM pages WHERE name!='' AND padre = %s\",\n\tGetSQLValueString($padre, \"int\"));\n\t\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\n\tif ($totalRows_ConsultaFuncion > 0) {\n\t\tdo {\n\t\t\t?> \n\t\t<div class=\"sub_cat\">\n\t\t\t<ul>\n\t\t\t\t<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $row_ConsultaFuncion['name']?></li>\n\t\t\t</ul>\n\t\t</div>\n\t<?php\n\t\t} while ($row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion));\n\t}\n\t\t \n\tmysqli_free_result($ConsultaFuncion);\n}", "public function countCath()\n\t{\n \t\treturn $this->findAll('kategoria')->count('*');\n\t}", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "public function getCategoria()\n {\n return \"Cliente com alta credibilidade\";\n }", "function kategoriberatbadan($g, $bb, $tb){\n\tif($g == \"Wanita\"){\n\t\tif(bmi($bb,$tb) < 18 ){\n\t\t\t$ket = \"Under Weight / Kurus dan saran dari kami sebaiknya mulai menambah berat badan dan mengkonsumsi makanan berkarbohidrat di imbangi dengan olah raga.\";\n\t\t}elseif (bmi($bb,$tb) >=18 && bmi($bb,$tb) <=25) {\n\t\t\t$ket = \"Normal Weight / Normal dan berat badan anda termasuk kategori ideal.\";\n\t\t}elseif (bmi($bb,$tb) > 25 && bmi($bb,$tb) <=27) {\n\t\t\t$ket = \"Over Weight / Kegemukan dan anda sudah masuk kategori gemuk. Saran dari kami sebaiknya hindari makanan berlemak dan mulailah meningkatkan olahraga seminggu minimal 2 kali.\";\n\t\t}elseif (bmi($bb,$tb) > 27) {\n\t\t\t$ket= \"Obesitas dan saran dari kami sebaiknya segera membuat program menurunkan berat badan karena anda termasuk kategori obesitas/ terlalu gemuk dan tidak baik bagi kesehatan.\";\n\t\t}\n\t}elseif ($g == \"Pria\") {\n\t\tif(bmi($bb,$tb) < 17 ){\n\t\t\t$ket = \"Under Weight / Kurus dan saran dari kami tambah konsumsi makanan berkalori.\";\n\t\t}elseif (bmi($bb,$tb) >= 17 && bmi($bb,$tb) <=23) {\n\t\t\t$ket = \"Normal Weight / Normal dan selamat berat badan anda termasuk ideal.\";\n\t\t}elseif (bmi($bb,$tb) > 23 && bmi($bb,$tb) <=27) {\n\t\t\t$ket = \"Over Weight / Kegemukan dan harus waspada.\";\n\t\t}elseif (bmi($bb,$tb) > 27) {\n\t\t\t$ket = \"Obesitas dan saran dari kami sebaiknya memulai program menurunkan berat badan agar lebih ideal.\";\n\t\t}\n\t}\nreturn $ket;\n}", "public function cargarcategoria()\n {\n \treturn Cont_Categoria::whereRaw(\" jerarquia ~ '*{1}' \")\n \t\t\t\t\t\t\t->orderBy('jerarquia', 'asc')\n \t\t\t\t\t\t\t->get();\n \t;\t\n }", "public function getCategoria()\n {\n return $this->categoria;\n }", "function getImagensCategoria($limite, $categoria){\n #De modo que: Selecione N marcações (numero de marcacoes = $limit)\n #As marcações serão referentes as categorias ou subcategorias selecionadas (categorias = $categorias, subcategorias = $subcategorias)\n\n $this->db->select('*');\n $this->db->from('Tbdimagem');\n $this->db->join('imagem_categoria', 'Tbdimagem.idImagem = imagem_categoria.idImagem');\n $this->db->where('imagem_categoria.idCategoria', $categoria);\n $this->db->order_by('rand()');\n $this->db->limit($limite);\n\n $query = $this->db->get();\n\n return $query->result_array();\n }", "public function getCategoria()\n {\n return $this->categoria;\n }", "public function getCategoria()\n {\n return $this->categoria;\n }", "public function get_categoria() {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"SELECT * FROM tm_categoria WHERE est=1\";\n $sql=$conectar->prepare($sql);\n $sql->execute();\n // IMPORTANTE AGREGARLE EL PDO::FETCH_ASSOC PARA QUE HAGA BIEN LA CONSULTA\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n\n }", "public function verCategoria(){\n\t\t\t$array[] = array(\"id\"=>\"A00-B99\",\"name\"=>\"Ciertas enfermedades infecciosas y parasitarias\");\n\t\t\t$array[] = array(\"id\"=>\"C00-D48\",\"name\"=>\"Neoplasias\");\n\t\t\t$array[] = array(\"id\"=>\"D50-D89\",\"name\"=>\"Enfermedades de la sangre y de los órganos hematopoyéticos y otros trastornos que afectan el mecanismo de la inmunidad\");\n\t\t\t$array[] = array(\"id\"=>\"E00-E90\",\"name\"=>\"Enfermedades endocrinas, nutricionales y metabólicas\");\n\t\t\t$array[] = array(\"id\"=>\"F00-F99\",\"name\"=>\"Trastornos mentales y del comportamiento\");\n\t\t\t$array[] = array(\"id\"=>\"G00-G99\",\"name\"=>\"Enfermedades del sistema nervioso\");\n\t\t\t$array[] = array(\"id\"=>\"H00-H59\",\"name\"=>\"Enfermedades del ojo y sus anexos\");\n\t\t\t$array[] = array(\"id\"=>\"H60-H95\",\"name\"=>\"Enfermedades del oído y de la apófisis mastoides\");\n\t\t\t$array[] = array(\"id\"=>\"I00-I99\",\"name\"=>\"Enfermedades del sistema circulatorio\");\n\t\t\treturn $array;\n\t\t\t/*\n\t\t\t$array=array(\n\t\t\t\t'CATEGORIA_ID'=>$categoria_id\n\t\t\t\t);\n\n\t\t\t$consult= oci_parse($conn,\"BEGIN Ips$_sndCitas.Ver_subcie10 END \");\n\t\t\t// $consult= oci_parse($conn,\"SELECT * FROM SUBCATEGORIA_CIE10\");\n\t\t\toci_execute($consult);\n\t\t\t*/\n\t\t}", "public function get_tipo_cat()\n { \n \n \n $this->db->select(\"distinct(cve_tipo_categoria), nom_tipo_cat\");\n\n $this->db->order_by('nom_tipo_cat','asc');\n $query = $this->db->get('ccategoria');\n \n $data_cat=0;\n $data_cat = array();\n foreach ($query->result_array() as $row)\n {\n \n $data_cat[$row['cve_tipo_categoria']] = $row['nom_tipo_cat']; \n }\n $query->free_result();\n\n return $data_cat; \n\n }", "function get_dataset_definitions_category($form) {\n global $CFG, $DB;\n $datasetdefs = array();\n $lnamemax = 30;\n if (!empty($form->category)) {\n $sql = \"SELECT i.*,d.*\n FROM {question_datasets} d,\n {question_dataset_definitions} i\n WHERE i.id = d.datasetdefinition\n AND i.category = ?\n ;\n \";\n if ($records = $DB->get_records_sql($sql, array($form->category))) {\n foreach ($records as $r) {\n if ( !isset ($datasetdefs[\"$r->name\"])) $datasetdefs[\"$r->name\"] = $r->itemcount;\n }\n }\n }\n return $datasetdefs ;\n }", "function getCodigoCategoria()\n {\n return $this->CodigoCategoria;\n }", "public function consultarCategoria(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT * from tbcategorias order by idcategoria; \";\n $sql = $this->conexao->query($sql);\n\n $dados = array();\n\n while ($row = $sql->fetch_assoc()) { \n $dado = array();\n $dado['idcategoria'] = $row[\"idcategoria\"];\n $dado['nome'] = $row[\"nome\"];\n $dado['habilitado'] = $row[\"habilitado\"];\n $dados[] = $dado;\n }\n\n return $dados;\n\n \n }", "public static function categories() {\n\t\t// can take a long time\n\t\tset_time_limit(0);\n\n\t\t// select all uncategorized monuments\n\t\t$monuments = ORM::factory('monument')->where('id_category','is',null)->or_where('id_category','=',12)->find_all();\n\t\t$i = 0;\n\t\tforeach($monuments as $monument) {\n\n\t\t\t$category = $monument->extractCategory();\n\n\t\t\t// save the extracted category to the database\n\t\t\t$monument->id_category = $category;\n\t\t\t$monument->category_extracted = 1;\n\t\t\tif($category > 0) {\n\t\t\t\t$i++;\n\t\t\t\t$monument->save();\n\t\t\t}\n\t\t}\n\n\t\treturn $i;\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "public function getCategoria()\n {\n return \"Cliente com Risco\";\n }", "private function categoriesMoreThanOne()\n {\n\n // RETURN : method is called twice at least\n if ( $this->boolMoreThanOneCategory != null )\n {\n return $this->boolMoreThanOneCategory;\n }\n // RETURN : method is called twice at least\n\n $categories = $this->categoriesGet();\n\n if ( count( $categories[ 'labels' ] ) > 1 )\n {\n $this->boolMoreThanOneCategory = true;\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'There is more than one category.';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n else\n {\n $this->boolMoreThanOneCategory = false;\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'There isn\\'t more than one category.';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n return $this->boolMoreThanOneCategory;\n }", "function makeCategory($ar_kat)\r\n\t{\r\n\t\tforeach($ar_kat as $val)\r\n\t\t{\r\n\t\t\t$this->trainNewCategory($val, $val);\r\n\t\t}\r\n\t\t\r\n\t\t/*isi word probability*/\r\n\t\tforeach($ar_kat as $val) //untuk setiap kategori\r\n\t\t{\r\n\t\t\tforeach ($this->arr_wc[$val]->vocab as $key => $row)\r\n\t\t\t{\r\n\t\t\t\t$prob = (1 + $row) / ($this->ctgrmgr->listCategory[$val]->jumWordInCategory + $this->arr_wc[$val]->jumVocab);\r\n\t\t\t\t//echo \"$row \";\r\n\t\t\t\t$this->ctgrmgr->listCategory[$val]->addWordProb($key, $prob);\r\n\t\t\t}\r\n\t\t\tif ($this->debug)\r\n\t\t\t{\r\n\t\t\t\techo \"<br/>\";\r\n\t\t\t\techo \"jum in category : \"; echo $this->ctgrmgr->listCategory[$val]->jumWordInCategory; echo \"<br/>\";\r\n\t\t\t\techo \"jum vocab : \"; echo $this->arr_wc[$val]->jumVocab; echo \"<br/>\";\r\n\t\t\t\techo \"get cat prob $val : \"; echo $this->ctgrmgr->getCatProb($val); echo \"<br/>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->serializeCat();\r\n\t}", "public function getCategoria_id()\n {\n return $this->categoria_id;\n }", "public function getCategory() {}", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "protected function fijarTabla(){\n \n return \"categorias\";\n \n }", "function my_separate_category() {\n return 1;\n }", "private function categoriesGet()\n {\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n//var_dump(__METHOD__, __LINE__, array_keys( $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'points.' ]));\n // RETURN : method is called twice at least\n if ( $this->arrCategories != null )\n {\n return $this->arrCategories;\n }\n // RETURN : method is called twice at least\n // Local array for category labels\n $catLabels = null;\n // Local array for category icons\n $catIcons = null;\n // #54548, 131221, dwildt, 2+\n // Local array for category label css classes\n $catCss = null;\n\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n // Get the field name of the field with the category label\n $fieldForLabel = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'category' ];\n // Get the field name of the field with the category icon\n $fieldForIcon = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n // Get the field name of the field with the category label\n $fieldForLabel = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryTitle' ];\n // #54548, 131221, dwildt, 4+\n // Get the field name of the field with the category label class for a marker category\n $fieldForCssMarker = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryCssMarker' ];\n // Get the field name of the field with the category label class for a path category\n $fieldForCssPath = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryCssPath' ];\n // Get the field name of the field with the category icon\n $fieldForIcon = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Get categories from the rows\n $categoryLabels = array();\n\n // FOREACH row\n foreach ( $this->pObj->rows as $row )\n {\n // RETURN : field for category label is missing\n // 130530, dwildt\n switch ( true )\n {\n case(!$fieldForLabel ):\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'table.field with the category is empty';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n $prompt = 'Please use the TypoScript Constant Editor and maintain map.marker.field.category ';\n t3lib_div :: devLog( '[HELP/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 1 );\n }\n // DRS\n //var_dump(__METHOD__, __LINE__, $fieldForLabel);\n $this->arrCategories = array();\n return $this->arrCategories;\n // #47602, 130911, dwildt, 1+\n case(!array_key_exists( $fieldForLabel, $row ) ):\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'current rows doesn\\'t contain the field \"' . $fieldForLabel . '\"';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS\n //var_dump(__METHOD__, __LINE__, $fieldForLabel, array_keys($row), $this->categoriesGetWoLatLon( $row ) );\n // #i0196, 151022, dwildt, 6+\n if ( $this->categoriesGetWoLatLon( $row ) )\n {\n $this->arrCategories = array();\n return $this->arrCategories;\n }\n $row[ $fieldForLabel ] = '';\n break;\n // #i0196, 151022, dwildt, 6+/2-\n //$this->arrCategories = array();\n //return $this->arrCategories;\n // #i0076, 140721, dwildt, +\n case($this->categoriesGetWoLatLon( $row ) ):\n continue 2;\n default:\n // follow the workflow\n }\n // RETURN : field for category label is missing\n // 4.1.7, dwildt, 1-\n //$categoryLabels = array_merge( $categoryLabels, explode( $this->catDevider, $row[ $fieldForLabel ] ) );\n // 4.1.7, dwildt, 10+\n//var_dump( __METHOD__, __LINE__, $this->catDevider, $fieldForLabel, $row[ $fieldForLabel ]);\n//die();\n $catLabelsOfCurrRow = explode( $this->catDevider, $row[ $fieldForLabel ] );\n foreach ( $catLabelsOfCurrRow as $labelKey => $labelValue )\n {\n // #47602, 130911, dwildt, 4+\n if ( empty( $labelValue ) )\n {\n $labelValue = $this->pObj->pi_getLL( 'phrase_noMapCat' );\n // #i0062, 140714, 1+\n $this->arrWoCategories[ 'rows' ][] = $row[ $this->pObj->arrLocalTable[ 'uid' ] ];\n }\n $categoryLabels[] = $labelValue;\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $catIconsOfCurrRow = explode( $this->catDevider, $row[ $fieldForIcon ] );\n $categoryIcons[ $labelValue ] = $catIconsOfCurrRow[ $labelKey ];\n }\n // #54548, 131221, dwildt, 13+\n switch ( true )\n {\n case( isset( $row[ $fieldForCssMarker ] ) ):\n $catCssOfCurrRow = explode( $this->catDevider, $row[ $fieldForCssMarker ] );\n $categoryCss[ $labelValue ] = $catCssOfCurrRow[ $labelKey ];\n break;\n case( isset( $row[ $fieldForCssPath ] ) ):\n $catCssOfCurrRow = explode( $this->catDevider, $row[ $fieldForCssPath ] );\n $categoryCss[ $labelValue ] = $catCssOfCurrRow[ $labelKey ];\n break;\n default;\n break;\n }\n }\n // 4.1.7, dwildt, 10+\n }\n // FOREACH row\n // Get categories from the rows\n // #i0120, 150101, dwildt: 4+\n if ( $this->categoriesEmpty( $categoryLabels ) )\n {\n return false;\n }\n // Remove non unique category labels\n $categoryLabels = array_unique( $categoryLabels );\n//var_dump (__METHOD__, __LINE__, $categoryLabels);\n//var_dump(__METHOD__, __LINE__);\n // Order the category labels\n $orderBy = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'orderBy' ];\n switch ( $orderBy )\n {\n case( 'SORT_REGULAR' ):\n sort( $categoryLabels, SORT_REGULAR );\n break;\n case( 'SORT_NUMERIC' ):\n sort( $categoryLabels, SORT_NUMERIC );\n break;\n case( 'SORT_STRING' ):\n sort( $categoryLabels, SORT_STRING );\n break;\n case( 'SORT_LOCALE_STRING' ):\n sort( $categoryLabels, SORT_LOCALE_STRING );\n break;\n default:\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'configuration.categories.orderBy has an unproper value: \"' . $orderBy . '\"';\n t3lib_div :: devLog( '[ERROR/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 3 );\n $prompt = 'categories will ordered by SORT_REGULAR!';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n sort( $categoryLabels, SORT_REGULAR );\n break;\n }\n // Order the category labels\n // Set the keys: keys should correspond with keys of the item colours\n $maxItem = count( $categoryLabels );\n $counter = 0;\n//var_dump(__METHOD__, __LINE__);\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n foreach ( array_keys( $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'points.' ] ) as $catKey )\n {\n if ( substr( $catKey, -1 ) == '.' )\n {\n continue;\n }\n $catLabels[ $catKey ] = $categoryLabels[ $counter ];\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $catIcons[ $catKey ] = $categoryIcons[ $categoryLabels[ $counter ] ];\n }\n\n // #i0062, 140714, 4+\n if ( $catLabels[ $catKey ] == $this->pObj->pi_getLL( 'phrase_noMapCat' ) )\n {\n $this->arrWoCategories[ 'iconKey' ] = $catKey;\n }\n // #54548, 131221, dwildt, 9+\n switch ( true )\n {\n case( isset( $row[ $fieldForCssMarker ] ) ):\n case( isset( $row[ $fieldForCssPath ] ) ):\n $catCss[ $catKey ] = $categoryCss[ $categoryLabels[ $counter ] ];\n break;\n default;\n break;\n }\n $counter++;\n if ( $counter >= $maxItem )\n {\n break;\n }\n }\n // Set the keys: keys should correspond with keys of the item colours\n\n $this->arrCategories[ 'labels' ] = $catLabels;\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $this->arrCategories[ 'icons' ] = $catIcons;\n }\n // #54548, 131221, dwildt, 8+\n if ( !empty( $catCss ) )\n {\n $this->arrCategories[ 'cssClass' ] = $catCss;\n }\n//var_dump(__METHOD__, __LINE__);\n\n return $this->arrCategories;\n }", "function categoria($productos) {\r\n $opciones = array(); \r\n foreach($productos->producto as $producto) {\r\n $opciones[] = $producto->categoria;\r\n }\r\n //eliminar los duplicados para mostrar el select con las opciones\r\n $opciones = array_unique($opciones);\r\n\r\n //crear las opciones del select sin repetidos\r\n for ($i=0; $i < count($opciones); $i++) { \r\n echo \"<option value='\" . $opciones[$i] . \"'>\" . ucwords($opciones[$i]) . \"</option>\";\r\n }\r\n }", "public function getIddefCategoria()\n {\n return $this->hasOne(DefCategoria::className(), ['iddef_categoria' => 'iddef_categoria']);\n }", "public function getCategoryImage($categoryId)\n {\n //$AccentOpaque = array(\"15\",\"50\",\"51\",\"52\",\"57\");\n //$Williamsburg = array(\"26\",\"86\",\"87\",\"88\",\"93\"); \n //$Carolina = array(\"23\",\"59\",\"66\",\"274\"); \n //$Springhill = array(\"25\",\"77\",\"78\",\"79\",\"84\");\n\t $AccentOpaque = array(\"57\");\n\t\t$Hammermill = array(\"246\");\n\t\t$Williamsburg = array(\"93\"); \n\t\t$Carolina = array(\"66\"); \n\t\t$Springhill = array(\"84\");\n\t\t//$PPAllBrands = array(\"209\");\n\t\t$Envelope = array(\"131\");\n\t\t$Forms = array(\"262\", \"263\", \"264\", \"265\", \"266\", \"267\", \"269\", \"270\", \"271\");\n\t\t$Bristols = array(\"233\", \"234\", \"235\", \"236\", \"237\", \"238\", \"239\", \"240\", \"241\");\n\t\t$Specialty = array(\"152\");\n\t\t$HotCupsLids = array(\"182\", \"178\", \"179\", \"183\", \"181\", \"220\", \"228\", \"229\", \"230\");\n\t\t$ColdCupsLids = array(\"158\", \"154\", \"275\", \"276\", \"277\");\n\t\t$FoodPackaging = array(\"213\", \"172\", \"212\", \"221\", \"222\", \"223\", \"214\", \"278\");\n \n //For category logo\n if(in_array($categoryId, $AccentOpaque)){\n //$catImgLogo = \"logo-accentopaque.jpg\";\n $catImgLogo = \"Accent Opaque\";\n }\n\t\t else if(in_array($categoryId, $Hammermill)){\n $catImgLogo = \"Hammermill\";\n }\n else if(in_array($categoryId, $Williamsburg)){\n $catImgLogo = \"Williamsburg\";\n }\n else if(in_array($categoryId, $Carolina)){\n $catImgLogo = \"Carolina\";\n }\n else if(in_array($categoryId, $Springhill)){\n $catImgLogo = \"Springhill\";\n }\n\t\t else if(in_array($categoryId, $Envelope)){\n $catImgLogo = \"Envelope\";\n }\n\t\t else if(in_array($categoryId, $Forms)){\n $catImgLogo = \"Forms\";\n }\n\t\t else if(in_array($categoryId, $Bristols)){\n $catImgLogo = \"Bristols\";\n }\n\t\t else if(in_array($categoryId, $Specialty)){\n $catImgLogo = \"Specialty\";\n }\n\t\t else if(in_array($categoryId, $HotCupsLids)){\n $catImgLogo = \"Hot Cups and Lids\";\n }\n\t\t else if(in_array($categoryId, $ColdCupsLids)){\n $catImgLogo = \"Cold Cups and Lids\";\n }\n\t\t else if(in_array($categoryId, $FoodPackaging)){\n $catImgLogo = \"Food Packaging\";\n }\n return $catImgLogo;\n }", "public function getCategoriesGroup() {\n\t\t$imageTypes = $this->getImagesTypes();\n\t\t$categories = $this->getCollection()\n\t\t\t\t->addFieldToFilter('status',1);\n\t\t$arrayOptions = array();\n\t\t$i = 1;\n\t\tforeach($imageTypes as $key => $imageType)\n\t\t{\n\t\t\tif($key == 'uncategorized')\n\t\t\t{\n\t\t\t\t$arrayOptions[0] = 'Uncategorized';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$arrayValue = array();\n\t\t\tforeach($categories as $category)\n\t\t\t{\n\t\t\t\tif($category->getImageTypes() == $key)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$arrayValue[] = array('value'=>$category->getId(),'label'=>$category->getTitle());\n\t\t\t\t}\n\t\t\t}\n\t\t\t$arrayOptions[$i]['value'] = $arrayValue;\n\t\t\t$arrayOptions[$i]['label'] = $imageType;\n\t\t\t$i++;\n\t\t}\n\t\treturn $arrayOptions;\n\t}", "public function getIdKategoria() {\n return $this->idKategoria;\n }", "function tradeoff_categorical_range($definition)\n {\n return app(Models\\Problem\\Range\\CategoricalRange::class)->setData($definition);\n }", "public function get_category()\n\t{\n\t\tglobal $module_name, $nv_Cache;\n\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id', $module_name );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}", "protected function fijarId(){\n return \"cod_categoria\";\n }", "public function getCategorie()\n {\n return $this->categorie;\n }", "public function getCategoria()\n {\n return \"Cliente padrão\";\n }", "public function getIdCategorie(): int\n {\n return $this->id_categorie;\n }", "public function categorias()\n {\n //$categorias = Categoria::get();\n $categorias = Categoria::with(['atractivos','fotos'])->get();\n //$categorias = $categorias->load('cat_atractivos','cat_fotos');\n //$atractivos = Atractivo::all();\n $response = Response::json($categorias,200);\n //return [\"results\" =>[$response]];\n return $response;\n //return Response::json(['results' => $atractivos],200);\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['general'];\n }", "public function get_categories()\n {\n return ['general'];\n }", "public function getCategorias() {\n $categorias=$this->db->query('SELECT * FROM categorias ORDER BY id DESC;');\n return $categorias;\n }", "public function getIdCategoria()\n {\n return $this->id_categoria;\n }", "public function getIdCategoria()\n {\n return $this->id_categoria;\n }", "function afficherCategories2(){\n\t\t$sql=\"SElECT nom From categorie\";\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}", "public function totalCategoria()\n {\n return $this->totalCentral() + $this->totalSeccional();\n }", "public function getCategory();", "public function getCategory();", "function __construct()\n {\n $this->productGroupsToCategories = Array(\n 1 => 1, // Power kits => Systems\n 2 => 3, // Solar lanterns => Light\n 14 => 1, // SHS 12V => Systems\n 16 => 3, // LED => Light\n 17 => 2, // Fans => Appliances\n 18 => 2, // Fridges => Appliances\n 19 => 2, // Pumps => Appliances\n 24 => 2, // Various appliances => Appliances\n 20 => 2, // Radios => Appliances\n 21 => 2, // TV => Appliances\n 25 => 0, // PAYG (component) => n/a\n 26 => 1, // SHS <12V => Systems\n );\n\n /*\n * Productsubgroups => Options\n */\n $this->productSubGroupsToOptions = Array(\n 14 => 23, // 21Wp - 50Wp =>\n 15 => 23, // 1Wp - 20Wp =>\n 16 => 24, // 51Wp -100Wp =>\n 17 => 36, // Table =>\n 18 => 37, // Ceiling =>\n 19 => 79, // < 1W =>\n 20 => 80, // 1W =>\n 21 => 81, // 2W =>\n 22 => 82, // 3W =>\n 23 => 83, // 4W =>\n 24 => 84, // 5W =>\n 25 => 85, // > 5W =>\n 26 => 44, // up to 20'' =>\n 27 => 45, // > 20'' =>\n //28 => 0, // Cloth dryers =>\n 29 => 58, // Egg incubators =>\n 30 => 59, // Electric fences =>\n 31 => 60, // Hand drills =>\n 32 => 61, // Kettles =>\n 33 => 62, // Sewing machines =>\n //34 => 0, // Spinning wheels =>\n 35 => 63, // Washing machines =>\n 36 => 25, // > 100Wp =>\n 37 => 35, // Stand =>\n 38 => 41, // Surface =>\n 39 => 40, // Submersible =>\n 40 => 46, // Portable =>\n\n 41 => 57, // Iron =>\n 42 => 56, // Hair dryer =>\n 43 => 55, // Mosquito repellent =>\n 44 => 54, // Cooker/Stove =>\n\n 45 => 2, // <12V =>\n 46 => 3, // 12V =>\n 47 => 4, // 24V =>\n 48 => 5, // 48V =>\n\n 49 => 53, // Refrigerators/Freezers =>\n 50 => 50, // Medical Fridges/Freezers =>\n 51 => 51, // Mobile/Portable =>\n 52 => 52, // Refrigerators =>\n 53 => 49, // Freezers =>\n );\n }", "public function run()\n {\n $categories = [\"legendize\",\"legendized\",\"legendizes\",\"legendizing\",\"legendries\",\"legendry\",\"legends\",\"leger\",\"legerdemain\",\"legerdemainist\",\"legerdemainists\",\"legerdemains\",\"legering\",\"legerings\",\"legerities\",\"legerity\",\"legers\",\"leges\",\"legge\",\"legged\",\"legger\",\"leggers\",\"legges\",\"leggie\",\"leggier\",\"leggiero\",\"leggies\",\"leggiest\",\"leggin\",\"legginess\",\"legginesses\",\"legging\",\"legginged\",\"leggings\",\"leggins\",\"leggism\",\"leggisms\",\"leggy\",\"leghorn\",\"leghorns\",\"legibilities\",\"legibility\",\"legible\",\"legibleness\",\"legiblenesses\",\"legibly\",\"legion\",\"legionaries\",\"legionary\",\"legioned\",\"legionella\",\"legionellae\",\"legionellas\",\"legionnaire\",\"legionnaires\",\"legions\",\"legislate\",\"legislated\",\"legislates\",\"legislating\",\"legislation\",\"legislations\",\"legislative\",\"legislatively\",\"legislatives\",\"legislator\",\"legislatorial\",\"legislators\",\"legislatorship\",\"legislatorships\",\"legislatress\",\"legislatresses\",\"legislature\",\"legislatures\",\"legist\",\"legists\",\"legit\",\"legitim\",\"legitimacies\",\"legitimacy\",\"legitimate\",\"legitimated\",\"legitimately\",\"legitimateness\",\"legitimates\",\"legitimating\",\"legitimation\",\"legitimations\",\"legitimatise\",\"legitimatised\",\"legitimatises\",\"legitimatising\",\"legitimatize\",\"legitimatized\",\"legitimatizes\",\"legitimatizing\",\"legitimator\",\"legitimators\",\"legitimisation\",\"legitimisations\",\"legitimise\",\"legitimised\",\"legitimiser\",\"legitimisers\",\"legitimises\",\"legitimising\",\"legitimism\",\"legitimisms\",\"legitimist\",\"legitimistic\",\"legitimists\",\"legitimization\",\"legitimizations\",\"legitimize\",\"legitimized\",\"legitimizer\",\"legitimizers\",\"legitimizes\",\"legitimizing\",\"legitims\",\"legits\",\"leglan\",\"leglans\",\"leglen\",\"leglens\",\"legless\",\"leglessness\",\"leglessnesses\",\"leglet\",\"leglets\",\"leglike\",\"leglin\",\"leglins\",\"legman\",\"legmen\",\"legong\",\"legongs\",\"legroom\",\"legrooms\",\"legs\",\"legside\",\"legsides\",\"leguaan\",\"leguaans\",\"leguan\",\"leguans\",\"legume\",\"legumes\",\"legumin\",\"leguminous\",\"legumins\",\"legwarmer\",\"legwarmers\",\"legwear\",\"legwears\",\"legwork\",\"legworks\",\"lehaim\",\"lehaims\",\"lehayim\",\"lehayims\",\"lehr\",\"lehrjahre\",\"lehrs\",\"lehua\",\"lehuas\",\"lei\",\"leidger\",\"leidgers\",\"leiger\",\"leigers\",\"leiomyoma\",\"leiomyomas\",\"leiomyomata\",\"leiotrichies\",\"leiotrichous\",\"leiotrichy\",\"leipoa\",\"leipoas\",\"leir\",\"leired\",\"leiring\",\"leirs\",\"leis\",\"leish\",\"leisher\",\"leishest\",\"leishmania\",\"leishmaniae\",\"leishmanial\",\"leishmanias\",\"leishmaniases\",\"leishmaniasis\",\"leishmanioses\",\"leishmaniosis\",\"leisler\",\"leislers\",\"leister\",\"leistered\",\"leistering\",\"leisters\",\"leisurable\",\"leisurably\",\"leisure\",\"leisured\",\"leisureliness\",\"leisurelinesses\",\"leisurely\",\"leisures\",\"leisuring\",\"leitmotif\",\"leitmotifs\",\"leitmotiv\",\"leitmotivs\",\"lek\",\"leke\",\"lekgotla\",\"lekgotlas\",\"lekked\",\"lekker\",\"lekking\",\"lekkings\",\"leks\",\"leku\",\"lekvar\",\"lekvars\",\"lekythi\",\"lekythoi\",\"lekythos\",\"lekythus\",\"leman\",\"lemans\",\"leme\",\"lemed\"];\n for ($i=0; $i < count($categories); $i++) {\n Category::create([\n 'name' => $categories[$i],\n ]);\n }\n }", "public function __construct($id,$createNewIfComplete=false,$specificReport=0){\r\n\t\t$this->categories=array(\r\n //'demographics'=>array('first_name','last_name','address1','address2','city','state','zipcode','email','dob','gender','race','marital_status','education','vision','hearing','language'),\r\n 'demographics'=>array(), \t\r\n \t'current_health_status'=>array('q4','q5_0','q5_1','q5_2','q5_3','q5_4','q5_5','q5_6','q5_7','q5_8','q5_9','q5_10','q5_11','q5_12','q5_13','q5_14','q5_15','q7','q9'),\r\n \t'family_health'=>array('q10_1','q10_2','q10_3','q10_4','q10_5','q10_6'),\r\n \t'preventative_health'=>array('q8','q11','q12','q13','q14','q15','q16','q17','q18','q19','q20'),\r\n \t'weight_nutrition'=>array('q21','q22','q23_1','q23_2','q23_3','q23_4','q23_5','q23_6','q23_7','q23_8', 'qn24', 'qn25'),\r\n \t'physical_activity'=>array('q24','q25','q26'),\r\n \t'stress_management'=>array('q27','q28','q29','q30','q31','q32','q33'),\r\n \t'mental_health'=>array('q38_1','q38_2','q38_3','q38_4','q38_5','q38_6','q38_7','q38_8'),\r\n\t\t\t'alcohol_use' => array('q39', 'q40'),\r\n \t'self_care'=>array('q41','q42','q42a', 'q43'),\r\n \t'tobaco_use'=>array('q44','q45','q46','q47'),\r\n \t'readiness_to_change'=>array('q48_1','q48_2','q48_3','q48_4','q48_5','q48_6','q48_7'),\r\n \t'wlq'=>array('wlq1a', 'wlq1b','wlq2a','wlq2b','wlq3','wlq4'),\r\n \t'biometric_data'=>array('height','weight','bp_systolic','bp_diastolic','body_fat','bmi','waist','blood_glucose','glucose_test','hemoglobin','cotinine','cholesterol','triglycerides','hdl','ldl'),\r\n \t);\r\n\r\n//\r\n//Database table columns that are free due to changes from client\r\n//\tq6, q34_1, q34_2, q35, q36, q37_1, q37_2\r\n//\r\n\r\n\t\t//Number of questions in each category.\r\n\t\t$this->nq = array ('demographics' => 3,\r\n\t\t 'current_health_status' => 4,\r\n\t\t 'family_health' => 1,\r\n\t\t 'preventative_health_M' => 7,\r\n\t\t 'preventative_health_F' => 8,\r\n\t\t 'weight_nutrition' => 5,\r\n\t\t 'physical_activity' => 3,\r\n\t\t 'stress_management' => 7,\r\n\t\t 'mental_health' => 1,\r\n\t\t 'alcohol_use' => 2,\r\n\t\t 'self_care' => 4,\r\n\t\t 'tobaco_use' => 4,\r\n\t\t 'readiness_to_change' => 1,\r\n\t\t 'wlq' => 4,\r\n\t\t 'biometric_data' => 12);\r\n\r\n\t\tforeach($this->categories as $cat=>$val){\r\n\t\t\t$this->data[$cat]=array();\r\n\t\t}\r\n\r\n\t\t$cred=UserCredentials::load();\r\n\t\t$this->acceptUpdates=$id==$cred->getId();\r\n\r\n\t\t$this->dbOb=Database::create();\r\n\t\t$this->retrieve($id,$createNewIfComplete,$specificReport);\r\n\t\t$this->vc= new Validator();\r\n\r\n\t\t$sql=\"SELECT is_gina,is_wlq FROM u_profile \r\n \t\t JOIN p_company on u_profile.company_id=p_company.id \r\n \t\t WHERE z_user_id='\".$this->dbOb->escape_string($id).\"'\"; \t\r\n\t\t$r=$this->dbOb->getRow($sql);\r\n\t\t$this->gina=$r['is_gina']==1;\r\n\t\t$this->wlq=$r['is_wlq']==1;\r\n\t}", "public function categoria()\n {\n\n $categoria = Categoria::all();\n $inmueble = Inmueble::all();\n // return $categoria;\n // return $inmueble;\n return view('reporte.categoria', compact('categoria', 'inmueble'));\n }", "public function get_categories() {\n return [ 'Alita-elements' ];\n }", "public function get_categories() {\n return [ 'Alita-elements' ];\n }", "public function category() {\n\t\treturn static::get_thrive_advanced_label();\n\t}", "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}", "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}", "public static function getCategoriaLista() {\n $dni=Yii::$app->user->identity->id;\n $droptions = Categoria::find()->where(['id_profesor_titular'=>$dni])->orWhere(['id_profesor_titular'=>$dni])->asArray()->all();\n return ArrayHelper::map($droptions, 'id_categoria', 'nombre_categoria');\n }", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "function get_habilidades( $id_usuario ) {\n\t\t$condicion = array(\n\t\t\t'IdUsuario' => $id_usuario,\n\t\t);\n\t\t$this->db->order_by( 'Habilidad' );\n\t\t$this->db->join('ab_puestos','ab_puestos.IdPuesto = pa_capacitacion_habilidades.IdPuesto');\n\t\t$consulta = $this->db->get_where( 'pa_capacitacion_habilidades', $condicion ); \n\t\t\n\t\treturn $consulta;\n\t}", "public function CategoriasPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from categorias where codcategoria = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcategoria\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\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 get_category_permastruct()\n {\n }", "function get_categoria($id){\t\n\t\t$sql=\"SELECT nombre_cat FROM categoria WHERE id_cat='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t$resultado=mysql_fetch_array($consulta);\n\n\t\treturn $resultado['nombre_cat'];\n\t}", "public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}", "function __construct() {\n\t\t$this -> modelo = new categoriaBss();\n\t}", "function categoria_x_id($id){\n return mostrar_categoria($id);\n }", "function biller_category() {\n\t\t$records = $this -> conn -> get_table_row_byidvalue('biller_category', 'biller_category_status', 1);\n\t\tif (!empty($records)) {\n\t\t\tforeach ($records as $v) {\n\t\t\t\t$biller_category_id = $v['biller_category_id'];\n\t\t\t\t$biller_category_name = $v['biller_category_name'];\n\t\t\t\t// frnd mobile number\n\t\t\t\t$biller_category_logo = biller_category_logo . $v['biller_category_logo'];\n\t\t\t\t$posts[] = array('biller_category_id' => $biller_category_id, \"biller_category_name\" => $biller_category_name, 'biller_category_logo' => $biller_category_logo);\n\t\t\t}\n\t\t\t$post = array('status' => 'true', 'biller_category' => $posts);\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Coming soon\");\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function categories(){\n return $this->db->get($this->categorie)->result();\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "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 }", "public function get_kategori()\n\t{\n\t\t$hasil = $this->db->get(\"kategori\")->result();\n\t\treturn $hasil;\n\t}", "public function getCategorias(){\n\t\t$sql = \"SELECT * FROM tipo_producto ORDER BY nombre_tipo_prod\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function categories(){\n /* \n id_categoria_producto int NOT NULL AUTO_INCREMENT,\n\ttipo_producto varchar(20) NOT NULL ,\n\tcaracteristicas_producto varchar(100) ,\n CONSTRAINT pk_categoria_producto PRIMARY KEY ( id_categoria_producto )\n\n\n id_producto int NOT NULL AUTO_INCREMENT,\n\tt_cat_producto int NOT NULL ,\n\tnombre_producto varchar(50) NOT NULL ,\n\tfecha varchar(10) NOT NULL ,\n\tpeso varchar(10) NOT NULL ,\n\tCONSTRAINT pk_producto PRIMARY KEY ( id_producto )\n */ \n $sql = 'SELECT c.name_categoria,\n c.id,\n p.id,\n p.id_categoria,\n p.nombre_producto,\n p.peso\n FROM categoria AS c, producto AS p\n WHERE c.id = p.id_categoria';\n $categories = $this->db->query($sql)->fetchAll(PDO::FETCH_CLASS, 'Category');\n return $categories;\n }", "function findCategories($key){\r\n // echo \"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\";\r\n $result = $this->connector->query(\"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\");\r\n $x = 0;\r\n while ($row = $this->connector->fetchArray($result)) {\r\n $x++;\r\n $cat[$x] = new Categorie();\r\n $cat[$x]->setCat_id($row['cat_id']);\r\n $cat[$x]->setCat_title($row['cat_title']);\r\n $cat[$x]->setCat_despription($row['cat_despription']);\r\n \r\n \t}\r\n return $cat; \r\n }", "public function get_categorieId()\n {\n return $this->_categorieId;\n }", "public function run()\n {\n $Brand_Categories=[\n [\n 'brand_id'=>'1',\n 'category_id'=>'1'\n ],\n [\n 'brand_id'=>'2',\n 'category_id'=>'1'\n ],\n [\n 'brand_id'=>'3',\n 'category_id'=>'1'\n ],\n [\n 'brand_id'=>'4',\n 'category_id'=>'2'\n ],\n [\n 'brand_id'=>'5',\n 'category_id'=>'2'\n ],\n [\n 'brand_id'=>'6',\n 'category_id'=>'2'\n ],\n [\n 'brand_id'=>'7',\n 'category_id'=>'2'\n ],\n [\n 'brand_id'=>'8',\n 'category_id'=>'2'\n ],\n [\n 'brand_id'=>'9',\n 'category_id'=>'2'\n ],\n [\n 'brand_id'=>'10',\n 'category_id'=>'3'\n ],\n [\n 'brand_id'=>'11',\n 'category_id'=>'3'\n ],\n [\n 'brand_id'=>'12',\n 'category_id'=>'4'\n ],\n [\n 'brand_id'=>'13',\n 'category_id'=>'4'\n ],\n [\n 'brand_id'=>'14',\n 'category_id'=>'4'\n ],\n [\n 'brand_id'=>'15',\n 'category_id'=>'8'\n ],\n [\n 'brand_id'=>'16',\n 'category_id'=>'6'\n ],\n [\n 'brand_id'=>'17',\n 'category_id'=>'6'\n ],\n [\n 'brand_id'=>'18',\n 'category_id'=>'6'\n ],\n [\n 'brand_id'=>'19',\n 'category_id'=>'6'\n ],\n [\n 'brand_id'=>'20',\n 'category_id'=>'6'\n ],\n [\n 'brand_id'=>'21',\n 'category_id'=>'7'\n ],\n [\n 'brand_id'=>'22',\n 'category_id'=>'7'\n ],\n [\n 'brand_id'=>'23',\n 'category_id'=>'7'\n ],\n [\n 'brand_id'=>'24',\n 'category_id'=>'7'\n ],\n [\n 'brand_id'=>'25',\n 'category_id'=>'7'\n ],\n [\n 'brand_id'=>'26',\n 'category_id'=>'7'\n ],\n [\n 'brand_id'=>'27',\n 'category_id'=>'7'\n ],\n [\n 'brand_id'=>'28',\n 'category_id'=>'8'\n ],\n [\n 'brand_id'=>'29',\n 'category_id'=>'9'\n ]\n ];\n foreach($Brand_Categories as $Brand_Category){\n Brand_Category::create($Brand_Category);\n }\n }", "public function definition()\n {\n $categories = $this->faker->unique()->randomElement(['pria', 'wanita', 'pulsa', 'voucher']);\n\n $isDigitalProduct = false;\n switch ($categories) {\n case 'pria':\n break;\n\n case 'wanita':\n break;\n\n case 'pulsa':\n $isDigitalProduct = true;\n break;\n\n case 'voucher':\n $isDigitalProduct = true;\n break;\n }\n\n return [\n 'title' => $categories,\n 'is_digital_product' => $isDigitalProduct,\n ];\n }", "public function getMenu(){\n $bigCategory = $this->getBigCategory();\n $medCategory = $this->getMediumCategory();\n foreach($bigCategory as $bigKey => $value){\n foreach($medCategory as $medKey => $val){\n if($val['parentId'] == $value['id']){\n $bigCategory[$bigKey]['subCategory'][] = $val;\n }\n }\n }\n return $bigCategory;\n }", "function CATEGORYSET($t_args) {\n // The dictionary of the associated factor.\n $dictionary = get_first_key($t_args, ['dictionary', 'dict', 0]);\n $values = array_values($dictionary);\n\n // The component types used.\n $category = lookupType('category', ['dict' => $dictionary]);\n $bitset = lookupType('bitset', ['values' => $values]);\n\n $size = $bitset->get('size.bytes');\n\n // The name of the object type.\n $className = 'CategorySet' . $size;\n\n $systemHeaders = ['cstdio', 'cstring'];\n $userHeaders = [];\n $libHeaders = [];\n $libraries = [];\n $constructors = [];\n $methods = [];\n $functions = [];\n $binaryOperators = [];\n $unaryOperators = [];\n $globalContent = '';\n $complex = false;\n $properties = [];\n $extra = ['size.bytes' => $size];\n $describeJson = DescribeJson('categoryset',\n DescribeJsonStatic(['levels' => $values]));\n\n $globalContent = '';\n?>\n\nclass <?=$className?> {\n public:\n using Category = <?=$category?>;\n using BitSet = <?=$bitset?>;\n using StorageType = BitSet::StorageType;\n\n private:\n // The binary data corresponding to the encoded string.\n BitSet data;\n\n public:\n<? $constructors[] = [[], true]; ?>\n <?=$className?>();\n<? $constructors[] = [['BASE::NULL'], true]; ?>\n <?=$className?>(const GrokitNull& null);\n<? $constructors[] = [['BASE::STRING_LITERAL'], true]; ?>\n <?=$className?>(const char* str);\n <?=$className?>(const BitSet& data);\n <?=$className?>(const <?=$className?>& other);\n\n<? $methods[] = ['IsEmpty', [], 'BASE::BOOL', true]; ?>\n bool IsEmpty() const;\n\n <?=$className?>& operator =(const <?=$className?>& other) = default;\n<? $binaryOperators[] = '=='; ?>\n bool operator ==(const <?=$className?>& other) const;\n<? $binaryOperators[] = '!='; ?>\n bool operator !=(const <?=$className?>& other) const;\n<? $binaryOperators[] = '<'; ?>\n bool operator <(const <?=$className?>& other) const;\n<? $binaryOperators[] = '>'; ?>\n bool operator >(const <?=$className?>& other) const;\n<? $binaryOperators[] = '<='; ?>\n bool operator <=(const <?=$className?>& other) const;\n<? $binaryOperators[] = '>='; ?>\n bool operator >=(const <?=$className?>& other) const;\n\n void FromString(const char* str);\n int ToString(char* buffer) const;\n\n void FromJson(const Json::Value& src);\n void ToJson(Json::Value& dest) const;\n};\n\ninline <?=$className?>::<?=$className?>()\n : data() {\n}\n\ninline <?=$className?>::<?=$className?>(const GrokitNull& null)\n : data() {\n}\n\ninline <?=$className?>::<?=$className?>(const char* str) {\n this->FromString(str);\n}\n\ninline <?=$className?>::<?=$className?>(const <?=$className?>::BitSet& data)\n : data(data) {\n}\n\ninline <?=$className?>::<?=$className?>(const <?=$className?>& other)\n : data(other.data) {\n}\n\ninline bool <?=$className?>::IsEmpty() const {\n return data == 0;\n}\n\ninline bool <?=$className?>::operator ==(const <?=$className?>& other) const {\n return this->data == other.data;\n}\n\ninline bool <?=$className?>::operator !=(const <?=$className?>& other) const {\n return this->data != other.data;\n}\n\ninline bool <?=$className?>::operator <(const <?=$className?>& other) const {\n return this->data < other.data;\n}\n\ninline bool <?=$className?>::operator >(const <?=$className?>&other) const {\n return this->data > other.data;\n}\n\ninline bool <?=$className?>::operator <=(const <?=$className?>& other) const {\n return this->data <= other.data;\n}\n\ninline bool <?=$className?>::operator >=(const <?=$className?>& other) const {\n return this->data >= other.data;\n}\n\ninline void <?=$className?>::FromString(const char* str) {\n StorageType mask;\n char* storage;\n char* copy = strdup(str);\n char* token = strtok_r(copy, \" \", &storage);\n while (token != NULL) {\n Category level (token);\n WARNINGIF(level.Invalid(), \"Invalid token: %s\", token);\n mask |= 1 << level;\n token = strtok_r(NULL, \" \", &storage);\n }\n data = mask;\n free(copy);\n}\n\ninline int <?=$className?>::ToString(char* buffer) const {\n char* start = buffer;\n<? foreach ($dictionary as $name) { ?>\n if (data.<?=$name?>())\n buffer += sprintf(buffer, \"%s \", \"<?=$name?>\");\n<? }?>\n if (start == buffer) {\n buffer[0] = '\\0';\n return 1;\n } else {\n buffer[-1] = '\\0';\n return buffer - start;\n }\n}\n\ninline void <?=$className?>::FromJson(const Json::Value& src) {\n this->FromString(src.asCString());\n}\n\ninline void <?=$className?>::ToJson(Json::Value& dest) const {\n char* buffer;\n this->ToString(buffer);\n dest = buffer;\n}\n\n<? ob_start(); ?>\n\ninline void FromString(@type& data, const char* buffer) {\n data.FromString(buffer);\n}\n\ninline int ToString(const @type& data, char* buffer) {\n return data.ToString(buffer);\n}\n\ninline void FromJson(const Json::Value& src, @type& dest) {\n dest.FromJson(src);\n}\n\ninline void ToJson(const @type& src, Json::Value& dest) {\n src.ToJson(dest);\n}\n\n<? $globalContent .= ob_get_clean(); ?>\n\n<?\n return [\n 'kind' => 'TYPE',\n 'name' => $className,\n 'complex' => $complex,\n 'system_headers' => $systemHeaders,\n 'user_headers' => $userHeaders,\n 'lib_headers' => $libHeaders,\n 'libraries' => $libraries,\n 'binary_operators' => $binaryOperators,\n 'unary_operators' => $unaryOperators,\n 'global_content' => $globalContent,\n 'constructors' => $constructors,\n 'methods' => $methods,\n 'functions' => $functions,\n 'libraries' => $libraries,\n 'properties' => $properties,\n 'extras' => $extra,\n 'describe_json' => $describeJson,\n ];\n}", "public function atualizarCategoria($idcategoria, $categoria, $habilitado){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT count(*) as total from tbcategorias where nome='$categoria' \";\n $sql = $this->conexao->query($sql);\n\n if(empty($categoria)) {\n return 2;\n }else{\n\n $sql = \"UPDATE tbcategorias SET nome = '$categoria', habilitado = '$habilitado' WHERE idcategoria = '$idcategoria' \";\n\n echo $this->conexao->query($sql);\n \n }\n\n }", "function unique_Category() {\n\t\t\n\t\tglobal $gesamt;\n\t\t\n\t\t$result = array_unique($gesamt);\n\t\tforeach ($result as $element){\n\t\t\techo \"<a href=\\\"load_page.php?cat=\" . $element .\"\\\">\". $element . \"</a><br>\";\n\t\t}\n\t}", "private function getCategoryID() {\n return 0;\n }", "public function getStrategys()\n {\n return [\n\n ];\n }", "function ObtenerCategorias(){\n\n\t\tinclude_once(\"../Entidades/Categorias.php\");\n\t\t$OBJCategorias = new Categorias;\n\t\t$categorias\t= $OBJCategorias -> ObtenerCategoriasconSeccion();\n\n\t\t$privilegios = $_SESSION['privilegios'];\n\n\t\tinclude_once(\"../ModuloAdministrador/vistas/FormularioCategorias.php\");\n\t\t$OBJFormCategorias = new FormularioCategorias;\n\t\t$OBJFormCategorias -> MostrarFormularioCategorias($categorias,$privilegios);\n\n\n\t}" ]
[ "0.7115779", "0.64479035", "0.6118651", "0.59649694", "0.58322686", "0.5790375", "0.5771036", "0.56999403", "0.56837493", "0.5669971", "0.564989", "0.5647507", "0.5632058", "0.56242603", "0.55907595", "0.55834526", "0.5582327", "0.5564064", "0.5559757", "0.5559757", "0.55503774", "0.5549746", "0.55275106", "0.5519975", "0.5501341", "0.54899263", "0.5467829", "0.5440799", "0.54282814", "0.5409554", "0.54031587", "0.5377836", "0.53752893", "0.5372078", "0.5362875", "0.5362065", "0.5355611", "0.53469026", "0.53464514", "0.53252137", "0.53009415", "0.5293736", "0.5290568", "0.52886707", "0.52822965", "0.5278852", "0.52756476", "0.5275193", "0.5264656", "0.5261748", "0.5261748", "0.525874", "0.525874", "0.5257753", "0.5256106", "0.5256106", "0.52522516", "0.525056", "0.52504236", "0.52504236", "0.52413297", "0.5240748", "0.52386504", "0.52295816", "0.5227858", "0.5227858", "0.5213613", "0.51985705", "0.51855975", "0.5185447", "0.51830035", "0.51830035", "0.5181799", "0.5169177", "0.51682395", "0.51658535", "0.5156725", "0.51556885", "0.5154278", "0.5152551", "0.51502085", "0.51498795", "0.5148226", "0.5148226", "0.5148226", "0.51477146", "0.5143066", "0.51386815", "0.51307625", "0.51307607", "0.5129169", "0.512419", "0.5123109", "0.51217824", "0.5121725", "0.51140136", "0.5113575", "0.5109924", "0.5108131", "0.5107652" ]
0.5247205
60
Lists all svCfgCalzadaCarril entities.
public function indexAction() { $helpers = $this->get("app.helpers"); $em = $this->getDoctrine()->getManager(); $calzadas = $em->getRepository('JHWEBSeguridadVialBundle:SvCfgCalzadaCarril')->findBy( array('activo' => true) ); $response['data'] = array(); if ($calzadas) { $response = array( 'status' => 'success', 'code' => 200, 'message' => count($calzadas) . " registros encontrados", 'data' => $calzadas, ); } return $helpers->json($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all_cajeros()\n { \n $this->parametros = array();\n $this->sp = \"str_consultacajeros\";\n $this->executeSPConsulta();\n\n if (count($this->rows)<=0){\n $this->mensaje=\"No existen niveles economicos en la BD.\";\n array_pop($rol);\n array_push($rol, array(0 => -1, \n 1 => 'Seleccione...',\n 3 => ''));\n\t\t\t\n }else{\n $rol = array();\n\n array_pop($rol);\n array_push($rol, array(0 => -1, \n 1 => 'Seleccione...',\n 3 => ''));\n\t\t\t\n foreach($this->rows as $niveles_economicos){\n array_push($rol, array_values($niveles_economicos));\n }\n\n $this->rows = $rol;\n unset($rol);\n }\n }", "public function getAllCAtegories()\n {\n return $this->dao->findAll();\n }", "public function all()\n {\n return $this->atividadeComercialRepository->all();\n }", "public function listAll()\n\t{\n\t\t$sql = new Conexao;\n\n\t\treturn $sql->select(\"SELECT * FROM tb_criarapuracao\");\n\t}", "function listaCidades(){\n\t\t\t$cidades = array();\n\t\t\t$resultado = mysqli_query($this->con, \"SELECT * FROM cidades ORDER BY nome;\");\t\n\t\t\twhile($cidade_atual = mysqli_fetch_assoc($resultado)) {\n\n\t\t\t\t$cidade = new CidadeModel();\n\t\t\t\t$cidade->setId($cidade_atual['id']);\n\t\t\t\t$cidade->setNome($cidade_atual['nome']);\n\t\t\t\t$cidade->setVaras($cidade_atual['varas']);\n\n\t\t\t\tarray_push($cidades, $cidade);\n\t\t\t}\n\t\t\tmysqli_close($this->con);\n\t\t\treturn $cidades;\n\t\t}", "public function getListadoCattareas()\r\n {\r\n return $this->conexionCattarea->listaLlaves(\"correlativo\", \"ASC\");\r\n }", "public function all()\n {\n return TipoCabelo::all();\n }", "public function getAll() {\n $sql = \"SELECT * FROM contatos\";\n $sql = $this->pdo->query($sql);\n\n if($sql->rowCount() > 0 ) {\n return $sql->fetchAll();\n } else {\n return array();\n }\n }", "function SHOWALL(){\n\n $stmt = $this->db->prepare(\"SELECT * FROM centro\");\n $stmt->execute();\n $centros_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $allcentros = array(); //array para almacenar los datos de todos los centros\n\n //Recorremos todos las filas de centros devueltas por la sentencia sql\n foreach ($centros_db as $centro){\n //Introducimos uno a uno los grupos recuperados de la BD\n array_push($allcentros,\n new CENTRO_Model(\n $centro['centro_id'],$centro['nombre_centro'],$centro['edificio_centro']\n )\n );\n }\n return $allcentros;\n }", "public function getAllContatti() {\r\n $res = Model::getDB()->query(self::$GET_ALL_CONTATTI);\r\n $contatti = array();\r\n if($res){\r\n while ($obj = $res->fetch_assoc()) {\r\n $contatto = new Contatto($obj['valore'], $obj['tipologia'], $obj['utente_matricola']);\r\n $contatto->setId($obj['id']);\r\n $contatti[] = $contatto;\r\n }\r\n }\r\n return $contatti;\r\n }", "public function getCalculos() {\n\n if (count($this->aCalculos) == 0 && !empty($this->iPlanilha)) {\n\n $oDaoBensCalculo = new cl_benshistoricocalculobem();\n $sWhereCalculos = \"t58_benshistoricocalculo = {$this->iPlanilha}\";\n $sSqlBensCalculo = $oDaoBensCalculo->sql_query(null, \"benshistoricocalculobem.*, bens.*, bensdepreciacao.*\", \"t58_sequencial\", $sWhereCalculos);\n $rsBensCaculo = $oDaoBensCalculo->sql_record($sSqlBensCalculo);\n\n if ($oDaoBensCalculo->numrows > 0) {\n\n for ($iCalculo = 0; $iCalculo < $oDaoBensCalculo->numrows; $iCalculo++) {\n\n $oDadosCalculo = db_utils::fieldsMemory($rsBensCaculo, $iCalculo);\n\n $oCalculo = new CalculoBem();\n $oCalculo->setHistoricoCalculo($oDadosCalculo->t58_benshistoricocalculo);\n $oCalculo->setPercentualDepreciado($oDadosCalculo->t58_percentualdepreciado);\n $oCalculo->setSequencial($oDadosCalculo->t58_sequencial);\n $oCalculo->setTipoDepreciacao($oDadosCalculo->t58_benstipodepreciacao);\n $oCalculo->setValorAnterior($oDadosCalculo->t58_valoranterior);\n $oCalculo->setValorAtual($oDadosCalculo->t58_valoratual);\n $oCalculo->setValorCalculado($oDadosCalculo->t58_valorcalculado);\n $oCalculo->setValorResidual($oDadosCalculo->t58_valorresidual);\n $oCalculo->setValorResidualAnterior($oDadosCalculo->t58_valorresidualanterior);\n\n $oBem = new Bem();\n $oBem->setCodigoBem($oDadosCalculo->t52_bem);\n $oBem->setCodigoBemDepreciacao($oDadosCalculo->t44_sequencial);\n $oBem->setTipoDepreciacao( BemTipoDepreciacaoRepository::getPorCodigo($oDadosCalculo->t44_benstipodepreciacao) );\n $oBem->setTipoAquisicao( BemTipoAquisicaoRepository::getPorCodigo($oDadosCalculo->t44_benstipoaquisicao) );\n $oBem->setClassificacao(BemClassificacaoRepository::getPorCodigo($oDadosCalculo->t52_codcla));\n $oBem->setVidaUtil($oDadosCalculo->t44_vidautil);\n $oBem->setValorAquisicao($oDadosCalculo->t52_valaqu);\n $oBem->setValorResidual($oDadosCalculo->t44_valorresidual);\n $oBem->setValorDepreciavel($oDadosCalculo->t44_valoratual);\n $oBem->setVidaUtil($oDadosCalculo->t44_vidautil);\n $oBem->setDescricao($oDadosCalculo->t52_descr);\n\n $oCalculo->setBem($oBem);\n\n array_push($this->aCalculos, $oCalculo);\n }\n }\n\n unset($oDaoBensCalculo);\n unset($rsBensCaculo);\n }\n return $this->aCalculos;\n }", "public function fetchAll()\n {\n $query = $this->em->createQuery(\"\n SELECT\n ccb.id,\n usr.nome corretor,\n con.nome contato ,\n ccb.dataBloqueio,\n ccb.status\n FROM\n {$this->repository} ccb\n JOIN crm\\Entity\\Usuarios usr WITH ccb.corretor = usr.id\n JOIN crm\\Entity\\Contatos con WITH ccb.contato = con.id\"\n );\n $results = $query->getResult();\n if(!is_null($results)) {\n return $results;\n }\n return new ApiProblem('404', \"Recurso n�o localizado\");\n }", "public static function index()\n {\n return Comida::all();\n }", "public function consultaCargos() {\n\t\t\treturn $this->entidad->getRepository('\\Entidades\\Expertos\\UsuariosCargo')->findAll();\n\t\t}", "function getAllCargos(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenCargo');\n\t\t\t$data=false;\n\t\t\t$obj->find();\n\t\t\t$i=0;\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\t\n\t\t\t\t$i++;\t\t\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getAllCargos');\n\t\t\treturn $data;\n\t\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminCommonBundle:Configuracao')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public static function all(){\n\t\t$bdd = new DBcnx();\n\t\t\treturn $bdd->allClient();\n\t}", "function getComentarios(){\n $this->bd->setConsulta(\"select * from comentario\");\n $comentario = array();\n $i=0;\n while ($fila = $this->bd->getFila()){\n $comentario[$i] = new Comentario($fila[\"id\"], $fila[\"descripcion\"],$fila[\"fechacreacion\"],$fila[\"idEntrada\"],$fila[\"idUsuario\"]);\n $i++;\n }\n return $comentario;\n }", "public function ListarCreditos()\n{\n\tself::SetNames();\n\t$sql =\"SELECT \n\tventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.fechaabono, SUM(abonoscreditos.montoabono) as abonototal, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.emailcliente, cajas.nrocaja\n\tFROM\n\t(ventas LEFT JOIN abonoscreditos ON ventas.codventa=abonoscreditos.codventa) LEFT JOIN clientes ON \n\tclientes.codcliente=ventas.codcliente LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.tipopagove ='CREDITO' GROUP BY ventas.codventa\";\n\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 cargarbodegas()\n {\n \treturn Cont_Bodega::all();\n }", "public function getAllActifClasse() {\n $qb = $this->createQueryBuilder('e')\n ->where('e.etatClasse = ' . TypeEtat::ACTIF);\n // ->orderBy('e.typeClasse', 'ASC');\n return $qb->getQuery()->getResult();\n }", "public function getAll()\n {\n return $this->indicacaoRepository->getAll();\n }", "public function listarComentariosAceitos(){\n $this->validaAutenticacao();\n $comentario = Container::getModel('Comentarios');\n $comentario->__set('idVitima', $_POST['idVitima']);\n\n echo (json_encode($comentario->getComentariosAprovadosDashboard()));\n }", "public function obtenerComprasSinAdecsys()\n {\n $sql = $this->getAdapter()->select()->from(array('c' => 'compra'),\n array('id', 'id_tarifa', 't.medio_pub'))\n ->joinLeft(array('cac' => 'compra_adecsys_codigo'),\n 'c.id = cac.id_compra', null)\n ->joinInner(array('t' => 'tarifa'), 't.id = c.id_tarifa', null)\n ->where('cac.id is null')\n ->where('c.estado = ?', self::ESTADO_PAGADO)\n ->where('c.id_tarifa <> ?', Application_Model_Tarifa::GRATUITA)\n ->where('c.medio_pago in (?)',\n array(self::FORMA_PAGO_VISA, self::FORMA_PAGO_PAGO_EFECTIVO,\n self::FORMA_PAGO_MASTER_CARD, self::FORMA_PAGO_CREDITO))\n ->order('c.id asc');\n\n return $this->getAdapter()->fetchAll($sql);\n }", "public function index()\n {\n return Contatos::orderBy('id', 'DESC')->get();\n }", "public function listarClientes(){\n $this->bd->getConeccion();\n $sql = \"SELECT * FROM CLIENTE\";\n $registros = $this->bd->executeQueryReturnData($sql); \n $this->bd->cerrarConeccion(); \n $clientes = array(); \n \n foreach ($registros as $cliente) {\n $cliente = new Cliente($cliente['id'],$cliente['dni'],$cliente['Nombre'],$cliente['Apellido'],$cliente['Correo'],$cliente['Telefono']);\n array_push($clientes, $cliente);\n }\n \n return $clientes; \n }", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "private function buscaCidades($cod_uf=null){\n\n\t\t//Verifica o tipo de solicitação\n\t\tif(!is_null($cod_uf)){\n\t\t\t\t\n\t\t\t//Parametros da Requisição\n\t\t\t$parametros = array('data' => array('cod_uf' => $cod_uf));\n\t\t\t\t\n\t\t}else{\n\t\t\t\t\n\t\t\t//Parametros da Requisição\n\t\t\t$parametros = array('json_data' => true,'data' => (HelperFactory::getInstance()->isAjax() ? $this->getPost() : false));\n\t\t}\n\n\t\t//Verifica se os parametros foram informados corretamente\n\t\tif($parametros !== false){\n\t\t\t\t\n\t\t\t//Delega a tarefa ao Model\n\t\t\t$recordset = $this->Delegator('ConcreteCadastro', 'buscaCidades',$parametros);\n\t\t\t\t\n\t\t\t//Verifica o tipo de retorno\n\t\t\tif(!isset($parametros['json_data'])){\n\n\t\t\t\t//Associa os dados a view\n\t\t\t\t$this->View()->assign('cidades',$recordset);\n\t\t\t}\n\t\t}\n\t}", "static function cursadas(){\n\t\t\n\t\t$cs = array();\n\t\t\n\t\t$conn = new Conexion();\n\t\t\n\t\t$sql = 'SELECT id_carrera, materia, anio FROM cursada';\n\t\t\n\t\t$consulta = $conn->prepare($sql);\n\t\t\n\t\t$consulta->setFetchMode(PDO::FETCH_ASSOC);\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$consulta->execute();\n\t\t\t\n\t\t\t$results = $consulta->fetchall();\n\t\t\t\n\t\t\tforeach($results as $r){\n\t\t\t\t\n\t\t\t\t$c = Cursada::cursada($r['id_carrera'], $r['materia'], $r['anio']);\n\t\t\t\t\n\t\t\t\tarray_push($cs, $c);\n\t\t\t}\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $cs;\n\t}", "public function listarCentro()\r\n {\r\n $sql = \"SELECT * FROM Centro\";\r\n $resultado = $this-> conex-> consultaRetorno($sql);\r\n return $resultado;\r\n }", "public function buscarTodos() {\r\n global $conn;\r\n $qry = $conn->query(\"SELECT * FROM conta\");\r\n $items = array();\r\n while($linha = $qry->fetch()) {\r\n $items[] = new Conta($linha[\"saldo\"], $linha[\"numero\"], $linha[\"cpf\"],$linha[\"cnpj\"]);\r\n }\r\n return $items;\r\n }", "public function listConfiguracoes(){\n $configuracoes = Configuracao::all();\n return view('adm/configuracoes/pagseguro', compact('configuracoes'));\n }", "public function get_cargos($centro_costo){\n\t\t\t\n\t\t\t\n\t\t\ttry { \n\t\t\t\tglobal $conn;\n\t\t\t\t$sql=\"SELECT distinct c.cod_car, C.NOM_CAR \n\t\t\t\t\t FROM CARGOS C, CENTROCOSTO2 AREA, EMPLEADOS_BASIC EPL\n\t\t\t\t\t\tWHERE \n\t\t\t\t\t EPL.COD_CC2='\".$centro_costo.\"'\n\t\t\t\t\t\tAND EPL.COD_CAR=C.COD_CAR\n\t\t\t\t\t\torder by nom_car asc\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\twhile($fila=$rs->FetchRow()){\n\t\t\t\t\t$this->lista[]=array(\"codigo\" => $fila[\"cod_car\"],\n\t\t\t\t\t\t\t\t\t\t \"cargos\"=> utf8_encode($fila[\"NOM_CAR\"]));\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn $this->lista;\n\t\t\t\t\n\t\t\t}catch (exception $e) { \n\n\t\t\t var_dump($e); \n\n\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t} \n\t\t\n\t\t}", "public function getComercios(){\n\t\t$sql = \"SELECT ID_comercio, nombre, correo, telefono, responsable, FK_ID_estado_comercio FROM comercio ORDER BY nombre\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function indexAll()\n {\n $citas = Cita::all();\n return $citas;\n }", "public function lista() {\n $sql = \"SELECT * FROM cliente\";\n $qry = $this->db->query($sql); // query do pdo com acesso ao bd\n\n //return $qry->fetchAll(); // retorna todos os registros\n return $qry->fetchAll(\\PDO::FETCH_OBJ); // retorna todos os registros a nível de objeto\n }", "public function actionGetcitas()\n {\n $Citas = Citas::find()\n\t\t ->alias('t')\n\t\t\t\t\t\t\t->select('t.*, ct.CITU_HORARIPS, f.CIFI_NOMBRE, cm.CIMI_NOMBRE, pp.PEPA_NOMBRE1, pp.PEPA_APELLIDO1')\n\t\t\t\t\t\t\t->where(['ceh.PEEM_ID' => 339])\n\t\t\t\t\t\t\t->andWhere(['like', 't.CITA_FECHA', '2018-09-04'])\n\t\t\t\t\t\t\t->andWhere(['<>','f.CIFI_ID', 401])\n\t\t\t\t\t\t\t->andWhere(['<>','f.CIFI_ID', 402])\n\t\t\t\t\t\t\t->innerJoin('TBL_CITASPEEMHORA ceh', 'ceh.EMHO_ID = t.EMHO_ID')\n\t\t\t\t\t\t\t->innerJoin('TBL_CITASHORARIOS ch', 'ch.CIHO_ID = ceh.CIHO_ID')\n\t\t\t\t\t\t\t->innerJoin('TBL_CITASTURNOS ct', 'ct.CITU_ID = ch.CITU_ID')\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t->innerJoin('TBL_CITASMINUTOS cm', 'cm.CIMI_ID = ct.CIMI_ID')\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t->innerJoin('TBL_CITASFINALIDADES f', 't.CIFI_ID = f.CIFI_ID')\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t->innerJoin('TBL_PERSONASPACIENTES pp', 't.PEPA_ID = pp.PEPA_ID')\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t->all();\n\t\t$i = 1;\n\t\tforeach($Citas as $Cita){\t\t\n\t\t\t\n\t\t\t$horaI = $Cita->CITU_HORARIPS;\n\t\t\t$min = \"00:\".$Cita->CIMI_NOMBRE.\":00\";\t\t\n\t\t\t$horaF = $this->SumaHoras($horaI,$min);\n\t\t\t$title = $Cita->CIFI_NOMBRE . \" -- \" . $Cita->PEPA_NOMBRE1 . \" -- \" . $Cita->PEPA_APELLIDO1;\n\t\t\techo $i.' - '.$Cita->CIFI_NOMBRE.' -> : '.$title.' -> : '.$Cita->CITU_HORARIPS.' : '.$horaF.' <br>';\n\t\t\n\t\t$i++;\n\t\t}\n\t\t\n }", "public function getCotizaciones() {\n $sql = \"SELECT cot_odt.id_odt, cot_odt.num_odt, cot_odt.id_modelo, cot_odt.tiraje, cot_odt.fecha_odt\n , cot_odt.hora_odt, modelos_cajas.nombre as nombre_caja\n , clientes.nombre as nombre_cliente\n FROM cot_odt\n join modelos_cajas on cot_odt.id_modelo = modelos_cajas.id_modelo\n join clientes on cot_odt.id_cliente = clientes.id_cliente\n WHERE cot_odt.status = 'A' order by cot_odt.fecha_odt desc, cot_odt.hora_odt desc\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = array();\n\n while ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n\n $result[] = $row;\n }\n\n return $result;\n\n }", "public function listadoCirugiasSinPagar(){\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT C.idCirugia, C.fecha, DATE_FORMAT(C.hora, '%H:%i') as hora,\n\t\t\n\t\t\t\t\t\tP.nombre AS nombrePaciente,\n\t\t\t\t\t\t\n\t\t\t\t\t\tPP.idPropietario, PP.identificacion, PP.nombre AS nombre, PP.apellido,\n\t\t\t\t\t\t\n\t\t\t\t\t\tU.nombre AS nombreMedico, U.apellido AS apellidoMedico\n\t\t\n\t\t\t\t\t\tFROM tb_cirugias AS C \n\t\t\t\t\t\t\n\t\t\t\t\t\tINNER JOIN tb_mascotas AS P ON P.idMascota = C.idMascota\n\t\t\t\t\t\tINNER JOIN tb_propietarios AS PP ON PP.idPropietario = P.idPropietario\n\t\t\t\t\t\tINNER JOIN tb_usuarios AS U ON U.idUsuario = C.idUsuario\n\t\t\t\t\t\t\n \t\t\t\tWHERE Not C.idCirugia IN (SELECT idTipoDetalle FROM tb_pago_factura_caja_detalle WHERE tipoDetalle = 'Cirugia' AND estado = 'Activo' )\n \t\t\t\torder by C.fecha desc, C.hora \";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado[] = $filas;\n }\n \n /* liberar el conjunto de resultados */\n $res->free();\n \n }\n\n return $resultado;\t\t\n\t}", "private function buscarFacturasRAD() {\n try {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $conCont = $obj_con->conexionIntermedio();\n $rawData = array();\n $fechaIni=$obj_var->dateStartFact;\n $limitEnv=$obj_var->limitEnv;\n \n $sql = \"SELECT IdFactura,AutorizacionSRI,FechaAutorizacion,Ambiente,TipoEmision,RazonSocial,NombreComercial,\n Ruc,ClaveAcceso,CodigoDocumento,Establecimiento,PuntoEmision,Secuencial,DireccionMatriz,\n FechaEmision,DireccionEstablecimiento,ContribuyenteEspecial,ObligadoContabilidad,TipoIdentificacionComprador,\n GuiaRemision,RazonSocialComprador,IdentificacionComprador,TotalSinImpuesto,TotalDescuento,Propina,\n ImporteTotal,Moneda,'1','',Estado\n FROM \" . $obj_con->BdIntermedio . \".NubeFactura \n WHERE Estado=2 AND IdRad='0' AND FechaCarga>'$fechaIni' limit $limitEnv \";\n //echo $sql;\n $sentencia = $conCont->query($sql);\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawData[] = $fila;\n }\n }\n $conCont->close();\n return $rawData;\n } catch (Exception $e) {\n echo $e;\n $conCont->close();\n return false;\n }\n }", "public function getAllCliente() {\n try {\n $sql = \"SELECT * FROM cliente\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $dados = $stm->fetchAll(PDO::FETCH_OBJ);\n return $dados;\n } catch (PDOException $erro) {\n echo \"<script>alert('Erro na linha: {$erro->getLine()}')</script>\";\n }\n }", "public function listAllCCO( Request $request ) \n {\n\n $reportes = $this->reportaDao->listAll();\n \n $arregloReporta = array();\n foreach( $reportes as $indice => $reporta ){\n\n $arreglo = array( \n \"id\" => $reporta->getId(), \n \"etiqueta\" => $reporta->getEtiqueta()\n );\n $arregloReporta[] = $arreglo;\n }\n \n return response( $arregloReporta , 200)->header('Content-Type', 'application/json'); \n \n\n \n}", "public function getAllCiudades()\n\t{\n\t\t//el parametro es el nombre de la tabla\n\t\t$query = $this->db->get('ciudad');\n\t\t//devuelve un array de filas\n\t\treturn $query->result_array();\n\t\t/*\n\t\tMientras sea una tabla sola, la usamos asi,\n\t\tpero si es un join de varias tablas hay que usar los\n\t\tprepared statements que usamos en la app\n\t\t*/\n\t}", "public function listAllCCO( Request $request ) \n {\n\n $ultimoId = $request->get('ultimoId');\n\n $fechaInicio = new \\DateTime();\n $fechaFin = new \\DateTime();\n\n $sectores = $request->get('sectores');\n \n $alertas = $this->alertaDao->listAllCCO( $ultimoId, $fechaInicio , $fechaFin , $sectores);\n //return response( $alertas , 200)->header('Content-Type', 'application/json'); \n \n $arregloAlertas = array();\n foreach( $alertas as $indice => $alerta ){\n\n $cadenasArreglo = array();\n foreach( $alerta->getNegocio()->getCadenas() as $indice => $cadena ){\n $arreglo = array(\n \"id\" => $cadena->getId(),\n \"etiqueta\" => $cadena->getEtiqueta(),\n ); \n $cadenasArreglo[] = $arreglo;\n } \n\n $zonasArreglo = array();\n if( $alerta->getSector() != null ){\n foreach( $alerta->getSector()->getZonas() as $indice => $zona ){ \n $arreglo = array(\n \"id\" => $zona->getId(),\n \"etiqueta\" => $zona->getEtiqueta()\n ); \n $zonasArreglo[] = $arreglo;\n } \n }\n\n $direccionArreglo = array(\n \"colonia\" => $alerta->getNegocio()->getDireccion()->getColonia()->getEtiqueta(),\n \"delegacion\" => $alerta->getNegocio()->getDireccion()->getColonia()->getDelegacion()->getEtiqueta(),\n \"callePrincipal\" => $alerta->getNegocio()->getDireccion()->getCallePrincipal(),\n \"calle1\" => $alerta->getNegocio()->getDireccion()->getCalle1(),\n \"calle2\" => $alerta->getNegocio()->getDireccion()->getCalle2(),\n \"numeroInterior\" => $alerta->getNegocio()->getDireccion()->getNumeroInterior(),\n \"numeroExterior\" => $alerta->getNegocio()->getDireccion()->getNumeroExterior(),\n \"codigoPostal\" => $alerta->getNegocio()->getDireccion()->getCodigoPostal()\n ); \n \n \n $arreglo = array( \n \"id\" => $alerta->getId(), \n \"cadenas\" => $cadenasArreglo, \n \"idNegocio\" => $alerta->getNegocio()->getId(),\n\n \"latitud\" => $alerta->getNegocio()->getLatitud(), \n \"longitud\" => $alerta->getNegocio()->getLongitud(),\n \n \"idNegocio\" => $alerta->getNegocio()->getId(),\n \"fechaAltaNegocio\" => $alerta->getNegocio()->getFechaAlta(), \n \"direccionNegocio\" => $direccionArreglo,\n \"negocio\" => $alerta->getNegocio()->getNombre(),\n\n \"referenciaNegocio\" => $alerta->getNegocio()->getReferencia(),\n \"giroNegocio\" => $alerta->getNegocio()->getGirONegocioGeneral()->getEtiqueta(),\n \"fechaAlta\" => $alerta->getFechaAlta(), \n \"zonas\" => $zonasArreglo, \n \"sector\" => $alerta->getSector() != null ? $alerta->getSector()->getEtiqueta() : \"Ninguno\",\n \"dispositivo\" => $alerta->getDispositivo()->getTipoDispositivo()->getEtiqueta(),\n );\n $arregloAlertas[] = $arreglo;\n }\n return response( $arregloAlertas , 200)->header('Content-Type', 'application/json'); \n \n }", "public function getListadoObligacioness() {\n return $this->conexionObligaciones->listaLlaves(\"CARNET\", \"ASC\");\n }", "public function index()\n {\n return CiudadesResources::collection(Ciudad::all()); \n }", "public function listCategorias()\n\t{\n\t\t$em = $this->getEntityManager();\n\t\t\n\t\ttry{\n\t\t\t$dql = 'SELECT cat, sin FROM MbpPersonalBundle:Categorias cat JOIN cat.idSindicato sin\n\t\t\t\t\tWHERE cat.inactivo = 0';\n\t\t\t$query = $em->createQuery($dql);\n\t\t\t$res = $query->getArrayResult();\n\t\t\t\n\t\t\t$rec = array();\n\t\t\t$i=0;\n\t\t\tforeach($res as $reg){\n\t\t\t\t$rec[$i] = $reg;\n\t\t\t\t$rec[$i]['sindicato'] = $reg['idSindicato']['sindicato'];\n\t\t\t\t$rec[$i]['idCategoria'] = $reg['id'];\n\t\t\t\t$rec[$i]['idSindicato'] = $reg['idSindicato']['id'];\n\t\t\t\tunset($rec[$i]['id']);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$jsonRes = json_encode(array(\n\t\t\t\t'items' => $rec\n\t\t\t));\n\t\t\t\n\t\t\techo $jsonRes;\t\n\t\t}catch(\\Doctrine\\ORM\\ORMException $e){\n\t\t\t$this->get('logger')->error($e->getMessage());\n\t\t}\n\t\t\n\t}", "function listarFactura(){\r\n\t\t$this->procedimiento='tesor.ft_factura_sel';\r\n\t\t$this->transaccion='TSR_FAC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\t\t\t\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_factura','int4');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('nro_factura','int4');\r\n\t\t$this->captura('nombre_emisor','varchar');\t\t\r\n\t\t$this->captura('domicilio_emisor','varchar');\r\n\t\t$this->captura('nit_emisor','int4');\r\n\t\t$this->captura('nombre_cliente','varchar');\t\t\r\n\t\t$this->captura('domicilio_cliente','varchar');\r\n\t\t$this->captura('nit_cliente','int4');\r\n\t\t$this->captura('fecha_emision','date');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function obtenerComentarios($idpincho){\n\t\t$comentario = new Comentarios();\n\t\treturn $comentario->listarPorPincho($idpincho);\n\t}", "public function listarc()\n\t{\n\t\t$sql=\"SELECT * FROM persona WHERE tipo_persona = 'Cliente';\";\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function index()\n {\n $cm_clientes = CmCliente::with(\"contrato.cliente\", \"cmmac\", 'orden_trabajo', \"estado_cm\")->get();\n return $cm_clientes;\n }", "static function listaClanaka(){\n\t\trequire_once(MODEL_ABS.'DB_DAO/Broker_baze.php');\n\t\trequire_once(MODEL_ABS.'DB_DAO/Clanak.php');\n\t\t\n\t\t$broker=new Broker();\n\t\t$clanak=new Clanak($broker);\n\t\t(isset($_GET['pag'])) ? $pag=$_GET['pag'] : $pag=0;\n\t\t(isset($_GET['korak'])) ? $korak=$_GET['korak'] : $korak=5;\n\t\t\n\t\t$rezultat['clanci']=$clanak->limitClanci($pag,$korak);\n\t\t$br_clanaka=$clanak->brojanjeClanaka();\n\t\t$rezultat['pags']=ceil($br_clanaka/$korak);\n\t\t$rezultat['pag']=$pag;\n\t\t\n\t\treturn $rezultat;\n\t}", "public function get_centroCosto(){\n\t\t\t\n\t\t\ttry { \n\t\t\t\tglobal $conn;\n\t\t\t\t$sql=\"SELECT distinct AREA.COD_CC2, AREA.NOM_CC2 \n\t\t\t\t\t\tFROM CENTROCOSTO2 AREA, EMPLEADOS_BASIC EPL, EMPLEADOS_GRAL GRAL\n\t\t\t\t\t\tWHERE EPL.COD_EPL = GRAL.COD_EPL\n\t\t\t\t\t\tAND EPL.COD_CC2=AREA.COD_CC2\n\t\t\t\t\t\tand AREA.estado='A'\n\t\t\t\t\t\tand EPL.estado='A'\n\t\t\t\t\t\torder by nom_cc2 asc\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\twhile($fila=$rs->FetchRow()){\n\t\t\t\t\t$this->lista[]=array(\"codigo\" => $fila[\"COD_CC2\"],\n\t\t\t\t\t\t\t\t\t\t \"area\"\t => utf8_encode($fila[\"NOM_CC2\"]));\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn $this->lista;\n\t\t\t\t\n\t\t\t}catch (exception $e) { \n\n\t\t\t var_dump($e); \n\n\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t} \n\t\t\t\n\t\t\t\n\t\t}", "public function listcentroatencion($id_demarcacion = null)\n {\n if (is_null($id_demarcacion)) {\n $list_centroatencion = \\common\\models\\poc\\CentroAtencionCiudadano::find()->all();\n } else {\n $list_centroatencion = \\common\\models\\poc\\CentroAtencionCiudadano::find()->where(['id_demarcaciones' => $id_demarcacion])->all();\n }\n\n return $list_centroatencion;\n }", "public function index()\n {\n //\n return ExamenesClinicos::all();\n }", "public function consultar_configuracion(){\n $listado = [];\n #Recorro la jornada....\n $resultados = $this->mongo_db->order_by(array('_id' => 'DESC'))->where(array('eliminado'=>false))->get(\"configuracion_reservaciones\");\n foreach ($resultados as $clave => $valor) {\n $valores = $valor;\n $listado[]= $valores;\n }\n return $valores;\n }", "public function ciudades_all()\n {\n $ciudad = Ciudad::with('departamento')->get();\n\n return $this->sendResponse($ciudad->toArray(), 'Ciudades devueltas con éxito');\n }", "public function getListaOcupaciones() {\n \n $listaOcupaciones = array();\n \n $dbAccess = new DBAccess();\n $result = $dbAccess->getSelect(\"SELECT * from ocupacion\");\n\n foreach($result as $row){\n \n $ocupacion = new Ocupacion($row['idocupacion'], $row['idempleado'], $row['fecha_ocupado']);\n array_push($listaOcupaciones, $ocupacion); \n }\n \n return $listaOcupaciones;\n }", "public function CarregaClientes() {\n\t\t$clientes = new Model_Wpr_Clientes_ClientesIntegracao ();\n\t\t\n\t\treturn $clientes->carregaClientes ();\n\t}", "public function getAll()\n {\n $data = array();\n $rs = parent::findAll(array(\"name\" => \"Commande\"));\n foreach ($rs as $k => $v) {\n foreach ($v as $vi) {\n $data[$k] = new Commande($v['ID'],$v['CLIENTID'],$v['PRODID'],$v['NBPRODUITS'],$v['DATEAJOUT']);\n }\n }\n return $data;\n }", "public static function obtenerTodos()\n\t{\n\t\t$listaColores = NULL;\n\n\t\ttry\n\t\t{\n\t\t\t$sentencia = \"select * from colores\";\n\t\t\t$resultado = mysql_query($sentencia, BD::conectar());\n\n\t\t\tif ($resultado)\n\t\t\t{\n\t\t\t\t$listaColores = array();\n\t\t\t\t$contador = 0;\n\t\t\t\twhile ($fila = mysql_fetch_array($resultado))\n\t\t\t\t{\n\t\t\t\t\t$color = self::obtenerDatos($fila);\n\t\t\t\t\tif ($color != NULL)\n\t\t\t\t\t{\n\t\t\t\t\t\t$listaColores[$contador++] = $color;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tLogger::aviso(\"<CADColor::obtenerTodos() Color nulo nº $contador\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLogger::error(\"<CADColor::obtenerTodos() \".$e->getMessage());\n\t\t\t$listaColores = NULL;\n\t\t}\n\n\t\treturn $listaColores;\n\t}", "public static function getAll()\n\t{\n\t\t$categories = self::find()->asArray()->all(); // Добавить проверку если в prize is_limit = 0 and amount = 0\n\t\tforeach ($categories as $k => $category) {\n\t\t\t$categories[$k]['icon'] = self::getIconName($category['name']);\n\t\t}\n\t\treturn $categories;\n\t}", "public function getFiltroCulinarias()\n {\n return Query::fetch('Busca/Filtros/QryBuscarCulinariasComQuantidades');\n }", "public function obtenerCiclos() {\r\n $ciclo = new Ciclo;\r\n $respuestaObtenerCiclos = $ciclo->obtenerCiclos();\r\n return $respuestaObtenerCiclos;\r\n }", "public function consultarDatosCita($idCita){\n\t\t\n\n\t\t$resultadoCita = array();\n\t\t\n\t\t$idCita \t= parent::escaparQueryBDCliente($idCita); \n\t\t\n\t\t$query = \"SELECT C.idAgendaCita, C.fecha, DATE_FORMAT(C.horaInicio, '%H:%i') horaInicio, C.fechaFin, C.horaFin, C.duracionHoras, C.duracionMinutos, C.estado, \n\t\t\t\t\tC.observaciones, C.idMascota, C.idSucursal,C.idTipoCita, C.idPropietario,\n\t\t\t\t\tM.nombre as nombrePaciente, \n\t\t\t\t\tS.nombre as nombreSucursal, S.telefono1 as telefono1Sucursal, S.direccion,\n\t\t\t\t\tTC.nombre as nombreTipoCita,\n\t\t\t\t\tP.identificacion, P.nombre as nombrePropietario, P.apellido, P.telefono, P.celular, P.email\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tFROM tb_agendaCitas as C\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tINNER JOIN tb_agendaCitas_usuarios AS U on U.idAgendaCita = C.idAgendaCita\n\t\t\t\t\tINNER JOIN tb_mascotas as M on M.idMascota = C.idMascota\n\t\t\t\t\tINNER JOIN tb_sucursales AS S on S.idSucursal = C.idSucursal\n\t\t\t\t\tINNER JOIN tb_propietarios AS P on P.idPropietario = C.idPropietario\n\t\t\t\t\tLEFT JOIN tb_tiposCita AS TC on TC.idTipoCita = C.idTipoCita\n\t\t\t\t\t\n\t\t\t\t\tWHERE C.idAgendaCita = '$idCita' LIMIT 1\";\n\t\t\n $conexion = parent::conexionCliente();\t\t\n\t\n\t\tif($res = $conexion->query($query)){\n while ($filas = $res->fetch_assoc()) {\n \t\t$resultadoCita[] = $filas;\n \t}//fin while\n \t\n }//fin if\t\n \n \n return $resultadoCita;\t\n\t\t\n\t\t\n\t}", "public function ctlBuscaCompras(){\n\n\t\t$respuesta = Datos::mdlCompras(\"entradas\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"codProducto\"].'\">'.$item[\"noOperacion\"].' - '.$item[\"proveedor\"].' - '.$item[\"kg\"].' - '.$item[\"precio\"].'</option>';\n\t\t}\n\t}", "public function getAllCurricula() {\n return $this->get('get_all_curricula');\n }", "public function listarSocios() {\r\n $sql = \"select j.nombre,j.apellido,j.cedula,j.fechanac, j.porcentaje, m.nombre from juntadirectiva as j, municipio as m \"\r\n\t\t .\" where j.ciudadnac = m.id\";\t\t\r\n $respuesta = $this->object->ejecutar($sql);\r\n $this->construirListadoSocio($respuesta);\r\n }", "public function liste_conges()\n {\n $menu['title'] = \"IPSSI - Liste demandes de congés\";\n $menu['back'] = $this->back;\n $menu['menu'] = $this->menu->recupMenuBack($this->session->userdata('id'));\n $data['droits'] = $this->droits;\n $data['congesPersonnels'] = $this->ressources_humaines_back_model->recupCongesPersonnels($this->session->userdata('id'));\n $data['conges'] = $this->ressources_humaines_back_model->recupConges($this->session->userdata('id'));\n \n $this->load->view('back/include/menu.php', $menu);\n $this->load->view('back/ressources_humaines/gestion_conges/liste-conges.php', $data);\n }", "function get_all_configuracion()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('configuracion')->result_array();\n }", "function index()\n {\n return $this->dp->getAllCinema();\n }", "public static function getAllCancioness(){\n $bd = Database::getInstance();\n $bd->query(\"SELECT * FROM canciones;\");\n \n $datos = [];\n\n while($item = $bd->getRow(\"cancion\")){\n array_push($datos,$item);\n }\n return $datos;\n }", "public function getConsolas(){\n //Equivalente a un SELECT * FROM consolas\n $consolas = Consola::all();\n return $consolas;\n }", "public function mostrarDados(){\n\t\t$sql = \"SELECT cliente.cod_cliente, cliente.nome_cliente, categoria.cod_categoria, categoria.desc_categoria, servico.cod_servico, servico.desc_servico, servico.foto\t\n\t\t\t\tFROM cliente INNER JOIN (categoria INNER JOIN servico ON categoria.cod_categoria = servico.cod_categoria) ON cliente.cod_cliente = servico.cod_cliente\n\t\t\t\twhere cod_servico = '$this->cod_servico'\";\n\t\t$qry= self:: executarSQL($sql);\n\t\t$linha = self::listar($qry);\n\t\t\n\t\t$this-> cod_servico = $linha['cod_servico'];\n\t\t$this-> cod_categoria = $linha['cod_categoria'];\n\t\t$this-> desc_categoria = $linha['desc_categoria'];\n\t\t$this-> cod_cliente = $linha['cod_cliente'];\n\t\t$this-> nome_cliente = $linha['nome_cliente'];\n\t\t$this-> desc_servico = $linha['desc_servico'];\n\t\t$this-> foto = $linha['foto'];\n\t}", "public function index()\n {\n return Cliente::all();\n }", "public static function TraerTodoLosCds()\n\t{\n\t\t$objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso(); \n\t\t$consulta =$objetoAccesoDato->RetornarConsulta(\"select id, titel as titulo, interpret as cantante, jahr as año from cds\");\n\t\t$consulta->execute();\t\t\t\n\t\treturn $consulta->fetchAll(PDO::FETCH_CLASS, \"CD\");\t\t\n\t}", "public function listar(){\n\t\t$lista = Contato::select('id','nome','email','telefone')->get();\n\t\treturn $lista;\n\t}", "public function getAllCiudades()\n\t{\n $consulta = $this->db->prepare(\"\n SELECT COD_CIUDAD, NOM_CIUDAD, REGION_COD_REGION \n FROM t_ciudad ORDER BY NOM_CIUDAD\n \");\n\n $consulta->execute();\n\n return $consulta;\n\t}", "public static function getAll(){\n $result = static::$conn->query(\"SELECT * FROM enews.category\");\n return $result->fetchAll(\\PDO::FETCH_ASSOC);\n }", "function listarCotizacion(){\n\t\t$this->procedimiento='adq.f_cotizacion_sel';\n\t\t$this->transaccion='ADQ_COT_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t\n\t\t$this->setParametro('id_funcionario_usu','id_funcionario_usu','int4');\n $this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\n $this->setParametro('historico','historico','varchar');\n \n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cotizacion','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('estado','varchar');\n\t\t$this->captura('lugar_entrega','varchar');\n\t\t$this->captura('tipo_entrega','varchar');\n\t\t$this->captura('fecha_coti','date');\n\t\t$this->captura('numero_oc','varchar');\n\t\t$this->captura('id_proveedor','int4');\n\t\t$this->captura('desc_proveedor','varchar');\n\t\t\n\t\t$this->captura('fecha_entrega','date');\n\t\t$this->captura('id_moneda','int4');\n\t\t$this->captura('moneda','varchar');\n\t\t$this->captura('id_proceso_compra','int4');\n\t\t$this->captura('fecha_venc','date');\n\t\t$this->captura('obs','text');\n\t\t$this->captura('fecha_adju','date');\n\t\t$this->captura('nro_contrato','varchar');\n\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_estado_wf','integer');\n\t\t$this->captura('id_proceso_wf','integer');\n\t\t$this->captura('desc_moneda','varchar');\n\t\t$this->captura('tipo_cambio_conv','numeric');\n\t\t$this->captura('email','varchar');\n\t\t$this->captura('numero','varchar');\n\t\t$this->captura('num_tramite','varchar');\n\t\t$this->captura('id_obligacion_pago','int4');\n\t\t$this->captura('tiempo_entrega','varchar');\n\t\t$this->captura('funcionario_contacto','varchar');\n\t\t$this->captura('telefono_contacto','varchar');\n\t\t$this->captura('correo_contacto','varchar');\n\t\t$this->captura('prellenar_oferta','varchar');\n\t\t$this->captura('forma_pago','varchar');\n\t\t$this->captura('requiere_contrato','varchar');\n\t\t$this->captura('total_adjudicado','numeric');\n\t\t$this->captura('total_cotizado','numeric');\n\t\t$this->captura('total_adjudicado_mb','numeric');\n\t\t$this->captura('tiene_form500','varchar');\n\t\t$this->captura('correo_oc','varchar');\n\n\t\t$this->captura('id_gestion','int4');\n\n\t\t$this->captura('cuce','varchar');\n\t\t$this->captura('fecha_conclusion','date');\n\t\t$this->captura('id_solicitud','int4');\n\t\t$this->captura('justificacion','text');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function all($cod_clase, $cod_interno = null) {\n\t\t\t$conditions = array('cod_clase' => $cod_clase);\n\t\t\tif (!is_null($cod_interno))\n\t\t\t\t$conditions['cod_interno'] = $cod_interno;\n\t\t\treturn parent::all(__CLASS__, array('conditions' => $conditions));\n\t\t}", "public function listarcurso()\n {\n return $this->db->get(\"curso\")->result_array();\n }", "public function ListarCajasAbiertas()\n{\n\tself::SetNames();\n\t$sql = \" select * from cajas INNER JOIN arqueocaja ON cajas.codcaja = arqueocaja.codcaja LEFT JOIN usuarios ON cajas.codigo = usuarios.codigo WHERE arqueocaja.statusarqueo = '1'\";\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 indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MrsBlogBundle:Cidades')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function index_carrera()\n\t{\n\t\t$this->paginate = array('limit'=>30, 'order' => array('nombre' => 'asc'));\n\t\t$this->set('carreras', $this->paginate('Carrera')); \n\t}", "function list_all() {\n $ssql = \"select nombre from TBL_FRONTS where estado=\" . I_ACTIVE;\n $this->DBobj->loadRS($ssql);\n if (!$this->DBobj->noEmpty)\n return null;\n $i = 0;\n $list = array();\n while ($idV = $this->DBobj->get_vector()) {\n $list[$i] = $this->objsCache->get_object(get_class(), $idV[0]);\n $i++;\n }\n return $list;\n }", "public function getContatos()\n {\n $contatos = $this->contatoBO->getContatos();\n\n return $this->toJson($contatos);\n }", "public function getAllRows() {\n \n $stmt = $this->conexao->prepare(\"SELECT * FROM categoria\");\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS);\n }", "public function listing() {\n $this->aConfigs = $this->oLegalNotice->select();\n }", "public function getFkArrecadacaoLancamentoCalculos()\n {\n return $this->fkArrecadacaoLancamentoCalculos;\n }", "public function index()\n {\n $contatos = FaleConosco::orderByDesc('created_at')->paginate();\n\n return view('admin.fale-conosco.index', compact('contatos'));\n }", "function listarCitasDisponibles()\n\t\t{\n\t\t\t$dia = $this->uri->segment(3);\n\t\t\t$mes = $this->uri->segment(4);\n\t\t\t$year = $this->uri->segment(5);\n\t\t\t$diaDeLaSemana = date('N',mktime(0, 0, 0, $mes, $dia, $year));\n\t\t\t\n\t\t\t//Obetenemos los arrays de horarios del dia de la semana concreto\n\t\t\t$diasSemana = $this->PacienteModel->getCalendario();\n\t\t\tforeach ($diasSemana as $value) {\n\t\t\t\tif($diaDeLaSemana == $value->Dia)\n\t\t\t\t{\n\t\t\t\t\t$horaInicio = explode(':', $value->HoraInicio);\n\t\t\t\t\t$horaFin = explode(':', $value->HoraFin);\n\t\t\t\t\t$duracionCita[] = $value->DuracionCita;\n\t\t\t\t\t$unixInicio[] = mktime($horaInicio[0], $horaInicio[1], 0, $mes, $dia, $year);\n\t\t\t\t\t$unixFin[] = mktime($horaFin[0], $horaFin[1], 0, $mes, $dia, $year);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Comprobamos las citas planificadas para el dia concreto\n\t\t\t$data = $this->PacienteModel->getCitasDisponibles($dia, $mes, $year);\n\t\t\tforeach ($data as $value) {\n\t\t\t\t$aux = explode(\" \", $value->FechaIni);\n\t\t\t\t$aux = $aux[1];\n\t\t\t\t$aux = explode(\":\", $aux);\n\t\t\t\t$hora[] = $aux[0];\n\t\t\t\t$min[] = $aux[1];\n\t\t\t}\n\t\t\t\n\t\t\t//Si no hay ninguna cita se ponen los arrays fuera de rango\n\t\t\tif(!isset($hora) && !isset($min))\n\t\t\t{\n\t\t\t\t$hora[0] = -1;\n\t\t\t\t$min[0] = -1;\n\t\t\t}\n\n\t\t\t//Visualizamos las citas disponibles\n\t\t\techo '<ul class=\"list-group\">';\n\t\t\techo '<li class=\"list-group-item\">'.date('d-m-Y',mktime(0, 0, 0, $mes, $dia, $year)).'</li>';\n\t\t\tfor($j = 0; $j < sizeof($unixInicio); $j++)\n\t\t\t\tfor($i = $unixInicio[$j]; $i < $unixFin[$j]; $i += 60*$duracionCita[$j] )\n\t\t\t\t{\n\t\t\t\t\tif ( (in_array(date('H',$i), $hora) && in_array(date('i',$i), $min) )\n\t\t\t\t\t\t|| time()>$i )\n\t\t\t\t\t\techo '<li class=\"list-group-item\">'.date('H:i',$i).'</li>';\n\t\t\t\t\telse \n\t\t\t\t\t\techo '<li class=\"list-group-item active\">\n\t\t\t\t\t\t\t<a style=\"color: black;\" onclick=\"crearCita(\\''.$this->session->userdata('id').'\\',\n\t\t\t\t\t\t\t\\''.date('Y-m-d H:i:s',$i).'\\',\n\t\t\t\t\t\t\t\\''.date('Y-m-d H:i:s',$i + 60 * $duracionCita[$j]).'\\'\n\t\t\t\t\t\t\t)\">'.date('H:i',$i).'</a></li>';\n\t\t\t\t}\n\t\t\techo '</ul>';\n\t\t}", "public function getAll() {\n //$this->db = Database::connect();\n $resultado;\n\n $cursos = new ArrayObject();\n if(!empty($resultado)){\n $objeto;\n while ($fila = mysqli_fetch_array($resultado)) {\n $objeto = new curso();\n $objeto->constructor($fila['IdCurso'], $fila['Nombre'], $fila['Precio']);\n $cursos->append($objeto);\n }\n }\n\n return $cursos;\n }", "public static function getAll()\n {\n $consulta = \"SELECT * FROM clientes\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function index()\n {\n //\n return DetalleProporcionPaciente::all();\n }", "public function ListarCajas()\n{\n\tself::SetNames();\n\t$sql = \" select * from cajas LEFT JOIN usuarios ON cajas.codigo = usuarios.codigo\";\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}", "function SHOWALL(){\r\n\r\n $stmt = $this->db->prepare(\"SELECT * FROM edificio\");\r\n $stmt->execute();\r\n $edificios_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $alledificios = array(); //array para almacenar los datos de todos los edificios\r\n\r\n //Recorremos todos las filas de edificios devueltas por la sentencia sql\r\n foreach ($edificios_db as $edificio){\r\n //Introducimos uno a uno los edificios recuperados de la BD\r\n array_push($alledificios,\r\n new EDIFICIO_Model(\r\n $edificio['edificio_id'],$edificio['nombre_edif'],$edificio['direccion_edif']\r\n ,$edificio['telef_edif'],$edificio['num_plantas'],$edificio['agrup_edificio']\r\n )\r\n );\r\n }\r\n return $alledificios;\r\n }", "public function getAllClients(){\n\t\t$sql = \"SELECT * FROM cliente;\";\n\t\treturn $this->Model->getData($sql);\n\t}", "function consultarenviodetallesCedula (){\n\t\t$x = $this->pdo->prepare('SELECT En.empresa,En.telefono,En.fechaEnvio,Cl.cedula FROM enviodetalles EN INNER JOIN cliente Cl ON En.cedulaCliente = Cl.cedula');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "public function calendarioacedemico()\n {\n return $this->hasMany(CalendarioAcad::class, 'iCalAcadId');\n }" ]
[ "0.63419724", "0.6276612", "0.59976876", "0.59876746", "0.588597", "0.5843726", "0.58398104", "0.57474965", "0.5711451", "0.5697405", "0.55883914", "0.5585797", "0.556537", "0.5531148", "0.551706", "0.5507387", "0.55042535", "0.54948694", "0.54488635", "0.54328007", "0.5381347", "0.5356152", "0.5353318", "0.5350892", "0.5347415", "0.53431576", "0.5338323", "0.53161824", "0.5302406", "0.52953917", "0.52943134", "0.5292393", "0.5281591", "0.5277854", "0.5271067", "0.52633077", "0.5258009", "0.5255391", "0.5241157", "0.52360415", "0.5230063", "0.5229086", "0.5224115", "0.5222129", "0.5219897", "0.5213155", "0.5192682", "0.51858014", "0.51800346", "0.5179868", "0.51731694", "0.5170949", "0.51695263", "0.51656747", "0.51646554", "0.5163679", "0.5161584", "0.5151691", "0.5150714", "0.51458764", "0.5145294", "0.51389754", "0.5136103", "0.5134681", "0.5125484", "0.5122369", "0.5121558", "0.51146185", "0.51140696", "0.51131195", "0.5112415", "0.5107565", "0.51058275", "0.50972587", "0.5096199", "0.50950944", "0.5094958", "0.5093429", "0.5088313", "0.50856185", "0.5085517", "0.50852054", "0.50848556", "0.50826293", "0.50784636", "0.5076093", "0.50698245", "0.50645655", "0.50623536", "0.5061667", "0.50607306", "0.5057752", "0.505575", "0.505421", "0.505408", "0.5049666", "0.5048547", "0.50470763", "0.50442374", "0.503704" ]
0.56851524
10
Creates a form to delete a SvCfgCalzadaCarril entity.
private function createDeleteForm(SvCfgCalzadaCarril $svCfgCalzadaCarril) { return $this->createFormBuilder() ->setAction($this->generateUrl('svcfgcalzadacarril_delete', array('id' => $svCfgCalzadaCarril->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Contabilizar $contabilizar)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('contabilizar_delete', array('id' => $contabilizar->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(SvCfgDisenio $SvCfgDisenio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Svcfgdisenio_delete', array('id' => $SvCfgDisenio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Caisse $caisse)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caisse_delete', array('id' => $caisse->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Etat_civil $etat_civil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('etat_civil_delete', array('id' => $etat_civil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cancion $cancion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cancion_delete', array('id' => $cancion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(EcoCardiogramaTransesofagico $ecoCardiogramaTransesofagico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ecocardiogramatransesofagico_delete', array('id' => $ecoCardiogramaTransesofagico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cargaison $cargaison)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cargaison_delete', array('id' => $cargaison->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n $translated = $this->get('translator');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configuracao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $translated->transChoice('txt.excluir',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-danger btn-lg')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Feuil $feuil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('feuil_delete', array('id' => $feuil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm1($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('calendarcategories_delete', array('id' => $id)))\n ->setMethod('DELETE')\n /* ->add('submit', 'submit', array('label' => 'Delete')) */\n ->getForm()\n ;\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(Cahierdescharges $cahierdescharge) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cahierdescharges_delete', array('id' => $cahierdescharge->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Clasificaciontg $clasificaciontg)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clasificaciontg_delete', array('id' => $clasificaciontg->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Centro $centro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('centro_delete', array('id' => $centro->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ActividadAcademica $actividadAcademica)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('delete_actividadacademica', array('actividadAcademica' => $actividadAcademica->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Complect $complect)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nomenclature_complect_delete', array('id' => $complect->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cours $listeCour)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('listecours_delete', array('id' => $listeCour->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(CfgTipoAlerta $cfgTipoAlertum)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cfgtipoalerta_delete', array('id' => $cfgTipoAlertum->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnel_covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(TblCursosDocentes $tblCursosDocente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tblcursosdocentes_delete', array('id' => $tblCursosDocente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Caso $caso)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caso_delete', array('id' => $caso->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm ( Maileguak $maileguak )\n {\n return $this->createFormBuilder()\n ->setAction( $this->generateUrl( 'maileguak_delete', array ('id' => $maileguak->getId()) ) )\n ->setMethod( 'DELETE' )\n ->getForm();\n }", "private function createDeleteForm(Sous_categorie $sous_categorie)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sous_categorie_delete', array('id' => $sous_categorie->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }", "private function createDeleteForm(Clatesal $clatesal)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clatesal_delete', array(\n\n 'clasificacion' => $clatesal->getClasificacion()->getId(),\n 'categoria'=>$clatesal->getCategoria()->getId(),\n 'tiempoDedicacion'=>$clatesal->getTiempoDedicacion()->getId(),\n\n )))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ArmasMedico $armasMedico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('armasmedico_delete', array('id' => $armasMedico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Categorie_Produit $categorie_Produit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('categorie_produit_delete', array('id' => $categorie_Produit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "protected function createComponentDeleteRate()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteRateSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(Fratura $fratura)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fratura_delete', array('id' => $fratura->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(FroFacTransferencia $froFacTransferencium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('frofactransferencia_delete', array('id' => $froFacTransferencium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('periododeinscricao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('member_intrestconfig_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Delete'))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function genDeleteForm($id)\n {\n return $this->createFormBuilder(null, array('attr' => array( 'id' => 'ct_del_form', 'style' => 'display:none')))\n ->setAction($this->generateUrl('morus_fas_contacts_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $this->get('translator')->trans('btn.delete')))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caracteristicasequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm(CargoSubDivisao $vaga)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pessoal_gerenciar_vagas_delete', array('id' => $vaga->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n { \n \n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aulas_aula_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(AdminPensionadoInstitucion $adminPensionadoInstitucion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configurable_pensionados_instituciones_delete', array('id' => $adminPensionadoInstitucion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Reactif $reactif)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('reactif_delete', array('numreact' => $reactif->getNumreact())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Facture $facture)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('facture_delete', array('id' => $facture->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Estadosciviles $estadoscivile)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('estadosciviles_delete', array('idEstadocivil' => $estadoscivile->getIdestadocivil())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('finanzascategoria_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dzialy_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Usuń Dział' , 'attr' => array('class' => 'btn btn-danger' , 'icon' => 'times fa-fw')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pifeclassique_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Tipoanuncio $tipoanuncio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipoanuncio_delete', array('id' => $tipoanuncio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnoequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'ELIMINAR'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Atletas $atleta) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('atletas_delete', array('id' => $atleta->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cuisine $cuisine)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cuisine_delete', array('id' => $cuisine->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(FormulaireSecours $formulaireSecour)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('formulairesecours_delete', array('id' => $formulaireSecour->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Funcionario $funcionario)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('funcionario_delete', array('id' => $funcionario->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admin_consulta_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clientecredito_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('adtiposcomision_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(CMS $cM)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cms_delete', array('id' => $cM->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(SvCfgSenialTipo $svCfgSenialTipo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('svcfgsenialtipo_delete', array('id' => $svCfgSenialTipo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function createComponentDeleteForm($val){\n\t\t$form = new \\Nette\\Application\\UI\\Form();\n\t\t$url = $this->link('pages:delete');\n\t\t$form->setAction($url);\n\t\t$form->addHidden('id', $val->id);\n\t\t$form->addSubmit('submit', 'Smazat');\n\t\t$form->onSubmit[] = callback($this, 'deleteFormSubmitted');\n\t\treturn $form;\n\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('envase_ingreso_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private\n function createAnnonceeDeleteForm(Annonce $annonce)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annoncee_delete', array('id' => $annonce->getAnnonceId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Annonce_appart $annonce_appart) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annonce_appart_delete', array('id' => $annonce_appart->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(MsvTalonario $msvTalonario)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('msvtalonario_delete', array('id' => $msvTalonario->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(PsychEvalFreq $psychEvalFreq)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eval_freq_delete', array('id' => $psychEvalFreq->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ConfiguracaoBancoHoras $ponto)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ponto_configuracao_banco_horas_delete', array('id' => $ponto->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(CvCdoComparendo $cvCdoComparendo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cvcdocomparendo_delete', array('id' => $cvCdoComparendo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnoasignar_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'ELIMINAR ASIGNACION'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bien_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger'),))\n ->getForm()\n ;\n }", "private function createDeleteForm(MostraMizaUllirit $mostraMizaUllirit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mostramizaullirit_delete', array('id' => $mostraMizaUllirit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admtipoaporte_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Eliminar','attr'=>array('class'=>'btn btn-danger')))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Procedencia $procedencia)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('procedencia_delete', array('id' => $procedencia->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('medicamentossuministrados_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'attr' => array('class' => 'btn')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipuscentre_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Ficha $ficha)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ficha_delete', array('id' => $ficha->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ClasseMatiere $classeMatiere)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('class_mat_delete', array('id' => $classeMatiere->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Historique $historique)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('historique_delete', array('id' => $historique->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administracion_servicio_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Justicia $justicium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('justicia_delete', array('id' => $justicium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sucursal_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('com_incident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer','attr'=>array('class'=>'btn btn-danger','style'=>'width:100px;')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cosecha_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm(Dependencia $dependencium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dependencia_delete', array('id' => $dependencium->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_categoriaport_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detailsproduits_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(DatParteDesvio $datParteDesvio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('partedesvio_delete', array('id' => $datParteDesvio->getIdparte())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_partner_category_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit',\n array(\n 'label' => 'Supprimer',\n 'attr' => array('class' => 'btn btn-danger')\n ))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('client_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sifdainformeordentrabajo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar informe'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Fita $fitum)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cadastro_fita_delete', array('id' => $fitum->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Scenaristes $scenariste)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('scenaristes_delete', array('id' => $scenariste->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Acteur $acteur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acteur_delete_homepage', array('id' => $acteur->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cole_deletar', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Deces $dece)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('deces_delete', array('id' => $dece->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(NomDpa $nomdpa)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dpa_delete', array('id' => $nomdpa->getIddpa())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createComptesDeleteForm(Compte $compte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('comptes_delete', array('id' => $compte->getCompteId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('boncommandeligne_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_sesionventatratamiento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }" ]
[ "0.7063467", "0.69667834", "0.67409843", "0.6692823", "0.66592586", "0.6619199", "0.6614296", "0.6583932", "0.6559359", "0.6527039", "0.65194976", "0.6517043", "0.65096676", "0.64998555", "0.6472747", "0.64585733", "0.64558613", "0.64399177", "0.6433952", "0.64223593", "0.641798", "0.6404937", "0.639871", "0.63863975", "0.6382619", "0.63664633", "0.6361736", "0.6352224", "0.63419145", "0.633277", "0.63273466", "0.6320472", "0.6314375", "0.6298022", "0.6290372", "0.6287964", "0.6282523", "0.62709165", "0.626111", "0.62545556", "0.62505215", "0.6248761", "0.62470186", "0.624687", "0.6224642", "0.6222601", "0.6215987", "0.62114364", "0.6202226", "0.6201774", "0.61996406", "0.6199385", "0.6192462", "0.6190087", "0.6178716", "0.6172917", "0.61728495", "0.6163689", "0.616037", "0.6156842", "0.615529", "0.61498594", "0.61469585", "0.61458987", "0.61456156", "0.6134379", "0.6133387", "0.613142", "0.6129542", "0.6126109", "0.61160207", "0.61135304", "0.6112911", "0.61123276", "0.6106726", "0.6103005", "0.6101336", "0.6100103", "0.60967875", "0.60944474", "0.6093172", "0.6093059", "0.60876197", "0.6076684", "0.607487", "0.60705674", "0.606984", "0.6067685", "0.6063024", "0.6058336", "0.6057948", "0.6057222", "0.60463", "0.6039015", "0.6038858", "0.6038534", "0.6038311", "0.6035907", "0.60358906", "0.6032077" ]
0.79635614
0
Initializes the object. This method is called at the end of the constructor. The default implementation will trigger an [[EVENT_INIT]] event. If you override this method, make sure you call the parent implementation at the end to ensure triggering of the event.
public function init() { parent::init(); $this->trigger(self::EVENT_INIT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init() {\n parent::init();\n }", "public function init() {\n parent::init();\n }", "public function init() {\n parent::init();\n }", "public function init() {\r\n parent::init();\r\n }", "function init()\r\n\t\t{\r\n\t\t\t// Should always call parent's init\r\n\t\t\tparent::init();\r\n\t\t}", "public function init() {\n\t\tparent::init();\n\t}", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function init()\r\n {\r\n parent::init();\r\n }", "public function init()\n {\n parent::init();\n }", "public function init()\n {\n parent::init();\n }", "public function init()\n {\n parent::init();\n }", "public function init()\n {\n parent::init();\n }", "public function init()\n {\n parent::init();\n }", "public function init()\n {\n parent::init();\n }", "public function init()\n {\n parent::init();\n }", "public function init()\n\t{\n\t\tparent::init();\n\t}", "public function init()\n\t{\n\t\tparent::init();\n\t}", "function init()\n{\n\t$this->_init();\n\t$this->onInit();\n}", "public function init()\n {\n // Nothing needs to be done initially, huzzah!\n }", "public function init()\n {\n parent::init();\n $this->initClass();\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n\t{\n\t\t// Override this method as required.\n\t}", "public function init() {\r\n }", "public static function init()\n {\n }", "protected function __construct()\n\t\t{\n\t\t\t$this->init();\n\t\t}", "protected function __construct()\n\t\t{\n\t\t\t$this->init();\n\t\t}", "function init() {\n\t\t\n\t\tparent::init();\n\t}", "public function init()\n {\n \t\n }", "public function init()\n {\n \t\n }", "public function init() {\n \n }", "public function init() {\n \n }", "public function init() {\n \n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function __construct() {\n\t\t\t$this->init();\n\t\t}", "protected function __construct()\n\t{\n\t\t$this->_init();\n\t}", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init()\r\n\t {\r\n\t }", "public function init() {\n // nothing to do here\n }", "public function init() {\r\n\r\n\t\t}", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }" ]
[ "0.788238", "0.788238", "0.7879848", "0.7879428", "0.7879428", "0.7879428", "0.7879428", "0.7879428", "0.7879428", "0.7879428", "0.7879428", "0.7879428", "0.7879128", "0.7822284", "0.7822284", "0.7822284", "0.7818641", "0.7797968", "0.7733905", "0.7726127", "0.7726127", "0.7725367", "0.7700445", "0.7700445", "0.7700445", "0.7700445", "0.7700445", "0.7700445", "0.7700445", "0.769909", "0.769909", "0.76781285", "0.76712185", "0.7663466", "0.76455235", "0.76455235", "0.76455235", "0.76455235", "0.76455235", "0.7639341", "0.76152563", "0.76150864", "0.76125467", "0.76125467", "0.76052517", "0.7602141", "0.7602141", "0.7592292", "0.7592292", "0.7592292", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.75650054", "0.7558999", "0.7554978", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.75501704", "0.7530766", "0.75299704", "0.75147504", "0.7512907", "0.7512907", "0.7512907", "0.7512907", "0.7512907", "0.7512907", "0.7512907" ]
0.87640554
3
Description: Setting query conditions
public function setQuery($db) { /** Create Select */ $query = $db->createSelect(); /** Get where condition */ $where = $db->getQueryBuilder()->build($this); /** Setting query and fquery */ $queryWhere = "*:*"; if(!empty($where) && is_string($where)){ $queryWhere = $where; }elseif(!empty($where) && is_array($where)){ $k = key($where[0]); $v = $where[0][key($where[0])] === '' ? '""' : $where[0][key($where[0])]; $queryWhere = $k.':'.$v; if(count($where)>1){ unset($where[0]); foreach ($where as $key=>$value){ $k = key($value); $v = $value[key($value)] === '' ? '""' : $value[key($value)]; $query->createFilterQuery($k.$key)->setQuery($k.":".$v); } } } $query->setQuery($queryWhere); /** set fields to fetch (this overrides the default setting 'all fields') */ if($this->select !== null){ $query->setFields($this->select); } /** set start and rows param (comparable to SQL limit) using fluent interface */ if(!empty($this->offset)){ if((int)$this->offset < 0){ $this->offset = 0; } $query->setStart($this->offset); } if(!empty($this->limit)){ if((int)$this->limit < 0){ $this->limit = 10; } $query->setRows($this->limit); } /** sort the results by price ascending */ if($this->orderBy !== null){ foreach ($this->orderBy as $key=>$value) { $query->addSort($key, $value == SORT_ASC ? 'ASC' :'DESC'); } } /** Document highlight */ if($this->highlight !== null && !empty($this->highlight['fields'])){ $Highlighting = $query->getHighlighting(); $pre_tags = empty($this->highlight['pre_tags']) ? '<b>' : $this->highlight['pre_tags']; $post_tags = empty($this->highlight['post_tags']) ? '</b>' : $this->highlight['post_tags']; $fields = is_string($this->highlight['fields']) ? explode(',',$this->highlight['fields']) : $this->highlight['fields']; foreach ($fields as $value){ $Highlighting->getField($value)->setSimplePrefix($pre_tags)->setSimplePostfix($post_tags); } } return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "protected function user_where_clause() {}", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "function defineCriterias($criterio,$PreparedStatement){\n\t\t\tif(isset ($criterio[\"consumo_id\"]) && trim($criterio[\"consumo_id\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_id = \".Connection::inject($criterio[\"consumo_id\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"socio_id\"]) && trim($criterio[\"socio_id\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND socio_id = \".Connection::inject($criterio[\"socio_id\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"nro_medidor\"]) && trim($criterio[\"nro_medidor\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND nro_medidor LIKE '%\".Connection::inject($criterio[\"nro_medidor\"]).\"%'\";\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_lectura\"]) && trim($criterio[\"fecha_lectura\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_lectura = \".Connection::inject($criterio[\"fecha_lectura\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_emision\"]) && trim($criterio[\"fecha_emision\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_emision = \".Connection::inject($criterio[\"fecha_emision\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"periodo_mes\"]) && trim($criterio[\"periodo_mes\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND periodo_mes = \".Connection::inject($criterio[\"periodo_mes\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"periodo_anio\"]) && trim($criterio[\"periodo_anio\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND periodo_anio = \".Connection::inject($criterio[\"periodo_anio\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"consumo_total_lectura\"]) && trim($criterio[\"consumo_total_lectura\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_total_lectura = \".Connection::inject($criterio[\"consumo_total_lectura\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"consumo_por_pagar\"]) && trim($criterio[\"consumo_por_pagar\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_por_pagar = \".Connection::inject($criterio[\"consumo_por_pagar\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"costo_consumo_por_pagar\"]) && trim($criterio[\"costo_consumo_por_pagar\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND costo_consumo_por_pagar = \".Connection::inject($criterio[\"costo_consumo_por_pagar\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"estado\"]) && trim($criterio[\"estado\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND estado = '\".Connection::inject($criterio[\"estado\"]).\"'\";\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_hora_pago\"]) && trim($criterio[\"fecha_hora_pago\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_hora_pago = \".Connection::inject($criterio[\"fecha_hora_pago\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"usuario_pago\"]) && trim($criterio[\"usuario_pago\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND usuario_pago = \".Connection::inject($criterio[\"usuario_pago\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"monto_pagado\"]) && trim($criterio[\"monto_pagado\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND monto_pagado = \".Connection::inject($criterio[\"monto_pagado\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"pagado_por\"]) && trim($criterio[\"pagado_por\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND pagado_por = \".Connection::inject($criterio[\"pagado_por\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"ci_pagado_por\"]) && trim($criterio[\"ci_pagado_por\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND ci_pagado_por = \".Connection::inject($criterio[\"ci_pagado_por\"]);\n\t\t\t}\n\t\t\treturn $PreparedStatement;\n\t\t}", "protected function getWhereClause() {}", "protected function applyFieldConditions()\n {\n if ($this->field !== null) {\n $this->andWhere(Db::parseParam('fieldId', $this->parseFieldValue($this->field)));\n }\n }", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "protected function getGeneralWhereClause() {}", "function custom_conds( $conds = array())\n\t{\n\t\t// rating_id condition\n\t\tif ( isset( $conds['id'] )) {\n\t\t\t$this->db->where( 'id', $conds['id'] );\n\t\t}\n\n\t\t// user_id condition\n\t\tif ( isset( $conds['user_id'] )) {\n\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\n\t\t}\n\n\t\t// shop_id condition\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\t$this->db->where( 'shop_id', $conds['shop_id'] );\n\t\t}\n\n\t\t// rating condition\n\t\tif ( isset( $conds['rating'] )) {\n\t\t\t$this->db->where( 'rating', $conds['rating'] );\n\t\t}\n\n\t\t// title condition\n\t\tif ( isset( $conds['title'] )) {\n\t\t\t$this->db->where( 'title', $conds['title'] );\n\t\t}\n\n\t\t// description condition\n\t\tif ( isset( $conds['description'] )) {\n\t\t\t$this->db->where( 'description', $conds['description'] );\n\t\t}\n\n\t\t$this->db->order_by( 'added_date', 'desc' );\n\t}", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "function dbWhereVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->where($this->model.'.'.$f,$this->$f);\n }\n\n }", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "function setParamsToSaveQuery()\n {\n \n \n if($this->form->getQuery())\n {\n $stringTmp=$this->form->getQuery()->getSqlQuery();\n $stringTmp=substr($stringTmp, strpos($stringTmp,' FROM ' ));\n $stringTmp=substr($stringTmp, 0, strpos($stringTmp,' LIMIT ' ));\n $this->getUser()->setAttribute('queryToSaveWhere', $stringTmp);\n }\n \n if($this->form->getQuery()->getParams())\n {\n $stringTmp=\"\";\n $arrayTmp=$this->form->getQuery()->getParams();\n if(isset($arrayTmp['where']))\n {\n foreach($arrayTmp['where'] as $key=>$value)\n {\n $stringTmp.=\";|\".$value.\"|\";\n }\n $this->getUser()->setAttribute('queryToSaveParams', $stringTmp);\n }\n }\n return;\n }", "function query() {\n // Don't filter if we're exposed and the checkbox isn't selected.\n\n if ((!empty($this->options['exposed'])) && empty($this->value)) {\n return;\n }\n if (!$this->options['exposed']) {\n $value = $this->options['uid'];\n }\n else {\n $value = $this->validated_exposed_input[0];\n }\n\n\n $this->ensure_my_table();\n\n\n $table = 'scheduling_appointments';\n //$field1 = $this->query->add_field($table, 'nid');\n //$field2 = $this->query->add_field($table, 'title');\n\n\n //$field1 = $table . '.nid';\n //$field2 = $table . '.title';\n if ($value != '') {\n $this->query->add_where(\n $this->options['group'],\n db_and()\n ->condition($table . '.uid', $value, '=')\n );\n }\n }", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "protected function getWhereClauseForEnabledFields() {}", "public function prepareQuery()\n {\n //prepare where conditions\n foreach ($this->where as $where) {\n $this->prepareWhereCondition($where);\n }\n\n //prepare where not conditions\n foreach ($this->whereNot as $whereNot) {\n $this->prepareWhereNotCondition($whereNot);\n }\n\n // Add a basic range clause to the query\n foreach ($this->inRange as $inRange) {\n $this->prepareInRangeCondition($inRange);\n }\n\n // Add a basic not in range clause to the query\n foreach ($this->notInRange as $notInRange) {\n $this->prepareNotInRangeCondition($notInRange);\n }\n\n // add Terms to main query\n foreach ($this->whereTerms as $term) {\n $this->prepareWhereTermsCondition($term);\n }\n\n // add exists constrains to the query\n foreach ($this->exist as $exist) {\n $this->prepareExistCondition($exist);\n }\n\n // add matcher queries\n foreach ($this->match as $match) {\n $this->prepareMatchQueries($match);\n }\n\n $this->query->addFilter($this->filter);\n\n return $this->query;\n }", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= [email protected]']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "public function initQueryConditions(Model $m, Query $q) : Query\n {\n if (!isset($m->conditions)) {\n // no conditions are set in the model\n return $q;\n }\n\n foreach ($m->conditions as $cond) {\n\n // Options here are:\n // count($cond) == 1, we will pass the only\n // parameter inside where()\n\n if (count($cond) == 1) {\n\n // OR conditions\n if (is_array($cond[0])) {\n foreach ($cond[0] as &$row) {\n if (is_string($row[0])) {\n $row[0] = $m->getField($row[0]);\n }\n\n if ($row[0] instanceof Field) {\n $row[1] = $this->typecastSaveField($row[0], $row[count($row) == 2 ? 1 : 2]);\n }\n }\n }\n\n $q->where($cond[0]);\n continue;\n }\n\n if (is_string($cond[0])) {\n $cond[0] = $m->getField($cond[0]);\n }\n\n if (count($cond) == 2) {\n if ($cond[0] instanceof Field) {\n $cond[1] = $this->typecastSaveField($cond[0], $cond[1]);\n }\n $q->where($cond[0], $cond[1]);\n } else {\n if ($cond[0] instanceof Field) {\n $cond[2] = $this->typecastSaveField($cond[0], $cond[2]);\n }\n $q->where($cond[0], $cond[1], $cond[2]);\n }\n }\n\n return $q;\n }", "public function andWhere($conditions);", "public static function setCondition($args = null){\r\n return self::$PDO->setCondition($args);\r\n }", "public function queryAll($campos=\"*\",$criterio=\"\");", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "function custom_conds( $conds = array())\n\t{\n\t\t// default where clause\n\t\tif ( !isset( $conds['no_publish_filter'] )) {\n\t\t\t$this->db->where( 'status', 1 );\n\t\t}\n\t\t\n\t\t// order by\n\t\tif ( isset( $conds['order_by'] )) {\n\t\t\t$order_by_field = $conds['order_by_field'];\n\t\t\t$order_by_type = $conds['order_by_type'];\n\t\t\t\n\t\t\t$this->db->order_by( 'rt_products.'.$order_by_field, $order_by_type);\n\t\t}\n\t\t// product id condition\n\t\tif ( isset( $conds['id'] )) {\n\t\t\t$this->db->where( 'id', $conds['id'] );\t\n\t\t}\n\n\t\t// category id condition\n\t\tif ( isset( $conds['cat_id'] )) {\n\t\t\t\n\t\t\tif ($conds['cat_id'] != \"\") {\n\t\t\t\tif($conds['cat_id'] != '0'){\n\t\t\t\t\t$this->db->where( 'cat_id', $conds['cat_id'] );\t\n\t\t\t\t}\n\n\t\t\t}\t\t\t\n\t\t}\n\n\t\t// sub category id condition \n\t\tif ( isset( $conds['sub_cat_id'] )) {\n\t\t\t\n\t\t\tif ($conds['sub_cat_id'] != \"\") {\n\t\t\t\tif($conds['sub_cat_id'] != '0'){\n\t\t\t\t\n\t\t\t\t\t$this->db->where( 'sub_cat_id', $conds['sub_cat_id'] );\t\n\t\t\t\t}\n\n\t\t\t}\t\t\t\n\t\t}\n\n\t\n\t\t// cat_ordering condition\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\t$this->db->where( 'shop_id', $conds['shop_id'] );\n\t\t}\n\n\t\t// product_name condition\n\t\tif ( isset( $conds['name'] )) {\n\t\t\t$this->db->where( 'name', $conds['name'] );\n\t\t}\n\n\t\tif ( isset( $conds['desc'] )) {\n\t\t\t$this->db->where( 'description', $conds['desc'] );\n\t\t}\n\n\t\t// product keywords\n\t\tif ( isset( $conds['search_tag'] )) {\n\t\t\t$this->db->where( 'search_tag', $conds['search_tag'] );\n\t\t}\n\n\t\t// product highlight information condition\n\t\tif ( isset( $conds['info'] )) {\n\t\t\t$this->db->where( 'highlight_information', $conds['info'] );\n\t\t}\n\n\t\t// product code\n\t\tif ( isset( $conds['code'] )){\n\t\t\t$this->db->where( 'code', $conds['code'] );\n\t\t}\n\n\t\t// product unit_value condition\n\t\tif ( isset( $conds['product_unit_value'] )) {\n\t\t\t$this->db->where( 'product_unit_value', $conds['product_unit_value'] );\n\t\t}\n\n\t\t// product unit condition\n\t\tif ( isset( $conds['product_unit'] )) {\n\t\t\t$this->db->where( 'product_unit', $conds['product_unit'] );\n\t\t}\n\n\t\t// product minimum_order\n\t\tif ( isset( $conds['minimum_order'] )){\n\t\t\t$this->db->where( 'minimum_order', $conds['minimum_order'] );\n\t\t}\n\n\t\t// product maximum_order\n\t\tif ( isset( $conds['maximum_order'] )){\n\t\t\t$this->db->where( 'maximum_order', $conds['maximum_order'] );\n\t\t}\n\n\t\t// point condition\n\t\tif ( isset( $conds['price_min'] ) || isset( $conds['price_max'] )) {\n\t\t\t$this->db->where( 'unit_price >= ', $conds['price_min'] );\n\t\t\t$this->db->where( 'unit_price <= ', $conds['price_max'] );\n\t\t}\n\n\t\t// feature products\n\t\tif ( isset( $conds['is_featured'] )) {\n\t\t\t$this->db->where( 'is_featured', $conds['is_featured'] );\n\t\t}\n\n\t\t// rating condition\n\t\tif ( isset( $conds['rating_value'] ) ) {\n\t\t\t// For Rating value with comma 3,4,5\n\t\t\t// $rating_value = explode(',', $conds['rating_value']);\n\t\t\t// $this->db->where_in( 'overall_rating', $rating_value);\n\n\t\t\t// For single rating value\n\t\t\t$this->db->where( 'overall_rating >=', $conds['rating_value'] );\n\t\t}\n\t\t\n\t\t// discount products\n\t\tif ( $this->is_filter_discount( $conds )) {\n\t\t\t$this->db->where( 'is_discount', '1' );\t\n\t\t}\n\n\t\t// available products\n\t\tif ( isset( $conds['is_available'] )) {\n\t\t\t$this->db->where( 'is_available', $conds['is_available'] );\n\t\t}\n\n\t\t// searchterm\n\t\tif ( isset( $conds['searchterm'] )) {\n\t\t\t$this->db->like( 'name', $conds['searchterm'] );\n\t\t}\n\n\n\t\tif( isset($conds['min_price'])) {\n\n\t\t\t\n\t\t\tif( $conds['min_price'] != 0 ) {\n\t\t\t\t$this->db->where( 'unit_price >=', $conds['min_price'] );\n\t\t\t}\n\n\t\t}\n\n\t\tif( isset($conds['max_price'])) {\n\t\t\tif( $conds['max_price'] != 0 ) {\n\t\t\t\t$this->db->where( 'unit_price <=', $conds['max_price'] );\n\t\t\t}\t\n\n\t\t}\n\n\t\t// product shop_status\n\t\tif ( isset( $conds['shop_status'] )){\n\t\t\t$this->db->where( 'shop_status', $conds['shop_status'] );\n\t\t}\n\n\t\t$this->db->order_by('added_date', 'desc' );\n\n\n\t}", "function custom_conds( $conds = array()) {\n\n\t}", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "public function set_where(array $params) {\n $where = '';\n foreach ($params as $field_name => $field_value) {\n $where .= '`' . $field_name . '` = \\'' . $field_value . '\\' AND ';\n }\n\n $where = rtrim($where, ' AND ');\n $this->where = ' WHERE ' . $where;\n }", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "abstract protected function initQuery(): void;", "public function\r\n add_conditions_to_where_clause(\r\n $conditions\r\n );", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "function addConditionalsToQuery($query, $filledFormFields) {\n\t// Testing if we have to fill the conditional of our SQL statement\n\tif(count($filledFormFields) > 0) {\n\t\t$query .= \" WHERE \";\n\n\n\t\t// Adding the conditionals to the query\n\t\t$i = 0;\n\t\tforeach($filledFormFields as $fieldKey => $fieldValue) {\n\t\t\t// Appending the new conditional\n\t\t\t$queryAppendage = $fieldKey . \" LIKE :\" . $fieldKey . \" \";\n\n\t\t\t$query .= $queryAppendage;\n\t\t\t\n\t\t\t// If there's more conditionals after this, append an \"AND\" as well.\n\t\t\tif($i < count($filledFormFields) - 1) \n\t\t\t\t$query .= \" AND \";\n\n\t\t\t$i++;\n\t\t}\n\t}\n\n\treturn $query;\n}", "function OrWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "function sql_condition_statemment(array $criteria, int $totalCount)\n {\n // Init\n $sql = \"\";\n\n // Rendr base on condition\n $count = 0;\n foreach ($criteria as $filter => $value) {\n\n $str = (is_array($value)) \n ? objectSearchHandle($filter, $value)\n : \"$filter = '$value'\";\n \n $is_not_last = ($totalCount - 1 != $count);\n\n if($str):\n $sql .= $str;\n $sql .= ($is_not_last) ? \" AND \" : \"\";\n endif;\n\n $count ++;\n }\n // Return\n return $sql;\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "protected function applySiteConditions()\n {\n if ($this->site !== null) {\n $this->andWhere(Db::parseParam('siteId', $this->parseSiteValue($this->site)));\n }\n }", "function setQuery($where, $limit, $orderBy, $varName, $allowOrderByOveride=true) {\n $this->query_where = $where;\n if($this->getSessionVariable(\"query\", \"where\") != $where) {\n $this->query_where_has_changed = true;\n $this->setSessionVariable(\"query\", \"where\", $where);\n }\n\n $this->query_limit = $limit;\n if(!$allowOrderByOveride) {\n $this->query_orderby = $orderBy;\n return;\n }\n $this->getOrderBy($varName, $orderBy);\n\n $this->setLocalSessionVariable($varName, \"QUERY_WHERE\", $where);\n}", "protected abstract function getWhereClause(array $conditions);", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "public function setCondition($args = null){\r\n $this->_conditions = $args;\r\n return $this;\r\n }", "protected function setWhereFilters() : ApiGetService\n {\n if(count($this->where_filters) === 0){\n return $this;\n }\n\n // Traverse prepared filters\n foreach($this->where_filters as $column => $value){\n // {column}:{operator} = {value}\n $column_operator = preg_split('/[:\\s]+/', $column);\n\n // Split value by \" , \"\n $splited_value = preg_split('/[,]+/', $value);\n\n //... and if {value} is not scalar\n if(count($splited_value) > 1){\n // ... we know that we will have SQL IN operator in WHERE\n $in_operator = true;\n }\n // ... else we are good with simple \" = \"\n else{\n $in_operator = false;\n }\n\n // Depending on $in_operator, we know if we are using IN or =\n $this->builder\n ->when($in_operator ,\n // If it is true, we are using IN\n function ($query) use($column_operator, $splited_value){\n if(isset($column_operator[1]) && $column_operator[1] == \"eq\"){\n\n return $query->whereIn($column_operator[0], $splited_value);\n\n }elseif(isset($column_operator[1]) && $column_operator[1] == \"ne\"){\n\n return $query->whereNotIn($column_operator[0], $splited_value);\n\n }else{\n\n return $query->whereIn($column_operator[0], $splited_value);\n }\n },\n // Else, we are using scalar operators...\n function ($query) use($column_operator, $splited_value) {\n\n return $query->where($column_operator[0],\n ((isset($column_operator[1]) && $column_operator[1] != \"\") ? $this->api_operators[$column_operator[1]] : \"=\"),\n $splited_value[0]);\n });\n }\n\n return $this;\n }", "function build_sql_conditions( $args = array() ){\r\n\t\tglobal $wpdb;\r\n\t\t$events_table = $wpdb->prefix . EM_EVENTS_TABLE;\r\n\t\t$locations_table = $wpdb->prefix . EM_LOCATIONS_TABLE;\r\n\t\t\r\n\t\t$conditions = parent::build_sql_conditions($args);\r\n\t\t//eventful locations\r\n\t\tif( true == $args['eventful'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NOT NULL\";\r\n\t\t}elseif( true == $args['eventless'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NULL\";\r\n\t\t}\r\n\t\treturn $conditions;\r\n\t}", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n\t\tparent::_buildQueryWhere($query);\n\n\t\tif($this->_state->type) {\n\t\t\t$query->where('tbl.subscription_type', '=', $this->_state->type);\n\t\t} elseif($this->_state->type_name) {\n\t\t\t$table = $this->getService('com://admin/ninjaboard.database.table.watches');\n\t\t\t$query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name));\n\t\t}\n\t\t\n\t\tif($this->_state->type_id) {\n\t\t\t$query->where('tbl.subscription_type_id', '=', $this->_state->type_id);\n\t\t}\n\t\t\n\t\tif($this->_state->by) {\n\t\t\t$query->where('tbl.created_by', '=', $this->_state->by);\n\t\t}\n\t}", "protected function modifyQueryForFilter()\n {\n //the following select includes the mobile number, but overrides\n //the columns with an empty string if the matching boolean is false\n $this->q->getDoctrineQuery()->addSelect(\n 'if(x.is_show_mobile_number_in_phonebook is not FALSE, x.mobile_number, \\'\\') as mobile_number'\n );\n \n if ($this->isLocationView)\n {\n //order results by location name first\n $this->q->addOrderByPrefix('UllLocation->name');\n }\n\n if (!empty($this->phoneSearchFilter))\n {\n $this->q->getDoctrineQuery()->openParenthesisBeforeLastPart();\n \n //we need special handling here because we don't want hidden\n //numbers to be searchable\n $phoneSearchFilterPattern = '%' . $this->phoneSearchFilter . '%';\n \n $this->q->getDoctrineQuery()->orWhere(\n '(is_show_extension_in_phonebook is not FALSE AND phone_extension LIKE ?) ' .\n 'OR (is_show_extension_in_phonebook is FALSE AND alternative_phone_extension LIKE ?)',\n array($phoneSearchFilterPattern, $phoneSearchFilterPattern));\n\n $this->q->orWhere('is_show_mobile_number_in_phonebook is not FALSE ' .\n 'AND mobile_number LIKE ?', $phoneSearchFilterPattern);\n \n $this->q->getDoctrineQuery()->closeParenthesis();\n }\n \n\n if (!empty($this->filter_location_id))\n {\n $this->q->addWhere('ull_location_id = ?', $this->filter_location_id);\n }\n \n //we only want users which are active and have their\n //show-in-phonebook not set to false\n $this->q->addWhere('UllUserStatus->is_active is TRUE and is_show_in_phonebook is not FALSE');\n }", "private function set_query_components() {\n\t\n\t\t$start = (($this->page-1) * $this->rp);\n\t\t\n\t\tif($this->query) {\n\t\t\t$this->query_components['where'] = \" WHERE $qtype LIKE '%\".mysql_real_escape_string($query).\"%' \";\n\t\t}\n\t\telse {\n\t\t\t$this->query_componenets['where'] = \"\";\n\t\t}\n\t\t\n\t\t$this->query_components['sort'] = \"ORDER BY {$this->sortname} {$this->sortorder}\";\n\t\t$this->query_components['limit'] = \"LIMIT $start, {$this->rp}\";\n\t}", "function createQuery() ;", "public function appendConditions( $criteria, $condition, $params )\n {\n\n\n // append codition if the query has a default filter\n if( $this->condition )\n {\n if( ctype_digit($this->condition) )\n {\n $criteria->where( 'project_task.rowid = '.$this->condition );\n }\n else if( is_string($this->condition) )\n {\n $criteria->where( $this->condition );\n }\n else if( is_array($this->condition) )\n {\n $this->checkConditions( $criteria, $this->condition );\n }\n }\n\n if( $condition )\n {\n if( ctype_digit($condition ) )\n {\n $criteria->where( 'project_task.rowid = '.$condition );\n }\n else if( is_string($condition) )\n {\n $criteria->where( $condition );\n }\n else if( is_array($condition) )\n {\n $this->checkConditions( $criteria, $condition );\n }\n }\n\n\n if( $params->begin )\n {\n $this->checkCharBegin( $criteria, $params );\n }\n\n }", "function beforeFind($queryData) {\r\n\t\t\t\t\tif (is_array($queryData['conditions'])) {\r\n\t\t\t\t\t\t$queryData['conditions']['Auction.deleted']=0;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$queryData['conditions'].=' AND Auction.deleted=0';\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn $queryData;\r\n\t\t\t\t}", "function get_condition()\r\n {\r\n $owner = $this->owner;\r\n\r\n $conds = array();\r\n $parent = $this->parent;\r\n $category = $parent->get_parameter(WeblcmsManager :: PARAM_CATEGORY);\r\n $category = $category ? $category : 0;\r\n $conds[] = new EqualityCondition(ContentObjectPublication :: PROPERTY_CATEGORY_ID, $category, ContentObjectPublication :: get_table_name());\r\n\r\n $type_cond = array();\r\n $types = array(Assessment :: get_type_name(), Survey :: get_type_name(), Hotpotatoes :: get_type_name());\r\n foreach ($types as $type)\r\n {\r\n $type_cond[] = new EqualityCondition(ContentObject :: PROPERTY_TYPE, $type);\r\n }\r\n $conds[] = new OrCondition($type_cond);\r\n $c = Utilities :: query_to_condition($this->query);\r\n if (! is_null($c))\r\n {\r\n $conds[] = $c;\r\n }\r\n return new AndCondition($conds);\r\n }", "protected function filterQuery(&$query) {\n foreach($this->filter_params as $filter) {\n if(Input::has($filter)) {\n $val = Input::get($filter);\n $query->where($filter, '=', $val);\n }\n }\n }", "function __construct($get = array()) {\n\t\t$this->setSQLCondition($get);\n \t}", "public function where($field, $value, $comparison = '==', $logical = 'and');", "function _add_where_clause($where_clauses, $join)\n {\n foreach ($where_clauses as $clause) {\n // $clause => array(\n // 'column' => 'ID',\n // 'value' =>\t1210,\n // 'compare' => '='\n // )\n // Determine where what the where clause is comparing\n switch ($clause['column']) {\n case 'author':\n case 'author_id':\n $this->object->_query_args['author'] = $clause['value'];\n break;\n case 'author_name':\n $this->object->_query_args['author_name'] = $clause['value'];\n break;\n case 'cat':\n case 'cat_id':\n case 'category_id':\n switch ($clause['compare']) {\n case '=':\n case 'BETWEEN':\n case 'IN':\n if (!isset($this->object->_query_args['category__in'])) {\n $this->object->_query_args['category__in'] = array();\n }\n $this->object->_query_args['category__in'][] = $clause['value'];\n break;\n case '!=':\n case 'NOT BETWEEN':\n case 'NOT IN':\n if (!isset($this->object->_query_args['category__not_in'])) {\n $this->object->_query_args['category__not_in'] = array();\n }\n $this->object->_query_args['category__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'category_name':\n $this->object->_query_args['category_name'] = $clause['value'];\n break;\n case 'post_id':\n case $this->object->get_primary_key_column():\n switch ($clause['compare']) {\n case '=':\n case 'IN':\n case 'BETWEEN':\n if (!isset($this->object->_query_args['post__in'])) {\n $this->object->_query_args['post__in'] = array();\n }\n $this->object->_query_args['post__in'][] = $clause['value'];\n break;\n default:\n if (!isset($this->object->_query_args['post__not_in'])) {\n $this->object->_query_args['post__not_in'] = array();\n }\n $this->object->_query_args['post__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'pagename':\n case 'postname':\n case 'page_name':\n case 'post_name':\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['page_name__like'] = $clause['value'];\n } elseif ($clause['compare'] == '=') {\n $this->object->_query_args['pagename'] = $clause['value'];\n } elseif ($clause['compare'] == 'IN') {\n $this->object->_query_args['page_name__in'] = $clause['value'];\n }\n break;\n case 'post_title':\n // Post title uses custom WHERE clause\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['post_title__like'] = $clause['value'];\n } else {\n $this->object->_query_args['post_title'] = $clause['value'];\n }\n break;\n default:\n // Must be metadata\n $clause['key'] = $clause['column'];\n unset($clause['column']);\n // Convert values to array, when required\n if (in_array($clause['compare'], array('IN', 'BETWEEN'))) {\n $clause['value'] = explode(',', $clause['value']);\n foreach ($clause['value'] as &$val) {\n if (!is_numeric($val)) {\n // In the _parse_where_clause() method, we\n // quote the strings and add slashes\n $val = stripslashes($val);\n $val = substr($val, 1, strlen($val) - 2);\n }\n }\n }\n if (!isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query'] = array();\n }\n $this->object->_query_args['meta_query'][] = $clause;\n break;\n }\n }\n // If any where clauses have been added, specify how the conditions\n // will be conbined/joined\n if (isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query']['relation'] = $join;\n }\n }", "function testQueryset() {\n $comments = new Dormio_Queryset('Comment');\n $blogs = new Dormio_Queryset('Blog');\n \n $set = $blogs->filter('author__profile_set__fav_colour', 'IN', array('red', 'green'));\n \n }", "public function addConditionToQuery($query, array $condition)\n\t{\n\t\t$value = trim(array_get($condition, 'value'));\n\t\t$field = array_get($condition, 'field');\n\t\t\n\t\tif ('xref_id' == $field) {\n\t\t\t$field = 'objectID';\n\t\t}\n\t\t\n\t\tif (array_get($condition, 'filter')) {\n\t\t\tif (is_numeric($value)) {\n\t\t\t\t$query['query']['numericFilters'][] = \"{$field}={$value}\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$query['query']['facetFilters'][] = \"{$field}:{$value}\";\n\t\t\t}\n\t\t}\n\t\telse if (array_get($condition, 'lat')) {\n\t\t\t$query['query']['aroundLatLng'] = array_get($condition, 'lat') . ',' . array_get($condition, 'long');\n\t\t\t$query['query']['aroundRadius'] = array_get($condition, 'distance');\n\t\t}\n\t\telse {\n\t\t\t$query['terms'] .= ' ' . $value;\n\t\t\t\n\t\t\tif (!empty($field) && '*' !== $field) {\n\t\t\t\t$field = is_array($field) ? $field : array($field);\n\t\t\t\t$query['query']['restrictSearchableAttributes'] = implode(',', $field);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $query;\n\t}", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function testQueryRules()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "abstract function query( $p_filter_input );", "private function getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName)\n {\n $itemDataType = $profileIsp['item_data_type'];\n if ($itemDataType == 'S') {\n $ispCatArray = array_column($profileIsp['category_type'], 'value');\n $inString = \"'\" . implode(\"','\", $ispCatArray) . \"'\";\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value IN (\" . $inString . \") $profileItemCond ) \";\n } elseif ($itemDataType == 'D') {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") >= '\" . $profileIsp['start_date'] . \"' AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") <= '\" . $profileIsp['end_date'] . \"' $profileItemCond ) \";\n } elseif ($itemDataType == 'N') {\n if ($profileIsp['is_single']) {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value = '\" . $profileIsp['single_value'] . \"' $profileItemCond ) \";\n } else {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value >= \" . $profileIsp['min_digits'] . \" AND metadata_value <= \" . $profileIsp['max_digits'] . \" $profileItemCond) \";\n }\n }\n }", "function query() {\n $this->ensure_my_table();\n $value = $this->parse_gis_location();\n $this->query->add_where($this->options['group'], \"$this->table_alias.$this->real_field\", $value, $this->operator);\n }", "private function _set_where($params) {\n if (count($params) == 1) {\n if (!is_array($params[0]) && !strstr($params[0], \"'\")) {\n $this->db->where($this->primary_key, $params[0]); // 1.\n } else {\n $this->db->where($params[0]); // 2.\n }\n } elseif (count($params) == 2) {\n if (is_array($params[1])) {\n $this->db->where_in($params[0], $params[1]); // 4.\n } else {\n $this->db->where($params[0], $params[1]); // 3.\n }\n }\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "function setQueryFilter($sType, $sContent) {\n // when receive search type and data\n if(!(is_null($sType) || is_null($sContent))) {\n // when search type is all\n if($sType == 'all') {\n $this->queryFilter = \"WHERE title LIKE '%{$sContent}%'\n OR content LIKE '%{$sContent}%'\n OR user_name LIKE '%{$sContent}%'\";\n } else if($sType == 'writer') {\n $this->queryFilter = \"WHERE writer LIKE '%{$sContent}%'\n OR user_name LIKE '%{$sContent}%'\";\n } else {\n $this->queryFilter = \"WHERE {$sType} LIKE '%{$sContent}%'\";\n }\n } else {\n $this->queryFilter = '';\n }\n }", "private function initQuery()\n {\n $this->_lastSql = null;\n $this->_limit = null;\n $this->_offset = null;\n $this->_order = array();\n $this->_group = array();\n $this->_table = null;\n $this->_stmt = null;\n\n $this->fromStates = array();\n $this->selectFields = array();\n $this->whereStates = array();\n $this->havingStates = array();\n $this->values = array();\n $this->joinStates = array();\n }", "function realstate_search_conditions($params = null) {\n\n // we need conditions and search tables (only if we're using our custom tables)\n if ($params!=null) {\n $has_conditions = false;\n foreach ($params as $key => $value) {\n if ($value != \"\") {\n // We may want to have param-specific searches\n switch ($key) {\n case 'numFloor':\n if (preg_match('|([0-9]+) - ([0-9]+)|', $value, $match)) {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.i_num_floors >= %d AND %st_item_house_attr.i_num_floors <= %d\", DB_TABLE_PREFIX, $match[1], DB_TABLE_PREFIX, $match[2]));\n $has_conditions = true;\n }\n break;\n case 'rooms':\n if (preg_match('|([0-9]+) - ([0-9]+)|', $value, $match)) {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.i_num_rooms >= %d AND %st_item_house_attr.i_num_rooms <= %d\", DB_TABLE_PREFIX, $match[1], DB_TABLE_PREFIX, $match[2]));\n $has_conditions = true;\n }\n break;\n case 'rooms_min':\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.i_num_rooms >= %d\", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n break;\n case 'bathrooms':\n if (preg_match('|([0-9]+) - ([0-9]+)|', $value, $match)) {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.i_num_bathrooms >= %d AND %st_item_house_attr.i_num_bathrooms <= %d\", DB_TABLE_PREFIX, $match[1], DB_TABLE_PREFIX, $match[2]));\n $has_conditions = true;\n }\n break;\n case 'garages':\n if (preg_match('|([0-9]+) - ([0-9]+)|', $value, $match)) {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.i_num_garages >= %d AND %st_item_house_attr.i_num_garages <= %d\", DB_TABLE_PREFIX, $match[1], DB_TABLE_PREFIX, $match[2]));\n $has_conditions = true;\n }\n break;\n case 'year':\n if (preg_match('|([0-9]+) - ([0-9]+)|', $value, $match)) {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"(%st_item_house_attr.i_year = 0 || (%st_item_house_attr.i_year >= %d AND %st_item_house_attr.i_year <= %d))\", DB_TABLE_PREFIX, DB_TABLE_PREFIX, $match[1], DB_TABLE_PREFIX, $match[2]));\n $has_conditions = true;\n }\n break;\n case 'sq':\n if (preg_match('|([0-9]+) - ([0-9]+)|', $value, $match)) {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.s_square_meters >= %d AND %st_item_house_attr.s_square_meters <= %d\", DB_TABLE_PREFIX, $match[1], DB_TABLE_PREFIX, $match[2]));\n $has_conditions = true;\n }\n break;\n case 'heating':\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.b_heating = %d \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n break;\n case 'airCondition':\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.b_air_condition = %d \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n break;\n case 'elevator':\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.b_elevator = %d \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n break;\n case 'terrace':\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.b_terrace = %d \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n break;\n case 'parking':\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.b_parking = %d \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n break;\n case 'furnished':\n if ($value != \"\") {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.b_furnished = %d \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n }\n break;\n case 'new':\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.b_new = %d \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n break;\n case 'by_owner':\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.b_by_owner = %d \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n break;\n case 'property_type':\n if($value!='') {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.e_type = '%s' \", DB_TABLE_PREFIX, $value));\n $has_conditions = true;\n }\n break;\n case 'p_type':\n if($value!='') {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item_house_attr.fk_i_property_type_id = %d \", DB_TABLE_PREFIX, $value));\n }\n $has_conditions = true;\n break;\n default:\n break;\n }\n }\n }\n\n // Only if we have some values at the params we add our table and link with the ID of the item.\n if ($has_conditions) {\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item.pk_i_id = %st_item_house_attr.fk_i_item_id \", DB_TABLE_PREFIX, DB_TABLE_PREFIX));\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addConditions(sprintf(\"%st_item.pk_i_id = %st_item_house_description_attr.fk_i_item_id \", DB_TABLE_PREFIX, DB_TABLE_PREFIX));\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addTable(sprintf(\"%st_item_house_attr\", DB_TABLE_PREFIX));\n ClassLoader::getInstance()->getClassInstance( 'Model_Search' )->addTable(sprintf(\"%st_item_house_description_attr\", DB_TABLE_PREFIX));\n }\n }\n}", "protected function _setWhere(&$sql, $where, $whereValues) {\n\t\t\n\t\tif (!is_null($where)) $sql.= ' WHERE ' . $where;\n\t}", "public function whereOR()\n {\n $this->where_clause .= \" OR \";\n }", "public function setMDB2WhereCondition($query_string, $data_type, $data_value)\n\t{\n\t\t\n\t\t$this->mdb2Query = $query_string;\n\t\t$this->mdb2DataValue = $data_value;\n\t\t$this->mdb2DataType = $data_type;\n\t\n\t\t\n\t\treturn true;\n\t}", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\t\t$sql = 'WHERE 1 = 2';\n\t\t\t\tbreak;\t//nobody below GM can access this subject\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE c.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "private function setFilter()\n\t{\n\t\t// get filter values\n\t\t$this->filter['language'] = ($this->getParameter('language', 'array') != '') ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();\n\t\t$this->filter['application'] = $this->getParameter('application');\n\t\t$this->filter['module'] = $this->getParameter('module');\n\t\t$this->filter['type'] = $this->getParameter('type', 'array');\n\t\t$this->filter['name'] = $this->getParameter('name');\n\t\t$this->filter['value'] = $this->getParameter('value');\n\n\t\t// build query for filter\n\t\t$this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);\n\t}", "private function setWhere(QueryBuilder $qb)\n {\n // global filtering\n if (isset($this->requestParams['search']) && '' != $this->requestParams['search']['value']) {\n $globalSearch = $this->requestParams['search']['value'];\n\n $orExpr = $qb->expr()->orX();\n $globalSearchType = $this->options->getGlobalSearchType();\n\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n $searchType = $globalSearchType;\n $searchField = $this->searchColumns[$key];\n // Subqueries and arithmetics fields can't be search with LIKE\n if ($column->isCustomDql() && ('string' != $column->getTypeOfField()) || preg_match('/SELECT .+ FROM .+/', $searchField)) {\n if (!is_numeric($globalSearch)) {\n continue;\n }\n $globalSearch = floatval($globalSearch);\n switch ($searchType) {\n case 'like':\n $searchType = 'eq';\n break;\n case 'notLike':\n $searchType = 'neq';\n break;\n }\n }\n $this->setOrExpression($orExpr, $qb, $searchType, $searchField, $globalSearch, $key);\n }\n }\n\n if ($orExpr->count() > 0) {\n $qb->andWhere($orExpr);\n }\n }\n\n // individual filtering\n if (true === $this->accessor->getValue($this->options, 'individualFiltering')) {\n $andExpr = $qb->expr()->andX();\n\n $parameterCounter = DatatableQueryBuilder::INIT_PARAMETER_COUNTER;\n\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n if (false === array_key_exists($key, $this->requestParams['columns'])) {\n continue;\n }\n\n $searchValue = $this->requestParams['columns'][$key]['search']['value'];\n\n if ('' != $searchValue && 'null' != $searchValue) {\n /** @var FilterInterface $filter */\n $filter = $this->accessor->getValue($column, 'filter');\n $searchField = $this->searchColumns[$key];\n $andExpr = $filter->addAndExpression($andExpr, $qb, $searchField, $searchValue, $parameterCounter);\n }\n }\n }\n\n if ($andExpr->count() > 0) {\n $qb->andWhere($andExpr);\n }\n }\n\n return $this;\n }", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "function addQuery() {}", "function criteria(&$query){\n $id = $this->input->post('id', true);\n $k = $this->input->post('k', true);/*kind*/\n $t = $this->input->post('t', true);/*title*/\n $s = $this->input->post('s', true);/*sub*/\n $b = $this->input->post('b', true);/*background*/\n $so = $this->input->post('so', true);/*sort*/\n if(!empty($id)){/*where like include: before(%pattern), after(pattern%) and both(%pattern%)*/\n $query = $query->like('id', $id, 'both');\n }\n if(!empty($k)){\n $query = $query->like('kind', $k, 'both');\n }\n if(!empty($t)){\n $query = $query->like('title', $t, 'both');\n }\n if(!empty($s)){\n $query = $query->like('sub', $s, 'both');\n }\n if(!empty($b)){\n $query = $query->like('background', $b, 'both');\n }\n if(!empty($so)){\n $query = $query->like('sort', $so, 'both');\n }\n }", "protected function _filters_to_conditions($request_data = null){\n \n $conditions = array();\n //user has to have an active account\n $conditions['User.active'] = 1;\n \n if(empty($request_data)){\n return $conditions;\n }\n \n if(!empty($request_data['motive_id'])){\n $conditions['Experience.motive_id'] = $request_data['motive_id'];\n }\n if(!empty($request_data['department_id'])){\n $conditions['User.department_id'] = $request_data['department_id'];\n }\n if(!empty($request_data['school_id'])){\n $conditions['User.school_id'] = $request_data['school_id'];\n }\n if(!empty($request_data['key_word'])){\n $conditions['Experience.description LIKE'] = '%'.$request_data['key_word'].'%';\n }\n //now\n if(!empty($request_data['date_min']) && !empty($request_data['date_max']) && ($request_data['date_min'] === $request_data['date_max'])){\n $conditions['AND'] = array('Experience.dateEnd >=' => $request_data['date_min'],\n 'Experience.dateStart <=' => $request_data['date_max']);\n }\n else{\n //futur\n if(!empty($request_data['date_min'])){\n $conditions['Experience.dateStart >='] = $request_data['date_min'];\n }\n //past\n if(!empty($request_data['date_max'])){\n $conditions['Experience.dateStart <='] = $request_data['date_max'];\n }\n }\n if(!empty($request_data['city_id'])){\n $conditions['Experience.city_id'] = $request_data['city_id'];\n }\n if(!empty($request_data['city_name'])){\n $conditions['City.name'] = $request_data['city_name'];\n }\n if(!empty($request_data['country_id'])){\n $conditions['City.country_id'] = $request_data['country_id'];\n }\n if(!empty($request_data['user_name'])){\n //extracts first and last names\n $names = explode(' ',$request_data['user_name']);\n if(count($names) > 1){\n $conditions['AND']['User.firstname LIKE'] = '%'.$names[0].'%';\n $conditions['AND']['User.lastname LIKE'] = '%'.$names[1].'%';\n }\n //if only last or first name was entered\n else{\n $conditions['OR'] = array('User.firstname LIKE' => '%'.$request_data['user_name'].'%',\n 'User.lastname LIKE' => '%'.$request_data['user_name'].'%');\n }\n }\n return $conditions;\n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "protected function _buildCondition(){\n \t$aryCondition = array();\n \t\n \tif(!empty($this->postData)){\n \t\t //search\n\t\t\t \t\t\t\n\t\t\tif($this->postData['title']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.title\"=>$this->postData['title']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['page']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.page\"=>$this->postData['page']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['code']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.code\"=>$this->postData['code']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['status']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.status\"=>$this->postData['status']);\n \t\t }\t\t\t\n\n \t}\n \treturn $aryCondition;\n }", "public function setConditions(array $conditions);", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 1);\n $this->order = 'create_time desc';\n }", "function set_query($query) {\n\t\t\t// it just sets the query with which to get a recordset\n\t\t\t$this->query = $query;\n\t\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "function BeforeQueryView(&$strSQL, &$strWhereClause, &$pageObject)\n{\n\n\t\t$strSQL = calendar_getDbValuesById($_REQUEST[\"editid1\"], $pageObject->connection);\n;\t\t\n}", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "protected function prepareWhereQuery($conditionAndValues, $where)\n {\n $this->where = 'WHERE '.$where;\n $this->conditionsAndValues = $conditionAndValues;\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 0);\n $this->order = 'create_time desc';\n }", "public function getCondition() {\n\n \t$condition = array();\n \t$this->getQueryString(\"keyword\", $condition);\n \t$this->getQueryString(\"activityId\", $condition);\n \t$this->getQueryString(\"activityIds\", $condition);\n \t$this->getQueryString(\"activityType\", $condition);\n $this->getQueryString(\"state\", $condition);\n $this->getQueryString(\"orderDateStart\", $condition);\n $this->getQueryString(\"orderDateEnd\", $condition);\n $this->getQueryString(\"deliveryDateStart\", $condition);\n $this->getQueryString(\"deliveryDateEnd\", $condition);\n $this->getQueryString(\"serial\", $condition);\n $this->getQueryString(\"consumerId\", $condition);\n $this->getQueryString(\"payDateTimeStart\", $condition);\n $this->getQueryString(\"payDateTimeEnd\", $condition);\n $this->getQueryString(\"productId\", $condition);\n $this->getQueryString(\"deliveryId\", $condition);\n $this->getQueryString(\"productArray\", $condition);\n \n \treturn $condition;\n }", "protected function assembleQueries()\n {\n if ($this->getExecutedFilters()) {\n return $this;\n }\n\n $objectType = $this->getObjectType();\n\n $whereConditions = [];\n\n $mainTable = $this->getEntityService()->getTableName($objectType);\n $pre = 'v2';\n $dqlFilters = [];\n $tables = $this->getEntityService()->getVarOptionTables();\n $bindTypes = [];\n $pdoBindTypes = $this->getEntityService()->getPdoBindTypes();\n $filterable = $this->getFilterable();\n\n $x = 0; //count($this->getFilters()); // for tracking bind types\n\n // handle basic filters eg key=value\n // also, special handling of price range\n $filterParams = [];\n if ($this->getFilters()) {\n foreach($this->getFilters() as $field => $value) {\n foreach($filterable as $filterInfo) {\n if ($field == $filterInfo[CartRepositoryInterface::CODE]) {\n\n // handle special case for numerical ranges\n // eg price=100-199 or subtotal=50-100\n // note : the handling of strpos is very intentional, want an index > 0\n if ($filterInfo[CartRepositoryInterface::DATATYPE] == 'number' && strpos($value, '-')) {\n $rangeValues = explode('-', $value);\n $rangeMin = $rangeValues[0];\n $rangeMax = isset($rangeValues[1]) ? $rangeValues[1] : null;\n if (isset($rangeMax)) {\n\n $rangeMin = (float) $rangeMin;\n $rangeMax = (float) $rangeMax;\n\n // minimum\n $this->addAdvFilter([\n 'field' => $field,\n 'op' => 'gte',\n 'value' => $rangeMin,\n ]);\n\n // maximum\n $this->addAdvFilter([\n 'field' => $field,\n 'op' => 'lt',\n 'value' => $rangeMax,\n ]);\n\n break;\n }\n }\n\n if (isset($filterInfo['join'])) {\n $this->joins[] = $filterInfo['join'];\n $field = $filterInfo['join']['table'] . \".{$field}\";\n } elseif (!is_int(strpos($field, '.'))) {\n $field = \"main.{$field}\";\n }\n\n $whereConditions[] = \"{$field} = ?\";\n $filterParams[] = $value;\n\n switch($filterInfo[CartRepositoryInterface::DATATYPE]) {\n case 'boolean':\n $bindTypes[$x] = \\PDO::PARAM_INT;\n break;\n case 'number':\n // todo : make this better\n $bindTypes[$x] = \\PDO::PARAM_INT;\n break;\n case 'string':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n case 'date':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n default:\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n }\n\n $x++;\n break;\n }\n }\n }\n }\n\n // handle fulltext search first\n\n // note : use setFulltextIds() if you search somewhere else first eg SOLR / Elasticsearch\n if ($this->getFulltextIds()) {\n // ensure IDs are sanitized before you set them\n $whereConditions[] = \"main.id in (\" . implode(',', $this->getFulltextIds()) . \")\";\n } else if ($this->getQuery()\n && $this->getSearchField()\n && $this->getSearchMethod()) {\n\n if (is_array($this->getSearchField())) {\n if (count($this->getSearchField()) > 1) {\n\n $cond = '';\n foreach($this->getSearchField() as $searchField) {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n\n $tbl = 'main';\n\n if (is_array($searchField)) {\n if (isset($searchField['table']) && isset($searchField['column'])) {\n $tbl = $searchField['table'];\n $searchField = $searchField['column'];\n } else {\n continue;\n }\n }\n\n // cond is empty, add a leading parentheses\n if (!$cond) {\n $cond .= \"({$tbl}.{$searchField} like ?\";\n } else {\n $cond .= \" OR {$tbl}.{$searchField} like ?\";\n }\n $x++;\n }\n $cond .= ')';\n $whereConditions[] = $cond;\n } else {\n\n $fields = $this->getSearchField();\n $searchField = $fields[0];\n if (is_array($searchField)) {\n if (isset($searchField['table']) && isset($searchField['column'])) {\n $tbl = $searchField['table'];\n $searchField = $searchField['column'];\n\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"{$tbl}.{$searchField} like ?\";\n $x++;\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"main.{$searchField} like ?\";\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"main.{$this->getSearchField()} like ?\";\n $x++;\n }\n }\n\n // handle \"advanced\" filters\n // eg filter_field[x], filter_op[x], filter_val[x]\n // specifies a field, value, and operator ie (id > 100)\n $advFilterParams = [];\n if ($this->getAdvFilters()) {\n foreach($this->getAdvFilters() as $advFilter) {\n\n $field = $advFilter['field'];\n $op = $advFilter['op'];\n $value = $advFilter['value'];\n $table = isset($advFilter['table'])\n ? $advFilter['table']\n : 'main';\n\n $found = false;\n foreach($filterable as $filterInfo) {\n if ($field == $filterInfo[CartRepositoryInterface::CODE]) {\n $found = true;\n\n switch($filterInfo[CartRepositoryInterface::DATATYPE]) {\n case 'boolean':\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n break;\n case 'number':\n if ($op == 'in') {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n if ($value) {\n foreach($value as $dummy) {\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n }\n break;\n case 'string':\n if ($op == 'in') {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n if ($value) {\n foreach($value as $dummy) {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n }\n\n break;\n case 'date':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n break;\n default:\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n break;\n }\n\n\n break;\n }\n }\n\n if (!$found || !in_array($op, ['contains', 'starts', 'ends', 'equals', 'gt', 'gte', 'lt', 'lte', 'in'])) {\n continue;\n }\n\n // example:\n // $and->add($qb->expr()->eq('u.id', 1));\n\n switch($op) {\n case 'contains':\n $advFilterParams[] = '%'. $value . '%';\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'starts':\n $advFilterParams[] = $value . '%';\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'ends':\n $advFilterParams[] = '%'. $value;\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'equals':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} = ?\";\n break;\n case 'notequal':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} != ?\";\n break;\n// todo: this is messing up the counter, but it should be implemented\n// case 'null':\n// $advFilterParams[] = 'NULL';\n// $whereConditions[] = \"{$table}.{$field} IS ?\";\n// break;\n// case 'notnull':\n// $advFilterParams[] = $value;\n// $whereConditions[] = \"{$table}.{$field} IS NOT NULL\";\n// break;\n case 'gt':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} > ?\";\n break;\n case 'gte':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} >= ?\";\n break;\n case 'lt':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} < ?\";\n break;\n case 'lte':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} <= ?\";\n break;\n case 'in':\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n\n if ($value) {\n foreach($value as $val) {\n $advFilterParams[] = $val;\n }\n $paramStr = implode(',', $value);\n $whereConditions[] = \"{$table}.{$field} in ({$paramStr})\";\n }\n\n break;\n default:\n\n break;\n }\n }\n }\n\n // handle category filter with products\n if ($this->getCategoryId()\n && $this->getObjectType() == EntityConstants::PRODUCT) {\n\n $categoryTable = $this->getEntityService()->getTableName(EntityConstants::CATEGORY_PRODUCT);\n $bindTypes[$x] = \\PDO::PARAM_INT;\n // todo : sometime in the future , add a category 'anchor', connecting multiple categories\n $whereConditions[] = \"main.id in (select product_id from {$categoryTable} where category_id = ?)\";\n $x++;\n }\n\n // handle stock, visibility filters with products\n\n\n // handle facet filters\n // ie filters on EAV tables, child tables\n $facetFilterParams = [];\n if ($this->getFacetFilters()) {\n foreach($this->getFacetFilters() as $facetCode => $value) {\n\n $itemVar = $this->getVarByCode($facetCode);\n\n $tblValue = $objectType . '_' . EntityConstants::getVarDatatype($itemVar->getDatatype());\n $values = explode($this->valueSep, $value);\n $joinTbl = $tables[$itemVar->getDatatype()];\n $joinTblPre = 'ivo';\n\n if (count($values) > 1) {\n $conditions = [];\n foreach($values as $itemVarValue) {\n $conditions[] = \"({$pre}.value = ? OR {$joinTblPre}.url_value = ?)\";\n $facetFilterParams[] = $itemVarValue;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n }\n $dqlFilters[] = \"({$pre}.item_var_id={$itemVar->getId()} AND (\".implode(' OR ', $conditions).\"))\";\n } else {\n $dqlFilters[] = \"({$pre}.item_var_id={$itemVar->getId()} AND ({$pre}.value = ? OR {$joinTblPre}.url_value = ?))\";\n $facetFilterParams[] = $value;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n }\n\n $whereConditions[] = \"main.id in (select parent_id from {$tblValue} {$pre} left join {$joinTbl} {$joinTblPre} on {$pre}.item_var_option_id={$joinTblPre}.id where \". implode(' AND ', $dqlFilters).\")\";\n $dqlFilters = [];\n\n }\n }\n\n // assemble where conditions\n $conditionsSql = implode(' AND ', $whereConditions);\n if (!$conditionsSql) {\n $conditionsSql = '1=1';\n }\n\n // assemble group by\n $groupSql = $this->getGroupBy()\n ? 'group by ' . implode(', ', $this->getGroupBy())\n : '';\n\n // assemble select columns\n $colSql = '';\n if ($this->getColumns()) {\n $cols = [];\n foreach($this->getColumns() as $colData) {\n // add select\n $select = $colData['select'];\n $alias = $colData['alias'];\n if ($alias) {\n $select .= \" as {$alias}\";\n }\n\n $cols[] = $select;\n }\n $colSql = ',' . implode(',', $cols);\n }\n\n // assemble joins\n $joinSql = '';\n if ($this->getJoins()) {\n $joins = [];\n foreach($this->getJoins() as $join) {\n $type = $join['type'];\n $table = $join['table'];\n $column = $join['column'];\n $joinAlias = $join['join_alias'];\n $joinColumn = $join['join_column'];\n $joins[] = \"{$type} join {$table} on {$joinAlias}.{$joinColumn}={$table}.{$column}\";\n }\n $joinSql = implode(' ', $joins);\n }\n\n // main data query without sorting and grouping\n $this->filtersSql = \"select distinct(main.id) from {$mainTable} main {$joinSql} where {$conditionsSql}\";\n // main data query\n $this->mainSql = \"select distinct(main.id), main.* {$colSql} from {$mainTable} main {$joinSql} where {$conditionsSql} {$groupSql}\";\n // main count query, for all rows, not just the current page\n $this->countSql = \"select count(distinct(main.id)) as count from {$mainTable} main {$joinSql} where {$conditionsSql} {$groupSql}\";\n $this->bindTypes = $bindTypes;\n $this->filterParams = $filterParams;\n $this->advFilterParams = $advFilterParams;\n $this->facetFilterParams = $facetFilterParams;\n\n $this->setExecutedFilters(true);\n return $this;\n }", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}" ]
[ "0.7486974", "0.7363606", "0.71012133", "0.6759942", "0.6757744", "0.66835254", "0.66547596", "0.66043395", "0.65664244", "0.65245503", "0.652172", "0.6514471", "0.65136594", "0.6506201", "0.64573115", "0.63972896", "0.63740057", "0.6361312", "0.63097626", "0.6307017", "0.63060194", "0.630312", "0.6291815", "0.6272838", "0.6264921", "0.6261844", "0.62448436", "0.62336296", "0.62322056", "0.62099445", "0.62085867", "0.61946166", "0.6186229", "0.6184985", "0.6113809", "0.61071354", "0.607834", "0.60699105", "0.60695696", "0.6057211", "0.6045962", "0.60429907", "0.60382897", "0.60353506", "0.60293597", "0.60249734", "0.60249734", "0.6003861", "0.59925264", "0.59851354", "0.5981958", "0.5971235", "0.59654146", "0.5956394", "0.5954954", "0.59467655", "0.5943181", "0.59406894", "0.5934949", "0.59334964", "0.5933489", "0.59330845", "0.5923994", "0.5914914", "0.5905427", "0.59033763", "0.58931255", "0.589252", "0.588916", "0.5885403", "0.588367", "0.58815855", "0.5875839", "0.5871046", "0.5870211", "0.58602977", "0.58595175", "0.5859075", "0.5851182", "0.58360946", "0.58357024", "0.58344203", "0.58119303", "0.5806831", "0.57838786", "0.57643384", "0.57499975", "0.5749419", "0.5747708", "0.5744995", "0.57438505", "0.5742333", "0.5739662", "0.5739662", "0.5739662", "0.5734078", "0.5732296", "0.57311195", "0.57298535", "0.57298535", "0.57298535" ]
0.0
-1
Display a listing of the resource.
public function index() { $samples = $this->sampleService->getAll(); return view('samples.index',compact('samples')) ->with('i', (request()->input('page', 1) - 1) * Config::get('constants.paginate')); }
{ "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 view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\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 $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\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 }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\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 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 permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function 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 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 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.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1